From: Richard Rauch Date: Fri, 7 Nov 2003 08:06:10 +0000 (+0000) Subject: Somewhat normalized the style of this file. X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=7c1f2d267626b937acdb59e18c0e22fabbc6d339;p=freeglut Somewhat normalized the style of this file. Also moved the "glutMouseWheelFunc" extension down into the "extensions" part of the table. (Purely internal organization. It will still be found.) git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@313 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/src/freeglut_ext.c b/src/freeglut_ext.c index 24acc69..5b2ca92 100644 --- a/src/freeglut_ext.c +++ b/src/freeglut_ext.c @@ -33,12 +33,14 @@ #include "freeglut_internal.h" -struct name_address_pair { - const char *name; - void *address; +struct name_address_pair +{ + const char *name; + void *address; }; -static struct name_address_pair glut_functions[] = { +static struct name_address_pair glut_functions[] = +{ { "glutInit", (void *) glutInit }, { "glutInitDisplayMode", (void *) glutInitDisplayMode }, { "glutInitDisplayString", (void *) glutInitDisplayString }, @@ -87,7 +89,6 @@ static struct name_address_pair glut_functions[] = { { "glutReshapeFunc", (void *) glutReshapeFunc }, { "glutKeyboardFunc", (void *) glutKeyboardFunc }, { "glutMouseFunc", (void *) glutMouseFunc }, - { "glutMouseWheelFunc", (void *) glutMouseWheelFunc }, { "glutMotionFunc", (void *) glutMotionFunc }, { "glutPassiveMotionFunc", (void *) glutPassiveMotionFunc }, { "glutEntryFunc", (void *) glutEntryFunc }, @@ -174,25 +175,25 @@ static struct name_address_pair glut_functions[] = { { "glutWireSierpinskiSponge ", (void *) glutWireSierpinskiSponge }, { "glutSolidSierpinskiSponge ", (void *) glutSolidSierpinskiSponge }, { "glutGetProcAddress", (void *) glutGetProcAddress }, + { "glutMouseWheelFunc", (void *) glutMouseWheelFunc }, { NULL, NULL } }; -void * FGAPIENTRY glutGetProcAddress(const char *procName) +void *FGAPIENTRY glutGetProcAddress( const char *procName ) { - /* Try GLUT functions first */ - int i; - for (i = 0; glut_functions[i].name; i++) { - if (strcmp(glut_functions[i].name, procName) == 0) - return glut_functions[i].address; - } + /* Try GLUT functions first */ + int i; + for( i = 0; glut_functions[ i ].name; i++ ) + if( strcmp( glut_functions[ i ].name, procName ) == 0) + return glut_functions[ i ].address; - /* Try core GL functions */ + /* Try core GL functions */ #if TARGET_HOST_WIN32 - return (void *) wglGetProcAddress((LPCSTR) procName); -#elif TARGET_HOST_UNIX_X11 && defined(GLX_ARB_get_proc_address) - return (void *) glXGetProcAddressARB((const GLubyte *) procName); + return( void * )wglGetProcAddress( ( LPCSTR )procName ); +#elif TARGET_HOST_UNIX_X11 && defined( GLX_ARB_get_proc_address ) + return(void * )glXGetProcAddressARB( ( const GLubyte * )procName ); #else - return NULL; + return NULL; #endif }