Index: source/lib/sysdep/os/win/wgl.h =================================================================== --- source/lib/sysdep/os/win/wgl.h +++ source/lib/sysdep/os/win/wgl.h @@ -72,21 +72,3 @@ DECLARE_HANDLE(HDC); DECLARE_HANDLE(HGLRC); #endif - -// VC6 doesn't define wchar_t as built-in type -#ifndef _WCHAR_T_DEFINED -typedef unsigned short wchar_t; // for glu.h -#define _WCHAR_T_DEFINED -#endif - -WINGDIAPI BOOL WINAPI wglCopyContext(HGLRC, HGLRC, UINT); -WINGDIAPI HGLRC WINAPI wglCreateContext(HDC); -WINGDIAPI HGLRC WINAPI wglCreateLayerContext(HDC, int); -WINGDIAPI BOOL WINAPI wglDeleteContext(HGLRC); -WINGDIAPI HGLRC WINAPI wglGetCurrentContext(); -WINGDIAPI HDC WINAPI wglGetCurrentDC(); -WINGDIAPI PROC WINAPI wglGetProcAddress(LPCSTR); -WINGDIAPI BOOL WINAPI wglMakeCurrent(HDC, HGLRC); -WINGDIAPI BOOL WINAPI wglShareLists(HGLRC, HGLRC); -WINGDIAPI BOOL WINAPI wglUseFontBitmapsA(HDC, DWORD, DWORD, DWORD); -WINGDIAPI BOOL WINAPI wglUseFontBitmapsW(HDC, DWORD, DWORD, DWORD); Index: source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp =================================================================== --- source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp +++ source/tools/atlas/AtlasUI/ScenarioEditor/ScenarioEditor.cpp @@ -49,6 +49,8 @@ #include "Tools/Common/Brushes.h" #include "Tools/Common/MiscState.h" +#include + static HighResTimer g_Timer; /** @@ -562,7 +564,7 @@ // The canvas' context gets made current on creation; but it can only be // current for one thread at a time, and it needs to be current for the // thread that is doing the draw calls, so disable it for this one. - wglMakeCurrent(NULL, NULL); + POST_MESSAGE(MakeCurrent, ()); #elif defined(__WXGTK__) || defined(__WXOSX__) || defined(__WXMAC__) // Need to make sure the canvas is realised, so that its context is valid // this solves the "invalid drawable" error Index: source/tools/atlas/GameInterface/Handlers/GraphicsSetupHandlers.cpp =================================================================== --- source/tools/atlas/GameInterface/Handlers/GraphicsSetupHandlers.cpp +++ source/tools/atlas/GameInterface/Handlers/GraphicsSetupHandlers.cpp @@ -61,6 +61,13 @@ g_VideoMode.InitNonSDL(); } +MESSAGEHANDLER(MakeCurrent) +{ + UNUSED2(msg); + SDL_GL_MakeCurrent(SDL_GL_GetCurrentWindow(), SDL_GL_GetCurrentContext()); +} + + MESSAGEHANDLER(InitSDL) { UNUSED2(msg); @@ -91,8 +98,7 @@ #if OS_WIN // HACK (to stop things looking very ugly when scrolling) - should // use proper config system. - if(ogl_HaveExtension("WGL_EXT_swap_control")) - pwglSwapIntervalEXT(1); + SDL_GL_SetSwapInterval(1); #endif } Index: source/tools/atlas/GameInterface/Messages.h =================================================================== --- source/tools/atlas/GameInterface/Messages.h +++ source/tools/atlas/GameInterface/Messages.h @@ -44,6 +44,8 @@ // and before much else. MESSAGE(InitGraphics, ); +MESSAGE(MakeCurrent, ); + // Shut down engine/graphics code. MESSAGE(Shutdown, );