Add HAVE_DYNAMIC ifdefs

This commit is contained in:
twinaphex 2018-01-24 02:12:58 +01:00
parent cf97ff3824
commit 63ad668ff0
2 changed files with 14 additions and 4 deletions

View File

@ -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;

View File

@ -84,7 +84,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>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)</PreprocessorDefinitions>
<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)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\gfx\include\dxsdk;$(SolutionDir)\..\..\gfx\include;$(SolutionDir)\..\..\libretro-common\include;$(SolutionDir)\..\..\deps;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@ -98,7 +98,7 @@
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>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)</PreprocessorDefinitions>
<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)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\gfx\include\dxsdk;$(SolutionDir)\..\..\gfx\include;$(SolutionDir)\..\..\libretro-common\include;$(SolutionDir)\..\..\deps;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@ -114,7 +114,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>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)</PreprocessorDefinitions>
<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)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\gfx\include\dxsdk;$(SolutionDir)\..\..\gfx\include;$(SolutionDir)\..\..\libretro-common\include;$(SolutionDir)\..\..\deps;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
@ -132,7 +132,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>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)</PreprocessorDefinitions>
<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)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(SolutionDir)\..\..\gfx\include\dxsdk;$(SolutionDir)\..\..\gfx\include;$(SolutionDir)\..\..\libretro-common\include;$(SolutionDir)\..\..\deps;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>