diff --git a/api/graphics_api.C b/api/graphics_api.C index 3559908cdc..8d122a2bcf 100755 --- a/api/graphics_api.C +++ b/api/graphics_api.C @@ -61,11 +61,10 @@ GRAPHICS_INFO gi; bool graphics_inited = false; int boinc_init_graphics() { -#ifdef HAVE_GL_LIB FILE* f; int retval; - f = boinc_file_exists(GRAPHICS_DATA_FILE)?boinc_fopen(GRAPHICS_DATA_FILE, "r"):0; + f = boinc_fopen(GRAPHICS_DATA_FILE, "r"); if (!f) { fprintf(stderr, "boinc_init_graphics(): can't open graphics data file\n"); fprintf(stderr, "boinc_init_graphics(): Using default graphics settings.\n"); @@ -148,10 +147,8 @@ int boinc_init_graphics() { #endif graphics_inited = true; -#else - graphics_inited = false; -#endif - return !graphics_inited; + + return 0; } int boinc_finish_graphics() { @@ -218,89 +215,4 @@ bool throttled_app_render(int x, int y, double t) { return true; } return false; -} - -#ifdef HAVE_GL_LIB -// 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 - - if (fmt == NULL) // If There's No Text - return; // Do Nothing - - va_start(ap, fmt); // Parses The String For Variables - vsprintf(text, fmt, ap); // And Converts Symbols To Actual Numbers - va_end(ap); // Results Are Stored In Text - - glPushAttrib(GL_LIST_BIT); // Pushes The Display List Bits - glListBase(font); // Sets The Base Character - glCallLists(strlen(text), GL_UNSIGNED_BYTE, text); // Draws The Display List Text - glPopAttrib(); // Pops The Display List Bits - */ -} - -// All Setup For OpenGL Goes Here -// -GLenum InitGL(GLvoid) { - GLenum err; - - glShadeModel(GL_SMOOTH); // Enable Smooth Shading - err = glGetError(); - if (err) { - fprintf(stderr, "glShadeModel Error: %d '%s'", err, gluErrorString(err)); - return err; - } - - glClearColor(0.0f, 0.0f, 0.0f, 0.5f); // Black Background - err = glGetError(); - if (err) { - fprintf(stderr, "glClearColor Error: %d '%s'", err, gluErrorString(err)); - return err; - } - - glClearDepth(1.0f); // Depth Buffer Setup - err = glGetError(); - if (err) { - fprintf(stderr, "glClearDepth Error: %d '%s'", err, gluErrorString(err)); - return err; - } - - glEnable(GL_DEPTH_TEST); // Enables Depth Testing - err = glGetError(); - if (err) { - fprintf(stderr, "glEnable Error: %d '%s'", err, gluErrorString(err)); - return err; - } - - glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do - err = glGetError(); - if (err) { - fprintf(stderr, "glDepthFunc Error: %d '%s'", err, gluErrorString(err)); - return err; - } - - glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); // Really Nice Perspective Calculations - err = glGetError(); - if (err) { - fprintf(stderr, "glHint Error: %d '%s'", err, gluErrorString(err)); - return err; - } - - return GL_NO_ERROR; // Initialization Went OK -} - -// Resize And Initialize The GL Window -// -GLenum ReSizeGLScene(GLsizei width, GLsizei height) { - GLenum err; - glViewport(0,0,(int)width,(int)(height)); - - err = glGetError(); - if (err) return err; - - app_graphics_resize(width,height); - return GL_NO_ERROR; -} -#endif +} \ No newline at end of file diff --git a/api/graphics_api.h b/api/graphics_api.h index c209a545eb..402444e01c 100755 --- a/api/graphics_api.h +++ b/api/graphics_api.h @@ -1,84 +1,10 @@ #ifndef BOINC_GRAPHICS_API_H #define BOINC_GRAPHICS_API_H -#ifdef _WIN32 -#ifndef HAVE_GL_LIB -#define HAVE_GL_LIB 1 -#endif -#ifndef HAVE_GL_GL_H -#define HAVE_GL_GL_H 1 -#endif -#ifndef HAVE_GL_GLU_H -#define HAVE_GL_GLU_H 1 -#endif -#ifndef HAVE_GL_GLAUX_H -#define HAVE_GL_GLAUX_H 1 -#endif -#endif - -#ifdef __APPLE_CC__ -#ifndef HAVE_GL_LIB -#define HAVE_GL_LIB 1 -#endif -#ifndef HAVE_OPENGL_GL_H -#define HAVE_OPENGL_GL_H -#endif -#include -#endif - -#ifdef HAVE_GL_H -#include -#elif defined(HAVE_GL_GL_H) -#include -#elif defined(HAVE_OPENGL_GL_H) -#include -#elif defined(HAVE_MESAGL_GL_H) -#include -#else -#error No gl.h -#endif -#ifdef HAVE_GLU_H -#include -#elif defined(HAVE_GL_GLU_H) -#include -#elif defined(HAVE_OPENGL_GLU_H) -#include -#elif defined(HAVE_MESAGL_GLU_H) -#include -#endif -#ifdef HAVE_GLUT_H -#include -#elif defined(HAVE_GL_GLUT_H) -#include -#elif defined(HAVE_OPENGL_GLUT_H) -#include -#elif defined(HAVE_MESAGL_GLUT_H) -#include -#elif defined(HAVE_GLUT_GLUT_H) -#include -#endif -#ifdef HAVE_GLAUX_H -#include -#elif defined(HAVE_GL_GLAUX_H) -#include -#elif defined(HAVE_OPENGL_GLAUX_H) -#include -#elif defined(HAVE_MESAGL_GLAUX_H) -#include -#endif - -#if defined(HAVE_GL_LIB) && defined(HAVE_X11) -#include "x_opengl.h" -#endif - // The API (functions called by the app) extern int boinc_init_graphics(); extern int boinc_finish_graphics(); -#ifdef HAVE_GL_LIB -extern GLvoid glPrint(GLuint font, const char *fmt, ...); -#endif - // Functions that must be supplied by the app // extern void app_graphics_render(int xs, int ys, double time_of_day); @@ -94,8 +20,6 @@ extern void app_graphics_resize(int width, int height); // extern double boinc_max_fps; extern double boinc_max_gfx_cpu_frac; -extern GLenum InitGL(GLvoid); -extern GLenum ReSizeGLScene(GLsizei width, GLsizei height); extern bool throttled_app_render(int, int, double); #ifdef _WIN32 diff --git a/api/windows_opengl.C b/api/windows_opengl.C index d20933c18b..1ac17bfa08 100755 --- a/api/windows_opengl.C +++ b/api/windows_opengl.C @@ -282,7 +282,7 @@ LRESULT CALLBACK WndProc( } else { visible = TRUE; } - ReSizeGLScene(LOWORD(lParam),HIWORD(lParam)); + app_graphics_resize(LOWORD(lParam), HIWORD(lParam)); return 0; } @@ -411,7 +411,7 @@ BOOL VerifyPassword(HWND hwnd) return bres; } - +#if 0 float txt_widths[256]; unsigned int MyCreateFont(char *fontName, int Size, int weight) { @@ -456,3 +456,4 @@ unsigned int MyCreateFont(char *fontName, int Size, int weight) { float get_char_width(unsigned char c) { return txt_widths[c]; } +#endif \ No newline at end of file diff --git a/checkin_notes b/checkin_notes index 756d67fbb2..6cd6102c9e 100755 --- a/checkin_notes +++ b/checkin_notes @@ -12748,3 +12748,13 @@ David May 27 2004 sched/ start + +David May 27 2004 + - The BOINC app graphics framework does not use + (or require the use of) OpenGL. + Get rid of all OpenGL stuff in the code. + Note: windows_opengl.C is misnamed. + + api/ + graphics_api.C,h + windows_opengl.C