mirror of
https://github.com/glfw/glfw.git
synced 2026-09-23 09:08:58 +00:00
Formatting pass (no code changes).
This commit is contained in:
+27
-28
@@ -39,7 +39,7 @@
|
||||
// Dynamically load libraries
|
||||
//========================================================================
|
||||
|
||||
static void initLibraries( void )
|
||||
static void initLibraries(void)
|
||||
{
|
||||
#ifdef _GLFW_DLOPEN_LIBGL
|
||||
int i;
|
||||
@@ -53,11 +53,10 @@ static void initLibraries( void )
|
||||
};
|
||||
|
||||
_glfwLibrary.Libs.libGL = NULL;
|
||||
for( i = 0; !libGL_names[ i ] != NULL; i ++ )
|
||||
for (i = 0; libGL_names[i] != NULL; i++)
|
||||
{
|
||||
_glfwLibrary.Libs.libGL = dlopen( libGL_names[ i ],
|
||||
RTLD_LAZY | RTLD_GLOBAL );
|
||||
if( _glfwLibrary.Libs.libGL )
|
||||
_glfwLibrary.Libs.libGL = dlopen(libGL_names[i], RTLD_LAZY | RTLD_GLOBAL);
|
||||
if (_glfwLibrary.Libs.libGL)
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
@@ -68,7 +67,7 @@ static void initLibraries( void )
|
||||
// Terminate GLFW when exiting application
|
||||
//========================================================================
|
||||
|
||||
static void glfw_atexit( void )
|
||||
static void glfw_atexit(void)
|
||||
{
|
||||
glfwTerminate();
|
||||
}
|
||||
@@ -78,11 +77,11 @@ static void glfw_atexit( void )
|
||||
// Initialize X11 display
|
||||
//========================================================================
|
||||
|
||||
static int initDisplay( void )
|
||||
static int initDisplay(void)
|
||||
{
|
||||
// Open display
|
||||
_glfwLibrary.display = XOpenDisplay( 0 );
|
||||
if( !_glfwLibrary.display )
|
||||
_glfwLibrary.display = XOpenDisplay(0);
|
||||
if (!_glfwLibrary.display)
|
||||
{
|
||||
fprintf(stderr, "Failed to open X display\n");
|
||||
return GL_FALSE;
|
||||
@@ -91,9 +90,9 @@ static int initDisplay( void )
|
||||
// Check for XF86VidMode extension
|
||||
#ifdef _GLFW_HAS_XF86VIDMODE
|
||||
_glfwLibrary.XF86VidMode.available =
|
||||
XF86VidModeQueryExtension( _glfwLibrary.display,
|
||||
&_glfwLibrary.XF86VidMode.eventBase,
|
||||
&_glfwLibrary.XF86VidMode.errorBase);
|
||||
XF86VidModeQueryExtension(_glfwLibrary.display,
|
||||
&_glfwLibrary.XF86VidMode.eventBase,
|
||||
&_glfwLibrary.XF86VidMode.errorBase);
|
||||
#else
|
||||
_glfwLibrary.XF86VidMode.available = 0;
|
||||
#endif
|
||||
@@ -101,25 +100,25 @@ static int initDisplay( void )
|
||||
// Check for XRandR extension
|
||||
#ifdef _GLFW_HAS_XRANDR
|
||||
_glfwLibrary.XRandR.available =
|
||||
XRRQueryExtension( _glfwLibrary.display,
|
||||
&_glfwLibrary.XRandR.eventBase,
|
||||
&_glfwLibrary.XRandR.errorBase );
|
||||
XRRQueryExtension(_glfwLibrary.display,
|
||||
&_glfwLibrary.XRandR.eventBase,
|
||||
&_glfwLibrary.XRandR.errorBase);
|
||||
#else
|
||||
_glfwLibrary.XRandR.available = 0;
|
||||
#endif
|
||||
|
||||
// Fullscreen & screen saver settings
|
||||
// Check if GLX is supported on this display
|
||||
if( !glXQueryExtension( _glfwLibrary.display, NULL, NULL ) )
|
||||
if (!glXQueryExtension(_glfwLibrary.display, NULL, NULL))
|
||||
{
|
||||
fprintf(stderr, "GLX not supported\n");
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
// Retrieve GLX version
|
||||
if( !glXQueryVersion( _glfwLibrary.display,
|
||||
&_glfwLibrary.glxMajor,
|
||||
&_glfwLibrary.glxMinor ) )
|
||||
if (!glXQueryVersion(_glfwLibrary.display,
|
||||
&_glfwLibrary.glxMajor,
|
||||
&_glfwLibrary.glxMinor))
|
||||
{
|
||||
fprintf(stderr, "Unable to query GLX version\n");
|
||||
return GL_FALSE;
|
||||
@@ -133,12 +132,12 @@ static int initDisplay( void )
|
||||
// Terminate X11 display
|
||||
//========================================================================
|
||||
|
||||
static void terminateDisplay( void )
|
||||
static void terminateDisplay(void)
|
||||
{
|
||||
// Open display
|
||||
if( _glfwLibrary.display )
|
||||
if (_glfwLibrary.display)
|
||||
{
|
||||
XCloseDisplay( _glfwLibrary.display );
|
||||
XCloseDisplay(_glfwLibrary.display);
|
||||
_glfwLibrary.display = NULL;
|
||||
}
|
||||
}
|
||||
@@ -152,16 +151,16 @@ static void terminateDisplay( void )
|
||||
// Initialize various GLFW state
|
||||
//========================================================================
|
||||
|
||||
int _glfwPlatformInit( void )
|
||||
int _glfwPlatformInit(void)
|
||||
{
|
||||
if( !initDisplay() )
|
||||
if (!initDisplay())
|
||||
return GL_FALSE;
|
||||
|
||||
// Try to load libGL.so if necessary
|
||||
initLibraries();
|
||||
|
||||
// Install atexit() routine
|
||||
atexit( glfw_atexit );
|
||||
atexit(glfw_atexit);
|
||||
|
||||
// Initialize joysticks
|
||||
_glfwInitJoysticks();
|
||||
@@ -177,7 +176,7 @@ int _glfwPlatformInit( void )
|
||||
// Close window and shut down library
|
||||
//========================================================================
|
||||
|
||||
int _glfwPlatformTerminate( void )
|
||||
int _glfwPlatformTerminate(void)
|
||||
{
|
||||
// Close OpenGL window
|
||||
glfwCloseWindow();
|
||||
@@ -190,9 +189,9 @@ int _glfwPlatformTerminate( void )
|
||||
|
||||
// Unload libGL.so if necessary
|
||||
#ifdef _GLFW_DLOPEN_LIBGL
|
||||
if( _glfwLibrary.Libs.libGL != NULL )
|
||||
if (_glfwLibrary.Libs.libGL != NULL)
|
||||
{
|
||||
dlclose( _glfwLibrary.Libs.libGL );
|
||||
dlclose(_glfwLibrary.Libs.libGL);
|
||||
_glfwLibrary.Libs.libGL = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user