mirror of
https://github.com/gwm17/glfw.git
synced 2024-11-26 20:28:49 -05:00
Formatting.
This commit is contained in:
parent
dcc3e72d39
commit
8ac54e8b14
|
@ -37,31 +37,22 @@
|
||||||
static int compareVideoModes(const void* firstPtr, const void* secondPtr)
|
static int compareVideoModes(const void* firstPtr, const void* secondPtr)
|
||||||
{
|
{
|
||||||
int firstBPP, secondBPP, firstSize, secondSize;
|
int firstBPP, secondBPP, firstSize, secondSize;
|
||||||
GLFWvidmode* first = (GLFWvidmode*) firstPtr;
|
const GLFWvidmode* first = firstPtr;
|
||||||
GLFWvidmode* second = (GLFWvidmode*) secondPtr;
|
const GLFWvidmode* second = secondPtr;
|
||||||
|
|
||||||
// First sort on color bits per pixel
|
// First sort on color bits per pixel
|
||||||
|
firstBPP = first->redBits + first->greenBits + first->blueBits;
|
||||||
firstBPP = first->redBits +
|
secondBPP = second->redBits + second->greenBits + second->blueBits;
|
||||||
first->greenBits +
|
|
||||||
first->blueBits;
|
|
||||||
secondBPP = second->redBits +
|
|
||||||
second->greenBits +
|
|
||||||
second->blueBits;
|
|
||||||
|
|
||||||
if (firstBPP != secondBPP)
|
if (firstBPP != secondBPP)
|
||||||
return firstBPP - secondBPP;
|
return firstBPP - secondBPP;
|
||||||
|
|
||||||
// Then sort on screen area, in pixels
|
// Then sort on screen area, in pixels
|
||||||
|
|
||||||
firstSize = first->width * first->height;
|
firstSize = first->width * first->height;
|
||||||
secondSize = second->width * second->height;
|
secondSize = second->width * second->height;
|
||||||
|
|
||||||
if (firstSize != secondSize)
|
if (firstSize != secondSize)
|
||||||
return firstSize - secondSize;
|
return firstSize - secondSize;
|
||||||
|
|
||||||
// Lastly sort on refresh rate
|
// Lastly sort on refresh rate
|
||||||
|
|
||||||
return first->refreshRate - second->refreshRate;
|
return first->refreshRate - second->refreshRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user