mirror of
https://github.com/glfw/glfw.git
synced 2024-11-22 21:14:35 +00:00
Cleanup
This commit is contained in:
parent
e250c226ca
commit
1b82546b90
@ -55,13 +55,11 @@ static int getPixelFormatAttrib(_GLFWwindow* window, int pixelFormat, int attrib
|
|||||||
|
|
||||||
// Return a list of available and usable framebuffer configs
|
// Return a list of available and usable framebuffer configs
|
||||||
//
|
//
|
||||||
static GLFWbool choosePixelFormat(_GLFWwindow* window,
|
static int choosePixelFormat(_GLFWwindow* window, const _GLFWfbconfig* desired)
|
||||||
const _GLFWfbconfig* desired,
|
|
||||||
int* result)
|
|
||||||
{
|
{
|
||||||
_GLFWfbconfig* usableConfigs;
|
_GLFWfbconfig* usableConfigs;
|
||||||
const _GLFWfbconfig* closest;
|
const _GLFWfbconfig* closest;
|
||||||
int i, nativeCount, usableCount;
|
int i, pixelFormat, nativeCount, usableCount;
|
||||||
|
|
||||||
if (_glfw.wgl.ARB_pixel_format)
|
if (_glfw.wgl.ARB_pixel_format)
|
||||||
{
|
{
|
||||||
@ -197,7 +195,7 @@ static GLFWbool choosePixelFormat(_GLFWwindow* window,
|
|||||||
"WGL: The driver does not appear to support OpenGL");
|
"WGL: The driver does not appear to support OpenGL");
|
||||||
|
|
||||||
free(usableConfigs);
|
free(usableConfigs);
|
||||||
return GLFW_FALSE;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
closest = _glfwChooseFBConfig(desired, usableConfigs, usableCount);
|
closest = _glfwChooseFBConfig(desired, usableConfigs, usableCount);
|
||||||
@ -207,13 +205,13 @@ static GLFWbool choosePixelFormat(_GLFWwindow* window,
|
|||||||
"WGL: Failed to find a suitable pixel format");
|
"WGL: Failed to find a suitable pixel format");
|
||||||
|
|
||||||
free(usableConfigs);
|
free(usableConfigs);
|
||||||
return GLFW_FALSE;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
*result = (int) closest->handle;
|
pixelFormat = (int) closest->handle;
|
||||||
free(usableConfigs);
|
free(usableConfigs);
|
||||||
|
|
||||||
return GLFW_TRUE;
|
return pixelFormat;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns whether desktop compositing is enabled
|
// Returns whether desktop compositing is enabled
|
||||||
@ -471,7 +469,7 @@ GLFWbool _glfwCreateContextWGL(_GLFWwindow* window,
|
|||||||
const _GLFWfbconfig* fbconfig)
|
const _GLFWfbconfig* fbconfig)
|
||||||
{
|
{
|
||||||
int attribs[40];
|
int attribs[40];
|
||||||
int pixelFormat = 0;
|
int pixelFormat;
|
||||||
PIXELFORMATDESCRIPTOR pfd;
|
PIXELFORMATDESCRIPTOR pfd;
|
||||||
HGLRC share = NULL;
|
HGLRC share = NULL;
|
||||||
|
|
||||||
@ -489,7 +487,8 @@ GLFWbool _glfwCreateContextWGL(_GLFWwindow* window,
|
|||||||
return GLFW_FALSE;
|
return GLFW_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!choosePixelFormat(window, fbconfig, &pixelFormat))
|
pixelFormat = choosePixelFormat(window, fbconfig);
|
||||||
|
if (!pixelFormat)
|
||||||
return GLFW_FALSE;
|
return GLFW_FALSE;
|
||||||
|
|
||||||
if (!DescribePixelFormat(window->context.wgl.dc,
|
if (!DescribePixelFormat(window->context.wgl.dc,
|
||||||
|
Loading…
Reference in New Issue
Block a user