Initial graphics for Mac

svn path=/trunk/boinc/; revision=422
This commit is contained in:
Eric Heien 2002-09-18 21:15:23 +00:00
parent 4a7d7adf28
commit e8455f5fcf
2 changed files with 40 additions and 0 deletions

View File

@ -3,6 +3,44 @@
#include "parse.h" #include "parse.h"
#ifdef __APPLE_CC__
#include <Carbon/Carbon.h>
#include <CoreServices/CoreServices.h>
#include "mac_app_opengl.h"
#endif
extern GRAPHICS_INFO gi;
int boinc_init_opengl() {
#ifdef BOINC_APP_GRAPHICS
#ifdef __APPLE_CC__
OSErr theErr = noErr;
ThreadID graphicsThreadID = 0;
ThreadEntryUPP entry_proc;
entry_proc = NewThreadEntryUPP( mac_graphics_event_loop );
// Create the thread in a suspended state
theErr = NewThread ( kCooperativeThread, entry_proc,
(void *)(&gi), 0, kNewSuspend, NULL, &graphicsThreadID );
if (theErr != noErr) return ERR_THREAD;
// In theory we could do customized scheduling or install thread disposal routines here
// Put the graphics event loop into the ready state
SetThreadState( graphicsThreadID, kReadyThreadState, kNoThreadID );
YieldToAnyThread();
#endif
#endif
return 0;
}
int boinc_finish_opengl() {
}
int write_graphics_file(FILE* f, GRAPHICS_INFO* gi) { int write_graphics_file(FILE* f, GRAPHICS_INFO* gi) {
fprintf(f, fprintf(f,
"<graphics_info>\n" "<graphics_info>\n"

View File

@ -18,3 +18,5 @@ struct APP_OUT_GRAPHICS {
int write_graphics_file(FILE* f, GRAPHICS_INFO* gi); int write_graphics_file(FILE* f, GRAPHICS_INFO* gi);
int parse_graphics_file(FILE* f, GRAPHICS_INFO* gi); int parse_graphics_file(FILE* f, GRAPHICS_INFO* gi);
int boinc_init_opengl();
int boinc_finish_opengl();