mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-20 09:57:10 +00:00
meowww
This commit is contained in:
parent
d9dbb5c39c
commit
5baab016fa
|
|
@ -70,6 +70,9 @@ static void onFramebufferResize(int w, int h)
|
||||||
::glViewport(0, 0, w, h);
|
::glViewport(0, 0, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// V-Sync
|
||||||
|
|
||||||
|
|
||||||
// Initialize OpenGL & The SDL window.
|
// Initialize OpenGL & The SDL window.
|
||||||
void C4JRender::Initialise()
|
void C4JRender::Initialise()
|
||||||
{
|
{
|
||||||
|
|
@ -121,8 +124,14 @@ void C4JRender::Initialise()
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SDL_GL_SetSwapInterval(0); // V-Sync Off Please.
|
|
||||||
|
|
||||||
|
// 4JCraft VSync/V-Sync
|
||||||
|
#ifdef ENABLE_VSYNC
|
||||||
|
SDL_GL_SetSwapInterval(1); // V-Sync On Please.
|
||||||
|
#else
|
||||||
|
SDL_GL_SetSwapInterval(0); // V-Sync Off Please.
|
||||||
|
#endif
|
||||||
|
|
||||||
int fw, fh; SDL_GetWindowSize(s_window, &fw, &fh); onFramebufferResize(fw, fh);
|
int fw, fh; SDL_GetWindowSize(s_window, &fw, &fh); onFramebufferResize(fw, fh);
|
||||||
|
|
||||||
// We initialize the OpenGL states. Touching those values makes some funny artifacts appear.
|
// We initialize the OpenGL states. Touching those values makes some funny artifacts appear.
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,12 @@ global_cpp_defs = [
|
||||||
'-DDEBUG',
|
'-DDEBUG',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
if get_option('enable_vsync')
|
||||||
|
global_cpp_defs += '-DENABLE_VSYNC'
|
||||||
|
message('v-sync enabled')
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
if host_machine.system() == 'linux'
|
if host_machine.system() == 'linux'
|
||||||
global_cpp_defs += [
|
global_cpp_defs += [
|
||||||
'-Dlinux',
|
'-Dlinux',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue