Replace GLFW with SDL3
Since I plan to use SDL3 API, I had to replace GLFW window and surface creation with SDL3 variant. For now it's working fine.
This commit is contained in:
1 parent
393b59ad5d
commit
1b5cc7a79c
9 files changed
+43
-91
No files matched your search
@@ -1,3 +1,4 @@
|
||||
#include <SDL3/SDL_events.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
@@ -157,13 +158,14 @@ static rse_err_t create_framebuffers(struct graphics_context_t* context)
|
||||
*/
|
||||
void recreate_swapchain(struct graphics_context_t* context)
|
||||
{
|
||||
SDL_Event event;
|
||||
int width = 0;
|
||||
int height = 0;
|
||||
|
||||
glfwGetFramebufferSize(context->window_handle, &width, &height);
|
||||
SDL_GetWindowSizeInPixels(context->window_handle, &width, &height);
|
||||
while (width == 0 || height == 0) {
|
||||
glfwGetFramebufferSize(context->window_handle, &width, &height);
|
||||
glfwWaitEvents();
|
||||
SDL_GetWindowSizeInPixels(context->window_handle, &width, &height);
|
||||
SDL_WaitEvent(&event);
|
||||
}
|
||||
|
||||
vkDeviceWaitIdle(context->device);
|
||||
|
||||
Reference in new issue
Block a user