Changeset View
Changeset View
Standalone View
Standalone View
source/tools/atlas/GameInterface/Handlers/GraphicsSetupHandlers.cpp
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | MESSAGEHANDLER(Init) | ||||
} | } | ||||
// Initialise some graphics state for Atlas. | // Initialise some graphics state for Atlas. | ||||
// (This must be done after Init loads the config DB, | // (This must be done after Init loads the config DB, | ||||
// but before the UI constructs its GL canvases.) | // but before the UI constructs its GL canvases.) | ||||
g_VideoMode.InitNonSDL(); | g_VideoMode.InitNonSDL(); | ||||
} | } | ||||
MESSAGEHANDLER(MakeCurrent) | |||||
{ | |||||
UNUSED2(msg); | |||||
SDL_GL_MakeCurrent(SDL_GL_GetCurrentWindow(), SDL_GL_GetCurrentContext()); | |||||
} | |||||
MESSAGEHANDLER(InitSDL) | MESSAGEHANDLER(InitSDL) | ||||
{ | { | ||||
UNUSED2(msg); | UNUSED2(msg); | ||||
// When using GLX (Linux), SDL has to load the GL library to find | // When using GLX (Linux), SDL has to load the GL library to find | ||||
// glXGetProcAddressARB before it can load any extensions. | // glXGetProcAddressARB before it can load any extensions. | ||||
// When running in Atlas, we skip the SDL video initialisation code | // When running in Atlas, we skip the SDL video initialisation code | ||||
// which loads the library, and so SDL_GL_GetProcAddress fails (in | // which loads the library, and so SDL_GL_GetProcAddress fails (in | ||||
Show All 14 Lines | MESSAGEHANDLER(InitGraphics) | ||||
ogl_Init(); | ogl_Init(); | ||||
InitGraphics(g_AtlasGameLoop->args, g_InitFlags, {}); | InitGraphics(g_AtlasGameLoop->args, g_InitFlags, {}); | ||||
#if OS_WIN | #if OS_WIN | ||||
// HACK (to stop things looking very ugly when scrolling) - should | // HACK (to stop things looking very ugly when scrolling) - should | ||||
// use proper config system. | // use proper config system. | ||||
if(ogl_HaveExtension("WGL_EXT_swap_control")) | SDL_GL_SetSwapInterval(1); | ||||
pwglSwapIntervalEXT(1); | |||||
#endif | #endif | ||||
} | } | ||||
MESSAGEHANDLER(Shutdown) | MESSAGEHANDLER(Shutdown) | ||||
{ | { | ||||
UNUSED2(msg); | UNUSED2(msg); | ||||
▲ Show 20 Lines • Show All 101 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator