source: GTP/trunk/Lib/Geom/shared/GTGeometry/src/libs/vmi/include/global.h @ 983

Revision 983, 3.0 KB checked in by gumbau, 18 years ago (diff)
Line 
1#ifndef __global_h_
2#define __global_h_
3
4#include <assert.h>
5
6#include "glm.h"
7#include "camera.h"
8#include "mesh.h"
9#include "color.h"
10
11//      For progress update.
12#include        "GeoMesh.h"
13
14#ifndef TRUE
15#define TRUE    1
16#endif /* TRUE */
17
18#ifndef FALSE
19#define FALSE   0
20#endif /* FALSE */
21
22#ifndef false
23#define false   ((char) 0)
24#endif
25#ifndef true
26#define true    ((char) 1)
27#endif
28
29#ifndef MAX
30#define MAX(a,b) ( (a) > (b) ? (a) : (b) )
31#endif
32#ifndef MIN
33#define MIN(a,b) ( (a) < (b) ? (a) : (b) )
34#endif
35#ifndef ABS
36#define ABS(a)   ( (a) >= 0 ? (a) : (-(a)) )
37#endif
38
39#define MAX_CHAR 256
40
41//#define DEBUG
42
43// Geometry acceleration technique
44//#define IMMEDIATE_MODE
45//#define VERTEX_ARRAY_INTERLEAVE
46//#define VERTEX_ARRAY
47#define VERTEX_BUFFER_OBJECTS
48
49// Viewpoint metric
50//#define KL
51#define MI
52//#define HE
53//#define CS
54
55// Histogram technique
56//#define USE_OCCLUSION_QUERY
57#define HYBRID_HW_SW_HISTOGRAM
58
59//#define SALIENCY
60
61#define CHECK_OPENGL_ERROR( cmd ) \
62{ GLenum error; \
63    while ( ( error = glGetError() ) != GL_NO_ERROR ) { \
64    printf( "[%s:%d] ’%s’failed with error %s\n", \
65    __FILE__, __LINE__, \
66    cmd, gluErrorString(error) ); \
67    } \
68}
69
70#define CHECK_FRAMEBUFFER_STATUS()                            \
71{                                                             \
72    GLenum status;                                            \
73    status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); \
74    switch(status) {                                          \
75    case GL_FRAMEBUFFER_COMPLETE_EXT:                         \
76        break;                                                \
77    case GL_FRAMEBUFFER_UNSUPPORTED_EXT:                      \
78        /* choose different formats */                        \
79        break;                                                \
80    default:                                                  \
81        /* programming error; will fail on all hardware */    \
82        assert(0);                                            \
83    } \
84}
85
86namespace       VMI
87{
88
89extern GLMmodel* pmodel; // Vertices start at position 1
90
91extern GLubyte *pixels;
92
93extern Camera *cameras;
94extern GLuint numCameras;
95
96extern Color *colors;
97
98extern GLuint **histogram,
99               *queries;
100
101extern Mesh *mesh;
102
103extern GLdouble *initialIs;
104
105extern GLdouble  radius;
106extern GLdouble  fov;
107extern GLuint    numDemandedTriangles,
108                 cameraType;
109extern GLboolean bBeQuiet,
110                 bEnableOffScreen,
111                 bSaveLog,
112                 bLoadCamerasFromFile;
113
114extern GLsizei width, height;
115
116extern int vmiWin;
117
118extern char filename[MAX_CHAR];
119
120extern void init(void);
121
122extern void renderScene(GLuint **histogram, GLuint numCameras);
123
124extern void renderGeometry(void);
125
126extern void drawTexture(void);
127
128extern void display(void);
129
130extern void freeMemory(void);
131
132extern void applyHWAcceleration(void);
133extern void setOrthographicProjection(void);
134extern void resetPerspectiveProjection(void);
135extern void renderBitmapString(float x, float y, void *font, char *string);
136
137//      For progress update
138extern  Geometry::TIPOFUNC      mUPB;
139
140}
141
142#endif
143
Note: See TracBrowser for help on using the repository browser.