mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 20:11:58 +00:00
Move DWM enabled test to file where it is used
This commit is contained in:
parent
72632a846b
commit
75f1dfaf8a
@ -265,6 +265,21 @@ static GLFWbool choosePixelFormat(_GLFWwindow* window,
|
||||
return GLFW_TRUE;
|
||||
}
|
||||
|
||||
// Returns whether desktop compositing is enabled
|
||||
//
|
||||
static GLFWbool isCompositionEnabled(void)
|
||||
{
|
||||
BOOL enabled;
|
||||
|
||||
if (!_glfw_DwmIsCompositionEnabled)
|
||||
return FALSE;
|
||||
|
||||
if (_glfw_DwmIsCompositionEnabled(&enabled) != S_OK)
|
||||
return FALSE;
|
||||
|
||||
return enabled;
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
////// GLFW internal API //////
|
||||
@ -595,7 +610,7 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window)
|
||||
void _glfwPlatformSwapBuffers(_GLFWwindow* window)
|
||||
{
|
||||
// HACK: Use DwmFlush when desktop composition is enabled
|
||||
if (_glfwIsCompositionEnabled() && !window->monitor)
|
||||
if (isCompositionEnabled() && !window->monitor)
|
||||
{
|
||||
int count = abs(window->context.wgl.interval);
|
||||
while (count--)
|
||||
|
@ -290,21 +290,6 @@ static HWND createHelperWindow(void)
|
||||
////// GLFW internal API //////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Returns whether desktop compositing is enabled
|
||||
//
|
||||
BOOL _glfwIsCompositionEnabled(void)
|
||||
{
|
||||
BOOL enabled;
|
||||
|
||||
if (!_glfw_DwmIsCompositionEnabled)
|
||||
return FALSE;
|
||||
|
||||
if (_glfw_DwmIsCompositionEnabled(&enabled) != S_OK)
|
||||
return FALSE;
|
||||
|
||||
return enabled;
|
||||
}
|
||||
|
||||
// Returns a wide string version of the specified UTF-8 string
|
||||
//
|
||||
WCHAR* _glfwCreateWideStringFromUTF8(const char* source)
|
||||
|
@ -262,8 +262,6 @@ typedef struct _GLFWtimeWin32
|
||||
GLFWbool _glfwRegisterWindowClass(void);
|
||||
void _glfwUnregisterWindowClass(void);
|
||||
|
||||
BOOL _glfwIsCompositionEnabled(void);
|
||||
|
||||
WCHAR* _glfwCreateWideStringFromUTF8(const char* source);
|
||||
char* _glfwCreateUTF8FromWideString(const WCHAR* source);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user