diff --git a/api/graphics_api.C b/api/graphics_api.C index a49a7692a3..8a2d0e5dab 100755 --- a/api/graphics_api.C +++ b/api/graphics_api.C @@ -115,8 +115,9 @@ int boinc_init_opengl() { entry_proc = NewThreadEntryUPP( mac_graphics_event_loop ); // Create the thread in a suspended state - theErr = NewThread ( kCooperativeThread, entry_proc, - (void *)(&gi), 0, kNewSuspend | kCreateIfNeeded, NULL, &graphicsThreadID ); + theErr = NewThread ( kCooperativeThread, entry_proc, + (void *)(&gi), 0, kNewSuspend | kCreateIfNeeded, NULL, &graphicsThreadID + ); if (theErr != noErr) return ERR_THREAD; // In theory we could do customized scheduling or install thread disposal routines here @@ -158,8 +159,8 @@ int boinc_finish_opengl() { } #ifdef HAVE_GL_LIB -GLvoid glPrint(GLuint font, const char *fmt, ...) // Custom GL "Print" Routine -{ +// Custom GL "Print" Routine +GLvoid glPrint(GLuint font, const char *fmt, ...) { /* char text[256]; // Holds Our String va_list ap; // Pointer To List Of Arguments @@ -178,7 +179,9 @@ GLvoid glPrint(GLuint font, const char *fmt, ...) // Custom GL "Print" Routin */ } -GLenum InitGL(GLvoid) { // All Setup For OpenGL Goes Here +// All Setup For OpenGL Goes Here +// +GLenum InitGL(GLvoid) { GLenum err; glShadeModel(GL_SMOOTH); // Enable Smooth Shading diff --git a/api/graphics_api.h b/api/graphics_api.h index 456c5c125b..256d1b4627 100755 --- a/api/graphics_api.h +++ b/api/graphics_api.h @@ -8,8 +8,9 @@ #ifndef HAVE_OPENGL_GL_H #define HAVE_OPENGL_GL_H #endif +#endif -#elif defined(_WIN32) +#ifdef _WIN32 #ifndef HAVE_GL_LIB #define HAVE_GL_LIB 1 #endif @@ -22,11 +23,6 @@ #ifndef HAVE_GL_GLAUX_H #define HAVE_GL_GLAUX_H 1 #endif - -#include -extern HANDLE hQuitEvent; -extern HANDLE graphics_threadh; -extern BOOL win_loop_done; #endif #ifdef HAVE_GL_H @@ -68,8 +64,6 @@ extern BOOL win_loop_done; #include #endif - - #if defined(HAVE_GL_LIB) && defined(HAVE_X11) #include "x_opengl.h" #endif @@ -78,15 +72,27 @@ extern BOOL win_loop_done; #include #endif +// The API (functions called by the app) extern int boinc_init_opengl(); extern int boinc_finish_opengl(); -#ifdef HAVE_GL_LIB extern GLvoid glPrint(GLuint font, const char *fmt, ...); -extern GLenum InitGL(GLvoid); extern GLenum ReSizeGLScene(GLsizei width, GLsizei height); -#endif + +// Functions that must be supplied by the app +// extern bool app_render(int xs, int ys, double time_of_day); extern void app_init_gl(void); extern void app_resize(int width, int height); +// Implementation stuff +// +extern GLenum InitGL(GLvoid); +extern GLenum ReSizeGLScene(GLsizei width, GLsizei height); + +#ifdef _WIN32 +extern HANDLE hQuitEvent; +extern HANDLE graphics_threadh; +extern BOOL win_loop_done; +#endif + #endif diff --git a/client/app.C b/client/app.C index 14f8dc7390..800e9a7967 100644 --- a/client/app.C +++ b/client/app.C @@ -185,8 +185,10 @@ int ACTIVE_TASK::start(bool first_time) { sprintf(init_data_path, "%s%s%s", slot_dir, PATH_SEPARATOR, INIT_DATA_FILE); f = fopen(init_data_path, "w"); if (!f) { - msg_printf(wup->project, MSG_ERROR, "Failed to open core-to-app prefs file %s", - init_data_path); + msg_printf(wup->project, MSG_ERROR, + "Failed to open core-to-app prefs file %s", + init_data_path + ); return ERR_FOPEN; } @@ -208,8 +210,10 @@ int ACTIVE_TASK::start(bool first_time) { sprintf(graphics_data_path, "%s%s%s", slot_dir, PATH_SEPARATOR, GRAPHICS_DATA_FILE); f = fopen(graphics_data_path, "w"); if (!f) { - msg_printf(wup->project, MSG_ERROR, "Failed to open core-to-app graphics prefs file %s", - graphics_data_path); + msg_printf(wup->project, MSG_ERROR, + "Failed to open core-to-app graphics prefs file %s", + graphics_data_path + ); return ERR_FOPEN; } retval = write_graphics_file(f, &gi);