Skip to content
Snippets Groups Projects
Commit 3795d78b authored by Camilla Löwy's avatar Camilla Löwy
Browse files

Clean up DLL loading

parent a407a673
No related branches found
No related tags found
No related merge requests found
...@@ -65,8 +65,7 @@ static GLFWbool initLibraries(void) ...@@ -65,8 +65,7 @@ static GLFWbool initLibraries(void)
_glfw.win32.winmm.instance = LoadLibraryW(L"winmm.dll"); _glfw.win32.winmm.instance = LoadLibraryW(L"winmm.dll");
if (!_glfw.win32.winmm.instance) if (!_glfw.win32.winmm.instance)
{ {
_glfwInputError(GLFW_PLATFORM_ERROR, _glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Failed to load winmm.dll");
"Win32: Failed to load winmm.dll");
return GLFW_FALSE; return GLFW_FALSE;
} }
...@@ -79,24 +78,17 @@ static GLFWbool initLibraries(void) ...@@ -79,24 +78,17 @@ static GLFWbool initLibraries(void)
_glfw.win32.winmm.timeGetTime = (TIMEGETTIME_T) _glfw.win32.winmm.timeGetTime = (TIMEGETTIME_T)
GetProcAddress(_glfw.win32.winmm.instance, "timeGetTime"); GetProcAddress(_glfw.win32.winmm.instance, "timeGetTime");
if (!_glfw.win32.winmm.joyGetDevCaps || _glfw.win32.user32.instance = LoadLibraryW(L"user32.dll");
!_glfw.win32.winmm.joyGetPos || if (!_glfw.win32.user32.instance)
!_glfw.win32.winmm.joyGetPosEx ||
!_glfw.win32.winmm.timeGetTime)
{ {
_glfwInputError(GLFW_PLATFORM_ERROR, _glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Failed to load user32.dll");
"Win32: Failed to load winmm functions");
return GLFW_FALSE; return GLFW_FALSE;
} }
_glfw.win32.user32.instance = LoadLibraryW(L"user32.dll");
if (_glfw.win32.user32.instance)
{
_glfw.win32.user32.SetProcessDPIAware = (SETPROCESSDPIAWARE_T) _glfw.win32.user32.SetProcessDPIAware = (SETPROCESSDPIAWARE_T)
GetProcAddress(_glfw.win32.user32.instance, "SetProcessDPIAware"); GetProcAddress(_glfw.win32.user32.instance, "SetProcessDPIAware");
_glfw.win32.user32.ChangeWindowMessageFilterEx = (CHANGEWINDOWMESSAGEFILTEREX_T) _glfw.win32.user32.ChangeWindowMessageFilterEx = (CHANGEWINDOWMESSAGEFILTEREX_T)
GetProcAddress(_glfw.win32.user32.instance, "ChangeWindowMessageFilterEx"); GetProcAddress(_glfw.win32.user32.instance, "ChangeWindowMessageFilterEx");
}
_glfw.win32.dwmapi.instance = LoadLibraryW(L"dwmapi.dll"); _glfw.win32.dwmapi.instance = LoadLibraryW(L"dwmapi.dll");
if (_glfw.win32.dwmapi.instance) if (_glfw.win32.dwmapi.instance)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment