2003-05-07 20:04:26 +00:00
|
|
|
#ifndef BOINC_GRAPHICS_API_H
|
|
|
|
#define BOINC_GRAPHICS_API_H
|
|
|
|
|
2003-10-02 18:51:38 +00:00
|
|
|
#ifdef _WIN32
|
2003-10-01 18:19:29 +00:00
|
|
|
#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
|
2003-05-07 23:42:17 +00:00
|
|
|
#endif
|
|
|
|
#endif
|
2003-05-07 20:04:26 +00:00
|
|
|
|
2004-03-06 09:45:25 +00:00
|
|
|
#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 <Carbon/Carbon.h>
|
|
|
|
#endif
|
|
|
|
|
2003-10-01 18:19:29 +00:00
|
|
|
#ifdef HAVE_GL_H
|
|
|
|
#include <gl.h>
|
|
|
|
#elif defined(HAVE_GL_GL_H)
|
2003-05-07 23:42:17 +00:00
|
|
|
#include <GL/gl.h>
|
2003-10-01 18:19:29 +00:00
|
|
|
#elif defined(HAVE_OPENGL_GL_H)
|
|
|
|
#include <OpenGL/gl.h>
|
|
|
|
#elif defined(HAVE_MESAGL_GL_H)
|
|
|
|
#include <MesaGL/gl.h>
|
2003-10-07 04:35:56 +00:00
|
|
|
#else
|
|
|
|
#error No gl.h
|
2003-10-01 18:19:29 +00:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_GLU_H
|
|
|
|
#include <glu.h>
|
|
|
|
#elif defined(HAVE_GL_GLU_H)
|
|
|
|
#include <GL/glu.h>
|
|
|
|
#elif defined(HAVE_OPENGL_GLU_H)
|
|
|
|
#include <OpenGL/glu.h>
|
|
|
|
#elif defined(HAVE_MESAGL_GLU_H)
|
|
|
|
#include <MesaGL/glu.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_GLUT_H
|
|
|
|
#include <glut.h>
|
|
|
|
#elif defined(HAVE_GL_GLUT_H)
|
|
|
|
#include <GL/glut.h>
|
|
|
|
#elif defined(HAVE_OPENGL_GLUT_H)
|
|
|
|
#include <OpenGL/glut.h>
|
|
|
|
#elif defined(HAVE_MESAGL_GLUT_H)
|
|
|
|
#include <MesaGL/glut.h>
|
|
|
|
#elif defined(HAVE_GLUT_GLUT_H)
|
|
|
|
#include <GLUT/glut.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_GLAUX_H
|
|
|
|
#include <glaux.h>
|
|
|
|
#elif defined(HAVE_GL_GLAUX_H)
|
|
|
|
#include <GL/glaux.h>
|
|
|
|
#elif defined(HAVE_OPENGL_GLAUX_H)
|
|
|
|
#include <OpenGL/glaux.h>
|
|
|
|
#elif defined(HAVE_MESAGL_GLAUX_H)
|
|
|
|
#include <MesaGL/glaux.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(HAVE_GL_LIB) && defined(HAVE_X11)
|
2003-05-07 23:42:17 +00:00
|
|
|
#include "x_opengl.h"
|
|
|
|
#endif
|
2002-09-17 21:54:59 +00:00
|
|
|
|
2003-10-02 18:51:38 +00:00
|
|
|
// The API (functions called by the app)
|
2003-10-31 22:37:46 +00:00
|
|
|
extern int boinc_init_graphics();
|
|
|
|
extern int boinc_finish_graphics();
|
2003-10-02 21:30:14 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_GL_LIB
|
2003-09-30 21:17:20 +00:00
|
|
|
extern GLvoid glPrint(GLuint font, const char *fmt, ...);
|
2003-10-02 21:30:14 +00:00
|
|
|
#endif
|
2003-10-02 18:51:38 +00:00
|
|
|
|
|
|
|
// Functions that must be supplied by the app
|
|
|
|
//
|
2003-10-31 22:37:46 +00:00
|
|
|
extern void app_graphics_render(int xs, int ys, double time_of_day);
|
|
|
|
extern void app_graphics_init();
|
|
|
|
// called each time a window is opened;
|
|
|
|
// called in the graphics thread
|
|
|
|
extern void app_graphics_reread_prefs();
|
|
|
|
// called when get REREAD_PREFS message from core client.
|
|
|
|
// called in the graphics thread
|
|
|
|
extern void app_graphics_resize(int width, int height);
|
2003-05-07 20:04:26 +00:00
|
|
|
|
2003-10-02 18:51:38 +00:00
|
|
|
// Implementation stuff
|
|
|
|
//
|
2003-10-14 20:37:02 +00:00
|
|
|
extern double boinc_max_fps;
|
|
|
|
extern double boinc_max_gfx_cpu_frac;
|
2003-10-02 18:51:38 +00:00
|
|
|
extern GLenum InitGL(GLvoid);
|
|
|
|
extern GLenum ReSizeGLScene(GLsizei width, GLsizei height);
|
2003-10-05 05:26:59 +00:00
|
|
|
extern bool throttled_app_render(int, int, double);
|
2003-10-02 18:51:38 +00:00
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
extern HANDLE hQuitEvent;
|
|
|
|
extern HANDLE graphics_threadh;
|
2003-11-06 20:27:07 +00:00
|
|
|
extern BOOL win_loop_done;
|
2003-10-02 18:51:38 +00:00
|
|
|
#endif
|
|
|
|
|
2003-05-07 20:04:26 +00:00
|
|
|
#endif
|