Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/post/src/include/glaux.h
3203 views
1
/*
2
* (c) Copyright 1993, Silicon Graphics, Inc.
3
* ALL RIGHTS RESERVED
4
* Permission to use, copy, modify, and distribute this software for
5
* any purpose and without fee is hereby granted, provided that the above
6
* copyright notice appear in all copies and that both the copyright notice
7
* and this permission notice appear in supporting documentation, and that
8
* the name of Silicon Graphics, Inc. not be used in advertising
9
* or publicity pertaining to distribution of the software without specific,
10
* written prior permission.
11
*
12
* THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
13
* AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
14
* INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
15
* FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
16
* GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
17
* SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
18
* KIND, OR ANY DEMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
19
* LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
20
* THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
21
* ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
22
* ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THEj
23
* POSSESSION, USE OR PREFORMANCE OF THIS SOFTWARE.
24
*
25
* US Government Users Restricted Rights
26
* Use, duplication, or disclosure by the Government is subject to
27
* restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
28
* (c)(1)(ii) of the Rights in Technical Data and Computer Software
29
* clause at DFARS 252.227-7013 and/or in similar or successor
30
* clauses in the FAR or the DOD or NASA FAR Supplement.
31
* Unpublished-- rights reserved under the copyright laws of the
32
* United States. Contractor/manufacturer is Silicon Graphics,
33
* Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
34
*
35
* OpenGL(TM) is a trademark of Silicon Graphics, Inc.
36
*/
37
#ifndef __aux_h__
38
#define __aux_h__
39
40
#include <X11/Xlib.h>
41
#include <X11/Xutil.h>
42
43
44
#include <GL/gl.h>
45
#include <GL/glu.h>
46
47
48
49
#ifdef __cplusplus
50
extern "C" {
51
#endif
52
53
54
/*
55
** ToolKit Window Types
56
** In the future, AUX_RGBA may be a combination of both RGB and ALPHA
57
*/
58
59
#define AUX_RGB 0
60
#define AUX_RGBA AUX_RGB
61
#define AUX_INDEX 1
62
#define AUX_SINGLE 0
63
#define AUX_DOUBLE 2
64
#define AUX_DIRECT 0
65
#define AUX_INDIRECT 4
66
67
#define AUX_ACCUM 8
68
#define AUX_ALPHA 16
69
#define AUX_DEPTH 32
70
#define AUX_STENCIL 64
71
#define AUX_AUX 128
72
73
/*
74
** Window Masks
75
*/
76
77
#define AUX_WIND_IS_RGB(x) (((x) & AUX_INDEX) == 0)
78
#define AUX_WIND_IS_INDEX(x) (((x) & AUX_INDEX) != 0)
79
#define AUX_WIND_IS_SINGLE(x) (((x) & AUX_DOUBLE) == 0)
80
#define AUX_WIND_IS_DOUBLE(x) (((x) & AUX_DOUBLE) != 0)
81
#define AUX_WIND_IS_INDIRECT(x) (((x) & AUX_INDIRECT) != 0)
82
#define AUX_WIND_IS_DIRECT(x) (((x) & AUX_INDIRECT) == 0)
83
#define AUX_WIND_HAS_ACCUM(x) (((x) & AUX_ACCUM) != 0)
84
#define AUX_WIND_HAS_ALPHA(x) (((x) & AUX_ALPHA) != 0)
85
#define AUX_WIND_HAS_DEPTH(x) (((x) & AUX_DEPTH) != 0)
86
#define AUX_WIND_HAS_STENCIL(x) (((x) & AUX_STENCIL) != 0)
87
88
/*
89
** ToolKit Event Structure
90
*/
91
92
typedef struct _AUX_EVENTREC {
93
GLint event;
94
GLint data[4];
95
} AUX_EVENTREC;
96
97
/*
98
** ToolKit Event Types
99
*/
100
#define AUX_EXPOSE 1
101
#define AUX_CONFIG 2
102
#define AUX_DRAW 4
103
#define AUX_KEYEVENT 8
104
#define AUX_MOUSEDOWN 16
105
#define AUX_MOUSEUP 32
106
#define AUX_MOUSELOC 64
107
108
/*
109
** Toolkit Event Data Indices
110
*/
111
#define AUX_WINDOWX 0
112
#define AUX_WINDOWY 1
113
#define AUX_MOUSEX 0
114
#define AUX_MOUSEY 1
115
#define AUX_MOUSESTATUS 3
116
#define AUX_KEY 0
117
#define AUX_KEYSTATUS 1
118
119
/*
120
** ToolKit Event Status Messages
121
*/
122
#define AUX_LEFTBUTTON 1
123
#define AUX_RIGHTBUTTON 2
124
#define AUX_MIDDLEBUTTON 4
125
#define AUX_SHIFT 1
126
#define AUX_CONTROL 2
127
128
/*
129
** ToolKit Key Codes
130
*/
131
#define AUX_RETURN 0x0D
132
#define AUX_ESCAPE 0x1B
133
#define AUX_SPACE 0x20
134
#define AUX_LEFT 0x25
135
#define AUX_UP 0x26
136
#define AUX_RIGHT 0x27
137
#define AUX_DOWN 0x28
138
#define AUX_A 'A'
139
#define AUX_B 'B'
140
#define AUX_C 'C'
141
#define AUX_D 'D'
142
#define AUX_E 'E'
143
#define AUX_F 'F'
144
#define AUX_G 'G'
145
#define AUX_H 'H'
146
#define AUX_I 'I'
147
#define AUX_J 'J'
148
#define AUX_K 'K'
149
#define AUX_L 'L'
150
#define AUX_M 'M'
151
#define AUX_N 'N'
152
#define AUX_O 'O'
153
#define AUX_P 'P'
154
#define AUX_Q 'Q'
155
#define AUX_R 'R'
156
#define AUX_S 'S'
157
#define AUX_T 'T'
158
#define AUX_U 'U'
159
#define AUX_V 'V'
160
#define AUX_W 'W'
161
#define AUX_X 'X'
162
#define AUX_Y 'Y'
163
#define AUX_Z 'Z'
164
#define AUX_a 'a'
165
#define AUX_b 'b'
166
#define AUX_c 'c'
167
#define AUX_d 'd'
168
#define AUX_e 'e'
169
#define AUX_f 'f'
170
#define AUX_g 'g'
171
#define AUX_h 'h'
172
#define AUX_i 'i'
173
#define AUX_j 'j'
174
#define AUX_k 'k'
175
#define AUX_l 'l'
176
#define AUX_m 'm'
177
#define AUX_n 'n'
178
#define AUX_o 'o'
179
#define AUX_p 'p'
180
#define AUX_q 'q'
181
#define AUX_r 'r'
182
#define AUX_s 's'
183
#define AUX_t 't'
184
#define AUX_u 'u'
185
#define AUX_v 'v'
186
#define AUX_w 'w'
187
#define AUX_x 'x'
188
#define AUX_y 'y'
189
#define AUX_z 'z'
190
#define AUX_0 '0'
191
#define AUX_1 '1'
192
#define AUX_2 '2'
193
#define AUX_3 '3'
194
#define AUX_4 '4'
195
#define AUX_5 '5'
196
#define AUX_6 '6'
197
#define AUX_7 '7'
198
#define AUX_8 '8'
199
#define AUX_9 '9'
200
201
/*
202
** ToolKit Gets and Sets
203
*/
204
#define AUX_FD 1 /* return fd (long) */
205
#define AUX_COLORMAP 3 /* pass buf of r, g and b (unsigned char) */
206
#define AUX_GREYSCALEMAP 4
207
#define AUX_FOGMAP 5 /* pass fog and color bits (long) */
208
#define AUX_ONECOLOR 6 /* pass index, r, g, and b (long) */
209
210
/*
211
** Color Macros
212
*/
213
214
enum {
215
AUX_BLACK = 0,
216
AUX_RED,
217
AUX_GREEN,
218
AUX_YELLOW,
219
AUX_BLUE,
220
AUX_MAGENTA,
221
AUX_CYAN,
222
AUX_WHITE
223
};
224
225
extern float auxRGBMap[8][3];
226
227
#define AUX_SETCOLOR(x, y) (AUX_WIND_IS_RGB((x)) ? \
228
glColor3fv(auxRGBMap[(y)]) : glIndexf((y)))
229
230
/*
231
** RGB Image Structure
232
*/
233
234
typedef struct _AUX_RGBImageRec {
235
GLint sizeX, sizeY;
236
unsigned char *data;
237
} AUX_RGBImageRec;
238
239
/*
240
** Prototypes
241
*/
242
243
extern void auxInitDisplayMode(GLenum);
244
extern void auxInitPosition(int, int, int, int);
245
extern GLenum auxInitWindow(char *);
246
extern void auxCloseWindow(void);
247
extern void auxQuit(void);
248
extern void auxSwapBuffers(void);
249
250
extern Display *auxXDisplay(GLvoid);
251
extern Window auxXWindow(GLvoid);
252
253
extern void auxMainLoop(void (*)());
254
extern void auxExposeFunc(void (*)(int, int));
255
extern void auxReshapeFunc(void (*)(GLsizei, GLsizei));
256
extern void auxIdleFunc(void (*)());
257
extern void auxKeyFunc(int, void (*)());
258
extern void auxMouseFunc(int, int, void (*)(AUX_EVENTREC *));
259
260
extern int auxGetColorMapSize(void);
261
extern void auxGetMouseLoc(int *, int *);
262
extern void auxSetOneColor(int, float, float, float);
263
extern void auxSetFogRamp(int, int);
264
extern void auxSetGreyRamp(void);
265
extern void auxSetRGBMap(int, float *);
266
267
extern AUX_RGBImageRec *auxRGBImageLoad(char *);
268
269
extern void auxCreateFont(void);
270
extern void auxDrawStr(char *);
271
272
extern void auxWireSphere(GLdouble);
273
extern void auxSolidSphere(GLdouble);
274
extern void auxWireCube(GLdouble);
275
extern void auxSolidCube(GLdouble);
276
extern void auxWireBox(GLdouble, GLdouble, GLdouble);
277
extern void auxSolidBox(GLdouble, GLdouble, GLdouble);
278
extern void auxWireTorus(GLdouble, GLdouble);
279
extern void auxSolidTorus(GLdouble, GLdouble);
280
extern void auxWireCylinder(GLdouble, GLdouble);
281
extern void auxSolidCylinder(GLdouble, GLdouble);
282
extern void auxWireIcosahedron(GLdouble);
283
extern void auxSolidIcosahedron(GLdouble);
284
extern void auxWireOctahedron(GLdouble);
285
extern void auxSolidOctahedron(GLdouble);
286
extern void auxWireTetrahedron(GLdouble);
287
extern void auxSolidTetrahedron(GLdouble);
288
extern void auxWireDodecahedron(GLdouble);
289
extern void auxSolidDodecahedron(GLdouble);
290
extern void auxWireCone(GLdouble, GLdouble);
291
extern void auxSolidCone(GLdouble, GLdouble);
292
extern void auxWireTeapot(GLdouble);
293
extern void auxSolidTeapot(GLdouble);
294
295
#ifdef __cplusplus
296
}
297
#endif
298
299
#endif /* __aux_h__ */
300
301