summaryrefslogtreecommitdiff
path: root/Source/Core/DolphinWX/GLInterface/WGL.cpp
diff options
context:
space:
mode:
authorRyan Houdek <Sonicadvance1@Gmail.com>2014-01-18 14:10:24 +0000
committerRyan Houdek <Sonicadvance1@Gmail.com>2014-01-18 14:10:24 +0000
commitbea484e12f98f67eafafeb8db6d3181020fdfb46 (patch)
tree06ae3284c8693861d3a8a5965d1a4217ecfbeab5 /Source/Core/DolphinWX/GLInterface/WGL.cpp
parent839df31347cd1331c5426c2eae549371d7ae160f (diff)
Move Win32 specific function grabbing fallback to WGL.cpp. Fixes issue 6964.
Diffstat (limited to 'Source/Core/DolphinWX/GLInterface/WGL.cpp')
-rw-r--r--Source/Core/DolphinWX/GLInterface/WGL.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/Source/Core/DolphinWX/GLInterface/WGL.cpp b/Source/Core/DolphinWX/GLInterface/WGL.cpp
index 8bc9e7a73a..afc67da431 100644
--- a/Source/Core/DolphinWX/GLInterface/WGL.cpp
+++ b/Source/Core/DolphinWX/GLInterface/WGL.cpp
@@ -13,6 +13,7 @@
#include "EmuWindow.h"
static HDC hDC = NULL; // Private GDI Device Context
static HGLRC hRC = NULL; // Permanent Rendering Context
+static HINSTANCE dllHandle = NULL; // Handle to OpenGL32.dll
// typedef from wglext.h
typedef BOOL(WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
@@ -32,7 +33,10 @@ void cInterfaceWGL::Swap()
void* cInterfaceWGL::GetProcAddress(std::string name)
{
- return (void*)wglGetProcAddress((LPCSTR)name.c_str());
+ void* func = (void*)wglGetProcAddress((LPCSTR)name.c_str());
+ if (func == NULL)
+ func = (void*)GetProcAddress(dllHandle, (LPCSTR)name.c_str());
+ return func;
}
// Draw messages on top of the screen
@@ -69,6 +73,10 @@ bool cInterfaceWGL::Create(void *&window_handle)
s_backbuffer_width = _twidth;
s_backbuffer_height = _theight;
+#ifdef _WIN32
+ dllHandle = LoadLibrary(TEXT("OpenGL32.dll"));
+#endif
+
window_handle = (void*)EmuWindow::Create((HWND)window_handle, GetModuleHandle(0), _T("Please wait..."));
if (window_handle == NULL)
{