Changeset View
Changeset View
Standalone View
Standalone View
source/ps/VideoMode.cpp
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | |||||
} // anonymous namespace | } // anonymous namespace | ||||
#if OS_WIN | #if OS_WIN | ||||
// We can't include wutil directly because GL headers conflict with Windows | // We can't include wutil directly because GL headers conflict with Windows | ||||
// until we use a proper GL loader. | // until we use a proper GL loader. | ||||
extern void wutil_SetAppWindow(SDL_Window* window); | extern void wutil_SetAppWindow(SDL_Window* window); | ||||
// Todo: Should Return HDC, not sure how to do it without including windows.h | |||||
extern void wutil_GetAppHDC(SDL_Window* window); | |||||
// After a proper HiDPI integration we should switch to manifest until | // After a proper HiDPI integration we should switch to manifest until | ||||
// SDL has an implemented HiDPI on Windows. | // SDL has an implemented HiDPI on Windows. | ||||
extern void wutil_EnableHiDPIOnWindows(); | extern void wutil_EnableHiDPIOnWindows(); | ||||
#endif | #endif | ||||
CVideoMode g_VideoMode; | CVideoMode g_VideoMode; | ||||
class CVideoMode::CCursor | class CVideoMode::CCursor | ||||
▲ Show 20 Lines • Show All 379 Lines • ▼ Show 20 Lines | #endif | ||||
// If this atexit hook is called before SDL_Quit destroys the OpenGL context, | // If this atexit hook is called before SDL_Quit destroys the OpenGL context, | ||||
// some kind of double-free problem causes a crash and lockup in the driver. | // some kind of double-free problem causes a crash and lockup in the driver. | ||||
// Calling SDL_Quit twice appears to be harmless, though, and avoids the problem | // Calling SDL_Quit twice appears to be harmless, though, and avoids the problem | ||||
// by destroying the context *before* the driver's atexit hook is called. | // by destroying the context *before* the driver's atexit hook is called. | ||||
// (Note that atexit hooks are guaranteed to be called in reverse order of their registration.) | // (Note that atexit hooks are guaranteed to be called in reverse order of their registration.) | ||||
atexit(SDL_Quit); | atexit(SDL_Quit); | ||||
// End work around. | // End work around. | ||||
ogl_Init(); // required after each mode change | ogl_Init(SDL_GL_GetProcAddress); // required after each mode change | ||||
// (TODO: does that mean we need to call this when toggling fullscreen later?) | // (TODO: does that mean we need to call this when toggling fullscreen later?) | ||||
m_IsInitialised = true; | m_IsInitialised = true; | ||||
if (!m_ConfigFullscreen) | if (!m_ConfigFullscreen) | ||||
{ | { | ||||
m_WindowedW = w; | m_WindowedW = w; | ||||
m_WindowedH = h; | m_WindowedH = h; | ||||
▲ Show 20 Lines • Show All 288 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator