| | |
| | | /* |
| | | Simple DirectMedia Layer |
| | | Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org> |
| | | Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org> |
| | | |
| | | This software is provided 'as-is', without any express or implied |
| | | warranty. In no event will the authors be held liable for any damages |
| | |
| | | #include "SDL_windowsvideo.h" |
| | | #include "SDL_windowsframebuffer.h" |
| | | #include "SDL_windowsshape.h" |
| | | #include "SDL_windowsvulkan.h" |
| | | |
| | | /* Initialization/Query functions */ |
| | | static int WIN_VideoInit(_THIS); |
| | |
| | | SDL_bool g_WindowsEnableMessageLoop = SDL_TRUE; |
| | | SDL_bool g_WindowFrameUsableWhileCursorHidden = SDL_TRUE; |
| | | |
| | | static void UpdateWindowsEnableMessageLoop(void *userdata, const char *name, const char *oldValue, const char *newValue) |
| | | static void SDLCALL |
| | | UpdateWindowsEnableMessageLoop(void *userdata, const char *name, const char *oldValue, const char *newValue) |
| | | { |
| | | if (newValue && *newValue == '0') { |
| | | g_WindowsEnableMessageLoop = SDL_FALSE; |
| | |
| | | } |
| | | } |
| | | |
| | | static void UpdateWindowFrameUsableWhileCursorHidden(void *userdata, const char *name, const char *oldValue, const char *newValue) |
| | | static void SDLCALL |
| | | UpdateWindowFrameUsableWhileCursorHidden(void *userdata, const char *name, const char *oldValue, const char *newValue) |
| | | { |
| | | if (newValue && *newValue == '0') { |
| | | g_WindowFrameUsableWhileCursorHidden = SDL_FALSE; |
| | |
| | | data->CloseTouchInputHandle = (BOOL (WINAPI *)(HTOUCHINPUT)) SDL_LoadFunction(data->userDLL, "CloseTouchInputHandle"); |
| | | data->GetTouchInputInfo = (BOOL (WINAPI *)(HTOUCHINPUT, UINT, PTOUCHINPUT, int)) SDL_LoadFunction(data->userDLL, "GetTouchInputInfo"); |
| | | data->RegisterTouchWindow = (BOOL (WINAPI *)(HWND, ULONG)) SDL_LoadFunction(data->userDLL, "RegisterTouchWindow"); |
| | | } else { |
| | | SDL_ClearError(); |
| | | } |
| | | |
| | | data->shcoreDLL = SDL_LoadObject("SHCORE.DLL"); |
| | | if (data->shcoreDLL) { |
| | | data->GetDpiForMonitor = (HRESULT (WINAPI *)(HMONITOR, MONITOR_DPI_TYPE, UINT *, UINT *)) SDL_LoadFunction(data->shcoreDLL, "GetDpiForMonitor"); |
| | | } else { |
| | | SDL_ClearError(); |
| | | } |
| | | |
| | | /* Set the function pointers */ |
| | |
| | | device->SetDisplayMode = WIN_SetDisplayMode; |
| | | device->PumpEvents = WIN_PumpEvents; |
| | | |
| | | #undef CreateWindow |
| | | device->CreateWindow = WIN_CreateWindow; |
| | | device->CreateWindowFrom = WIN_CreateWindowFrom; |
| | | device->CreateSDLWindow = WIN_CreateWindow; |
| | | device->CreateSDLWindowFrom = WIN_CreateWindowFrom; |
| | | device->SetWindowTitle = WIN_SetWindowTitle; |
| | | device->SetWindowIcon = WIN_SetWindowIcon; |
| | | device->SetWindowPosition = WIN_SetWindowPosition; |
| | | device->SetWindowSize = WIN_SetWindowSize; |
| | | device->GetWindowBordersSize = WIN_GetWindowBordersSize; |
| | | device->SetWindowOpacity = WIN_SetWindowOpacity; |
| | | device->ShowWindow = WIN_ShowWindow; |
| | | device->HideWindow = WIN_HideWindow; |
| | |
| | | device->GL_SwapWindow = WIN_GLES_SwapWindow; |
| | | device->GL_DeleteContext = WIN_GLES_DeleteContext; |
| | | #endif |
| | | #if SDL_VIDEO_VULKAN |
| | | device->Vulkan_LoadLibrary = WIN_Vulkan_LoadLibrary; |
| | | device->Vulkan_UnloadLibrary = WIN_Vulkan_UnloadLibrary; |
| | | device->Vulkan_GetInstanceExtensions = WIN_Vulkan_GetInstanceExtensions; |
| | | device->Vulkan_CreateSurface = WIN_Vulkan_CreateSurface; |
| | | #endif |
| | | |
| | | device->StartTextInput = WIN_StartTextInput; |
| | | device->StopTextInput = WIN_StopTextInput; |
| | | device->SetTextInputRect = WIN_SetTextInputRect; |