author | Claus Gittinger <cg@exept.de> |
Fri, 08 Mar 1996 18:11:10 +0100 | |
changeset 524 | 577c0d1cb144 |
parent 448 | abcba4fa3fc0 |
child 528 | 22f4f7388a42 |
permissions | -rw-r--r-- |
0 | 1 |
" |
2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
77 | 3 |
All Rights Reserved |
0 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
XWorkstation subclass:#GLXWorkstation |
|
294 | 14 |
instanceVariableNames:'activeWindow hasStereoExtension glOK' |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
15 |
classVariableNames:'ForceGL' |
294 | 16 |
poolDictionaries:'' |
17 |
category:'Interface-Graphics' |
|
18 |
! |
|
77 | 19 |
|
89 | 20 |
!GLXWorkstation primitiveDefinitions! |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
21 |
|
0 | 22 |
%{ |
24 | 23 |
/* |
24 |
* on SGI, this class is compiled with -DGLX, while |
|
29 | 25 |
* for simulation (using vogl), this is compiled with -DVGL |
24 | 26 |
*/ |
29 | 27 |
|
0 | 28 |
/* |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
29 |
* define this (or compile with -DFULL_GLX) to enable: |
46 | 30 |
* blendcolor getgconfig getmultisample leftbuffer rightbuffer monobuffer |
31 |
* msalpha msmask mspattern mssize multisample stereobuffer |
|
32 |
* t3s t3i t3f t3d t4s t4i t4f t4d tlutbind zbsize |
|
33 |
* |
|
34 |
* these are not available on all gl's |
|
35 |
*/ |
|
36 |
||
37 |
/* #define FULL_GLX */ |
|
38 |
||
39 |
/* |
|
0 | 40 |
* this is stupid, GLX defines String, which is also defined here ... |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
41 |
* ... and xlib defines True and False |
0 | 42 |
*/ |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
43 |
# undef String |
29 | 44 |
# define String GLX_String |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
45 |
# undef True |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
46 |
# undef False |
24 | 47 |
|
168 | 48 |
#include <stdio.h> |
49 |
||
24 | 50 |
#ifdef GLX |
0 | 51 |
# include <gl/glws.h> |
12 | 52 |
# include <gl/sphere.h> |
24 | 53 |
#else |
82 | 54 |
# undef memset |
24 | 55 |
# include <vogl.h> |
157 | 56 |
# undef move |
24 | 57 |
# include <X11/Xlib.h> |
58 |
#endif |
|
0 | 59 |
|
185 | 60 |
/* |
61 |
* XSGIStereo extension - if available |
|
62 |
*/ |
|
63 |
#ifdef XSGIStereo |
|
64 |
# include <X11/extensions/SGIStereo.h> |
|
65 |
#endif |
|
66 |
||
35 | 67 |
#ifndef NULL |
58 | 68 |
# define NULL (char *)0 /* sigh */ |
35 | 69 |
#endif |
70 |
||
0 | 71 |
typedef enum { |
72 |
GLXcolorIndexSingleBuffer, |
|
73 |
GLXcolorIndexDoubleBuffer, |
|
74 |
GLXrgbSingleBuffer, |
|
75 |
GLXrgbDoubleBuffer |
|
76 |
} GLXWindowType; |
|
77 |
||
151 | 78 |
/* |
30 | 79 |
extern Window GLXCreateWindow(); |
151 | 80 |
*/ |
24 | 81 |
|
333 | 82 |
# define ENTERGLX __BEGIN_PROTECT_REGISTERS__ |
83 |
# define LEAVEGLX __END_PROTECT_REGISTERS__ |
|
134 | 84 |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
85 |
/* |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
86 |
* stupid again - from now on, we need ST/X's String again |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
87 |
*/ |
0 | 88 |
#undef String |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
89 |
#ifdef __DEF_STRING |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
90 |
# define String __DEF_String |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
91 |
#endif |
0 | 92 |
|
93 |
/* |
|
94 |
* some defines - tired of typing ... |
|
29 | 95 |
* most of these macros/functions extract values from smalltalk objects and |
96 |
* put/pack them into corresponding c variables. |
|
97 |
* |
|
0 | 98 |
*/ |
207
9124817bbb03
use new c-pointer wrapper macros (based on externalAddress)
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
99 |
#define myDpy (Display *)(__MKCP(_INST(displayId))) |
9124817bbb03
use new c-pointer wrapper macros (based on externalAddress)
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
100 |
#define ISCONNECTED (_INST(displayId) != nil) |
9124817bbb03
use new c-pointer wrapper macros (based on externalAddress)
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
101 |
#define _WindowVal(o) (Window)(__MKCP(o)) |
0 | 102 |
|
157 | 103 |
/* |
104 |
* set the GLXWindow for followup drawing |
|
105 |
*/ |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
106 |
#define SETWIN(aGLXWindowId) \ |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
107 |
if (_INST(activeWindow) != aGLXWindowId) { \ |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
108 |
if (! ISCONNECTED ) { \ |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
109 |
RETURN (false); \ |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
110 |
} \ |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
111 |
if (! __isExternalAddress(aGLXWindowId)) { \ |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
112 |
RETURN (false); \ |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
113 |
} \ |
207
9124817bbb03
use new c-pointer wrapper macros (based on externalAddress)
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
114 |
if (GLXwinset(myDpy, _WindowVal(aGLXWindowId)) < 0) { \ |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
115 |
RETURN (false); \ |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
116 |
} \ |
214
5316b1373129
oops - glOk was left undefined
Claus Gittinger <cg@exept.de>
parents:
213
diff
changeset
|
117 |
_INST(activeWindow) = aGLXWindowId; \ |
5316b1373129
oops - glOk was left undefined
Claus Gittinger <cg@exept.de>
parents:
213
diff
changeset
|
118 |
__STORE(self, aGLXWindowId); \ |
5316b1373129
oops - glOk was left undefined
Claus Gittinger <cg@exept.de>
parents:
213
diff
changeset
|
119 |
} else { \ |
5316b1373129
oops - glOk was left undefined
Claus Gittinger <cg@exept.de>
parents:
213
diff
changeset
|
120 |
if (aGLXWindowId == nil) { \ |
5316b1373129
oops - glOk was left undefined
Claus Gittinger <cg@exept.de>
parents:
213
diff
changeset
|
121 |
RETURN (false); \ |
5316b1373129
oops - glOk was left undefined
Claus Gittinger <cg@exept.de>
parents:
213
diff
changeset
|
122 |
} \ |
12 | 123 |
} |
124 |
||
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
125 |
#define __MKBOOLEAN(b) ((b==FALSE) ? false : true) |
157 | 126 |
#define _booleanVal(b) ((b==false) ? (Boolean)FALSE : (Boolean)TRUE) |
127 |
#define _coordVal(c) \ |
|
128 |
((__isFloat(c)) ? (Coord)(_floatVal(c)) \ |
|
185 | 129 |
: (Coord)(__intVal(c))) |
130 |
#define _icoordVal(c) ((Icoord)(__intVal(c))) |
|
131 |
#define _scoordVal(c) ((Scoord)(__intVal(c))) |
|
132 |
#define _screencoordVal(c) ((Screencoord)(__intVal(c))) |
|
133 |
#define _colorindexVal(c) ((Colorindex)(__intVal(c))) |
|
134 |
#define _linestyleVal(l) ((Linestyle)(__intVal(l))) |
|
135 |
#define _shortVal(l) ((short)(__intVal(l))) |
|
136 |
#define _longVal(l) ((long)(__intVal(l))) |
|
137 |
#define _deviceVal(l) ((Device)(__intVal(l))) |
|
138 |
#define _tagVal(l) ((Tag)(__intVal(l))) |
|
139 |
#define _objectVal(l) ((Object)(__intVal(l))) |
|
140 |
#define _offsetVal(l) ((Offset)(__intVal(l))) |
|
141 |
#define _rgbVal(l) ((RGBvalue)(__intVal(l))) |
|
142 |
#define _angleVal(c) ((Angle)(__intVal(c))) |
|
157 | 143 |
|
29 | 144 |
/* |
145 |
* check for and fetch a boolean from ST-arg into C-dst |
|
157 | 146 |
* ST-object must be true or false. Return wth false if invalid. |
29 | 147 |
*/ |
148 |
#define _BOOLEAN_(arg, dst) \ |
|
30 | 149 |
if (arg==true) \ |
77 | 150 |
dst = (Boolean)TRUE; \ |
30 | 151 |
else if (arg==false) \ |
77 | 152 |
dst = (Boolean)FALSE; \ |
29 | 153 |
else { RETURN(false); } |
154 |
||
155 |
/* |
|
156 |
* check for and fetch a coord from ST-arg into C-dst |
|
157 | 157 |
* ST-object must be Float, SmallInteger or Fraction. |
158 |
* Return wth false if invalid. |
|
29 | 159 |
*/ |
0 | 160 |
#define _COORD_(arg, dst) \ |
97 | 161 |
if (__isFloat(arg)) \ |
77 | 162 |
dst = (Coord)(_floatVal(arg)); \ |
97 | 163 |
else if (__isSmallInteger(arg)) \ |
185 | 164 |
dst = (Coord)(__intVal(arg)); \ |
97 | 165 |
else if (__isFraction(arg) \ |
166 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_numerator) \ |
|
167 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_denominator)) { \ |
|
77 | 168 |
float n, d; \ |
169 |
\ |
|
185 | 170 |
n = (float)(__intVal(_FractionInstPtr(arg)->f_numerator)); \ |
171 |
d = (float)(__intVal(_FractionInstPtr(arg)->f_denominator)); \ |
|
77 | 172 |
dst = (Coord)(n / d); \ |
29 | 173 |
} else { RETURN(false); } |
174 |
||
175 |
/* |
|
176 |
* check for and fetch an icoord from ST-arg into C-dst |
|
157 | 177 |
* ST-object must be SmallInteger. Return wth false if invalid. |
29 | 178 |
*/ |
179 |
#define _ICOORD_(arg, dst) \ |
|
97 | 180 |
if (__isSmallInteger(arg)) \ |
185 | 181 |
dst = (Icoord)(__intVal(arg)); \ |
29 | 182 |
else { RETURN(false); } |
183 |
||
184 |
/* |
|
157 | 185 |
* check for and fetch an scoord from ST-arg into C-dst |
186 |
* ST-object must be SmallInteger. Return wth false if invalid. |
|
29 | 187 |
*/ |
188 |
#define _SCOORD_(arg, dst) \ |
|
97 | 189 |
if (__isSmallInteger(arg)) \ |
185 | 190 |
dst = (Scoord)(__intVal(arg)); \ |
29 | 191 |
else { RETURN(false); } |
192 |
||
193 |
#define _SCREENCOORD_(arg, dst) \ |
|
97 | 194 |
if (__isSmallInteger(arg)) \ |
185 | 195 |
dst = (Screencoord)(__intVal(arg)); \ |
29 | 196 |
else { RETURN(false); } |
197 |
||
198 |
#define _COLORINDEX_(arg, dst) \ |
|
97 | 199 |
if (__isSmallInteger(arg)) \ |
185 | 200 |
dst = (Colorindex)(__intVal(arg)); \ |
29 | 201 |
else { RETURN(false); } |
202 |
||
203 |
#define _ANGLE_(arg, dst) \ |
|
97 | 204 |
if (__isSmallInteger(arg)) \ |
185 | 205 |
dst = (Angle)(__intVal(arg)); \ |
29 | 206 |
else { RETURN(false); } |
0 | 207 |
|
208 |
#define _FLOAT_(arg, dst) \ |
|
97 | 209 |
if (__isFloat(arg)) \ |
77 | 210 |
dst = (float)(_floatVal(arg)); \ |
97 | 211 |
else if (__isSmallInteger(arg)) \ |
185 | 212 |
dst = (float)(__intVal(arg)); \ |
97 | 213 |
else if (__isFraction(arg) \ |
214 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_numerator) \ |
|
215 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_denominator)) { \ |
|
77 | 216 |
float n, d; \ |
217 |
\ |
|
185 | 218 |
n = (float)(__intVal(_FractionInstPtr(arg)->f_numerator)); \ |
219 |
d = (float)(__intVal(_FractionInstPtr(arg)->f_denominator)); \ |
|
77 | 220 |
dst = (float)(n / d); \ |
29 | 221 |
} else { RETURN(false); } |
0 | 222 |
|
223 |
#define _INT_(arg, dst) \ |
|
97 | 224 |
if (__isSmallInteger(arg)) \ |
185 | 225 |
dst = (int)(__intVal(arg)); \ |
29 | 226 |
else { RETURN(false); } |
227 |
||
30 | 228 |
#define _indexedArea(object) \ |
229 |
(((char *) (_InstPtr(object))) \ |
|
77 | 230 |
+ OHDR_SIZE \ |
185 | 231 |
+ (__intVal(_ClassInstPtr(__qClass(object))->c_ninstvars)) * sizeof(OBJ)) |
77 | 232 |
%} |
233 |
! ! |
|
234 |
||
168 | 235 |
!GLXWorkstation primitiveVariables! |
236 |
%{ |
|
237 |
/* |
|
238 |
* remembered info from private error handler |
|
239 |
*/ |
|
240 |
static char lastErrorMsg[80] = ""; |
|
241 |
static unsigned lastRequestCode = 0; |
|
242 |
static unsigned lastMinorCode = 0; |
|
243 |
static unsigned lastResource = 0; |
|
244 |
||
245 |
%} |
|
246 |
! ! |
|
247 |
||
89 | 248 |
!GLXWorkstation primitiveFunctions! |
77 | 249 |
%{ |
151 | 250 |
|
168 | 251 |
/* |
252 |
* catch X-errors and forward as errorInterrupt:#DisplayError, |
|
253 |
* (which itself invokes my handler and optionally raises an exceptionSignal) |
|
254 |
* the implementation below is somewhat wrong: it will |
|
255 |
* report all errors for Display, even though there could be |
|
256 |
* more than one display connection. (being fixed, new errorInterrupt mechanism |
|
257 |
* allows passing an additional argument, which is the displayID ...) |
|
258 |
* |
|
259 |
* this dublicates the functionality as found in XWorkstation; |
|
260 |
* the reason is to allow dynamic loading systems to load this module |
|
261 |
* before XWorkstation (which was not possible otherwise, due to unresolved |
|
262 |
* external references while loading this one) |
|
263 |
*/ |
|
264 |
static |
|
265 |
__XErrorHandler__(dpy, event) |
|
266 |
Display *dpy; |
|
267 |
XErrorEvent *event; |
|
268 |
{ |
|
269 |
XGetErrorText(dpy, event->error_code, lastErrorMsg, 80); |
|
270 |
if (lastErrorMsg[0] == '\0') { |
|
185 | 271 |
sprintf(lastErrorMsg, "code: %d", event->error_code); |
168 | 272 |
} |
273 |
lastRequestCode = event->request_code; |
|
274 |
lastMinorCode = event->minor_code; |
|
275 |
lastResource = event->resourceid; |
|
276 |
||
218
10072d9beba5
can now turn off Xlib error messages from the errorHandler
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
277 |
if (@global(ErrorPrinting) == true) { |
219
9ff0660f447f
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
218
diff
changeset
|
278 |
fprintf(stderr, "XWORKSTAT: x-error cought maj=%d (0x%x) min=%d (0x%x) resource=%x\n", |
9ff0660f447f
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
218
diff
changeset
|
279 |
event->request_code, event->request_code, |
9ff0660f447f
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
218
diff
changeset
|
280 |
event->minor_code, event->minor_code, event->resourceid); |
9ff0660f447f
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
218
diff
changeset
|
281 |
fprintf(stderr, "XWORKSTAT: x-error message is '%s'\n", lastErrorMsg); |
218
10072d9beba5
can now turn off Xlib error messages from the errorHandler
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
282 |
} |
168 | 283 |
|
207
9124817bbb03
use new c-pointer wrapper macros (based on externalAddress)
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
284 |
__errorInterruptWithIDAndParameter__(@symbol(DisplayError), __MKOBJ(dpy)); |
168 | 285 |
return 0; |
286 |
} |
|
287 |
||
151 | 288 |
/* |
289 |
* begin moved from GLXsupport.c |
|
290 |
*/ |
|
291 |
||
292 |
/* |
|
293 |
* GLXsupport.c: |
|
294 |
* |
|
295 |
* This file provides a helper function "GLXCreateWindow", which does |
|
296 |
* all the necessary magic to create an X window suitable for GL drawing |
|
297 |
* to take place within. see the definition of GLXCreateWindow for a |
|
298 |
* description of how to call it. |
|
299 |
* |
|
300 |
* claus: I really had no time to look into all this, |
|
301 |
* this file has been just copied from a 4Dgifts demo .. |
|
302 |
* (will need more than a day to show more ...) |
|
303 |
*/ |
|
304 |
#if defined(GLX) || defined(VGL) |
|
305 |
||
306 |
#include <X11/Xlib.h> |
|
307 |
#include <X11/Xutil.h> |
|
308 |
#ifndef VGL |
|
309 |
# include <gl/glws.h> |
|
310 |
#endif |
|
311 |
#include <signal.h> |
|
312 |
#include <setjmp.h> |
|
313 |
#include "stcIntern.h" |
|
314 |
||
315 |
/* |
|
316 |
* glxhelper.h: |
|
317 |
* |
|
318 |
* List of drawing modes supported by GLXCreateWindow (in glxhelper.c). |
|
319 |
* More than this are possible with mixed model, but this is just an |
|
320 |
* example. You can either expand this list (and the corresponding code in |
|
321 |
* GLXCreateWindow) or call the mixed model calls yourself, using |
|
322 |
* GLXCreateWindow as an example. |
|
323 |
*/ |
|
324 |
||
325 |
static char *typeToName[] = { |
|
326 |
"color index single buffer", |
|
327 |
"color index double buffer", |
|
328 |
"rgb single buffer", |
|
329 |
"rgb double buffer", |
|
330 |
}; |
|
331 |
||
332 |
#ifndef VGL |
|
333 |
/* |
|
334 |
* Dorky little helper function used to build up a GLXconfig array. |
|
335 |
*/ |
|
336 |
||
337 |
static void set_entry (GLXconfig* ptr, int b, int m, int a) |
|
338 |
{ |
|
339 |
ptr->buffer = b; |
|
340 |
ptr->mode = m; |
|
341 |
ptr->arg = a; |
|
342 |
} |
|
343 |
#endif /* VGL */ |
|
344 |
||
345 |
static JMP_BUF errorReturn; |
|
346 |
||
347 |
static void |
|
348 |
glAbort() { |
|
349 |
longjmp(errorReturn, 1); |
|
350 |
} |
|
351 |
||
352 |
/* |
|
353 |
* GLXCreateWindow(dpy, parent, x, y, w, h, boderWidth, type) |
|
354 |
* |
|
355 |
* Return value is the X window id of the newly created window. |
|
356 |
* |
|
357 |
* Arguments are: |
|
358 |
* dpy The X "Display*" returned by XOpenDisplay |
|
359 |
* parent The parent of the newly created window, |
|
360 |
* a typical value for this is |
|
361 |
* RootWindow(dpy, DefaultScreen(dpy)) |
|
362 |
* x,y The location of the window to be created, |
|
363 |
* y coordinate is measured from the top down. |
|
364 |
* w,h size of the new window |
|
365 |
* borderWidth the X border size for this window, should probably |
|
366 |
* be zero. |
|
367 |
* type the GLXWindowType (see glxhelper.h) desribing the |
|
368 |
* typer of GL drawing to be done in this window |
|
369 |
*/ |
|
370 |
static Window |
|
371 |
GLXCreateWindow(dpy, parent, x, y, w, h, borderWidth, type) |
|
372 |
Display* dpy; |
|
373 |
Window parent; |
|
374 |
GLXWindowType type; |
|
375 |
{ |
|
376 |
#ifdef VGL |
|
377 |
Visual visual; |
|
378 |
#else |
|
379 |
GLXconfig params[50]; |
|
380 |
GLXconfig* next; |
|
381 |
GLXconfig* retconfig; |
|
382 |
Colormap cmap = DefaultColormap(dpy, DefaultScreen(dpy)); |
|
383 |
XVisualInfo *vis; |
|
384 |
#endif |
|
385 |
XVisualInfo template; |
|
386 |
XColor white; |
|
387 |
XSetWindowAttributes cwa; |
|
388 |
XWindowAttributes pwa; |
|
389 |
int scr, i, nret; |
|
390 |
Window win; |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
391 |
#ifdef HAS_SIGACTION |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
392 |
struct sigaction oldSig, newSig; |
151 | 393 |
#else |
394 |
void *oldSig; |
|
395 |
#endif |
|
396 |
||
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
397 |
__catchExit(1); |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
398 |
|
151 | 399 |
if (setjmp(errorReturn)) { |
400 |
printf("hard error in GL - return\n"); |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
401 |
#ifdef HAS_SIGACTION |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
402 |
sigaction(SIGSEGV, &oldSig, 0); |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
403 |
#else |
151 | 404 |
signal(SIGSEGV, oldSig); |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
405 |
#endif |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
406 |
__catchExit(0); |
151 | 407 |
return 0; |
408 |
} |
|
409 |
__CONT__ |
|
410 |
||
411 |
#ifdef VGL |
|
412 |
/* |
|
413 |
* I know what VGL supports; its somewhat unclean to hard code it here |
|
414 |
*/ |
|
415 |
switch (type) { |
|
416 |
case GLXcolorIndexSingleBuffer: |
|
417 |
case GLXcolorIndexDoubleBuffer: |
|
418 |
break; |
|
419 |
||
420 |
case GLXrgbSingleBuffer: |
|
421 |
case GLXrgbDoubleBuffer: |
|
422 |
printf("Sorry, VGL can't support %s type of windows\n", typeToName[type]); |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
423 |
__catchExit(0); |
151 | 424 |
return 0; |
425 |
} |
|
426 |
||
427 |
scr = DefaultScreen(dpy); |
|
428 |
visual.visualid = CopyFromParent; |
|
429 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
430 |
if (w <= 0) { |
|
431 |
printf("VGL: bad width: %d\n", w); |
|
432 |
w = 1; |
|
433 |
} |
|
434 |
if (h <= 0) { |
|
435 |
printf("VGL: bad height: %d\n", h); |
|
436 |
h = 1; |
|
437 |
} |
|
438 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
439 |
borderWidth, DisplayPlanes(dpy, scr), |
|
440 |
InputOutput, &visual, |
|
441 |
CWBorderPixel, &cwa); |
|
442 |
||
443 |
/* |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
444 |
* on some, seg-violations occur in the GL, if too many |
151 | 445 |
* views are created ... just to make certain, we catch those |
446 |
* in GL too. |
|
447 |
*/ |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
448 |
# ifdef HAS_SIGACTION |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
449 |
sigaction(SIGSEGV, (struct sigaction *)0, &oldSig); |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
450 |
newSig = oldSig; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
451 |
newSig.sa_handler = glAbort; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
452 |
sigaction(SIGSEGV, &newSig, (struct sigaction *)0); |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
453 |
# else |
151 | 454 |
oldSig = signal(SIGSEGV, glAbort); |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
455 |
# endif |
151 | 456 |
i = GLXlink(dpy, win); |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
457 |
# ifdef HAS_SIGACTION |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
458 |
sigaction(SIGSEGV, &oldSig, (struct sigaction *)0); |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
459 |
# else |
151 | 460 |
signal(SIGSEGV, oldSig); |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
461 |
# endif |
151 | 462 |
|
463 |
if (i < 0) { |
|
464 |
printf("GLXlink returned %d\n", i); |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
465 |
__catchExit(0); |
151 | 466 |
return 0; |
467 |
} |
|
468 |
#else /* not VGL */ |
|
469 |
/* |
|
470 |
* This builds an array in "params" that describes for GLXgetconfig(3G) |
|
471 |
* the type of GL drawing that will be done. |
|
472 |
*/ |
|
473 |
next = params; |
|
474 |
switch (type) { |
|
475 |
case GLXcolorIndexSingleBuffer: |
|
476 |
set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE); |
|
477 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE); |
|
478 |
break; |
|
479 |
case GLXcolorIndexDoubleBuffer: |
|
480 |
set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE); |
|
481 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE); |
|
482 |
break; |
|
483 |
case GLXrgbSingleBuffer: |
|
484 |
set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE); |
|
485 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE); |
|
486 |
break; |
|
487 |
case GLXrgbDoubleBuffer: |
|
488 |
set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE); |
|
489 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE); |
|
490 |
break; |
|
491 |
} |
|
492 |
set_entry(next, 0, 0, 0); /* The input to GLXgetconfig is null terminated */ |
|
493 |
||
494 |
/* |
|
495 |
* Get configuration data for a window based on above parameters |
|
496 |
* First we have to find out which screen the parent window is on, |
|
497 |
* then we can call GXLgetconfig() |
|
498 |
*/ |
|
499 |
XGetWindowAttributes(dpy, parent, &pwa); |
|
500 |
retconfig = GLXgetconfig(dpy, XScreenNumberOfScreen(pwa.screen), params); |
|
501 |
if (retconfig == 0) { |
|
502 |
printf("Sorry, can't support %s type of windows\n", typeToName[type]); |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
503 |
__catchExit(0); |
151 | 504 |
return 0; |
505 |
} |
|
506 |
||
507 |
/* |
|
508 |
* Scan through config info, pulling info needed to create a window |
|
509 |
* that supports the rendering mode. |
|
510 |
*/ |
|
511 |
for (next = retconfig; next->buffer; next++) { |
|
512 |
unsigned long buffer = next->buffer; |
|
513 |
unsigned long mode = next->mode; |
|
514 |
unsigned long value = next->arg; |
|
515 |
switch (mode) { |
|
516 |
case GLX_COLORMAP: |
|
517 |
if (buffer == GLX_NORMAL) { |
|
518 |
cmap = value; |
|
519 |
} |
|
520 |
break; |
|
521 |
case GLX_VISUAL: |
|
522 |
if (buffer == GLX_NORMAL) { |
|
523 |
template.visualid = value; |
|
524 |
template.screen = DefaultScreen(dpy); |
|
525 |
vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask, |
|
526 |
&template, &nret); |
|
527 |
} |
|
528 |
break; |
|
529 |
} |
|
530 |
} |
|
531 |
||
532 |
/* |
|
533 |
* Create the window |
|
534 |
*/ |
|
535 |
cwa.colormap = cmap; |
|
536 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
537 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
538 |
borderWidth, vis->depth, InputOutput, vis->visual, |
|
539 |
CWColormap|CWBorderPixel, &cwa); |
|
540 |
||
541 |
/* |
|
542 |
* Rescan configuration info and find window slot that getconfig |
|
543 |
* provided. Fill it in with the window we just created. |
|
544 |
*/ |
|
545 |
for (next = retconfig; next->buffer; next++) { |
|
546 |
if ((next->buffer == GLX_NORMAL) && (next->mode == GLX_WINDOW)) { |
|
547 |
next->arg = win; |
|
548 |
break; |
|
549 |
} |
|
550 |
} |
|
551 |
||
552 |
/* |
|
553 |
* Now "retconfig" contains all the information the GL needs to |
|
554 |
* configure the window and its own internal state. |
|
555 |
*/ |
|
556 |
/* |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
557 |
* on iris, seg-violations occur in the GL, if too many |
151 | 558 |
* views are created ... |
559 |
*/ |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
560 |
# ifdef HAS_SIGACTION |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
561 |
sigaction(SIGSEGV, (struct sigaction *)0, &oldSig); |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
562 |
newSig = oldSig; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
563 |
newSig.sa_handler = glAbort; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
564 |
sigaction(SIGSEGV, &newSig, (struct sigaction *)0); |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
565 |
# else |
151 | 566 |
oldSig = signal(SIGSEGV, glAbort); |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
567 |
# endif |
151 | 568 |
i = GLXlink(dpy, retconfig); |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
569 |
# ifdef HAS_SIGACTION |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
570 |
sigaction(SIGSEGV, &oldSig, (struct sigaction *)0); |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
571 |
# else |
151 | 572 |
signal(SIGSEGV, oldSig); |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
573 |
# endif |
151 | 574 |
|
575 |
if (i < 0) { |
|
576 |
printf("GLXlink returned %d\n", i); |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
577 |
__catchExit(0); |
151 | 578 |
return 0; |
579 |
} |
|
580 |
||
581 |
/* |
|
582 |
* The GL sets its own X error handlers, which exits - this is not what we want |
|
583 |
*/ |
|
584 |
XSetErrorHandler(__XErrorHandler__); |
|
585 |
#endif |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
586 |
__catchExit(0); |
151 | 587 |
return win; |
588 |
} |
|
589 |
||
590 |
static |
|
591 |
GLXUnlinkWindow(dpy, win) |
|
592 |
Display* dpy; |
|
593 |
Window win; |
|
594 |
{ |
|
595 |
/* |
|
596 |
* only needed for VGL - GLX does it automatically |
|
597 |
*/ |
|
598 |
#ifdef VGL |
|
599 |
GLXunlink(dpy, win); |
|
600 |
#endif |
|
601 |
} |
|
602 |
||
603 |
#endif /* GLX or VGL */ |
|
604 |
||
605 |
/* |
|
606 |
* end moved from GLXsupport.c |
|
607 |
*/ |
|
608 |
||
29 | 609 |
/* |
64 | 610 |
* helper for rotation - call rot() |
29 | 611 |
*/ |
612 |
static OBJ |
|
613 |
doRotate(angle, axis) |
|
614 |
OBJ angle; |
|
615 |
char axis; |
|
616 |
{ |
|
617 |
Angle a_angle; |
|
618 |
float f_angle; |
|
619 |
||
35 | 620 |
if (__isFloat(angle)) { |
77 | 621 |
f_angle = (float)(_floatVal(angle)); |
622 |
if (f_angle != 0.0) |
|
623 |
rot(f_angle, axis); |
|
624 |
return (true); |
|
29 | 625 |
} |
35 | 626 |
if (__isFraction(angle) |
97 | 627 |
&& __isSmallInteger(_FractionInstPtr(angle)->f_numerator) |
628 |
&& __isSmallInteger(_FractionInstPtr(angle)->f_denominator)) { |
|
77 | 629 |
float n, d; |
630 |
||
185 | 631 |
n = (float)(__intVal(_FractionInstPtr(angle)->f_numerator)); |
632 |
d = (float)(__intVal(_FractionInstPtr(angle)->f_denominator)); |
|
77 | 633 |
f_angle = n / d; |
634 |
if (f_angle != 0.0) |
|
635 |
rot(f_angle, axis); |
|
636 |
return (true); |
|
29 | 637 |
} |
97 | 638 |
if (__isSmallInteger(angle)) { |
185 | 639 |
f_angle = (float)(__intVal(angle)); |
77 | 640 |
if (f_angle != 0.0) |
641 |
rot(f_angle, axis); |
|
642 |
return (true); |
|
29 | 643 |
} |
644 |
return false; |
|
645 |
} |
|
0 | 646 |
|
24 | 647 |
/* |
29 | 648 |
* fetch integers from an st-array (elements must be smallIntegers) |
649 |
*/ |
|
650 |
static long * |
|
651 |
getLongsFromInto(obj, vec, count) |
|
652 |
OBJ obj; |
|
653 |
long *vec; |
|
654 |
{ |
|
655 |
OBJ cls, o; |
|
656 |
int nByte, i, ninstVars, nInstBytes; |
|
657 |
char *pElem; |
|
658 |
||
659 |
if (! _isNonNilObject(obj)) return (long *)NULL; |
|
134 | 660 |
cls = __qClass(obj); |
185 | 661 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 662 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 663 |
nByte = __qSize(obj) - nInstBytes; |
29 | 664 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
665 |
if (nByte < (count * sizeof(OBJ))) return (long *)NULL; |
|
666 |
for (i=0; i<count; i++) { |
|
77 | 667 |
o = *(OBJ *)pElem; |
97 | 668 |
if (! __isSmallInteger(o)) return (long *)NULL; |
185 | 669 |
vec[i] = (long)__intVal(o); |
77 | 670 |
pElem += sizeof(OBJ); |
29 | 671 |
} |
672 |
return vec; |
|
673 |
} |
|
674 |
||
675 |
/* |
|
676 |
* fetch shorts from an st-array (elements must be smallIntegers) |
|
677 |
*/ |
|
678 |
static short * |
|
679 |
getShortsFromInto(obj, vec, count) |
|
680 |
OBJ obj; |
|
681 |
short *vec; |
|
682 |
{ |
|
683 |
OBJ cls, o; |
|
684 |
int nByte, i, ninstVars, nInstBytes; |
|
685 |
char *pElem; |
|
686 |
||
687 |
if (! _isNonNilObject(obj)) return (short *)NULL; |
|
134 | 688 |
cls = __qClass(obj); |
185 | 689 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 690 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 691 |
nByte = __qSize(obj) - nInstBytes; |
29 | 692 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
693 |
if (nByte < (count * sizeof(OBJ))) return (short *)NULL; |
|
694 |
for (i=0; i<count; i++) { |
|
77 | 695 |
o = *(OBJ *)pElem; |
97 | 696 |
if (! __isSmallInteger(o)) return (short *)NULL; |
185 | 697 |
vec[i] = (short)__intVal(o); |
77 | 698 |
pElem += sizeof(OBJ); |
29 | 699 |
} |
700 |
return vec; |
|
701 |
} |
|
702 |
||
703 |
/* |
|
704 |
* fetch floats from an st-object into a c-float array |
|
705 |
* which may be a floatArray, doubleArray or array-of-something, |
|
706 |
* where something may be a float, fraction or smallInteger, |
|
24 | 707 |
*/ |
12 | 708 |
static float * |
709 |
getFloatsFromInto(obj, vec, count) |
|
710 |
OBJ obj; |
|
711 |
float *vec; |
|
712 |
{ |
|
713 |
OBJ cls; |
|
714 |
int nByte; |
|
715 |
OBJ o; |
|
716 |
int i, ninstVars, nInstBytes; |
|
717 |
char *pElem; |
|
718 |
||
719 |
if (! _isNonNilObject(obj)) return (float *)0; |
|
720 |
||
134 | 721 |
cls = __qClass(obj); |
185 | 722 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
12 | 723 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 724 |
nByte = __qSize(obj) - nInstBytes; |
12 | 725 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
726 |
||
185 | 727 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
12 | 728 |
case FLOATARRAY: |
77 | 729 |
/* |
730 |
* best speed for float array |
|
731 |
* - the data is already as we want it |
|
732 |
*/ |
|
733 |
if (nByte < (count * sizeof(float))) return (float *)0; |
|
734 |
return (float *)pElem; |
|
12 | 735 |
|
736 |
case DOUBLEARRAY: |
|
77 | 737 |
/* |
738 |
* for double array, have to copy-and-cast |
|
739 |
*/ |
|
740 |
if (nByte < (count * sizeof(double))) return (float *)0; |
|
741 |
for (i=0; i<count; i++) { |
|
742 |
vec[i] = *((double *)pElem); |
|
743 |
pElem += sizeof(double); |
|
744 |
} |
|
745 |
return vec; |
|
12 | 746 |
|
747 |
case POINTERARRAY: |
|
77 | 748 |
/* |
749 |
* for other array, have to fetch, check and store |
|
750 |
* the elements can be floats, smallintegers or fractions |
|
751 |
*/ |
|
752 |
if (nByte < (count * sizeof(OBJ))) return (float *)0; |
|
753 |
/* get elements one-by-one */ |
|
754 |
for (i=0; i<count; i++) { |
|
755 |
o = *(OBJ *)pElem; |
|
756 |
if (__isFloat(o)) { |
|
757 |
vec[i] = _floatVal(o); |
|
97 | 758 |
} else if (__isSmallInteger(o)) { |
185 | 759 |
vec[i] = (float)(__intVal(o)); |
77 | 760 |
} else if (__isFraction(o) |
97 | 761 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
762 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
77 | 763 |
float n, d; |
764 |
||
185 | 765 |
n = (float)(__intVal(_FractionInstPtr(o)->f_numerator)); |
766 |
d = (float)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
77 | 767 |
vec[i] = n / d; |
768 |
} else |
|
769 |
return 0; |
|
770 |
pElem += sizeof(OBJ); |
|
771 |
} |
|
772 |
return vec; |
|
12 | 773 |
} |
774 |
return (float *)0; |
|
775 |
} |
|
776 |
||
29 | 777 |
/* |
778 |
* fetch doubles from an st-object into a c-double array |
|
779 |
* which may be a floatArray, doubleArray or array-of-something, |
|
780 |
* where something may be a float, fraction or smallInteger, |
|
781 |
*/ |
|
782 |
static double * |
|
783 |
getDoublesFromInto(obj, vec, count) |
|
784 |
OBJ obj; |
|
785 |
double *vec; |
|
786 |
{ |
|
787 |
OBJ cls, o; |
|
788 |
int nByte, i, ninstVars, nInstBytes; |
|
789 |
char *pElem; |
|
790 |
||
791 |
if (! _isNonNilObject(obj)) return (double *)0; |
|
134 | 792 |
cls = __qClass(obj); |
185 | 793 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 794 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 795 |
nByte = __qSize(obj) - nInstBytes; |
29 | 796 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
797 |
||
185 | 798 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
29 | 799 |
case DOUBLEARRAY: |
77 | 800 |
/* best speed for double array - the data is already as we want it */ |
801 |
if (nByte < (count * sizeof(double))) return (double *)0; |
|
802 |
return (double *)pElem; |
|
29 | 803 |
|
804 |
case FLOATARRAY: |
|
77 | 805 |
if (nByte < (count * sizeof(float))) return (double *)0; |
806 |
for (i=0; i<count; i++) { |
|
807 |
vec[i] = *((float *)pElem); |
|
808 |
pElem += sizeof(float); |
|
809 |
} |
|
810 |
return vec; |
|
29 | 811 |
|
812 |
case POINTERARRAY: |
|
77 | 813 |
if (nByte < (count * sizeof(OBJ))) return (double *)0; |
814 |
/* get elements one-by-one */ |
|
815 |
for (i=0; i<count; i++) { |
|
816 |
o = *(OBJ *)pElem; |
|
817 |
if (__isFloat(o)) |
|
818 |
vec[i] = _floatVal(o); |
|
97 | 819 |
else if (__isSmallInteger(o)) |
185 | 820 |
vec[i] = (double)(__intVal(o)); |
77 | 821 |
else if (__isFraction(o) |
97 | 822 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
823 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
77 | 824 |
double n, d; |
825 |
||
185 | 826 |
n = (double)(__intVal(_FractionInstPtr(o)->f_numerator)); |
827 |
d = (double)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
77 | 828 |
vec[i] = n / d; |
829 |
||
830 |
} else |
|
831 |
return 0; |
|
832 |
pElem += sizeof(OBJ); |
|
833 |
} |
|
834 |
return vec; |
|
29 | 835 |
} |
836 |
return (double *)0; |
|
837 |
} |
|
838 |
||
839 |
/* |
|
840 |
* move from a c-float array into an st-object, |
|
841 |
* the st-object MUST be either a float- or double array |
|
842 |
*/ |
|
12 | 843 |
static |
844 |
putFloatsFromInto(vec, obj, count) |
|
845 |
OBJ obj; |
|
846 |
float *vec; |
|
847 |
{ |
|
848 |
OBJ cls; |
|
849 |
int nByte; |
|
850 |
OBJ o; |
|
851 |
int i, ninstVars, nInstBytes; |
|
852 |
char *pElem; |
|
853 |
||
854 |
if (! _isNonNilObject(obj)) return 0; |
|
855 |
||
134 | 856 |
cls = __qClass(obj); |
185 | 857 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
12 | 858 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 859 |
nByte = __qSize(obj) - nInstBytes; |
12 | 860 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
861 |
||
185 | 862 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
12 | 863 |
case FLOATARRAY: |
77 | 864 |
if (nByte < (count * sizeof(float))) return 0; |
865 |
for (i=0; i<count; i++) { |
|
866 |
*(float *)pElem = vec[i]; |
|
867 |
pElem += sizeof(float); |
|
868 |
} |
|
869 |
return 1; |
|
12 | 870 |
|
871 |
case DOUBLEARRAY: |
|
77 | 872 |
if (nByte < (count * sizeof(float))) return 0; |
873 |
for (i=0; i<count; i++) { |
|
874 |
*(double *)pElem = vec[i]; |
|
875 |
pElem += sizeof(double); |
|
876 |
} |
|
877 |
return 1; |
|
12 | 878 |
} |
879 |
/* not implemented for others */ |
|
880 |
||
881 |
return 0; |
|
882 |
} |
|
883 |
||
884 |
static Matrix* |
|
885 |
getFloatsFromMatrixInto(obj, mp) |
|
886 |
OBJ obj; |
|
887 |
Matrix *mp; |
|
888 |
{ |
|
889 |
OBJ cls; |
|
890 |
int nByte; |
|
891 |
OBJ o; |
|
29 | 892 |
int ninstVars, nInstBytes; |
893 |
char *pElem; |
|
894 |
int x = 0; |
|
895 |
int i,j; |
|
12 | 896 |
|
897 |
if (! _isNonNilObject(obj)) return (Matrix *)0; |
|
898 |
||
134 | 899 |
cls = __qClass(obj); |
185 | 900 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 901 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 902 |
nByte = __qSize(obj) - nInstBytes; |
29 | 903 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
904 |
||
185 | 905 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
29 | 906 |
case FLOATARRAY: |
77 | 907 |
/* |
908 |
* very easy for FLOATARRAY objects - no copying needed |
|
909 |
*/ |
|
910 |
if (nByte < (16 * sizeof(float))) return (Matrix *)0; |
|
911 |
return (Matrix *) _FloatArrayInstPtr(obj)->f_element; |
|
12 | 912 |
|
29 | 913 |
case DOUBLEARRAY: |
77 | 914 |
/* |
915 |
* for DOUBLEARRAY objects copy and cast |
|
916 |
*/ |
|
917 |
if (nByte < (16 * sizeof(double))) return (Matrix *)0; |
|
918 |
for (i=0; i<4; i++) { |
|
919 |
for (j=0; j<4; j++) { |
|
920 |
(*mp)[i][j] = _DoubleArrayInstPtr(obj)->d_element[x]; |
|
921 |
x++; |
|
922 |
} |
|
923 |
} |
|
924 |
return mp; |
|
29 | 925 |
|
926 |
case POINTERARRAY: |
|
77 | 927 |
if (nByte < (16 * sizeof(OBJ))) return (Matrix *)0; |
928 |
/* |
|
929 |
* get elements one-by-one |
|
930 |
*/ |
|
931 |
for (i=0; i<4; i++) { |
|
932 |
for (j=0; j<4; j++) { |
|
933 |
o = _ArrayInstPtr(obj)->a_element[x]; |
|
934 |
if (__isFloat(o)) { |
|
935 |
(*mp)[i][j] = _floatVal(o); |
|
97 | 936 |
} else if (__isSmallInteger(o)) { |
185 | 937 |
(*mp)[i][j] = (double)__intVal(o); |
77 | 938 |
} else if (__isFraction(o) |
97 | 939 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
940 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
77 | 941 |
double n, d; |
942 |
||
185 | 943 |
n = (double)(__intVal(_FractionInstPtr(o)->f_numerator)); |
944 |
d = (double)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
77 | 945 |
(*mp)[i][j] = n / d; |
946 |
} else |
|
947 |
return (Matrix *)0; |
|
948 |
x++; |
|
949 |
} |
|
950 |
} |
|
951 |
return mp; |
|
12 | 952 |
} |
953 |
return (Matrix *)0; |
|
954 |
} |
|
955 |
||
46 | 956 |
static float* |
957 |
getFloatsFromFloatArrayInto(obj, fp) |
|
958 |
OBJ obj; |
|
959 |
float *fp; |
|
960 |
{ |
|
961 |
OBJ cls; |
|
962 |
int ninstVars; |
|
963 |
||
964 |
if (! _isNonNilObject(obj)) return (float *)0; |
|
134 | 965 |
cls = __qClass(obj); |
350 | 966 |
if (cls == @global(FloatArray)) |
77 | 967 |
return _FloatArrayInstPtr(obj)->f_element; |
46 | 968 |
|
185 | 969 |
if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) { |
970 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
77 | 971 |
return (float *) &(_InstPtr(obj)->i_instvars[ninstVars]); |
46 | 972 |
} |
973 |
||
974 |
/* |
|
975 |
* need more here (i.e. convert from array-of-floats) |
|
976 |
*/ |
|
977 |
return (float *)0; |
|
978 |
} |
|
979 |
||
980 |
%} |
|
981 |
! ! |
|
0 | 982 |
|
294 | 983 |
!GLXWorkstation class methodsFor:'documentation'! |
984 |
||
985 |
copyright |
|
986 |
" |
|
987 |
COPYRIGHT (c) 1993 by Claus Gittinger |
|
988 |
All Rights Reserved |
|
989 |
||
990 |
This software is furnished under a license and may be used |
|
991 |
only in accordance with the terms of that license and with the |
|
992 |
inclusion of the above copyright notice. This software may not |
|
993 |
be provided or otherwise made available to, or used by, any |
|
994 |
other person. No title to or ownership of the software is |
|
995 |
hereby transferred. |
|
996 |
" |
|
997 |
! |
|
998 |
||
999 |
documentation |
|
1000 |
" |
|
1001 |
this class was originally written as a demo on how an interface to |
|
1002 |
a c graphics library could be implemented. In the mean time, it has become |
|
1003 |
quite complete ... |
|
1004 |
||
1005 |
It provides an interface to either a real GL (on SGI workstations) |
|
1006 |
or a simulated VGL (i.e. GL-light; low nicotine). |
|
1007 |
The GL simulation is derived from the PD vogl library, with slight |
|
1008 |
modifictions to support multiple GL views. |
|
1009 |
||
1010 |
Most of the hard work was done by Jeff (thanks indeed) ... |
|
1011 |
||
1012 |
||
1013 |
Some notes: |
|
1014 |
||
1015 |
I do not really know what most of these functions do - for more |
|
1016 |
detail, see the GL man pages (on SGI) or the doc provided with VGL. |
|
1017 |
||
1018 |
The interface offered here provides a very very low level (i.e one-to-one) |
|
1019 |
interface to GL functions. More high-level stuff is required, to make |
|
1020 |
3D drawing be more object-oriented. |
|
1021 |
(see a bit of this in 'clients/IRIS-specials') |
|
1022 |
||
1023 |
Some functions are duplicated, Jeff and I developed those in parallel - |
|
1024 |
for now, both will remain - finally they will be merged and duplicates removed ... |
|
1025 |
(examples are makeobj and makeObject). |
|
1026 |
||
1027 |
Also, in a hurry to implement all those methods, many do no or only |
|
1028 |
limited argument checking - make certain, that you pass the correct |
|
1029 |
arguments. |
|
1030 |
||
1031 |
There might be some confusion in the v3[sifd] functions: basically they |
|
1032 |
all do the same, and could be mapped onto one st-method (such as vertex3). |
|
1033 |
However, the C-functions expect different argument types - I dont know if |
|
1034 |
one or another of these functions suffers from any performance penalties. |
|
1035 |
Therefore, I leave the direct 1-to-1 mapping; GL experts might know more |
|
1036 |
about this (I use v3f in all of my code). |
|
1037 |
||
1038 |
written june 93 by claus |
|
1039 |
VGL stuff dec 93 |
|
1040 |
many many additions jan 94 by Jeff McAffer <jeff@is.s.u-tokyo.ac.jp> |
|
1041 |
||
1042 |
Since this is a demo (consider it a free add-on goody) there is |
|
1043 |
*** NO WARRANTY ** for this. |
|
1044 |
||
1045 |
Notice: this should be rewritten to use the openGL library functions |
|
1046 |
(actually, to not loose the VGL interface, another OpenGLWorkstation |
|
1047 |
class should be written) |
|
1048 |
" |
|
1049 |
! ! |
|
1050 |
||
168 | 1051 |
!GLXWorkstation class methodsFor:'error handling'! |
1052 |
||
294 | 1053 |
errorStringOfLastError |
1054 |
%{ |
|
1055 |
RETURN ( __MKSTRING(lastErrorMsg COMMA_CON) ); |
|
168 | 1056 |
%} |
1057 |
! |
|
1058 |
||
1059 |
minorCodeOfLastError |
|
1060 |
%{ /* NOCONTEXT */ |
|
1061 |
||
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
1062 |
RETURN ( __MKSMALLINT(lastMinorCode) ); |
168 | 1063 |
%} |
1064 |
! |
|
1065 |
||
294 | 1066 |
requestCodeOfLastError |
1067 |
%{ /* NOCONTEXT */ |
|
1068 |
||
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
1069 |
RETURN ( __MKSMALLINT(lastRequestCode) ); |
294 | 1070 |
%} |
1071 |
! |
|
1072 |
||
168 | 1073 |
resourceIdOfLastError |
1074 |
%{ /* NOCONTEXT */ |
|
1075 |
||
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
1076 |
RETURN ( __MKSMALLINT(lastResource) ); |
168 | 1077 |
%} |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
1078 |
! |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
1079 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
1080 |
forceGL:aBoolean |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
1081 |
ForceGL := aBoolean. |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
1082 |
AllScreens notNil ifTrue:[ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
1083 |
AllScreens do:[:screen | screen initializeScreenProperties] |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
1084 |
]. |
294 | 1085 |
! ! |
1086 |
||
1087 |
!GLXWorkstation methodsFor:'arcs and circles'! |
|
1088 |
||
1089 |
glxArcX: x y: y radius: radius startang: startang endang: endang in: aGLXWindowId |
|
1090 |
"draw an arc" |
|
1091 |
||
1092 |
%{ /* NOCONTEXT */ |
|
1093 |
Coord c_x, c_y, c_radius; |
|
1094 |
Angle a_startang, a_endang; |
|
1095 |
||
1096 |
_COORD_(x, c_x) |
|
1097 |
_COORD_(y, c_y) |
|
1098 |
_COORD_(radius, c_radius) |
|
1099 |
_ANGLE_(startang, a_startang) |
|
1100 |
_ANGLE_(endang, a_endang) |
|
1101 |
SETWIN(aGLXWindowId) |
|
1102 |
arc(c_x, c_y, c_radius, a_startang, a_endang); |
|
1103 |
RETURN (true); |
|
1104 |
%} |
|
1105 |
! |
|
1106 |
||
1107 |
glxArcfX: x y: y radius: radius startang: startang endang: endang in: aGLXWindowId |
|
1108 |
"draw a filled arc" |
|
1109 |
||
1110 |
%{ /* NOCONTEXT */ |
|
1111 |
Coord c_x, c_y, c_radius; |
|
1112 |
Angle a_startang, a_endang; |
|
1113 |
||
1114 |
_COORD_(x, c_x) |
|
1115 |
_COORD_(y, c_y) |
|
1116 |
_COORD_(radius, c_radius) |
|
1117 |
_ANGLE_(startang, a_startang) |
|
1118 |
_ANGLE_(endang, a_endang) |
|
1119 |
SETWIN(aGLXWindowId) |
|
1120 |
arcf(c_x, c_y, c_radius, a_startang, a_endang); |
|
1121 |
RETURN (true); |
|
1122 |
%} |
|
1123 |
! |
|
1124 |
||
1125 |
glxArcfiX: x y: y radius: radius startang: startang endang: endang in: aGLXWindowId |
|
1126 |
"draw a filled arc" |
|
1127 |
||
1128 |
%{ /* NOCONTEXT */ |
|
1129 |
Icoord c_x, c_y, c_radius; |
|
1130 |
Angle a_startang, a_endang; |
|
1131 |
||
1132 |
_ICOORD_(x, c_x) |
|
1133 |
_ICOORD_(y, c_y) |
|
1134 |
_ICOORD_(radius, c_radius) |
|
1135 |
_ANGLE_(startang, a_startang); |
|
1136 |
_ANGLE_(endang, a_endang) |
|
1137 |
SETWIN(aGLXWindowId) |
|
1138 |
arcfi(c_x, c_y, c_radius, a_startang, a_endang); |
|
1139 |
RETURN (true); |
|
1140 |
%} |
|
1141 |
! |
|
1142 |
||
1143 |
glxArcfsX: x y: y radius: radius startang: startang endang: endang in: aGLXWindowId |
|
1144 |
"draw a filled arc" |
|
1145 |
||
1146 |
%{ /* NOCONTEXT */ |
|
1147 |
Scoord c_x, c_y, c_radius; |
|
1148 |
Angle a_startang, a_endang; |
|
1149 |
||
1150 |
_SCOORD_(x, c_x) |
|
1151 |
_SCOORD_(y, c_y) |
|
1152 |
_SCOORD_(radius, c_radius) |
|
1153 |
_ANGLE_(startang, a_startang) |
|
1154 |
_ANGLE_(endang, a_endang) |
|
1155 |
SETWIN(aGLXWindowId) |
|
1156 |
arcfs(c_x, c_y, c_radius, a_startang, a_endang); |
|
1157 |
RETURN (true); |
|
1158 |
%} |
|
1159 |
! |
|
1160 |
||
1161 |
glxArciX: x y: y radius: radius startang: startang endang: endang in: aGLXWindowId |
|
1162 |
"draw an arc" |
|
1163 |
||
1164 |
%{ /* NOCONTEXT */ |
|
1165 |
Icoord c_x, c_y, c_radius; |
|
1166 |
Angle a_startang, a_endang; |
|
1167 |
||
1168 |
_ICOORD_(x, c_x) |
|
1169 |
_ICOORD_(y, c_y) |
|
1170 |
_ICOORD_(radius, c_radius) |
|
1171 |
_ANGLE_(startang, a_startang) |
|
1172 |
_ANGLE_(endang, a_endang) |
|
1173 |
SETWIN(aGLXWindowId) |
|
1174 |
arci(c_x, c_y, c_radius, a_startang, a_endang); |
|
1175 |
RETURN (true); |
|
1176 |
%} |
|
1177 |
! |
|
1178 |
||
1179 |
glxArcsX: x y: y radius: radius startang: startang endang: endang in: aGLXWindowId |
|
1180 |
"draw an arc" |
|
1181 |
||
1182 |
%{ /* NOCONTEXT */ |
|
1183 |
Scoord c_x, c_y, c_radius; |
|
1184 |
Angle a_startang, a_endang; |
|
1185 |
||
1186 |
_SCOORD_(x, c_x) |
|
1187 |
_SCOORD_(y, c_y) |
|
1188 |
_SCOORD_(radius, c_radius) |
|
1189 |
_ANGLE_(startang, a_startang) |
|
1190 |
_ANGLE_(endang, a_endang) |
|
1191 |
SETWIN(aGLXWindowId) |
|
1192 |
arcs(c_x, c_y, c_radius, a_startang, a_endang); |
|
1193 |
RETURN (true); |
|
1194 |
%} |
|
1195 |
! |
|
1196 |
||
1197 |
glxCircX: x y: y radius: radius in: aGLXWindowId |
|
1198 |
"draw a circle" |
|
1199 |
||
1200 |
%{ /* NOCONTEXT */ |
|
1201 |
Coord c_x, c_y, c_radius; |
|
1202 |
||
1203 |
_COORD_ (x, c_x) |
|
1204 |
_COORD_ (y, c_y) |
|
1205 |
_COORD_ (radius, c_radius) |
|
1206 |
SETWIN(aGLXWindowId) |
|
1207 |
circ(c_x, c_y, c_radius); |
|
1208 |
RETURN (true); |
|
1209 |
%} |
|
1210 |
! |
|
1211 |
||
1212 |
glxCircfX: x y: y radius: radius in: aGLXWindowId |
|
1213 |
"draw a filled circle" |
|
1214 |
||
1215 |
%{ /* NOCONTEXT */ |
|
1216 |
Coord c_x, c_y, c_radius; |
|
1217 |
||
1218 |
_COORD_ (x, c_x) |
|
1219 |
_COORD_ (y, c_y) |
|
1220 |
_COORD_ (radius, c_radius) |
|
1221 |
SETWIN(aGLXWindowId) |
|
1222 |
circf(c_x, c_y, c_radius); |
|
1223 |
RETURN (true); |
|
1224 |
%} |
|
1225 |
! |
|
1226 |
||
1227 |
glxCircfiX: x y: y radius: radius in: aGLXWindowId |
|
1228 |
"draw a filled circle" |
|
1229 |
||
1230 |
%{ /* NOCONTEXT */ |
|
1231 |
Icoord c_x, c_y, c_radius; |
|
1232 |
||
1233 |
_ICOORD_ (x, c_x) |
|
1234 |
_ICOORD_ (y, c_y) |
|
1235 |
_ICOORD_ (radius, c_radius) |
|
1236 |
SETWIN(aGLXWindowId) |
|
1237 |
circfi(c_x, c_y, c_radius); |
|
1238 |
RETURN (true); |
|
1239 |
%} |
|
1240 |
! |
|
1241 |
||
1242 |
glxCircfsX: x y: y radius: radius in: aGLXWindowId |
|
1243 |
"draw a filled circle" |
|
1244 |
||
1245 |
%{ /* NOCONTEXT */ |
|
1246 |
Scoord c_x, c_y, c_radius; |
|
1247 |
||
1248 |
_SCOORD_ (x, c_x) |
|
1249 |
_SCOORD_ (y, c_y) |
|
1250 |
_SCOORD_ (radius, c_radius) |
|
1251 |
SETWIN(aGLXWindowId) |
|
1252 |
circfs(c_x, c_y, c_radius); |
|
1253 |
RETURN (true); |
|
1254 |
%} |
|
1255 |
! |
|
1256 |
||
1257 |
glxCirciX: x y: y radius: radius in: aGLXWindowId |
|
1258 |
"draw a circle" |
|
1259 |
||
1260 |
%{ /* NOCONTEXT */ |
|
1261 |
Icoord c_x, c_y, c_radius; |
|
1262 |
||
1263 |
_ICOORD_ (x, c_x) |
|
1264 |
_ICOORD_ (y, c_y) |
|
1265 |
_ICOORD_ (radius, c_radius) |
|
1266 |
SETWIN(aGLXWindowId) |
|
1267 |
circi(c_x, c_y, c_radius); |
|
1268 |
RETURN (true); |
|
1269 |
%} |
|
1270 |
! |
|
1271 |
||
1272 |
glxCircsX: x y: y radius: radius in: aGLXWindowId |
|
1273 |
"draw a circle" |
|
1274 |
||
1275 |
%{ /* NOCONTEXT */ |
|
1276 |
Scoord c_x, c_y, c_radius; |
|
1277 |
||
1278 |
_SCOORD_ (x, c_x) |
|
1279 |
_SCOORD_ (y, c_y) |
|
1280 |
_SCOORD_ (radius, c_radius) |
|
1281 |
SETWIN(aGLXWindowId) |
|
1282 |
circs(c_x, c_y, c_radius); |
|
1283 |
RETURN (true); |
|
1284 |
%} |
|
1285 |
! ! |
|
1286 |
||
1287 |
!GLXWorkstation methodsFor:'clearing'! |
|
1288 |
||
1289 |
glxClearIn:aGLXWindowId |
|
1290 |
"clear to current color" |
|
1291 |
||
1292 |
%{ /* NOCONTEXT */ |
|
1293 |
SETWIN(aGLXWindowId) |
|
1294 |
clear(); |
|
1295 |
RETURN (true); |
|
1296 |
%} |
|
1297 |
! |
|
1298 |
||
1299 |
glxCzclearCval:cval zval:zval in:aGLXWindowId |
|
1300 |
"clear to a color (cval) and clear z buffer to zval simultaniously" |
|
1301 |
||
1302 |
%{ /* NOCONTEXT */ |
|
1303 |
#ifdef GLX |
|
1304 |
SETWIN(aGLXWindowId) |
|
1305 |
czclear((ulong)__intVal(cval), __intVal(zval)); |
|
1306 |
RETURN (true); |
|
1307 |
#endif |
|
1308 |
%} |
|
1309 |
. |
|
1310 |
^ false |
|
1311 |
! |
|
1312 |
||
1313 |
glxZClearIn:aGLXWindowId |
|
1314 |
"clear z buffer" |
|
1315 |
||
1316 |
%{ /* NOCONTEXT */ |
|
1317 |
#ifdef GLX |
|
1318 |
SETWIN(aGLXWindowId) |
|
1319 |
zclear(); |
|
1320 |
RETURN (true); |
|
1321 |
#endif |
|
1322 |
%} |
|
1323 |
. |
|
1324 |
^ false |
|
1325 |
! ! |
|
1326 |
||
1327 |
!GLXWorkstation methodsFor:'color'! |
|
1328 |
||
1329 |
glxColor:index in:aGLXWindowId |
|
1330 |
"set color, for non gouraud shading, we dont care if the |
|
1331 |
argument is integer or float; otherwise, better results are |
|
1332 |
expected with float values." |
|
1333 |
||
1334 |
%{ /* NOCONTEXT */ |
|
1335 |
||
1336 |
SETWIN(aGLXWindowId) |
|
1337 |
if (__isSmallInteger(index)) { |
|
1338 |
color((Colorindex)(__intVal(index))); |
|
1339 |
RETURN (true); |
|
1340 |
} |
|
1341 |
if (__isFloat(index)) { |
|
1342 |
colorf((float)(_floatVal(index))); |
|
1343 |
RETURN (true); |
|
1344 |
} |
|
1345 |
%} |
|
1346 |
. |
|
1347 |
^ false |
|
1348 |
! |
|
1349 |
||
1350 |
glxColorRed:r green:g blue:b alpha:a in:aGLXWindowId |
|
1351 |
"set color including alpha value, args must be integer values within 0..255" |
|
1352 |
||
1353 |
%{ /* NOCONTEXT */ |
|
1354 |
||
1355 |
#ifdef GLX |
|
1356 |
short s_r, s_g, s_b, s_a; |
|
1357 |
||
1358 |
_INT_(r, s_r); |
|
1359 |
_INT_(g, s_g); |
|
1360 |
_INT_(b, s_b); |
|
1361 |
_INT_(a, s_a); |
|
1362 |
SETWIN(aGLXWindowId) |
|
1363 |
cpack((((((s_a<<8) | s_b) << 8) | s_g) << 8) | s_r); |
|
1364 |
RETURN (true); |
|
1365 |
#endif |
|
1366 |
%} |
|
1367 |
. |
|
1368 |
^ false |
|
1369 |
! |
|
1370 |
||
1371 |
glxColorRed:r green:g blue:b in:aGLXWindowId |
|
1372 |
"set color, args must be integer values in 0..255" |
|
1373 |
||
1374 |
%{ /* NOCONTEXT */ |
|
1375 |
||
1376 |
#ifdef GLX |
|
1377 |
short s_r, s_g, s_b; |
|
1378 |
||
1379 |
_INT_(r, s_r); |
|
1380 |
_INT_(g, s_g); |
|
1381 |
_INT_(b, s_b); |
|
1382 |
SETWIN(aGLXWindowId) |
|
1383 |
RGBcolor(s_r, s_g, s_b); |
|
1384 |
RETURN (true); |
|
1385 |
#endif |
|
1386 |
%} |
|
1387 |
. |
|
1388 |
^ false |
|
1389 |
! |
|
1390 |
||
1391 |
glxTextcolor: tcolor in: aGLXWindowId |
|
1392 |
||
1393 |
%{ /* NOCONTEXT */ |
|
1394 |
#ifdef GLX |
|
1395 |
SETWIN(aGLXWindowId) |
|
1396 |
textcolor(_colorindexVal(tcolor)); |
|
1397 |
RETURN (true); |
|
1398 |
#endif |
|
1399 |
%} |
|
1400 |
. |
|
1401 |
^ false |
|
1402 |
! ! |
|
1403 |
||
1404 |
!GLXWorkstation methodsFor:'double buffering'! |
|
1405 |
||
1406 |
glxBackBufferIn:aGLXWindowId |
|
1407 |
"switch to back buffer - turning frontbuffer off" |
|
1408 |
||
1409 |
%{ /* NOCONTEXT */ |
|
1410 |
SETWIN(aGLXWindowId) |
|
1411 |
#ifdef GLX |
|
1412 |
frontbuffer(FALSE); |
|
1413 |
#endif |
|
1414 |
backbuffer(TRUE); |
|
1415 |
RETURN (true); |
|
1416 |
%} |
|
1417 |
! |
|
1418 |
||
1419 |
glxBackbuffer: b in: aGLXWindowId |
|
1420 |
||
1421 |
%{ /* NOCONTEXT */ |
|
1422 |
SETWIN(aGLXWindowId) |
|
1423 |
backbuffer(_booleanVal(b)); |
|
1424 |
RETURN (true); |
|
1425 |
%} |
|
1426 |
! |
|
1427 |
||
1428 |
glxDoubleBufferIn:aGLXWindowId |
|
1429 |
"set double buffer mode" |
|
1430 |
||
1431 |
%{ /* NOCONTEXT */ |
|
1432 |
SETWIN(aGLXWindowId) |
|
1433 |
doublebuffer(); |
|
1434 |
RETURN (true); |
|
1435 |
%} |
|
1436 |
! |
|
1437 |
||
1438 |
glxFrontBufferIn:aGLXWindowId |
|
1439 |
"switch to front buffer - turning backbuffer off" |
|
1440 |
||
1441 |
%{ /* NOCONTEXT */ |
|
1442 |
SETWIN(aGLXWindowId) |
|
1443 |
#ifdef GLX |
|
1444 |
backbuffer(FALSE); |
|
1445 |
#endif |
|
1446 |
frontbuffer(TRUE); |
|
1447 |
RETURN (true); |
|
1448 |
%} |
|
1449 |
! |
|
1450 |
||
1451 |
glxFrontbuffer: b in: aGLXWindowId |
|
1452 |
||
1453 |
%{ /* NOCONTEXT */ |
|
1454 |
SETWIN(aGLXWindowId) |
|
1455 |
frontbuffer(_booleanVal(b)); |
|
1456 |
RETURN (true); |
|
1457 |
%} |
|
1458 |
! |
|
1459 |
||
1460 |
glxSingleBufferIn: aGLXWindowId |
|
1461 |
"set single buffer mode" |
|
1462 |
||
1463 |
%{ /* NOCONTEXT */ |
|
1464 |
SETWIN(aGLXWindowId) |
|
1465 |
singlebuffer(); |
|
1466 |
RETURN (true); |
|
1467 |
%} |
|
1468 |
! |
|
1469 |
||
1470 |
glxSwapBuffersIn:aGLXWindowId |
|
1471 |
"swap double buffers" |
|
1472 |
||
1473 |
%{ /* NOCONTEXT */ |
|
1474 |
SETWIN(aGLXWindowId) |
|
1475 |
swapbuffers(); |
|
1476 |
RETURN (true); |
|
1477 |
%} |
|
1478 |
! ! |
|
1479 |
||
1480 |
!GLXWorkstation methodsFor:'flat drawing'! |
|
1481 |
||
1482 |
glxBeginClosedLineIn:aGLXWindowId |
|
1483 |
"start a closed line" |
|
1484 |
||
1485 |
%{ /* NOCONTEXT */ |
|
1486 |
SETWIN(aGLXWindowId) |
|
1487 |
bgnclosedline(); |
|
1488 |
RETURN (true); |
|
1489 |
%} |
|
1490 |
! |
|
1491 |
||
1492 |
glxBeginLineIn:aGLXWindowId |
|
1493 |
"start a line group" |
|
1494 |
||
1495 |
%{ /* NOCONTEXT */ |
|
1496 |
SETWIN(aGLXWindowId) |
|
1497 |
bgnline(); |
|
1498 |
RETURN (true); |
|
1499 |
%} |
|
1500 |
! |
|
1501 |
||
1502 |
glxBeginPointIn:aGLXWindowId |
|
1503 |
"start a point-group" |
|
1504 |
||
1505 |
%{ /* NOCONTEXT */ |
|
1506 |
SETWIN(aGLXWindowId) |
|
1507 |
bgnpoint(); |
|
1508 |
RETURN (true); |
|
1509 |
%} |
|
1510 |
! |
|
1511 |
||
1512 |
glxBeginPolygonIn:aGLXWindowId |
|
1513 |
"start a polygon" |
|
1514 |
||
1515 |
%{ /* NOCONTEXT */ |
|
1516 |
SETWIN(aGLXWindowId) |
|
1517 |
bgnpolygon(); |
|
1518 |
RETURN (true); |
|
1519 |
%} |
|
1520 |
! |
|
1521 |
||
1522 |
glxBeginQuadrilateralStripIn:aGLXWindowId |
|
1523 |
"start a quadrilateral strip" |
|
1524 |
||
1525 |
%{ /* NOCONTEXT */ |
|
1526 |
SETWIN(aGLXWindowId) |
|
1527 |
bgnqstrip(); |
|
1528 |
RETURN (true); |
|
1529 |
%} |
|
1530 |
! |
|
1531 |
||
1532 |
glxBeginTriangleMeshIn:aGLXWindowId |
|
1533 |
"start a triangle mesh" |
|
1534 |
||
1535 |
%{ /* NOCONTEXT */ |
|
1536 |
SETWIN(aGLXWindowId) |
|
1537 |
bgntmesh(); |
|
1538 |
RETURN (true); |
|
1539 |
%} |
|
1540 |
! |
|
1541 |
||
1542 |
glxEndClosedLineIn:aGLXWindowId |
|
1543 |
"end a closed line" |
|
1544 |
||
1545 |
%{ /* NOCONTEXT */ |
|
1546 |
SETWIN(aGLXWindowId) |
|
1547 |
endclosedline(); |
|
1548 |
RETURN (true); |
|
1549 |
%} |
|
1550 |
! |
|
1551 |
||
1552 |
glxEndLineIn:aGLXWindowId |
|
1553 |
"end a line group" |
|
1554 |
||
1555 |
%{ /* NOCONTEXT */ |
|
1556 |
SETWIN(aGLXWindowId) |
|
1557 |
endline(); |
|
1558 |
RETURN (true); |
|
1559 |
%} |
|
1560 |
! |
|
1561 |
||
1562 |
glxEndPointIn:aGLXWindowId |
|
1563 |
"end a point group" |
|
1564 |
||
1565 |
%{ /* NOCONTEXT */ |
|
1566 |
SETWIN(aGLXWindowId) |
|
1567 |
endpoint(); |
|
1568 |
RETURN (true); |
|
1569 |
%} |
|
1570 |
! |
|
1571 |
||
1572 |
glxEndPolygonIn:aGLXWindowId |
|
1573 |
"end a polygon" |
|
1574 |
||
1575 |
%{ /* NOCONTEXT */ |
|
1576 |
SETWIN(aGLXWindowId) |
|
1577 |
endpolygon(); |
|
1578 |
RETURN (true); |
|
1579 |
%} |
|
1580 |
! |
|
1581 |
||
1582 |
glxEndQuadrilateralStripIn:aGLXWindowId |
|
1583 |
"end a quadrilateral strip" |
|
1584 |
||
1585 |
%{ /* NOCONTEXT */ |
|
1586 |
SETWIN(aGLXWindowId) |
|
1587 |
endqstrip(); |
|
1588 |
RETURN (true); |
|
1589 |
%} |
|
1590 |
! |
|
1591 |
||
1592 |
glxEndTriangleMeshIn:aGLXWindowId |
|
1593 |
"end a triangle mesh" |
|
1594 |
||
1595 |
%{ /* NOCONTEXT */ |
|
1596 |
SETWIN(aGLXWindowId) |
|
1597 |
endtmesh(); |
|
1598 |
RETURN (true); |
|
168 | 1599 |
%} |
1600 |
! ! |
|
1601 |
||
1602 |
!GLXWorkstation methodsFor:'initialization'! |
|
1603 |
||
1604 |
initializeFor:aDisplayName |
|
169 | 1605 |
(super initializeFor:aDisplayName) isNil ifTrue:[^ nil]. |
168 | 1606 |
%{ |
1607 |
if (_INST(displayId) != nil) { |
|
185 | 1608 |
XSetErrorHandler(__XErrorHandler__); |
1609 |
} |
|
1610 |
%} |
|
1611 |
! |
|
1612 |
||
1613 |
initializeScreenProperties |
|
1614 |
super initializeScreenProperties. |
|
1615 |
||
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1616 |
"/ GL has a 'bug' (or feature ?) |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1617 |
"/ which makes it exit (instead of giving an error return) |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1618 |
"/ if a gl view is opened on a non-gl capable remote display. |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1619 |
"/ we certainly do not want this here. |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1620 |
"/ Since I cannot tell in advance if the remote display is gl capable, |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1621 |
"/ and its too late once we know its not, we simply disallow any remote gl. |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1622 |
"/ Sorry. (I guess, there are some query functions for that available, but I |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1623 |
"/ have no documentation). |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
1624 |
"/ Late note: setting the ForceGL classVar overrides above behavior. |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
1625 |
"/ it may be set from a startupScript with: 'GLXWorkstation forceGL:true' |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
1626 |
"/ however: be careful: only set it to true, if you are certain that remoteGL works |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
1627 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
1628 |
(self isTrueGL and:[ForceGL ~~ true]) ifTrue:[ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
1629 |
glOK := (displayName = ':0') or:[displayName = ':0.0']. |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
1630 |
] ifFalse:[ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
1631 |
glOK := true. |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
1632 |
]. |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1633 |
|
185 | 1634 |
%{ |
1635 |
Display *dpy = myDpy; |
|
1636 |
int dummy; |
|
1637 |
||
1638 |
if (ISCONNECTED) { |
|
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
1639 |
_INST(hasStereoExtension) = false; |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
1640 |
|
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
1641 |
#if defined(XSGIStereo) && !defined(VGL) |
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
1642 |
if (_INST(glOK) == true) { |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1643 |
if (XQueryExtension(dpy, "SGIFullScreenStereo", &dummy, &dummy, &dummy)) |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
1644 |
_INST(hasStereoExtension) = true; |
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
1645 |
} |
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
1646 |
#endif |
168 | 1647 |
} |
1648 |
%} |
|
1649 |
! ! |
|
1650 |
||
294 | 1651 |
!GLXWorkstation methodsFor:'materials & lights'! |
1652 |
||
1653 |
glxLmbind:target index:index in:aGLXWindowId |
|
1654 |
"select a material, light or lighting model. |
|
1655 |
target must be a symbol from: #material, #backMaterial, |
|
1656 |
#light0-light7 or #lightModel." |
|
1657 |
||
1658 |
%{ /* NOCONTEXT */ |
|
1659 |
#ifdef GLX |
|
1660 |
short defType; |
|
1661 |
short i_index; |
|
1662 |
||
1663 |
if (target == @symbol(material)) |
|
1664 |
defType = MATERIAL; |
|
1665 |
else if (target == @symbol(backMaterial)) |
|
1666 |
defType = BACKMATERIAL; |
|
1667 |
else if (target == @symbol(light0)) |
|
1668 |
defType = LIGHT0; |
|
1669 |
else if (target == @symbol(light1)) |
|
1670 |
defType = LIGHT1; |
|
1671 |
else if (target == @symbol(light2)) |
|
1672 |
defType = LIGHT2; |
|
1673 |
else if (target == @symbol(light3)) |
|
1674 |
defType = LIGHT3; |
|
1675 |
else if (target == @symbol(light4)) |
|
1676 |
defType = LIGHT4; |
|
1677 |
else if (target == @symbol(light5)) |
|
1678 |
defType = LIGHT5; |
|
1679 |
else if (target == @symbol(light6)) |
|
1680 |
defType = LIGHT6; |
|
1681 |
else if (target == @symbol(light7)) |
|
1682 |
defType = LIGHT7; |
|
1683 |
else if (target == @symbol(lightModel)) |
|
1684 |
defType = LMODEL; |
|
1685 |
else { |
|
1686 |
RETURN (false); |
|
1687 |
} |
|
1688 |
||
1689 |
_INT_ (index, i_index); |
|
1690 |
SETWIN(aGLXWindowId) |
|
1691 |
lmbind(defType, i_index); |
|
1692 |
RETURN (true); |
|
1693 |
#endif |
|
1694 |
%} |
|
1695 |
. |
|
1696 |
^ false |
|
1697 |
! |
|
1698 |
||
1699 |
glxLmdef:what index:index np:np props:props in:aGLXWindowId |
|
1700 |
"define a material, light source or lighting model; |
|
1701 |
what must be one of #material, #light or #lightModel. |
|
1702 |
props must be a FloatArray or a subclass of FloatArray" |
|
1703 |
||
1704 |
%{ /* NOCONTEXT */ |
|
1705 |
#ifdef GLX |
|
1706 |
short defType; |
|
1707 |
short i_index, i_np; |
|
1708 |
float *fp; |
|
1709 |
OBJ cls; |
|
1710 |
int ninstVars, nInstBytes; |
|
1711 |
||
1712 |
if (what == @symbol(material)) |
|
1713 |
defType = DEFMATERIAL; |
|
1714 |
else if (what == @symbol(light)) |
|
1715 |
defType = DEFLIGHT; |
|
1716 |
else if (what == @symbol(lightModel)) |
|
1717 |
defType = DEFLMODEL; |
|
1718 |
else { |
|
1719 |
RETURN (false); |
|
1720 |
} |
|
1721 |
||
1722 |
_INT_ (index, i_index); |
|
1723 |
_INT_ (np, i_np); |
|
1724 |
||
1725 |
if (! _isNonNilObject(props)) fp = NULL; |
|
1726 |
else { |
|
1727 |
cls = __qClass(props); |
|
350 | 1728 |
if (cls == @global(FloatArray)) |
294 | 1729 |
fp = _FloatArrayInstPtr(props)->f_element; |
1730 |
else { |
|
1731 |
if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) { |
|
1732 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
1733 |
fp = (float *) &(_InstPtr(props)->i_instvars[ninstVars]); |
|
1734 |
} else { |
|
1735 |
RETURN (false); |
|
1736 |
} |
|
1737 |
} |
|
1738 |
} |
|
1739 |
SETWIN(aGLXWindowId) |
|
1740 |
lmdef(defType, i_index, i_np, fp); |
|
1741 |
RETURN (true); |
|
1742 |
#endif |
|
1743 |
%} |
|
1744 |
. |
|
1745 |
^ false |
|
1746 |
! |
|
1747 |
||
1748 |
glxTevbind:target index:index in:aGLXWindowId |
|
1749 |
"bind a texture environment; target must be 0 |
|
1750 |
or the symbol #env0." |
|
1751 |
||
1752 |
%{ /* NOCONTEXT */ |
|
1753 |
#ifdef GLX |
|
1754 |
long t; |
|
1755 |
||
1756 |
if (__isSmallInteger(target)) { |
|
1757 |
t = __intVal(target); |
|
1758 |
} else { |
|
1759 |
if (target == @symbol(env0)) { |
|
1760 |
t = TV_ENV0; |
|
1761 |
} else { |
|
1762 |
RETURN (false); |
|
1763 |
} |
|
1764 |
} |
|
1765 |
SETWIN(aGLXWindowId) |
|
1766 |
tevbind(t, __intVal(index)); |
|
1767 |
RETURN (true); |
|
1768 |
#endif |
|
1769 |
%} |
|
1770 |
. |
|
1771 |
^ false |
|
1772 |
! |
|
1773 |
||
1774 |
glxTevdef:index np:np props:props in:aGLXWindowId |
|
1775 |
||
1776 |
%{ /* NOCONTEXT */ |
|
1777 |
#ifdef GLX |
|
1778 |
const float *fp; |
|
1779 |
float fbuff[30]; |
|
1780 |
||
1781 |
SETWIN(aGLXWindowId) |
|
1782 |
fp = getFloatsFromFloatArrayInto(props, fbuff); |
|
1783 |
tevdef(__intVal(index), __intVal(np), fp); |
|
1784 |
RETURN (true); |
|
1785 |
#endif |
|
1786 |
%} |
|
1787 |
. |
|
1788 |
^ false |
|
1789 |
! |
|
1790 |
||
1791 |
glxTexDef2d:index nc:nc width:w height:h bits:image np:np props:props in:aGLXWindowId |
|
1792 |
"define a 2D texture. index is the 'name' of the texture; |
|
1793 |
nc is the number of components (1-4) per pixel; |
|
1794 |
w/h define the size of the texture; bits is a byteArray containing the |
|
1795 |
long-word aligned pixel data; np is the number of props found in |
|
1796 |
the floatArray props. Props must be delimited by a 0.0 entry." |
|
1797 |
||
1798 |
%{ /* NOCONTEXT */ |
|
1799 |
#ifdef GLX |
|
1800 |
unsigned char *cp; |
|
1801 |
const float *fp; |
|
1802 |
OBJ cls; |
|
1803 |
float fbuff[30]; |
|
1804 |
||
1805 |
if (__isByteArray(image)) { |
|
1806 |
cp = _ByteArrayInstPtr(image)->ba_element; |
|
1807 |
fp = getFloatsFromFloatArrayInto(props, fbuff); |
|
1808 |
||
1809 |
SETWIN(aGLXWindowId) |
|
1810 |
texdef2d(__intVal(index), __intVal(nc), __intVal(w), __intVal(h), |
|
1811 |
(const unsigned long *)cp, __intVal(np), fp); |
|
1812 |
RETURN (true); |
|
1813 |
} |
|
1814 |
#endif |
|
1815 |
%} |
|
1816 |
. |
|
1817 |
^ false |
|
1818 |
! |
|
1819 |
||
1820 |
glxTexDef3d:index nc:nc width:w height:h depth:d bits:image np:np props:props in:aGLXWindowId |
|
1821 |
"define a 3D texture. index is the 'name' of the texture; |
|
1822 |
nc is the number of components (1-4) per pixel; |
|
1823 |
w/h/d define the size of the texture; bits is a byteArray containing the |
|
1824 |
long-word aligned pixel data; np is the number of props found in |
|
1825 |
the floatArray props. Props must be delimited by a 0.0 entry." |
|
1826 |
||
1827 |
%{ /* NOCONTEXT */ |
|
1828 |
#ifdef GLX |
|
1829 |
unsigned char *cp; |
|
1830 |
const float *fp; |
|
1831 |
OBJ cls; |
|
1832 |
float fbuff[30]; |
|
1833 |
||
1834 |
if (__isByteArray(image)) { |
|
1835 |
cp = _ByteArrayInstPtr(image)->ba_element; |
|
1836 |
fp = getFloatsFromFloatArrayInto(props, fbuff); |
|
1837 |
||
1838 |
SETWIN(aGLXWindowId) |
|
1839 |
texdef3d(__intVal(index), __intVal(nc), __intVal(w), __intVal(h), |
|
1840 |
__intVal(d), |
|
1841 |
(const unsigned long *)cp, __intVal(np), fp); |
|
1842 |
RETURN (true); |
|
1843 |
} |
|
1844 |
#endif |
|
1845 |
%} |
|
1846 |
. |
|
1847 |
^ false |
|
1848 |
! |
|
1849 |
||
1850 |
glxTexbind:target index:index in:aGLXWindowId |
|
1851 |
"bind a texture; target must be an integer or one |
|
1852 |
of the symbols #texture0, #textureDetail or #textureIdle." |
|
1853 |
||
1854 |
%{ /* NOCONTEXT */ |
|
1855 |
#ifdef GLX |
|
1856 |
long t; |
|
1857 |
||
1858 |
if (__isSmallInteger(target)) { |
|
1859 |
t = __intVal(target); |
|
1860 |
} else { |
|
1861 |
if (target == @symbol(texture0)) { |
|
1862 |
t = TX_TEXTURE_0; |
|
1863 |
} else if (target == @symbol(textureDetail)) { |
|
1864 |
t = TX_TEXTURE_DETAIL; |
|
1865 |
} else if (target == @symbol(textureIdle)) { |
|
1866 |
t = TX_TEXTURE_IDLE; |
|
1867 |
} else { |
|
1868 |
RETURN (false); |
|
1869 |
} |
|
1870 |
} |
|
1871 |
SETWIN(aGLXWindowId) |
|
1872 |
texbind(t, __intVal(index)); |
|
1873 |
RETURN (true); |
|
1874 |
#endif |
|
1875 |
%} |
|
1876 |
. |
|
1877 |
^ false |
|
1878 |
! ! |
|
1879 |
||
1880 |
!GLXWorkstation methodsFor:'matrix stack'! |
|
1881 |
||
1882 |
glxGetMatrix:arrayOf16Floats in:aGLXWindowId |
|
1883 |
"argument must be an array (a matrix) of 16 floats. The current matrix |
|
1884 |
will be stored into that." |
|
1885 |
||
1886 |
%{ /* NOCONTEXT */ |
|
1887 |
Matrix matrix; |
|
1888 |
||
1889 |
SETWIN(aGLXWindowId) |
|
1890 |
getmatrix(matrix); |
|
1891 |
if (! putFloatsFromInto(matrix, arrayOf16Floats, 16)) RETURN(false); |
|
1892 |
%} |
|
1893 |
. |
|
1894 |
^ true |
|
1895 |
! |
|
1896 |
||
1897 |
glxLoadMatrix:arrayOf16Floats in:aGLXWindowId |
|
1898 |
"argument must be an array(a matrix) of 16 floats. The current matrix |
|
1899 |
will be loaded from that." |
|
1900 |
||
1901 |
%{ /* NOCONTEXT */ |
|
1902 |
Matrix matrix; |
|
1903 |
Matrix *m; |
|
1904 |
||
1905 |
if (! (m = getFloatsFromMatrixInto(arrayOf16Floats, &matrix))) RETURN (false); |
|
1906 |
SETWIN(aGLXWindowId) |
|
1907 |
loadmatrix(*m); |
|
1908 |
RETURN (true); |
|
1909 |
%} |
|
1910 |
! |
|
1911 |
||
1912 |
glxMultMatrix:arrayOf16Floats in:aGLXWindowId |
|
1913 |
"argument must be an array(a matrix) of 16 floats containing a |
|
1914 |
matrix to multiply into the current matrix." |
|
1915 |
||
1916 |
%{ /* NOCONTEXT */ |
|
1917 |
Matrix matrix; |
|
1918 |
Matrix *m; |
|
1919 |
||
1920 |
if (! (m = getFloatsFromMatrixInto(arrayOf16Floats, &matrix))) RETURN (false); |
|
1921 |
SETWIN(aGLXWindowId) |
|
1922 |
multmatrix(*m); |
|
1923 |
RETURN (true); |
|
1924 |
%} |
|
1925 |
! |
|
1926 |
||
1927 |
glxPopmatrixIn:aGLXWindowId |
|
1928 |
"pop transformation stack" |
|
1929 |
||
1930 |
%{ /* NOCONTEXT */ |
|
1931 |
SETWIN(aGLXWindowId) |
|
1932 |
popmatrix(); |
|
1933 |
RETURN (true); |
|
1934 |
%} |
|
1935 |
! |
|
1936 |
||
1937 |
glxPushmatrixIn:aGLXWindowId |
|
1938 |
"push down transformation stack" |
|
1939 |
||
1940 |
%{ /* NOCONTEXT */ |
|
1941 |
SETWIN(aGLXWindowId) |
|
1942 |
pushmatrix(); |
|
1943 |
RETURN (true); |
|
1944 |
%} |
|
1945 |
! ! |
|
1946 |
||
1947 |
!GLXWorkstation methodsFor:'misc'! |
|
1948 |
||
1949 |
glxGconfigIn:aGLXWindowId |
|
1950 |
"must be sent after RGBmode, doubleBuffer etc. to have these |
|
1951 |
changes really take effect. See GLX manual. |
|
1952 |
(Actually, it seems to be not allowed - I dont really know)" |
|
1953 |
||
1954 |
%{ /* NOCONTEXT */ |
|
1955 |
SETWIN(aGLXWindowId) |
|
1956 |
gconfig(); |
|
1957 |
RETURN (true); |
|
1958 |
%} |
|
1959 |
! |
|
1960 |
||
1961 |
glxMmode:aSymbol in:aGLXWindowId |
|
1962 |
"set matrix mode: #single, #viewing, #projection or #texture" |
|
1963 |
||
1964 |
%{ /* NOCONTEXT */ |
|
1965 |
#ifdef GLX |
|
1966 |
if (aSymbol == @symbol(single)) { |
|
1967 |
mmode(MSINGLE); |
|
1968 |
RETURN (true); |
|
1969 |
} |
|
1970 |
if (aSymbol == @symbol(viewing)) { |
|
1971 |
mmode(MVIEWING); |
|
1972 |
RETURN (true); |
|
1973 |
} |
|
1974 |
if (aSymbol == @symbol(projection)) { |
|
1975 |
mmode(MPROJECTION); |
|
1976 |
RETURN (true); |
|
1977 |
} |
|
1978 |
if (aSymbol == @symbol(texture)) { |
|
1979 |
mmode(MTEXTURE); |
|
1980 |
RETURN (true); |
|
1981 |
} |
|
1982 |
#endif |
|
1983 |
%} |
|
1984 |
. |
|
1985 |
^ false |
|
1986 |
! |
|
1987 |
||
1988 |
glxNmode:aSymbol in:aGLXWindowId |
|
1989 |
"set normalize mode: #auto, #normalize" |
|
1990 |
||
1991 |
%{ /* NOCONTEXT */ |
|
1992 |
#ifdef GLX |
|
1993 |
if (aSymbol == @symbol(auto)) { |
|
1994 |
nmode(NAUTO); |
|
1995 |
RETURN (true); |
|
1996 |
} |
|
1997 |
if (aSymbol == @symbol(normalize)) { |
|
1998 |
nmode(NNORMALIZE); |
|
1999 |
RETURN (true); |
|
2000 |
} |
|
2001 |
#endif |
|
2002 |
%} |
|
2003 |
. |
|
2004 |
^ false |
|
2005 |
! |
|
2006 |
||
2007 |
glxRGBmodeIn:aGLXWindowId |
|
2008 |
"set true color mode (no colormap)" |
|
2009 |
||
2010 |
%{ /* NOCONTEXT */ |
|
2011 |
#ifdef GLX |
|
2012 |
SETWIN(aGLXWindowId) |
|
2013 |
RGBmode(); |
|
2014 |
RETURN (true); |
|
2015 |
#endif |
|
2016 |
%} |
|
2017 |
. |
|
2018 |
^ false |
|
2019 |
! ! |
|
2020 |
||
2021 |
!GLXWorkstation methodsFor:'objects'! |
|
2022 |
||
2023 |
glxCallObject:obj in:aGLXWindowId |
|
2024 |
"perform the commands of an object (macro)." |
|
2025 |
||
2026 |
%{ /* NOCONTEXT */ |
|
2027 |
if (__isSmallInteger(obj)) { |
|
2028 |
SETWIN(aGLXWindowId) |
|
2029 |
callobj(_objectVal(obj)); |
|
2030 |
RETURN (true); |
|
2031 |
} |
|
2032 |
%} |
|
2033 |
. |
|
2034 |
^ false |
|
2035 |
! |
|
2036 |
||
2037 |
glxCallobj: obj in: aGLXWindowId |
|
2038 |
"OBSOLETE; use glxCallObject:in: |
|
2039 |
This one will be removed soon." |
|
2040 |
||
2041 |
%{ /* NOCONTEXT */ |
|
2042 |
if (__isSmallInteger(obj)) { |
|
2043 |
SETWIN(aGLXWindowId) |
|
2044 |
callobj(_objectVal(obj)); |
|
2045 |
RETURN (true); |
|
2046 |
} |
|
2047 |
%} |
|
2048 |
. |
|
2049 |
^ false |
|
2050 |
! |
|
2051 |
||
2052 |
glxCloseObjectIn:aGLXWindowId |
|
2053 |
"end object defnition" |
|
2054 |
||
2055 |
%{ /* NOCONTEXT */ |
|
2056 |
SETWIN(aGLXWindowId) |
|
2057 |
closeobj(); |
|
2058 |
RETURN (true); |
|
2059 |
%} |
|
2060 |
! |
|
2061 |
||
2062 |
glxCloseobjIn:aGLXWindowId |
|
2063 |
"OBSOLETE: use glxCloseObjectIn: |
|
2064 |
This one will be removed." |
|
2065 |
||
2066 |
%{ /* NOCONTEXT */ |
|
2067 |
SETWIN(aGLXWindowId) |
|
2068 |
closeobj(); |
|
2069 |
RETURN (true); |
|
2070 |
%} |
|
2071 |
! |
|
2072 |
||
2073 |
glxDeleteObject:obj in:aGLXWindowId |
|
2074 |
||
2075 |
%{ /* NOCONTEXT */ |
|
2076 |
SETWIN(aGLXWindowId) |
|
2077 |
delobj(_objectVal(obj)); |
|
2078 |
RETURN (true); |
|
2079 |
%} |
|
2080 |
! |
|
2081 |
||
2082 |
glxDelobj:obj in:aGLXWindowId |
|
2083 |
"OBSOLETE: use glxDeleteObject:in: |
|
2084 |
This one will be removed." |
|
2085 |
||
2086 |
%{ /* NOCONTEXT */ |
|
2087 |
SETWIN(aGLXWindowId) |
|
2088 |
delobj(_objectVal(obj)); |
|
2089 |
RETURN (true); |
|
2090 |
%} |
|
2091 |
! |
|
2092 |
||
2093 |
glxGenObjectIn:aGLXWindowId |
|
2094 |
"return a new (free & unused) object id for use |
|
2095 |
with makeObj" |
|
2096 |
||
2097 |
%{ /* NOCONTEXT */ |
|
2098 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
2099 |
RETURN (__MKSMALLINT(genobj())); |
294 | 2100 |
%} |
2101 |
! |
|
2102 |
||
2103 |
glxGenobjIn:aGLXWindowId |
|
2104 |
"OBSOLETE: use glxGenObject:in: |
|
2105 |
This one will be removed." |
|
2106 |
||
2107 |
%{ /* NOCONTEXT */ |
|
2108 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
2109 |
RETURN (__MKSMALLINT(genobj())); |
294 | 2110 |
%} |
2111 |
! |
|
2112 |
||
2113 |
glxGetopenobjIn:aGLXWindowId |
|
2114 |
"return the currently open objects id; -1 if none is open" |
|
2115 |
||
2116 |
%{ /* NOCONTEXT */ |
|
2117 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
2118 |
RETURN (__MKSMALLINT(getopenobj())); |
294 | 2119 |
%} |
2120 |
! |
|
2121 |
||
2122 |
glxIsobj:obj in:aGLXWindowId |
|
2123 |
"return true, if obj is a valid object id" |
|
2124 |
||
2125 |
%{ /* NOCONTEXT */ |
|
2126 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
2127 |
RETURN (__MKBOOLEAN(isobj(_objectVal(obj)))); |
294 | 2128 |
%} |
2129 |
! |
|
2130 |
||
2131 |
glxMakeObject:id in:aGLXWindowId |
|
2132 |
"start object definition - |
|
2133 |
another name conflict" |
|
2134 |
||
2135 |
%{ /* NOCONTEXT */ |
|
2136 |
if (__isSmallInteger(id)) { |
|
2137 |
SETWIN(aGLXWindowId) |
|
2138 |
makeobj(_objectVal(id)); |
|
2139 |
RETURN (true); |
|
2140 |
} |
|
2141 |
%} |
|
2142 |
. |
|
2143 |
^ false |
|
2144 |
! |
|
2145 |
||
2146 |
glxMakeobj:obj in:aGLXWindowId |
|
2147 |
"OBSOLETE; use glxMakeObject:in: |
|
2148 |
This one will be removed soon." |
|
2149 |
||
2150 |
%{ /* NOCONTEXT */ |
|
2151 |
if (__isSmallInteger(obj)) { |
|
2152 |
SETWIN(aGLXWindowId) |
|
2153 |
makeobj(_objectVal(obj)); |
|
2154 |
RETURN (true); |
|
2155 |
} |
|
2156 |
%} |
|
2157 |
. |
|
2158 |
^ false |
|
2159 |
! ! |
|
2160 |
||
2161 |
!GLXWorkstation methodsFor:'patches & surfaces'! |
|
2162 |
||
2163 |
glxBeginCurveIn:aGLXWindowId |
|
2164 |
"start a NURBS curve def - in real GL only" |
|
2165 |
||
2166 |
%{ /* NOCONTEXT */ |
|
2167 |
#ifdef GLX |
|
2168 |
SETWIN(aGLXWindowId) |
|
2169 |
bgncurve(); |
|
2170 |
RETURN (true); |
|
2171 |
#endif |
|
2172 |
%} |
|
2173 |
. |
|
2174 |
^ false |
|
2175 |
! |
|
2176 |
||
2177 |
glxBeginSurfaceIn:aGLXWindowId |
|
2178 |
"start a NURBS surface def - in real GL only" |
|
2179 |
||
2180 |
%{ /* NOCONTEXT */ |
|
2181 |
#ifdef GLX |
|
2182 |
SETWIN(aGLXWindowId) |
|
2183 |
bgnsurface(); |
|
2184 |
RETURN (true); |
|
2185 |
#endif |
|
2186 |
%} |
|
2187 |
. |
|
2188 |
^ false |
|
2189 |
! |
|
2190 |
||
2191 |
glxDefBasis:id mat:aMatrix in:aGLXWindowId |
|
2192 |
"define the basis" |
|
2193 |
||
2194 |
%{ /* NOCONTEXT */ |
|
2195 |
Matrix matrix; |
|
2196 |
Matrix *m; |
|
2197 |
||
2198 |
if (! (m = getFloatsFromMatrixInto(aMatrix, &matrix))) RETURN (false); |
|
2199 |
if (__isSmallInteger(id)) { |
|
2200 |
SETWIN(aGLXWindowId) |
|
2201 |
defbasis((short)(__intVal(id)), *m); |
|
2202 |
RETURN (true); |
|
2203 |
} |
|
2204 |
%} |
|
2205 |
. |
|
2206 |
^ false |
|
2207 |
! |
|
2208 |
||
2209 |
glxEndCurveIn:aGLXWindowId |
|
2210 |
"end a NURBS curve def - in real GL only" |
|
2211 |
||
2212 |
%{ /* NOCONTEXT */ |
|
2213 |
#ifdef GLX |
|
2214 |
SETWIN(aGLXWindowId) |
|
2215 |
endcurve(); |
|
2216 |
RETURN (true); |
|
2217 |
#endif |
|
2218 |
%} |
|
2219 |
. |
|
2220 |
^ false |
|
2221 |
! |
|
2222 |
||
2223 |
glxEndSurfaceIn:aGLXWindowId |
|
2224 |
"end a NURBS surface def - in real GL only" |
|
2225 |
||
2226 |
%{ /* NOCONTEXT */ |
|
2227 |
#ifdef GLX |
|
2228 |
SETWIN(aGLXWindowId) |
|
2229 |
endsurface(); |
|
2230 |
RETURN (true); |
|
2231 |
#endif |
|
2232 |
%} |
|
2233 |
. |
|
2234 |
^ false |
|
2235 |
! |
|
2236 |
||
2237 |
glxNurbsSurfaceUKnotCount: uKnotCount uKnot: uKnot |
|
2238 |
vKnotCount: vKnotCount vKnot: vKnot |
|
2239 |
uOffset: uOffset vOffset: vOffset |
|
2240 |
ctlArray: ctlArray |
|
2241 |
uOrder: uOrder vOrder: vOrder |
|
2242 |
type: type in: aGLXWindowId |
|
2243 |
||
2244 |
| ctlPoints i | |
|
2245 |
ctlPoints := DoubleArray new: ctlArray size * (ctlArray first size). |
|
2246 |
i := 1. |
|
2247 |
ctlArray do: [:point | |
|
2248 |
point do: [:coord | |
|
2249 |
ctlPoints at: i put: coord. |
|
2250 |
i := i + 1]]. |
|
2251 |
||
2252 |
%{ /* NOCONTEXT */ |
|
2253 |
#ifdef GLX |
|
2254 |
char *uKnotElements, *vKnotElements, *ctlElements; |
|
2255 |
OBJ cls; |
|
2256 |
int ninstVars, nInstBytes; |
|
2257 |
||
2258 |
SETWIN(aGLXWindowId) |
|
2259 |
cls = __qClass(ctlPoints); |
|
2260 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
2261 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
|
2262 |
||
2263 |
ctlElements = (char *)(_InstPtr(ctlPoints)) + nInstBytes; |
|
2264 |
uKnotElements = (char *)(_InstPtr(uKnot)) + nInstBytes; |
|
2265 |
vKnotElements = (char *)(_InstPtr(vKnot)) + nInstBytes; |
|
2266 |
||
2267 |
nurbssurface ( |
|
2268 |
__intVal(uKnotCount), (double *)uKnotElements, |
|
2269 |
__intVal(vKnotCount), (double *)vKnotElements, |
|
2270 |
__intVal(uOffset), __intVal(vOffset), |
|
2271 |
(double *)ctlElements, |
|
2272 |
__intVal(uOrder), __intVal(vOrder), __intVal(type)); |
|
2273 |
RETURN(true); |
|
2274 |
#endif |
|
2275 |
%} |
|
2276 |
. |
|
2277 |
^ false |
|
2278 |
! |
|
2279 |
||
2280 |
glxPatchBasisU:u v:v in:aGLXWindowId |
|
2281 |
"set the current basis matrices" |
|
2282 |
||
2283 |
%{ /* NOCONTEXT */ |
|
2284 |
if (__bothSmallInteger(u, v)) { |
|
2285 |
SETWIN(aGLXWindowId) |
|
2286 |
patchbasis((long)__intVal(u), (long)__intVal(v)); |
|
2287 |
RETURN (true); |
|
2288 |
} |
|
2289 |
%} |
|
2290 |
. |
|
2291 |
^ false |
|
2292 |
! |
|
2293 |
||
2294 |
glxPatchCurvesU:u v:v in:aGLXWindowId |
|
2295 |
"set the number of curves in a patch" |
|
2296 |
||
2297 |
%{ /* NOCONTEXT */ |
|
2298 |
if (__bothSmallInteger(u, v)) { |
|
2299 |
SETWIN(aGLXWindowId) |
|
2300 |
patchcurves((long)__intVal(u), (long)__intVal(v)); |
|
2301 |
RETURN (true); |
|
2302 |
} |
|
2303 |
%} |
|
2304 |
. |
|
2305 |
^ false |
|
2306 |
! |
|
2307 |
||
2308 |
glxPatchPrecisionU:u v:v in:aGLXWindowId |
|
2309 |
"set the patch precision" |
|
2310 |
||
2311 |
%{ /* NOCONTEXT */ |
|
2312 |
if (__bothSmallInteger(u, v)) { |
|
2313 |
SETWIN(aGLXWindowId) |
|
2314 |
patchprecision((long)__intVal(u), (long)__intVal(v)); |
|
2315 |
RETURN (true); |
|
2316 |
} |
|
2317 |
%} |
|
2318 |
. |
|
2319 |
^ false |
|
2320 |
! |
|
2321 |
||
2322 |
glxPatchX:arrayOf16XFloats y:arrayOf16YFloats z:arrayOf16ZFloats in:aGLXWindowId |
|
2323 |
"arguments must be arrays of 16 floats containing the patch" |
|
2324 |
||
2325 |
%{ /* NOCONTEXT */ |
|
2326 |
Matrix matrixX, matrixY, matrixZ; |
|
2327 |
Matrix *mX, *mY, *mZ; |
|
2328 |
||
2329 |
if (! (mX = getFloatsFromMatrixInto(arrayOf16XFloats, &matrixX))) RETURN (false); |
|
2330 |
if (! (mY = getFloatsFromMatrixInto(arrayOf16YFloats, &matrixY))) RETURN (false); |
|
2331 |
if (! (mZ = getFloatsFromMatrixInto(arrayOf16ZFloats, &matrixZ))) RETURN (false); |
|
2332 |
SETWIN(aGLXWindowId) |
|
2333 |
patch(*mX, *mY, *mZ); |
|
2334 |
RETURN (true); |
|
2335 |
%} |
|
2336 |
! ! |
|
2337 |
||
24 | 2338 |
!GLXWorkstation methodsFor:'queries'! |
2339 |
||
159 | 2340 |
glVersion |
2341 |
"return a string describing the GL version. |
|
2342 |
For informative use only; portable applications do not depend |
|
2343 |
on the returned string." |
|
2344 |
||
2345 |
%{ /* NOCONTEXT */ |
|
2346 |
#ifdef VGL |
|
216 | 2347 |
RETURN (__MKSTRING("vogl" COMMA_CON)); |
159 | 2348 |
#else |
2349 |
char buffer[128]; |
|
2350 |
||
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2351 |
if (_INST(glOK) == true) { |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2352 |
gversion(buffer); |
216 | 2353 |
RETURN (__MKSTRING(buffer COMMA_CON)); |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2354 |
} else { |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2355 |
RETURN (nil); |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2356 |
} |
159 | 2357 |
#endif |
2358 |
%} |
|
2359 |
||
2360 |
" |
|
2361 |
Display glVersion |
|
2362 |
" |
|
2363 |
! |
|
2364 |
||
294 | 2365 |
hasStereoExtension |
2366 |
"return true, if this workstation supports stereo GL drawing. |
|
2367 |
Both the server must support it, and the feature must have been |
|
2368 |
enabled in the smalltalk system, for true to be returned." |
|
2369 |
||
2370 |
^ hasStereoExtension |
|
2371 |
||
2372 |
" |
|
2373 |
Display hasStereoExtension |
|
2374 |
" |
|
2375 |
! |
|
2376 |
||
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2377 |
isTrueGL |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2378 |
"return true, if this is a true GL (as opposed to a simulated VOGL)" |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2379 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2380 |
%{ /* NOCONTEXT */ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2381 |
#ifdef VGL |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2382 |
RETURN ( false ); |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2383 |
#else |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2384 |
RETURN ( true ); |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2385 |
#endif |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2386 |
%} |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2387 |
! |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2388 |
|
294 | 2389 |
maxZValue |
2390 |
"return the max. Z value (only valid if z-buffer is supported)" |
|
2391 |
%{ |
|
2392 |
#ifdef GLX |
|
2393 |
long zMax; |
|
2394 |
||
2395 |
if (_INST(glOK) == true) { |
|
2396 |
zMax = getgdesc(GD_ZMAX); |
|
2397 |
||
2398 |
if ((zMax >= _MIN_INT) && (zMax <= _MAX_INT)) { |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
2399 |
RETURN ( __MKSMALLINT(zMax) ); |
294 | 2400 |
} |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
2401 |
RETURN ( __MKLARGEINT(zMax) ); |
294 | 2402 |
} |
2403 |
#endif |
|
2404 |
%}. |
|
2405 |
^ nil |
|
2406 |
! |
|
2407 |
||
2408 |
supportsDoubleBuffer |
|
2409 |
"return true, if this gl workstation supports double buffering. |
|
157 | 2410 |
For portable applications, always combine this with a query |
2411 |
if the display supports GL drawing at all." |
|
24 | 2412 |
|
2413 |
%{ /* NOCONTEXT */ |
|
294 | 2414 |
|
2415 |
#ifdef GLX |
|
2416 |
if (getgdesc(GD_BITS_NORM_DBL_RED) != 0) { |
|
2417 |
RETURN ( _INST(glOK) ); |
|
2418 |
} |
|
24 | 2419 |
#endif |
89 | 2420 |
%}. |
2421 |
^ false |
|
2422 |
||
2423 |
" |
|
294 | 2424 |
Display supportsDoubleBuffer |
2425 |
" |
|
2426 |
! |
|
2427 |
||
2428 |
supportsGLDrawing |
|
2429 |
"return true, if this device supports 3D GL drawing." |
|
2430 |
||
2431 |
^ glOK |
|
2432 |
||
2433 |
" |
|
2434 |
Display supportsGLDrawing |
|
89 | 2435 |
" |
64 | 2436 |
! |
2437 |
||
2438 |
supportsLight |
|
157 | 2439 |
"return true, if this gl workstation supports light sources |
2440 |
(i.e. if its a real GL). |
|
2441 |
For portable applications, always combine this with a query |
|
2442 |
if the display supports GL drawing at all." |
|
89 | 2443 |
|
2444 |
%{ /* NOCONTEXT */ |
|
64 | 2445 |
#ifdef GLX |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2446 |
RETURN ( _INST(glOK) ); |
64 | 2447 |
#endif |
89 | 2448 |
%}. |
2449 |
^ false |
|
2450 |
||
2451 |
" |
|
2452 |
Display supportsLight |
|
2453 |
" |
|
2454 |
! |
|
2455 |
||
294 | 2456 |
supportsRGB |
2457 |
"return true, if this gl workstation supports rgb |
|
2458 |
(in addition to indexed) colors. Actually, we return true |
|
2459 |
for a real GL engine, false for the simulator here. |
|
2460 |
For portable applications, always combine this with a query |
|
2461 |
if the display supports GL drawing at all." |
|
2462 |
||
2463 |
%{ /* NOCONTEXT */ |
|
2464 |
#ifdef GLX |
|
2465 |
RETURN ( _INST(glOK) ); |
|
2466 |
#endif |
|
2467 |
%}. |
|
2468 |
^ false |
|
2469 |
||
2470 |
" |
|
2471 |
Display supportsRGB |
|
2472 |
" |
|
2473 |
! |
|
2474 |
||
89 | 2475 |
supportsTextures |
2476 |
"return true, if this gl workstation supports texture mapping |
|
157 | 2477 |
(i.e. if its a real GL). |
2478 |
For portable applications, always combine this with a query |
|
2479 |
if the display supports GL drawing at all." |
|
89 | 2480 |
|
2481 |
%{ /* NOCONTEXT */ |
|
2482 |
#ifdef GLX |
|
2483 |
if (getgdesc(GD_TEXTURE) != 0) { |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2484 |
RETURN ( _INST(glOK) ); |
89 | 2485 |
} |
2486 |
#endif |
|
2487 |
%}. |
|
2488 |
^ false |
|
2489 |
||
2490 |
" |
|
2491 |
Display supportsTextures |
|
2492 |
" |
|
2493 |
! |
|
2494 |
||
2495 |
supportsZBuffer |
|
157 | 2496 |
"return true, if this gl workstation has z buffer support. |
2497 |
For portable applications, always combine this with a query |
|
2498 |
if the display supports GL drawing at all." |
|
2499 |
||
89 | 2500 |
%{ /* NOCONTEXT */ |
2501 |
||
2502 |
#ifdef GLX |
|
2503 |
if (getgdesc(GD_BITS_NORM_ZBUFFER) != 0) { |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2504 |
RETURN ( _INST(glOK) ); |
89 | 2505 |
} |
2506 |
#endif |
|
2507 |
%}. |
|
2508 |
^ false |
|
2509 |
||
2510 |
" |
|
2511 |
Display supportsZBuffer |
|
2512 |
" |
|
294 | 2513 |
! ! |
2514 |
||
2515 |
!GLXWorkstation methodsFor:'sphere drawing'! |
|
2516 |
||
2517 |
glxSphDraw:arrayOf4Floats in:aGLXWindowId |
|
2518 |
"argument must be an array(a matrix) of 4 floats containing the |
|
2519 |
sphere - in real GL only" |
|
2520 |
||
2521 |
%{ /* NOCONTEXT */ |
|
2522 |
#ifdef GLX |
|
2523 |
float vec[4], *v; |
|
2524 |
||
2525 |
if (! (v = getFloatsFromInto(arrayOf4Floats, vec, 4))) RETURN(false); |
|
2526 |
SETWIN(aGLXWindowId) |
|
2527 |
sphdraw(v); |
|
2528 |
RETURN (true); |
|
2529 |
#endif |
|
2530 |
%} |
|
2531 |
. |
|
2532 |
^ false |
|
2533 |
! |
|
2534 |
||
2535 |
glxSphDrawX:x y:y z:z radius:r in:aGLXWindowId |
|
2536 |
"arguments must be convertable to floats - in real GL only" |
|
2537 |
||
2538 |
%{ /* NOCONTEXT */ |
|
2539 |
#ifdef GLX |
|
2540 |
float vec[4]; |
|
2541 |
||
2542 |
_FLOAT_(x, vec[0]) |
|
2543 |
_FLOAT_(y, vec[1]) |
|
2544 |
_FLOAT_(z, vec[2]) |
|
2545 |
_FLOAT_(r, vec[3]) |
|
2546 |
SETWIN(aGLXWindowId) |
|
2547 |
sphdraw(vec); |
|
2548 |
RETURN (true); |
|
2549 |
#endif |
|
2550 |
%} |
|
2551 |
. |
|
2552 |
^ false |
|
2553 |
! |
|
2554 |
||
2555 |
glxSphfreeIn: aGLXWindowId |
|
2556 |
||
2557 |
%{ /* NOCONTEXT */ |
|
2558 |
#ifdef GLX |
|
2559 |
SETWIN(aGLXWindowId) |
|
2560 |
sphfree(); |
|
2561 |
RETURN (true); |
|
2562 |
#endif |
|
2563 |
%} |
|
2564 |
. |
|
2565 |
^ false |
|
2566 |
! |
|
2567 |
||
2568 |
glxSphgnpolysIn: aGLXWindowId |
|
2569 |
||
2570 |
%{ /* NOCONTEXT */ |
|
2571 |
#ifdef GLX |
|
2572 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
2573 |
RETURN (__MKSMALLINT(sphgnpolys())); |
294 | 2574 |
#endif |
2575 |
%} |
|
2576 |
. |
|
2577 |
^ false |
|
2578 |
! |
|
2579 |
||
2580 |
glxSphmode: attribute value: value in: aGLXWindowId |
|
2581 |
||
2582 |
%{ /* NOCONTEXT */ |
|
2583 |
#ifdef GLX |
|
2584 |
SETWIN(aGLXWindowId) |
|
2585 |
sphmode(__intVal(attribute), __intVal(value)); |
|
2586 |
RETURN (true); |
|
2587 |
#endif |
|
2588 |
%} |
|
2589 |
. |
|
2590 |
^ false |
|
2591 |
! |
|
2592 |
||
2593 |
glxSphobj: objid in: aGLXWindowId |
|
2594 |
||
2595 |
%{ /* NOCONTEXT */ |
|
2596 |
#ifdef GLX |
|
2597 |
SETWIN(aGLXWindowId) |
|
2598 |
sphobj(_objectVal(objid)); |
|
2599 |
RETURN (true); |
|
2600 |
#endif |
|
2601 |
%} |
|
2602 |
. |
|
2603 |
^ false |
|
2604 |
! |
|
2605 |
||
2606 |
glxSphrotmatrix: mat in: aGLXWindowId |
|
2607 |
||
2608 |
%{ /* NOCONTEXT */ |
|
2609 |
#ifdef GLX |
|
2610 |
Matrix matrix, *m; |
|
2611 |
||
2612 |
if (! (m = getFloatsFromMatrixInto(mat, &matrix))) RETURN (false); |
|
2613 |
SETWIN(aGLXWindowId) |
|
2614 |
sphrotmatrix(*m); |
|
2615 |
RETURN (true); |
|
2616 |
#endif |
|
2617 |
%} |
|
2618 |
. |
|
2619 |
^ false |
|
2620 |
! ! |
|
2621 |
||
2622 |
!GLXWorkstation methodsFor:'stereo extension'! |
|
2623 |
||
2624 |
stereoExtensionBuffer:aBufferSymbol for:aWindowId |
|
2625 |
"set the current stereo buffer; the argument may be one of: |
|
2626 |
#left -> STEREO_BUFFER_LEFT |
|
2627 |
#right -> STEREO_BUFFER_RIGHT |
|
2628 |
" |
|
2629 |
||
2630 |
%{ /* NOCONTEXT */ |
|
2631 |
#if defined(XSGIStereo) && defined(GLX) |
|
2632 |
Status status; |
|
2633 |
int buffer; |
|
2634 |
Window win; |
|
2635 |
||
2636 |
if (ISCONNECTED |
|
2637 |
&& __isExternalAddress(aWindowId)) { |
|
2638 |
win = _WindowVal(aWindowId); |
|
2639 |
if (aBufferSymbol == @symbol(left)) { |
|
2640 |
buffer = STEREO_BUFFER_LEFT; |
|
2641 |
} else { |
|
2642 |
if (aBufferSymbol == @symbol(right)) { |
|
2643 |
buffer = STEREO_BUFFER_RIGHT; |
|
2644 |
} else { |
|
2645 |
goto bad; |
|
2646 |
} |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2647 |
} |
294 | 2648 |
status = XSGISetStereoBuffer(myDpy, win, buffer); |
2649 |
RETURN ( status ? true : false); |
|
2650 |
} |
|
2651 |
bad: ; |
|
2652 |
#endif |
|
2653 |
%}. |
|
2654 |
self primitiveFailed |
|
2655 |
||
2656 |
" |
|
2657 |
|t v| |
|
2658 |
||
2659 |
t := StandardSystemView new. |
|
2660 |
t extent:300@300. |
|
2661 |
v := GLXView origin:0.0@0.0 corner:1.0@1.0 in:t. |
|
2662 |
t openAndWait. |
|
2663 |
||
2664 |
v device stereoExtensionBuffer:#left for:(v id). |
|
2665 |
(Delay forSeconds:10) wait. |
|
2666 |
v device stereoExtensionBuffer:#right for:(v id). |
|
2667 |
" |
|
2668 |
! |
|
2669 |
||
2670 |
stereoExtensionMode:aModeSymbol height:h offset:o for:aWindowId |
|
2671 |
"set the current stereo mode; the argument may be one of: |
|
2672 |
nil/false #off -> turn it off |
|
2673 |
#bottom -> STEREO_BOTTOM |
|
2674 |
#top -> STEREO_TOP |
|
2675 |
" |
|
2676 |
||
2677 |
%{ /* NOCONTEXT */ |
|
2678 |
#if defined(XSGIStereo) && defined(GLX) |
|
2679 |
Status status; |
|
2680 |
int mode; |
|
2681 |
unsigned short us_h, us_o; |
|
2682 |
Window win; |
|
2683 |
||
2684 |
if (ISCONNECTED |
|
2685 |
&& __bothSmallInteger(h, o) |
|
2686 |
&& __isExternalAddress(aWindowId)) { |
|
2687 |
win = _WindowVal(aWindowId); |
|
2688 |
if ((aModeSymbol == nil) |
|
2689 |
|| (aModeSymbol == false) |
|
2690 |
|| (aModeSymbol == @symbol(off))) { |
|
2691 |
mode = STEREO_OFF; |
|
2692 |
} else { |
|
2693 |
if (aModeSymbol == @symbol(bottom)) { |
|
2694 |
mode = STEREO_BOTTOM; |
|
2695 |
} else { |
|
2696 |
if (aModeSymbol == @symbol(top)) { |
|
2697 |
mode = STEREO_TOP; |
|
2698 |
} else { |
|
2699 |
goto bad; |
|
2700 |
} |
|
2701 |
} |
|
2702 |
} |
|
2703 |
us_h = __intVal(h); |
|
2704 |
us_o = __intVal(o); |
|
2705 |
status = XSGISetStereoMode(myDpy, win, us_h, us_o, mode); |
|
2706 |
RETURN ( status ? true : false); |
|
2707 |
} |
|
2708 |
bad: ; |
|
2709 |
#endif |
|
2710 |
%}. |
|
2711 |
self primitiveFailed |
|
2712 |
||
2713 |
" |
|
2714 |
Display stereoExtensionMode:#top height:492 offset:532 for:(Display rootWindowId). |
|
2715 |
(Delay forSeconds:10) wait. |
|
2716 |
Display stereoExtensionMode:#off height:0 offset:0 for:(Display rootWindowId). |
|
2717 |
" |
|
2718 |
! |
|
2719 |
||
2720 |
stereoExtensionModeIn:aWindowId |
|
2721 |
"return the current stereo mode for some window" |
|
2722 |
||
2723 |
%{ /* NOCONTEXT */ |
|
2724 |
#if defined(XSGIStereo) && defined(GLX) |
|
2725 |
int mode; |
|
2726 |
Window win; |
|
2727 |
||
2728 |
if (ISCONNECTED && __isExternalAddress(aWindowId)) { |
|
2729 |
win = _WindowVal(aWindowId); |
|
2730 |
mode = XSGIQueryStereoMode(myDpy, win); |
|
2731 |
switch (mode) { |
|
2732 |
case STEREO_OFF: |
|
2733 |
RETURN ( @symbol(off) ); |
|
2734 |
case STEREO_BOTTOM: |
|
2735 |
RETURN ( @symbol(bottom) ); |
|
2736 |
case STEREO_TOP: |
|
2737 |
RETURN ( @symbol(top) ); |
|
2738 |
} |
|
2739 |
RETURN ( @symbol(unsupported) ); |
|
2740 |
} |
|
2741 |
#endif |
|
2742 |
%}. |
|
2743 |
self primitiveFailed |
|
2744 |
||
2745 |
" |
|
2746 |
|v| |
|
2747 |
||
2748 |
v := StandardSystemView new. |
|
2749 |
v extent:300@300. |
|
2750 |
v openAndWait. |
|
2751 |
v device stereoExtensionModeIn:(v id) |
|
2752 |
||
2753 |
Display stereoExtensionModeIn:Display rootWindowId |
|
2754 |
" |
|
2755 |
! |
|
2756 |
||
2757 |
stereoExtensionVersion |
|
2758 |
"return the stereo extensions version as an array consisting of |
|
2759 |
major and minor numbers." |
|
2760 |
||
2761 |
%{ /* NOCONTEXT */ |
|
2762 |
#if defined(XSGIStereo) && defined(GLX) |
|
2763 |
Status status; |
|
2764 |
Display *dpy = myDpy; |
|
2765 |
int major, minor; |
|
2766 |
||
2767 |
if (ISCONNECTED) { |
|
2768 |
status = XSGIStereoQueryVersion(myDpy, &major, &minor); |
|
2769 |
if (status == True) { |
|
2770 |
RETURN ( __ARRAY_WITH2(__MKSMALLINT(major), __MKSMALLINT(minor))); |
|
2771 |
} |
|
89 | 2772 |
} |
2773 |
#endif |
|
2774 |
%}. |
|
294 | 2775 |
self primitiveFailed |
185 | 2776 |
|
2777 |
" |
|
294 | 2778 |
Display stereoExtensionVersion |
185 | 2779 |
" |
24 | 2780 |
! ! |
2781 |
||
294 | 2782 |
!GLXWorkstation methodsFor:'transformations'! |
2783 |
||
2784 |
glxRotate:angle axis:axis in:aGLXWindowId |
|
2785 |
"rotate the current matrix around the axis given by the axis arg, |
|
2786 |
which must be one of the symbols: #x, #y or #z. |
|
2787 |
The angle is in degrees." |
|
2788 |
||
2789 |
%{ /* NOCONTEXT */ |
|
2790 |
||
2791 |
char c_axis; |
|
2792 |
||
2793 |
if (axis == @symbol(x)) |
|
2794 |
c_axis = 'x'; |
|
2795 |
else if (axis == @symbol(y)) |
|
2796 |
c_axis = 'y'; |
|
2797 |
else if (axis == @symbol(z)) |
|
2798 |
c_axis = 'z'; |
|
2799 |
else { |
|
2800 |
RETURN (false); |
|
2801 |
} |
|
2802 |
||
2803 |
SETWIN(aGLXWindowId) |
|
2804 |
RETURN ( doRotate(angle, c_axis) ); |
|
2805 |
%} |
|
2806 |
! |
|
2807 |
||
2808 |
glxRotate:arrayOf3Floats in:aGLXWindowId |
|
2809 |
"rotate current matrix, given a 3-element vector (or more). |
|
2810 |
The elements of the array are degrees." |
|
2811 |
||
2812 |
%{ /* NOCONTEXT */ |
|
2813 |
||
2814 |
float vec[3], *v; |
|
2815 |
||
2816 |
if (! (v = getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
|
2817 |
||
2818 |
SETWIN(aGLXWindowId) |
|
2819 |
rot(v[0], 'x'); |
|
2820 |
rot(v[1], 'y'); |
|
2821 |
rot(v[2], 'z'); |
|
2822 |
RETURN (true); |
|
2823 |
%} |
|
2824 |
! |
|
2825 |
||
2826 |
glxRotateI:angle axis:axis in:aGLXWindowId |
|
2827 |
"rotate the current matrix around the axis given by the axis arg, |
|
2828 |
which must be one of the symbols: #x, #y or #z. |
|
2829 |
The angle is an integer specifying tenths of a degree." |
|
2830 |
||
2831 |
%{ /* NOCONTEXT */ |
|
2832 |
||
2833 |
char c_axis; |
|
2834 |
||
2835 |
if (axis == @symbol(x)) |
|
2836 |
c_axis = 'x'; |
|
2837 |
else if (axis == @symbol(y)) |
|
2838 |
c_axis = 'y'; |
|
2839 |
else if (axis == @symbol(z)) |
|
2840 |
c_axis = 'z'; |
|
2841 |
else { |
|
2842 |
RETURN (false); |
|
2843 |
} |
|
2844 |
||
2845 |
if (__isSmallInteger(angle)) { |
|
2846 |
SETWIN(aGLXWindowId) |
|
2847 |
rotate(__intVal(angle), c_axis); |
|
2848 |
RETURN (true); |
|
2849 |
} |
|
2850 |
%} |
|
2851 |
. |
|
2852 |
^ false |
|
2853 |
! |
|
2854 |
||
2855 |
glxRotateIX:angle in:aGLXWindowId |
|
2856 |
"rotate the current matrix on x axis. |
|
2857 |
The angle is an integer specifying tenths of a degree." |
|
2858 |
||
2859 |
%{ /* NOCONTEXT */ |
|
2860 |
||
2861 |
if (__isSmallInteger(angle)) { |
|
2862 |
SETWIN(aGLXWindowId) |
|
2863 |
rotate(__intVal(angle), 'x'); |
|
2864 |
RETURN (true); |
|
2865 |
} |
|
2866 |
%} |
|
2867 |
. |
|
2868 |
^ false |
|
2869 |
! |
|
2870 |
||
2871 |
glxRotateIX:xAngle y:yAngle z:zAngle in:aGLXWindowId |
|
2872 |
"rotate the current matrix on all axes, given individual x, y and z values. |
|
2873 |
The values are integers specifying tenths of a degree." |
|
2874 |
||
2875 |
%{ /* NOCONTEXT */ |
|
2876 |
||
2877 |
if (__bothSmallInteger(xAngle, yAngle) |
|
2878 |
&& __isSmallInteger(zAngle)) { |
|
2879 |
SETWIN(aGLXWindowId) |
|
2880 |
rotate(__intVal(xAngle), 'x'); |
|
2881 |
rotate(__intVal(yAngle), 'y'); |
|
2882 |
rotate(__intVal(zAngle), 'z'); |
|
2883 |
RETURN (true); |
|
2884 |
} |
|
2885 |
%} |
|
2886 |
. |
|
2887 |
^ false |
|
2888 |
! |
|
2889 |
||
2890 |
glxRotateIY:angle in:aGLXWindowId |
|
2891 |
"rotate the current matrix on x axis. |
|
2892 |
The angle is an integer specifying tenths of a degree." |
|
2893 |
||
2894 |
%{ /* NOCONTEXT */ |
|
2895 |
||
2896 |
if (__isSmallInteger(angle)) { |
|
2897 |
SETWIN(aGLXWindowId) |
|
2898 |
rotate(__intVal(angle), 'y'); |
|
2899 |
RETURN (true); |
|
2900 |
} |
|
2901 |
%} |
|
2902 |
. |
|
2903 |
^ false |
|
2904 |
! |
|
2905 |
||
2906 |
glxRotateIZ:angle in:aGLXWindowId |
|
2907 |
"rotate the current matrix on x axis. |
|
2908 |
The angle is an integer specifying tenths of a degree." |
|
2909 |
||
2910 |
%{ /* NOCONTEXT */ |
|
2911 |
||
2912 |
if (__isSmallInteger(angle)) { |
|
2913 |
SETWIN(aGLXWindowId) |
|
2914 |
rotate(__intVal(angle), 'z'); |
|
2915 |
RETURN (true); |
|
2916 |
} |
|
2917 |
%} |
|
2918 |
. |
|
2919 |
^ false |
|
2920 |
! |
|
2921 |
||
2922 |
glxRotateX:angle in:aGLXWindowId |
|
2923 |
"rotate the current matrix on x axis. |
|
2924 |
The angle is in degrees." |
|
2925 |
||
2926 |
%{ /* NOCONTEXT */ |
|
2927 |
||
2928 |
SETWIN(aGLXWindowId) |
|
2929 |
RETURN (doRotate(angle, 'x')); |
|
2930 |
%} |
|
2931 |
! |
|
2932 |
||
2933 |
glxRotateX:xAngle y:yAngle z:zAngle in:aGLXWindowId |
|
2934 |
"rotate the current matrix on all axes, given individual x, y and z values. |
|
2935 |
The values are in degrees" |
|
2936 |
||
2937 |
%{ /* NOCONTEXT */ |
|
2938 |
||
2939 |
SETWIN(aGLXWindowId) |
|
2940 |
if ( doRotate(xAngle, 'x') == true) { |
|
2941 |
if ( doRotate(yAngle, 'y') == true) { |
|
2942 |
RETURN (doRotate(zAngle, 'z')); |
|
2943 |
} |
|
2944 |
} |
|
2945 |
%} |
|
2946 |
. |
|
2947 |
^ false |
|
2948 |
! |
|
2949 |
||
2950 |
glxRotateY:angle in:aGLXWindowId |
|
2951 |
"rotate the current matrix on y axis. |
|
2952 |
The angle is in degrees." |
|
2953 |
||
2954 |
%{ /* NOCONTEXT */ |
|
2955 |
||
2956 |
SETWIN(aGLXWindowId) |
|
2957 |
RETURN (doRotate(angle, 'y')); |
|
2958 |
%} |
|
2959 |
! |
|
2960 |
||
2961 |
glxRotateZ:angle in:aGLXWindowId |
|
2962 |
"rotate the current matrix on z axis. |
|
2963 |
The angle is in degrees." |
|
2964 |
||
2965 |
%{ /* NOCONTEXT */ |
|
2966 |
||
2967 |
SETWIN(aGLXWindowId) |
|
2968 |
RETURN (doRotate(angle, 'z')); |
|
2969 |
%} |
|
2970 |
! |
|
2971 |
||
2972 |
glxScale:arrayOf3Floats in:aGLXWindowId |
|
2973 |
"scale current matrix, given a 3-element vector" |
|
2974 |
||
2975 |
%{ /* NOCONTEXT */ |
|
2976 |
||
2977 |
float vec[3], *v; |
|
2978 |
||
2979 |
if (! (v = getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
|
2980 |
||
2981 |
SETWIN(aGLXWindowId) |
|
2982 |
scale(v[0], v[1], v[2]); |
|
2983 |
RETURN (true); |
|
2984 |
%} |
|
2985 |
! |
|
2986 |
||
2987 |
glxScaleX:x in:aGLXWindowId |
|
2988 |
"scale in x direction" |
|
2989 |
||
2990 |
%{ /* NOCONTEXT */ |
|
2991 |
||
2992 |
float f_x; |
|
2993 |
||
2994 |
_FLOAT_ (x, f_x) |
|
2995 |
SETWIN(aGLXWindowId) |
|
2996 |
scale(f_x, (float)0, (float)0); |
|
2997 |
RETURN (true); |
|
2998 |
%} |
|
2999 |
! |
|
3000 |
||
3001 |
glxScaleX:x y:y z:z in:aGLXWindowId |
|
3002 |
"scale & mirror current matrix, given individual x, y and z values" |
|
3003 |
||
3004 |
%{ /* NOCONTEXT */ |
|
3005 |
||
3006 |
float f_x, f_y, f_z; |
|
3007 |
||
3008 |
_FLOAT_ (x, f_x) |
|
3009 |
_FLOAT_ (y, f_y) |
|
3010 |
_FLOAT_ (z, f_z) |
|
3011 |
SETWIN(aGLXWindowId) |
|
3012 |
scale(f_x, f_y, f_z); |
|
3013 |
RETURN (true); |
|
3014 |
%} |
|
3015 |
! |
|
3016 |
||
3017 |
glxScaleY:y in:aGLXWindowId |
|
3018 |
"scale in y direction" |
|
3019 |
||
3020 |
%{ /* NOCONTEXT */ |
|
3021 |
||
3022 |
float f_y; |
|
3023 |
||
3024 |
_FLOAT_ (y, f_y) |
|
3025 |
SETWIN(aGLXWindowId) |
|
3026 |
scale((float)0, f_y, (float)0); |
|
3027 |
RETURN (true); |
|
3028 |
%} |
|
3029 |
! |
|
3030 |
||
3031 |
glxScaleZ:z in:aGLXWindowId |
|
3032 |
"scale in z direction" |
|
3033 |
||
3034 |
%{ /* NOCONTEXT */ |
|
3035 |
||
3036 |
float f_z; |
|
3037 |
||
3038 |
_FLOAT_ (z, f_z) |
|
3039 |
SETWIN(aGLXWindowId) |
|
3040 |
scale((float)0, (float)0, f_z); |
|
3041 |
RETURN (true); |
|
3042 |
%} |
|
3043 |
! |
|
3044 |
||
3045 |
glxTranslate:arrayOf3Floats in:aGLXWindowId |
|
3046 |
"translate current matrix, given a 3-element vector" |
|
3047 |
||
3048 |
%{ /* NOCONTEXT */ |
|
3049 |
||
3050 |
float vec[3], *v; |
|
3051 |
||
3052 |
if (! (v = getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
|
3053 |
||
3054 |
SETWIN(aGLXWindowId) |
|
3055 |
translate((Coord)(v[0]), (Coord)(v[1]), (Coord)(v[2])); |
|
3056 |
RETURN (true); |
|
3057 |
%} |
|
3058 |
! |
|
3059 |
||
3060 |
glxTranslateX:x in:aGLXWindowId |
|
3061 |
"translate current matrix on X axis" |
|
3062 |
||
3063 |
%{ /* NOCONTEXT */ |
|
3064 |
||
3065 |
Coord c_x; |
|
3066 |
||
3067 |
_COORD_ (x, c_x) |
|
3068 |
SETWIN(aGLXWindowId) |
|
3069 |
translate(c_x, (Coord)0, (Coord)0); |
|
3070 |
RETURN (true); |
|
3071 |
%} |
|
3072 |
! |
|
3073 |
||
3074 |
glxTranslateX:x y:y z:z in:aGLXWindowId |
|
3075 |
"translate current matrix, given individual x, y and z values" |
|
3076 |
||
3077 |
%{ /* NOCONTEXT */ |
|
3078 |
||
3079 |
Coord c_x, c_y, c_z; |
|
3080 |
||
3081 |
_COORD_ (x, c_x) |
|
3082 |
_COORD_ (y, c_y) |
|
3083 |
_COORD_ (z, c_z) |
|
3084 |
SETWIN(aGLXWindowId) |
|
3085 |
translate(c_x, c_y, c_z); |
|
3086 |
RETURN (true); |
|
3087 |
%} |
|
3088 |
! |
|
3089 |
||
3090 |
glxTranslateY:y in:aGLXWindowId |
|
3091 |
"translate current matrix on Y axis" |
|
3092 |
||
3093 |
%{ /* NOCONTEXT */ |
|
3094 |
||
3095 |
Coord c_y; |
|
3096 |
||
3097 |
_COORD_ (y, c_y) |
|
3098 |
SETWIN(aGLXWindowId) |
|
3099 |
translate((Coord)0, c_y, (Coord)0); |
|
3100 |
RETURN (true); |
|
3101 |
%} |
|
3102 |
! |
|
3103 |
||
3104 |
glxTranslateZ:z in:aGLXWindowId |
|
3105 |
"translate current matrix on Z axis" |
|
3106 |
||
3107 |
%{ /* NOCONTEXT */ |
|
3108 |
||
3109 |
Coord c_z; |
|
3110 |
||
3111 |
_COORD_ (z, c_z) |
|
3112 |
SETWIN(aGLXWindowId) |
|
3113 |
translate((Coord)0, (Coord)0, c_z); |
|
3114 |
RETURN (true); |
|
3115 |
%} |
|
3116 |
! ! |
|
3117 |
||
3118 |
!GLXWorkstation methodsFor:'unspecified rest'! |
|
3119 |
||
3120 |
glxAcbufOp:op value:value in:aGLXWindowId |
|
3121 |
||
3122 |
%{ /* NOCONTEXT */ |
|
3123 |
#ifdef GLX |
|
3124 |
SETWIN(aGLXWindowId) |
|
3125 |
acbuf(__intVal(op), _floatVal(value)); |
|
3126 |
RETURN (true); |
|
3127 |
#endif |
|
3128 |
%} |
|
3129 |
. |
|
3130 |
^ false |
|
3131 |
! |
|
3132 |
||
3133 |
glxAcsizePlanes: planes in: aGLXWindowId |
|
3134 |
||
3135 |
%{ /* NOCONTEXT */ |
|
3136 |
#ifdef GLX |
|
3137 |
SETWIN(aGLXWindowId) |
|
3138 |
acsize(__intVal(planes)); |
|
3139 |
RETURN (true); |
|
3140 |
#endif |
|
3141 |
%} |
|
3142 |
. |
|
3143 |
^ false |
|
3144 |
! |
|
3145 |
||
3146 |
glxAfunctionRef: ref func: func in: aGLXWindowId |
|
3147 |
||
3148 |
%{ /* NOCONTEXT */ |
|
3149 |
#ifdef GLX |
|
3150 |
SETWIN(aGLXWindowId) |
|
3151 |
afunction(__intVal(ref), __intVal(func)); |
|
3152 |
RETURN (true); |
|
3153 |
#endif |
|
3154 |
%} |
|
3155 |
. |
|
3156 |
^ false |
|
3157 |
! |
|
3158 |
||
3159 |
glxBackface: b in: aGLXWindowId |
|
3160 |
"enable/disable backface culling" |
|
3161 |
||
3162 |
%{ /* NOCONTEXT */ |
|
3163 |
SETWIN(aGLXWindowId) |
|
3164 |
backface(_booleanVal(b)); |
|
3165 |
RETURN (true); |
|
3166 |
%} |
|
3167 |
! |
|
3168 |
||
3169 |
glxBbox2Xmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
3170 |
||
3171 |
%{ /* NOCONTEXT */ |
|
3172 |
#ifdef GLX |
|
3173 |
Screencoord c_xmin, c_ymin; |
|
3174 |
Coord c_x1, c_y1, c_x2, c_y2; |
|
3175 |
||
3176 |
_SCREENCOORD_ (xmin, c_xmin) |
|
3177 |
_SCREENCOORD_ (ymin, c_ymin) |
|
3178 |
_COORD_ (x1, c_x1) |
|
3179 |
_COORD_ (y1, c_y1) |
|
3180 |
_COORD_ (x2, c_x2) |
|
3181 |
_COORD_ (y2, c_y2) |
|
3182 |
SETWIN(aGLXWindowId) |
|
3183 |
bbox2(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
|
3184 |
RETURN (true); |
|
3185 |
#endif |
|
3186 |
%} |
|
3187 |
. |
|
3188 |
^ false |
|
3189 |
! |
|
3190 |
||
3191 |
glxBbox2iXmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
3192 |
||
3193 |
%{ /* NOCONTEXT */ |
|
3194 |
#ifdef GLX |
|
3195 |
Screencoord c_xmin, c_ymin; |
|
3196 |
Icoord c_x1, c_y1, c_x2, c_y2; |
|
3197 |
||
3198 |
_SCREENCOORD_ (xmin, c_xmin) |
|
3199 |
_SCREENCOORD_ (ymin, c_ymin) |
|
3200 |
_ICOORD_ (x1, c_x1) |
|
3201 |
_ICOORD_ (y1, c_y1) |
|
3202 |
_ICOORD_ (x2, c_x2) |
|
3203 |
_ICOORD_ (y2, c_y2) |
|
3204 |
SETWIN(aGLXWindowId) |
|
3205 |
bbox2i(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
|
3206 |
RETURN (true); |
|
3207 |
#endif |
|
3208 |
%} |
|
3209 |
. |
|
3210 |
^ false |
|
3211 |
! |
|
3212 |
||
3213 |
glxBbox2sXmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
3214 |
||
3215 |
%{ /* NOCONTEXT */ |
|
3216 |
#ifdef GLX |
|
3217 |
Screencoord c_xmin, c_ymin; |
|
3218 |
Scoord c_x1, c_y1, c_x2, c_y2; |
|
3219 |
||
3220 |
_SCREENCOORD_ (xmin, c_xmin) |
|
3221 |
_SCREENCOORD_ (ymin, c_ymin) |
|
3222 |
_SCOORD_ (x1, c_x1) |
|
3223 |
_SCOORD_ (y1, c_y1) |
|
3224 |
_SCOORD_ (x2, c_x2) |
|
3225 |
_SCOORD_ (y2, c_y2) |
|
3226 |
SETWIN(aGLXWindowId) |
|
3227 |
bbox2s(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
|
3228 |
RETURN (true); |
|
3229 |
#endif |
|
3230 |
%} |
|
3231 |
. |
|
3232 |
^ false |
|
3233 |
! |
|
3234 |
||
3235 |
glxBeginTrimIn: aGLXWindowId |
|
3236 |
||
3237 |
%{ /* NOCONTEXT */ |
|
3238 |
#ifdef GLX |
|
3239 |
SETWIN(aGLXWindowId) |
|
3240 |
bgntrim(); |
|
3241 |
RETURN (true); |
|
3242 |
#endif |
|
3243 |
%} |
|
3244 |
. |
|
3245 |
^ false |
|
3246 |
! |
|
3247 |
||
3248 |
glxBlankscreen: b in: aGLXWindowId |
|
3249 |
||
3250 |
%{ /* NOCONTEXT */ |
|
3251 |
#ifdef GLX |
|
3252 |
SETWIN(aGLXWindowId) |
|
3253 |
blankscreen(_booleanVal(b)); |
|
3254 |
RETURN (true); |
|
3255 |
#endif |
|
3256 |
%} |
|
3257 |
. |
|
3258 |
^ false |
|
3259 |
! |
|
3260 |
||
3261 |
glxBlanktime: count in: aGLXWindowId |
|
3262 |
||
3263 |
%{ /* NOCONTEXT */ |
|
3264 |
#ifdef GLX |
|
3265 |
SETWIN(aGLXWindowId) |
|
3266 |
blanktime(__intVal(count)); |
|
3267 |
RETURN (true); |
|
3268 |
#endif |
|
3269 |
%} |
|
3270 |
. |
|
3271 |
^ false |
|
3272 |
! |
|
3273 |
||
3274 |
glxBlendcolorRed: red green: green blue: blue alpha: alpha in: aGLXWindowId |
|
3275 |
||
3276 |
%{ /* NOCONTEXT */ |
|
3277 |
#ifdef FULL_GLX |
|
3278 |
SETWIN(aGLXWindowId) |
|
3279 |
blendcolor(_floatVal(red), _floatVal(green), _floatVal(blue), _floatVal(alpha)); |
|
3280 |
RETURN (true); |
|
3281 |
#endif |
|
3282 |
%} |
|
3283 |
. |
|
3284 |
^ false |
|
3285 |
! |
|
3286 |
||
3287 |
glxBlendfunctionSfactr: sfactr dfactr: dfactr in: aGLXWindowId |
|
3288 |
||
3289 |
%{ /* NOCONTEXT */ |
|
3290 |
#ifdef GLX |
|
3291 |
SETWIN(aGLXWindowId) |
|
3292 |
blendfunction(__intVal(sfactr), __intVal(dfactr)); |
|
3293 |
RETURN (true); |
|
3294 |
#endif |
|
3295 |
%} |
|
3296 |
. |
|
3297 |
^ false |
|
3298 |
! |
|
3299 |
||
3300 |
glxBlinkRate: rate i: i red: red green: green blue: blue in: aGLXWindowId |
|
3301 |
||
3302 |
%{ /* NOCONTEXT */ |
|
3303 |
#ifdef GLX |
|
3304 |
SETWIN(aGLXWindowId) |
|
3305 |
blink(_shortVal(rate), _colorindexVal(i), |
|
3306 |
_shortVal(red), _shortVal(green), _shortVal(blue)); |
|
3307 |
RETURN (true); |
|
3308 |
#endif |
|
3309 |
%} |
|
3310 |
. |
|
3311 |
^ false |
|
3312 |
! |
|
3313 |
||
3314 |
glxBlkqreadData: data n: n in: aGLXWindowId |
|
3315 |
||
3316 |
%{ /* NOCONTEXT */ |
|
3317 |
#ifdef GLX |
|
3318 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3319 |
RETURN (__MKSMALLINT(blkqread((short *)_indexedArea(data), __intVal(n)))); |
294 | 3320 |
#endif |
3321 |
%} |
|
3322 |
. |
|
3323 |
^ false |
|
3324 |
! |
|
3325 |
||
3326 |
glxC3f: v in: aGLXWindowId |
|
3327 |
||
3328 |
%{ /* NOCONTEXT */ |
|
3329 |
#ifdef GLX |
|
3330 |
float vec[3], *c_v; |
|
3331 |
||
3332 |
if (! (c_v = getFloatsFromInto(v, vec, 3))) RETURN(false); |
|
3333 |
SETWIN(aGLXWindowId) |
|
3334 |
c3f(c_v); |
|
3335 |
RETURN (true); |
|
3336 |
#endif |
|
3337 |
%} |
|
3338 |
. |
|
3339 |
^ false |
|
3340 |
! |
|
3341 |
||
3342 |
glxC3i: v in: aGLXWindowId |
|
3343 |
||
3344 |
%{ /* NOCONTEXT */ |
|
3345 |
#ifdef GLX |
|
3346 |
long vec[3], *c_v; |
|
3347 |
||
3348 |
if (! (c_v = getLongsFromInto(v, vec, 3))) RETURN(false); |
|
3349 |
SETWIN(aGLXWindowId) |
|
3350 |
c3i(c_v); |
|
3351 |
RETURN (true); |
|
3352 |
#endif |
|
3353 |
%} |
|
3354 |
. |
|
3355 |
^ false |
|
3356 |
! |
|
3357 |
||
3358 |
glxC3s: v in: aGLXWindowId |
|
3359 |
||
3360 |
%{ /* NOCONTEXT */ |
|
3361 |
#ifdef GLX |
|
3362 |
short vec[3], *c_v; |
|
3363 |
||
3364 |
if (! (c_v = getShortsFromInto(v, vec, 3))) RETURN(false); |
|
3365 |
SETWIN(aGLXWindowId) |
|
3366 |
c3s(c_v); |
|
3367 |
RETURN (true); |
|
3368 |
#endif |
|
3369 |
%} |
|
3370 |
. |
|
3371 |
^ false |
|
3372 |
! |
|
3373 |
||
3374 |
glxC4f: v in: aGLXWindowId |
|
3375 |
||
3376 |
%{ /* NOCONTEXT */ |
|
3377 |
#ifdef GLX |
|
3378 |
float vec[4], *c_v; |
|
3379 |
||
3380 |
if (! (c_v = getFloatsFromInto(v, vec, 4))) RETURN(false); |
|
3381 |
SETWIN(aGLXWindowId) |
|
3382 |
c4f(c_v); |
|
3383 |
RETURN (true); |
|
3384 |
#endif |
|
3385 |
%} |
|
3386 |
. |
|
3387 |
^ false |
|
3388 |
! |
|
3389 |
||
3390 |
glxC4i: v in: aGLXWindowId |
|
3391 |
||
3392 |
%{ /* NOCONTEXT */ |
|
3393 |
#ifdef GLX |
|
3394 |
long vec[4], *c_v; |
|
3395 |
||
3396 |
if (! (c_v = getLongsFromInto(v, vec, 4))) RETURN(false); |
|
3397 |
SETWIN(aGLXWindowId) |
|
3398 |
c4i(c_v); |
|
3399 |
RETURN (true); |
|
3400 |
#endif |
|
3401 |
%} |
|
3402 |
. |
|
3403 |
^ false |
|
3404 |
! |
|
3405 |
||
3406 |
glxC4s: v in: aGLXWindowId |
|
3407 |
||
3408 |
%{ /* NOCONTEXT */ |
|
3409 |
#ifdef GLX |
|
3410 |
short vec[4], *c_v; |
|
3411 |
||
3412 |
if (! (c_v = getShortsFromInto(v, vec, 4))) RETURN(false); |
|
3413 |
SETWIN(aGLXWindowId) |
|
3414 |
c4s(c_v); |
|
3415 |
RETURN (true); |
|
3416 |
#endif |
|
3417 |
%} |
|
3418 |
. |
|
3419 |
^ false |
|
3420 |
! |
|
3421 |
||
3422 |
glxClearhitcodeIn: aGLXWindowId |
|
3423 |
||
3424 |
%{ /* NOCONTEXT */ |
|
3425 |
#ifdef GLX |
|
3426 |
SETWIN(aGLXWindowId) |
|
3427 |
clearhitcode(); |
|
3428 |
RETURN (true); |
|
3429 |
#endif |
|
3430 |
%} |
|
3431 |
. |
|
3432 |
^ false |
|
3433 |
! |
|
3434 |
||
3435 |
glxClipplaneIndex: index mode: mode params: params in: aGLXWindowId |
|
3436 |
||
3437 |
%{ /* NOCONTEXT */ |
|
3438 |
#ifdef GLX |
|
3439 |
float vec[4], *v; |
|
3440 |
||
3441 |
if (! (v = getFloatsFromInto(params, vec, 4))) RETURN(false); |
|
3442 |
SETWIN(aGLXWindowId) |
|
3443 |
clipplane(__intVal(index), __intVal(mode), v); |
|
3444 |
RETURN (true); |
|
3445 |
#endif |
|
3446 |
%} |
|
3447 |
. |
|
3448 |
^ false |
|
3449 |
! |
|
3450 |
||
3451 |
glxCmodeIn: aGLXWindowId |
|
3452 |
||
3453 |
%{ /* NOCONTEXT */ |
|
3454 |
#ifdef GLX |
|
3455 |
SETWIN(aGLXWindowId) |
|
3456 |
cmode(); |
|
3457 |
RETURN (true); |
|
3458 |
#endif |
|
3459 |
%} |
|
3460 |
. |
|
3461 |
^ false |
|
3462 |
! |
|
3463 |
||
3464 |
glxCmov2X: x y: y in: aGLXWindowId |
|
3465 |
||
3466 |
%{ /* NOCONTEXT */ |
|
3467 |
Coord c_x, c_y; |
|
3468 |
||
3469 |
_COORD_ (x, c_x) |
|
3470 |
_COORD_ (y, c_y) |
|
3471 |
SETWIN(aGLXWindowId) |
|
3472 |
cmov2(c_x, c_y); |
|
3473 |
RETURN (true); |
|
3474 |
%} |
|
3475 |
! |
|
3476 |
||
3477 |
glxCmov2iX: x y: y in: aGLXWindowId |
|
3478 |
||
3479 |
%{ /* NOCONTEXT */ |
|
3480 |
Icoord c_x, c_y; |
|
3481 |
||
3482 |
_ICOORD_ (x, c_x) |
|
3483 |
_ICOORD_ (y, c_y) |
|
3484 |
SETWIN(aGLXWindowId) |
|
3485 |
cmov2i(c_x, c_y); |
|
3486 |
RETURN (true); |
|
3487 |
%} |
|
3488 |
! |
|
3489 |
||
3490 |
glxCmov2sX: x y: y in: aGLXWindowId |
|
3491 |
||
3492 |
%{ /* NOCONTEXT */ |
|
3493 |
Scoord c_x, c_y; |
|
3494 |
||
3495 |
_SCOORD_ (x, c_x) |
|
3496 |
_SCOORD_ (y, c_y) |
|
3497 |
SETWIN(aGLXWindowId) |
|
3498 |
cmov2s(c_x, c_y); |
|
3499 |
RETURN (true); |
|
3500 |
%} |
|
3501 |
! |
|
3502 |
||
3503 |
glxCmovX: x y: y z: z in: aGLXWindowId |
|
3504 |
||
3505 |
%{ /* NOCONTEXT */ |
|
3506 |
Coord c_x, c_y, c_z; |
|
3507 |
||
3508 |
_COORD_ (x, c_x) |
|
3509 |
_COORD_ (y, c_y) |
|
3510 |
_COORD_ (z, c_z) |
|
3511 |
SETWIN(aGLXWindowId) |
|
3512 |
cmov(c_x, c_y, c_z); |
|
3513 |
RETURN (true); |
|
3514 |
%} |
|
3515 |
! |
|
3516 |
||
3517 |
glxCmoviX: x y: y z: z in: aGLXWindowId |
|
3518 |
||
3519 |
%{ /* NOCONTEXT */ |
|
3520 |
Icoord c_x, c_y, c_z; |
|
3521 |
||
3522 |
_ICOORD_ (x, c_x) |
|
3523 |
_ICOORD_ (y, c_y) |
|
3524 |
_ICOORD_ (z, c_z) |
|
3525 |
SETWIN(aGLXWindowId) |
|
3526 |
cmovi(c_x, c_y, c_z); |
|
3527 |
RETURN (true); |
|
3528 |
%} |
|
3529 |
! |
|
3530 |
||
3531 |
glxCmovsX: x y: y z: z in: aGLXWindowId |
|
3532 |
||
3533 |
%{ /* NOCONTEXT */ |
|
3534 |
Scoord c_x, c_y, c_z; |
|
3535 |
||
3536 |
_SCOORD_ (x, c_x) |
|
3537 |
_SCOORD_ (y, c_y) |
|
3538 |
_SCOORD_ (z, c_z) |
|
3539 |
SETWIN(aGLXWindowId) |
|
3540 |
cmovs(c_x, c_y, c_z); |
|
3541 |
RETURN (true); |
|
3542 |
%} |
|
3543 |
! |
|
3544 |
||
3545 |
glxColorfIndex: index in: aGLXWindowId |
|
3546 |
||
3547 |
^self glxColor: index in: aGLXWindowId |
|
3548 |
! |
|
3549 |
||
3550 |
glxConcave: b in: aGLXWindowId |
|
3551 |
||
3552 |
%{ /* NOCONTEXT */ |
|
3553 |
SETWIN(aGLXWindowId) |
|
3554 |
concave(_booleanVal(b)); |
|
3555 |
RETURN (true); |
|
3556 |
%} |
|
3557 |
! |
|
3558 |
||
3559 |
glxCuroriginN: n xorigin: xorigin yorigin: yorigin in: aGLXWindowId |
|
3560 |
||
3561 |
%{ /* NOCONTEXT */ |
|
3562 |
#ifdef GLX |
|
3563 |
SETWIN(aGLXWindowId) |
|
3564 |
curorigin(_shortVal(n), _shortVal(xorigin), _shortVal(yorigin)); |
|
3565 |
RETURN (true); |
|
3566 |
#endif |
|
3567 |
%} |
|
3568 |
. |
|
3569 |
^ false |
|
3570 |
! |
|
3571 |
||
3572 |
glxCursoffIn: aGLXWindowId |
|
3573 |
||
3574 |
%{ /* NOCONTEXT */ |
|
3575 |
#ifdef GLX |
|
3576 |
SETWIN(aGLXWindowId) |
|
3577 |
cursoff(); |
|
3578 |
RETURN (true); |
|
3579 |
#endif |
|
3580 |
%} |
|
3581 |
. |
|
3582 |
^ false |
|
3583 |
! |
|
3584 |
||
3585 |
glxCursonIn: aGLXWindowId |
|
3586 |
||
3587 |
%{ /* NOCONTEXT */ |
|
3588 |
#ifdef GLX |
|
3589 |
SETWIN(aGLXWindowId) |
|
3590 |
curson(); |
|
3591 |
RETURN (true); |
|
3592 |
#endif |
|
3593 |
%} |
|
3594 |
. |
|
3595 |
^ false |
|
3596 |
! |
|
3597 |
||
3598 |
glxCurstype: type in: aGLXWindowId |
|
3599 |
||
3600 |
%{ /* NOCONTEXT */ |
|
3601 |
#ifdef GLX |
|
3602 |
SETWIN(aGLXWindowId) |
|
3603 |
curstype(__intVal(type)); |
|
3604 |
RETURN (true); |
|
3605 |
#endif |
|
3606 |
%} |
|
3607 |
. |
|
3608 |
^ false |
|
3609 |
! |
|
3610 |
||
3611 |
glxCurvebasis: basid in: aGLXWindowId |
|
3612 |
||
3613 |
%{ /* NOCONTEXT */ |
|
3614 |
SETWIN(aGLXWindowId) |
|
3615 |
curvebasis(_shortVal(basid)); |
|
3616 |
RETURN (true); |
|
3617 |
%} |
|
3618 |
! |
|
3619 |
||
3620 |
glxCurveit: iterationcount in: aGLXWindowId |
|
3621 |
||
3622 |
%{ /* NOCONTEXT */ |
|
3623 |
SETWIN(aGLXWindowId) |
|
3624 |
curveit(_shortVal(iterationcount)); |
|
3625 |
RETURN (true); |
|
3626 |
%} |
|
3627 |
! |
|
3628 |
||
3629 |
glxCurveprecision: nsegments in: aGLXWindowId |
|
3630 |
||
3631 |
%{ /* NOCONTEXT */ |
|
3632 |
SETWIN(aGLXWindowId) |
|
3633 |
curveprecision(_shortVal(nsegments)); |
|
3634 |
RETURN (true); |
|
3635 |
%} |
|
3636 |
! |
|
3637 |
||
3638 |
glxCyclemapDuration: duration map: map nxtmap: nxtmap in: aGLXWindowId |
|
3639 |
||
3640 |
%{ /* NOCONTEXT */ |
|
3641 |
#ifdef GLX |
|
3642 |
SETWIN(aGLXWindowId) |
|
3643 |
cyclemap(_shortVal(duration), _shortVal(map), _shortVal(nxtmap)); |
|
3644 |
RETURN (true); |
|
3645 |
#endif |
|
3646 |
%} |
|
3647 |
. |
|
3648 |
^ false |
|
3649 |
! |
|
3650 |
||
3651 |
glxDeflinestyleN: n ls: ls in: aGLXWindowId |
|
3652 |
"define a line style" |
|
3653 |
||
3654 |
%{ /* NOCONTEXT */ |
|
3655 |
SETWIN(aGLXWindowId) |
|
3656 |
deflinestyle(_shortVal(n), _linestyleVal(ls)); |
|
3657 |
RETURN (true); |
|
3658 |
%} |
|
3659 |
! |
|
3660 |
||
3661 |
glxDefpatternN: n size: size mask: mask in: aGLXWindowId |
|
3662 |
||
3663 |
%{ /* NOCONTEXT */ |
|
3664 |
#ifdef GLX |
|
3665 |
SETWIN(aGLXWindowId) |
|
3666 |
defpattern(_shortVal(n), _shortVal(size), (unsigned short *)_indexedArea(mask)); |
|
3667 |
RETURN (true); |
|
3668 |
#endif |
|
3669 |
%} |
|
3670 |
. |
|
3671 |
^ false |
|
3672 |
! |
|
3673 |
||
3674 |
glxDeltag: t in: aGLXWindowId |
|
3675 |
||
3676 |
%{ /* NOCONTEXT */ |
|
3677 |
#ifdef GLX |
|
3678 |
SETWIN(aGLXWindowId) |
|
3679 |
deltag(_tagVal(t)); |
|
3680 |
RETURN (true); |
|
3681 |
#endif |
|
3682 |
%} |
|
3683 |
. |
|
3684 |
^ false |
|
3685 |
! |
|
3686 |
||
3687 |
glxDepthcueMode: mode in: aGLXWindowId |
|
3688 |
||
3689 |
%{ /* NOCONTEXT */ |
|
3690 |
#ifdef GLX |
|
3691 |
SETWIN(aGLXWindowId) |
|
3692 |
depthcue(_booleanVal(mode)); |
|
3693 |
RETURN (true); |
|
3694 |
#endif |
|
3695 |
%} |
|
3696 |
. |
|
3697 |
^ false |
|
3698 |
! |
|
3699 |
||
3700 |
glxDitherMode: mode in: aGLXWindowId |
|
3701 |
||
3702 |
%{ /* NOCONTEXT */ |
|
3703 |
#ifdef GLX |
|
3704 |
SETWIN(aGLXWindowId) |
|
3705 |
dither(_longVal(mode)); |
|
3706 |
RETURN (true); |
|
3707 |
#endif |
|
3708 |
%} |
|
3709 |
. |
|
3710 |
^ false |
|
3711 |
! |
|
3712 |
||
3713 |
glxDopup: pup in: aGLXWindowId |
|
3714 |
||
3715 |
%{ /* NOCONTEXT */ |
|
3716 |
#ifdef GLX |
|
3717 |
SETWIN(aGLXWindowId) |
|
3718 |
dopup(_longVal(pup)); |
|
3719 |
RETURN (true); |
|
3720 |
#endif |
|
3721 |
%} |
|
3722 |
. |
|
3723 |
^ false |
|
3724 |
! |
|
3725 |
||
3726 |
glxDraw2:v in: aGLXWindowId |
|
3727 |
||
3728 |
%{ /* NOCONTEXT */ |
|
3729 |
float vec[2], *c_v; |
|
3730 |
||
3731 |
if (! (c_v = getFloatsFromInto(v, vec, 2))) RETURN(false); |
|
3732 |
SETWIN(aGLXWindowId) |
|
3733 |
draw2((Coord)(c_v[0]), (Coord)(c_v[1])); |
|
3734 |
RETURN (true); |
|
3735 |
%} |
|
3736 |
! |
|
3737 |
||
3738 |
glxDraw2X: x y: y in: aGLXWindowId |
|
3739 |
||
3740 |
%{ /* NOCONTEXT */ |
|
3741 |
Coord c_x, c_y; |
|
3742 |
||
3743 |
_COORD_ (x, c_x) |
|
3744 |
_COORD_ (y, c_y) |
|
3745 |
SETWIN(aGLXWindowId) |
|
3746 |
draw2(c_x, c_y); |
|
3747 |
RETURN (true); |
|
3748 |
%} |
|
3749 |
! |
|
3750 |
||
3751 |
glxDraw2iX: x y: y in: aGLXWindowId |
|
3752 |
||
3753 |
%{ /* NOCONTEXT */ |
|
3754 |
Icoord c_x, c_y; |
|
3755 |
||
3756 |
_ICOORD_ (x, c_x) |
|
3757 |
_ICOORD_ (y, c_y) |
|
3758 |
SETWIN(aGLXWindowId) |
|
3759 |
draw2i(c_x, c_y); |
|
3760 |
RETURN (true); |
|
3761 |
%} |
|
3762 |
! |
|
3763 |
||
3764 |
glxDraw2sX: x y: y in: aGLXWindowId |
|
3765 |
||
3766 |
%{ /* NOCONTEXT */ |
|
3767 |
Scoord c_x, c_y; |
|
3768 |
||
3769 |
_SCOORD_ (x, c_x) |
|
3770 |
_SCOORD_ (y, c_y) |
|
3771 |
SETWIN(aGLXWindowId) |
|
3772 |
draw2s(c_x, c_y); |
|
3773 |
RETURN (true); |
|
3774 |
%} |
|
3775 |
! |
|
3776 |
||
3777 |
glxDraw:v in: aGLXWindowId |
|
3778 |
||
3779 |
%{ /* NOCONTEXT */ |
|
3780 |
float vec[3], *c_v; |
|
3781 |
||
3782 |
if (! (c_v = getFloatsFromInto(v, vec, 3))) RETURN(false); |
|
3783 |
SETWIN(aGLXWindowId) |
|
3784 |
draw((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
|
3785 |
RETURN (true); |
|
3786 |
%} |
|
3787 |
! |
|
3788 |
||
3789 |
glxDrawX: x y: y z: z in: aGLXWindowId |
|
3790 |
||
3791 |
%{ /* NOCONTEXT */ |
|
3792 |
Coord c_x, c_y, c_z; |
|
3793 |
||
3794 |
_COORD_ (x, c_x) |
|
3795 |
_COORD_ (y, c_y) |
|
3796 |
_COORD_ (z, c_z) |
|
3797 |
SETWIN(aGLXWindowId) |
|
3798 |
draw(c_x, c_y, c_z); |
|
3799 |
RETURN (true); |
|
3800 |
%} |
|
3801 |
! |
|
3802 |
||
3803 |
glxDrawiX: x y: y z: z in: aGLXWindowId |
|
3804 |
||
3805 |
%{ /* NOCONTEXT */ |
|
3806 |
Icoord c_x, c_y, c_z; |
|
3807 |
||
3808 |
_ICOORD_ (x, c_x) |
|
3809 |
_ICOORD_ (y, c_y) |
|
3810 |
_ICOORD_ (z, c_z) |
|
3811 |
SETWIN(aGLXWindowId) |
|
3812 |
drawi(c_x, c_y, c_z); |
|
3813 |
RETURN (true); |
|
3814 |
%} |
|
3815 |
! |
|
3816 |
||
3817 |
glxDrawmode: mode in: aGLXWindowId |
|
3818 |
||
3819 |
%{ /* NOCONTEXT */ |
|
3820 |
#ifdef GLX |
|
3821 |
SETWIN(aGLXWindowId) |
|
3822 |
drawmode(_longVal(mode)); |
|
3823 |
RETURN (true); |
|
3824 |
#endif |
|
3825 |
%} |
|
3826 |
. |
|
3827 |
^ false |
|
3828 |
! |
|
3829 |
||
3830 |
glxDrawsX: x y: y z: z in: aGLXWindowId |
|
3831 |
||
3832 |
%{ /* NOCONTEXT */ |
|
3833 |
Scoord c_x, c_y, c_z; |
|
3834 |
||
3835 |
_SCOORD_ (x, c_x) |
|
3836 |
_SCOORD_ (y, c_y) |
|
3837 |
_SCOORD_ (z, c_z) |
|
3838 |
SETWIN(aGLXWindowId) |
|
3839 |
draws(c_x, c_y, c_z); |
|
3840 |
RETURN (true); |
|
3841 |
%} |
|
3842 |
! |
|
3843 |
||
3844 |
glxEditobj: obj in: aGLXWindowId |
|
3845 |
||
3846 |
%{ /* NOCONTEXT */ |
|
3847 |
#ifdef GLX |
|
3848 |
SETWIN(aGLXWindowId) |
|
3849 |
editobj(_objectVal(obj)); |
|
3850 |
RETURN (true); |
|
3851 |
#endif |
|
3852 |
%} |
|
3853 |
. |
|
3854 |
^ false |
|
3855 |
! |
|
3856 |
||
3857 |
glxEndTrimIn: aGLXWindowId |
|
3858 |
||
3859 |
%{ /* NOCONTEXT */ |
|
3860 |
#ifdef GLX |
|
3861 |
SETWIN(aGLXWindowId) |
|
3862 |
endtrim(); |
|
3863 |
RETURN (true); |
|
3864 |
#endif |
|
3865 |
%} |
|
3866 |
. |
|
3867 |
^ false |
|
3868 |
! |
|
3869 |
||
3870 |
glxEndfullscrnIn: aGLXWindowId |
|
3871 |
||
3872 |
%{ /* NOCONTEXT */ |
|
3873 |
#ifdef GLX |
|
3874 |
SETWIN(aGLXWindowId) |
|
3875 |
endfullscrn(); |
|
3876 |
RETURN (true); |
|
3877 |
#endif |
|
3878 |
%} |
|
3879 |
. |
|
3880 |
^ false |
|
3881 |
! |
|
3882 |
||
3883 |
glxEndpupmodeIn: aGLXWindowId |
|
3884 |
||
3885 |
%{ /* NOCONTEXT */ |
|
3886 |
#ifdef GLX |
|
3887 |
SETWIN(aGLXWindowId) |
|
3888 |
endpupmode(); |
|
3889 |
RETURN (true); |
|
3890 |
#endif |
|
3891 |
%} |
|
3892 |
. |
|
3893 |
^ false |
|
3894 |
! |
|
3895 |
||
3896 |
glxFinishIn: aGLXWindowId |
|
3897 |
||
3898 |
%{ /* NOCONTEXT */ |
|
3899 |
#ifdef GLX |
|
3900 |
SETWIN(aGLXWindowId) |
|
3901 |
finish(); |
|
3902 |
RETURN (true); |
|
3903 |
#endif |
|
3904 |
%} |
|
3905 |
. |
|
3906 |
^ false |
|
3907 |
! |
|
3908 |
||
3909 |
glxFont: fntnum in: aGLXWindowId |
|
3910 |
||
3911 |
%{ /* NOCONTEXT */ |
|
3912 |
SETWIN(aGLXWindowId) |
|
3913 |
font(_shortVal(fntnum)); |
|
3914 |
RETURN (true); |
|
3915 |
%} |
|
3916 |
! |
|
3917 |
||
3918 |
glxForegroundIn: aGLXWindowId |
|
3919 |
||
3920 |
%{ /* NOCONTEXT */ |
|
3921 |
SETWIN(aGLXWindowId) |
|
3922 |
foreground(); |
|
3923 |
RETURN (true); |
|
3924 |
%} |
|
3925 |
! |
|
3926 |
||
3927 |
glxFreepup: pup in: aGLXWindowId |
|
3928 |
||
3929 |
%{ /* NOCONTEXT */ |
|
3930 |
#ifdef GLX |
|
3931 |
SETWIN(aGLXWindowId) |
|
3932 |
freepup(_longVal(pup)); |
|
3933 |
RETURN (true); |
|
3934 |
#endif |
|
3935 |
%} |
|
3936 |
. |
|
3937 |
^ false |
|
3938 |
! |
|
3939 |
||
3940 |
glxFrontface: b in: aGLXWindowId |
|
3941 |
||
3942 |
%{ /* NOCONTEXT */ |
|
3943 |
SETWIN(aGLXWindowId) |
|
3944 |
frontface(_booleanVal(b)); |
|
3945 |
RETURN (true); |
|
3946 |
%} |
|
3947 |
. |
|
3948 |
^ false |
|
3949 |
! |
|
3950 |
||
3951 |
glxFudgeXfudge: xfudge yfudge: yfudge in: aGLXWindowId |
|
3952 |
||
3953 |
%{ /* NOCONTEXT */ |
|
3954 |
#ifdef GLX |
|
3955 |
SETWIN(aGLXWindowId) |
|
3956 |
fudge(_longVal(xfudge), _longVal(yfudge)); |
|
3957 |
RETURN (true); |
|
3958 |
#endif |
|
3959 |
%} |
|
3960 |
. |
|
3961 |
^ false |
|
3962 |
! |
|
3963 |
||
3964 |
glxFullscrnIn: aGLXWindowId |
|
3965 |
||
3966 |
%{ /* NOCONTEXT */ |
|
3967 |
#ifdef GLX |
|
3968 |
SETWIN(aGLXWindowId) |
|
3969 |
fullscrn(); |
|
3970 |
RETURN (true); |
|
3971 |
#endif |
|
3972 |
%} |
|
3973 |
. |
|
3974 |
^ false |
|
3975 |
! |
|
3976 |
||
3977 |
glxGbeginIn: aGLXWindowId |
|
3978 |
||
3979 |
%{ /* NOCONTEXT */ |
|
3980 |
#ifdef GLX |
|
3981 |
SETWIN(aGLXWindowId) |
|
3982 |
gbegin(); |
|
3983 |
RETURN (true); |
|
3984 |
#endif |
|
3985 |
%} |
|
3986 |
. |
|
3987 |
^ false |
|
3988 |
! |
|
3989 |
||
3990 |
glxGentagIn: aGLXWindowId |
|
3991 |
||
3992 |
%{ /* NOCONTEXT */ |
|
3993 |
#ifdef GLX |
|
3994 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3995 |
RETURN (__MKSMALLINT(gentag())); |
294 | 3996 |
#endif |
3997 |
%} |
|
3998 |
. |
|
3999 |
^ false |
|
4000 |
! |
|
4001 |
||
4002 |
glxGetbackfaceIn: aGLXWindowId |
|
4003 |
||
4004 |
%{ /* NOCONTEXT */ |
|
4005 |
#ifdef GLX |
|
4006 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4007 |
RETURN (__MKSMALLINT(getbackface())); |
294 | 4008 |
#endif |
4009 |
%} |
|
4010 |
. |
|
4011 |
^ false |
|
4012 |
! |
|
4013 |
||
4014 |
glxGetbufferIn: aGLXWindowId |
|
4015 |
||
4016 |
%{ /* NOCONTEXT */ |
|
4017 |
#ifdef GLX |
|
4018 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4019 |
RETURN (__MKSMALLINT(getbuffer())); |
294 | 4020 |
#endif |
4021 |
%} |
|
4022 |
. |
|
4023 |
^ false |
|
4024 |
! |
|
4025 |
||
4026 |
glxGetbutton: num in: aGLXWindowId |
|
4027 |
||
4028 |
%{ /* NOCONTEXT */ |
|
4029 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4030 |
RETURN (__MKSMALLINT(getbutton(_deviceVal(num)))); |
294 | 4031 |
%} |
4032 |
! |
|
4033 |
||
4034 |
glxGetcmmodeIn: aGLXWindowId |
|
4035 |
||
4036 |
%{ /* NOCONTEXT */ |
|
4037 |
#ifdef GLX |
|
4038 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4039 |
RETURN (__MKBOOLEAN(getcmmode())); |
294 | 4040 |
#endif |
4041 |
%} |
|
4042 |
. |
|
4043 |
^ false |
|
4044 |
! |
|
4045 |
||
4046 |
glxGetcolorIn: aGLXWindowId |
|
4047 |
"return the current drawing color" |
|
4048 |
||
4049 |
%{ /* NOCONTEXT */ |
|
4050 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4051 |
RETURN (__MKSMALLINT(getcolor())); |
294 | 4052 |
%} |
4053 |
! |
|
4054 |
||
4055 |
glxGetcposIn: aGLXWindowId |
|
4056 |
||
4057 |
| x y | |
|
4058 |
%{ |
|
4059 |
#ifdef GLX |
|
4060 |
short s_x, s_y; |
|
4061 |
SETWIN(aGLXWindowId) |
|
4062 |
getcpos(&s_x, &s_y); |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4063 |
x = __MKSMALLINT(s_x); |
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4064 |
y = __MKSMALLINT(s_y); |
294 | 4065 |
#endif |
4066 |
%} |
|
4067 |
. |
|
4068 |
^x @ y |
|
4069 |
! |
|
4070 |
||
4071 |
glxGetdcmIn: aGLXWindowId |
|
4072 |
||
4073 |
%{ /* NOCONTEXT */ |
|
4074 |
#ifdef GLX |
|
4075 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4076 |
RETURN (__MKBOOLEAN(getdcm())); |
294 | 4077 |
#endif |
4078 |
%} |
|
4079 |
. |
|
4080 |
^ false |
|
4081 |
! |
|
4082 |
||
4083 |
glxGetdescenderIn: aGLXWindowId |
|
4084 |
||
4085 |
%{ /* NOCONTEXT */ |
|
4086 |
#ifdef GLX |
|
4087 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4088 |
RETURN (__MKSMALLINT(getdescender())); |
294 | 4089 |
#endif |
4090 |
%} |
|
4091 |
. |
|
4092 |
^ false |
|
4093 |
! |
|
4094 |
||
4095 |
glxGetdisplaymodeIn: aGLXWindowId |
|
4096 |
||
4097 |
%{ /* NOCONTEXT */ |
|
4098 |
#ifdef GLX |
|
4099 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4100 |
RETURN (__MKSMALLINT(getdisplaymode())); |
294 | 4101 |
#endif |
4102 |
%} |
|
4103 |
. |
|
4104 |
^ false |
|
4105 |
! |
|
4106 |
||
4107 |
glxGetdrawmodeIn: aGLXWindowId |
|
4108 |
||
4109 |
%{ /* NOCONTEXT */ |
|
4110 |
#ifdef GLX |
|
4111 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4112 |
RETURN (__MKSMALLINT(getdrawmode())); |
294 | 4113 |
#endif |
4114 |
%} |
|
4115 |
. |
|
4116 |
^ false |
|
4117 |
! |
|
4118 |
||
4119 |
glxGetfontIn: aGLXWindowId |
|
4120 |
||
4121 |
%{ /* NOCONTEXT */ |
|
4122 |
#ifdef GLX |
|
4123 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4124 |
RETURN (__MKSMALLINT(getfont())); |
294 | 4125 |
#endif |
4126 |
%} |
|
4127 |
. |
|
4128 |
^ false |
|
4129 |
! |
|
4130 |
||
4131 |
glxGetgconfigBuffer: buffer in: aGLXWindowId |
|
4132 |
||
4133 |
%{ /* NOCONTEXT */ |
|
4134 |
#ifdef FULL_GLX |
|
4135 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4136 |
RETURN (__MKSMALLINT(getgconfig(_longVal(buffer)))); |
294 | 4137 |
#endif |
4138 |
%} |
|
4139 |
. |
|
4140 |
^ false |
|
4141 |
! |
|
4142 |
||
4143 |
glxGetgdescInquiry: inquiry in: aGLXWindowId |
|
4144 |
||
4145 |
%{ /* NOCONTEXT */ |
|
4146 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4147 |
RETURN (__MKSMALLINT(getgdesc(_longVal(inquiry)))); |
294 | 4148 |
%} |
4149 |
! |
|
4150 |
||
4151 |
glxGetheightIn: aGLXWindowId |
|
4152 |
||
4153 |
%{ /* NOCONTEXT */ |
|
4154 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4155 |
RETURN (__MKSMALLINT(getheight())); |
294 | 4156 |
%} |
4157 |
! |
|
4158 |
||
4159 |
glxGethitcodeIn: aGLXWindowId |
|
4160 |
||
4161 |
%{ /* NOCONTEXT */ |
|
4162 |
#ifdef GLX |
|
4163 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4164 |
RETURN (__MKSMALLINT(gethitcode())); |
294 | 4165 |
#endif |
4166 |
%} |
|
4167 |
. |
|
4168 |
^ false |
|
4169 |
! |
|
4170 |
||
4171 |
glxGetlsbackupIn: aGLXWindowId |
|
4172 |
||
4173 |
%{ /* NOCONTEXT */ |
|
4174 |
#ifdef GLX |
|
4175 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4176 |
RETURN (__MKBOOLEAN(getlsbackup())); |
294 | 4177 |
#endif |
4178 |
%} |
|
4179 |
. |
|
4180 |
^ false |
|
4181 |
! |
|
4182 |
||
4183 |
glxGetlsrepeatIn: aGLXWindowId |
|
4184 |
||
4185 |
%{ /* NOCONTEXT */ |
|
4186 |
#ifdef GLX |
|
4187 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4188 |
RETURN (__MKSMALLINT(getlsrepeat())); |
294 | 4189 |
#endif |
4190 |
%} |
|
4191 |
. |
|
4192 |
^ false |
|
4193 |
! |
|
4194 |
||
4195 |
glxGetlstyleIn: aGLXWindowId |
|
4196 |
||
4197 |
%{ /* NOCONTEXT */ |
|
4198 |
#ifdef GLX |
|
4199 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4200 |
RETURN (__MKSMALLINT(getlstyle())); |
294 | 4201 |
#endif |
4202 |
%} |
|
4203 |
. |
|
4204 |
^ false |
|
4205 |
! |
|
4206 |
||
4207 |
glxGetlwidthIn: aGLXWindowId |
|
4208 |
||
4209 |
%{ /* NOCONTEXT */ |
|
4210 |
#ifdef GLX |
|
4211 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4212 |
RETURN (__MKSMALLINT(getlwidth())); |
294 | 4213 |
#endif |
4214 |
%} |
|
4215 |
. |
|
4216 |
^ false |
|
4217 |
! |
|
4218 |
||
4219 |
glxGetmapIn: aGLXWindowId |
|
4220 |
||
4221 |
%{ /* NOCONTEXT */ |
|
4222 |
#ifdef GLX |
|
4223 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4224 |
RETURN (__MKSMALLINT(getmap())); |
294 | 4225 |
#endif |
4226 |
%} |
|
4227 |
. |
|
4228 |
^ false |
|
4229 |
! |
|
4230 |
||
4231 |
glxGetmmodeIn: aGLXWindowId |
|
4232 |
||
4233 |
%{ /* NOCONTEXT */ |
|
4234 |
#ifdef GLX |
|
4235 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4236 |
RETURN (__MKSMALLINT(getmmode())); |
294 | 4237 |
#endif |
4238 |
%} |
|
4239 |
. |
|
4240 |
^ false |
|
4241 |
! |
|
4242 |
||
4243 |
glxGetmonitorIn: aGLXWindowId |
|
4244 |
||
4245 |
%{ /* NOCONTEXT */ |
|
4246 |
#ifdef GLX |
|
4247 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4248 |
RETURN (__MKSMALLINT(getmonitor())); |
294 | 4249 |
#endif |
4250 |
%} |
|
4251 |
. |
|
4252 |
^ false |
|
4253 |
! |
|
4254 |
||
4255 |
glxGetmultisampleIn: aGLXWindowId |
|
4256 |
||
4257 |
%{ /* NOCONTEXT */ |
|
4258 |
#ifdef FULL_GLX |
|
4259 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4260 |
RETURN (__MKBOOLEAN(getmultisample())); |
294 | 4261 |
#endif |
4262 |
%} |
|
4263 |
. |
|
4264 |
^ false |
|
4265 |
! |
|
4266 |
||
4267 |
glxGetothermonitorIn: aGLXWindowId |
|
4268 |
||
4269 |
%{ /* NOCONTEXT */ |
|
4270 |
#ifdef GLX |
|
4271 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4272 |
RETURN (__MKSMALLINT(getothermonitor())); |
294 | 4273 |
#endif |
4274 |
%} |
|
4275 |
. |
|
4276 |
^ false |
|
4277 |
! |
|
4278 |
||
4279 |
glxGetpatternIn: aGLXWindowId |
|
4280 |
||
4281 |
%{ /* NOCONTEXT */ |
|
4282 |
#ifdef GLX |
|
4283 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4284 |
RETURN (__MKSMALLINT(getpattern())); |
294 | 4285 |
#endif |
4286 |
%} |
|
4287 |
. |
|
4288 |
^ false |
|
4289 |
! |
|
4290 |
||
4291 |
glxGetplanesIn: aGLXWindowId |
|
4292 |
||
4293 |
%{ /* NOCONTEXT */ |
|
4294 |
#ifdef GLX |
|
4295 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4296 |
RETURN (__MKSMALLINT(getplanes())); |
294 | 4297 |
#endif |
4298 |
%} |
|
4299 |
. |
|
4300 |
^ false |
|
4301 |
! |
|
4302 |
||
4303 |
glxGetresetlsIn: aGLXWindowId |
|
4304 |
||
4305 |
%{ /* NOCONTEXT */ |
|
4306 |
#ifdef GLX |
|
4307 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4308 |
RETURN (__MKBOOLEAN(getresetls())); |
294 | 4309 |
#endif |
4310 |
%} |
|
4311 |
. |
|
4312 |
^ false |
|
4313 |
! |
|
4314 |
||
4315 |
glxGetshadeIn: aGLXWindowId |
|
4316 |
||
4317 |
%{ /* NOCONTEXT */ |
|
4318 |
#ifdef GLX |
|
4319 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4320 |
RETURN (__MKSMALLINT(getshade())); |
294 | 4321 |
#endif |
4322 |
%} |
|
4323 |
. |
|
4324 |
^ false |
|
4325 |
! |
|
4326 |
||
4327 |
glxGetsmIn: aGLXWindowId |
|
4328 |
||
4329 |
%{ /* NOCONTEXT */ |
|
4330 |
#ifdef GLX |
|
4331 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4332 |
RETURN (__MKSMALLINT(getsm())); |
294 | 4333 |
#endif |
4334 |
%} |
|
4335 |
. |
|
4336 |
^ false |
|
4337 |
! |
|
4338 |
||
4339 |
glxGetvaluator: dev in: aGLXWindowId |
|
4340 |
||
4341 |
%{ /* NOCONTEXT */ |
|
4342 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4343 |
RETURN (__MKSMALLINT(getvaluator(_deviceVal(dev)))); |
294 | 4344 |
%} |
4345 |
. |
|
4346 |
^ false |
|
4347 |
! |
|
4348 |
||
4349 |
glxGetvideo: reg in: aGLXWindowId |
|
4350 |
||
4351 |
%{ /* NOCONTEXT */ |
|
4352 |
#ifdef GLX |
|
4353 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4354 |
RETURN (__MKSMALLINT(getvideo(_longVal(reg)))); |
294 | 4355 |
#endif |
4356 |
%} |
|
4357 |
. |
|
4358 |
^ false |
|
4359 |
! |
|
4360 |
||
4361 |
glxGetwritemaskIn: aGLXWindowId |
|
4362 |
||
4363 |
%{ /* NOCONTEXT */ |
|
4364 |
#ifdef GLX |
|
4365 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4366 |
RETURN (__MKSMALLINT(getwritemask())); |
294 | 4367 |
#endif |
4368 |
%} |
|
4369 |
. |
|
4370 |
^ false |
|
4371 |
! |
|
4372 |
||
4373 |
glxGetwscrnIn: aGLXWindowId |
|
4374 |
||
4375 |
%{ /* NOCONTEXT */ |
|
4376 |
#ifdef GLX |
|
4377 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4378 |
RETURN (__MKSMALLINT(getwscrn())); |
294 | 4379 |
#endif |
4380 |
%} |
|
4381 |
. |
|
4382 |
^ false |
|
4383 |
! |
|
4384 |
||
4385 |
glxGetzbufferIn: aGLXWindowId |
|
4386 |
||
4387 |
%{ /* NOCONTEXT */ |
|
4388 |
#ifdef GLX |
|
4389 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4390 |
RETURN (__MKBOOLEAN(getzbuffer())); |
294 | 4391 |
#endif |
4392 |
%} |
|
4393 |
. |
|
4394 |
^ false |
|
4395 |
! |
|
4396 |
||
4397 |
glxGexitIn: aGLXWindowId |
|
4398 |
||
4399 |
%{ /* NOCONTEXT */ |
|
4400 |
#ifdef GLX |
|
4401 |
SETWIN(aGLXWindowId) |
|
4402 |
gexit(); |
|
4403 |
RETURN (true); |
|
4404 |
#endif |
|
4405 |
%} |
|
4406 |
. |
|
4407 |
^ false |
|
4408 |
! |
|
4409 |
||
4410 |
glxGflushIn: aGLXWindowId |
|
4411 |
||
4412 |
%{ /* NOCONTEXT */ |
|
4413 |
#ifdef GLX |
|
4414 |
SETWIN(aGLXWindowId) |
|
4415 |
gflush(); |
|
4416 |
RETURN (true); |
|
4417 |
#endif |
|
4418 |
%} |
|
4419 |
. |
|
4420 |
^ false |
|
4421 |
! |
|
4422 |
||
4423 |
glxGinitIn: aGLXWindowId |
|
4424 |
||
4425 |
%{ /* NOCONTEXT */ |
|
4426 |
#ifdef GLX |
|
4427 |
SETWIN(aGLXWindowId) |
|
4428 |
ginit(); |
|
4429 |
RETURN (true); |
|
4430 |
#endif |
|
4431 |
%} |
|
4432 |
. |
|
4433 |
^ false |
|
4434 |
! |
|
4435 |
||
4436 |
glxGlcompatMode: mode value: value in: aGLXWindowId |
|
4437 |
||
4438 |
%{ /* NOCONTEXT */ |
|
4439 |
#ifdef GLX |
|
4440 |
SETWIN(aGLXWindowId) |
|
4441 |
glcompat(_longVal(mode), _longVal(value)); |
|
4442 |
RETURN (true); |
|
4443 |
#endif |
|
4444 |
%} |
|
4445 |
. |
|
4446 |
^ false |
|
4447 |
! |
|
4448 |
||
4449 |
glxGresetIn: aGLXWindowId |
|
4450 |
||
4451 |
%{ /* NOCONTEXT */ |
|
4452 |
#ifdef GLX |
|
4453 |
SETWIN(aGLXWindowId) |
|
4454 |
greset(); |
|
4455 |
RETURN (true); |
|
4456 |
#endif |
|
4457 |
%} |
|
4458 |
. |
|
4459 |
^ false |
|
4460 |
! |
|
4461 |
||
4462 |
glxGsyncIn: aGLXWindowId |
|
4463 |
||
4464 |
%{ /* NOCONTEXT */ |
|
4465 |
#ifdef GLX |
|
4466 |
SETWIN(aGLXWindowId) |
|
4467 |
gsync(); |
|
4468 |
RETURN (true); |
|
4469 |
#endif |
|
4470 |
%} |
|
4471 |
. |
|
4472 |
^ false |
|
4473 |
! |
|
4474 |
||
4475 |
glxIconsizeX: x y: y in: aGLXWindowId |
|
4476 |
||
4477 |
%{ /* NOCONTEXT */ |
|
4478 |
#ifdef GLX |
|
4479 |
SETWIN(aGLXWindowId) |
|
4480 |
iconsize(_longVal(x), _longVal(y)); |
|
4481 |
RETURN (true); |
|
4482 |
#endif |
|
4483 |
%} |
|
4484 |
. |
|
4485 |
^ false |
|
4486 |
! |
|
4487 |
||
4488 |
glxImakebackgroundIn: aGLXWindowId |
|
4489 |
||
4490 |
%{ /* NOCONTEXT */ |
|
4491 |
#ifdef GLX |
|
4492 |
SETWIN(aGLXWindowId) |
|
4493 |
imakebackground(); |
|
4494 |
RETURN (true); |
|
4495 |
#endif |
|
4496 |
%} |
|
4497 |
. |
|
4498 |
^ false |
|
4499 |
! |
|
4500 |
||
4501 |
glxInitnamesIn: aGLXWindowId |
|
4502 |
||
4503 |
%{ /* NOCONTEXT */ |
|
4504 |
#ifdef GLX |
|
4505 |
SETWIN(aGLXWindowId) |
|
4506 |
initnames(); |
|
4507 |
RETURN (true); |
|
4508 |
#endif |
|
4509 |
%} |
|
4510 |
. |
|
4511 |
^ false |
|
4512 |
! |
|
4513 |
||
4514 |
glxIsqueued: dev in: aGLXWindowId |
|
4515 |
||
4516 |
%{ /* NOCONTEXT */ |
|
4517 |
#ifdef GLX |
|
4518 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4519 |
RETURN (__MKBOOLEAN(isqueued(_deviceVal(dev)))); |
294 | 4520 |
#endif |
4521 |
%} |
|
4522 |
. |
|
4523 |
^ false |
|
4524 |
! |
|
4525 |
||
4526 |
glxIstag: t in: aGLXWindowId |
|
4527 |
||
4528 |
%{ /* NOCONTEXT */ |
|
4529 |
#ifdef GLX |
|
4530 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4531 |
RETURN (__MKBOOLEAN(istag(_tagVal(t)))); |
294 | 4532 |
#endif |
4533 |
%} |
|
4534 |
. |
|
4535 |
^ false |
|
4536 |
! |
|
4537 |
||
4538 |
glxKeepaspectX: x y: y in: aGLXWindowId |
|
4539 |
||
4540 |
%{ /* NOCONTEXT */ |
|
4541 |
#ifdef GLX |
|
4542 |
SETWIN(aGLXWindowId) |
|
4543 |
keepaspect(_longVal(x), _longVal(y)); |
|
4544 |
RETURN (true); |
|
4545 |
#endif |
|
4546 |
%} |
|
4547 |
. |
|
4548 |
^ false |
|
4549 |
! |
|
4550 |
||
4551 |
glxLeftbuffer: bool in: aGLXWindowId |
|
4552 |
||
4553 |
%{ /* NOCONTEXT */ |
|
4554 |
#ifdef FULL_GLX |
|
4555 |
SETWIN(aGLXWindowId) |
|
4556 |
leftbuffer(_booleanVal(bool)); |
|
4557 |
RETURN (true); |
|
4558 |
#endif |
|
4559 |
%} |
|
4560 |
. |
|
4561 |
^ false |
|
4562 |
! |
|
4563 |
||
4564 |
glxLinesmoothMode: mode in: aGLXWindowId |
|
4565 |
||
4566 |
%{ /* NOCONTEXT */ |
|
4567 |
#ifdef GLX |
|
4568 |
SETWIN(aGLXWindowId) |
|
4569 |
linesmooth((ulong)__intVal(mode)); |
|
4570 |
RETURN (true); |
|
4571 |
#endif |
|
4572 |
%} |
|
4573 |
. |
|
4574 |
^ false |
|
4575 |
! |
|
4576 |
||
4577 |
glxLinewidth: n in: aGLXWindowId |
|
4578 |
"set the linewidth" |
|
4579 |
||
4580 |
%{ /* NOCONTEXT */ |
|
4581 |
SETWIN(aGLXWindowId) |
|
4582 |
linewidth(_shortVal(n)); |
|
4583 |
RETURN (true); |
|
4584 |
%} |
|
4585 |
! |
|
4586 |
||
4587 |
glxLinewidthf: n in: aGLXWindowId |
|
4588 |
"set the linewidth" |
|
4589 |
||
4590 |
%{ /* NOCONTEXT */ |
|
4591 |
SETWIN(aGLXWindowId) |
|
4592 |
linewidthf(_floatVal(n)); |
|
4593 |
RETURN (true); |
|
4594 |
%} |
|
4595 |
! |
|
4596 |
||
4597 |
glxLmcolorMode: mode in: aGLXWindowId |
|
4598 |
||
4599 |
%{ /* NOCONTEXT */ |
|
4600 |
#ifdef GLX |
|
4601 |
SETWIN(aGLXWindowId) |
|
4602 |
lmcolor(_longVal(mode)); |
|
4603 |
RETURN (true); |
|
4604 |
#endif |
|
4605 |
%} |
|
4606 |
. |
|
4607 |
^ false |
|
4608 |
! |
|
4609 |
||
4610 |
glxLoadname: name in: aGLXWindowId |
|
4611 |
||
4612 |
%{ /* NOCONTEXT */ |
|
4613 |
#ifdef GLX |
|
4614 |
SETWIN(aGLXWindowId) |
|
4615 |
loadname(_shortVal(name)); |
|
4616 |
RETURN (true); |
|
4617 |
#endif |
|
4618 |
%} |
|
4619 |
. |
|
4620 |
^ false |
|
4621 |
! |
|
4622 |
||
4623 |
glxLogicop: opcode in: aGLXWindowId |
|
4624 |
||
4625 |
%{ /* NOCONTEXT */ |
|
4626 |
#ifdef GLX |
|
4627 |
SETWIN(aGLXWindowId) |
|
4628 |
logicop(_longVal(opcode)); |
|
4629 |
RETURN (true); |
|
4630 |
#endif |
|
4631 |
%} |
|
4632 |
. |
|
4633 |
^ false |
|
4634 |
! |
|
4635 |
||
4636 |
glxLrgbrangeRmin: rmin gmin: gmin bmin: bmin rmax: rmax gmax: gmax bmax: bmax |
|
4637 |
znear: znear zfar: zfar in: aGLXWindowId |
|
4638 |
||
4639 |
%{ /* NOCONTEXT */ |
|
4640 |
#ifdef GLX |
|
4641 |
SETWIN(aGLXWindowId) |
|
4642 |
lRGBrange(_shortVal(rmin), _shortVal(gmin), _shortVal(bmin), |
|
4643 |
_shortVal(rmax), _shortVal(gmax), _shortVal(bmax), |
|
4644 |
_longVal(znear), _longVal(zfar)); |
|
4645 |
RETURN (true); |
|
4646 |
#endif |
|
4647 |
%} |
|
4648 |
. |
|
4649 |
^ false |
|
4650 |
! |
|
4651 |
||
4652 |
glxLsbackup: b in: aGLXWindowId |
|
4653 |
||
4654 |
%{ /* NOCONTEXT */ |
|
4655 |
#ifdef GLX |
|
4656 |
SETWIN(aGLXWindowId) |
|
4657 |
lsbackup(_booleanVal(b)); |
|
4658 |
RETURN (true); |
|
4659 |
#endif |
|
4660 |
%} |
|
4661 |
. |
|
4662 |
^ false |
|
4663 |
! |
|
4664 |
||
4665 |
glxLsetdepthNear: near far: far in: aGLXWindowId |
|
4666 |
||
4667 |
%{ /* NOCONTEXT */ |
|
4668 |
#ifdef GLX |
|
4669 |
SETWIN(aGLXWindowId) |
|
4670 |
lsetdepth(_longVal(near), _longVal(far)); |
|
4671 |
RETURN (true); |
|
4672 |
#endif |
|
4673 |
%} |
|
4674 |
. |
|
4675 |
^ false |
|
4676 |
! |
|
4677 |
||
4678 |
glxLshaderangeLowin: lowin hiwin: hiwin znear: znear zfar: zfar in: aGLXWindowId |
|
4679 |
||
4680 |
%{ /* NOCONTEXT */ |
|
4681 |
#ifdef GLX |
|
4682 |
SETWIN(aGLXWindowId) |
|
4683 |
lshaderange(_colorindexVal(lowin), _colorindexVal(hiwin), |
|
4684 |
_longVal(znear), _longVal(zfar)); |
|
4685 |
RETURN (true); |
|
4686 |
#endif |
|
4687 |
%} |
|
4688 |
. |
|
4689 |
^ false |
|
4690 |
! |
|
4691 |
||
4692 |
glxLsrepeatFactor: factor in: aGLXWindowId |
|
4693 |
||
4694 |
%{ /* NOCONTEXT */ |
|
4695 |
#ifdef GLX |
|
4696 |
SETWIN(aGLXWindowId) |
|
4697 |
lsrepeat(_longVal(factor)); |
|
4698 |
RETURN (true); |
|
4699 |
#endif |
|
4700 |
%} |
|
4701 |
. |
|
4702 |
^ false |
|
4703 |
! |
|
4704 |
||
4705 |
glxMaketag: t in: aGLXWindowId |
|
4706 |
||
4707 |
%{ /* NOCONTEXT */ |
|
4708 |
#ifdef GLX |
|
4709 |
SETWIN(aGLXWindowId) |
|
4710 |
maketag(_tagVal(t)); |
|
4711 |
RETURN (true); |
|
4712 |
#endif |
|
4713 |
%} |
|
4714 |
. |
|
4715 |
^ false |
|
4716 |
! |
|
4717 |
||
4718 |
glxMapcolorI: i red: red green: green blue: blue in: aGLXWindowId |
|
4719 |
||
4720 |
%{ /* NOCONTEXT */ |
|
4721 |
SETWIN(aGLXWindowId) |
|
4722 |
mapcolor(_colorindexVal(i), _shortVal(red), _shortVal(green), _shortVal(blue)); |
|
4723 |
RETURN (true); |
|
4724 |
%} |
|
4725 |
! |
|
4726 |
||
4727 |
glxMaxsizeX: x y: y in: aGLXWindowId |
|
4728 |
||
4729 |
%{ /* NOCONTEXT */ |
|
4730 |
#ifdef GLX |
|
4731 |
SETWIN(aGLXWindowId) |
|
4732 |
maxsize(_longVal(x), _longVal(y)); |
|
4733 |
RETURN (true); |
|
4734 |
#endif |
|
4735 |
%} |
|
4736 |
. |
|
4737 |
^ false |
|
4738 |
! |
|
4739 |
||
4740 |
glxMinsizeX: x y: y in: aGLXWindowId |
|
4741 |
||
4742 |
%{ /* NOCONTEXT */ |
|
4743 |
#ifdef GLX |
|
4744 |
SETWIN(aGLXWindowId) |
|
4745 |
minsize(_longVal(x), _longVal(y)); |
|
4746 |
RETURN (true); |
|
4747 |
#endif |
|
4748 |
%} |
|
4749 |
. |
|
4750 |
^ false |
|
4751 |
! |
|
4752 |
||
4753 |
glxMonobufferIn: aGLXWindowId |
|
4754 |
||
4755 |
%{ /* NOCONTEXT */ |
|
4756 |
#ifdef FULL_GLX |
|
4757 |
SETWIN(aGLXWindowId) |
|
4758 |
monobuffer(); |
|
4759 |
RETURN (true); |
|
4760 |
#endif |
|
4761 |
%} |
|
4762 |
. |
|
4763 |
^ false |
|
4764 |
! |
|
4765 |
||
4766 |
glxMove2:v in: aGLXWindowId |
|
4767 |
||
4768 |
%{ /* NOCONTEXT */ |
|
4769 |
float vec[2], *c_v; |
|
4770 |
||
4771 |
if (! (c_v = getFloatsFromInto(v, vec, 2))) RETURN(false); |
|
4772 |
SETWIN(aGLXWindowId) |
|
4773 |
move2((Coord)(c_v[0]), (Coord)(c_v[1])); |
|
4774 |
RETURN (true); |
|
4775 |
%} |
|
4776 |
! |
|
4777 |
||
4778 |
glxMove2X: x y: y in: aGLXWindowId |
|
4779 |
||
4780 |
%{ /* NOCONTEXT */ |
|
4781 |
Coord c_x, c_y; |
|
4782 |
||
4783 |
_COORD_ (x, c_x) |
|
4784 |
_COORD_ (y, c_y) |
|
4785 |
SETWIN(aGLXWindowId) |
|
4786 |
move2(c_x, c_y); |
|
4787 |
RETURN (true); |
|
4788 |
%} |
|
4789 |
! |
|
4790 |
||
4791 |
glxMove2iX: x y: y in: aGLXWindowId |
|
4792 |
||
4793 |
%{ /* NOCONTEXT */ |
|
4794 |
Icoord c_x, c_y; |
|
4795 |
||
4796 |
_ICOORD_ (x, c_x) |
|
4797 |
_ICOORD_ (y, c_y) |
|
4798 |
SETWIN(aGLXWindowId) |
|
4799 |
move2i(c_x, c_y); |
|
4800 |
RETURN (true); |
|
4801 |
%} |
|
4802 |
! |
|
4803 |
||
4804 |
glxMove2sX: x y: y in: aGLXWindowId |
|
4805 |
||
4806 |
%{ /* NOCONTEXT */ |
|
4807 |
Scoord c_x, c_y; |
|
4808 |
||
4809 |
_SCOORD_ (x, c_x) |
|
4810 |
_SCOORD_ (y, c_y) |
|
4811 |
SETWIN(aGLXWindowId) |
|
4812 |
move2s(c_x, c_y); |
|
4813 |
RETURN (true); |
|
4814 |
%} |
|
4815 |
! |
|
4816 |
||
4817 |
glxMove:v in: aGLXWindowId |
|
4818 |
||
4819 |
%{ /* NOCONTEXT */ |
|
4820 |
float vec[3], *c_v; |
|
4821 |
||
4822 |
if (! (c_v = getFloatsFromInto(v, vec, 3))) RETURN(false); |
|
4823 |
SETWIN(aGLXWindowId) |
|
4824 |
move((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
|
4825 |
RETURN (true); |
|
4826 |
%} |
|
4827 |
! |
|
4828 |
||
4829 |
glxMoveX: x y: y z: z in: aGLXWindowId |
|
4830 |
||
4831 |
%{ /* NOCONTEXT */ |
|
4832 |
Coord c_x, c_y, c_z; |
|
4833 |
||
4834 |
_COORD_ (x, c_x) |
|
4835 |
_COORD_ (y, c_y) |
|
4836 |
_COORD_ (z, c_z) |
|
4837 |
SETWIN(aGLXWindowId) |
|
4838 |
move(c_x, c_y, c_z); |
|
4839 |
RETURN (true); |
|
4840 |
%} |
|
4841 |
! |
|
4842 |
||
4843 |
glxMoveiX: x y: y z: z in: aGLXWindowId |
|
4844 |
||
4845 |
%{ /* NOCONTEXT */ |
|
4846 |
Icoord c_x, c_y, c_z; |
|
4847 |
||
4848 |
_ICOORD_ (x, c_x) |
|
4849 |
_ICOORD_ (y, c_y) |
|
4850 |
_ICOORD_ (z, c_z) |
|
4851 |
SETWIN(aGLXWindowId) |
|
4852 |
movei(c_x, c_y, c_z); |
|
4853 |
RETURN (true); |
|
4854 |
%} |
|
4855 |
! |
|
4856 |
||
4857 |
glxMovesX: x y: y z: z in: aGLXWindowId |
|
4858 |
||
4859 |
%{ /* NOCONTEXT */ |
|
4860 |
Scoord c_x, c_y, c_z; |
|
4861 |
||
4862 |
_SCOORD_ (x, c_x) |
|
4863 |
_SCOORD_ (y, c_y) |
|
4864 |
_SCOORD_ (z, c_z) |
|
4865 |
SETWIN(aGLXWindowId) |
|
4866 |
moves(c_x, c_y, c_z); |
|
4867 |
RETURN (true); |
|
4868 |
%} |
|
4869 |
! |
|
4870 |
||
4871 |
glxMsalphaMode: mode in: aGLXWindowId |
|
4872 |
||
4873 |
%{ /* NOCONTEXT */ |
|
4874 |
#ifdef FULL_GLX |
|
4875 |
SETWIN(aGLXWindowId) |
|
4876 |
msalpha(_longVal(mode)); |
|
4877 |
RETURN (true); |
|
4878 |
#endif |
|
4879 |
%} |
|
4880 |
. |
|
4881 |
^ false |
|
4882 |
! |
|
4883 |
||
4884 |
glxMsmask: mask inverse: inverse in: aGLXWindowId |
|
4885 |
||
4886 |
%{ /* NOCONTEXT */ |
|
4887 |
#ifdef FULL_GLX |
|
4888 |
SETWIN(aGLXWindowId) |
|
4889 |
msmask(_floatVal(mask), _booleanVal(inverse)); |
|
4890 |
RETURN (true); |
|
4891 |
#endif |
|
4892 |
%} |
|
4893 |
. |
|
4894 |
^ false |
|
4895 |
! |
|
4896 |
||
4897 |
glxMspattern: pattern in: aGLXWindowId |
|
4898 |
||
4899 |
%{ /* NOCONTEXT */ |
|
4900 |
#ifdef FULL_GLX |
|
4901 |
SETWIN(aGLXWindowId) |
|
4902 |
mspattern(_longVal(pattern)); |
|
4903 |
RETURN (true); |
|
4904 |
#endif |
|
4905 |
%} |
|
4906 |
. |
|
4907 |
^ false |
|
4908 |
! |
|
4909 |
||
4910 |
glxMssizeSamples: samples zsize: zsize ssize: ssize in: aGLXWindowId |
|
4911 |
||
4912 |
%{ /* NOCONTEXT */ |
|
4913 |
#ifdef FULL_GLX |
|
4914 |
SETWIN(aGLXWindowId) |
|
4915 |
mssize(_longVal(samples), _longVal(zsize), _longVal(ssize)); |
|
4916 |
RETURN (true); |
|
4917 |
#endif |
|
4918 |
%} |
|
4919 |
. |
|
4920 |
^ false |
|
4921 |
! |
|
4922 |
||
4923 |
glxMswapbuffers: fbuf in: aGLXWindowId |
|
4924 |
||
4925 |
%{ /* NOCONTEXT */ |
|
4926 |
#ifdef GLX |
|
4927 |
SETWIN(aGLXWindowId) |
|
4928 |
mswapbuffers(_longVal(fbuf)); |
|
4929 |
RETURN (true); |
|
4930 |
#endif |
|
4931 |
%} |
|
4932 |
. |
|
4933 |
^ false |
|
4934 |
! |
|
4935 |
||
4936 |
glxMultimapIn: aGLXWindowId |
|
4937 |
||
4938 |
%{ /* NOCONTEXT */ |
|
4939 |
#ifdef GLX |
|
4940 |
SETWIN(aGLXWindowId) |
|
4941 |
multimap(); |
|
4942 |
RETURN (true); |
|
4943 |
#endif |
|
4944 |
%} |
|
4945 |
. |
|
4946 |
^ false |
|
4947 |
! |
|
4948 |
||
4949 |
glxMultisample: bool in: aGLXWindowId |
|
4950 |
||
4951 |
%{ /* NOCONTEXT */ |
|
4952 |
#ifdef FULL_GLX |
|
4953 |
SETWIN(aGLXWindowId) |
|
4954 |
multisample(_booleanVal(bool)); |
|
4955 |
RETURN (true); |
|
4956 |
#endif |
|
4957 |
%} |
|
4958 |
. |
|
4959 |
^ false |
|
4960 |
! |
|
4961 |
||
4962 |
glxNewpupIn: aGLXWindowId |
|
4963 |
||
4964 |
%{ /* NOCONTEXT */ |
|
4965 |
#ifdef GLX |
|
4966 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4967 |
RETURN (__MKSMALLINT(newpup())); |
294 | 4968 |
#endif |
4969 |
%} |
|
4970 |
. |
|
4971 |
^ false |
|
4972 |
! |
|
4973 |
||
4974 |
glxNewtag: newtg oldtg: oldtg offst: offst in: aGLXWindowId |
|
4975 |
||
4976 |
%{ /* NOCONTEXT */ |
|
4977 |
#ifdef GLX |
|
4978 |
SETWIN(aGLXWindowId) |
|
4979 |
newtag(_tagVal(newtg), _tagVal(oldtg), _offsetVal(offst)); |
|
4980 |
RETURN (true); |
|
4981 |
#endif |
|
4982 |
%} |
|
4983 |
. |
|
4984 |
^ false |
|
4985 |
! |
|
4986 |
||
4987 |
glxNoborderIn: aGLXWindowId |
|
4988 |
||
4989 |
%{ /* NOCONTEXT */ |
|
4990 |
#ifdef GLX |
|
4991 |
SETWIN(aGLXWindowId) |
|
4992 |
noborder(); |
|
4993 |
RETURN (true); |
|
4994 |
#endif |
|
4995 |
%} |
|
4996 |
. |
|
4997 |
^ false |
|
4998 |
! |
|
4999 |
||
5000 |
glxNoise: v delta: delta in: aGLXWindowId |
|
5001 |
||
5002 |
%{ /* NOCONTEXT */ |
|
5003 |
#ifdef GLX |
|
5004 |
SETWIN(aGLXWindowId) |
|
5005 |
noise(_deviceVal(v), _shortVal(delta)); |
|
5006 |
RETURN (true); |
|
5007 |
#endif |
|
5008 |
%} |
|
5009 |
. |
|
5010 |
^ false |
|
5011 |
! |
|
5012 |
||
5013 |
glxNoportIn: aGLXWindowId |
|
5014 |
||
5015 |
%{ /* NOCONTEXT */ |
|
5016 |
#ifdef GLX |
|
5017 |
SETWIN(aGLXWindowId) |
|
5018 |
noport(); |
|
5019 |
RETURN (true); |
|
5020 |
#endif |
|
5021 |
%} |
|
5022 |
. |
|
5023 |
^ false |
|
5024 |
! |
|
5025 |
||
5026 |
glxNurbscurveKnotCount: knotCount knotList: knotList |
|
5027 |
offset: offset ctlArray: ctlArray |
|
5028 |
order: order type: type in: aGLXWindowId |
|
5029 |
||
5030 |
| ctlPoints i | |
|
5031 |
ctlPoints := DoubleArray new: ctlArray size * (ctlArray first size). |
|
5032 |
i := 1. |
|
5033 |
ctlArray do: [:point | |
|
5034 |
point do: [:coord | |
|
5035 |
ctlPoints at: i put: coord. |
|
5036 |
i := i + 1]]. |
|
5037 |
||
5038 |
%{ /* NOCONTEXT */ |
|
5039 |
#ifdef GLX |
|
5040 |
char *knotElements, *ctlElements; |
|
5041 |
OBJ cls; |
|
5042 |
int ninstVars, nInstBytes; |
|
5043 |
||
5044 |
SETWIN(aGLXWindowId) |
|
5045 |
cls = __qClass(ctlPoints); |
|
5046 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
5047 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
|
5048 |
||
5049 |
ctlElements = (char *)(_InstPtr(ctlPoints)) + nInstBytes; |
|
5050 |
knotElements = (char *)(_InstPtr(knotList)) + nInstBytes; |
|
5051 |
||
5052 |
nurbscurve ( |
|
5053 |
_longVal(knotCount), (double *)knotElements, |
|
5054 |
_longVal(offset), (double *)ctlElements, |
|
5055 |
_longVal(order), _longVal(type)); |
|
5056 |
RETURN(true); |
|
5057 |
#endif |
|
5058 |
%} |
|
5059 |
. |
|
5060 |
^ false |
|
5061 |
! |
|
5062 |
||
5063 |
glxObjdeleteTag1: tag1 tag2: tag2 in: aGLXWindowId |
|
5064 |
||
5065 |
%{ /* NOCONTEXT */ |
|
5066 |
#ifdef GLX |
|
5067 |
SETWIN(aGLXWindowId) |
|
5068 |
objdelete(_tagVal(tag1), _tagVal(tag2)); |
|
5069 |
RETURN (true); |
|
5070 |
#endif |
|
5071 |
%} |
|
5072 |
. |
|
5073 |
^ false |
|
5074 |
! |
|
5075 |
||
5076 |
glxObjinsert: t in: aGLXWindowId |
|
5077 |
||
5078 |
%{ /* NOCONTEXT */ |
|
5079 |
#ifdef GLX |
|
5080 |
SETWIN(aGLXWindowId) |
|
5081 |
objinsert(_tagVal(t)); |
|
5082 |
RETURN (true); |
|
5083 |
#endif |
|
5084 |
%} |
|
5085 |
. |
|
5086 |
^ false |
|
5087 |
! |
|
5088 |
||
5089 |
glxObjreplace: t in: aGLXWindowId |
|
5090 |
||
5091 |
%{ /* NOCONTEXT */ |
|
5092 |
#ifdef GLX |
|
5093 |
SETWIN(aGLXWindowId) |
|
5094 |
objreplace(_tagVal(t)); |
|
5095 |
RETURN (true); |
|
5096 |
#endif |
|
5097 |
%} |
|
5098 |
. |
|
5099 |
^ false |
|
5100 |
! |
|
5101 |
||
5102 |
glxOnemapIn: aGLXWindowId |
|
5103 |
||
5104 |
%{ /* NOCONTEXT */ |
|
5105 |
#ifdef GLX |
|
5106 |
SETWIN(aGLXWindowId) |
|
5107 |
onemap(); |
|
5108 |
RETURN (true); |
|
5109 |
#endif |
|
5110 |
%} |
|
5111 |
. |
|
5112 |
^ false |
|
5113 |
! |
|
5114 |
||
5115 |
glxPagecolor: pcolor in: aGLXWindowId |
|
5116 |
||
5117 |
%{ /* NOCONTEXT */ |
|
5118 |
#ifdef GLX |
|
5119 |
SETWIN(aGLXWindowId) |
|
5120 |
pagecolor(_colorindexVal(pcolor)); |
|
5121 |
RETURN (true); |
|
5122 |
#endif |
|
5123 |
%} |
|
5124 |
. |
|
5125 |
^ false |
|
5126 |
! |
|
5127 |
||
5128 |
glxPassthroughToken: token in: aGLXWindowId |
|
5129 |
||
5130 |
%{ /* NOCONTEXT */ |
|
5131 |
#ifdef GLX |
|
5132 |
SETWIN(aGLXWindowId) |
|
5133 |
passthrough(_shortVal(token)); |
|
5134 |
RETURN (true); |
|
5135 |
#endif |
|
5136 |
%} |
|
5137 |
. |
|
5138 |
^ false |
|
5139 |
! |
|
5140 |
||
5141 |
glxPclosIn: aGLXWindowId |
|
5142 |
||
5143 |
%{ /* NOCONTEXT */ |
|
5144 |
#ifdef GLX |
|
5145 |
SETWIN(aGLXWindowId) |
|
5146 |
pclos(); |
|
5147 |
RETURN (true); |
|
5148 |
#endif |
|
5149 |
%} |
|
5150 |
. |
|
5151 |
^ false |
|
5152 |
! |
|
5153 |
||
5154 |
glxPdr2X: x y: y in: aGLXWindowId |
|
5155 |
||
5156 |
%{ /* NOCONTEXT */ |
|
5157 |
Coord c_x, c_y; |
|
5158 |
||
5159 |
_COORD_ (x, c_x) |
|
5160 |
_COORD_ (y, c_y) |
|
5161 |
SETWIN(aGLXWindowId) |
|
5162 |
pdr2(c_x, c_y); |
|
5163 |
RETURN (true); |
|
5164 |
%} |
|
5165 |
! |
|
5166 |
||
5167 |
glxPdr2iX: x y: y in: aGLXWindowId |
|
5168 |
||
5169 |
%{ /* NOCONTEXT */ |
|
5170 |
Icoord c_x, c_y; |
|
5171 |
||
5172 |
_ICOORD_ (x, c_x) |
|
5173 |
_ICOORD_ (y, c_y) |
|
5174 |
SETWIN(aGLXWindowId) |
|
5175 |
pdr2i(c_x, c_y); |
|
5176 |
RETURN (true); |
|
5177 |
%} |
|
5178 |
! |
|
5179 |
||
5180 |
glxPdr2sX: x y: y in: aGLXWindowId |
|
5181 |
||
5182 |
%{ /* NOCONTEXT */ |
|
5183 |
Scoord c_x, c_y; |
|
5184 |
||
5185 |
_SCOORD_ (x, c_x) |
|
5186 |
_SCOORD_ (y, c_y) |
|
5187 |
SETWIN(aGLXWindowId) |
|
5188 |
pdr2s(c_x, c_y); |
|
5189 |
RETURN (true); |
|
5190 |
%} |
|
5191 |
! |
|
5192 |
||
5193 |
glxPdrX: x y: y z: z in: aGLXWindowId |
|
5194 |
||
5195 |
%{ /* NOCONTEXT */ |
|
5196 |
Coord c_x, c_y, c_z; |
|
5197 |
||
5198 |
_COORD_ (x, c_x) |
|
5199 |
_COORD_ (y, c_y) |
|
5200 |
_COORD_ (z, c_z) |
|
5201 |
SETWIN(aGLXWindowId) |
|
5202 |
pdr(c_x, c_y, c_z); |
|
5203 |
RETURN (true); |
|
5204 |
%} |
|
5205 |
! |
|
5206 |
||
5207 |
glxPdriX: x y: y z: z in: aGLXWindowId |
|
5208 |
||
5209 |
%{ /* NOCONTEXT */ |
|
5210 |
Icoord c_x, c_y, c_z; |
|
5211 |
||
5212 |
_ICOORD_ (x, c_x) |
|
5213 |
_ICOORD_ (y, c_y) |
|
5214 |
_ICOORD_ (z, c_z) |
|
5215 |
SETWIN(aGLXWindowId) |
|
5216 |
pdri(c_x, c_y, c_z); |
|
5217 |
RETURN (true); |
|
5218 |
%} |
|
5219 |
! |
|
5220 |
||
5221 |
glxPdrsX: x y: y z: z in: aGLXWindowId |
|
5222 |
||
5223 |
%{ /* NOCONTEXT */ |
|
5224 |
Scoord c_x, c_y, c_z; |
|
5225 |
||
5226 |
_SCOORD_ (x, c_x) |
|
5227 |
_SCOORD_ (y, c_y) |
|
5228 |
_SCOORD_ (z, c_z) |
|
5229 |
SETWIN(aGLXWindowId) |
|
5230 |
pdrs(c_x, c_y, c_z); |
|
5231 |
RETURN (true); |
|
5232 |
%} |
|
5233 |
! |
|
5234 |
||
5235 |
glxPicksizeX: x y: y in: aGLXWindowId |
|
5236 |
||
5237 |
%{ /* NOCONTEXT */ |
|
5238 |
#ifdef GLX |
|
5239 |
SETWIN(aGLXWindowId) |
|
5240 |
picksize(_shortVal(x), _shortVal(y)); |
|
5241 |
RETURN (true); |
|
5242 |
#endif |
|
5243 |
%} |
|
5244 |
. |
|
5245 |
^ false |
|
5246 |
! |
|
5247 |
||
5248 |
glxPixmode: mode value: value in: aGLXWindowId |
|
5249 |
||
5250 |
%{ /* NOCONTEXT */ |
|
5251 |
#ifdef GLX |
|
5252 |
SETWIN(aGLXWindowId) |
|
5253 |
pixmode(_longVal(mode), _longVal(value)); |
|
5254 |
RETURN (true); |
|
5255 |
#endif |
|
5256 |
%} |
|
5257 |
. |
|
5258 |
^ false |
|
5259 |
! |
|
5260 |
||
5261 |
glxPmv2X: x y: y in: aGLXWindowId |
|
5262 |
||
5263 |
%{ /* NOCONTEXT */ |
|
5264 |
Coord c_x, c_y; |
|
5265 |
||
5266 |
_COORD_ (x, c_x) |
|
5267 |
_COORD_ (y, c_y) |
|
5268 |
SETWIN(aGLXWindowId) |
|
5269 |
pmv2(c_x, c_y); |
|
5270 |
RETURN (true); |
|
5271 |
%} |
|
5272 |
! |
|
5273 |
||
5274 |
glxPmv2iX: x y: y in: aGLXWindowId |
|
5275 |
||
5276 |
%{ /* NOCONTEXT */ |
|
5277 |
Icoord c_x, c_y; |
|
5278 |
||
5279 |
_ICOORD_ (x, c_x) |
|
5280 |
_ICOORD_ (y, c_y) |
|
5281 |
SETWIN(aGLXWindowId) |
|
5282 |
pmv2i(c_x, c_y); |
|
5283 |
RETURN (true); |
|
5284 |
%} |
|
5285 |
! |
|
5286 |
||
5287 |
glxPmv2sX: x y: y in: aGLXWindowId |
|
5288 |
||
5289 |
%{ /* NOCONTEXT */ |
|
5290 |
Scoord c_x, c_y; |
|
5291 |
||
5292 |
_SCOORD_ (x, c_x) |
|
5293 |
_SCOORD_ (y, c_y) |
|
5294 |
SETWIN(aGLXWindowId) |
|
5295 |
pmv2s(c_x, c_y); |
|
5296 |
RETURN (true); |
|
5297 |
%} |
|
5298 |
! |
|
5299 |
||
5300 |
glxPmvX: x y: y z: z in: aGLXWindowId |
|
5301 |
||
5302 |
%{ /* NOCONTEXT */ |
|
5303 |
Coord c_x, c_y, c_z; |
|
5304 |
||
5305 |
_COORD_ (x, c_x) |
|
5306 |
_COORD_ (y, c_y) |
|
5307 |
_COORD_ (z, c_z) |
|
5308 |
SETWIN(aGLXWindowId) |
|
5309 |
pmv(c_x, c_y, c_z); |
|
5310 |
RETURN (true); |
|
5311 |
%} |
|
5312 |
! |
|
5313 |
||
5314 |
glxPmviX: x y: y z: z in: aGLXWindowId |
|
5315 |
||
5316 |
%{ /* NOCONTEXT */ |
|
5317 |
Icoord c_x, c_y, c_z; |
|
5318 |
||
5319 |
_ICOORD_ (x, c_x) |
|
5320 |
_ICOORD_ (y, c_y) |
|
5321 |
_ICOORD_ (z, c_z) |
|
5322 |
SETWIN(aGLXWindowId) |
|
5323 |
pmvi(c_x, c_y, c_z); |
|
5324 |
RETURN (true); |
|
5325 |
%} |
|
5326 |
! |
|
5327 |
||
5328 |
glxPmvsX: x y: y z: z in: aGLXWindowId |
|
5329 |
||
5330 |
%{ /* NOCONTEXT */ |
|
5331 |
Scoord c_x, c_y, c_z; |
|
5332 |
||
5333 |
_SCOORD_ (x, c_x) |
|
5334 |
_SCOORD_ (y, c_y) |
|
5335 |
_SCOORD_ (z, c_z) |
|
5336 |
SETWIN(aGLXWindowId) |
|
5337 |
pmvs(c_x, c_y, c_z); |
|
5338 |
RETURN (true); |
|
5339 |
%} |
|
5340 |
! |
|
5341 |
||
5342 |
glxPnt2X: x y: y in: aGLXWindowId |
|
5343 |
||
5344 |
%{ /* NOCONTEXT */ |
|
5345 |
Coord c_x, c_y; |
|
5346 |
||
5347 |
_COORD_ (x, c_x) |
|
5348 |
_COORD_ (y, c_y) |
|
5349 |
SETWIN(aGLXWindowId) |
|
5350 |
pnt2(c_x, c_y); |
|
5351 |
RETURN (true); |
|
5352 |
%} |
|
5353 |
! |
|
5354 |
||
5355 |
glxPnt2iX: x y: y in: aGLXWindowId |
|
5356 |
||
5357 |
%{ /* NOCONTEXT */ |
|
5358 |
Icoord c_x, c_y; |
|
5359 |
||
5360 |
_ICOORD_ (x, c_x) |
|
5361 |
_ICOORD_ (y, c_y) |
|
5362 |
SETWIN(aGLXWindowId) |
|
5363 |
pnt2i(c_x, c_y); |
|
5364 |
RETURN (true); |
|
5365 |
%} |
|
5366 |
! |
|
5367 |
||
5368 |
glxPnt2sX: x y: y in: aGLXWindowId |
|
5369 |
||
5370 |
%{ /* NOCONTEXT */ |
|
5371 |
Scoord c_x, c_y; |
|
5372 |
||
5373 |
_SCOORD_ (x, c_x) |
|
5374 |
_SCOORD_ (y, c_y) |
|
5375 |
SETWIN(aGLXWindowId) |
|
5376 |
pnt2s(c_x, c_y); |
|
5377 |
RETURN (true); |
|
5378 |
%} |
|
5379 |
! |
|
5380 |
||
5381 |
glxPntX: x y: y z: z in: aGLXWindowId |
|
5382 |
||
5383 |
%{ /* NOCONTEXT */ |
|
5384 |
Coord c_x, c_y, c_z; |
|
5385 |
||
5386 |
_COORD_ (x, c_x) |
|
5387 |
_COORD_ (y, c_y) |
|
5388 |
_COORD_ (z, c_z) |
|
5389 |
SETWIN(aGLXWindowId) |
|
5390 |
pnt(c_x, c_y, c_z); |
|
5391 |
RETURN (true); |
|
5392 |
%} |
|
5393 |
! |
|
5394 |
||
5395 |
glxPntiX: x y: y z: z in: aGLXWindowId |
|
5396 |
||
5397 |
%{ /* NOCONTEXT */ |
|
5398 |
Icoord c_x, c_y, c_z; |
|
5399 |
||
5400 |
_ICOORD_ (x, c_x) |
|
5401 |
_ICOORD_ (y, c_y) |
|
5402 |
_ICOORD_ (z, c_z) |
|
5403 |
SETWIN(aGLXWindowId) |
|
5404 |
pnti(c_x, c_y, c_z); |
|
5405 |
RETURN (true); |
|
5406 |
%} |
|
5407 |
! |
|
5408 |
||
5409 |
glxPntsX: x y: y z: z in: aGLXWindowId |
|
5410 |
||
5411 |
%{ /* NOCONTEXT */ |
|
5412 |
Scoord c_x, c_y, c_z; |
|
5413 |
||
5414 |
_SCOORD_ (x, c_x) |
|
5415 |
_SCOORD_ (y, c_y) |
|
5416 |
_SCOORD_ (z, c_z) |
|
5417 |
SETWIN(aGLXWindowId) |
|
5418 |
pnts(c_x, c_y, c_z); |
|
5419 |
RETURN (true); |
|
5420 |
%} |
|
5421 |
! |
|
5422 |
||
5423 |
glxPntsize: n in: aGLXWindowId |
|
5424 |
||
5425 |
%{ /* NOCONTEXT */ |
|
5426 |
#ifdef GLX |
|
5427 |
SETWIN(aGLXWindowId) |
|
5428 |
pntsize(_shortVal(n)); |
|
5429 |
RETURN (true); |
|
5430 |
#endif |
|
5431 |
%} |
|
5432 |
. |
|
5433 |
^ false |
|
5434 |
! |
|
5435 |
||
5436 |
glxPntsizef: n in: aGLXWindowId |
|
5437 |
||
5438 |
%{ /* NOCONTEXT */ |
|
5439 |
#ifdef GLX |
|
5440 |
SETWIN(aGLXWindowId) |
|
5441 |
pntsizef(_floatVal(n)); |
|
5442 |
RETURN (true); |
|
5443 |
#endif |
|
5444 |
%} |
|
5445 |
. |
|
5446 |
^ false |
|
5447 |
! |
|
5448 |
||
5449 |
glxPntsmoothMode: mode in: aGLXWindowId |
|
5450 |
||
5451 |
%{ /* NOCONTEXT */ |
|
5452 |
#ifdef GLX |
|
5453 |
SETWIN(aGLXWindowId) |
|
5454 |
pntsmooth((ulong)__intVal(mode)); |
|
5455 |
RETURN (true); |
|
5456 |
#endif |
|
5457 |
%} |
|
5458 |
. |
|
5459 |
^ false |
|
5460 |
! |
|
5461 |
||
5462 |
glxPolymode: mode in: aGLXWindowId |
|
5463 |
||
5464 |
%{ /* NOCONTEXT */ |
|
5465 |
SETWIN(aGLXWindowId) |
|
5466 |
polymode(_longVal(mode)); |
|
5467 |
RETURN (true); |
|
5468 |
%} |
|
5469 |
! |
|
5470 |
||
5471 |
glxPolysmoothMode: mode in: aGLXWindowId |
|
5472 |
||
5473 |
%{ /* NOCONTEXT */ |
|
5474 |
#ifdef GLX |
|
5475 |
SETWIN(aGLXWindowId) |
|
5476 |
polysmooth(_longVal(mode)); |
|
5477 |
RETURN (true); |
|
5478 |
#endif |
|
5479 |
%} |
|
5480 |
. |
|
5481 |
^ false |
|
5482 |
! |
|
5483 |
||
5484 |
glxPopattributesIn: aGLXWindowId |
|
5485 |
||
5486 |
%{ /* NOCONTEXT */ |
|
5487 |
SETWIN(aGLXWindowId) |
|
5488 |
popattributes(); |
|
5489 |
RETURN (true); |
|
5490 |
%} |
|
5491 |
! |
|
5492 |
||
5493 |
glxPopnameIn: aGLXWindowId |
|
5494 |
||
5495 |
%{ /* NOCONTEXT */ |
|
5496 |
#ifdef GLX |
|
5497 |
SETWIN(aGLXWindowId) |
|
5498 |
popname(); |
|
5499 |
RETURN (true); |
|
5500 |
#endif |
|
5501 |
%} |
|
5502 |
. |
|
5503 |
^ false |
|
5504 |
! |
|
5505 |
||
5506 |
glxPopviewportIn: aGLXWindowId |
|
5507 |
||
5508 |
%{ /* NOCONTEXT */ |
|
5509 |
SETWIN(aGLXWindowId) |
|
5510 |
popviewport(); |
|
5511 |
RETURN (true); |
|
5512 |
%} |
|
5513 |
! |
|
5514 |
||
5515 |
glxPrefpositionX1: x1 x2: x2 y1: y1 y2: y2 in: aGLXWindowId |
|
5516 |
||
5517 |
%{ /* NOCONTEXT */ |
|
5518 |
SETWIN(aGLXWindowId) |
|
5519 |
prefposition(_longVal(x1), _longVal(x2), _longVal(y1), _longVal(y2)); |
|
5520 |
RETURN (true); |
|
5521 |
%} |
|
5522 |
! |
|
5523 |
||
5524 |
glxPrefsizeX: x y: y in: aGLXWindowId |
|
5525 |
||
5526 |
%{ /* NOCONTEXT */ |
|
5527 |
SETWIN(aGLXWindowId) |
|
5528 |
prefsize(_longVal(x), _longVal(y)); |
|
5529 |
RETURN (true); |
|
5530 |
%} |
|
5531 |
! |
|
5532 |
||
5533 |
glxPupmodeIn: aGLXWindowId |
|
5534 |
||
5535 |
%{ /* NOCONTEXT */ |
|
5536 |
#ifdef GLX |
|
5537 |
SETWIN(aGLXWindowId) |
|
5538 |
pupmode(); |
|
5539 |
RETURN (true); |
|
5540 |
#endif |
|
5541 |
%} |
|
5542 |
. |
|
5543 |
^ false |
|
5544 |
! |
|
5545 |
||
5546 |
glxPushattributesIn: aGLXWindowId |
|
5547 |
||
5548 |
%{ /* NOCONTEXT */ |
|
5549 |
SETWIN(aGLXWindowId) |
|
5550 |
pushattributes(); |
|
5551 |
RETURN (true); |
|
5552 |
%} |
|
5553 |
! |
|
5554 |
||
5555 |
glxPushname: name In: aGLXWindowId |
|
5556 |
||
5557 |
%{ /* NOCONTEXT */ |
|
5558 |
#ifdef GLX |
|
5559 |
SETWIN(aGLXWindowId) |
|
5560 |
pushname(_shortVal(name)); |
|
5561 |
RETURN (true); |
|
5562 |
#endif |
|
5563 |
%} |
|
5564 |
. |
|
5565 |
^ false |
|
5566 |
! |
|
5567 |
||
5568 |
glxPushviewportIn: aGLXWindowId |
|
5569 |
||
5570 |
%{ /* NOCONTEXT */ |
|
5571 |
SETWIN(aGLXWindowId) |
|
5572 |
pushviewport(); |
|
5573 |
RETURN (true); |
|
5574 |
%} |
|
5575 |
! |
|
5576 |
||
5577 |
glxQdevice: dev in: aGLXWindowId |
|
5578 |
||
5579 |
%{ /* NOCONTEXT */ |
|
5580 |
SETWIN(aGLXWindowId) |
|
5581 |
qdevice(_deviceVal(dev)); |
|
5582 |
RETURN (true); |
|
5583 |
%} |
|
5584 |
! |
|
5585 |
||
5586 |
glxQenterDev: dev val: val in: aGLXWindowId |
|
5587 |
||
5588 |
%{ /* NOCONTEXT */ |
|
5589 |
SETWIN(aGLXWindowId) |
|
5590 |
qenter(_deviceVal(dev), _shortVal(val)); |
|
5591 |
RETURN (true); |
|
5592 |
%} |
|
5593 |
! |
|
5594 |
||
5595 |
glxQgetfdIn: aGLXWindowId |
|
5596 |
||
5597 |
%{ /* NOCONTEXT */ |
|
5598 |
#ifdef GLX |
|
5599 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
5600 |
RETURN (__MKSMALLINT(qgetfd())); |
294 | 5601 |
#endif |
5602 |
%} |
|
5603 |
. |
|
5604 |
^ false |
|
5605 |
! |
|
5606 |
||
5607 |
glxQreadIn: aGLXWindowId |
|
5608 |
||
5609 |
| dev data | |
|
5610 |
%{ |
|
5611 |
short c_data; |
|
5612 |
||
5613 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
5614 |
dev = __MKSMALLINT(qread(&c_data)); |
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
5615 |
data = __MKSMALLINT(c_data); |
294 | 5616 |
%} |
5617 |
. |
|
5618 |
^ Array with: dev with: data |
|
5619 |
! |
|
5620 |
||
5621 |
glxQresetIn: aGLXWindowId |
|
5622 |
||
5623 |
%{ /* NOCONTEXT */ |
|
5624 |
SETWIN(aGLXWindowId) |
|
5625 |
qreset(); |
|
5626 |
RETURN (true); |
|
5627 |
%} |
|
5628 |
! |
|
5629 |
||
5630 |
glxQtestIn: aGLXWindowId |
|
5631 |
||
5632 |
%{ /* NOCONTEXT */ |
|
5633 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
5634 |
RETURN (__MKSMALLINT(qtest())); |
294 | 5635 |
%} |
5636 |
! |
|
5637 |
||
5638 |
glxRGBcursorIndex: index red: red green: green blue: blue |
|
5639 |
redm: redm greenm: greenm bluem: bluem in: aGLXWindowId |
|
5640 |
||
5641 |
%{ /* NOCONTEXT */ |
|
5642 |
#ifdef GLX |
|
5643 |
SETWIN(aGLXWindowId) |
|
5644 |
RGBcursor(_shortVal(index), |
|
5645 |
_shortVal(red), _shortVal(green), _shortVal(blue), |
|
5646 |
_shortVal(redm), _shortVal(greenm), _shortVal(bluem)); |
|
5647 |
RETURN (true); |
|
5648 |
#endif |
|
5649 |
%} |
|
5650 |
. |
|
5651 |
^ false |
|
5652 |
! |
|
5653 |
||
5654 |
glxRGBwritemaskRed: red green: green blue: blue in: aGLXWindowId |
|
5655 |
||
5656 |
%{ /* NOCONTEXT */ |
|
5657 |
#ifdef GLX |
|
5658 |
SETWIN(aGLXWindowId) |
|
5659 |
RGBwritemask(_shortVal(red), _shortVal(green), _shortVal(blue)); |
|
5660 |
RETURN (true); |
|
5661 |
#endif |
|
5662 |
%} |
|
5663 |
. |
|
5664 |
^ false |
|
5665 |
! |
|
5666 |
||
5667 |
glxRdr2:v in: aGLXWindowId |
|
5668 |
||
5669 |
%{ /* NOCONTEXT */ |
|
5670 |
float vec[2], *c_v; |
|
5671 |
||
5672 |
if (! (c_v = getFloatsFromInto(v, vec, 2))) RETURN(false); |
|
5673 |
SETWIN(aGLXWindowId) |
|
5674 |
rdr2((Coord)(c_v[0]), (Coord)(c_v[1])); |
|
5675 |
RETURN (true); |
|
5676 |
%} |
|
5677 |
! |
|
5678 |
||
5679 |
glxRdr2X: x y: y in: aGLXWindowId |
|
5680 |
||
5681 |
%{ /* NOCONTEXT */ |
|
5682 |
Coord c_x, c_y; |
|
5683 |
||
5684 |
_COORD_ (x, c_x) |
|
5685 |
_COORD_ (y, c_y) |
|
5686 |
SETWIN(aGLXWindowId) |
|
5687 |
rdr2(c_x, c_y); |
|
5688 |
RETURN (true); |
|
5689 |
%} |
|
5690 |
! |
|
5691 |
||
5692 |
glxRdr2iX: x y: y in: aGLXWindowId |
|
5693 |
||
5694 |
%{ /* NOCONTEXT */ |
|
5695 |
Icoord c_x, c_y; |
|
5696 |
||
5697 |
_ICOORD_ (x, c_x) |
|
5698 |
_ICOORD_ (y, c_y) |
|
5699 |
SETWIN(aGLXWindowId) |
|
5700 |
rdr2i(c_x, c_y); |
|
5701 |
RETURN (true); |
|
5702 |
%} |
|
5703 |
! |
|
5704 |
||
5705 |
glxRdr2sX: x y: y in: aGLXWindowId |
|
5706 |
||
5707 |
%{ /* NOCONTEXT */ |
|
5708 |
Scoord c_x, c_y; |
|
5709 |
||
5710 |
_SCOORD_ (x, c_x) |
|
5711 |
_SCOORD_ (y, c_y) |
|
5712 |
SETWIN(aGLXWindowId) |
|
5713 |
rdr2s(c_x, c_y); |
|
5714 |
RETURN (true); |
|
5715 |
%} |
|
5716 |
! |
|
5717 |
||
5718 |
glxRdr:v in: aGLXWindowId |
|
5719 |
||
5720 |
%{ /* NOCONTEXT */ |
|
5721 |
float vec[3], *c_v; |
|
5722 |
||
5723 |
if (! (c_v = getFloatsFromInto(v, vec, 3))) RETURN(false); |
|
5724 |
SETWIN(aGLXWindowId) |
|
5725 |
rdr((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
|
5726 |
RETURN (true); |
|
5727 |
%} |
|
5728 |
! |
|
5729 |
||
5730 |
glxRdrX: x y: y z: z in: aGLXWindowId |
|
5731 |
||
5732 |
%{ /* NOCONTEXT */ |
|
5733 |
Coord c_x, c_y, c_z; |
|
5734 |
||
5735 |
_COORD_ (x, c_x) |
|
5736 |
_COORD_ (y, c_y) |
|
5737 |
_COORD_ (z, c_z) |
|
5738 |
SETWIN(aGLXWindowId) |
|
5739 |
rdr(c_x, c_y, c_z); |
|
5740 |
RETURN (true); |
|
5741 |
%} |
|
5742 |
! |
|
5743 |
||
5744 |
glxRdriX: x y: y z: z in: aGLXWindowId |
|
5745 |
||
5746 |
%{ /* NOCONTEXT */ |
|
5747 |
Icoord c_x, c_y, c_z; |
|
5748 |
||
5749 |
_ICOORD_ (x, c_x) |
|
5750 |
_ICOORD_ (y, c_y) |
|
5751 |
_ICOORD_ (z, c_z) |
|
5752 |
SETWIN(aGLXWindowId) |
|
5753 |
rdri(c_x, c_y, c_z); |
|
5754 |
RETURN (true); |
|
5755 |
%} |
|
5756 |
! |
|
5757 |
||
5758 |
glxRdrsX: x y: y z: z in: aGLXWindowId |
|
5759 |
||
5760 |
%{ /* NOCONTEXT */ |
|
5761 |
Scoord c_x, c_y, c_z; |
|
5762 |
||
5763 |
_SCOORD_ (x, c_x) |
|
5764 |
_SCOORD_ (y, c_y) |
|
5765 |
_SCOORD_ (z, c_z) |
|
5766 |
SETWIN(aGLXWindowId) |
|
5767 |
rdrs(c_x, c_y, c_z); |
|
5768 |
RETURN (true); |
|
5769 |
%} |
|
5770 |
! |
|
5771 |
||
5772 |
glxReadsource: src in: aGLXWindowId |
|
5773 |
||
5774 |
%{ /* NOCONTEXT */ |
|
5775 |
#ifdef GLX |
|
5776 |
SETWIN(aGLXWindowId) |
|
5777 |
readsource(_longVal(src)); |
|
5778 |
RETURN (true); |
|
5779 |
#endif |
|
5780 |
%} |
|
5781 |
. |
|
5782 |
^ false |
|
5783 |
! |
|
5784 |
||
5785 |
glxRectX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5786 |
||
5787 |
%{ /* NOCONTEXT */ |
|
5788 |
SETWIN(aGLXWindowId) |
|
5789 |
rect(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
5790 |
RETURN (true); |
|
5791 |
%} |
|
5792 |
! |
|
5793 |
||
5794 |
glxRectcopyX1: x1 y1: y1 x2: x2 y2: y2 newx: newx newy: newy in: aGLXWindowId |
|
5795 |
||
5796 |
%{ /* NOCONTEXT */ |
|
5797 |
#ifdef GLX |
|
5798 |
SETWIN(aGLXWindowId) |
|
5799 |
rectcopy(_screencoordVal(x1), _screencoordVal(y1), |
|
5800 |
_screencoordVal(x2), _screencoordVal(y2), |
|
5801 |
_screencoordVal(newx), _screencoordVal(newy)); |
|
5802 |
RETURN (true); |
|
5803 |
#endif |
|
5804 |
%} |
|
5805 |
. |
|
5806 |
^ false |
|
5807 |
! |
|
5808 |
||
5809 |
glxRectfX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5810 |
||
5811 |
%{ /* NOCONTEXT */ |
|
5812 |
SETWIN(aGLXWindowId) |
|
5813 |
rectf(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
5814 |
RETURN (true); |
|
5815 |
%} |
|
5816 |
! |
|
5817 |
||
5818 |
glxRectfiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5819 |
||
5820 |
%{ /* NOCONTEXT */ |
|
5821 |
SETWIN(aGLXWindowId) |
|
5822 |
rectfi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
5823 |
RETURN (true); |
|
5824 |
%} |
|
5825 |
! |
|
5826 |
||
5827 |
glxRectfsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5828 |
||
5829 |
%{ /* NOCONTEXT */ |
|
5830 |
SETWIN(aGLXWindowId) |
|
5831 |
rectfs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
5832 |
RETURN (true); |
|
5833 |
%} |
|
5834 |
! |
|
5835 |
||
5836 |
glxRectiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5837 |
||
5838 |
%{ /* NOCONTEXT */ |
|
5839 |
SETWIN(aGLXWindowId) |
|
5840 |
recti(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
5841 |
RETURN (true); |
|
5842 |
%} |
|
5843 |
! |
|
5844 |
||
5845 |
glxRectsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5846 |
||
5847 |
%{ /* NOCONTEXT */ |
|
5848 |
SETWIN(aGLXWindowId) |
|
5849 |
rects(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
5850 |
RETURN (true); |
|
5851 |
%} |
|
5852 |
! |
|
5853 |
||
5854 |
glxRectzoomX: xfactor y: yfactor in: aGLXWindowId |
|
5855 |
||
5856 |
%{ /* NOCONTEXT */ |
|
5857 |
#ifdef GLX |
|
5858 |
SETWIN(aGLXWindowId) |
|
5859 |
rectzoom(_floatVal(xfactor), _floatVal(yfactor)); |
|
5860 |
RETURN (true); |
|
5861 |
#endif |
|
5862 |
%} |
|
5863 |
. |
|
5864 |
^ false |
|
5865 |
! |
|
5866 |
||
5867 |
glxResetls: b in: aGLXWindowId |
|
5868 |
||
5869 |
%{ /* NOCONTEXT */ |
|
5870 |
#ifdef GLX |
|
5871 |
SETWIN(aGLXWindowId) |
|
5872 |
resetls(_booleanVal(b)); |
|
5873 |
RETURN (true); |
|
5874 |
#endif |
|
5875 |
%} |
|
5876 |
. |
|
5877 |
^ false |
|
5878 |
! |
|
5879 |
||
5880 |
glxRightbuffer: bool in: aGLXWindowId |
|
5881 |
||
5882 |
%{ /* NOCONTEXT */ |
|
5883 |
#ifdef FULL_GLX |
|
5884 |
SETWIN(aGLXWindowId) |
|
5885 |
rightbuffer(_booleanVal(bool)); |
|
5886 |
RETURN (true); |
|
5887 |
#endif |
|
5888 |
%} |
|
5889 |
. |
|
5890 |
^ false |
|
5891 |
! |
|
5892 |
||
5893 |
glxRingbellIn: aGLXWindowId |
|
5894 |
||
5895 |
%{ /* NOCONTEXT */ |
|
5896 |
#ifdef GLX |
|
5897 |
SETWIN(aGLXWindowId) |
|
5898 |
ringbell(); |
|
5899 |
RETURN (true); |
|
5900 |
#endif |
|
5901 |
%} |
|
5902 |
. |
|
5903 |
^ false |
|
5904 |
! |
|
5905 |
||
5906 |
glxRmv2:v in: aGLXWindowId |
|
5907 |
||
5908 |
%{ /* NOCONTEXT */ |
|
5909 |
float vec[2], *c_v; |
|
5910 |
||
5911 |
if (! (c_v = getFloatsFromInto(v, vec, 2))) RETURN(false); |
|
5912 |
SETWIN(aGLXWindowId) |
|
5913 |
rmv2((Coord)(c_v[0]), (Coord)(c_v[1])); |
|
5914 |
RETURN (true); |
|
5915 |
%} |
|
5916 |
! |
|
5917 |
||
5918 |
glxRmv2X: x y: y in: aGLXWindowId |
|
5919 |
||
5920 |
%{ /* NOCONTEXT */ |
|
5921 |
Coord c_x, c_y; |
|
5922 |
||
5923 |
_COORD_ (x, c_x) |
|
5924 |
_COORD_ (y, c_y) |
|
5925 |
SETWIN(aGLXWindowId) |
|
5926 |
rmv2(c_x, c_y); |
|
5927 |
RETURN (true); |
|
5928 |
%} |
|
5929 |
! |
|
5930 |
||
5931 |
glxRmv2iX: x y: y in: aGLXWindowId |
|
5932 |
||
5933 |
%{ /* NOCONTEXT */ |
|
5934 |
Icoord c_x, c_y; |
|
5935 |
||
5936 |
_ICOORD_ (x, c_x) |
|
5937 |
_ICOORD_ (y, c_y) |
|
5938 |
SETWIN(aGLXWindowId) |
|
5939 |
rmv2i(c_x, c_y); |
|
5940 |
RETURN (true); |
|
5941 |
%} |
|
5942 |
! |
|
5943 |
||
5944 |
glxRmv2sX: x y: y in: aGLXWindowId |
|
5945 |
||
5946 |
%{ /* NOCONTEXT */ |
|
5947 |
Scoord c_x, c_y; |
|
5948 |
||
5949 |
_SCOORD_ (x, c_x) |
|
5950 |
_SCOORD_ (y, c_y) |
|
5951 |
SETWIN(aGLXWindowId) |
|
5952 |
rmv2s(c_x, c_y); |
|
5953 |
RETURN (true); |
|
5954 |
%} |
|
5955 |
! |
|
5956 |
||
5957 |
glxRmv:v in: aGLXWindowId |
|
5958 |
||
5959 |
%{ /* NOCONTEXT */ |
|
5960 |
float vec[3], *c_v; |
|
5961 |
||
5962 |
if (! (c_v = getFloatsFromInto(v, vec, 3))) RETURN(false); |
|
5963 |
SETWIN(aGLXWindowId) |
|
5964 |
rmv((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
|
5965 |
RETURN (true); |
|
5966 |
%} |
|
5967 |
! |
|
5968 |
||
5969 |
glxRmvX: x y: y z: z in: aGLXWindowId |
|
5970 |
||
5971 |
%{ /* NOCONTEXT */ |
|
5972 |
Coord c_x, c_y, c_z; |
|
5973 |
||
5974 |
_COORD_ (x, c_x) |
|
5975 |
_COORD_ (y, c_y) |
|
5976 |
_COORD_ (z, c_z) |
|
5977 |
SETWIN(aGLXWindowId) |
|
5978 |
rmv(c_x, c_y, c_z); |
|
5979 |
RETURN (true); |
|
5980 |
%} |
|
5981 |
! |
|
5982 |
||
5983 |
glxRmviX: x y: y z: z in: aGLXWindowId |
|
5984 |
||
5985 |
%{ /* NOCONTEXT */ |
|
5986 |
Icoord c_x, c_y, c_z; |
|
5987 |
||
5988 |
_ICOORD_ (x, c_x) |
|
5989 |
_ICOORD_ (y, c_y) |
|
5990 |
_ICOORD_ (z, c_z) |
|
5991 |
SETWIN(aGLXWindowId) |
|
5992 |
rmvi(c_x, c_y, c_z); |
|
5993 |
RETURN (true); |
|
5994 |
%} |
|
5995 |
! |
|
5996 |
||
5997 |
glxRmvsX: x y: y z: z in: aGLXWindowId |
|
5998 |
||
5999 |
%{ /* NOCONTEXT */ |
|
6000 |
Scoord c_x, c_y, c_z; |
|
6001 |
||
6002 |
_SCOORD_ (x, c_x) |
|
6003 |
_SCOORD_ (y, c_y) |
|
6004 |
_SCOORD_ (z, c_z) |
|
6005 |
SETWIN(aGLXWindowId) |
|
6006 |
rmvs(c_x, c_y, c_z); |
|
6007 |
RETURN (true); |
|
6008 |
%} |
|
6009 |
! |
|
6010 |
||
6011 |
glxRpdr2X: x y: y in: aGLXWindowId |
|
6012 |
||
6013 |
%{ /* NOCONTEXT */ |
|
6014 |
Coord c_x, c_y; |
|
6015 |
||
6016 |
_COORD_ (x, c_x) |
|
6017 |
_COORD_ (y, c_y) |
|
6018 |
SETWIN(aGLXWindowId) |
|
6019 |
rpdr2(c_x, c_y); |
|
6020 |
RETURN (true); |
|
6021 |
%} |
|
6022 |
! |
|
6023 |
||
6024 |
glxRpdr2iX: x y: y in: aGLXWindowId |
|
6025 |
||
6026 |
%{ /* NOCONTEXT */ |
|
6027 |
Icoord c_x, c_y; |
|
6028 |
||
6029 |
_ICOORD_ (x, c_x) |
|
6030 |
_ICOORD_ (y, c_y) |
|
6031 |
SETWIN(aGLXWindowId) |
|
6032 |
rpdr2i(c_x, c_y); |
|
6033 |
RETURN (true); |
|
6034 |
%} |
|
6035 |
! |
|
6036 |
||
6037 |
glxRpdr2sX: x y: y in: aGLXWindowId |
|
6038 |
||
6039 |
%{ /* NOCONTEXT */ |
|
6040 |
Scoord c_x, c_y; |
|
6041 |
||
6042 |
_SCOORD_ (x, c_x) |
|
6043 |
_SCOORD_ (y, c_y) |
|
6044 |
SETWIN(aGLXWindowId) |
|
6045 |
rpdr2s(c_x, c_y); |
|
6046 |
RETURN (true); |
|
6047 |
%} |
|
6048 |
! |
|
6049 |
||
6050 |
glxRpdrX: x y: y z: z in: aGLXWindowId |
|
6051 |
||
6052 |
%{ /* NOCONTEXT */ |
|
6053 |
Coord c_x, c_y, c_z; |
|
6054 |
||
6055 |
_COORD_ (x, c_x) |
|
6056 |
_COORD_ (y, c_y) |
|
6057 |
_COORD_ (z, c_z) |
|
6058 |
SETWIN(aGLXWindowId) |
|
6059 |
rpdr(c_x, c_y, c_z); |
|
6060 |
RETURN (true); |
|
6061 |
%} |
|
6062 |
! |
|
6063 |
||
6064 |
glxRpdriX: x y: y z: z in: aGLXWindowId |
|
6065 |
||
6066 |
%{ /* NOCONTEXT */ |
|
6067 |
Icoord c_x, c_y, c_z; |
|
6068 |
||
6069 |
_ICOORD_ (x, c_x) |
|
6070 |
_ICOORD_ (y, c_y) |
|
6071 |
_ICOORD_ (z, c_z) |
|
6072 |
SETWIN(aGLXWindowId) |
|
6073 |
rpdri(c_x, c_y, c_z); |
|
6074 |
RETURN (true); |
|
6075 |
%} |
|
6076 |
! |
|
6077 |
||
6078 |
glxRpdrsX: x y: y z: z in: aGLXWindowId |
|
6079 |
||
6080 |
%{ /* NOCONTEXT */ |
|
6081 |
Scoord c_x, c_y, c_z; |
|
6082 |
||
6083 |
_SCOORD_ (x, c_x) |
|
6084 |
_SCOORD_ (y, c_y) |
|
6085 |
_SCOORD_ (z, c_z) |
|
6086 |
SETWIN(aGLXWindowId) |
|
6087 |
rpdrs(c_x, c_y, c_z); |
|
6088 |
RETURN (true); |
|
6089 |
%} |
|
6090 |
! |
|
6091 |
||
6092 |
glxRpmv2X: x y: y in: aGLXWindowId |
|
6093 |
||
6094 |
%{ /* NOCONTEXT */ |
|
6095 |
Coord c_x, c_y; |
|
6096 |
||
6097 |
_COORD_ (x, c_x) |
|
6098 |
_COORD_ (y, c_y) |
|
6099 |
SETWIN(aGLXWindowId) |
|
6100 |
rpmv2(c_x, c_y); |
|
6101 |
RETURN (true); |
|
6102 |
%} |
|
6103 |
! |
|
6104 |
||
6105 |
glxRpmv2iX: x y: y in: aGLXWindowId |
|
6106 |
||
6107 |
%{ /* NOCONTEXT */ |
|
6108 |
Icoord c_x, c_y; |
|
6109 |
||
6110 |
_ICOORD_ (x, c_x) |
|
6111 |
_ICOORD_ (y, c_y) |
|
6112 |
SETWIN(aGLXWindowId) |
|
6113 |
rpmv2i(c_x, c_y); |
|
6114 |
RETURN (true); |
|
6115 |
%} |
|
6116 |
! |
|
6117 |
||
6118 |
glxRpmv2sX: x y: y in: aGLXWindowId |
|
6119 |
||
6120 |
%{ /* NOCONTEXT */ |
|
6121 |
Scoord c_x, c_y; |
|
6122 |
||
6123 |
_SCOORD_ (x, c_x) |
|
6124 |
_SCOORD_ (y, c_y) |
|
6125 |
SETWIN(aGLXWindowId) |
|
6126 |
rpmv2s(c_x, c_y); |
|
6127 |
RETURN (true); |
|
6128 |
%} |
|
6129 |
! |
|
6130 |
||
6131 |
glxRpmvX: x y: y z: z in: aGLXWindowId |
|
6132 |
||
6133 |
%{ /* NOCONTEXT */ |
|
6134 |
Coord c_x, c_y, c_z; |
|
6135 |
||
6136 |
_COORD_ (x, c_x) |
|
6137 |
_COORD_ (y, c_y) |
|
6138 |
_COORD_ (z, c_z) |
|
6139 |
SETWIN(aGLXWindowId) |
|
6140 |
rpmv(c_x, c_y, c_z); |
|
6141 |
RETURN (true); |
|
6142 |
%} |
|
6143 |
! |
|
6144 |
||
6145 |
glxRpmviX: x y: y z: z in: aGLXWindowId |
|
6146 |
||
6147 |
%{ /* NOCONTEXT */ |
|
6148 |
Icoord c_x, c_y, c_z; |
|
6149 |
||
6150 |
_ICOORD_ (x, c_x) |
|
6151 |
_ICOORD_ (y, c_y) |
|
6152 |
_ICOORD_ (z, c_z) |
|
6153 |
SETWIN(aGLXWindowId) |
|
6154 |
rpmvi(c_x, c_y, c_z); |
|
6155 |
RETURN (true); |
|
6156 |
%} |
|
6157 |
! |
|
6158 |
||
6159 |
glxRpmvsX: x y: y z: z in: aGLXWindowId |
|
6160 |
||
6161 |
%{ /* NOCONTEXT */ |
|
6162 |
Scoord c_x, c_y, c_z; |
|
6163 |
||
6164 |
_SCOORD_ (x, c_x) |
|
6165 |
_SCOORD_ (y, c_y) |
|
6166 |
_SCOORD_ (z, c_z) |
|
6167 |
SETWIN(aGLXWindowId) |
|
6168 |
rpmvs(c_x, c_y, c_z); |
|
6169 |
RETURN (true); |
|
6170 |
%} |
|
6171 |
! |
|
6172 |
||
6173 |
glxSboxX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
6174 |
||
6175 |
%{ /* NOCONTEXT */ |
|
6176 |
#ifdef GLX |
|
6177 |
SETWIN(aGLXWindowId) |
|
6178 |
sbox(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
6179 |
RETURN (true); |
|
6180 |
#endif |
|
6181 |
%} |
|
6182 |
. |
|
6183 |
^ false |
|
6184 |
! |
|
6185 |
||
6186 |
glxSboxfX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
6187 |
||
6188 |
%{ /* NOCONTEXT */ |
|
6189 |
#ifdef GLX |
|
6190 |
SETWIN(aGLXWindowId) |
|
6191 |
sboxf(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
6192 |
RETURN (true); |
|
6193 |
#endif |
|
6194 |
%} |
|
6195 |
. |
|
6196 |
^ false |
|
6197 |
! |
|
6198 |
||
6199 |
glxSboxfiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
6200 |
||
6201 |
%{ /* NOCONTEXT */ |
|
6202 |
#ifdef GLX |
|
6203 |
SETWIN(aGLXWindowId) |
|
6204 |
sboxfi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
6205 |
RETURN (true); |
|
6206 |
#endif |
|
6207 |
%} |
|
6208 |
. |
|
6209 |
^ false |
|
6210 |
! |
|
6211 |
||
6212 |
glxSboxfsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
6213 |
||
6214 |
%{ /* NOCONTEXT */ |
|
6215 |
#ifdef GLX |
|
6216 |
SETWIN(aGLXWindowId) |
|
6217 |
sboxfs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
6218 |
RETURN (true); |
|
6219 |
#endif |
|
6220 |
%} |
|
6221 |
. |
|
6222 |
^ false |
|
6223 |
! |
|
6224 |
||
6225 |
glxSboxiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
6226 |
||
6227 |
%{ /* NOCONTEXT */ |
|
6228 |
#ifdef GLX |
|
6229 |
SETWIN(aGLXWindowId) |
|
6230 |
sboxi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
6231 |
RETURN (true); |
|
6232 |
#endif |
|
6233 |
%} |
|
6234 |
. |
|
6235 |
^ false |
|
6236 |
! |
|
6237 |
||
6238 |
glxSboxsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
6239 |
||
6240 |
%{ /* NOCONTEXT */ |
|
6241 |
#ifdef GLX |
|
6242 |
SETWIN(aGLXWindowId) |
|
6243 |
sboxs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
6244 |
RETURN (true); |
|
6245 |
#endif |
|
6246 |
%} |
|
6247 |
. |
|
6248 |
^ false |
|
6249 |
! |
|
6250 |
||
6251 |
glxSclearSval: sval in: aGLXWindowId |
|
6252 |
||
6253 |
%{ /* NOCONTEXT */ |
|
6254 |
#ifdef GLX |
|
6255 |
SETWIN(aGLXWindowId) |
|
6256 |
sclear((ulong)__intVal(sval)); |
|
6257 |
RETURN (true); |
|
6258 |
#endif |
|
6259 |
%} |
|
6260 |
. |
|
6261 |
^ false |
|
6262 |
! |
|
6263 |
||
6264 |
glxScrbox: arg in: aGLXWindowId |
|
6265 |
||
6266 |
%{ /* NOCONTEXT */ |
|
6267 |
#ifdef GLX |
|
6268 |
SETWIN(aGLXWindowId) |
|
6269 |
scrbox(_longVal(arg)); |
|
6270 |
RETURN (true); |
|
6271 |
#endif |
|
6272 |
%} |
|
6273 |
. |
|
6274 |
^ false |
|
6275 |
! |
|
6276 |
||
6277 |
glxScreenspaceIn: aGLXWindowId |
|
6278 |
||
6279 |
%{ /* NOCONTEXT */ |
|
6280 |
#ifdef GLX |
|
6281 |
SETWIN(aGLXWindowId) |
|
6282 |
screenspace(); |
|
6283 |
RETURN (true); |
|
6284 |
#endif |
|
6285 |
%} |
|
6286 |
. |
|
6287 |
^ false |
|
6288 |
! |
|
6289 |
||
6290 |
glxScrmaskLeft: left right: right bottom: bottom top: top in: aGLXWindowId |
|
6291 |
||
6292 |
%{ /* NOCONTEXT */ |
|
6293 |
#ifdef GLX |
|
6294 |
SETWIN(aGLXWindowId) |
|
6295 |
scrmask(_screencoordVal(left), _screencoordVal(right), |
|
6296 |
_screencoordVal(bottom), _screencoordVal(top)); |
|
6297 |
RETURN (true); |
|
6298 |
#endif |
|
6299 |
%} |
|
6300 |
. |
|
6301 |
^ false |
|
6302 |
! |
|
6303 |
||
6304 |
glxScrnattach: gsnr in: aGLXWindowId |
|
6305 |
||
6306 |
%{ /* NOCONTEXT */ |
|
6307 |
#ifdef GLX |
|
6308 |
SETWIN(aGLXWindowId) |
|
6309 |
scrnattach(_longVal(gsnr)); |
|
6310 |
RETURN (true); |
|
6311 |
#endif |
|
6312 |
%} |
|
6313 |
. |
|
6314 |
^ false |
|
6315 |
! |
|
6316 |
||
6317 |
glxScrnselect: gsnr in: aGLXWindowId |
|
6318 |
||
6319 |
%{ /* NOCONTEXT */ |
|
6320 |
#ifdef GLX |
|
6321 |
SETWIN(aGLXWindowId) |
|
6322 |
scrnselect(_longVal(gsnr)); |
|
6323 |
RETURN (true); |
|
6324 |
#endif |
|
6325 |
%} |
|
6326 |
. |
|
6327 |
^ false |
|
6328 |
! |
|
6329 |
||
6330 |
glxSetcursorIndex: index color: color wtn: wtn in: aGLXWindowId |
|
6331 |
||
6332 |
%{ /* NOCONTEXT */ |
|
6333 |
#ifdef GLX |
|
6334 |
SETWIN(aGLXWindowId) |
|
6335 |
setcursor(_shortVal(index), _colorindexVal(color), _colorindexVal(wtn)); |
|
6336 |
RETURN (true); |
|
6337 |
#endif |
|
6338 |
%} |
|
6339 |
. |
|
6340 |
^ false |
|
6341 |
! |
|
6342 |
||
6343 |
glxSetdblightsMask: mask in: aGLXWindowId |
|
6344 |
||
6345 |
%{ /* NOCONTEXT */ |
|
6346 |
#ifdef GLX |
|
6347 |
SETWIN(aGLXWindowId) |
|
6348 |
setdblights((ulong)__intVal(mask)); |
|
6349 |
RETURN (true); |
|
6350 |
#endif |
|
6351 |
%} |
|
6352 |
. |
|
6353 |
^ false |
|
6354 |
! |
|
6355 |
||
6356 |
glxSetdepthNear: near far: far in: aGLXWindowId |
|
6357 |
||
6358 |
%{ /* NOCONTEXT */ |
|
6359 |
#ifdef GLX |
|
6360 |
SETWIN(aGLXWindowId) |
|
6361 |
setdepth(_screencoordVal(near), _screencoordVal(far)); |
|
6362 |
RETURN (true); |
|
6363 |
#endif |
|
6364 |
%} |
|
6365 |
. |
|
6366 |
^ false |
|
6367 |
! |
|
6368 |
||
6369 |
glxSetlinestyle: index in: aGLXWindowId |
|
6370 |
"set the linestyle" |
|
6371 |
||
6372 |
%{ /* NOCONTEXT */ |
|
6373 |
SETWIN(aGLXWindowId) |
|
6374 |
setlinestyle(_shortVal(index)); |
|
6375 |
RETURN (true); |
|
6376 |
%} |
|
6377 |
. |
|
6378 |
^ false |
|
6379 |
! |
|
6380 |
||
6381 |
glxSetmap: mapnum in: aGLXWindowId |
|
6382 |
||
6383 |
%{ /* NOCONTEXT */ |
|
6384 |
#ifdef GLX |
|
6385 |
SETWIN(aGLXWindowId) |
|
6386 |
setmap(_shortVal(mapnum)); |
|
6387 |
RETURN (true); |
|
6388 |
#endif |
|
6389 |
%} |
|
6390 |
. |
|
6391 |
^ false |
|
6392 |
! |
|
6393 |
||
6394 |
glxSetmonitor: mtype in: aGLXWindowId |
|
6395 |
||
6396 |
%{ /* NOCONTEXT */ |
|
6397 |
#ifdef GLX |
|
6398 |
SETWIN(aGLXWindowId) |
|
6399 |
setmonitor(_shortVal(mtype)); |
|
6400 |
RETURN (true); |
|
6401 |
#endif |
|
6402 |
%} |
|
6403 |
. |
|
6404 |
^ false |
|
6405 |
! |
|
6406 |
||
6407 |
glxSetnurbsproperty: property value: value in: aGLXWindowId |
|
6408 |
||
6409 |
%{ /* NOCONTEXT */ |
|
6410 |
#ifdef GLX |
|
6411 |
SETWIN(aGLXWindowId) |
|
6412 |
setnurbsproperty(_longVal(property), _floatVal(value)); |
|
6413 |
RETURN (true); |
|
6414 |
#endif |
|
6415 |
%} |
|
6416 |
. |
|
6417 |
^ false |
|
6418 |
! |
|
6419 |
||
6420 |
glxSetpattern: index in: aGLXWindowId |
|
6421 |
||
6422 |
%{ /* NOCONTEXT */ |
|
6423 |
#ifdef GLX |
|
6424 |
SETWIN(aGLXWindowId) |
|
6425 |
setpattern(_shortVal(index)); |
|
6426 |
RETURN (true); |
|
6427 |
#endif |
|
6428 |
%} |
|
6429 |
. |
|
6430 |
^ false |
|
6431 |
! |
|
6432 |
||
6433 |
glxSetpup: pup entry: entry mode: mode in: aGLXWindowId |
|
6434 |
||
6435 |
%{ /* NOCONTEXT */ |
|
6436 |
#ifdef GLX |
|
6437 |
SETWIN(aGLXWindowId) |
|
6438 |
setpup(_longVal(pup), _longVal(entry), (ulong)__intVal(mode)); |
|
6439 |
RETURN (true); |
|
6440 |
#endif |
|
6441 |
%} |
|
6442 |
. |
|
6443 |
^ false |
|
6444 |
! |
|
6445 |
||
6446 |
glxSetvaluator: v init: init vmin: vmin vmax: vmax in: aGLXWindowId |
|
6447 |
||
6448 |
%{ /* NOCONTEXT */ |
|
6449 |
#ifdef GLX |
|
6450 |
SETWIN(aGLXWindowId) |
|
6451 |
setvaluator(_deviceVal(v), _shortVal(init), _shortVal(vmin), _shortVal(vmax)); |
|
6452 |
RETURN (true); |
|
6453 |
#endif |
|
6454 |
%} |
|
6455 |
. |
|
6456 |
^ false |
|
6457 |
! |
|
6458 |
||
6459 |
glxSetvideo: reg value: value in: aGLXWindowId |
|
6460 |
||
6461 |
%{ /* NOCONTEXT */ |
|
6462 |
#ifdef GLX |
|
6463 |
SETWIN(aGLXWindowId) |
|
6464 |
setvideo(_longVal(reg), _longVal(value)); |
|
6465 |
RETURN (true); |
|
6466 |
#endif |
|
6467 |
%} |
|
6468 |
. |
|
6469 |
^ false |
|
6470 |
! |
|
6471 |
||
6472 |
glxShademodel: model in: aGLXWindowId |
|
6473 |
||
6474 |
%{ /* NOCONTEXT */ |
|
6475 |
#ifdef GLX |
|
6476 |
SETWIN(aGLXWindowId) |
|
6477 |
shademodel(_longVal(model)); |
|
6478 |
RETURN (true); |
|
6479 |
#endif |
|
6480 |
%} |
|
6481 |
. |
|
6482 |
^ false |
|
6483 |
! |
|
6484 |
||
6485 |
glxShaderangeLowin: lowin hiwin: hiwin z1: z1 z2: z2 in: aGLXWindowId |
|
6486 |
||
6487 |
%{ /* NOCONTEXT */ |
|
6488 |
#ifdef GLX |
|
6489 |
SETWIN(aGLXWindowId) |
|
6490 |
shaderange(_colorindexVal(lowin), _colorindexVal(hiwin), |
|
6491 |
_screencoordVal(z1), _screencoordVal(z2)); |
|
6492 |
RETURN (true); |
|
6493 |
#endif |
|
6494 |
%} |
|
6495 |
. |
|
6496 |
^ false |
|
6497 |
! |
|
6498 |
||
6499 |
glxSmoothline: mode in: aGLXWindowId |
|
6500 |
||
6501 |
%{ /* NOCONTEXT */ |
|
6502 |
#ifdef GLX |
|
6503 |
SETWIN(aGLXWindowId) |
|
6504 |
smoothline(_longVal(mode)); |
|
6505 |
RETURN (true); |
|
6506 |
#endif |
|
6507 |
%} |
|
6508 |
. |
|
6509 |
^ false |
|
6510 |
! |
|
6511 |
||
6512 |
glxStencilEnable: enable ref: ref func: func mask: mask fail: fail |
|
6513 |
pass: pass zpass: zpass in: aGLXWindowId |
|
6514 |
||
6515 |
%{ /* NOCONTEXT */ |
|
6516 |
#ifdef GLX |
|
6517 |
SETWIN(aGLXWindowId) |
|
6518 |
stencil(_longVal(enable), (ulong)__intVal(ref), _longVal(func), |
|
6519 |
(ulong)__intVal(mask), _longVal(fail), _longVal(pass), _longVal(zpass)); |
|
6520 |
RETURN (true); |
|
6521 |
#endif |
|
6522 |
%} |
|
6523 |
. |
|
6524 |
^ false |
|
6525 |
! |
|
6526 |
||
6527 |
glxStensize: planes in: aGLXWindowId |
|
6528 |
||
6529 |
%{ /* NOCONTEXT */ |
|
6530 |
#ifdef GLX |
|
6531 |
SETWIN(aGLXWindowId) |
|
6532 |
stensize(_longVal(planes)); |
|
6533 |
RETURN (true); |
|
6534 |
#endif |
|
6535 |
%} |
|
6536 |
. |
|
6537 |
^ false |
|
6538 |
! |
|
6539 |
||
6540 |
glxStepunitX: x y: y in: aGLXWindowId |
|
6541 |
||
6542 |
%{ /* NOCONTEXT */ |
|
6543 |
#ifdef GLX |
|
6544 |
SETWIN(aGLXWindowId) |
|
6545 |
stepunit(_longVal(x), _longVal(y)); |
|
6546 |
RETURN (true); |
|
6547 |
#endif |
|
6548 |
%} |
|
6549 |
. |
|
6550 |
^ false |
|
6551 |
! |
|
6552 |
||
6553 |
glxSubpixel: b in: aGLXWindowId |
|
6554 |
||
6555 |
%{ /* NOCONTEXT */ |
|
6556 |
#ifdef GLX |
|
6557 |
SETWIN(aGLXWindowId) |
|
6558 |
subpixel(_booleanVal(b)); |
|
6559 |
RETURN (true); |
|
6560 |
#endif |
|
6561 |
%} |
|
6562 |
. |
|
6563 |
^ false |
|
6564 |
! |
|
6565 |
||
6566 |
glxSwapinterval: i in: aGLXWindowId |
|
6567 |
||
6568 |
%{ /* NOCONTEXT */ |
|
6569 |
#ifdef GLX |
|
6570 |
SETWIN(aGLXWindowId) |
|
6571 |
swapinterval(_shortVal(i)); |
|
6572 |
RETURN (true); |
|
6573 |
#endif |
|
6574 |
%} |
|
6575 |
. |
|
6576 |
^ false |
|
6577 |
! |
|
6578 |
||
6579 |
glxSwaptmeshIn: aGLXWindowId |
|
6580 |
||
6581 |
%{ /* NOCONTEXT */ |
|
6582 |
#ifdef GLX |
|
6583 |
SETWIN(aGLXWindowId) |
|
6584 |
swaptmesh(); |
|
6585 |
RETURN (true); |
|
6586 |
#endif |
|
6587 |
%} |
|
6588 |
. |
|
6589 |
^ false |
|
6590 |
! |
|
6591 |
||
6592 |
glxSwinopen: parent in: aGLXWindowId |
|
6593 |
||
6594 |
%{ /* NOCONTEXT */ |
|
6595 |
#ifdef GLX |
|
6596 |
SETWIN(aGLXWindowId) |
|
6597 |
swinopen(_longVal(parent)); |
|
6598 |
RETURN (true); |
|
6599 |
#endif |
|
6600 |
%} |
|
6601 |
. |
|
6602 |
^ false |
|
6603 |
! |
|
6604 |
||
6605 |
glxSwritemask: mask in: aGLXWindowId |
|
6606 |
||
6607 |
%{ /* NOCONTEXT */ |
|
6608 |
#ifdef GLX |
|
6609 |
SETWIN(aGLXWindowId) |
|
6610 |
swritemask((ulong)__intVal(mask)); |
|
6611 |
RETURN (true); |
|
6612 |
#endif |
|
6613 |
%} |
|
6614 |
. |
|
6615 |
^ false |
|
6616 |
! |
|
6617 |
||
6618 |
glxT2d: v in: aGLXWindowId |
|
6619 |
||
6620 |
%{ /* NOCONTEXT */ |
|
6621 |
#ifdef GLX |
|
6622 |
double vec[2], *c_v; |
|
6623 |
||
6624 |
if (! (c_v = getDoublesFromInto(v, vec, 2))) RETURN(false); |
|
6625 |
SETWIN(aGLXWindowId) |
|
6626 |
t2d(c_v); |
|
6627 |
RETURN (true); |
|
6628 |
#endif |
|
6629 |
%} |
|
6630 |
. |
|
6631 |
^ false |
|
6632 |
! |
|
6633 |
||
6634 |
glxT2f: v in: aGLXWindowId |
|
6635 |
||
6636 |
%{ /* NOCONTEXT */ |
|
6637 |
#ifdef GLX |
|
6638 |
float vec[2], *c_v; |
|
6639 |
||
6640 |
if (! (c_v = getFloatsFromInto(v, vec, 2))) RETURN(false); |
|
6641 |
SETWIN(aGLXWindowId) |
|
6642 |
t2f(c_v); |
|
6643 |
RETURN (true); |
|
6644 |
#endif |
|
6645 |
%} |
|
6646 |
. |
|
6647 |
^ false |
|
6648 |
! |
|
6649 |
||
6650 |
glxT2i: v in: aGLXWindowId |
|
6651 |
||
6652 |
%{ /* NOCONTEXT */ |
|
6653 |
#ifdef GLX |
|
6654 |
long vec[2], *c_v; |
|
6655 |
||
6656 |
if (! (c_v = getLongsFromInto(v, vec, 2))) RETURN(false); |
|
6657 |
SETWIN(aGLXWindowId) |
|
6658 |
t2i(c_v); |
|
6659 |
RETURN (true); |
|
6660 |
#endif |
|
6661 |
%} |
|
6662 |
. |
|
6663 |
^ false |
|
6664 |
! |
|
6665 |
||
6666 |
glxT2s: v in: aGLXWindowId |
|
6667 |
||
6668 |
%{ /* NOCONTEXT */ |
|
6669 |
#ifdef GLX |
|
6670 |
short vec[2], *c_v; |
|
6671 |
||
6672 |
if (! (c_v = getShortsFromInto(v, vec, 2))) RETURN(false); |
|
6673 |
SETWIN(aGLXWindowId) |
|
6674 |
t2s(c_v); |
|
6675 |
RETURN (true); |
|
6676 |
#endif |
|
6677 |
%} |
|
6678 |
. |
|
6679 |
^ false |
|
6680 |
! |
|
6681 |
||
6682 |
glxT3d:v in:aGLXWindowId |
|
6683 |
||
6684 |
%{ /* NOCONTEXT */ |
|
6685 |
#ifdef FULL_GLX |
|
6686 |
double vec[3], *c_v; |
|
6687 |
||
6688 |
if (! (c_v = getDoublesFromInto(v, vec, 3))) RETURN(false); |
|
6689 |
SETWIN(aGLXWindowId) |
|
6690 |
t3d(c_v); |
|
6691 |
RETURN (true); |
|
6692 |
#endif |
|
6693 |
%} |
|
6694 |
. |
|
6695 |
^ false |
|
6696 |
! |
|
6697 |
||
6698 |
glxT3f:v in:aGLXWindowId |
|
6699 |
||
6700 |
%{ /* NOCONTEXT */ |
|
6701 |
#ifdef FULL_GLX |
|
6702 |
float vec[3], *c_v; |
|
6703 |
||
6704 |
if (! (c_v = getFloatsFromInto(v, vec, 3))) RETURN(false); |
|
6705 |
SETWIN(aGLXWindowId) |
|
6706 |
t3f(c_v); |
|
6707 |
RETURN (true); |
|
6708 |
#endif |
|
6709 |
%} |
|
6710 |
. |
|
6711 |
^ false |
|
6712 |
! |
|
6713 |
||
6714 |
glxT3i:v in:aGLXWindowId |
|
6715 |
||
6716 |
%{ /* NOCONTEXT */ |
|
6717 |
#ifdef FULL_GLX |
|
6718 |
long vec[3], *c_v; |
|
6719 |
||
6720 |
if (! (c_v = getLongsFromInto(v, vec, 3))) RETURN(false); |
|
6721 |
SETWIN(aGLXWindowId) |
|
6722 |
t3i(c_v); |
|
6723 |
RETURN (true); |
|
6724 |
#endif |
|
6725 |
%} |
|
6726 |
. |
|
6727 |
^ false |
|
6728 |
! |
|
6729 |
||
6730 |
glxT3s:v in:aGLXWindowId |
|
6731 |
||
6732 |
%{ /* NOCONTEXT */ |
|
6733 |
#ifdef FULL_GLX |
|
6734 |
short vec[3], *c_v; |
|
6735 |
||
6736 |
if (! (c_v = getShortsFromInto(v, vec, 3))) RETURN(false); |
|
6737 |
SETWIN(aGLXWindowId) |
|
6738 |
t3s(c_v); |
|
6739 |
RETURN (true); |
|
6740 |
#endif |
|
6741 |
%} |
|
6742 |
. |
|
6743 |
^ false |
|
6744 |
! |
|
6745 |
||
6746 |
glxT4d: v in: aGLXWindowId |
|
6747 |
||
6748 |
%{ /* NOCONTEXT */ |
|
6749 |
#ifdef FULL_GLX |
|
6750 |
double vec[4], *c_v; |
|
6751 |
||
6752 |
if (! (c_v = getDoublesFromInto(v, vec, 4))) RETURN(false); |
|
6753 |
SETWIN(aGLXWindowId) |
|
6754 |
t4d(c_v); |
|
6755 |
RETURN (true); |
|
6756 |
#endif |
|
6757 |
%} |
|
6758 |
. |
|
6759 |
^ false |
|
6760 |
! |
|
6761 |
||
6762 |
glxT4f: v in: aGLXWindowId |
|
6763 |
||
6764 |
%{ /* NOCONTEXT */ |
|
6765 |
#ifdef FULL_GLX |
|
6766 |
float vec[4], *c_v; |
|
6767 |
||
6768 |
if (! (c_v = getFloatsFromInto(v, vec, 4))) RETURN(false); |
|
6769 |
SETWIN(aGLXWindowId) |
|
6770 |
t4f(c_v); |
|
6771 |
RETURN (true); |
|
6772 |
#endif |
|
6773 |
%} |
|
6774 |
. |
|
6775 |
^ false |
|
6776 |
! |
|
6777 |
||
6778 |
glxT4i: v in: aGLXWindowId |
|
6779 |
||
6780 |
%{ /* NOCONTEXT */ |
|
6781 |
#ifdef FULL_GLX |
|
6782 |
long vec[4], *c_v; |
|
6783 |
||
6784 |
if (! (c_v = getLongsFromInto(v, vec, 4))) RETURN(false); |
|
6785 |
SETWIN(aGLXWindowId) |
|
6786 |
t4i(c_v); |
|
6787 |
RETURN (true); |
|
6788 |
#endif |
|
6789 |
%} |
|
6790 |
. |
|
6791 |
^ false |
|
6792 |
! |
|
6793 |
||
6794 |
glxT4s: v in: aGLXWindowId |
|
6795 |
||
6796 |
%{ /* NOCONTEXT */ |
|
6797 |
#ifdef FULL_GLX |
|
6798 |
short vec[4], *c_v; |
|
6799 |
||
6800 |
if (! (c_v = getShortsFromInto(v, vec, 4))) RETURN(false); |
|
6801 |
SETWIN(aGLXWindowId) |
|
6802 |
t4s(c_v); |
|
6803 |
RETURN (true); |
|
6804 |
#endif |
|
6805 |
%} |
|
6806 |
. |
|
6807 |
^ false |
|
6808 |
! |
|
6809 |
||
6810 |
glxTextinitIn: aGLXWindowId |
|
6811 |
||
6812 |
%{ /* NOCONTEXT */ |
|
6813 |
#ifdef GLX |
|
6814 |
SETWIN(aGLXWindowId) |
|
6815 |
textinit(); |
|
6816 |
RETURN (true); |
|
6817 |
#endif |
|
6818 |
%} |
|
6819 |
. |
|
6820 |
^ false |
|
6821 |
! |
|
6822 |
||
6823 |
glxTextportLeft: left right: right bottom: bottom top: top in: aGLXWindowId |
|
6824 |
||
6825 |
%{ /* NOCONTEXT */ |
|
6826 |
#ifdef GLX |
|
6827 |
SETWIN(aGLXWindowId) |
|
6828 |
textport(_screencoordVal(left), _screencoordVal(right), |
|
6829 |
_screencoordVal(bottom), _screencoordVal(top)); |
|
6830 |
RETURN (true); |
|
6831 |
#endif |
|
6832 |
%} |
|
6833 |
. |
|
6834 |
^ false |
|
6835 |
! |
|
6836 |
||
6837 |
glxTieB: b v1: v1 v2: v2 in: aGLXWindowId |
|
6838 |
||
6839 |
%{ /* NOCONTEXT */ |
|
6840 |
#ifdef GLX |
|
6841 |
SETWIN(aGLXWindowId) |
|
6842 |
tie(_deviceVal(b), _deviceVal(v1), _deviceVal(v2)); |
|
6843 |
RETURN (true); |
|
6844 |
#endif |
|
6845 |
%} |
|
6846 |
. |
|
6847 |
^ false |
|
6848 |
! |
|
6849 |
||
6850 |
glxTlutbind: target index: index in: aGLXWindowId |
|
6851 |
||
6852 |
%{ /* NOCONTEXT */ |
|
6853 |
#ifdef FULL_GLX |
|
6854 |
SETWIN(aGLXWindowId) |
|
6855 |
tlutbind(_longVal(target), _longVal(index)); |
|
6856 |
RETURN (true); |
|
6857 |
#endif |
|
6858 |
%} |
|
6859 |
. |
|
6860 |
^ false |
|
6861 |
! |
|
6862 |
||
6863 |
glxTpoffIn: aGLXWindowId |
|
6864 |
||
6865 |
%{ /* NOCONTEXT */ |
|
6866 |
#ifdef GLX |
|
6867 |
SETWIN(aGLXWindowId) |
|
6868 |
tpoff(); |
|
6869 |
RETURN (true); |
|
6870 |
#endif |
|
6871 |
%} |
|
6872 |
. |
|
6873 |
^ false |
|
6874 |
! |
|
6875 |
||
6876 |
glxTponIn: aGLXWindowId |
|
6877 |
||
6878 |
%{ /* NOCONTEXT */ |
|
6879 |
#ifdef GLX |
|
6880 |
SETWIN(aGLXWindowId) |
|
6881 |
tpon(); |
|
6882 |
RETURN (true); |
|
6883 |
#endif |
|
6884 |
%} |
|
6885 |
. |
|
6886 |
^ false |
|
6887 |
! |
|
6888 |
||
6889 |
glxUnqdevice: dev in: aGLXWindowId |
|
6890 |
||
6891 |
%{ /* NOCONTEXT */ |
|
6892 |
#ifdef GLX |
|
6893 |
SETWIN(aGLXWindowId) |
|
6894 |
unqdevice(_deviceVal(dev)); |
|
6895 |
RETURN (true); |
|
6896 |
#endif |
|
6897 |
%} |
|
6898 |
. |
|
6899 |
^ false |
|
6900 |
! |
|
6901 |
||
6902 |
glxWmpack: pack in: aGLXWindowId |
|
6903 |
||
6904 |
%{ /* NOCONTEXT */ |
|
6905 |
#ifdef GLX |
|
6906 |
SETWIN(aGLXWindowId) |
|
6907 |
wmpack((ulong)__intVal(pack)); |
|
6908 |
RETURN (true); |
|
6909 |
#endif |
|
6910 |
%} |
|
6911 |
. |
|
6912 |
^ false |
|
6913 |
! |
|
6914 |
||
6915 |
glxWritemask: wtm in: aGLXWindowId |
|
6916 |
||
6917 |
%{ /* NOCONTEXT */ |
|
6918 |
#ifdef GLX |
|
6919 |
SETWIN(aGLXWindowId) |
|
6920 |
writemask(_colorindexVal(wtm)); |
|
6921 |
RETURN (true); |
|
6922 |
#endif |
|
6923 |
%} |
|
6924 |
. |
|
6925 |
^ false |
|
6926 |
! |
|
6927 |
||
6928 |
glxXfpt2X: x y: y in: aGLXWindowId |
|
6929 |
||
6930 |
%{ /* NOCONTEXT */ |
|
6931 |
#ifdef GLX |
|
6932 |
Coord c_x, c_y; |
|
6933 |
||
6934 |
_COORD_ (x, c_x) |
|
6935 |
_COORD_ (y, c_y) |
|
6936 |
SETWIN(aGLXWindowId) |
|
6937 |
xfpt2(c_x, c_y); |
|
6938 |
RETURN (true); |
|
6939 |
#endif |
|
6940 |
%} |
|
6941 |
. |
|
6942 |
^ false |
|
6943 |
! |
|
6944 |
||
6945 |
glxXfpt2iX: x y: y in: aGLXWindowId |
|
6946 |
||
6947 |
%{ /* NOCONTEXT */ |
|
6948 |
#ifdef GLX |
|
6949 |
Icoord c_x, c_y; |
|
6950 |
||
6951 |
_ICOORD_ (x, c_x) |
|
6952 |
_ICOORD_ (y, c_y) |
|
6953 |
SETWIN(aGLXWindowId) |
|
6954 |
xfpt2i(c_x, c_y); |
|
6955 |
RETURN (true); |
|
6956 |
#endif |
|
6957 |
%} |
|
6958 |
. |
|
6959 |
^ false |
|
6960 |
! |
|
6961 |
||
6962 |
glxXfpt2sX: x y: y in: aGLXWindowId |
|
6963 |
||
6964 |
%{ /* NOCONTEXT */ |
|
6965 |
#ifdef GLX |
|
6966 |
Scoord c_x, c_y; |
|
6967 |
||
6968 |
_SCOORD_ (x, c_x) |
|
6969 |
_SCOORD_ (y, c_y) |
|
6970 |
SETWIN(aGLXWindowId) |
|
6971 |
xfpt2s(c_x, c_y); |
|
6972 |
RETURN (true); |
|
6973 |
#endif |
|
6974 |
%} |
|
6975 |
. |
|
6976 |
^ false |
|
6977 |
! |
|
6978 |
||
6979 |
glxXfpt4X: x y: y z: z w: w in: aGLXWindowId |
|
6980 |
||
6981 |
%{ /* NOCONTEXT */ |
|
6982 |
#ifdef GLX |
|
6983 |
Coord c_x, c_y, c_z, c_w; |
|
6984 |
||
6985 |
_COORD_ (x, c_x) |
|
6986 |
_COORD_ (y, c_y) |
|
6987 |
_COORD_ (z, c_z) |
|
6988 |
_COORD_ (w, c_w) |
|
6989 |
SETWIN(aGLXWindowId) |
|
6990 |
xfpt4(c_x, c_y, c_z, c_w); |
|
6991 |
RETURN (true); |
|
6992 |
#endif |
|
6993 |
%} |
|
6994 |
. |
|
6995 |
^ false |
|
6996 |
! |
|
6997 |
||
6998 |
glxXfpt4iX: x y: y z: z w: w in: aGLXWindowId |
|
6999 |
||
7000 |
%{ /* NOCONTEXT */ |
|
7001 |
#ifdef GLX |
|
7002 |
Icoord c_x, c_y, c_z, c_w; |
|
7003 |
||
7004 |
_ICOORD_ (x, c_x) |
|
7005 |
_ICOORD_ (y, c_y) |
|
7006 |
_ICOORD_ (z, c_z) |
|
7007 |
_ICOORD_ (w, c_w) |
|
7008 |
SETWIN(aGLXWindowId) |
|
7009 |
xfpt4i(c_x, c_y, c_z, c_w); |
|
7010 |
RETURN (true); |
|
7011 |
#endif |
|
7012 |
%} |
|
7013 |
. |
|
7014 |
^ false |
|
7015 |
! |
|
7016 |
||
7017 |
glxXfpt4sX: x y: y z: z w: w in: aGLXWindowId |
|
7018 |
||
7019 |
%{ /* NOCONTEXT */ |
|
7020 |
#ifdef GLX |
|
7021 |
Scoord c_x, c_y, c_z, c_w; |
|
7022 |
||
7023 |
_SCOORD_ (x, c_x) |
|
7024 |
_SCOORD_ (y, c_y) |
|
7025 |
_SCOORD_ (z, c_z) |
|
7026 |
_SCOORD_ (w, c_w) |
|
7027 |
SETWIN(aGLXWindowId) |
|
7028 |
xfpt4s(c_x, c_y, c_z, c_w); |
|
7029 |
RETURN (true); |
|
7030 |
#endif |
|
7031 |
%} |
|
7032 |
. |
|
7033 |
^ false |
|
7034 |
! |
|
7035 |
||
7036 |
glxXfptX: x y: y z: z in: aGLXWindowId |
|
7037 |
||
7038 |
%{ /* NOCONTEXT */ |
|
7039 |
#ifdef GLX |
|
7040 |
Coord c_x, c_y, c_z; |
|
7041 |
||
7042 |
_COORD_ (x, c_x) |
|
7043 |
_COORD_ (y, c_y) |
|
7044 |
_COORD_ (z, c_z) |
|
7045 |
SETWIN(aGLXWindowId) |
|
7046 |
xfpt(c_x, c_y, c_z); |
|
7047 |
RETURN (true); |
|
7048 |
#endif |
|
7049 |
%} |
|
7050 |
. |
|
7051 |
^ false |
|
7052 |
! |
|
7053 |
||
7054 |
glxXfptiX: x y: y z: z in: aGLXWindowId |
|
7055 |
||
7056 |
%{ /* NOCONTEXT */ |
|
7057 |
#ifdef GLX |
|
7058 |
Icoord c_x, c_y, c_z; |
|
7059 |
||
7060 |
_ICOORD_ (x, c_x) |
|
7061 |
_ICOORD_ (y, c_y) |
|
7062 |
_ICOORD_ (z, c_z) |
|
7063 |
SETWIN(aGLXWindowId) |
|
7064 |
xfpti(c_x, c_y, c_z); |
|
7065 |
RETURN (true); |
|
7066 |
#endif |
|
7067 |
%} |
|
7068 |
. |
|
7069 |
^ false |
|
7070 |
! |
|
7071 |
||
7072 |
glxXfptsX: x y: y z: z in: aGLXWindowId |
|
7073 |
||
7074 |
%{ /* NOCONTEXT */ |
|
7075 |
#ifdef GLX |
|
7076 |
Scoord c_x, c_y, c_z; |
|
7077 |
||
7078 |
_SCOORD_ (x, c_x) |
|
7079 |
_SCOORD_ (y, c_y) |
|
7080 |
_SCOORD_ (z, c_z) |
|
7081 |
SETWIN(aGLXWindowId) |
|
7082 |
xfpts(c_x, c_y, c_z); |
|
7083 |
RETURN (true); |
|
7084 |
#endif |
|
7085 |
%} |
|
7086 |
. |
|
7087 |
^ false |
|
7088 |
! ! |
|
7089 |
||
7090 |
!GLXWorkstation methodsFor:'vertex data transfer'! |
|
7091 |
||
7092 |
glxN3f:arrayOf3Floats in:aGLXWindowId |
|
7093 |
"argument must be an array of 3 floats containing the |
|
7094 |
current vertex normal - in real GL only" |
|
7095 |
||
7096 |
%{ /* NOCONTEXT */ |
|
7097 |
#ifdef GLX |
|
7098 |
float vec[3], *v; |
|
7099 |
||
7100 |
if (! (v = getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
|
7101 |
SETWIN(aGLXWindowId) |
|
7102 |
n3f(v); |
|
7103 |
RETURN (true); |
|
7104 |
#endif |
|
7105 |
%} |
|
7106 |
. |
|
7107 |
^ false |
|
7108 |
! |
|
7109 |
||
7110 |
glxV2d:v in:aGLXWindowId |
|
7111 |
"pass a vertex; v must be a vector with 2 doubles; z is taken as 0" |
|
7112 |
||
7113 |
%{ /* NOCONTEXT */ |
|
7114 |
double vec[2], *c_v; |
|
7115 |
||
7116 |
if (! (c_v = getDoublesFromInto(v, vec, 2))) RETURN(false); |
|
7117 |
SETWIN(aGLXWindowId) |
|
7118 |
v2d(c_v); |
|
7119 |
RETURN (true); |
|
7120 |
%} |
|
7121 |
! |
|
7122 |
||
7123 |
glxV2f:v in:aGLXWindowId |
|
7124 |
"pass a vertex; v must be a vector with 2 floats; z is taken as 0" |
|
7125 |
||
7126 |
%{ /* NOCONTEXT */ |
|
7127 |
float vec[2], *c_v; |
|
7128 |
||
7129 |
if (! (c_v = getFloatsFromInto(v, vec, 2))) RETURN(false); |
|
7130 |
SETWIN(aGLXWindowId) |
|
7131 |
v2f(c_v); |
|
7132 |
RETURN (true); |
|
7133 |
%} |
|
7134 |
! |
|
7135 |
||
7136 |
glxV2fX:x y:y in:aGLXWindowId |
|
7137 |
"pass a vertex from individual x and y values; z is taken as 0.0" |
|
7138 |
||
7139 |
%{ /* NOCONTEXT */ |
|
7140 |
float vec[2]; |
|
7141 |
||
7142 |
_FLOAT_(x, vec[0]) |
|
7143 |
_FLOAT_(y, vec[1]) |
|
7144 |
SETWIN(aGLXWindowId) |
|
7145 |
v2f(vec); |
|
7146 |
RETURN (true); |
|
7147 |
%} |
|
7148 |
! |
|
7149 |
||
7150 |
glxV2i:v in:aGLXWindowId |
|
7151 |
"pass a vertex; v must be a vector with 2 longs; z is taken as 0" |
|
7152 |
||
7153 |
%{ /* NOCONTEXT */ |
|
7154 |
long vec[2], *c_v; |
|
7155 |
||
7156 |
if (! (c_v = getLongsFromInto(v, vec, 2))) RETURN(false); |
|
7157 |
SETWIN(aGLXWindowId) |
|
7158 |
v2i(c_v); |
|
7159 |
RETURN (true); |
|
7160 |
%} |
|
7161 |
! |
|
7162 |
||
7163 |
glxV2s:v in:aGLXWindowId |
|
7164 |
"pass a vertex; v must be a vector with 2 shorts; z is taken as 0" |
|
7165 |
||
7166 |
%{ /* NOCONTEXT */ |
|
7167 |
short vec[2], *c_v; |
|
7168 |
||
7169 |
if (! (c_v = getShortsFromInto(v, vec, 2))) RETURN(false); |
|
7170 |
SETWIN(aGLXWindowId) |
|
7171 |
v2s(c_v); |
|
7172 |
RETURN (true); |
|
7173 |
%} |
|
7174 |
! |
|
7175 |
||
7176 |
glxV3d:v in:aGLXWindowId |
|
7177 |
"pass a vertex; v must be a 3-element double-vector" |
|
7178 |
||
7179 |
%{ /* NOCONTEXT */ |
|
7180 |
double vec[3], *c_v; |
|
7181 |
||
7182 |
if (! (c_v = getDoublesFromInto(v, vec, 3))) RETURN(false); |
|
7183 |
SETWIN(aGLXWindowId) |
|
7184 |
v3d(c_v); |
|
7185 |
RETURN (true); |
|
7186 |
%} |
|
7187 |
. |
|
7188 |
^ false |
|
7189 |
! |
|
7190 |
||
7191 |
glxV3f:v in:aGLXWindowId |
|
7192 |
"pass a vertex; v must be a 3-element float-vector" |
|
7193 |
||
7194 |
%{ /* NOCONTEXT */ |
|
7195 |
float vec[3], *c_v; |
|
7196 |
||
7197 |
if (! (c_v = getFloatsFromInto(v, vec, 3))) RETURN(false); |
|
7198 |
SETWIN(aGLXWindowId) |
|
7199 |
v3f(c_v); |
|
7200 |
RETURN (true); |
|
7201 |
%} |
|
7202 |
! |
|
7203 |
||
7204 |
glxV3fX:x y:y z:z in: aGLXWindowId |
|
7205 |
"pass a vector from individual x, y and z (float) values" |
|
7206 |
||
7207 |
%{ /* NOCONTEXT */ |
|
7208 |
float vec[3]; |
|
7209 |
||
7210 |
_FLOAT_(x, vec[0]) |
|
7211 |
_FLOAT_(y, vec[1]) |
|
7212 |
_FLOAT_(z, vec[2]) |
|
7213 |
SETWIN(aGLXWindowId) |
|
7214 |
v3f(vec); |
|
7215 |
RETURN (true); |
|
7216 |
%} |
|
7217 |
! |
|
7218 |
||
7219 |
glxV3i:v in:aGLXWindowId |
|
7220 |
"pass a vertex; v must be a vector with 3 longs" |
|
7221 |
||
7222 |
%{ /* NOCONTEXT */ |
|
7223 |
long vec[3], *c_v; |
|
7224 |
||
7225 |
if (! (c_v = getLongsFromInto(v, vec, 3))) RETURN(false); |
|
7226 |
SETWIN(aGLXWindowId) |
|
7227 |
v3i(c_v); |
|
7228 |
RETURN (true); |
|
7229 |
%} |
|
7230 |
! |
|
7231 |
||
7232 |
glxV3s:v in:aGLXWindowId |
|
7233 |
"pass a vertex; v must be a vector with 3 shorts" |
|
7234 |
||
7235 |
%{ /* NOCONTEXT */ |
|
7236 |
short vec[3], *c_v; |
|
7237 |
||
7238 |
if (! (c_v = getShortsFromInto(v, vec, 3))) RETURN(false); |
|
7239 |
SETWIN(aGLXWindowId) |
|
7240 |
v3s(c_v); |
|
7241 |
RETURN (true); |
|
7242 |
%} |
|
7243 |
! |
|
7244 |
||
7245 |
glxV4d:v in:aGLXWindowId |
|
7246 |
"pass a vertex; v must be a 4-element double-vector, |
|
7247 |
containing x, y, z and w" |
|
7248 |
||
7249 |
%{ /* NOCONTEXT */ |
|
7250 |
double vec[4], *c_v; |
|
7251 |
||
7252 |
if (! (c_v = getDoublesFromInto(v, vec, 4))) RETURN(false); |
|
7253 |
SETWIN(aGLXWindowId) |
|
7254 |
v4d(c_v); |
|
7255 |
RETURN (true); |
|
7256 |
%} |
|
7257 |
! |
|
7258 |
||
7259 |
glxV4f:v in:aGLXWindowId |
|
7260 |
"pass a vertex; v must be a 4-element float-vector, |
|
7261 |
containing x, y, z and w" |
|
7262 |
||
7263 |
%{ /* NOCONTEXT */ |
|
7264 |
float vec[4], *c_v; |
|
7265 |
||
7266 |
if (! (c_v = getFloatsFromInto(v, vec, 4))) RETURN(false); |
|
7267 |
SETWIN(aGLXWindowId) |
|
7268 |
v4f(c_v); |
|
7269 |
RETURN (true); |
|
7270 |
%} |
|
7271 |
! |
|
7272 |
||
7273 |
glxV4i:v in:aGLXWindowId |
|
7274 |
"pass a vertex; v must be a 4-element int-vector, |
|
7275 |
containing x, y, z and w" |
|
7276 |
||
7277 |
%{ /* NOCONTEXT */ |
|
7278 |
long vec[4], *c_v; |
|
7279 |
||
7280 |
if (! (c_v = getLongsFromInto(v, vec, 4))) RETURN(false); |
|
7281 |
SETWIN(aGLXWindowId) |
|
7282 |
v4i(c_v); |
|
7283 |
RETURN (true); |
|
7284 |
%} |
|
7285 |
! |
|
7286 |
||
7287 |
glxV4s:v in:aGLXWindowId |
|
7288 |
"pass a vertex; v must be a 4-element short-vector, |
|
7289 |
containing x, y, z and w" |
|
7290 |
||
7291 |
%{ /* NOCONTEXT */ |
|
7292 |
short vec[4], *c_v; |
|
7293 |
||
7294 |
if (! (c_v = getShortsFromInto(v, vec, 4))) RETURN(false); |
|
7295 |
SETWIN(aGLXWindowId) |
|
7296 |
v4s(c_v); |
|
7297 |
RETURN (true); |
|
7298 |
%} |
|
7299 |
! |
|
7300 |
||
7301 |
glxVOriginIn:aGLXWindowId |
|
7302 |
"pass a 0.0/0.0/0.0 vector. |
|
7303 |
This is the same as v3f:#(0.0 0.0 0.0), but, since its so |
|
7304 |
common, this somewhat faster method has been provided" |
|
7305 |
||
7306 |
%{ /* NOCONTEXT */ |
|
7307 |
static float vec[3] = {0.0, 0.0, 0.0}; |
|
7308 |
||
7309 |
SETWIN(aGLXWindowId) |
|
7310 |
v3f(vec); |
|
7311 |
RETURN (true); |
|
7312 |
%} |
|
7313 |
! |
|
7314 |
||
7315 |
glxVUnitXIn:aGLXWindowId |
|
7316 |
"pass a 1.0/0.0/0.0 vector. |
|
7317 |
This is the same as v3f:#(1.0 0.0 0.0), but, since its so |
|
7318 |
common, this somewhat faster method has been provided" |
|
7319 |
||
7320 |
%{ /* NOCONTEXT */ |
|
7321 |
static float vec[3] = {1.0, 0.0, 0.0}; |
|
7322 |
||
7323 |
SETWIN(aGLXWindowId) |
|
7324 |
v3f(vec); |
|
7325 |
RETURN (true); |
|
7326 |
%} |
|
7327 |
! |
|
7328 |
||
7329 |
glxVUnitYIn:aGLXWindowId |
|
7330 |
"pass a 0.0/1.0/0.0 vector. |
|
7331 |
This is the same as v3f:#(0.0 1.0 0.0), but, since its so |
|
7332 |
common, this somewhat faster method has been provided" |
|
7333 |
||
7334 |
%{ /* NOCONTEXT */ |
|
7335 |
static float vec[3] = {0.0, 1.0, 0.0}; |
|
7336 |
||
7337 |
SETWIN(aGLXWindowId) |
|
7338 |
v3f(vec); |
|
7339 |
RETURN (true); |
|
7340 |
%} |
|
7341 |
! |
|
7342 |
||
7343 |
glxVUnitZIn:aGLXWindowId |
|
7344 |
"pass a 0.0/0.0/1.0 vector. |
|
7345 |
This is the same as v3f:#(0.0 0.0 1.0), but, since its so |
|
7346 |
common, this somewhat faster method has been provided" |
|
7347 |
||
7348 |
%{ /* NOCONTEXT */ |
|
7349 |
static float vec[3] = {0.0, 0.0, 1.0}; |
|
7350 |
||
7351 |
SETWIN(aGLXWindowId) |
|
7352 |
v3f(vec); |
|
7353 |
RETURN (true); |
|
7354 |
%} |
|
7355 |
! ! |
|
7356 |
||
7357 |
!GLXWorkstation methodsFor:'video and planes'! |
|
7358 |
||
7359 |
glxOverlayPlanes: planes in: aGLXWindowId |
|
7360 |
||
7361 |
%{ /* NOCONTEXT */ |
|
7362 |
#ifdef GLX |
|
7363 |
SETWIN(aGLXWindowId) |
|
7364 |
overlay(_longVal(planes)); |
|
7365 |
RETURN (true); |
|
7366 |
#endif |
|
7367 |
%} |
|
7368 |
. |
|
7369 |
^ false |
|
7370 |
! |
|
7371 |
||
7372 |
glxStereobufferIn: aGLXWindowId |
|
7373 |
||
7374 |
%{ /* NOCONTEXT */ |
|
7375 |
#ifdef FULL_GLX |
|
7376 |
SETWIN(aGLXWindowId) |
|
7377 |
stereobuffer(); |
|
7378 |
RETURN (true); |
|
7379 |
#endif |
|
7380 |
%} |
|
7381 |
. |
|
7382 |
^ false |
|
7383 |
! |
|
7384 |
||
7385 |
glxUnderlay: planes in: aGLXWindowId |
|
7386 |
||
7387 |
%{ /* NOCONTEXT */ |
|
7388 |
#ifdef GLX |
|
7389 |
SETWIN(aGLXWindowId) |
|
7390 |
underlay(_longVal(planes)); |
|
7391 |
RETURN (true); |
|
7392 |
#endif |
|
7393 |
%} |
|
7394 |
. |
|
7395 |
^ false |
|
7396 |
! |
|
7397 |
||
7398 |
glxVideocmd:cmd in:aGLXWindowId |
|
7399 |
||
7400 |
%{ /* NOCONTEXT */ |
|
7401 |
#ifdef GLX |
|
7402 |
SETWIN(aGLXWindowId) |
|
7403 |
videocmd(_longVal(cmd)); |
|
7404 |
RETURN (true); |
|
7405 |
#endif |
|
7406 |
%} |
|
7407 |
. |
|
7408 |
^ false |
|
7409 |
! ! |
|
7410 |
||
7411 |
!GLXWorkstation methodsFor:'viewing'! |
|
7412 |
||
7413 |
glxLookatVx:vx vy:vy vz:vz px:px py:py pz:pz twist:twist in:aGLXWindowId |
|
7414 |
"define viewing transformation" |
|
7415 |
||
7416 |
%{ /* NOCONTEXT */ |
|
7417 |
||
7418 |
Coord f_vx, f_vy, f_vz, f_px, f_py, f_pz; |
|
7419 |
Angle a_twist; |
|
7420 |
||
7421 |
_COORD_ (vx, f_vx) |
|
7422 |
_COORD_ (vy, f_vy) |
|
7423 |
_COORD_ (vz, f_vz) |
|
7424 |
_COORD_ (px, f_px) |
|
7425 |
_COORD_ (py, f_py) |
|
7426 |
_COORD_ (pz, f_pz) |
|
7427 |
_ANGLE_ (twist, a_twist) |
|
7428 |
SETWIN(aGLXWindowId) |
|
7429 |
lookat(f_vx, f_vy, f_vz, f_px, f_py, f_pz, a_twist); |
|
7430 |
RETURN (true); |
|
7431 |
%} |
|
7432 |
! |
|
7433 |
||
7434 |
glxOrtho2Left: left right: right bottom: bottom top: top in: aGLXWindowId |
|
7435 |
"define 2D orthogonal projection" |
|
7436 |
||
7437 |
%{ /* NOCONTEXT */ |
|
7438 |
float f_left, f_right, f_top, f_bottom; |
|
7439 |
||
7440 |
SETWIN(aGLXWindowId) |
|
7441 |
_FLOAT_(left, f_left) |
|
7442 |
_FLOAT_(right, f_right) |
|
7443 |
_FLOAT_(bottom, f_bottom) |
|
7444 |
_FLOAT_(top, f_top) |
|
7445 |
ortho2(f_left, f_right, f_bottom, f_top); |
|
7446 |
%} |
|
7447 |
. |
|
7448 |
^ true |
|
7449 |
! |
|
7450 |
||
7451 |
glxOrthoLeft: left right: right bottom: bottom top: top near: near far: far in: aGLXWindowId |
|
7452 |
"define orthogonal projection" |
|
7453 |
||
7454 |
%{ /* NOCONTEXT */ |
|
7455 |
float f_left, f_right, f_bottom, f_top, |
|
7456 |
f_near, f_far; |
|
7457 |
||
7458 |
_FLOAT_(left, f_left) |
|
7459 |
_FLOAT_(right, f_right) |
|
7460 |
_FLOAT_(bottom, f_bottom) |
|
7461 |
_FLOAT_(top, f_top) |
|
7462 |
_FLOAT_(near, f_near) |
|
7463 |
_FLOAT_(far, f_far) |
|
7464 |
SETWIN(aGLXWindowId) |
|
7465 |
ortho(f_left, f_right, f_bottom, f_top, f_near, f_far); |
|
7466 |
RETURN (true); |
|
7467 |
%} |
|
7468 |
! |
|
7469 |
||
7470 |
glxPerspectiveFovy:fovy aspect:aspect near:near far:far in:aGLXWindowId |
|
7471 |
"define perspective projection" |
|
7472 |
||
7473 |
%{ /* NOCONTEXT */ |
|
7474 |
||
7475 |
Angle a_fovy; |
|
7476 |
Coord c_near, c_far; |
|
7477 |
float f_aspect; |
|
7478 |
||
7479 |
_ANGLE_ (fovy, a_fovy) |
|
7480 |
_FLOAT_ (aspect, f_aspect) |
|
7481 |
_COORD_ (near, c_near) |
|
7482 |
_COORD_ (far, c_far) |
|
7483 |
||
7484 |
SETWIN(aGLXWindowId) |
|
7485 |
perspective(a_fovy, f_aspect, c_near, c_far); |
|
7486 |
||
7487 |
RETURN (true); |
|
7488 |
%} |
|
7489 |
! |
|
7490 |
||
7491 |
glxPolarviewDist: dist azim: azim inc: inc twist: twist in: aGLXWindowId |
|
7492 |
||
7493 |
%{ /* NOCONTEXT */ |
|
7494 |
Coord c_dist; |
|
7495 |
Angle a_azim, a_inc, a_twist; |
|
7496 |
||
7497 |
_COORD_(dist, c_dist) |
|
7498 |
_ANGLE_(azim, a_azim) |
|
7499 |
_ANGLE_(inc, a_inc) |
|
7500 |
_ANGLE_(twist, a_twist) |
|
7501 |
SETWIN(aGLXWindowId) |
|
7502 |
polarview(c_dist, a_azim, a_inc, a_twist); |
|
7503 |
RETURN (true); |
|
7504 |
%} |
|
7505 |
! |
|
7506 |
||
7507 |
glxReshapeViewPortIn: aGLXWindowId |
|
7508 |
||
7509 |
%{ /* NOCONTEXT */ |
|
7510 |
SETWIN(aGLXWindowId) |
|
7511 |
reshapeviewport(); |
|
7512 |
%} |
|
7513 |
. |
|
7514 |
^ true |
|
7515 |
! |
|
7516 |
||
7517 |
glxViewportLeft:left right:right bottom:bottom top:top in:aGLXWindowId |
|
7518 |
||
7519 |
%{ /* NOCONTEXT */ |
|
7520 |
SETWIN(aGLXWindowId) |
|
7521 |
viewport(_screencoordVal(left), _screencoordVal(right), |
|
7522 |
_screencoordVal(bottom), _screencoordVal(top)); |
|
7523 |
RETURN (true); |
|
7524 |
%} |
|
7525 |
! |
|
7526 |
||
7527 |
glxWindowLeft: left right: right bottom: bottom top: top near: near far: far in: aGLXWindowId |
|
7528 |
"this one was added independently by JEFF - kept for his programs ..." |
|
7529 |
||
7530 |
self glxWindowLeft:left right:right top:top bottom:bottom near:near far:far in:aGLXWindowId |
|
7531 |
! |
|
7532 |
||
7533 |
glxWindowLeft:left right:right top:top bottom:bottom near:near far:far in:aGLXWindowId |
|
7534 |
"define perspective viewing pyramid" |
|
7535 |
||
7536 |
%{ /* NOCONTEXT */ |
|
7537 |
Coord c_left, c_right, c_top, c_bot, c_near, c_far; |
|
7538 |
||
7539 |
_COORD_ (left, c_left) |
|
7540 |
_COORD_ (right, c_right) |
|
7541 |
_COORD_ (top, c_top) |
|
7542 |
_COORD_ (bottom, c_bot) |
|
7543 |
_COORD_ (near, c_near) |
|
7544 |
_COORD_ (far, c_far) |
|
7545 |
SETWIN(aGLXWindowId) |
|
7546 |
window(c_left, c_right, c_bot, c_top, c_near, c_far); |
|
7547 |
||
7548 |
RETURN (true); |
|
7549 |
%} |
|
7550 |
! ! |
|
7551 |
||
7552 |
!GLXWorkstation methodsFor:'window control'! |
|
7553 |
||
7554 |
glxWinclose:gwid in:aGLXWindowId |
|
7555 |
||
7556 |
%{ /* NOCONTEXT */ |
|
7557 |
#ifdef GLX |
|
7558 |
SETWIN(aGLXWindowId) |
|
7559 |
winclose(_longVal(gwid)); |
|
7560 |
RETURN (true); |
|
7561 |
#endif |
|
7562 |
%} |
|
7563 |
. |
|
7564 |
^ false |
|
7565 |
! |
|
7566 |
||
7567 |
glxWinconstraintsIn: aGLXWindowId |
|
7568 |
||
7569 |
%{ /* NOCONTEXT */ |
|
7570 |
#ifdef GLX |
|
7571 |
SETWIN(aGLXWindowId) |
|
7572 |
winconstraints(); |
|
7573 |
RETURN (true); |
|
7574 |
#endif |
|
7575 |
%} |
|
7576 |
. |
|
7577 |
^ false |
|
7578 |
! |
|
7579 |
||
7580 |
glxWindepth: gwid in: aGLXWindowId |
|
7581 |
||
7582 |
%{ /* NOCONTEXT */ |
|
7583 |
#ifdef GLX |
|
7584 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7585 |
RETURN (__MKSMALLINT(windepth(_longVal(gwid)))); |
294 | 7586 |
#endif |
7587 |
%} |
|
7588 |
. |
|
7589 |
^ false |
|
7590 |
! |
|
7591 |
||
7592 |
glxWingetIn: aGLXWindowId |
|
7593 |
||
7594 |
%{ /* NOCONTEXT */ |
|
7595 |
#ifdef GLX |
|
7596 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7597 |
RETURN (__MKSMALLINT(winget())); |
294 | 7598 |
#endif |
7599 |
%} |
|
7600 |
. |
|
7601 |
^ false |
|
7602 |
! |
|
7603 |
||
7604 |
glxWinmoveX: x y: y in: aGLXWindowId |
|
7605 |
||
7606 |
%{ /* NOCONTEXT */ |
|
7607 |
#ifdef GLX |
|
7608 |
SETWIN(aGLXWindowId) |
|
7609 |
winmove(_longVal(x), _longVal(y)); |
|
7610 |
RETURN (true); |
|
7611 |
#endif |
|
7612 |
%} |
|
7613 |
. |
|
7614 |
^ false |
|
7615 |
! |
|
7616 |
||
7617 |
glxWinpopIn: aGLXWindowId |
|
7618 |
||
7619 |
%{ /* NOCONTEXT */ |
|
7620 |
#ifdef GLX |
|
7621 |
SETWIN(aGLXWindowId) |
|
7622 |
winpop(); |
|
7623 |
RETURN (true); |
|
7624 |
#endif |
|
7625 |
%} |
|
7626 |
. |
|
7627 |
^ false |
|
7628 |
! |
|
7629 |
||
7630 |
glxWinpositionX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7631 |
||
7632 |
%{ /* NOCONTEXT */ |
|
7633 |
#ifdef GLX |
|
7634 |
SETWIN(aGLXWindowId) |
|
7635 |
winposition(_longVal(x1), _longVal(y1), _longVal(x2), _longVal(y2)); |
|
7636 |
RETURN (true); |
|
7637 |
#endif |
|
7638 |
%} |
|
7639 |
. |
|
7640 |
^ false |
|
7641 |
! |
|
7642 |
||
7643 |
glxWinpushIn: aGLXWindowId |
|
7644 |
||
7645 |
%{ /* NOCONTEXT */ |
|
7646 |
#ifdef GLX |
|
7647 |
SETWIN(aGLXWindowId) |
|
7648 |
winpush(); |
|
7649 |
RETURN (true); |
|
7650 |
#endif |
|
7651 |
%} |
|
7652 |
. |
|
7653 |
^ false |
|
7654 |
! |
|
7655 |
||
7656 |
glxWinset: gwid in: aGLXWindowId |
|
7657 |
||
7658 |
%{ /* NOCONTEXT */ |
|
7659 |
#ifdef GLX |
|
7660 |
SETWIN(aGLXWindowId) |
|
7661 |
winset(_longVal(gwid)); |
|
7662 |
RETURN (true); |
|
7663 |
#endif |
|
7664 |
%} |
|
7665 |
. |
|
7666 |
^ false |
|
7667 |
! ! |
|
7668 |
||
0 | 7669 |
!GLXWorkstation methodsFor:'window creation'! |
7670 |
||
12 | 7671 |
createGLXWindowFor:aView left:xpos top:ypos width:wwidth height:wheight type:glxType |
157 | 7672 |
|ext wsuperView wsuperViewId windowId| |
0 | 7673 |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
7674 |
glOK ifFalse:[^ nil]. |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
7675 |
|
0 | 7676 |
wsuperView := aView superView. |
7677 |
wsuperView notNil ifTrue:[ |
|
77 | 7678 |
wsuperViewId := wsuperView id |
0 | 7679 |
]. |
7680 |
||
524 | 7681 |
%{ /* CALLSSTACK: 20000 */ |
0 | 7682 |
Display *dpy = myDpy; |
185 | 7683 |
int screen = __intVal(_INST(screen)); |
0 | 7684 |
Window newWindow, parentWindow; |
7685 |
extern Window GLXCreateWindow(); |
|
12 | 7686 |
int t; |
0 | 7687 |
|
97 | 7688 |
if (__isSmallInteger(xpos) && __isSmallInteger(ypos) |
7689 |
&& __isSmallInteger(wwidth) && __isSmallInteger(wheight)) { |
|
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
7690 |
if (__isExternalAddress(wsuperViewId)) { |
207
9124817bbb03
use new c-pointer wrapper macros (based on externalAddress)
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
7691 |
parentWindow = _WindowVal(wsuperViewId); |
77 | 7692 |
} else { |
7693 |
parentWindow = RootWindow(dpy, screen); |
|
7694 |
} |
|
7695 |
||
7696 |
if (glxType == @symbol(colorIndexSingleBuffer)) |
|
7697 |
t = GLXcolorIndexSingleBuffer; |
|
7698 |
else if (glxType == @symbol(colorIndexDoubleBuffer)) |
|
7699 |
t = GLXcolorIndexDoubleBuffer; |
|
7700 |
else if (glxType == @symbol(rgbSingleBuffer)) |
|
7701 |
t = GLXrgbSingleBuffer; |
|
7702 |
else if (glxType == @symbol(rgbDoubleBuffer)) |
|
7703 |
t = GLXrgbDoubleBuffer; |
|
7704 |
else { |
|
7705 |
RETURN ( nil ); |
|
7706 |
} |
|
7707 |
||
134 | 7708 |
ENTERGLX; |
77 | 7709 |
newWindow = GLXCreateWindow(dpy, parentWindow, |
185 | 7710 |
__intVal(xpos), __intVal(ypos), |
7711 |
__intVal(wwidth), __intVal(wheight), |
|
77 | 7712 |
0, t); |
134 | 7713 |
LEAVEGLX; |
77 | 7714 |
|
7715 |
if (! newWindow) { |
|
7716 |
RETURN ( nil ); |
|
7717 |
} |
|
7718 |
||
207
9124817bbb03
use new c-pointer wrapper macros (based on externalAddress)
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
7719 |
windowId = __MKOBJ(newWindow); |
0 | 7720 |
} |
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
7721 |
%}. |
0 | 7722 |
windowId notNil ifTrue:[ |
77 | 7723 |
self addKnownView:aView withId:windowId. |
0 | 7724 |
]. |
7725 |
^ windowId |
|
20 | 7726 |
! |
7727 |
||
7728 |
unlinkGLXView:aGLXWindowId |
|
7729 |
"remove X/GLX link" |
|
524 | 7730 |
|
7731 |
%{ /* CALLSSTACK: 20000 */ |
|
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
7732 |
if (__isExternalAddress(aGLXWindowId)) { |
134 | 7733 |
ENTERGLX; |
207
9124817bbb03
use new c-pointer wrapper macros (based on externalAddress)
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
7734 |
GLXUnlinkWindow(myDpy, _WindowVal(aGLXWindowId)); |
134 | 7735 |
LEAVEGLX; |
7736 |
} |
|
20 | 7737 |
%} |
0 | 7738 |
! ! |
7739 |
||
294 | 7740 |
!GLXWorkstation methodsFor:'zbuffer'! |
7741 |
||
7742 |
glxZbsize: planes in: aGLXWindowId |
|
127 | 7743 |
|
7744 |
%{ /* NOCONTEXT */ |
|
7745 |
#ifdef FULL_GLX |
|
7746 |
SETWIN(aGLXWindowId) |
|
294 | 7747 |
zbsize(_longVal(planes)); |
7748 |
RETURN (true); |
|
7749 |
#endif |
|
7750 |
%} |
|
7751 |
. |
|
7752 |
^ false |
|
7753 |
! |
|
64 | 7754 |
|
7755 |
glxZbuffer:aBoolean in:aGLXWindowId |
|
7756 |
"enable/disable z-buffer operation" |
|
7757 |
||
7758 |
%{ /* NOCONTEXT */ |
|
7759 |
#ifdef GLX |
|
7760 |
SETWIN(aGLXWindowId) |
|
7761 |
zbuffer(aBoolean == false ? FALSE : TRUE); |
|
7762 |
RETURN (true); |
|
7763 |
#endif |
|
7764 |
%} |
|
7765 |
. |
|
7766 |
^ false |
|
294 | 7767 |
! |
64 | 7768 |
|
7769 |
glxZdraw: b in: aGLXWindowId |
|
7770 |
"enable/disable drawing into the z-buffer" |
|
7771 |
||
7772 |
%{ /* NOCONTEXT */ |
|
7773 |
#ifdef GLX |
|
7774 |
SETWIN(aGLXWindowId) |
|
7775 |
zdraw(_booleanVal(b)); |
|
7776 |
RETURN (true); |
|
7777 |
#endif |
|
7778 |
%} |
|
7779 |
. |
|
7780 |
^ false |
|
294 | 7781 |
! |
64 | 7782 |
|
7783 |
glxZfunction: func in: aGLXWindowId |
|
7784 |
"set the z-buffer comparison function. |
|
7785 |
func may be either the numeric value or a symbol (preferred)" |
|
7786 |
||
7787 |
%{ /* NOCONTEXT */ |
|
7788 |
#ifdef GLX |
|
7789 |
long f; |
|
7790 |
||
7791 |
SETWIN(aGLXWindowId) |
|
7792 |
if (func == @symbol(NEVER)) |
|
77 | 7793 |
f = ZF_NEVER; |
64 | 7794 |
else if (func == @symbol(LESS)) |
77 | 7795 |
f = ZF_LESS; |
64 | 7796 |
else if (func == @symbol(EQUAL)) |
77 | 7797 |
f = ZF_EQUAL; |
64 | 7798 |
else if (func == @symbol(LEQUAL)) |
77 | 7799 |
f = ZF_LEQUAL; |
64 | 7800 |
else if (func == @symbol(GREATER)) |
77 | 7801 |
f = ZF_GREATER; |
64 | 7802 |
else if (func == @symbol(NOTEQUAL)) |
77 | 7803 |
f = ZF_NOTEQUAL; |
64 | 7804 |
else if (func == @symbol(GEQUAL)) |
77 | 7805 |
f = ZF_GEQUAL; |
64 | 7806 |
else if (func == @symbol(ALWAYS)) |
77 | 7807 |
f = ZF_ALWAYS; |
64 | 7808 |
else |
77 | 7809 |
f = _longVal(func); |
64 | 7810 |
zfunction(f); |
7811 |
RETURN (true); |
|
7812 |
#endif |
|
7813 |
%} |
|
7814 |
. |
|
7815 |
^ false |
|
294 | 7816 |
! |
64 | 7817 |
|
7818 |
glxZsource: src in: aGLXWindowId |
|
7819 |
||
7820 |
%{ /* NOCONTEXT */ |
|
7821 |
#ifdef GLX |
|
7822 |
SETWIN(aGLXWindowId) |
|
7823 |
zsource(_longVal(src)); |
|
7824 |
RETURN (true); |
|
7825 |
#endif |
|
7826 |
%} |
|
7827 |
. |
|
7828 |
^ false |
|
294 | 7829 |
! |
64 | 7830 |
|
7831 |
glxZwritemask: mask in: aGLXWindowId |
|
7832 |
||
7833 |
%{ /* NOCONTEXT */ |
|
7834 |
#ifdef GLX |
|
7835 |
SETWIN(aGLXWindowId) |
|
185 | 7836 |
zwritemask((ulong)__intVal(mask)); |
64 | 7837 |
RETURN (true); |
7838 |
#endif |
|
7839 |
%} |
|
7840 |
. |
|
7841 |
^ false |
|
7842 |
! ! |
|
7843 |
||
294 | 7844 |
!GLXWorkstation class methodsFor:'documentation'! |
7845 |
||
7846 |
version |
|
524 | 7847 |
^ '$Header: /cvs/stx/stx/libview/GLXWorkstation.st,v 1.46 1996-03-08 17:11:10 cg Exp $' |
89 | 7848 |
! ! |