34 #if defined(_GLFW_USE_HYBRID_HPG) || defined(_GLFW_USE_OPTIMUS_HPG) 40 __declspec(dllexport) DWORD NvOptimusEnablement = 1;
46 __declspec(dllexport)
int AmdPowerXpressRequestHighPerformance = 1;
48 #endif // _GLFW_USE_HYBRID_HPG 50 #if defined(_GLFW_BUILD_DLL) 54 BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason,
LPVOID reserved)
59 #endif // _GLFW_BUILD_DLL 65 _glfw.win32.winmm.instance = LoadLibraryW(L
"winmm.dll");
66 if (!
_glfw.win32.winmm.instance)
69 "Win32: Failed to load winmm.dll");
74 GetProcAddress(
_glfw.win32.winmm.instance,
"joyGetDevCapsW");
76 GetProcAddress(
_glfw.win32.winmm.instance,
"joyGetPos");
78 GetProcAddress(
_glfw.win32.winmm.instance,
"joyGetPosEx");
80 GetProcAddress(
_glfw.win32.winmm.instance,
"timeGetTime");
82 if (!
_glfw.win32.winmm.joyGetDevCaps ||
83 !
_glfw.win32.winmm.joyGetPos ||
84 !
_glfw.win32.winmm.joyGetPosEx ||
85 !
_glfw.win32.winmm.timeGetTime)
88 "Win32: Failed to load winmm functions");
92 _glfw.win32.user32.instance = LoadLibraryW(L
"user32.dll");
93 if (
_glfw.win32.user32.instance)
96 GetProcAddress(
_glfw.win32.user32.instance,
"SetProcessDPIAware");
98 GetProcAddress(
_glfw.win32.user32.instance,
"ChangeWindowMessageFilterEx");
101 _glfw.win32.dwmapi.instance = LoadLibraryW(L
"dwmapi.dll");
102 if (
_glfw.win32.dwmapi.instance)
105 GetProcAddress(
_glfw.win32.dwmapi.instance,
"DwmIsCompositionEnabled");
107 GetProcAddress(
_glfw.win32.dwmapi.instance,
"DwmFlush");
117 if (
_glfw.win32.winmm.instance)
118 FreeLibrary(
_glfw.win32.winmm.instance);
120 if (
_glfw.win32.user32.instance)
121 FreeLibrary(
_glfw.win32.user32.instance);
123 if (
_glfw.win32.dwmapi.instance)
124 FreeLibrary(
_glfw.win32.dwmapi.instance);
131 memset(
_glfw.win32.publicKeys, -1,
sizeof(
_glfw.win32.publicKeys));
282 length = MultiByteToWideChar(CP_UTF8, 0, source, -1, NULL, 0);
286 target = calloc(length,
sizeof(WCHAR));
288 if (!MultiByteToWideChar(CP_UTF8, 0, source, -1, target, length))
304 length = WideCharToMultiByte(CP_UTF8, 0, source, -1, NULL, 0, NULL, NULL);
308 target = calloc(length,
sizeof(
char));
310 if (!WideCharToMultiByte(CP_UTF8, 0, source, -1, target, length, NULL, NULL))
329 SystemParametersInfoW(SPI_GETFOREGROUNDLOCKTIMEOUT, 0,
330 &
_glfw.win32.foregroundLockTimeout, 0);
331 SystemParametersInfoW(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, UIntToPtr(0),
359 SystemParametersInfoW(SPI_SETFOREGROUNDLOCKTIMEOUT, 0,
360 UIntToPtr(
_glfw.win32.foregroundLockTimeout),
363 free(
_glfw.win32.clipboardString);
373 #if defined(_GLFW_WGL) 375 #elif defined(_GLFW_EGL) 378 #if defined(__MINGW32__) 380 #elif defined(_MSC_VER) 383 #if defined(_GLFW_USE_HYBRID_HPG) || defined(_GLFW_USE_OPTIMUS_HPG) 386 #if defined(_GLFW_BUILD_DLL) #define GLFW_KEY_SCROLL_LOCK
static void createKeyTables(void)
#define GLFW_KEY_RIGHT_CONTROL
#define GLFW_KEY_KP_DIVIDE
#define _GLFW_VERSION_NUMBER
#define GLFW_KEY_SEMICOLON
#define GLFW_KEY_GRAVE_ACCENT
void _glfwTerminateContextAPI(void)
#define GLFW_KEY_LEFT_SHIFT
#define GLFW_KEY_PAGE_DOWN
#define GLFW_KEY_LEFT_BRACKET
GLenum GLenum GLsizei const GLuint GLboolean enabled
_GLFWlibrary _glfw
All global data protected by _glfwInitialized. This should only be touched after a call to glfwInit t...
#define GLFW_KEY_BACKSPACE
#define GLFW_KEY_KP_DECIMAL
void _glfwInitJoysticks(void)
#define GLFW_KEY_RIGHT_SUPER
typedef GLboolean(APIENTRYP PFNGLISQUERYPROC)(GLuint id)
#define GLFW_PLATFORM_ERROR
A platform-specific error occurred that does not match any of the more specific categories.
#define GLFW_KEY_CAPS_LOCK
#define GLFW_KEY_KP_MULTIPLY
#define GLFW_KEY_NUM_LOCK
static GLboolean initLibraries(void)
void _glfwTerminateJoysticks(void)
typedef BOOL(WINAPI *PFNWGLSAVEBUFFERREGIONARBPROC)(HANDLE hRegion
static void terminateLibraries(void)
#define GLFW_KEY_RIGHT_BRACKET
#define GLFW_KEY_KP_ENTER
#define GLFW_KEY_KP_SUBTRACT
#define GLFW_KEY_RIGHT_ALT
GLsizei GLsizei GLchar * source
#define GLFW_KEY_PRINT_SCREEN
#define GLFW_KEY_LEFT_CONTROL
GLuint GLsizei GLsizei * length
void _glfwInputError(int error, const char *format,...)
Notifies shared code of an error.
typedef LPVOID(WINAPI *PFNWGLCREATEIMAGEBUFFERI3DPROC)(HDC hDC
#define GLFW_KEY_LEFT_ALT
BOOL _glfwIsCompositionEnabled(void)
#define GLFW_KEY_RIGHT_SHIFT
char * _glfwCreateUTF8FromWideString(const WCHAR *source)
#define GLFW_KEY_BACKSLASH
#define GLFW_KEY_APOSTROPHE
int _glfwInitContextAPI(void)
#define GLFW_KEY_LEFT_SUPER
WCHAR * _glfwCreateWideStringFromUTF8(const char *source)