Fixes vsync setting ignored when using a separate thread for rendering

Setting the vsync in the main thread, after the rendering thread starts
and takes the OpenGL context fails, so we need to do that before.
Also, for some reason, the main thread cannot make current the context
anymore.

Fixes #13447
This commit is contained in:
Stefano Bonicatti
2017-12-08 17:58:28 +01:00
parent 146bdf031d
commit c067cf2c6a
7 changed files with 12 additions and 4 deletions

View File

@ -92,14 +92,16 @@ public:
bool resizable;
bool borderless_window;
bool maximized;
bool use_vsync;
float get_aspect() const { return (float)width / (float)height; }
VideoMode(int p_width = 1024, int p_height = 600, bool p_fullscreen = false, bool p_resizable = true, bool p_borderless_window = false, bool p_maximized = false) {
VideoMode(int p_width = 1024, int p_height = 600, bool p_fullscreen = false, bool p_resizable = true, bool p_borderless_window = false, bool p_maximized = false, bool p_use_vsync = false) {
width = p_width;
height = p_height;
fullscreen = p_fullscreen;
resizable = p_resizable;
borderless_window = p_borderless_window;
maximized = p_maximized;
use_vsync = p_use_vsync;
}
};