Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/post/src/glaux/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
#include <GL/gl.h>
43
#include <GL/glu.h>
44
45
#ifdef __cplusplus
46
extern "C" {
47
#endif
48
49
50
/*
51
** ToolKit Window Types
52
** In the future, AUX_RGBA may be a combination of both RGB and ALPHA
53
*/
54
55
#define AUX_RGB 0
56
#define AUX_RGBA AUX_RGB
57
#define AUX_INDEX 1
58
#define AUX_SINGLE 0
59
#define AUX_DOUBLE 2
60
#define AUX_DIRECT 0
61
#define AUX_INDIRECT 4
62
63
#define AUX_ACCUM 8
64
#define AUX_ALPHA 16
65
#define AUX_DEPTH 32
66
#define AUX_STENCIL 64
67
#define AUX_AUX 128
68
69
/*
70
** Window Masks
71
*/
72
73
#define AUX_WIND_IS_RGB(x) (((x) & AUX_INDEX) == 0)
74
#define AUX_WIND_IS_INDEX(x) (((x) & AUX_INDEX) != 0)
75
#define AUX_WIND_IS_SINGLE(x) (((x) & AUX_DOUBLE) == 0)
76
#define AUX_WIND_IS_DOUBLE(x) (((x) & AUX_DOUBLE) != 0)
77
#define AUX_WIND_IS_INDIRECT(x) (((x) & AUX_INDIRECT) != 0)
78
#define AUX_WIND_IS_DIRECT(x) (((x) & AUX_INDIRECT) == 0)
79
#define AUX_WIND_HAS_ACCUM(x) (((x) & AUX_ACCUM) != 0)
80
#define AUX_WIND_HAS_ALPHA(x) (((x) & AUX_ALPHA) != 0)
81
#define AUX_WIND_HAS_DEPTH(x) (((x) & AUX_DEPTH) != 0)
82
#define AUX_WIND_HAS_STENCIL(x) (((x) & AUX_STENCIL) != 0)
83
84
/*
85
** ToolKit Event Structure
86
*/
87
88
typedef struct _AUX_EVENTREC {
89
GLint event;
90
GLint data[4];
91
} AUX_EVENTREC;
92
93
/*
94
** ToolKit Event Types
95
*/
96
#define AUX_EXPOSE 1
97
#define AUX_CONFIG 2
98
#define AUX_DRAW 4
99
#define AUX_KEYEVENT 8
100
#define AUX_MOUSEDOWN 16
101
#define AUX_MOUSEUP 32
102
#define AUX_MOUSELOC 64
103
104
/*
105
** Toolkit Event Data Indices
106
*/
107
#define AUX_WINDOWX 0
108
#define AUX_WINDOWY 1
109
#define AUX_MOUSEX 0
110
#define AUX_MOUSEY 1
111
#define AUX_MOUSESTATUS 3
112
#define AUX_KEY 0
113
#define AUX_KEYSTATUS 1
114
115
/*
116
** ToolKit Event Status Messages
117
*/
118
#define AUX_LEFTBUTTON 1
119
#define AUX_RIGHTBUTTON 2
120
#define AUX_MIDDLEBUTTON 4
121
#define AUX_SHIFT 1
122
#define AUX_CONTROL 2
123
124
/*
125
** ToolKit Key Codes
126
*/
127
#define AUX_RETURN 0x0D
128
#define AUX_ESCAPE 0x1B
129
#define AUX_SPACE 0x20
130
#define AUX_LEFT 0x25
131
#define AUX_UP 0x26
132
#define AUX_RIGHT 0x27
133
#define AUX_DOWN 0x28
134
#define AUX_A 'A'
135
#define AUX_B 'B'
136
#define AUX_C 'C'
137
#define AUX_D 'D'
138
#define AUX_E 'E'
139
#define AUX_F 'F'
140
#define AUX_G 'G'
141
#define AUX_H 'H'
142
#define AUX_I 'I'
143
#define AUX_J 'J'
144
#define AUX_K 'K'
145
#define AUX_L 'L'
146
#define AUX_M 'M'
147
#define AUX_N 'N'
148
#define AUX_O 'O'
149
#define AUX_P 'P'
150
#define AUX_Q 'Q'
151
#define AUX_R 'R'
152
#define AUX_S 'S'
153
#define AUX_T 'T'
154
#define AUX_U 'U'
155
#define AUX_V 'V'
156
#define AUX_W 'W'
157
#define AUX_X 'X'
158
#define AUX_Y 'Y'
159
#define AUX_Z 'Z'
160
#define AUX_a 'a'
161
#define AUX_b 'b'
162
#define AUX_c 'c'
163
#define AUX_d 'd'
164
#define AUX_e 'e'
165
#define AUX_f 'f'
166
#define AUX_g 'g'
167
#define AUX_h 'h'
168
#define AUX_i 'i'
169
#define AUX_j 'j'
170
#define AUX_k 'k'
171
#define AUX_l 'l'
172
#define AUX_m 'm'
173
#define AUX_n 'n'
174
#define AUX_o 'o'
175
#define AUX_p 'p'
176
#define AUX_q 'q'
177
#define AUX_r 'r'
178
#define AUX_s 's'
179
#define AUX_t 't'
180
#define AUX_u 'u'
181
#define AUX_v 'v'
182
#define AUX_w 'w'
183
#define AUX_x 'x'
184
#define AUX_y 'y'
185
#define AUX_z 'z'
186
#define AUX_0 '0'
187
#define AUX_1 '1'
188
#define AUX_2 '2'
189
#define AUX_3 '3'
190
#define AUX_4 '4'
191
#define AUX_5 '5'
192
#define AUX_6 '6'
193
#define AUX_7 '7'
194
#define AUX_8 '8'
195
#define AUX_9 '9'
196
197
/*
198
** ToolKit Gets and Sets
199
*/
200
#define AUX_FD 1 /* return fd (long) */
201
#define AUX_COLORMAP 3 /* pass buf of r, g and b (unsigned char) */
202
#define AUX_GREYSCALEMAP 4
203
#define AUX_FOGMAP 5 /* pass fog and color bits (long) */
204
#define AUX_ONECOLOR 6 /* pass index, r, g, and b (long) */
205
206
/*
207
** Color Macros
208
*/
209
210
enum {
211
AUX_BLACK = 0,
212
AUX_RED,
213
AUX_GREEN,
214
AUX_YELLOW,
215
AUX_BLUE,
216
AUX_MAGENTA,
217
AUX_CYAN,
218
AUX_WHITE
219
};
220
221
extern float auxRGBMap[8][3];
222
223
#define AUX_SETCOLOR(x, y) (AUX_WIND_IS_RGB((x)) ? \
224
glColor3fv(auxRGBMap[(y)]) : glIndexf((y)))
225
226
/*
227
** RGB Image Structure
228
*/
229
230
typedef struct _AUX_RGBImageRec {
231
GLint sizeX, sizeY;
232
unsigned char *data;
233
} AUX_RGBImageRec;
234
235
/*
236
** Prototypes
237
*/
238
239
extern void auxInitDisplayMode(GLenum);
240
extern void auxInitPosition(int, int, int, int);
241
extern GLenum auxInitWindow(char *);
242
extern void auxCloseWindow(void);
243
extern void auxQuit(void);
244
extern void auxSwapBuffers(void);
245
246
extern Display *auxXDisplay(GLvoid);
247
extern Window auxXWindow(GLvoid);
248
249
extern void auxMainLoop(void (*)());
250
extern void auxExposeFunc(void (*)(int, int));
251
extern void auxReshapeFunc(void (*)(GLsizei, GLsizei));
252
extern void auxIdleFunc(void (*)());
253
extern void auxKeyFunc(int, void (*)());
254
extern void auxMouseFunc(int, int, void (*)(AUX_EVENTREC *));
255
256
extern int auxGetColorMapSize(void);
257
extern void auxGetMouseLoc(int *, int *);
258
extern void auxSetOneColor(int, float, float, float);
259
extern void auxSetFogRamp(int, int);
260
extern void auxSetGreyRamp(void);
261
extern void auxSetRGBMap(int, float *);
262
263
extern AUX_RGBImageRec *auxRGBImageLoad(char *);
264
265
extern void auxCreateFont(void);
266
extern void auxDrawStr(char *);
267
268
extern void auxWireSphere(GLdouble);
269
extern void auxSolidSphere(GLdouble);
270
extern void auxWireCube(GLdouble);
271
extern void auxSolidCube(GLdouble);
272
extern void auxWireBox(GLdouble, GLdouble, GLdouble);
273
extern void auxSolidBox(GLdouble, GLdouble, GLdouble);
274
extern void auxWireTorus(GLdouble, GLdouble);
275
extern void auxSolidTorus(GLdouble, GLdouble);
276
extern void auxWireCylinder(GLdouble, GLdouble);
277
extern void auxSolidCylinder(GLdouble, GLdouble);
278
extern void auxWireIcosahedron(GLdouble);
279
extern void auxSolidIcosahedron(GLdouble);
280
extern void auxWireOctahedron(GLdouble);
281
extern void auxSolidOctahedron(GLdouble);
282
extern void auxWireTetrahedron(GLdouble);
283
extern void auxSolidTetrahedron(GLdouble);
284
extern void auxWireDodecahedron(GLdouble);
285
extern void auxSolidDodecahedron(GLdouble);
286
extern void auxWireCone(GLdouble, GLdouble);
287
extern void auxSolidCone(GLdouble, GLdouble);
288
extern void auxWireTeapot(GLdouble);
289
extern void auxSolidTeapot(GLdouble);
290
291
#ifdef __cplusplus
292
}
293
#endif
294
295
#endif /* __aux_h__ */
296
297