mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 12:02:00 +00:00
Clean up DLL loading
This commit is contained in:
parent
a407a673dd
commit
3795d78b14
@ -65,8 +65,7 @@ static GLFWbool initLibraries(void)
|
||||
_glfw.win32.winmm.instance = LoadLibraryW(L"winmm.dll");
|
||||
if (!_glfw.win32.winmm.instance)
|
||||
{
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
"Win32: Failed to load winmm.dll");
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Failed to load winmm.dll");
|
||||
return GLFW_FALSE;
|
||||
}
|
||||
|
||||
@ -79,24 +78,17 @@ static GLFWbool initLibraries(void)
|
||||
_glfw.win32.winmm.timeGetTime = (TIMEGETTIME_T)
|
||||
GetProcAddress(_glfw.win32.winmm.instance, "timeGetTime");
|
||||
|
||||
if (!_glfw.win32.winmm.joyGetDevCaps ||
|
||||
!_glfw.win32.winmm.joyGetPos ||
|
||||
!_glfw.win32.winmm.joyGetPosEx ||
|
||||
!_glfw.win32.winmm.timeGetTime)
|
||||
_glfw.win32.user32.instance = LoadLibraryW(L"user32.dll");
|
||||
if (!_glfw.win32.user32.instance)
|
||||
{
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
"Win32: Failed to load winmm functions");
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR, "Win32: Failed to load user32.dll");
|
||||
return GLFW_FALSE;
|
||||
}
|
||||
|
||||
_glfw.win32.user32.instance = LoadLibraryW(L"user32.dll");
|
||||
if (_glfw.win32.user32.instance)
|
||||
{
|
||||
_glfw.win32.user32.SetProcessDPIAware = (SETPROCESSDPIAWARE_T)
|
||||
GetProcAddress(_glfw.win32.user32.instance, "SetProcessDPIAware");
|
||||
_glfw.win32.user32.ChangeWindowMessageFilterEx = (CHANGEWINDOWMESSAGEFILTEREX_T)
|
||||
GetProcAddress(_glfw.win32.user32.instance, "ChangeWindowMessageFilterEx");
|
||||
}
|
||||
_glfw.win32.user32.SetProcessDPIAware = (SETPROCESSDPIAWARE_T)
|
||||
GetProcAddress(_glfw.win32.user32.instance, "SetProcessDPIAware");
|
||||
_glfw.win32.user32.ChangeWindowMessageFilterEx = (CHANGEWINDOWMESSAGEFILTEREX_T)
|
||||
GetProcAddress(_glfw.win32.user32.instance, "ChangeWindowMessageFilterEx");
|
||||
|
||||
_glfw.win32.dwmapi.instance = LoadLibraryW(L"dwmapi.dll");
|
||||
if (_glfw.win32.dwmapi.instance)
|
||||
|
Loading…
Reference in New Issue
Block a user