diff --git a/gfx/drivers_context/wgl_ctx.c b/gfx/drivers_context/wgl_ctx.c index 7da01152eb..b745d13c19 100644 --- a/gfx/drivers_context/wgl_ctx.c +++ b/gfx/drivers_context/wgl_ctx.c @@ -100,7 +100,9 @@ static unsigned win32_minor = 0; static unsigned win32_interval = 0; static enum gfx_ctx_api win32_api = GFX_CTX_NONE; +#ifdef HAVE_DYNAMIC static dylib_t dll_handle = NULL; /* Handle to OpenGL32.dll */ +#endif static gfx_ctx_proc_t gfx_ctx_wgl_get_proc_address(const char *symbol) { @@ -119,7 +121,11 @@ static gfx_ctx_proc_t gfx_ctx_wgl_get_proc_address(const char *symbol) break; } +#ifdef HAVE_DYNAMIC return (gfx_ctx_proc_t)GetProcAddress((HINSTANCE)dll_handle, symbol); +#else + return NULL; +#endif } #if defined(HAVE_OPENGL) @@ -461,7 +467,9 @@ static void *gfx_ctx_wgl_init(video_frame_info_t *video_info, void *video_driver if (g_inited) return NULL; +#ifdef HAVE_DYNAMIC dll_handle = dylib_load("OpenGL32.dll"); +#endif win32_window_reset(); win32_monitor_init(); @@ -545,7 +553,9 @@ static void gfx_ctx_wgl_destroy(void *data) g_restore_desktop = false; } +#ifdef HAVE_DYNAMIC dylib_close(dll_handle); +#endif win32_core_hw_context_enable = false; g_inited = false; diff --git a/pkg/msvc/msvc-2013/RetroArch-msvc2013.vcxproj b/pkg/msvc/msvc-2013/RetroArch-msvc2013.vcxproj index 9e382fae2b..d65b5fb367 100644 --- a/pkg/msvc/msvc-2013/RetroArch-msvc2013.vcxproj +++ b/pkg/msvc/msvc-2013/RetroArch-msvc2013.vcxproj @@ -84,7 +84,7 @@ Level3 Disabled - WIN32;HAVE_MENU;HAVE_XMB;HAVE_RGUI;HAVE_MATERIALUI;_DEBUG;_WINDOWS;HAVE_XAUDIO;HAVE_DSOUND;HAVE_DINPUT;HAVE_D3D;HAVE_D3D9;HAVE_GL;HAVE_GLSL;HAVE_THREADS;%(PreprocessorDefinitions) + WIN32;HAVE_MENU;HAVE_XMB;HAVE_RGUI;HAVE_MATERIALUI;_DEBUG;_WINDOWS;HAVE_XAUDIO;HAVE_DSOUND;HAVE_DINPUT;HAVE_D3D;HAVE_D3D9;HAVE_OPENGL;HAVE_GLSL;HAVE_THREADS;%(PreprocessorDefinitions) $(SolutionDir)\..\..\gfx\include\dxsdk;$(SolutionDir)\..\..\gfx\include;$(SolutionDir)\..\..\libretro-common\include;$(SolutionDir)\..\..\deps;%(AdditionalIncludeDirectories) @@ -98,7 +98,7 @@ Level3 Disabled - WIN32;HAVE_MENU;HAVE_XMB;HAVE_RGUI;HAVE_MATERIALUI;_DEBUG;_WINDOWS;HAVE_XAUDIO;HAVE_DSOUND;HAVE_DINPUT;HAVE_D3D;HAVE_D3D9;HAVE_GL;HAVE_GLSL;HAVE_THREADS;%(PreprocessorDefinitions) + WIN32;HAVE_MENU;HAVE_XMB;HAVE_RGUI;HAVE_MATERIALUI;_DEBUG;_WINDOWS;HAVE_XAUDIO;HAVE_DSOUND;HAVE_DINPUT;HAVE_D3D;HAVE_D3D9;HAVE_OPENGL;HAVE_GLSL;HAVE_THREADS;%(PreprocessorDefinitions) $(SolutionDir)\..\..\gfx\include\dxsdk;$(SolutionDir)\..\..\gfx\include;$(SolutionDir)\..\..\libretro-common\include;$(SolutionDir)\..\..\deps;%(AdditionalIncludeDirectories) @@ -114,7 +114,7 @@ MaxSpeed true true - WIN32;HAVE_MENU;HAVE_XMB;HAVE_RGUI;HAVE_MATERIALUI;NDEBUG;_WINDOWS;HAVE_XAUDIO;HAVE_DSOUND;HAVE_DINPUT;HAVE_D3D;HAVE_D3D9;HAVE_GL;HAVE_GLSL;HAVE_THREADS;%(PreprocessorDefinitions) + WIN32;HAVE_MENU;HAVE_XMB;HAVE_RGUI;HAVE_MATERIALUI;NDEBUG;_WINDOWS;HAVE_XAUDIO;HAVE_DSOUND;HAVE_DINPUT;HAVE_D3D;HAVE_D3D9;HAVE_OPENGL;HAVE_GLSL;HAVE_THREADS;%(PreprocessorDefinitions) $(SolutionDir)\..\..\gfx\include\dxsdk;$(SolutionDir)\..\..\gfx\include;$(SolutionDir)\..\..\libretro-common\include;$(SolutionDir)\..\..\deps;%(AdditionalIncludeDirectories) @@ -132,7 +132,7 @@ MaxSpeed true true - WIN32;HAVE_MENU;HAVE_XMB;HAVE_RGUI;HAVE_MATERIALUI;NDEBUG;_WINDOWS;HAVE_XAUDIO;HAVE_DSOUND;HAVE_DINPUT;HAVE_D3D;HAVE_D3D9;HAVE_GL;HAVE_GLSL;HAVE_THREADS;%(PreprocessorDefinitions) + WIN32;HAVE_MENU;HAVE_XMB;HAVE_RGUI;HAVE_MATERIALUI;NDEBUG;_WINDOWS;HAVE_XAUDIO;HAVE_DSOUND;HAVE_DINPUT;HAVE_D3D;HAVE_D3D9;HAVE_OPENGL;HAVE_GLSL;HAVE_THREADS;%(PreprocessorDefinitions) $(SolutionDir)\..\..\gfx\include\dxsdk;$(SolutionDir)\..\..\gfx\include;$(SolutionDir)\..\..\libretro-common\include;$(SolutionDir)\..\..\deps;%(AdditionalIncludeDirectories)