mirror of
https://github.com/glfw/glfw.git
synced 2026-09-22 16:52:57 +00:00
Cleanup
This is an extract of a commit, minimally edited to ensure it compiles. Closes #1078. Related to #197.
This commit is contained in:
committed by
Camilla Löwy
parent
ac009a5f5c
commit
93e66661d3
+7
-6
@@ -85,7 +85,7 @@ static int choosePixelFormat(_GLFWwindow* window,
|
||||
_GLFWfbconfig* u = usableConfigs + usableCount;
|
||||
PIXELFORMATDESCRIPTOR pfd;
|
||||
|
||||
if (window->transparent) {
|
||||
if (fbconfig->transparent) {
|
||||
if (!DescribePixelFormat(window->context.wgl.dc,
|
||||
n,
|
||||
sizeof(PIXELFORMATDESCRIPTOR),
|
||||
@@ -168,7 +168,7 @@ static int choosePixelFormat(_GLFWwindow* window,
|
||||
{
|
||||
// Get pixel format attributes through legacy PFDs
|
||||
|
||||
if (!window->transparent && DescribePixelFormat(window->context.wgl.dc,
|
||||
if (!fbconfig->transparent && DescribePixelFormat(window->context.wgl.dc,
|
||||
n,
|
||||
sizeof(PIXELFORMATDESCRIPTOR),
|
||||
&pfd))
|
||||
@@ -217,8 +217,7 @@ static int choosePixelFormat(_GLFWwindow* window,
|
||||
}
|
||||
// Reiterate the selection loop without looking for transparency supporting
|
||||
// formats if no matching pixelformat for a transparent window were found.
|
||||
if (window->transparent && !usableCount) {
|
||||
window->transparent = GLFW_FALSE;
|
||||
if (fbconfig->transparent && !usableCount) {
|
||||
free(usableConfigs);
|
||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||
"WGL: No pixel format found for transparent window. Ignoring transparency.");
|
||||
@@ -803,10 +802,12 @@ GLFWbool _glfwCreateContextWGL(_GLFWwindow* window,
|
||||
}
|
||||
}
|
||||
|
||||
if (window->transparent)
|
||||
if (fbconfig->transparent)
|
||||
{
|
||||
if (!setupTransparentWindow(window))
|
||||
window->transparent = GLFW_FALSE;
|
||||
_glfwInputErrorWin32(GLFW_PLATFORM_ERROR,
|
||||
"WGL: Failed to setup window as transparent as requested");
|
||||
|
||||
}
|
||||
|
||||
window->context.makeCurrent = makeContextCurrentWGL;
|
||||
|
||||
Reference in New Issue
Block a user