*** 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

@ -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

View File

@ -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 <windows.h>
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 <MesaGL/glaux.h>
#endif
#if defined(HAVE_GL_LIB) && defined(HAVE_X11)
#include "x_opengl.h"
#endif
@ -78,15 +72,27 @@ extern BOOL win_loop_done;
#include <Carbon/Carbon.h>
#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

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);
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);