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