File: glaux.i

package info (click to toggle)
swig 1.1p5-1
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 9,448 kB
  • ctags: 5,025
  • sloc: cpp: 21,599; ansic: 13,333; yacc: 3,297; python: 2,794; makefile: 2,197; perl: 1,984; tcl: 1,583; sh: 736; lisp: 201; objc: 143
file content (328 lines) | stat: -rw-r--r-- 7,199 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
//
%{
#include "glaux.h"
%}

/* glaux.h */

/*
 * Mesa - a 3-D graphics library
 * Version:  1.0 beta
 * Copyright (C) 1995  Brian Paul  (brianp@ssec.wisc.edu)
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */


/*
 * This code originated from SGI and was modified for use with Mesa.
 */


#ifndef AUX_INCLUDED
#define AUX_INCLUDED


#ifdef __cplusplus
extern "C" {
#endif

/*
** ToolKit Window Types
** In the future, AUX_RGBA may be a combination of both RGB and ALPHA
*/

#define AUX_RGB		0
#define AUX_RGBA	AUX_RGB
#define AUX_INDEX	1
#define AUX_SINGLE	0
#define AUX_DOUBLE	2
#define AUX_DIRECT	0
#define AUX_INDIRECT	4

#define AUX_ACCUM	8
#define AUX_ALPHA	16
#define AUX_DEPTH	32
#define AUX_STENCIL	64
#define AUX_AUX		128

/* 
** Window Masks
*/

#define AUX_WIND_IS_RGB(x)	(((x) & AUX_INDEX) == 0)
#define AUX_WIND_IS_INDEX(x)	(((x) & AUX_INDEX) != 0)
#define AUX_WIND_IS_SINGLE(x)	(((x) & AUX_DOUBLE) == 0)
#define AUX_WIND_IS_DOUBLE(x)	(((x) & AUX_DOUBLE) != 0)
#define AUX_WIND_IS_INDIRECT(x)	(((x) & AUX_INDIRECT) != 0)
#define AUX_WIND_IS_DIRECT(x)	(((x) & AUX_INDIRECT) == 0)
#define AUX_WIND_HAS_ACCUM(x)	(((x) & AUX_ACCUM) != 0)
#define AUX_WIND_HAS_ALPHA(x)	(((x) & AUX_ALPHA) != 0)
#define AUX_WIND_HAS_DEPTH(x)	(((x) & AUX_DEPTH) != 0)
#define AUX_WIND_HAS_STENCIL(x)	(((x) & AUX_STENCIL) != 0)

/*
** Display Mode Selection Criteria
*/

enum {
    AUX_USE_ID = 1,
    AUX_EXACT_MATCH,
    AUX_MINIMUM_CRITERIA
};


#define AUX_OFF 0
#define AUX_ON 1


/*
** ToolKit Event Structure
*/

//typedef struct _AUX_EVENTREC {
//    GLint event;
//    GLint data[4];
//} AUX_EVENTREC;

/* 
** ToolKit Event Types
*/
#define AUX_EXPOSE	1
#define AUX_CONFIG	2
#define AUX_DRAW	4
#define AUX_KEYEVENT	8
#define AUX_MOUSEDOWN	16
#define AUX_MOUSEUP	32	
#define AUX_MOUSELOC	64

/*
** Toolkit Event Data Indices
*/
#define AUX_WINDOWX		0
#define AUX_WINDOWY		1
#define AUX_MOUSEX		0
#define AUX_MOUSEY		1
#define AUX_MOUSESTATUS		3
#define AUX_KEY			0
#define AUX_KEYSTATUS		1

/*
** ToolKit Event Status Messages
*/
#define	AUX_LEFTBUTTON		1
#define	AUX_RIGHTBUTTON		2
#define	AUX_MIDDLEBUTTON	4
#define	AUX_SHIFT		1
#define	AUX_CONTROL		2

/* 
** ToolKit Key Codes
*/
#define AUX_RETURN		0x0D
#define AUX_ESCAPE		0x1B
#define AUX_SPACE		0x20
#define AUX_LEFT		0x25
#define AUX_UP			0x26
#define AUX_RIGHT		0x27
#define AUX_DOWN		0x28
#define AUX_A			'A'
#define AUX_B			'B'
#define AUX_C			'C'
#define AUX_D			'D'
#define AUX_E			'E'
#define AUX_F			'F'
#define AUX_G			'G'
#define AUX_H			'H'
#define AUX_I			'I'
#define AUX_J			'J'
#define AUX_K			'K'
#define AUX_L			'L'
#define AUX_M			'M'
#define AUX_N			'N'
#define AUX_O			'O'
#define AUX_P			'P'
#define AUX_Q			'Q'
#define AUX_R			'R'
#define AUX_S			'S'
#define AUX_T			'T'
#define AUX_U			'U'
#define AUX_V			'V'
#define AUX_W			'W'
#define AUX_X			'X'
#define AUX_Y			'Y'
#define AUX_Z			'Z'
#define AUX_a			'a'
#define AUX_b			'b'
#define AUX_c			'c'
#define AUX_d			'd'
#define AUX_e			'e'
#define AUX_f			'f'
#define AUX_g			'g'
#define AUX_h			'h'
#define AUX_i			'i'
#define AUX_j			'j'
#define AUX_k			'k'
#define AUX_l			'l'
#define AUX_m			'm'
#define AUX_n			'n'
#define AUX_o			'o'
#define AUX_p			'p'
#define AUX_q			'q'
#define AUX_r			'r'
#define AUX_s			's'
#define AUX_t			't'
#define AUX_u			'u'
#define AUX_v			'v'
#define AUX_w			'w'
#define AUX_x			'x'
#define AUX_y			'y'
#define AUX_z			'z'
#define AUX_0			'0'
#define AUX_1			'1'
#define AUX_2			'2'
#define AUX_3			'3'
#define AUX_4			'4'
#define AUX_5			'5'
#define AUX_6			'6'
#define AUX_7			'7'
#define AUX_8			'8'
#define AUX_9			'9'

/*
** ToolKit Gets and Sets
*/
#define AUX_FD			1  /* return fd (long) */
#define AUX_COLORMAP		3  /* pass buf of r, g and b (unsigned char) */
#define AUX_GREYSCALEMAP	4
#define AUX_FOGMAP		5  /* pass fog and color bits (long) */
#define AUX_ONECOLOR		6  /* pass index, r, g, and b (long) */

/*
** Color Macros
*/

enum {
    AUX_BLACK = 0,
#ifdef __WIN32__
    AUX_RED=10,
#else
    AUX_RED,
#endif
    AUX_GREEN,
    AUX_YELLOW,
    AUX_BLUE,
    AUX_MAGENTA,
    AUX_CYAN,
    AUX_WHITE
};

#ifdef __WIN32__
    float auxRGBMap[17][3];
#else
    float auxRGBMap[8][3];
#endif

#define AUX_SETCOLOR(x, y) (AUX_WIND_IS_RGB((x)) ? \
		           glColor3fv(auxRGBMap[(y)]) : glIndexf((y)))

/*
** RGB Image Structure
*/

typedef struct _AUX_RGBImageRec {
    GLint sizeX, sizeY;
    unsigned char *data;
} AUX_RGBImageRec;

/*
** Prototypes
*/

 void auxInitDisplayMode(GLbitfield);
 void auxInitPosition(int, int, int, int);
 GLenum auxInitWindow(char *);
 void auxCloseWindow(void);
 void auxQuit(void);
 void auxSwapBuffers(void);

// Display *auxXDisplay(void);
// Window auxXWindow(void);

// void auxMainLoop(void (*)());
// void auxExposeFunc(void (*)(int, int));
// void auxReshapeFunc(void (*)(int, int));
// void auxIdleFunc(void (*)());
// void auxKeyFunc(int, void (*)());
// void auxMouseFunc(int, int, void (*)(AUX_EVENTREC *));

// void auxDeleteMouseFunc( int, int , void (*)(AUX_EVENTREC *));

 int auxGetColorMapSize(void);
 void auxGetMouseLoc(int *, int *);
 void auxSetOneColor(int, float, float, float);
 void auxSetFogRamp(int, int);
 void auxSetGreyRamp(void);
 void auxSetRGBMap(int, float *);

 AUX_RGBImageRec *auxRGBImageLoad(char *);

 void auxCreateFont(void);
 void auxDrawStr(char *);

 void auxWireSphere(GLdouble);
 void auxSolidSphere(GLdouble);
 void auxWireCube(GLdouble);
 void auxSolidCube(GLdouble);
 void auxWireBox(GLdouble, GLdouble, GLdouble);
 void auxSolidBox(GLdouble, GLdouble, GLdouble);
 void auxWireTorus(GLdouble, GLdouble);
 void auxSolidTorus(GLdouble, GLdouble);
 void auxWireCylinder(GLdouble, GLdouble);
 void auxSolidCylinder(GLdouble, GLdouble);
 void auxWireIcosahedron(GLdouble);
 void auxSolidIcosahedron(GLdouble);
 void auxWireOctahedron(GLdouble);
 void auxSolidOctahedron(GLdouble);
 void auxWireTetrahedron(GLdouble);
 void auxSolidTetrahedron(GLdouble);
 void auxWireDodecahedron(GLdouble);
 void auxSolidDodecahedron(GLdouble);
 void auxWireCone(GLdouble, GLdouble);
 void auxSolidCone(GLdouble, GLdouble);
 void auxWireTeapot(GLdouble);
 void auxSolidTeapot(GLdouble);

/* added for viewperf benchmark */
 void auxInitDisplayModePolicy( GLenum type );
 GLenum auxGetDisplayModePolicy( void );
 GLenum auxInitDisplayModeID( GLint id );
 GLint auxGetDisplayModeID( void );
 GLenum auxGetDisplayMode( void );

/*
 void auxGetScreenSize( GLint *width, GLint *height );

 void auxAnimation( GLint flag );
*/


#ifdef __cplusplus
}
#endif


#endif /* AUX_INCLUDED */