Add SDL_Window to initGraphicsContext prototype
This value is needed for vulkan to properly allocate a surface, and would benefit OpenGL to move more of its initialization code into here rather than in `emulator.cpp`.
This commit is contained in:
@@ -45,7 +45,7 @@ void RendererGL::reset() {
|
||||
}
|
||||
}
|
||||
|
||||
void RendererGL::initGraphicsContext() {
|
||||
void RendererGL::initGraphicsContext(SDL_Window* window) {
|
||||
gl.reset();
|
||||
|
||||
auto gl_resources = cmrc::RendererGL::get_filesystem();
|
||||
|
||||
@@ -5,7 +5,7 @@ RendererNull::~RendererNull() {}
|
||||
|
||||
void RendererNull::reset() {}
|
||||
void RendererNull::display() {}
|
||||
void RendererNull::initGraphicsContext() {}
|
||||
void RendererNull::initGraphicsContext(SDL_Window* window) {}
|
||||
void RendererNull::clearBuffer(u32 startAddress, u32 endAddress, u32 value, u32 control) {}
|
||||
void RendererNull::displayTransfer(u32 inputAddr, u32 outputAddr, u32 inputSize, u32 outputSize, u32 flags) {}
|
||||
void RendererNull::drawVertices(PICA::PrimType primType, std::span<const PICA::Vertex> vertices) {}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "renderer_vk/renderer_vk.hpp"
|
||||
|
||||
#include "SDL_vulkan.h"
|
||||
#include "helpers.hpp"
|
||||
#include "renderer_vk/vk_debug.hpp"
|
||||
|
||||
@@ -11,7 +12,7 @@ void RendererVK::reset() {}
|
||||
|
||||
void RendererVK::display() {}
|
||||
|
||||
void RendererVK::initGraphicsContext() {
|
||||
void RendererVK::initGraphicsContext(SDL_Window* window) {
|
||||
// Resolve all function pointers
|
||||
static vk::DynamicLoader dl;
|
||||
VULKAN_HPP_DEFAULT_DISPATCHER.init(dl.getProcAddress<PFN_vkGetInstanceProcAddr>("vkGetInstanceProcAddr"));
|
||||
@@ -129,6 +130,9 @@ void RendererVK::initGraphicsContext() {
|
||||
|
||||
// Initialize device-specific function pointers
|
||||
VULKAN_HPP_DEFAULT_DISPATCHER.init(device.get());
|
||||
|
||||
VkSurfaceKHR surface;
|
||||
SDL_Vulkan_CreateSurface(window, instance.get(), &surface);
|
||||
}
|
||||
|
||||
void RendererVK::clearBuffer(u32 startAddress, u32 endAddress, u32 value, u32 control) {}
|
||||
|
||||
Reference in New Issue
Block a user