Changeset View
Changeset View
Standalone View
Standalone View
source/tools/atlas/GameInterface/Handlers/GraphicsSetupHandlers.cpp
Show First 20 Lines • Show All 56 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(InitSDL) | |||||
{ | |||||
UNUSED2(msg); | |||||
// When using GLX (Linux), SDL has to load the GL library to find | |||||
// glXGetProcAddressARB before it can load any extensions. | |||||
// When running in Atlas, we skip the SDL video initialisation code | |||||
// which loads the library, and so SDL_GL_GetProcAddress fails (in | |||||
// ogl.cpp importExtensionFunctions). | |||||
// (TODO: I think this is meant to be context-independent, i.e. it | |||||
// doesn't matter that we're getting extensions from SDL-initialised | |||||
// GL stuff instead of from the wxWidgets-initialised GL stuff, but that | |||||
// should be checked.) | |||||
// So, make sure it's loaded: | |||||
historic_bruno: Doesn't most of this comment still apply? I'm not sure if the TODO is resolved either, nobody… | |||||
Done Inline ActionsOur engine uses SDL_GL_GetProcAddress to load all GL libraries, even if wxWidget load OpenGL, our engine isn't going to use because our engine is waiting we load OpenGL with SDL_GL_LoadLibrary. trompetin17: Our engine uses SDL_GL_GetProcAddress to load all GL libraries, even if wxWidget load OpenGL… | |||||
SDL_InitSubSystem(SDL_INIT_VIDEO); | |||||
SDL_GL_LoadLibrary(NULL); // NULL = use default | |||||
// (it shouldn't hurt if this is called multiple times, I think) | |||||
} | |||||
MESSAGEHANDLER(InitGraphics) | MESSAGEHANDLER(InitGraphics) | ||||
{ | { | ||||
UNUSED2(msg); | UNUSED2(msg); | ||||
ogl_Init(); | ogl_Init(); | ||||
InitGraphics(g_AtlasGameLoop->args, g_InitFlags, {}); | InitGraphics(g_AtlasGameLoop->args, g_InitFlags, {}); | ||||
▲ Show 20 Lines • Show All 114 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
Doesn't most of this comment still apply? I'm not sure if the TODO is resolved either, nobody seems to know for certain.