*** empty log message ***

svn path=/trunk/boinc/; revision=2390
This commit is contained in:
David Anderson 2003-10-02 18:51:38 +00:00
parent 0b69b868c2
commit 70b839eace
3 changed files with 33 additions and 20 deletions

View File

@ -116,7 +116,8 @@ int boinc_init_opengl() {
// Create the thread in a suspended state // Create the thread in a suspended state
theErr = NewThread ( kCooperativeThread, entry_proc, theErr = NewThread ( kCooperativeThread, entry_proc,
(void *)(&gi), 0, kNewSuspend | kCreateIfNeeded, NULL, &graphicsThreadID ); (void *)(&gi), 0, kNewSuspend | kCreateIfNeeded, NULL, &graphicsThreadID
);
if (theErr != noErr) return ERR_THREAD; if (theErr != noErr) return ERR_THREAD;
// In theory we could do customized scheduling or install thread disposal routines here // 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 #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 char text[256]; // Holds Our String
va_list ap; // Pointer To List Of Arguments 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; GLenum err;
glShadeModel(GL_SMOOTH); // Enable Smooth Shading glShadeModel(GL_SMOOTH); // Enable Smooth Shading

View File

@ -8,8 +8,9 @@
#ifndef HAVE_OPENGL_GL_H #ifndef HAVE_OPENGL_GL_H
#define HAVE_OPENGL_GL_H #define HAVE_OPENGL_GL_H
#endif #endif
#endif
#elif defined(_WIN32) #ifdef _WIN32
#ifndef HAVE_GL_LIB #ifndef HAVE_GL_LIB
#define HAVE_GL_LIB 1 #define HAVE_GL_LIB 1
#endif #endif
@ -22,11 +23,6 @@
#ifndef HAVE_GL_GLAUX_H #ifndef HAVE_GL_GLAUX_H
#define HAVE_GL_GLAUX_H 1 #define HAVE_GL_GLAUX_H 1
#endif #endif
#include <windows.h>
extern HANDLE hQuitEvent;
extern HANDLE graphics_threadh;
extern BOOL win_loop_done;
#endif #endif
#ifdef HAVE_GL_H #ifdef HAVE_GL_H
@ -68,8 +64,6 @@ extern BOOL win_loop_done;
#include <MesaGL/glaux.h> #include <MesaGL/glaux.h>
#endif #endif
#if defined(HAVE_GL_LIB) && defined(HAVE_X11) #if defined(HAVE_GL_LIB) && defined(HAVE_X11)
#include "x_opengl.h" #include "x_opengl.h"
#endif #endif
@ -78,15 +72,27 @@ extern BOOL win_loop_done;
#include <Carbon/Carbon.h> #include <Carbon/Carbon.h>
#endif #endif
// The API (functions called by the app)
extern int boinc_init_opengl(); extern int boinc_init_opengl();
extern int boinc_finish_opengl(); extern int boinc_finish_opengl();
#ifdef HAVE_GL_LIB
extern GLvoid glPrint(GLuint font, const char *fmt, ...); extern GLvoid glPrint(GLuint font, const char *fmt, ...);
extern GLenum InitGL(GLvoid);
extern GLenum ReSizeGLScene(GLsizei width, GLsizei height); 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 bool app_render(int xs, int ys, double time_of_day);
extern void app_init_gl(void); extern void app_init_gl(void);
extern void app_resize(int width, int height); 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 #endif

View File

@ -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); sprintf(init_data_path, "%s%s%s", slot_dir, PATH_SEPARATOR, INIT_DATA_FILE);
f = fopen(init_data_path, "w"); f = fopen(init_data_path, "w");
if (!f) { if (!f) {
msg_printf(wup->project, MSG_ERROR, "Failed to open core-to-app prefs file %s", msg_printf(wup->project, MSG_ERROR,
init_data_path); "Failed to open core-to-app prefs file %s",
init_data_path
);
return ERR_FOPEN; 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); sprintf(graphics_data_path, "%s%s%s", slot_dir, PATH_SEPARATOR, GRAPHICS_DATA_FILE);
f = fopen(graphics_data_path, "w"); f = fopen(graphics_data_path, "w");
if (!f) { if (!f) {
msg_printf(wup->project, MSG_ERROR, "Failed to open core-to-app graphics prefs file %s", msg_printf(wup->project, MSG_ERROR,
graphics_data_path); "Failed to open core-to-app graphics prefs file %s",
graphics_data_path
);
return ERR_FOPEN; return ERR_FOPEN;
} }
retval = write_graphics_file(f, &gi); retval = write_graphics_file(f, &gi);