X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_ext.c;h=2c98d4b4a983307f5e98ce49d5d44e9f15870f8e;hb=acc07c33a660243fece1e72b658c4228a70bea33;hp=bb810860d7494e09506552e734a567aa23143b5d;hpb=0b1a7966eeafc97ab68fcf331fddeeb22ca3b619;p=freeglut diff --git a/src/freeglut_ext.c b/src/freeglut_ext.c index bb81086..2c98d4b 100644 --- a/src/freeglut_ext.c +++ b/src/freeglut_ext.c @@ -29,18 +29,20 @@ #include "config.h" #endif -#define G_LOG_DOMAIN "freeglut-ext" +#define GLX_GLXEXT_PROTOTYPES #include "../include/GL/freeglut.h" #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 }, @@ -89,7 +91,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 }, @@ -176,25 +177,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 }