This is laying some groundwork for a much better way of determining the best GFX api to use at runtime, and making it easier to support more GFX backends in the future.
18 lines
No EOL
542 B
C++
18 lines
No EOL
542 B
C++
#include "platform.hpp"
|
|
|
|
#include <SDL.h>
|
|
#include <SDL_vulkan.h>
|
|
|
|
extern std::vector<SDL_Window*> windows;
|
|
|
|
SDL_Window* get_window(platform::window_ptr index);
|
|
|
|
void* create_vulkan_surface(platform::window_ptr window, void* surface_creation_info) {
|
|
auto vulkan_surface_info = (vulkan_surface_creation_info*)surface_creation_info;
|
|
auto window_ptr = get_window(window);
|
|
|
|
auto vk_surface = new vulkan_surface();
|
|
SDL_Vulkan_CreateSurface(window_ptr, vulkan_surface_info->instance, &vk_surface->surface);
|
|
|
|
return vk_surface;
|
|
} |