Made GLFWvidmode members camel case.
This commit is contained in:
parent
9a7166926c
commit
af10b06439
@ -28,8 +28,8 @@ int main( void )
|
||||
// Show desktop video mode
|
||||
glfwGetDesktopMode( &dtmode );
|
||||
printf( "Desktop mode: %d x %d x %d\n\n",
|
||||
dtmode.Width, dtmode.Height, dtmode.RedBits +
|
||||
dtmode.GreenBits + dtmode.BlueBits );
|
||||
dtmode.width, dtmode.height, dtmode.redBits +
|
||||
dtmode.greenBits + dtmode.blueBits );
|
||||
|
||||
// List available video modes
|
||||
modecount = glfwGetVideoModes( modes, MAX_NUM_MODES );
|
||||
@ -37,8 +37,8 @@ int main( void )
|
||||
for( i = 0; i < modecount; i ++ )
|
||||
{
|
||||
printf( "%3d: %d x %d x %d\n", i,
|
||||
modes[i].Width, modes[i].Height, modes[i].RedBits +
|
||||
modes[i].GreenBits + modes[i].BlueBits );
|
||||
modes[i].width, modes[i].height, modes[i].redBits +
|
||||
modes[i].greenBits + modes[i].blueBits );
|
||||
}
|
||||
|
||||
// Terminate GLFW
|
||||
|
@ -359,8 +359,8 @@ extern "C" {
|
||||
|
||||
/* The video mode structure used by glfwGetVideoModes() */
|
||||
typedef struct {
|
||||
int Width, Height;
|
||||
int RedBits, BlueBits, GreenBits;
|
||||
int width, height;
|
||||
int redBits, blueBits, greenBits;
|
||||
} GLFWvidmode;
|
||||
|
||||
/* Function pointer types */
|
||||
|
@ -38,14 +38,14 @@
|
||||
static int _glfwVideoModesEqual( GLFWvidmode* first,
|
||||
GLFWvidmode* second )
|
||||
{
|
||||
if( first->Width != second->Width )
|
||||
if( first->width != second->width )
|
||||
return 0;
|
||||
|
||||
if( first->Height != second->Height )
|
||||
if( first->height != second->height )
|
||||
return 0;
|
||||
|
||||
if( first->RedBits + first->GreenBits + first->BlueBits !=
|
||||
second->RedBits + second->GreenBits + second->BlueBits )
|
||||
if( first->redBits + first->greenBits + first->blueBits !=
|
||||
second->redBits + second->greenBits + second->blueBits )
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
@ -62,18 +62,18 @@ static void _glfwCGToGLFWVideoMode( CFDictionaryRef cgMode,
|
||||
|
||||
CFNumberGetValue( CFDictionaryGetValue( cgMode, kCGDisplayWidth ),
|
||||
kCFNumberIntType,
|
||||
&(glfwMode->Width) );
|
||||
&(glfwMode->width) );
|
||||
CFNumberGetValue( CFDictionaryGetValue( cgMode, kCGDisplayHeight ),
|
||||
kCFNumberIntType,
|
||||
&(glfwMode->Height) );
|
||||
&(glfwMode->height) );
|
||||
|
||||
CFNumberGetValue( CFDictionaryGetValue( cgMode, kCGDisplayBitsPerSample ),
|
||||
kCFNumberIntType,
|
||||
&bitsPerSample );
|
||||
|
||||
glfwMode->RedBits = bitsPerSample;
|
||||
glfwMode->GreenBits = bitsPerSample;
|
||||
glfwMode->BlueBits = bitsPerSample;
|
||||
glfwMode->redBits = bitsPerSample;
|
||||
glfwMode->greenBits = bitsPerSample;
|
||||
glfwMode->blueBits = bitsPerSample;
|
||||
}
|
||||
|
||||
//========================================================================
|
||||
@ -98,7 +98,7 @@ int _glfwPlatformGetVideoModes( GLFWvidmode *list, int maxcount )
|
||||
&mode );
|
||||
|
||||
// Is it a valid mode? (only list depths >= 15 bpp)
|
||||
if( mode.RedBits + mode.GreenBits + mode.BlueBits < 15 )
|
||||
if( mode.redBits + mode.greenBits + mode.blueBits < 15 )
|
||||
continue;
|
||||
|
||||
// Check for duplicate of current mode in target list
|
||||
|
@ -57,11 +57,11 @@ static GLFWvidmode vidmodeFromCGDisplayMode( NSDictionary *mode )
|
||||
unsigned int bps = [[mode objectForKey:(id)kCGDisplayBitsPerSample] unsignedIntValue];
|
||||
|
||||
GLFWvidmode result;
|
||||
result.Width = width;
|
||||
result.Height = height;
|
||||
result.RedBits = bps;
|
||||
result.GreenBits = bps;
|
||||
result.BlueBits = bps;
|
||||
result.width = width;
|
||||
result.height = height;
|
||||
result.redBits = bps;
|
||||
result.greenBits = bps;
|
||||
result.blueBits = bps;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
// Get a list of available video modes
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI int glfwGetVideoModes(GLFWvidmode *list, int maxcount)
|
||||
GLFWAPI int glfwGetVideoModes(GLFWvidmode* list, int maxcount)
|
||||
{
|
||||
int count, i, swap, res1, res2, depth1, depth2;
|
||||
GLFWvidmode vm;
|
||||
@ -56,11 +56,11 @@ GLFWAPI int glfwGetVideoModes(GLFWvidmode *list, int maxcount)
|
||||
swap = 0;
|
||||
for (i = 0; i < count - 1; i++)
|
||||
{
|
||||
res1 = list[i].Width*list[i].Height;
|
||||
depth1 = list[i].RedBits+list[i].GreenBits+list[i].BlueBits;
|
||||
res2 = list[i + 1].Width*list[i + 1].Height;
|
||||
depth2 = list[i + 1].RedBits+list[i + 1].GreenBits+
|
||||
list[i + 1].BlueBits;
|
||||
res1 = list[i].width*list[i].height;
|
||||
depth1 = list[i].redBits+list[i].greenBits+list[i].blueBits;
|
||||
res2 = list[i + 1].width*list[i + 1].height;
|
||||
depth2 = list[i + 1].redBits+list[i + 1].greenBits+
|
||||
list[i + 1].blueBits;
|
||||
|
||||
if ((depth2 < depth1) || ((depth2 == depth1) && (res2 < res1)))
|
||||
{
|
||||
@ -81,7 +81,7 @@ GLFWAPI int glfwGetVideoModes(GLFWvidmode *list, int maxcount)
|
||||
// Get the desktop video mode
|
||||
//========================================================================
|
||||
|
||||
GLFWAPI void glfwGetDesktopMode(GLFWvidmode *mode)
|
||||
GLFWAPI void glfwGetDesktopMode(GLFWvidmode* mode)
|
||||
{
|
||||
if (!_glfwInitialized || mode == NULL)
|
||||
return;
|
||||
|
@ -258,9 +258,9 @@ int _glfwPlatformGetVideoModes( GLFWvidmode *list, int maxcount )
|
||||
for( i = 0; i < count; i ++ )
|
||||
{
|
||||
// Mode "code" for already listed mode
|
||||
bpp = list[i].RedBits + list[i].GreenBits +
|
||||
list[i].BlueBits;
|
||||
m2 = (bpp << 25) | (list[i].Width * list[i].Height);
|
||||
bpp = list[i].redBits + list[i].greenBits +
|
||||
list[i].blueBits;
|
||||
m2 = (bpp << 25) | (list[i].width * list[i].height);
|
||||
if( m1 <= m2 )
|
||||
{
|
||||
break;
|
||||
@ -270,11 +270,11 @@ int _glfwPlatformGetVideoModes( GLFWvidmode *list, int maxcount )
|
||||
// New entry at the end of the list?
|
||||
if( i >= count )
|
||||
{
|
||||
list[count].Width = dm.dmPelsWidth;
|
||||
list[count].Height = dm.dmPelsHeight;
|
||||
list[count].RedBits = r;
|
||||
list[count].GreenBits = g;
|
||||
list[count].BlueBits = b;
|
||||
list[count].width = dm.dmPelsWidth;
|
||||
list[count].height = dm.dmPelsHeight;
|
||||
list[count].redBits = r;
|
||||
list[count].greenBits = g;
|
||||
list[count].blueBits = b;
|
||||
count ++;
|
||||
}
|
||||
// Insert new entry in the list?
|
||||
@ -284,11 +284,11 @@ int _glfwPlatformGetVideoModes( GLFWvidmode *list, int maxcount )
|
||||
{
|
||||
list[j] = list[j-1];
|
||||
}
|
||||
list[i].Width = dm.dmPelsWidth;
|
||||
list[i].Height = dm.dmPelsHeight;
|
||||
list[i].RedBits = r;
|
||||
list[i].GreenBits = g;
|
||||
list[i].BlueBits = b;
|
||||
list[i].width = dm.dmPelsWidth;
|
||||
list[i].height = dm.dmPelsHeight;
|
||||
list[i].redBits = r;
|
||||
list[i].greenBits = g;
|
||||
list[i].blueBits = b;
|
||||
count ++;
|
||||
}
|
||||
}
|
||||
@ -313,8 +313,8 @@ void _glfwPlatformGetDesktopMode( GLFWvidmode *mode )
|
||||
(void) EnumDisplaySettings( NULL, ENUM_REGISTRY_SETTINGS, &dm );
|
||||
|
||||
// Return desktop mode parameters
|
||||
mode->Width = dm.dmPelsWidth;
|
||||
mode->Height = dm.dmPelsHeight;
|
||||
bpp2rgb( dm.dmBitsPerPel, &mode->RedBits, &mode->GreenBits, &mode->BlueBits );
|
||||
mode->width = dm.dmPelsWidth;
|
||||
mode->height = dm.dmPelsHeight;
|
||||
bpp2rgb( dm.dmBitsPerPel, &mode->redBits, &mode->greenBits, &mode->blueBits );
|
||||
}
|
||||
|
||||
|
@ -471,11 +471,11 @@ int _glfwPlatformGetVideoModes(GLFWvidmode* list, int maxcount)
|
||||
{
|
||||
for (l = 0; l < rescount && count < maxcount; l++)
|
||||
{
|
||||
list[count].Width = resarray[l].width;
|
||||
list[count].Height = resarray[l].height;
|
||||
list[count].RedBits = (rgbarray[k] >> 16) & 255;
|
||||
list[count].GreenBits = (rgbarray[k] >> 8) & 255;
|
||||
list[count].BlueBits = rgbarray[k] & 255;
|
||||
list[count].width = resarray[l].width;
|
||||
list[count].height = resarray[l].height;
|
||||
list[count].redBits = (rgbarray[k] >> 16) & 255;
|
||||
list[count].greenBits = (rgbarray[k] >> 8) & 255;
|
||||
list[count].blueBits = rgbarray[k] & 255;
|
||||
count++;
|
||||
}
|
||||
}
|
||||
@ -511,15 +511,15 @@ void _glfwPlatformGetDesktopMode(GLFWvidmode* mode)
|
||||
bpp = DefaultDepth(dpy, screen);
|
||||
|
||||
// Convert BPP to RGB bits
|
||||
BPP2RGB(bpp, &mode->RedBits, &mode->GreenBits, &mode->BlueBits);
|
||||
BPP2RGB(bpp, &mode->redBits, &mode->greenBits, &mode->blueBits);
|
||||
|
||||
#if defined(_GLFW_HAS_XRANDR)
|
||||
if (_glfwLibrary.XRandR.available)
|
||||
{
|
||||
if (_glfwWin.FS.modeChanged)
|
||||
{
|
||||
mode->Width = _glfwWin.FS.oldWidth;
|
||||
mode->Height = _glfwWin.FS.oldHeight;
|
||||
mode->width = _glfwWin.FS.oldWidth;
|
||||
mode->height = _glfwWin.FS.oldHeight;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -529,8 +529,8 @@ void _glfwPlatformGetDesktopMode(GLFWvidmode* mode)
|
||||
if (_glfwWin.FS.modeChanged)
|
||||
{
|
||||
// The old (desktop) mode is stored in _glfwWin.FS.oldMode
|
||||
mode->Width = _glfwWin.FS.oldMode.hdisplay;
|
||||
mode->Height = _glfwWin.FS.oldMode.vdisplay;
|
||||
mode->width = _glfwWin.FS.oldMode.hdisplay;
|
||||
mode->height = _glfwWin.FS.oldMode.vdisplay;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -538,8 +538,8 @@ void _glfwPlatformGetDesktopMode(GLFWvidmode* mode)
|
||||
XF86VidModeGetAllModeLines(dpy, screen, &modecount, &modelist);
|
||||
|
||||
// The first mode in the list is the current (desktio) mode
|
||||
mode->Width = modelist[0]->hdisplay;
|
||||
mode->Height = modelist[0]->vdisplay;
|
||||
mode->width = modelist[0]->hdisplay;
|
||||
mode->height = modelist[0]->vdisplay;
|
||||
|
||||
// Free list
|
||||
XFree(modelist);
|
||||
@ -550,7 +550,7 @@ void _glfwPlatformGetDesktopMode(GLFWvidmode* mode)
|
||||
#endif
|
||||
|
||||
// Get current display width and height
|
||||
mode->Width = DisplayWidth(dpy, screen);
|
||||
mode->Height = DisplayHeight(dpy, screen);
|
||||
mode->width = DisplayWidth(dpy, screen);
|
||||
mode->height = DisplayHeight(dpy, screen);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user