assets/linux/simple2d/src/window.c in ruby2d-0.9.3 vs assets/linux/simple2d/src/window.c in ruby2d-0.9.4
- old
+ new
@@ -89,10 +89,16 @@
// Set Up OpenGL /////////////////////////////////////////////////////////////
S2D_GL_Init(window);
+ // SDL 2.0.10 and macOS 10.15 fix ////////////////////////////////////////////
+
+ #if MACOS
+ SDL_SetWindowSize(window->sdl, window->width, window->height);
+ #endif
+
// Set Main Loop Data ////////////////////////////////////////////////////////
const Uint8 *key_state;
Uint32 frames = 0; // Total frames since start
@@ -311,9 +317,14 @@
// Call update and render callbacks
if (window->update) window->update();
if (window->render) window->render();
// Draw Frame //////////////////////////////////////////////////////////////
+
+ // Render and flush all OpenGL buffers
+ S2D_GL_FlushBuffers();
+
+ // Swap buffers to display drawn contents in the window
SDL_GL_SwapWindow(window->sdl);
}
return 0;
}