1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-27 04:28:52 -05:00

Made fbconfig conversion more readable.

This commit is contained in:
Camilla Berglund 2012-06-03 16:54:06 +02:00
parent 01551e332d
commit bc8860dc6a

View File

@ -185,7 +185,7 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
for (i = 1; i <= available; i++) for (i = 1; i <= available; i++)
{ {
_GLFWfbconfig* fbconfig = fbconfigs + *found; _GLFWfbconfig* f = fbconfigs + *found;
if (window->WGL.ARB_pixel_format) if (window->WGL.ARB_pixel_format)
{ {
@ -209,41 +209,26 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
continue; continue;
} }
fbconfig->redBits = f->redBits = getPixelFormatAttrib(window, i, WGL_RED_BITS_ARB);
getPixelFormatAttrib(window, i, WGL_RED_BITS_ARB); f->greenBits = getPixelFormatAttrib(window, i, WGL_GREEN_BITS_ARB);
fbconfig->greenBits = f->blueBits = getPixelFormatAttrib(window, i, WGL_BLUE_BITS_ARB);
getPixelFormatAttrib(window, i, WGL_GREEN_BITS_ARB); f->alphaBits = getPixelFormatAttrib(window, i, WGL_ALPHA_BITS_ARB);
fbconfig->blueBits =
getPixelFormatAttrib(window, i, WGL_BLUE_BITS_ARB);
fbconfig->alphaBits =
getPixelFormatAttrib(window, i, WGL_ALPHA_BITS_ARB);
fbconfig->depthBits = f->depthBits = getPixelFormatAttrib(window, i, WGL_DEPTH_BITS_ARB);
getPixelFormatAttrib(window, i, WGL_DEPTH_BITS_ARB); f->stencilBits = getPixelFormatAttrib(window, i, WGL_STENCIL_BITS_ARB);
fbconfig->stencilBits =
getPixelFormatAttrib(window, i, WGL_STENCIL_BITS_ARB);
fbconfig->accumRedBits = f->accumRedBits = getPixelFormatAttrib(window, i, WGL_ACCUM_RED_BITS_ARB);
getPixelFormatAttrib(window, i, WGL_ACCUM_RED_BITS_ARB); f->accumGreenBits = getPixelFormatAttrib(window, i, WGL_ACCUM_GREEN_BITS_ARB);
fbconfig->accumGreenBits = f->accumBlueBits = getPixelFormatAttrib(window, i, WGL_ACCUM_BLUE_BITS_ARB);
getPixelFormatAttrib(window, i, WGL_ACCUM_GREEN_BITS_ARB); f->accumAlphaBits = getPixelFormatAttrib(window, i, WGL_ACCUM_ALPHA_BITS_ARB);
fbconfig->accumBlueBits =
getPixelFormatAttrib(window, i, WGL_ACCUM_BLUE_BITS_ARB);
fbconfig->accumAlphaBits =
getPixelFormatAttrib(window, i, WGL_ACCUM_ALPHA_BITS_ARB);
fbconfig->auxBuffers = f->auxBuffers = getPixelFormatAttrib(window, i, WGL_AUX_BUFFERS_ARB);
getPixelFormatAttrib(window, i, WGL_AUX_BUFFERS_ARB); f->stereo = getPixelFormatAttrib(window, i, WGL_STEREO_ARB);
fbconfig->stereo =
getPixelFormatAttrib(window, i, WGL_STEREO_ARB);
if (window->WGL.ARB_multisample) if (window->WGL.ARB_multisample)
{ f->samples = getPixelFormatAttrib(window, i, WGL_SAMPLES_ARB);
fbconfig->samples =
getPixelFormatAttrib(window, i, WGL_SAMPLES_ARB);
}
else else
fbconfig->samples = 0; f->samples = 0;
} }
else else
{ {
@ -273,27 +258,27 @@ static _GLFWfbconfig* getFBConfigs(_GLFWwindow* window, unsigned int* found)
if (pfd.iPixelType != PFD_TYPE_RGBA) if (pfd.iPixelType != PFD_TYPE_RGBA)
continue; continue;
fbconfig->redBits = pfd.cRedBits; f->redBits = pfd.cRedBits;
fbconfig->greenBits = pfd.cGreenBits; f->greenBits = pfd.cGreenBits;
fbconfig->blueBits = pfd.cBlueBits; f->blueBits = pfd.cBlueBits;
fbconfig->alphaBits = pfd.cAlphaBits; f->alphaBits = pfd.cAlphaBits;
fbconfig->depthBits = pfd.cDepthBits; f->depthBits = pfd.cDepthBits;
fbconfig->stencilBits = pfd.cStencilBits; f->stencilBits = pfd.cStencilBits;
fbconfig->accumRedBits = pfd.cAccumRedBits; f->accumRedBits = pfd.cAccumRedBits;
fbconfig->accumGreenBits = pfd.cAccumGreenBits; f->accumGreenBits = pfd.cAccumGreenBits;
fbconfig->accumBlueBits = pfd.cAccumBlueBits; f->accumBlueBits = pfd.cAccumBlueBits;
fbconfig->accumAlphaBits = pfd.cAccumAlphaBits; f->accumAlphaBits = pfd.cAccumAlphaBits;
fbconfig->auxBuffers = pfd.cAuxBuffers; f->auxBuffers = pfd.cAuxBuffers;
fbconfig->stereo = (pfd.dwFlags & PFD_STEREO) ? GL_TRUE : GL_FALSE; f->stereo = (pfd.dwFlags & PFD_STEREO) ? GL_TRUE : GL_FALSE;
// PFD pixel formats do not support FSAA // PFD pixel formats do not support FSAA
fbconfig->samples = 0; f->samples = 0;
} }
fbconfig->platformID = i; f->platformID = i;
(*found)++; (*found)++;
} }