2003-05-07 20:04:26 +00:00
|
|
|
#ifndef BOINC_GRAPHICS_API_H
|
|
|
|
#define BOINC_GRAPHICS_API_H
|
|
|
|
|
2003-05-07 23:42:17 +00:00
|
|
|
#ifdef __APPLE_CC__
|
2003-10-01 18:19:29 +00:00
|
|
|
#ifndef HAVE_GL_LIB
|
|
|
|
#define HAVE_GL_LIB 1
|
|
|
|
#endif
|
|
|
|
#ifndef HAVE_OPENGL_GL_H
|
|
|
|
#define HAVE_OPENGL_GL_H
|
|
|
|
#endif
|
2003-10-02 21:16:37 +00:00
|
|
|
#include <Carbon/Carbon.h>
|
2003-10-02 18:51:38 +00:00
|
|
|
#endif
|
2003-10-01 18:19:29 +00:00
|
|
|
|
2003-10-02 18:51:38 +00:00
|
|
|
#ifdef _WIN32
|
2003-10-02 21:16:37 +00:00
|
|
|
#include <windows.h>
|
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
|
|
|
|
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>
|
|
|
|
#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-09-30 21:17:20 +00:00
|
|
|
extern int boinc_init_opengl();
|
|
|
|
extern int boinc_finish_opengl();
|
|
|
|
extern GLvoid glPrint(GLuint font, const char *fmt, ...);
|
2003-10-02 18:51:38 +00:00
|
|
|
|
|
|
|
// Functions that must be supplied by the app
|
|
|
|
//
|
2003-02-19 18:55:07 +00:00
|
|
|
extern bool app_render(int xs, int ys, double time_of_day);
|
2003-03-03 18:46:06 +00:00
|
|
|
extern void app_init_gl(void);
|
2003-09-22 22:22:20 +00:00
|
|
|
extern void app_resize(int width, int height);
|
2003-05-07 20:04:26 +00:00
|
|
|
|
2003-10-02 18:51:38 +00:00
|
|
|
// Implementation stuff
|
|
|
|
//
|
|
|
|
extern GLenum InitGL(GLvoid);
|
|
|
|
extern GLenum ReSizeGLScene(GLsizei width, GLsizei height);
|
2003-10-02 21:16:37 +00:00
|
|
|
extern void throttled_app_render(int, int, double);
|
2003-10-02 18:51:38 +00:00
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
extern HANDLE hQuitEvent;
|
|
|
|
extern HANDLE graphics_threadh;
|
|
|
|
extern BOOL win_loop_done;
|
|
|
|
#endif
|
|
|
|
|
2003-05-07 20:04:26 +00:00
|
|
|
#endif
|