author | Stefan Vogel <sv@exept.de> |
Thu, 05 Nov 2009 15:37:38 +0100 | |
changeset 5479 | ae6b3ac21920 |
parent 4718 | 11e89d5330e7 |
child 6002 | 3773c70bed6a |
permissions | -rw-r--r-- |
0 | 1 |
" |
614 | 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 |
" |
|
3214 | 12 |
"{ Package: 'stx:libview' }" |
13 |
||
0 | 14 |
XWorkstation subclass:#GLXWorkstation |
528 | 15 |
instanceVariableNames:'activeWindow hasStereoExtension glOK' |
16 |
classVariableNames:'ForceGL' |
|
17 |
poolDictionaries:'' |
|
18 |
category:'Interface-Graphics' |
|
294 | 19 |
! |
77 | 20 |
|
89 | 21 |
!GLXWorkstation primitiveDefinitions! |
0 | 22 |
%{ |
24 | 23 |
/* |
24 |
* on SGI, this class is compiled with -DGLX, while |
|
29 | 25 |
* for simulation (using vogl), this is compiled with -DVGL |
4718 | 26 |
* |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
27 |
* New note: starting to support openGL (tm) (compile with -DOPENGL) |
1932 | 28 |
* or its simulation (compile with -DMESA) |
24 | 29 |
*/ |
29 | 30 |
|
0 | 31 |
/* |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
32 |
* SAD, SAD: |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
33 |
* on SGI, the GL library seems to come in different versions, |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
34 |
* some include the functions below, others dont. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
35 |
* To avoid getting undefined symbol errors when linking, these |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
36 |
* functions are not included by default. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
37 |
* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
38 |
* enable the #define below (or compile with -DFULL_GLX) to enable |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
39 |
* the following: |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
40 |
* |
46 | 41 |
* blendcolor getgconfig getmultisample leftbuffer rightbuffer monobuffer |
42 |
* msalpha msmask mspattern mssize multisample stereobuffer |
|
43 |
* t3s t3i t3f t3d t4s t4i t4f t4d tlutbind zbsize |
|
44 |
* |
|
45 |
* these are not available on all gl's |
|
46 |
*/ |
|
47 |
||
1932 | 48 |
#ifdef GLX |
46 | 49 |
/* #define FULL_GLX */ |
1932 | 50 |
#endif |
46 | 51 |
|
52 |
/* |
|
554
34cc776bcc0f
compilable with String/Object definition
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
53 |
* this is stupid, GLX type-defs String, which is also defined here ... |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
54 |
* ... and xlib defines True and False |
554
34cc776bcc0f
compilable with String/Object definition
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
55 |
* It might be a better idea, to completely separate GLX stuff from ST/X |
0 | 56 |
*/ |
1899 | 57 |
#ifdef String |
58 |
# undef String |
|
59 |
#endif |
|
60 |
#define String GLX_String |
|
61 |
||
62 |
#ifdef Object |
|
63 |
# undef Object |
|
64 |
#endif |
|
65 |
#define Object GLX_Object |
|
66 |
||
67 |
#undef True |
|
68 |
#undef False |
|
69 |
||
2768 | 70 |
#ifdef Time |
71 |
# undef Time |
|
72 |
#endif |
|
73 |
#define Time X_Time |
|
74 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
75 |
|
1899 | 76 |
#ifdef __VMS__ |
77 |
# include "vms_Xnames.h" |
|
78 |
#endif |
|
24 | 79 |
|
168 | 80 |
#include <stdio.h> |
81 |
||
1932 | 82 |
#ifndef OPENGL |
83 |
# ifdef MESA |
|
84 |
# define OPENGL |
|
85 |
# endif |
|
86 |
#endif |
|
87 |
||
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
88 |
#ifdef OPENGL /* SGI or others OPENGL library */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
89 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
90 |
# include "GL/gl.h" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
91 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
92 |
# ifdef MESA /* GNU MESA openGL simulation */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
93 |
# include "GL/xmesa.h" |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
94 |
# define OPENGLCONTEXT XMesaContext |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
95 |
# define GLXMAKECURRENT(dpy, draw, con) XMesaMakeCurrent(con) |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
96 |
# else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
97 |
/* not yet known what else to include */ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
98 |
# define OPENGLCONTEXT GLXContext |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
99 |
# define GLXMAKECURRENT(dpy, draw, con) glxMakeCurrent(dpy, draw, con) |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
100 |
# endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
101 |
|
24 | 102 |
#else |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
103 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
104 |
# ifdef GLX /* SGI's GL library */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
105 |
# include <gl/glws.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
106 |
# include <gl/sphere.h> |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
107 |
# else /* VOGL GL simulation */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
108 |
# undef memset |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
109 |
# include <vogl.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
110 |
# undef move |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
111 |
# include <X11/Xlib.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
112 |
# endif |
24 | 113 |
#endif |
0 | 114 |
|
185 | 115 |
/* |
116 |
* XSGIStereo extension - if available |
|
117 |
*/ |
|
118 |
#ifdef XSGIStereo |
|
119 |
# include <X11/extensions/SGIStereo.h> |
|
120 |
#endif |
|
121 |
||
35 | 122 |
#ifndef NULL |
58 | 123 |
# define NULL (char *)0 /* sigh */ |
35 | 124 |
#endif |
125 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
126 |
|
0 | 127 |
typedef enum { |
128 |
GLXcolorIndexSingleBuffer, |
|
129 |
GLXcolorIndexDoubleBuffer, |
|
130 |
GLXrgbSingleBuffer, |
|
131 |
GLXrgbDoubleBuffer |
|
132 |
} GLXWindowType; |
|
133 |
||
333 | 134 |
# define ENTERGLX __BEGIN_PROTECT_REGISTERS__ |
135 |
# define LEAVEGLX __END_PROTECT_REGISTERS__ |
|
134 | 136 |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
137 |
/* |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
138 |
* stupid again - from now on, we need ST/X's String again |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
139 |
*/ |
0 | 140 |
#undef String |
969 | 141 |
#ifdef __DEF_String |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
142 |
# define String __DEF_String |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
143 |
#endif |
969 | 144 |
#undef Object |
145 |
#ifdef __DEF_Object |
|
146 |
# define Object __DEF_Object |
|
147 |
#endif |
|
0 | 148 |
|
149 |
/* |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
150 |
* mhmh - openGL has its separate gl-context, |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
151 |
* which is distinct (?) from the windowID. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
152 |
* We dont want to add another instvar to View - do we ? |
0 | 153 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
154 |
#if defined(OPENGL) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
155 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
156 |
# ifndef MAX_OPENGL_VIEWS |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
157 |
# define MAX_OPENGL_VIEWS 50 |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
158 |
# endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
159 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
160 |
struct windowIDToGLContextMapping { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
161 |
Window win; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
162 |
OPENGLCONTEXT con; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
163 |
}; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
164 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
165 |
static struct windowIDToGLContextMapping windowIDToGLContextMapping[MAX_OPENGL_VIEWS]; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
166 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
167 |
static OPENGLCONTEXT |
4718 | 168 |
__glxWindowIdToGLContext(xId) |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
169 |
Window xId; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
170 |
{ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
171 |
int i; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
172 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
173 |
for (i=0; i<MAX_OPENGL_VIEWS; i++) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
174 |
if (windowIDToGLContextMapping[i].win == xId) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
175 |
return windowIDToGLContextMapping[i].con; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
176 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
177 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
178 |
return (OPENGLCONTEXT) 0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
179 |
} |
0 | 180 |
|
157 | 181 |
/* |
182 |
* set the GLXWindow for followup drawing |
|
183 |
*/ |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
184 |
#define SETWIN(aGLXWindowId) \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
185 |
{ \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
186 |
OPENGLCONTEXT context; \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
187 |
\ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
188 |
if (_INST(activeWindow) != aGLXWindowId) { \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
189 |
if (! ISCONNECTED ) { \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
190 |
RETURN (false); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
191 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
192 |
if (! __isExternalAddress(aGLXWindowId)) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
193 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
194 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
195 |
context = (OPENGLCONTEXT) __glxWindowIdToGLContext(_WindowVal(aGLXWindowId)); \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
196 |
if (! context) { \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
197 |
RETURN (false); \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
198 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
199 |
GLXMAKECURRENT(myDpy, _WindowVal(aGLXWindowId), context ); \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
200 |
_INST(activeWindow) = aGLXWindowId; \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
201 |
__STORE(self, aGLXWindowId); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
202 |
} else { \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
203 |
if (aGLXWindowId == nil) { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
204 |
RETURN (false); \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
205 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
206 |
} \ |
12 | 207 |
} |
208 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
209 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
210 |
#else /* old GL */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
211 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
212 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
213 |
* set the GLXWindow for followup drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
214 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
215 |
#define SETWIN(aGLXWindowId) \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
216 |
{ \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
217 |
if (_INST(activeWindow) != aGLXWindowId) { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
218 |
if (! ISCONNECTED ) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
219 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
220 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
221 |
if (! __isExternalAddress(aGLXWindowId)) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
222 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
223 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
224 |
if (GLXwinset(myDpy, _WindowVal(aGLXWindowId)) < 0) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
225 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
226 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
227 |
_INST(activeWindow) = aGLXWindowId; \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
228 |
__STORE(self, aGLXWindowId); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
229 |
} else { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
230 |
if (aGLXWindowId == nil) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
231 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
232 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
233 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
234 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
235 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
236 |
#endif /* old GL */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
237 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
238 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
239 |
* some defines - tired of typing ... |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
240 |
* most of these macros/functions extract values from smalltalk objects or |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
241 |
* put/pack them into corresponding c variables. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
242 |
* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
243 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
244 |
#ifdef OPENGL |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
245 |
# define Boolean int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
246 |
# define TRUE 1 |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
247 |
# define FALSE 0 |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
248 |
# define Coord float |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
249 |
# define Icoord int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
250 |
# define Scoord int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
251 |
# define Colorindex int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
252 |
# define Linestyle int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
253 |
# define Offset int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
254 |
# define Angle int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
255 |
# define Screencoord int |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
256 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
257 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
258 |
#define myDpy (Display *)(__MKCP(_INST(displayId))) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
259 |
#define ISCONNECTED (_INST(displayId) != nil) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
260 |
#define _WindowVal(o) (Window)(__MKCP(o)) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
261 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
262 |
#define __MKBOOLEAN(b) ((b==FALSE) ? false : true) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
263 |
#define _booleanVal(b) ((b==false) ? (Boolean)FALSE : (Boolean)TRUE) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
264 |
#define _coordVal(c) ((__isFloat(c)) ? (Coord)(_floatVal(c)) : (Coord)(__intVal(c))) |
185 | 265 |
#define _icoordVal(c) ((Icoord)(__intVal(c))) |
266 |
#define _scoordVal(c) ((Scoord)(__intVal(c))) |
|
267 |
#define _screencoordVal(c) ((Screencoord)(__intVal(c))) |
|
268 |
#define _colorindexVal(c) ((Colorindex)(__intVal(c))) |
|
269 |
#define _linestyleVal(l) ((Linestyle)(__intVal(l))) |
|
270 |
#define _shortVal(l) ((short)(__intVal(l))) |
|
271 |
#define _longVal(l) ((long)(__intVal(l))) |
|
272 |
#define _deviceVal(l) ((Device)(__intVal(l))) |
|
273 |
#define _tagVal(l) ((Tag)(__intVal(l))) |
|
969 | 274 |
#define _objectVal(l) ((GLX_Object)(__intVal(l))) |
185 | 275 |
#define _offsetVal(l) ((Offset)(__intVal(l))) |
276 |
#define _rgbVal(l) ((RGBvalue)(__intVal(l))) |
|
277 |
#define _angleVal(c) ((Angle)(__intVal(c))) |
|
157 | 278 |
|
29 | 279 |
/* |
280 |
* check for and fetch a boolean from ST-arg into C-dst |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
281 |
* ST-object must be true or false. Return from method if invalid. |
29 | 282 |
*/ |
283 |
#define _BOOLEAN_(arg, dst) \ |
|
30 | 284 |
if (arg==true) \ |
77 | 285 |
dst = (Boolean)TRUE; \ |
30 | 286 |
else if (arg==false) \ |
77 | 287 |
dst = (Boolean)FALSE; \ |
29 | 288 |
else { RETURN(false); } |
289 |
||
290 |
/* |
|
291 |
* check for and fetch a coord from ST-arg into C-dst |
|
157 | 292 |
* ST-object must be Float, SmallInteger or Fraction. |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
293 |
* Return from method if invalid. |
29 | 294 |
*/ |
0 | 295 |
#define _COORD_(arg, dst) \ |
97 | 296 |
if (__isFloat(arg)) \ |
77 | 297 |
dst = (Coord)(_floatVal(arg)); \ |
97 | 298 |
else if (__isSmallInteger(arg)) \ |
185 | 299 |
dst = (Coord)(__intVal(arg)); \ |
97 | 300 |
else if (__isFraction(arg) \ |
301 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_numerator) \ |
|
302 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_denominator)) { \ |
|
77 | 303 |
float n, d; \ |
304 |
\ |
|
185 | 305 |
n = (float)(__intVal(_FractionInstPtr(arg)->f_numerator)); \ |
306 |
d = (float)(__intVal(_FractionInstPtr(arg)->f_denominator)); \ |
|
77 | 307 |
dst = (Coord)(n / d); \ |
29 | 308 |
} else { RETURN(false); } |
309 |
||
310 |
/* |
|
311 |
* check for and fetch an icoord from ST-arg into C-dst |
|
4718 | 312 |
* ST-object must be SmallInteger. Return from method if invalid. |
29 | 313 |
*/ |
314 |
#define _ICOORD_(arg, dst) \ |
|
97 | 315 |
if (__isSmallInteger(arg)) \ |
185 | 316 |
dst = (Icoord)(__intVal(arg)); \ |
29 | 317 |
else { RETURN(false); } |
318 |
||
319 |
/* |
|
157 | 320 |
* check for and fetch an scoord from ST-arg into C-dst |
4718 | 321 |
* ST-object must be SmallInteger. Return from method if invalid. |
29 | 322 |
*/ |
323 |
#define _SCOORD_(arg, dst) \ |
|
97 | 324 |
if (__isSmallInteger(arg)) \ |
185 | 325 |
dst = (Scoord)(__intVal(arg)); \ |
29 | 326 |
else { RETURN(false); } |
327 |
||
328 |
#define _SCREENCOORD_(arg, dst) \ |
|
97 | 329 |
if (__isSmallInteger(arg)) \ |
185 | 330 |
dst = (Screencoord)(__intVal(arg)); \ |
29 | 331 |
else { RETURN(false); } |
332 |
||
333 |
#define _COLORINDEX_(arg, dst) \ |
|
97 | 334 |
if (__isSmallInteger(arg)) \ |
185 | 335 |
dst = (Colorindex)(__intVal(arg)); \ |
29 | 336 |
else { RETURN(false); } |
337 |
||
338 |
#define _ANGLE_(arg, dst) \ |
|
97 | 339 |
if (__isSmallInteger(arg)) \ |
185 | 340 |
dst = (Angle)(__intVal(arg)); \ |
29 | 341 |
else { RETURN(false); } |
0 | 342 |
|
343 |
#define _FLOAT_(arg, dst) \ |
|
97 | 344 |
if (__isFloat(arg)) \ |
77 | 345 |
dst = (float)(_floatVal(arg)); \ |
97 | 346 |
else if (__isSmallInteger(arg)) \ |
185 | 347 |
dst = (float)(__intVal(arg)); \ |
97 | 348 |
else if (__isFraction(arg) \ |
349 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_numerator) \ |
|
350 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_denominator)) { \ |
|
77 | 351 |
float n, d; \ |
352 |
\ |
|
185 | 353 |
n = (float)(__intVal(_FractionInstPtr(arg)->f_numerator)); \ |
354 |
d = (float)(__intVal(_FractionInstPtr(arg)->f_denominator)); \ |
|
77 | 355 |
dst = (float)(n / d); \ |
29 | 356 |
} else { RETURN(false); } |
0 | 357 |
|
358 |
#define _INT_(arg, dst) \ |
|
97 | 359 |
if (__isSmallInteger(arg)) \ |
185 | 360 |
dst = (int)(__intVal(arg)); \ |
29 | 361 |
else { RETURN(false); } |
362 |
||
30 | 363 |
#define _indexedArea(object) \ |
364 |
(((char *) (_InstPtr(object))) \ |
|
77 | 365 |
+ OHDR_SIZE \ |
185 | 366 |
+ (__intVal(_ClassInstPtr(__qClass(object))->c_ninstvars)) * sizeof(OBJ)) |
77 | 367 |
%} |
368 |
! ! |
|
369 |
||
168 | 370 |
!GLXWorkstation primitiveVariables! |
371 |
%{ |
|
372 |
/* |
|
373 |
* remembered info from private error handler |
|
374 |
*/ |
|
4164
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
375 |
static char lastErrorMsg[128] = ""; |
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
376 |
static unsigned INT lastRequestCode = 0; |
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
377 |
static unsigned INT lastMinorCode = 0; |
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
378 |
static unsigned INT lastResource = 0; |
168 | 379 |
|
380 |
%} |
|
381 |
! ! |
|
382 |
||
89 | 383 |
!GLXWorkstation primitiveFunctions! |
77 | 384 |
%{ |
151 | 385 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
386 |
#ifdef DYNAMICALLY_LOADABLE |
168 | 387 |
/* |
388 |
* catch X-errors and forward as errorInterrupt:#DisplayError, |
|
4251 | 389 |
* (which itself invokes my handler and optionally raises an exception) |
168 | 390 |
* the implementation below is somewhat wrong: it will |
391 |
* report all errors for Display, even though there could be |
|
392 |
* more than one display connection. (being fixed, new errorInterrupt mechanism |
|
393 |
* allows passing an additional argument, which is the displayID ...) |
|
394 |
* |
|
4251 | 395 |
* this duplicates the functionality as found in XWorkstation; |
168 | 396 |
* the reason is to allow dynamic loading systems to load this module |
397 |
* before XWorkstation (which was not possible otherwise, due to unresolved |
|
398 |
* external references while loading this one) |
|
399 |
*/ |
|
400 |
static |
|
401 |
__XErrorHandler__(dpy, event) |
|
402 |
Display *dpy; |
|
403 |
XErrorEvent *event; |
|
404 |
{ |
|
405 |
XGetErrorText(dpy, event->error_code, lastErrorMsg, 80); |
|
406 |
if (lastErrorMsg[0] == '\0') { |
|
4718 | 407 |
sprintf(lastErrorMsg, "code: %d", event->error_code); |
168 | 408 |
} |
409 |
lastRequestCode = event->request_code; |
|
410 |
lastMinorCode = event->minor_code; |
|
411 |
lastResource = event->resourceid; |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
412 |
if ((event->error_code == BadWindow) && (lastRequestCode == 4) && (lastMinorCode == 0)) { |
4718 | 413 |
/* |
414 |
* this is a BadWindow error for X_DestroyWindow. |
|
415 |
* ignore it here, since it results from the GC freeing windows |
|
416 |
* in non bottom-up window order. |
|
417 |
*/ |
|
418 |
return 0; |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
419 |
} |
168 | 420 |
|
218
10072d9beba5
can now turn off Xlib error messages from the errorHandler
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
421 |
if (@global(ErrorPrinting) == true) { |
4718 | 422 |
console_fprintf(stderr, "GLXWORKSTAT: x-error caught maj=%d (0x%x) min=%d (0x%x) resource=%x\n", |
423 |
event->request_code, event->request_code, |
|
424 |
event->minor_code, event->minor_code, event->resourceid); |
|
425 |
console_fprintf(stderr, "GLXWORKSTAT: x-error message is [%d] '%s'\n", event->error_code, lastErrorMsg); |
|
218
10072d9beba5
can now turn off Xlib error messages from the errorHandler
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
426 |
} |
168 | 427 |
|
207
9124817bbb03
use new c-pointer wrapper macros (based on externalAddress)
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
428 |
__errorInterruptWithIDAndParameter__(@symbol(DisplayError), __MKOBJ(dpy)); |
168 | 429 |
return 0; |
430 |
} |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
431 |
#else |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
432 |
extern __XErrorHandler__(); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
433 |
#endif |
168 | 434 |
|
4718 | 435 |
/* |
151 | 436 |
* begin moved from GLXsupport.c |
437 |
*/ |
|
438 |
||
439 |
/* |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
440 |
* This provides a helper function "GLXCreateWindow", which does |
4718 | 441 |
* all the necessary magic to create an X window suitable for GL drawing |
442 |
* to take place within. See the definition of GLXCreateWindow for a |
|
151 | 443 |
* description of how to call it. |
444 |
* |
|
445 |
* claus: I really had no time to look into all this, |
|
446 |
* this file has been just copied from a 4Dgifts demo .. |
|
447 |
* (will need more than a day to show more ...) |
|
448 |
*/ |
|
1932 | 449 |
#if !defined(OPENGL) |
151 | 450 |
|
1899 | 451 |
# include <X11/Xlib.h> |
452 |
# include <X11/Xutil.h> |
|
453 |
# ifndef VGL |
|
4718 | 454 |
# include <gl/glws.h> |
1899 | 455 |
# endif |
456 |
# include <signal.h> |
|
457 |
# include <setjmp.h> |
|
458 |
# include "stcIntern.h" |
|
151 | 459 |
|
460 |
/* |
|
461 |
* glxhelper.h: |
|
462 |
* |
|
463 |
* List of drawing modes supported by GLXCreateWindow (in glxhelper.c). |
|
4718 | 464 |
* More than this are possible with mixed model, but this is just an |
465 |
* example. You can either expand this list (and the corresponding code in |
|
466 |
* GLXCreateWindow) or call the mixed model calls yourself, using |
|
151 | 467 |
* GLXCreateWindow as an example. |
468 |
*/ |
|
469 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
470 |
static char * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
471 |
typeToName[] = { |
151 | 472 |
"color index single buffer", |
473 |
"color index double buffer", |
|
474 |
"rgb single buffer", |
|
475 |
"rgb double buffer", |
|
476 |
}; |
|
477 |
||
1932 | 478 |
#endif /* GLX || VGL */ |
479 |
||
480 |
#if defined(GLX) && !defined(VGL) |
|
151 | 481 |
/* |
482 |
* Dorky little helper function used to build up a GLXconfig array. |
|
483 |
*/ |
|
484 |
||
4718 | 485 |
static void |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
486 |
set_entry (GLXconfig* ptr, int b, int m, int a) |
151 | 487 |
{ |
488 |
ptr->buffer = b; |
|
489 |
ptr->mode = m; |
|
490 |
ptr->arg = a; |
|
491 |
} |
|
1932 | 492 |
#endif /* GLX & not VGL */ |
151 | 493 |
|
4711 | 494 |
static stx_jmp_buf errorReturn; |
151 | 495 |
|
496 |
static void |
|
497 |
glAbort() { |
|
498 |
longjmp(errorReturn, 1); |
|
499 |
} |
|
500 |
||
501 |
/* |
|
502 |
* GLXCreateWindow(dpy, parent, x, y, w, h, boderWidth, type) |
|
503 |
* |
|
504 |
* Return value is the X window id of the newly created window. |
|
505 |
* |
|
506 |
* Arguments are: |
|
507 |
* dpy The X "Display*" returned by XOpenDisplay |
|
508 |
* parent The parent of the newly created window, |
|
509 |
* a typical value for this is |
|
510 |
* RootWindow(dpy, DefaultScreen(dpy)) |
|
511 |
* x,y The location of the window to be created, |
|
512 |
* y coordinate is measured from the top down. |
|
513 |
* w,h size of the new window |
|
514 |
* borderWidth the X border size for this window, should probably |
|
515 |
* be zero. |
|
516 |
* type the GLXWindowType (see glxhelper.h) desribing the |
|
517 |
* typer of GL drawing to be done in this window |
|
518 |
*/ |
|
4718 | 519 |
Window |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
520 |
__GLXCreateWindow(dpy, parent, x, y, w, h, borderWidth, type) |
151 | 521 |
Display* dpy; |
522 |
Window parent; |
|
523 |
GLXWindowType type; |
|
524 |
{ |
|
1932 | 525 |
#if !defined(OPENGL) |
526 |
# ifndef VGL |
|
151 | 527 |
GLXconfig params[50]; |
528 |
GLXconfig* next; |
|
529 |
GLXconfig* retconfig; |
|
530 |
Colormap cmap = DefaultColormap(dpy, DefaultScreen(dpy)); |
|
1932 | 531 |
# endif |
532 |
#endif |
|
533 |
Visual visual; |
|
151 | 534 |
XVisualInfo *vis; |
535 |
XVisualInfo template; |
|
536 |
XColor white; |
|
537 |
XSetWindowAttributes cwa; |
|
538 |
XWindowAttributes pwa; |
|
539 |
int scr, i, nret; |
|
540 |
Window win; |
|
1932 | 541 |
#ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
542 |
struct sigaction oldSig, newSig; |
1932 | 543 |
#else |
151 | 544 |
void *oldSig; |
1932 | 545 |
#endif |
546 |
||
547 |
#if !defined(OPENGL) |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
548 |
__catchExit(1); |
1932 | 549 |
#endif |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
550 |
|
151 | 551 |
if (setjmp(errorReturn)) { |
4718 | 552 |
console_fprintf(stderr, "hard error in GL - return\n"); |
1932 | 553 |
#ifdef HAS_SIGACTION |
4718 | 554 |
sigaction(SIGSEGV, &oldSig, 0); |
555 |
#else |
|
556 |
signal(SIGSEGV, oldSig); |
|
1932 | 557 |
#endif |
558 |
#if !defined(OPENGL) |
|
4718 | 559 |
__catchExit(0); |
560 |
#endif |
|
561 |
return 0; |
|
151 | 562 |
} |
563 |
__CONT__ |
|
564 |
||
1932 | 565 |
if (w <= 0) { |
4718 | 566 |
console_fprintf(stderr, "GL: bad width: %d\n", w); |
567 |
w = 1; |
|
1932 | 568 |
} |
569 |
if (h <= 0) { |
|
4718 | 570 |
console_fprintf(stderr, "GL: bad height: %d\n", h); |
571 |
h = 1; |
|
1932 | 572 |
} |
573 |
||
574 |
#if !defined(OPENGL) |
|
1899 | 575 |
# ifdef VGL |
151 | 576 |
/* |
577 |
* I know what VGL supports; its somewhat unclean to hard code it here |
|
578 |
*/ |
|
579 |
switch (type) { |
|
580 |
case GLXcolorIndexSingleBuffer: |
|
581 |
case GLXcolorIndexDoubleBuffer: |
|
4718 | 582 |
break; |
151 | 583 |
|
584 |
case GLXrgbSingleBuffer: |
|
585 |
case GLXrgbDoubleBuffer: |
|
4718 | 586 |
console_fprintf(stderr, "Sorry, VGL can't support %s type of windows\n", typeToName[type]); |
587 |
__catchExit(0); |
|
588 |
return 0; |
|
151 | 589 |
} |
590 |
||
591 |
scr = DefaultScreen(dpy); |
|
592 |
visual.visualid = CopyFromParent; |
|
593 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
594 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
4718 | 595 |
borderWidth, DisplayPlanes(dpy, scr), |
596 |
InputOutput, &visual, |
|
597 |
CWBorderPixel, &cwa); |
|
151 | 598 |
|
599 |
/* |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
600 |
* on some, seg-violations occur in the GL, if too many |
151 | 601 |
* views are created ... just to make certain, we catch those |
602 |
* in GL too. |
|
603 |
*/ |
|
1899 | 604 |
# ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
605 |
sigaction(SIGSEGV, (struct sigaction *)0, &oldSig); |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
606 |
newSig = oldSig; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
607 |
newSig.sa_handler = glAbort; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
608 |
sigaction(SIGSEGV, &newSig, (struct sigaction *)0); |
1899 | 609 |
# else |
151 | 610 |
oldSig = signal(SIGSEGV, glAbort); |
1899 | 611 |
# endif |
151 | 612 |
i = GLXlink(dpy, win); |
1899 | 613 |
# ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
614 |
sigaction(SIGSEGV, &oldSig, (struct sigaction *)0); |
1899 | 615 |
# else |
151 | 616 |
signal(SIGSEGV, oldSig); |
1899 | 617 |
# endif |
151 | 618 |
|
619 |
if (i < 0) { |
|
4718 | 620 |
console_fprintf(stderr, "GLXlink returned %d\n", i); |
621 |
__catchExit(0); |
|
622 |
return 0; |
|
151 | 623 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
624 |
|
1899 | 625 |
# else /* not VGL */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
626 |
|
151 | 627 |
/* |
628 |
* This builds an array in "params" that describes for GLXgetconfig(3G) |
|
629 |
* the type of GL drawing that will be done. |
|
630 |
*/ |
|
631 |
next = params; |
|
632 |
switch (type) { |
|
633 |
case GLXcolorIndexSingleBuffer: |
|
4718 | 634 |
set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE); |
635 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE); |
|
636 |
break; |
|
151 | 637 |
case GLXcolorIndexDoubleBuffer: |
4718 | 638 |
set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE); |
639 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE); |
|
640 |
break; |
|
151 | 641 |
case GLXrgbSingleBuffer: |
4718 | 642 |
set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE); |
643 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE); |
|
644 |
break; |
|
151 | 645 |
case GLXrgbDoubleBuffer: |
4718 | 646 |
set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE); |
647 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE); |
|
648 |
break; |
|
151 | 649 |
} |
650 |
set_entry(next, 0, 0, 0); /* The input to GLXgetconfig is null terminated */ |
|
651 |
||
652 |
/* |
|
653 |
* Get configuration data for a window based on above parameters |
|
654 |
* First we have to find out which screen the parent window is on, |
|
655 |
* then we can call GXLgetconfig() |
|
656 |
*/ |
|
657 |
XGetWindowAttributes(dpy, parent, &pwa); |
|
658 |
retconfig = GLXgetconfig(dpy, XScreenNumberOfScreen(pwa.screen), params); |
|
659 |
if (retconfig == 0) { |
|
4718 | 660 |
console_fprintf(stderr, "Sorry, can't support %s type of windows\n", typeToName[type]); |
661 |
__catchExit(0); |
|
662 |
return 0; |
|
151 | 663 |
} |
664 |
||
665 |
/* |
|
666 |
* Scan through config info, pulling info needed to create a window |
|
667 |
* that supports the rendering mode. |
|
668 |
*/ |
|
669 |
for (next = retconfig; next->buffer; next++) { |
|
4718 | 670 |
unsigned long buffer = next->buffer; |
671 |
unsigned long mode = next->mode; |
|
672 |
unsigned long value = next->arg; |
|
673 |
switch (mode) { |
|
674 |
case GLX_COLORMAP: |
|
675 |
if (buffer == GLX_NORMAL) { |
|
676 |
cmap = value; |
|
677 |
} |
|
678 |
break; |
|
679 |
case GLX_VISUAL: |
|
680 |
if (buffer == GLX_NORMAL) { |
|
681 |
template.visualid = value; |
|
682 |
template.screen = DefaultScreen(dpy); |
|
683 |
vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask, |
|
684 |
&template, &nret); |
|
685 |
} |
|
686 |
break; |
|
687 |
} |
|
151 | 688 |
} |
689 |
||
690 |
/* |
|
691 |
* Create the window |
|
692 |
*/ |
|
693 |
cwa.colormap = cmap; |
|
694 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
695 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
4718 | 696 |
borderWidth, vis->depth, InputOutput, vis->visual, |
697 |
CWColormap|CWBorderPixel, &cwa); |
|
151 | 698 |
|
699 |
/* |
|
700 |
* Rescan configuration info and find window slot that getconfig |
|
701 |
* provided. Fill it in with the window we just created. |
|
702 |
*/ |
|
703 |
for (next = retconfig; next->buffer; next++) { |
|
4718 | 704 |
if ((next->buffer == GLX_NORMAL) && (next->mode == GLX_WINDOW)) { |
705 |
next->arg = win; |
|
706 |
break; |
|
707 |
} |
|
151 | 708 |
} |
709 |
||
710 |
/* |
|
711 |
* Now "retconfig" contains all the information the GL needs to |
|
712 |
* configure the window and its own internal state. |
|
713 |
*/ |
|
714 |
/* |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
715 |
* on iris, seg-violations occur in the GL, if too many |
151 | 716 |
* views are created ... |
717 |
*/ |
|
1899 | 718 |
# ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
719 |
sigaction(SIGSEGV, (struct sigaction *)0, &oldSig); |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
720 |
newSig = oldSig; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
721 |
newSig.sa_handler = glAbort; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
722 |
sigaction(SIGSEGV, &newSig, (struct sigaction *)0); |
1899 | 723 |
# else |
151 | 724 |
oldSig = signal(SIGSEGV, glAbort); |
1899 | 725 |
# endif |
151 | 726 |
i = GLXlink(dpy, retconfig); |
1899 | 727 |
# ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
728 |
sigaction(SIGSEGV, &oldSig, (struct sigaction *)0); |
1899 | 729 |
# else |
151 | 730 |
signal(SIGSEGV, oldSig); |
1899 | 731 |
# endif |
151 | 732 |
|
733 |
if (i < 0) { |
|
4718 | 734 |
console_fprintf(stderr, "GLXlink returned %d\n", i); |
735 |
__catchExit(0); |
|
736 |
return 0; |
|
151 | 737 |
} |
738 |
||
739 |
/* |
|
740 |
* The GL sets its own X error handlers, which exits - this is not what we want |
|
741 |
*/ |
|
742 |
XSetErrorHandler(__XErrorHandler__); |
|
1899 | 743 |
# endif /* not VGL */ |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
744 |
__catchExit(0); |
1932 | 745 |
|
746 |
#else /* OPENGL | MESA */ |
|
747 |
||
748 |
scr = DefaultScreen(dpy); |
|
749 |
visual.visualid = CopyFromParent; |
|
750 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
751 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
4718 | 752 |
borderWidth, DisplayPlanes(dpy, scr), |
753 |
InputOutput, &visual, |
|
754 |
CWBorderPixel, &cwa); |
|
1932 | 755 |
|
756 |
vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask, &visual, &nret); |
|
4718 | 757 |
console_fprintf(stderr, "vis is %x\n", vis); |
1932 | 758 |
#endif /* GLX || VGL */ |
759 |
||
151 | 760 |
return win; |
761 |
} |
|
762 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
763 |
__GLXUnlinkWindow(dpy, win) |
151 | 764 |
Display* dpy; |
765 |
Window win; |
|
766 |
{ |
|
767 |
/* |
|
768 |
* only needed for VGL - GLX does it automatically |
|
769 |
*/ |
|
1932 | 770 |
#ifdef VGL |
151 | 771 |
GLXunlink(dpy, win); |
1932 | 772 |
#endif |
151 | 773 |
} |
774 |
||
29 | 775 |
/* |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
776 |
* helper for rotation - calls rot() |
29 | 777 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
778 |
OBJ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
779 |
__glx_doRotate(angle, axis) |
29 | 780 |
OBJ angle; |
781 |
char axis; |
|
782 |
{ |
|
783 |
float f_angle; |
|
784 |
||
35 | 785 |
if (__isFloat(angle)) { |
4718 | 786 |
f_angle = (float)(_floatVal(angle)); |
787 |
if (f_angle != 0.0) { |
|
788 |
#ifdef OPENGL |
|
789 |
#else |
|
790 |
rot(f_angle, axis); |
|
791 |
#endif |
|
792 |
} |
|
793 |
return (true); |
|
29 | 794 |
} |
35 | 795 |
if (__isFraction(angle) |
97 | 796 |
&& __isSmallInteger(_FractionInstPtr(angle)->f_numerator) |
797 |
&& __isSmallInteger(_FractionInstPtr(angle)->f_denominator)) { |
|
4718 | 798 |
float n, d; |
799 |
||
800 |
n = (float)(__intVal(_FractionInstPtr(angle)->f_numerator)); |
|
801 |
d = (float)(__intVal(_FractionInstPtr(angle)->f_denominator)); |
|
802 |
f_angle = n / d; |
|
803 |
if (f_angle != 0.0) { |
|
804 |
#ifdef OPENGL |
|
805 |
#else |
|
806 |
rot(f_angle, axis); |
|
807 |
#endif |
|
808 |
} |
|
809 |
return (true); |
|
29 | 810 |
} |
97 | 811 |
if (__isSmallInteger(angle)) { |
4718 | 812 |
f_angle = (float)(__intVal(angle)); |
813 |
if (f_angle != 0.0) { |
|
814 |
#ifdef OPENGL |
|
815 |
#else |
|
816 |
rot(f_angle, axis); |
|
817 |
#endif |
|
818 |
} |
|
819 |
return (true); |
|
29 | 820 |
} |
821 |
return false; |
|
822 |
} |
|
0 | 823 |
|
24 | 824 |
/* |
29 | 825 |
* fetch integers from an st-array (elements must be smallIntegers) |
826 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
827 |
long * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
828 |
__glx_getLongsFromInto(obj, vec, count) |
29 | 829 |
OBJ obj; |
830 |
long *vec; |
|
831 |
{ |
|
832 |
OBJ cls, o; |
|
833 |
int nByte, i, ninstVars, nInstBytes; |
|
834 |
char *pElem; |
|
835 |
||
836 |
if (! _isNonNilObject(obj)) return (long *)NULL; |
|
134 | 837 |
cls = __qClass(obj); |
185 | 838 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 839 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 840 |
nByte = __qSize(obj) - nInstBytes; |
29 | 841 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
842 |
if (nByte < (count * sizeof(OBJ))) return (long *)NULL; |
|
843 |
for (i=0; i<count; i++) { |
|
4718 | 844 |
o = *(OBJ *)pElem; |
845 |
if (! __isSmallInteger(o)) return (long *)NULL; |
|
846 |
vec[i] = (long)__intVal(o); |
|
847 |
pElem += sizeof(OBJ); |
|
29 | 848 |
} |
849 |
return vec; |
|
850 |
} |
|
851 |
||
852 |
/* |
|
853 |
* fetch shorts from an st-array (elements must be smallIntegers) |
|
854 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
855 |
short * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
856 |
__glx_getShortsFromInto(obj, vec, count) |
29 | 857 |
OBJ obj; |
858 |
short *vec; |
|
859 |
{ |
|
860 |
OBJ cls, o; |
|
861 |
int nByte, i, ninstVars, nInstBytes; |
|
862 |
char *pElem; |
|
863 |
||
864 |
if (! _isNonNilObject(obj)) return (short *)NULL; |
|
134 | 865 |
cls = __qClass(obj); |
185 | 866 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 867 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 868 |
nByte = __qSize(obj) - nInstBytes; |
29 | 869 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
870 |
if (nByte < (count * sizeof(OBJ))) return (short *)NULL; |
|
871 |
for (i=0; i<count; i++) { |
|
4718 | 872 |
o = *(OBJ *)pElem; |
873 |
if (! __isSmallInteger(o)) return (short *)NULL; |
|
874 |
vec[i] = (short)__intVal(o); |
|
875 |
pElem += sizeof(OBJ); |
|
29 | 876 |
} |
877 |
return vec; |
|
878 |
} |
|
879 |
||
880 |
/* |
|
4718 | 881 |
* fetch floats from an st-object into a c-float array |
29 | 882 |
* which may be a floatArray, doubleArray or array-of-something, |
883 |
* where something may be a float, fraction or smallInteger, |
|
24 | 884 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
885 |
float * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
886 |
__glx_getFloatsFromInto(obj, vec, count) |
12 | 887 |
OBJ obj; |
888 |
float *vec; |
|
889 |
{ |
|
890 |
OBJ cls; |
|
891 |
int nByte; |
|
892 |
OBJ o; |
|
893 |
int i, ninstVars, nInstBytes; |
|
894 |
char *pElem; |
|
895 |
||
896 |
if (! _isNonNilObject(obj)) return (float *)0; |
|
897 |
||
134 | 898 |
cls = __qClass(obj); |
185 | 899 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
12 | 900 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 901 |
nByte = __qSize(obj) - nInstBytes; |
12 | 902 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
903 |
||
185 | 904 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
12 | 905 |
case FLOATARRAY: |
4718 | 906 |
/* |
907 |
* best speed for float array |
|
908 |
* - the data is already as we want it |
|
909 |
*/ |
|
910 |
if (nByte < (count * sizeof(float))) return (float *)0; |
|
911 |
return (float *)pElem; |
|
12 | 912 |
|
913 |
case DOUBLEARRAY: |
|
4718 | 914 |
/* |
915 |
* for double array, have to copy-and-cast |
|
916 |
*/ |
|
917 |
if (nByte < (count * sizeof(double))) return (float *)0; |
|
918 |
for (i=0; i<count; i++) { |
|
919 |
vec[i] = *((double *)pElem); |
|
920 |
pElem += sizeof(double); |
|
921 |
} |
|
922 |
return vec; |
|
12 | 923 |
|
924 |
case POINTERARRAY: |
|
4718 | 925 |
/* |
926 |
* for other array, have to fetch, check and store |
|
927 |
* the elements can be floats, smallintegers or fractions |
|
928 |
*/ |
|
929 |
if (nByte < (count * sizeof(OBJ))) return (float *)0; |
|
930 |
/* get elements one-by-one */ |
|
931 |
for (i=0; i<count; i++) { |
|
932 |
o = *(OBJ *)pElem; |
|
933 |
if (__isFloat(o)) { |
|
934 |
vec[i] = _floatVal(o); |
|
935 |
} else if (__isSmallInteger(o)) { |
|
936 |
vec[i] = (float)(__intVal(o)); |
|
937 |
} else if (__isFraction(o) |
|
938 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
|
939 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
940 |
float n, d; |
|
941 |
||
942 |
n = (float)(__intVal(_FractionInstPtr(o)->f_numerator)); |
|
943 |
d = (float)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
944 |
vec[i] = n / d; |
|
945 |
} else |
|
946 |
return 0; |
|
947 |
pElem += sizeof(OBJ); |
|
948 |
} |
|
949 |
return vec; |
|
12 | 950 |
} |
951 |
return (float *)0; |
|
952 |
} |
|
953 |
||
29 | 954 |
/* |
4718 | 955 |
* fetch doubles from an st-object into a c-double array |
29 | 956 |
* which may be a floatArray, doubleArray or array-of-something, |
957 |
* where something may be a float, fraction or smallInteger, |
|
958 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
959 |
double * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
960 |
__glx_getDoublesFromInto(obj, vec, count) |
29 | 961 |
OBJ obj; |
962 |
double *vec; |
|
963 |
{ |
|
964 |
OBJ cls, o; |
|
965 |
int nByte, i, ninstVars, nInstBytes; |
|
966 |
char *pElem; |
|
967 |
||
968 |
if (! _isNonNilObject(obj)) return (double *)0; |
|
134 | 969 |
cls = __qClass(obj); |
185 | 970 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 971 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 972 |
nByte = __qSize(obj) - nInstBytes; |
29 | 973 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
974 |
||
185 | 975 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
29 | 976 |
case DOUBLEARRAY: |
4718 | 977 |
/* best speed for double array - the data is already as we want it */ |
978 |
if (nByte < (count * sizeof(double))) return (double *)0; |
|
979 |
return (double *)pElem; |
|
29 | 980 |
|
981 |
case FLOATARRAY: |
|
4718 | 982 |
if (nByte < (count * sizeof(float))) return (double *)0; |
983 |
for (i=0; i<count; i++) { |
|
984 |
vec[i] = *((float *)pElem); |
|
985 |
pElem += sizeof(float); |
|
986 |
} |
|
987 |
return vec; |
|
29 | 988 |
|
989 |
case POINTERARRAY: |
|
4718 | 990 |
if (nByte < (count * sizeof(OBJ))) return (double *)0; |
991 |
/* get elements one-by-one */ |
|
992 |
for (i=0; i<count; i++) { |
|
993 |
o = *(OBJ *)pElem; |
|
994 |
if (__isFloat(o)) |
|
995 |
vec[i] = _floatVal(o); |
|
996 |
else if (__isSmallInteger(o)) |
|
997 |
vec[i] = (double)(__intVal(o)); |
|
998 |
else if (__isFraction(o) |
|
999 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
|
1000 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
1001 |
double n, d; |
|
1002 |
||
1003 |
n = (double)(__intVal(_FractionInstPtr(o)->f_numerator)); |
|
1004 |
d = (double)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
1005 |
vec[i] = n / d; |
|
1006 |
||
1007 |
} else |
|
1008 |
return 0; |
|
1009 |
pElem += sizeof(OBJ); |
|
1010 |
} |
|
1011 |
return vec; |
|
29 | 1012 |
} |
1013 |
return (double *)0; |
|
1014 |
} |
|
1015 |
||
1016 |
/* |
|
1017 |
* move from a c-float array into an st-object, |
|
1018 |
* the st-object MUST be either a float- or double array |
|
1019 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1020 |
__glx_putFloatsFromInto(vec, obj, count) |
12 | 1021 |
OBJ obj; |
1022 |
float *vec; |
|
1023 |
{ |
|
1024 |
OBJ cls; |
|
1025 |
int nByte; |
|
1026 |
OBJ o; |
|
1027 |
int i, ninstVars, nInstBytes; |
|
1028 |
char *pElem; |
|
1029 |
||
1030 |
if (! _isNonNilObject(obj)) return 0; |
|
1031 |
||
134 | 1032 |
cls = __qClass(obj); |
185 | 1033 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
12 | 1034 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1035 |
nByte = __qSize(obj) - nInstBytes; |
12 | 1036 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1037 |
||
185 | 1038 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
12 | 1039 |
case FLOATARRAY: |
4718 | 1040 |
if (nByte < (count * sizeof(float))) return 0; |
1041 |
for (i=0; i<count; i++) { |
|
1042 |
*(float *)pElem = vec[i]; |
|
1043 |
pElem += sizeof(float); |
|
1044 |
} |
|
1045 |
return 1; |
|
12 | 1046 |
|
1047 |
case DOUBLEARRAY: |
|
4718 | 1048 |
if (nByte < (count * sizeof(float))) return 0; |
1049 |
for (i=0; i<count; i++) { |
|
1050 |
*(double *)pElem = vec[i]; |
|
1051 |
pElem += sizeof(double); |
|
1052 |
} |
|
1053 |
return 1; |
|
12 | 1054 |
} |
1055 |
/* not implemented for others */ |
|
1056 |
||
1057 |
return 0; |
|
1058 |
} |
|
1059 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1060 |
#ifndef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1061 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1062 |
Matrix * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1063 |
__glx_getFloatsFromMatrixInto(obj, mp) |
12 | 1064 |
OBJ obj; |
1065 |
Matrix *mp; |
|
1066 |
{ |
|
1067 |
OBJ cls; |
|
1068 |
int nByte; |
|
1069 |
OBJ o; |
|
29 | 1070 |
int ninstVars, nInstBytes; |
1071 |
char *pElem; |
|
1072 |
int x = 0; |
|
1073 |
int i,j; |
|
12 | 1074 |
|
1075 |
if (! _isNonNilObject(obj)) return (Matrix *)0; |
|
1076 |
||
134 | 1077 |
cls = __qClass(obj); |
185 | 1078 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 1079 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1080 |
nByte = __qSize(obj) - nInstBytes; |
29 | 1081 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1082 |
||
185 | 1083 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
4718 | 1084 |
case FLOATARRAY: |
1085 |
/* |
|
1086 |
* very easy for FLOATARRAY objects - no copying needed |
|
1087 |
*/ |
|
1088 |
if (nByte < (16 * sizeof(float))) return (Matrix *)0; |
|
1089 |
return (Matrix *) _FloatArrayInstPtr(obj)->f_element; |
|
1090 |
||
1091 |
case DOUBLEARRAY: |
|
1092 |
/* |
|
1093 |
* for DOUBLEARRAY objects copy and cast |
|
1094 |
*/ |
|
1095 |
if (nByte < (16 * sizeof(double))) return (Matrix *)0; |
|
1096 |
for (i=0; i<4; i++) { |
|
1097 |
for (j=0; j<4; j++) { |
|
1098 |
(*mp)[i][j] = _DoubleArrayInstPtr(obj)->d_element[x]; |
|
1099 |
x++; |
|
1100 |
} |
|
1101 |
} |
|
1102 |
return mp; |
|
1103 |
||
1104 |
case POINTERARRAY: |
|
1105 |
if (nByte < (16 * sizeof(OBJ))) return (Matrix *)0; |
|
1106 |
/* |
|
1107 |
* get elements one-by-one |
|
1108 |
*/ |
|
1109 |
for (i=0; i<4; i++) { |
|
1110 |
for (j=0; j<4; j++) { |
|
1111 |
o = _ArrayInstPtr(obj)->a_element[x]; |
|
1112 |
if (__isFloat(o)) { |
|
1113 |
(*mp)[i][j] = _floatVal(o); |
|
1114 |
} else if (__isSmallInteger(o)) { |
|
1115 |
(*mp)[i][j] = (double)__intVal(o); |
|
1116 |
} else if (__isFraction(o) |
|
1117 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
|
1118 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
1119 |
double n, d; |
|
1120 |
||
1121 |
n = (double)(__intVal(_FractionInstPtr(o)->f_numerator)); |
|
1122 |
d = (double)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
1123 |
(*mp)[i][j] = n / d; |
|
1124 |
} else |
|
1125 |
return (Matrix *)0; |
|
1126 |
x++; |
|
1127 |
} |
|
1128 |
} |
|
1129 |
return mp; |
|
12 | 1130 |
} |
1131 |
return (Matrix *)0; |
|
1132 |
} |
|
1133 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1134 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1135 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1136 |
float* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1137 |
__glx_getFloatsFromFloatArrayInto(obj, fp) |
46 | 1138 |
OBJ obj; |
1139 |
float *fp; |
|
1140 |
{ |
|
1141 |
OBJ cls; |
|
1142 |
int ninstVars; |
|
1143 |
||
1144 |
if (! _isNonNilObject(obj)) return (float *)0; |
|
134 | 1145 |
cls = __qClass(obj); |
350 | 1146 |
if (cls == @global(FloatArray)) |
4718 | 1147 |
return _FloatArrayInstPtr(obj)->f_element; |
46 | 1148 |
|
185 | 1149 |
if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) { |
4718 | 1150 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
1151 |
return (float *) &(_InstPtr(obj)->i_instvars[ninstVars]); |
|
46 | 1152 |
} |
1153 |
||
1154 |
/* |
|
1155 |
* need more here (i.e. convert from array-of-floats) |
|
1156 |
*/ |
|
1157 |
return (float *)0; |
|
1158 |
} |
|
1159 |
||
1160 |
%} |
|
1161 |
! ! |
|
0 | 1162 |
|
294 | 1163 |
!GLXWorkstation class methodsFor:'documentation'! |
1164 |
||
1165 |
copyright |
|
1166 |
" |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1167 |
COPYRIGHT (c) 1993 by Claus Gittinger |
294 | 1168 |
All Rights Reserved |
1169 |
||
1170 |
This software is furnished under a license and may be used |
|
1171 |
only in accordance with the terms of that license and with the |
|
1172 |
inclusion of the above copyright notice. This software may not |
|
1173 |
be provided or otherwise made available to, or used by, any |
|
1174 |
other person. No title to or ownership of the software is |
|
1175 |
hereby transferred. |
|
1176 |
" |
|
1177 |
! |
|
1178 |
||
1179 |
documentation |
|
1180 |
" |
|
1181 |
this class was originally written as a demo on how an interface to |
|
1182 |
a c graphics library could be implemented. In the mean time, it has become |
|
1183 |
quite complete ... |
|
1184 |
||
1185 |
It provides an interface to either a real GL (on SGI workstations) |
|
1186 |
or a simulated VGL (i.e. GL-light; low nicotine). |
|
1187 |
The GL simulation is derived from the PD vogl library, with slight |
|
1188 |
modifictions to support multiple GL views. |
|
1189 |
||
1190 |
Most of the hard work was done by Jeff (thanks indeed) ... |
|
1191 |
||
1192 |
||
1193 |
Some notes: |
|
1194 |
||
1195 |
I do not really know what most of these functions do - for more |
|
1196 |
detail, see the GL man pages (on SGI) or the doc provided with VGL. |
|
1197 |
||
1198 |
The interface offered here provides a very very low level (i.e one-to-one) |
|
1199 |
interface to GL functions. More high-level stuff is required, to make |
|
4718 | 1200 |
3D drawing be more object-oriented. |
294 | 1201 |
(see a bit of this in 'clients/IRIS-specials') |
1202 |
||
1203 |
Some functions are duplicated, Jeff and I developed those in parallel - |
|
1204 |
for now, both will remain - finally they will be merged and duplicates removed ... |
|
1205 |
(examples are makeobj and makeObject). |
|
1206 |
||
1207 |
Also, in a hurry to implement all those methods, many do no or only |
|
1208 |
limited argument checking - make certain, that you pass the correct |
|
1209 |
arguments. |
|
1210 |
||
1211 |
There might be some confusion in the v3[sifd] functions: basically they |
|
1212 |
all do the same, and could be mapped onto one st-method (such as vertex3). |
|
1213 |
However, the C-functions expect different argument types - I dont know if |
|
1214 |
one or another of these functions suffers from any performance penalties. |
|
1215 |
Therefore, I leave the direct 1-to-1 mapping; GL experts might know more |
|
1216 |
about this (I use v3f in all of my code). |
|
1217 |
||
1218 |
written june 93 by claus |
|
1219 |
VGL stuff dec 93 |
|
1220 |
many many additions jan 94 by Jeff McAffer <jeff@is.s.u-tokyo.ac.jp> |
|
1221 |
||
4718 | 1222 |
Since this is a demo (consider it a free add-on goody) there is |
294 | 1223 |
*** NO WARRANTY ** for this. |
1224 |
||
1225 |
Notice: this should be rewritten to use the openGL library functions |
|
1226 |
(actually, to not loose the VGL interface, another OpenGLWorkstation |
|
1227 |
class should be written) |
|
614 | 1228 |
|
1229 |
[author:] |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1230 |
Claus Gittinger |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1231 |
Jeff McAffer |
294 | 1232 |
" |
1233 |
! ! |
|
1234 |
||
168 | 1235 |
!GLXWorkstation class methodsFor:'error handling'! |
1236 |
||
294 | 1237 |
errorStringOfLastError |
1238 |
%{ |
|
4251 | 1239 |
#ifdef DYNAMICALLY_LOADABLE |
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1240 |
RETURN ( __MKSTRING(lastErrorMsg) ); |
4251 | 1241 |
#endif |
1242 |
%}. |
|
1243 |
||
1244 |
^ super errorStringOfLastError. |
|
1245 |
! |
|
1246 |
||
1247 |
minorCodeOfLastError |
|
1248 |
%{ /* NOCONTEXT */ |
|
1249 |
#ifdef DYNAMICALLY_LOADABLE |
|
1250 |
RETURN ( __MKSMALLINT(lastMinorCode) ); |
|
1251 |
#endif |
|
1252 |
%}. |
|
1253 |
||
1254 |
^ super minorCodeOfLastError. |
|
1255 |
! |
|
1256 |
||
1257 |
requestCodeOfLastError |
|
1258 |
%{ /* NOCONTEXT */ |
|
1259 |
#ifdef DYNAMICALLY_LOADABLE |
|
1260 |
RETURN ( __MKSMALLINT(lastRequestCode) ); |
|
1261 |
#endif |
|
1262 |
%}. |
|
1263 |
||
1264 |
^ super requestCodeOfLastError. |
|
1265 |
! |
|
1266 |
||
1267 |
resourceIdOfLastError |
|
1268 |
%{ /* NOCONTEXT */ |
|
1269 |
#ifdef DYNAMICALLY_LOADABLE |
|
1270 |
if (lastResource != 0) { |
|
1271 |
RETURN ( __MKEXTERNALADDRESS(lastResource) ); |
|
1272 |
} |
|
1273 |
RETURN ( nil ); |
|
1274 |
#endif |
|
1275 |
%}. |
|
1276 |
||
1277 |
^ super resourceIdOfLastError. |
|
1278 |
! ! |
|
1279 |
||
1280 |
!GLXWorkstation class methodsFor:'misc'! |
|
168 | 1281 |
|
528 | 1282 |
forceGL:aBoolean |
1283 |
ForceGL := aBoolean. |
|
1284 |
AllScreens notNil ifTrue:[ |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1285 |
AllScreens do:[:screen | screen initializeScreenProperties] |
528 | 1286 |
]. |
294 | 1287 |
! ! |
1288 |
||
1289 |
!GLXWorkstation methodsFor:'arcs and circles'! |
|
1290 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1291 |
glxArcX:x y:y radius:radius startang:startang endang:endang in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1292 |
"draw an arc at a given location. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1293 |
The x/y/radius args may be floats, fractions or smallIntegers. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1294 |
startang and endang must be smallIntegers (10th of a degree)." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1295 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1296 |
%{ /* NOCONTEXT */ |
294 | 1297 |
Coord c_x, c_y, c_radius; |
1298 |
Angle a_startang, a_endang; |
|
1299 |
||
1300 |
_COORD_(x, c_x) |
|
1301 |
_COORD_(y, c_y) |
|
1302 |
_COORD_(radius, c_radius) |
|
1303 |
_ANGLE_(startang, a_startang) |
|
1304 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1305 |
|
294 | 1306 |
SETWIN(aGLXWindowId) |
1932 | 1307 |
#ifdef OPENGL |
1308 |
#else |
|
294 | 1309 |
arc(c_x, c_y, c_radius, a_startang, a_endang); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1310 |
#endif |
294 | 1311 |
%} |
528 | 1312 |
|
1313 |
"Modified: 19.3.1996 / 18:43:52 / cg" |
|
294 | 1314 |
! |
1315 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1316 |
glxArcfX:x y:y radius:radius startang:startang endang:endang in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1317 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1318 |
The x/y/radius args may be floats, fractions or smallIntegers. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1319 |
startang and endang must be smallIntegers (10th of a degree)." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1320 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1321 |
%{ /* NOCONTEXT */ |
294 | 1322 |
Coord c_x, c_y, c_radius; |
1323 |
Angle a_startang, a_endang; |
|
1324 |
||
1325 |
_COORD_(x, c_x) |
|
1326 |
_COORD_(y, c_y) |
|
1327 |
_COORD_(radius, c_radius) |
|
1328 |
_ANGLE_(startang, a_startang) |
|
1329 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1330 |
|
294 | 1331 |
SETWIN(aGLXWindowId) |
1932 | 1332 |
#ifdef OPENGL |
1333 |
#else |
|
294 | 1334 |
arcf(c_x, c_y, c_radius, a_startang, a_endang); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1335 |
#endif |
294 | 1336 |
%} |
1337 |
! |
|
1338 |
||
1339 |
glxArcfiX: x y: y radius: radius startang: startang endang: endang in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1340 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1341 |
All arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1342 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1343 |
%{ /* NOCONTEXT */ |
294 | 1344 |
Icoord c_x, c_y, c_radius; |
1345 |
Angle a_startang, a_endang; |
|
1346 |
||
1347 |
_ICOORD_(x, c_x) |
|
1348 |
_ICOORD_(y, c_y) |
|
1349 |
_ICOORD_(radius, c_radius) |
|
1350 |
_ANGLE_(startang, a_startang); |
|
1351 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1352 |
|
294 | 1353 |
SETWIN(aGLXWindowId) |
1932 | 1354 |
#ifdef OPENGL |
1355 |
#else |
|
294 | 1356 |
arcfi(c_x, c_y, c_radius, a_startang, a_endang); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1357 |
#endif |
294 | 1358 |
%} |
1359 |
! |
|
1360 |
||
1361 |
glxArcfsX: x y: y radius: radius startang: startang endang: endang in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1362 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1363 |
All arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1364 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1365 |
%{ /* NOCONTEXT */ |
294 | 1366 |
Scoord c_x, c_y, c_radius; |
1367 |
Angle a_startang, a_endang; |
|
1368 |
||
1369 |
_SCOORD_(x, c_x) |
|
1370 |
_SCOORD_(y, c_y) |
|
1371 |
_SCOORD_(radius, c_radius) |
|
1372 |
_ANGLE_(startang, a_startang) |
|
1373 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1374 |
|
294 | 1375 |
SETWIN(aGLXWindowId) |
1932 | 1376 |
#ifdef OPENGL |
1377 |
#else |
|
294 | 1378 |
arcfs(c_x, c_y, c_radius, a_startang, a_endang); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1379 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1380 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1381 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1382 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1383 |
glxArciX:x y:y radius:radius startang:startang endang:endang in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1384 |
"draw an (unfilled) arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1385 |
All arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1386 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1387 |
%{ /* NOCONTEXT */ |
294 | 1388 |
Icoord c_x, c_y, c_radius; |
1389 |
Angle a_startang, a_endang; |
|
1390 |
||
1391 |
_ICOORD_(x, c_x) |
|
1392 |
_ICOORD_(y, c_y) |
|
1393 |
_ICOORD_(radius, c_radius) |
|
1394 |
_ANGLE_(startang, a_startang) |
|
1395 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1396 |
|
294 | 1397 |
SETWIN(aGLXWindowId) |
1932 | 1398 |
#ifdef OPENGL |
1399 |
#else |
|
294 | 1400 |
arci(c_x, c_y, c_radius, a_startang, a_endang); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1401 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1402 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1403 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1404 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1405 |
glxArcsX:x y:y radius:radius startang:startang endang:endang in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1406 |
"draw an (unfilled) arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1407 |
All arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1408 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1409 |
%{ /* NOCONTEXT */ |
1932 | 1410 |
Scoord c_x, c_y, c_radius; |
1411 |
Angle a_startang, a_endang; |
|
1412 |
||
1413 |
_SCOORD_(x, c_x) |
|
1414 |
_SCOORD_(y, c_y) |
|
1415 |
_SCOORD_(radius, c_radius) |
|
1416 |
_ANGLE_(startang, a_startang) |
|
1417 |
_ANGLE_(endang, a_endang) |
|
1418 |
||
1419 |
SETWIN(aGLXWindowId) |
|
1420 |
#ifdef OPENGL |
|
1421 |
#else |
|
1422 |
arcs(c_x, c_y, c_radius, a_startang, a_endang); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1423 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1424 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1425 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1426 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1427 |
glxCircX:x y:y radius: radius in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1428 |
"draw a circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1429 |
x/y/radius may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1430 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1431 |
%{ /* NOCONTEXT */ |
1932 | 1432 |
Coord c_x, c_y, c_radius; |
1433 |
||
1434 |
_COORD_ (x, c_x) |
|
1435 |
_COORD_ (y, c_y) |
|
1436 |
_COORD_ (radius, c_radius) |
|
1437 |
||
1438 |
SETWIN(aGLXWindowId) |
|
1439 |
#ifdef OPENGL |
|
1440 |
#else |
|
1441 |
circ(c_x, c_y, c_radius); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1442 |
#endif |
294 | 1443 |
%} |
1444 |
! |
|
1445 |
||
1446 |
glxCircfX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1447 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1448 |
x/y/radius may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1449 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1450 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1451 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1452 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1453 |
Coord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1454 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1455 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1456 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1457 |
_COORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1458 |
|
1932 | 1459 |
#ifdef OPENGL |
1460 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1461 |
circf(c_x, c_y, c_radius); |
1932 | 1462 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1463 |
} |
294 | 1464 |
%} |
1465 |
! |
|
1466 |
||
1467 |
glxCircfiX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1468 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1469 |
x/y/radius must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1470 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1471 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1472 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1473 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1474 |
Icoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1475 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1476 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1477 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1478 |
_ICOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1479 |
|
1932 | 1480 |
#ifdef OPENGL |
1481 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1482 |
circfi(c_x, c_y, c_radius); |
1932 | 1483 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1484 |
} |
294 | 1485 |
%} |
1486 |
! |
|
1487 |
||
1488 |
glxCircfsX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1489 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1490 |
x/y/radius must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1491 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1492 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1493 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1494 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1495 |
Scoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1496 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1497 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1498 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1499 |
_SCOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1500 |
|
1932 | 1501 |
#ifdef OPENGL |
1502 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1503 |
circfs(c_x, c_y, c_radius); |
1932 | 1504 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1505 |
} |
294 | 1506 |
%} |
1507 |
! |
|
1508 |
||
1509 |
glxCirciX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1510 |
"draw a circle (unfilled). |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1511 |
x/y/radius must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1512 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1513 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1514 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1515 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1516 |
Icoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1517 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1518 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1519 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1520 |
_ICOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1521 |
|
1932 | 1522 |
#ifdef OPENGL |
1523 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1524 |
circi(c_x, c_y, c_radius); |
1932 | 1525 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1526 |
} |
294 | 1527 |
%} |
1528 |
! |
|
1529 |
||
1530 |
glxCircsX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1531 |
"draw a circle (unfilled) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1532 |
x/y/radius must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1533 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1534 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1535 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1536 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1537 |
Scoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1538 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1539 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1540 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1541 |
_SCOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1542 |
|
1932 | 1543 |
#ifdef OPENGL |
1544 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1545 |
circs(c_x, c_y, c_radius); |
1932 | 1546 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1547 |
} |
294 | 1548 |
%} |
1549 |
! ! |
|
1550 |
||
528 | 1551 |
!GLXWorkstation methodsFor:'attribute stack'! |
1552 |
||
1553 |
glxPopattributesIn: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1554 |
"pop (and forget) the top entry on the attribute stack" |
528 | 1555 |
|
1556 |
%{ /* NOCONTEXT */ |
|
1557 |
SETWIN(aGLXWindowId) |
|
1932 | 1558 |
#ifndef OPENGL |
528 | 1559 |
popattributes(); |
1932 | 1560 |
#endif |
528 | 1561 |
%} |
1562 |
||
1563 |
"Modified: 19.3.1996 / 18:42:53 / cg" |
|
1564 |
! |
|
1565 |
||
1566 |
glxPushattributesIn: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1567 |
"save the current attributes on the attribute stack" |
528 | 1568 |
|
1569 |
%{ /* NOCONTEXT */ |
|
1570 |
SETWIN(aGLXWindowId) |
|
1932 | 1571 |
#ifndef OPENGL |
528 | 1572 |
pushattributes(); |
1932 | 1573 |
#endif |
528 | 1574 |
%} |
1575 |
||
1576 |
"Modified: 19.3.1996 / 18:43:04 / cg" |
|
1577 |
! ! |
|
1578 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1579 |
!GLXWorkstation methodsFor:'character position'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1580 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1581 |
glxCmov2X: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1582 |
"change the character position to a 2D point, as passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1583 |
The arguments may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1584 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1585 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1586 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1587 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1588 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1589 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1590 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1591 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1592 |
|
1932 | 1593 |
#ifdef OPENGL |
1594 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1595 |
cmov2(c_x, c_y); |
1932 | 1596 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1597 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1598 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1599 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1600 |
"Modified: 22.3.1996 / 18:17:38 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1601 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1602 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1603 |
glxCmov2iX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1604 |
"change the character position to a 2D point, as passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1605 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1606 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1607 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1608 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1609 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1610 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1611 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1612 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1613 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1614 |
|
1932 | 1615 |
#ifdef OPENGL |
1616 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1617 |
cmov2i(c_x, c_y); |
1932 | 1618 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1619 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1620 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1621 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1622 |
"Modified: 22.3.1996 / 18:17:43 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1623 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1624 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1625 |
glxCmov2sX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1626 |
"change the character position to a 2D point, as passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1627 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1628 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1629 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1630 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1631 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1632 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1633 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1634 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1635 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1636 |
|
1932 | 1637 |
#ifdef OPENGL |
1638 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1639 |
cmov2s(c_x, c_y); |
1932 | 1640 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1641 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1642 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1643 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1644 |
"Modified: 22.3.1996 / 18:17:47 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1645 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1646 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1647 |
glxCmovX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1648 |
"change the character position to a 3D point, as passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1649 |
The arguments may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1650 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1651 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1652 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1653 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1654 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1655 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1656 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1657 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1658 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1659 |
|
1932 | 1660 |
#ifdef OPENGL |
1661 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1662 |
cmov(c_x, c_y, c_z); |
1932 | 1663 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1664 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1665 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1666 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1667 |
"Modified: 22.3.1996 / 18:17:22 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1668 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1669 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1670 |
glxCmoviX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1671 |
"change the character position to a 3D point, as passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1672 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1673 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1674 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1675 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1676 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1677 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1678 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1679 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1680 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1681 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1682 |
|
1932 | 1683 |
#ifdef OPENGL |
1684 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1685 |
cmovi(c_x, c_y, c_z); |
1932 | 1686 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1687 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1688 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1689 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1690 |
"Modified: 22.3.1996 / 18:17:55 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1691 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1692 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1693 |
glxCmovsX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1694 |
"change the character position to a 3D point, as passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1695 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1696 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1697 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1698 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1699 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1700 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1701 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1702 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1703 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1704 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1705 |
|
1932 | 1706 |
#ifdef OPENGL |
1707 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1708 |
cmovs(c_x, c_y, c_z); |
1932 | 1709 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1710 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1711 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1712 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1713 |
"Modified: 22.3.1996 / 18:17:59 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1714 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1715 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1716 |
glxGetcposIn: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1717 |
"Return the current character position as a point with integer coordinates" |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1718 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1719 |
| x y | |
4718 | 1720 |
%{ |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1721 |
short s_x, s_y; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1722 |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1723 |
SETWIN(aGLXWindowId) |
1932 | 1724 |
#ifdef OPENGL |
1725 |
#else |
|
1726 |
# ifdef GLX |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1727 |
getcpos(&s_x, &s_y); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1728 |
x = __MKSMALLINT(s_x); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1729 |
y = __MKSMALLINT(s_y); |
1932 | 1730 |
# endif |
1731 |
#endif |
|
1732 |
%}. |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1733 |
^x @ y |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1734 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1735 |
|
294 | 1736 |
!GLXWorkstation methodsFor:'clearing'! |
1737 |
||
1738 |
glxClearIn:aGLXWindowId |
|
1739 |
"clear to current color" |
|
1740 |
||
1741 |
%{ /* NOCONTEXT */ |
|
1742 |
SETWIN(aGLXWindowId) |
|
1932 | 1743 |
#ifdef OPENGL |
1744 |
#else |
|
294 | 1745 |
clear(); |
1932 | 1746 |
#endif |
294 | 1747 |
%} |
1748 |
! |
|
1749 |
||
1750 |
glxCzclearCval:cval zval:zval in:aGLXWindowId |
|
1751 |
"clear to a color (cval) and clear z buffer to zval simultaniously" |
|
1752 |
||
1753 |
%{ /* NOCONTEXT */ |
|
1932 | 1754 |
SETWIN(aGLXWindowId) |
1755 |
#ifdef OPENGL |
|
1756 |
#else |
|
1757 |
# ifdef GLX |
|
294 | 1758 |
czclear((ulong)__intVal(cval), __intVal(zval)); |
1932 | 1759 |
# endif |
1760 |
#endif |
|
1761 |
%} |
|
294 | 1762 |
! |
1763 |
||
1764 |
glxZClearIn:aGLXWindowId |
|
1765 |
"clear z buffer" |
|
1766 |
||
1767 |
%{ /* NOCONTEXT */ |
|
1932 | 1768 |
SETWIN(aGLXWindowId) |
1769 |
#ifdef OPENGL |
|
1770 |
#else |
|
1771 |
# ifdef GLX |
|
294 | 1772 |
zclear(); |
1932 | 1773 |
# endif |
1774 |
#endif |
|
1775 |
%} |
|
294 | 1776 |
! ! |
1777 |
||
1778 |
!GLXWorkstation methodsFor:'color'! |
|
1779 |
||
1780 |
glxColor:index in:aGLXWindowId |
|
4718 | 1781 |
"set the drawing color; |
1782 |
for non gouraud shading, we dont care if the argument is integer or float; |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1783 |
otherwise, better results are expected with float values." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1784 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1785 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1786 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1787 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1788 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1789 |
#else |
294 | 1790 |
if (__isSmallInteger(index)) { |
1791 |
color((Colorindex)(__intVal(index))); |
|
1932 | 1792 |
RETURN (self); |
294 | 1793 |
} |
1794 |
if (__isFloat(index)) { |
|
1795 |
colorf((float)(_floatVal(index))); |
|
1932 | 1796 |
RETURN (self); |
294 | 1797 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1798 |
#endif |
1932 | 1799 |
%} |
294 | 1800 |
! |
1801 |
||
1802 |
glxColorRed:r green:g blue:b alpha:a in:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1803 |
"set the drawing color, including alpha value. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1804 |
The args must be integer values within 0..255" |
294 | 1805 |
|
1806 |
%{ /* NOCONTEXT */ |
|
1807 |
short s_r, s_g, s_b, s_a; |
|
1808 |
||
1809 |
_INT_(r, s_r); |
|
1810 |
_INT_(g, s_g); |
|
1811 |
_INT_(b, s_b); |
|
1812 |
_INT_(a, s_a); |
|
1813 |
SETWIN(aGLXWindowId) |
|
1932 | 1814 |
#ifdef GLX |
294 | 1815 |
cpack((((((s_a<<8) | s_b) << 8) | s_g) << 8) | s_r); |
1932 | 1816 |
#endif |
1817 |
%} |
|
294 | 1818 |
! |
1819 |
||
1820 |
glxColorRed:r green:g blue:b in:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1821 |
"set the drawing color. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1822 |
The args must be integer values in 0..255" |
294 | 1823 |
|
1824 |
%{ /* NOCONTEXT */ |
|
1825 |
short s_r, s_g, s_b; |
|
1826 |
||
1827 |
_INT_(r, s_r); |
|
1828 |
_INT_(g, s_g); |
|
1829 |
_INT_(b, s_b); |
|
1830 |
SETWIN(aGLXWindowId) |
|
1932 | 1831 |
#ifdef GLX |
294 | 1832 |
RGBcolor(s_r, s_g, s_b); |
1932 | 1833 |
#endif |
1834 |
%} |
|
294 | 1835 |
! |
1836 |
||
528 | 1837 |
glxLrgbrangeRmin: rmin gmin: gmin bmin: bmin rmax: rmax gmax: gmax bmax: bmax |
1838 |
znear: znear zfar: zfar in: aGLXWindowId |
|
1839 |
||
1840 |
%{ /* NOCONTEXT */ |
|
1932 | 1841 |
SETWIN(aGLXWindowId) |
1842 |
#ifdef GLX |
|
4718 | 1843 |
lRGBrange(_shortVal(rmin), _shortVal(gmin), _shortVal(bmin), |
1844 |
_shortVal(rmax), _shortVal(gmax), _shortVal(bmax), |
|
528 | 1845 |
_longVal(znear), _longVal(zfar)); |
1932 | 1846 |
#endif |
1847 |
%} |
|
528 | 1848 |
! |
1849 |
||
1850 |
glxMapcolorI: i red: red green: green blue: blue in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1851 |
"change a color in the color lookup table (i.e. in COLOR_INDEX mode). |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1852 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1853 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1854 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1855 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1856 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1857 |
#else |
528 | 1858 |
mapcolor(_colorindexVal(i), _shortVal(red), _shortVal(green), _shortVal(blue)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1859 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1860 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1861 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1862 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1863 |
glxTextcolor:tcolor in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1864 |
"change the color used for text drawing" |
294 | 1865 |
|
1866 |
%{ /* NOCONTEXT */ |
|
1932 | 1867 |
SETWIN(aGLXWindowId) |
1868 |
#ifdef GLX |
|
294 | 1869 |
textcolor(_colorindexVal(tcolor)); |
1932 | 1870 |
#endif |
1871 |
%} |
|
294 | 1872 |
! ! |
1873 |
||
528 | 1874 |
!GLXWorkstation methodsFor:'curves'! |
1875 |
||
1876 |
glxCurvebasis: basid in: aGLXWindowId |
|
1877 |
"sets the basis type of curves" |
|
1878 |
||
1879 |
%{ /* NOCONTEXT */ |
|
1880 |
SETWIN(aGLXWindowId) |
|
1932 | 1881 |
#ifdef GLX |
528 | 1882 |
curvebasis(_shortVal(basid)); |
1932 | 1883 |
#endif |
528 | 1884 |
%} |
1885 |
||
1886 |
"Modified: 19.3.1996 / 18:47:09 / cg" |
|
1887 |
! |
|
1888 |
||
1889 |
glxCurveit: iterationcount in: aGLXWindowId |
|
1890 |
"Iterates the top matrix on the stack as a forward difference |
|
1891 |
matrix, drawing as it goes along." |
|
1892 |
||
1893 |
%{ /* NOCONTEXT */ |
|
1894 |
SETWIN(aGLXWindowId) |
|
1932 | 1895 |
#ifdef GLX |
528 | 1896 |
curveit(_shortVal(iterationcount)); |
1932 | 1897 |
#endif |
528 | 1898 |
%} |
1899 |
||
1900 |
"Modified: 19.3.1996 / 18:48:57 / cg" |
|
1901 |
! |
|
1902 |
||
1903 |
glxCurveprecision: nsegments in: aGLXWindowId |
|
1904 |
"sets the number of line segments that make up a curve segment" |
|
1905 |
||
1906 |
%{ /* NOCONTEXT */ |
|
1907 |
SETWIN(aGLXWindowId) |
|
1932 | 1908 |
#ifdef GLX |
528 | 1909 |
curveprecision(_shortVal(nsegments)); |
1932 | 1910 |
#endif |
528 | 1911 |
%} |
1912 |
||
1913 |
"Modified: 19.3.1996 / 18:47:43 / cg" |
|
1914 |
! ! |
|
1915 |
||
294 | 1916 |
!GLXWorkstation methodsFor:'double buffering'! |
1917 |
||
1918 |
glxBackBufferIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1919 |
"switch to back buffer drawing - turning frontbuffer drawing off" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1920 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1921 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1922 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1923 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1924 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1925 |
# ifdef GLX |
294 | 1926 |
frontbuffer(FALSE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1927 |
# endif |
294 | 1928 |
backbuffer(TRUE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1929 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1930 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1931 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1932 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1933 |
glxBackbuffer:b in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1934 |
"turn backBuffer drawing on/off. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1935 |
Notice: VGL is not able to draw into both buffers at the same time ... |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1936 |
... enabling the backbuffer automatically disables frontbuffer drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1937 |
and vice versa. This seems not to be the case with a true GL." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1938 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1939 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1940 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1941 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1942 |
#else |
294 | 1943 |
backbuffer(_booleanVal(b)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1944 |
#endif |
294 | 1945 |
%} |
528 | 1946 |
|
1947 |
"Modified: 19.3.1996 / 18:45:05 / cg" |
|
294 | 1948 |
! |
1949 |
||
1950 |
glxDoubleBufferIn:aGLXWindowId |
|
1951 |
"set double buffer mode" |
|
1952 |
||
1953 |
%{ /* NOCONTEXT */ |
|
1954 |
SETWIN(aGLXWindowId) |
|
1932 | 1955 |
#ifdef OPENGL |
1956 |
#else |
|
294 | 1957 |
doublebuffer(); |
1932 | 1958 |
#endif |
294 | 1959 |
%} |
1960 |
! |
|
1961 |
||
1962 |
glxFrontBufferIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1963 |
"switch to front buffer drawing - turning backbuffer drawing off" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1964 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1965 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1966 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1967 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1968 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1969 |
# ifdef GLX |
294 | 1970 |
backbuffer(FALSE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1971 |
# endif |
294 | 1972 |
frontbuffer(TRUE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1973 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1974 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1975 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1976 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1977 |
glxFrontbuffer:b in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1978 |
"turn on/off frontbuffer drawing. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1979 |
Notice: VGL is not able to draw into both buffers at the same time ... |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1980 |
... enabling the backbuffer automatically disables frontbuffer drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1981 |
and vice versa. This seems not to be the case with a true GL." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1982 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1983 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1984 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1985 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1986 |
#else |
294 | 1987 |
frontbuffer(_booleanVal(b)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1988 |
#endif |
294 | 1989 |
%} |
528 | 1990 |
|
1991 |
"Modified: 19.3.1996 / 18:45:31 / cg" |
|
294 | 1992 |
! |
1993 |
||
1994 |
glxSingleBufferIn: aGLXWindowId |
|
1995 |
"set single buffer mode" |
|
1996 |
||
1997 |
%{ /* NOCONTEXT */ |
|
1998 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1999 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2000 |
#else |
294 | 2001 |
singlebuffer(); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2002 |
#endif |
294 | 2003 |
%} |
2004 |
! |
|
2005 |
||
2006 |
glxSwapBuffersIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2007 |
"swap the back and front buffers. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2008 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2009 |
To animate things smoothly, draw into the backBuffer while the frontBuffer is |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2010 |
displayed and swap them for every frame." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2011 |
|
1903 | 2012 |
%{ /* UNLIMITEDSTACK */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2013 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2014 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2015 |
#else |
294 | 2016 |
swapbuffers(); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2017 |
#endif |
294 | 2018 |
%} |
528 | 2019 |
|
2020 |
"Modified: 19.3.1996 / 18:45:47 / cg" |
|
294 | 2021 |
! ! |
2022 |
||
2023 |
!GLXWorkstation methodsFor:'flat drawing'! |
|
2024 |
||
2025 |
glxBeginClosedLineIn:aGLXWindowId |
|
2026 |
"start a closed line" |
|
2027 |
||
2028 |
%{ /* NOCONTEXT */ |
|
1932 | 2029 |
#ifdef OPENGL |
2030 |
#else |
|
294 | 2031 |
SETWIN(aGLXWindowId) |
2032 |
bgnclosedline(); |
|
1932 | 2033 |
#endif |
294 | 2034 |
%} |
2035 |
! |
|
2036 |
||
2037 |
glxBeginLineIn:aGLXWindowId |
|
2038 |
"start a line group" |
|
2039 |
||
2075 | 2040 |
%{ /* NOCONTEXT STACK:32000 */ |
1932 | 2041 |
#ifdef OPENGL |
2042 |
#else |
|
294 | 2043 |
SETWIN(aGLXWindowId) |
2044 |
bgnline(); |
|
1932 | 2045 |
#endif |
294 | 2046 |
%} |
2047 |
! |
|
2048 |
||
2049 |
glxBeginPointIn:aGLXWindowId |
|
2050 |
"start a point-group" |
|
2051 |
||
2052 |
%{ /* NOCONTEXT */ |
|
1932 | 2053 |
#ifdef OPENGL |
2054 |
#else |
|
294 | 2055 |
SETWIN(aGLXWindowId) |
2056 |
bgnpoint(); |
|
1932 | 2057 |
#endif |
294 | 2058 |
%} |
2059 |
! |
|
2060 |
||
2061 |
glxBeginPolygonIn:aGLXWindowId |
|
2062 |
"start a polygon" |
|
2063 |
||
2064 |
%{ /* NOCONTEXT */ |
|
1932 | 2065 |
#ifdef OPENGL |
2066 |
#else |
|
294 | 2067 |
SETWIN(aGLXWindowId) |
2068 |
bgnpolygon(); |
|
1932 | 2069 |
#endif |
294 | 2070 |
%} |
2071 |
! |
|
2072 |
||
2073 |
glxBeginQuadrilateralStripIn:aGLXWindowId |
|
2074 |
"start a quadrilateral strip" |
|
2075 |
||
2076 |
%{ /* NOCONTEXT */ |
|
1932 | 2077 |
#ifdef OPENGL |
2078 |
#else |
|
294 | 2079 |
SETWIN(aGLXWindowId) |
2080 |
bgnqstrip(); |
|
1932 | 2081 |
#endif |
294 | 2082 |
%} |
2083 |
! |
|
2084 |
||
2085 |
glxBeginTriangleMeshIn:aGLXWindowId |
|
2086 |
"start a triangle mesh" |
|
2087 |
||
2088 |
%{ /* NOCONTEXT */ |
|
1932 | 2089 |
#ifdef OPENGL |
2090 |
#else |
|
294 | 2091 |
SETWIN(aGLXWindowId) |
2092 |
bgntmesh(); |
|
1932 | 2093 |
#endif |
294 | 2094 |
%} |
2095 |
! |
|
2096 |
||
2097 |
glxEndClosedLineIn:aGLXWindowId |
|
2098 |
"end a closed line" |
|
2099 |
||
2100 |
%{ /* NOCONTEXT */ |
|
1932 | 2101 |
#ifdef OPENGL |
2102 |
#else |
|
294 | 2103 |
SETWIN(aGLXWindowId) |
2104 |
endclosedline(); |
|
1932 | 2105 |
#endif |
294 | 2106 |
%} |
2107 |
! |
|
2108 |
||
2109 |
glxEndLineIn:aGLXWindowId |
|
2110 |
"end a line group" |
|
2111 |
||
2075 | 2112 |
%{ /* NOCONTEXT STACK:32000 */ |
1932 | 2113 |
#ifdef OPENGL |
2114 |
#else |
|
294 | 2115 |
SETWIN(aGLXWindowId) |
2116 |
endline(); |
|
1932 | 2117 |
#endif |
294 | 2118 |
%} |
2119 |
! |
|
2120 |
||
2121 |
glxEndPointIn:aGLXWindowId |
|
2122 |
"end a point group" |
|
2123 |
||
2124 |
%{ /* NOCONTEXT */ |
|
1932 | 2125 |
#ifdef OPENGL |
2126 |
#else |
|
294 | 2127 |
SETWIN(aGLXWindowId) |
2128 |
endpoint(); |
|
1932 | 2129 |
#endif |
294 | 2130 |
%} |
2131 |
! |
|
2132 |
||
2133 |
glxEndPolygonIn:aGLXWindowId |
|
2134 |
"end a polygon" |
|
2135 |
||
2136 |
%{ /* NOCONTEXT */ |
|
1932 | 2137 |
#ifdef OPENGL |
2138 |
#else |
|
294 | 2139 |
SETWIN(aGLXWindowId) |
2140 |
endpolygon(); |
|
1932 | 2141 |
#endif |
294 | 2142 |
%} |
2143 |
! |
|
2144 |
||
2145 |
glxEndQuadrilateralStripIn:aGLXWindowId |
|
2146 |
"end a quadrilateral strip" |
|
2147 |
||
2148 |
%{ /* NOCONTEXT */ |
|
1932 | 2149 |
#ifdef OPENGL |
2150 |
#else |
|
294 | 2151 |
SETWIN(aGLXWindowId) |
2152 |
endqstrip(); |
|
1932 | 2153 |
#endif |
294 | 2154 |
%} |
2155 |
! |
|
2156 |
||
2157 |
glxEndTriangleMeshIn:aGLXWindowId |
|
2158 |
"end a triangle mesh" |
|
2159 |
||
2160 |
%{ /* NOCONTEXT */ |
|
1932 | 2161 |
#ifdef OPENGL |
2162 |
#else |
|
294 | 2163 |
SETWIN(aGLXWindowId) |
2164 |
endtmesh(); |
|
1932 | 2165 |
#endif |
168 | 2166 |
%} |
2167 |
! ! |
|
2168 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2169 |
!GLXWorkstation methodsFor:'graphics position'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2170 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2171 |
glxMove2:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2172 |
"change the graphics position to a 2D point, as passed in vector v" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2173 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2174 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2175 |
float vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2176 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2177 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2178 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2179 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2180 |
#else |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2181 |
move2((Coord)(c_v[0]), (Coord)(c_v[1])); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2182 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2183 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2184 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2185 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2186 |
"Modified: 22.3.1996 / 18:15:23 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2187 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2188 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2189 |
glxMove2X: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2190 |
"change the graphics position to a 2D point, as passed in x/y" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2191 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2192 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2193 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2194 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2195 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2196 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2197 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2198 |
SETWIN(aGLXWindowId) |
1932 | 2199 |
#ifdef OPENGL |
2200 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2201 |
move2(c_x, c_y); |
1932 | 2202 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2203 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2204 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2205 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2206 |
"Modified: 22.3.1996 / 18:15:02 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2207 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2208 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2209 |
glxMove2iX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2210 |
"change the graphics position to a 2D point, as passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2211 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2212 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2213 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2214 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2215 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2216 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2217 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2218 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2219 |
SETWIN(aGLXWindowId) |
1932 | 2220 |
#ifdef OPENGL |
2221 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2222 |
move2i(c_x, c_y); |
1932 | 2223 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2224 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2225 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2226 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2227 |
"Modified: 22.3.1996 / 18:15:08 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2228 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2229 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2230 |
glxMove2sX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2231 |
"change the graphics position to a 2D point, as passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2232 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2233 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2234 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2235 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2236 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2237 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2238 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2239 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2240 |
SETWIN(aGLXWindowId) |
1932 | 2241 |
#ifdef OPENGL |
2242 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2243 |
move2s(c_x, c_y); |
1932 | 2244 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2245 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2246 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2247 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2248 |
"Modified: 22.3.1996 / 18:15:13 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2249 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2250 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2251 |
glxMove:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2252 |
"change the graphics position to a 3D point, as passed in vector v" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2253 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2254 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2255 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2256 |
float vec[3], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2257 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2258 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2259 |
SETWIN(aGLXWindowId) |
1932 | 2260 |
#ifdef OPENGL |
2261 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2262 |
move((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
1932 | 2263 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2264 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2265 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2266 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2267 |
"Modified: 22.3.1996 / 18:14:29 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2268 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2269 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2270 |
glxMoveX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2271 |
"change the graphics position to a 3D point, as passed in x/y/z" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2272 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2273 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2274 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2275 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2276 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2277 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2278 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2279 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2280 |
SETWIN(aGLXWindowId) |
1932 | 2281 |
#ifdef OPENGL |
2282 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2283 |
move(c_x, c_y, c_z); |
1932 | 2284 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2285 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2286 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2287 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2288 |
"Modified: 22.3.1996 / 18:14:38 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2289 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2290 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2291 |
glxMoveiX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2292 |
"change the graphics position to a 3D point, as passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2293 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2294 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2295 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2296 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2297 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2298 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2299 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2300 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2301 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2302 |
SETWIN(aGLXWindowId) |
1932 | 2303 |
#ifdef OPENGL |
2304 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2305 |
movei(c_x, c_y, c_z); |
1932 | 2306 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2307 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2308 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2309 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2310 |
"Modified: 22.3.1996 / 18:14:44 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2311 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2312 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2313 |
glxMovesX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2314 |
"change the graphics position to a 3D point, as passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2315 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2316 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2317 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2318 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2319 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2320 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2321 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2322 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2323 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2324 |
SETWIN(aGLXWindowId) |
1932 | 2325 |
#ifdef OPENGL |
2326 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2327 |
moves(c_x, c_y, c_z); |
1932 | 2328 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2329 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2330 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2331 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2332 |
"Modified: 22.3.1996 / 18:14:48 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2333 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2334 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2335 |
glxRmv2:v in: aGLXWindowId |
4718 | 2336 |
"change the graphics position to a 2D point, |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2337 |
the relative distance is passed in vector v" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2338 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2339 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2340 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2341 |
float vec[2], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2342 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2343 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2344 |
SETWIN(aGLXWindowId) |
1932 | 2345 |
#ifdef OPENGL |
2346 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2347 |
rmv2((Coord)(c_v[0]), (Coord)(c_v[1])); |
1932 | 2348 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2349 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2350 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2351 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2352 |
"Modified: 22.3.1996 / 18:15:57 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2353 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2354 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2355 |
glxRmv2X: x y: y in: aGLXWindowId |
4718 | 2356 |
"change the graphics position to a 2D point, |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2357 |
the relative distance is passed in x/y" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2358 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2359 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2360 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2361 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2362 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2363 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2364 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2365 |
SETWIN(aGLXWindowId) |
1932 | 2366 |
#ifdef OPENGL |
2367 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2368 |
rmv2(c_x, c_y); |
1932 | 2369 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2370 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2371 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2372 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2373 |
"Modified: 22.3.1996 / 18:16:42 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2374 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2375 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2376 |
glxRmv2iX: x y: y in: aGLXWindowId |
4718 | 2377 |
"change the graphics position to a 2D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2378 |
the relative distance is passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2379 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2380 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2381 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2382 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2383 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2384 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2385 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2386 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2387 |
SETWIN(aGLXWindowId) |
1932 | 2388 |
#ifdef OPENGL |
2389 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2390 |
rmv2i(c_x, c_y); |
1932 | 2391 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2392 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2393 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2394 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2395 |
"Modified: 22.3.1996 / 18:16:39 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2396 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2397 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2398 |
glxRmv2sX: x y: y in: aGLXWindowId |
4718 | 2399 |
"change the graphics position to a 2D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2400 |
the relative distance is passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2401 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2402 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2403 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2404 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2405 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2406 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2407 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2408 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2409 |
SETWIN(aGLXWindowId) |
1932 | 2410 |
#ifdef OPENGL |
2411 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2412 |
rmv2s(c_x, c_y); |
1932 | 2413 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2414 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2415 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2416 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2417 |
"Modified: 22.3.1996 / 18:16:33 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2418 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2419 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2420 |
glxRmv:v in: aGLXWindowId |
4718 | 2421 |
"change the graphics position to a 3D point, |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2422 |
the relative distance is passed in vector v" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2423 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2424 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2425 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2426 |
float vec[3], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2427 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2428 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2429 |
SETWIN(aGLXWindowId) |
1932 | 2430 |
#ifdef OPENGL |
2431 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2432 |
rmv((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
1932 | 2433 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2434 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2435 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2436 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2437 |
"Modified: 22.3.1996 / 18:16:08 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2438 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2439 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2440 |
glxRmvX: x y: y z: z in: aGLXWindowId |
4718 | 2441 |
"change the graphics position to a 3D point, |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2442 |
the relative distance is passed in x/y/z" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2443 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2444 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2445 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2446 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2447 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2448 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2449 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2450 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2451 |
SETWIN(aGLXWindowId) |
1932 | 2452 |
#ifdef OPENGL |
2453 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2454 |
rmv(c_x, c_y, c_z); |
1932 | 2455 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2456 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2457 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2458 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2459 |
"Modified: 22.3.1996 / 18:16:16 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2460 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2461 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2462 |
glxRmviX: x y: y z: z in: aGLXWindowId |
4718 | 2463 |
"change the graphics position to a 3D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2464 |
the relative distance is passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2465 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2466 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2467 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2468 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2469 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2470 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2471 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2472 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2473 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2474 |
SETWIN(aGLXWindowId) |
1932 | 2475 |
#ifdef OPENGL |
2476 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2477 |
rmvi(c_x, c_y, c_z); |
1932 | 2478 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2479 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2480 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2481 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2482 |
"Modified: 22.3.1996 / 18:16:21 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2483 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2484 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2485 |
glxRmvsX: x y: y z: z in: aGLXWindowId |
4718 | 2486 |
"change the graphics position to a 3D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2487 |
the relative distance is passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2488 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2489 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2490 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2491 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2492 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2493 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2494 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2495 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2496 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2497 |
SETWIN(aGLXWindowId) |
1932 | 2498 |
#ifdef OPENGL |
2499 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2500 |
rmvs(c_x, c_y, c_z); |
1932 | 2501 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2502 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2503 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2504 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2505 |
"Modified: 22.3.1996 / 18:16:25 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2506 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2507 |
|
168 | 2508 |
!GLXWorkstation methodsFor:'initialization'! |
2509 |
||
2510 |
initializeFor:aDisplayName |
|
169 | 2511 |
(super initializeFor:aDisplayName) isNil ifTrue:[^ nil]. |
168 | 2512 |
%{ |
2513 |
if (_INST(displayId) != nil) { |
|
185 | 2514 |
XSetErrorHandler(__XErrorHandler__); |
2515 |
} |
|
2516 |
%} |
|
2517 |
! |
|
2518 |
||
2519 |
initializeScreenProperties |
|
2520 |
super initializeScreenProperties. |
|
2521 |
||
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2522 |
"/ 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
|
2523 |
"/ 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
|
2524 |
"/ 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
|
2525 |
"/ 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
|
2526 |
"/ 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
|
2527 |
"/ 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
|
2528 |
"/ 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
|
2529 |
"/ have no documentation). |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2530 |
"/ Late note: setting the ForceGL classVar overrides above behavior. |
4718 | 2531 |
"/ it may be set from a startupScript with: 'GLXWorkstation forceGL:true' |
2532 |
"/ however: be careful: only set it to true, if you are certain that remoteGL works |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2533 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2534 |
(self isTrueGL and:[ForceGL ~~ true]) ifTrue:[ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2535 |
glOK := (displayName = ':0') or:[displayName = ':0.0']. |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2536 |
] ifFalse:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2537 |
glOK := true. |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2538 |
]. |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2539 |
|
185 | 2540 |
%{ |
2541 |
Display *dpy = myDpy; |
|
2542 |
int dummy; |
|
2543 |
||
2544 |
if (ISCONNECTED) { |
|
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2545 |
_INST(hasStereoExtension) = false; |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2546 |
|
1932 | 2547 |
#if defined(XSGIStereo) && defined(GLX) |
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2548 |
if (_INST(glOK) == true) { |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2549 |
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
|
2550 |
_INST(hasStereoExtension) = true; |
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2551 |
} |
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2552 |
#endif |
168 | 2553 |
} |
2554 |
%} |
|
2555 |
! ! |
|
2556 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2557 |
!GLXWorkstation methodsFor:'lines'! |
528 | 2558 |
|
2559 |
glxDeflinestyleN: n ls: ls in: aGLXWindowId |
|
2560 |
"define a line style" |
|
2561 |
||
2562 |
%{ /* NOCONTEXT */ |
|
1932 | 2563 |
SETWIN(aGLXWindowId) |
2564 |
#ifdef OPENGL |
|
2565 |
#else |
|
528 | 2566 |
deflinestyle(_shortVal(n), _linestyleVal(ls)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2567 |
#endif |
528 | 2568 |
%} |
2569 |
! |
|
2570 |
||
2571 |
glxDraw2:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2572 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2573 |
to a new 2D position, passed in vector v." |
528 | 2574 |
|
2575 |
%{ /* NOCONTEXT */ |
|
2576 |
float vec[2], *c_v; |
|
2577 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2578 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2579 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2580 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2581 |
#else |
528 | 2582 |
draw2((Coord)(c_v[0]), (Coord)(c_v[1])); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2583 |
#endif |
528 | 2584 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2585 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2586 |
"Modified: 22.3.1996 / 18:03:29 / cg" |
528 | 2587 |
! |
2588 |
||
2589 |
glxDraw2X: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2590 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2591 |
to a new 2D position, passed in x/y." |
528 | 2592 |
|
2593 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2594 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2595 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2596 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2597 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2598 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2599 |
SETWIN(aGLXWindowId) |
1932 | 2600 |
#ifdef OPENGL |
2601 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2602 |
draw2(c_x, c_y); |
1932 | 2603 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2604 |
} |
528 | 2605 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2606 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2607 |
"Modified: 22.3.1996 / 18:03:50 / cg" |
528 | 2608 |
! |
2609 |
||
2610 |
glxDraw2iX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2611 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2612 |
to a new 2D position, passed in x/y." |
528 | 2613 |
|
2614 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2615 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2616 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2617 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2618 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2619 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2620 |
SETWIN(aGLXWindowId) |
1932 | 2621 |
#ifdef OPENGL |
2622 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2623 |
draw2i(c_x, c_y); |
1932 | 2624 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2625 |
} |
528 | 2626 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2627 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2628 |
"Modified: 22.3.1996 / 18:04:07 / cg" |
528 | 2629 |
! |
2630 |
||
2631 |
glxDraw2sX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2632 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2633 |
to a new 2D position, passed in x/y." |
528 | 2634 |
|
2635 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2636 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2637 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2638 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2639 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2640 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2641 |
SETWIN(aGLXWindowId) |
1932 | 2642 |
#ifdef OPENGL |
2643 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2644 |
draw2s(c_x, c_y); |
1932 | 2645 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2646 |
} |
528 | 2647 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2648 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2649 |
"Modified: 22.3.1996 / 18:04:19 / cg" |
528 | 2650 |
! |
2651 |
||
2652 |
glxDraw:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2653 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2654 |
to a new 3D position, passed in vector v." |
528 | 2655 |
|
2656 |
%{ /* NOCONTEXT */ |
|
2657 |
float vec[3], *c_v; |
|
2658 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2659 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2660 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2661 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2662 |
#else |
528 | 2663 |
draw((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2664 |
#endif |
528 | 2665 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2666 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2667 |
"Modified: 22.3.1996 / 18:04:34 / cg" |
528 | 2668 |
! |
2669 |
||
2670 |
glxDrawX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2671 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2672 |
to a new 3D position, passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2673 |
The arguments may be floats, fractions or smallIntegers" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2674 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2675 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2676 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2677 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2678 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2679 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2680 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2681 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2682 |
SETWIN(aGLXWindowId) |
1932 | 2683 |
#ifdef OPENGL |
2684 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2685 |
draw(c_x, c_y, c_z); |
1932 | 2686 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2687 |
} |
528 | 2688 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2689 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2690 |
"Modified: 22.3.1996 / 18:04:46 / cg" |
528 | 2691 |
! |
2692 |
||
2693 |
glxDrawiX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2694 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2695 |
to a new 3D position, passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2696 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2697 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2698 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2699 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2700 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2701 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2702 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2703 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2704 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2705 |
SETWIN(aGLXWindowId) |
1932 | 2706 |
#ifdef OPENGL |
2707 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2708 |
drawi(c_x, c_y, c_z); |
1932 | 2709 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2710 |
} |
528 | 2711 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2712 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2713 |
"Modified: 22.3.1996 / 18:04:54 / cg" |
528 | 2714 |
! |
2715 |
||
2716 |
glxDrawsX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2717 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2718 |
to a new 3D position, passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2719 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2720 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2721 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2722 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2723 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2724 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2725 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2726 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2727 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2728 |
SETWIN(aGLXWindowId) |
1932 | 2729 |
#ifdef OPENGL |
2730 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2731 |
draws(c_x, c_y, c_z); |
1932 | 2732 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2733 |
} |
528 | 2734 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2735 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2736 |
"Modified: 22.3.1996 / 18:05:01 / cg" |
528 | 2737 |
! |
2738 |
||
2739 |
glxLinewidth: n in: aGLXWindowId |
|
2740 |
"set the linewidth" |
|
2741 |
||
2742 |
%{ /* NOCONTEXT */ |
|
2743 |
SETWIN(aGLXWindowId) |
|
1932 | 2744 |
#ifdef OPENGL |
2745 |
#else |
|
528 | 2746 |
linewidth(_shortVal(n)); |
1932 | 2747 |
#endif |
528 | 2748 |
%} |
2749 |
! |
|
2750 |
||
2751 |
glxLinewidthf: n in: aGLXWindowId |
|
2752 |
"set the linewidth" |
|
2753 |
||
2754 |
%{ /* NOCONTEXT */ |
|
2755 |
SETWIN(aGLXWindowId) |
|
1932 | 2756 |
#ifdef OPENGL |
2757 |
#else |
|
528 | 2758 |
linewidthf(_floatVal(n)); |
1932 | 2759 |
#endif |
528 | 2760 |
RETURN (true); |
2761 |
%} |
|
2762 |
! |
|
2763 |
||
2764 |
glxRdr2:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2765 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2766 |
to a new 2D position, passing the relative distance in the vector v." |
528 | 2767 |
|
2768 |
%{ /* NOCONTEXT */ |
|
2769 |
float vec[2], *c_v; |
|
2770 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2771 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
528 | 2772 |
SETWIN(aGLXWindowId) |
1932 | 2773 |
#ifdef OPENGL |
2774 |
#else |
|
528 | 2775 |
rdr2((Coord)(c_v[0]), (Coord)(c_v[1])); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2776 |
#endif |
528 | 2777 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2778 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2779 |
"Modified: 22.3.1996 / 18:05:54 / cg" |
528 | 2780 |
! |
2781 |
||
2782 |
glxRdr2X: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2783 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2784 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2785 |
|
2786 |
%{ /* NOCONTEXT */ |
|
2787 |
Coord c_x, c_y; |
|
2788 |
||
2789 |
_COORD_ (x, c_x) |
|
2790 |
_COORD_ (y, c_y) |
|
2791 |
SETWIN(aGLXWindowId) |
|
1932 | 2792 |
#ifdef OPENGL |
2793 |
#else |
|
528 | 2794 |
rdr2(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2795 |
#endif |
528 | 2796 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2797 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2798 |
"Modified: 22.3.1996 / 18:06:20 / cg" |
528 | 2799 |
! |
2800 |
||
2801 |
glxRdr2iX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2802 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2803 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2804 |
|
2805 |
%{ /* NOCONTEXT */ |
|
2806 |
Icoord c_x, c_y; |
|
2807 |
||
2808 |
_ICOORD_ (x, c_x) |
|
2809 |
_ICOORD_ (y, c_y) |
|
2810 |
SETWIN(aGLXWindowId) |
|
1932 | 2811 |
#ifdef OPENGL |
2812 |
#else |
|
528 | 2813 |
rdr2i(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2814 |
#endif |
528 | 2815 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2816 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2817 |
"Modified: 22.3.1996 / 18:06:28 / cg" |
528 | 2818 |
! |
2819 |
||
2820 |
glxRdr2sX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2821 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2822 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2823 |
|
2824 |
%{ /* NOCONTEXT */ |
|
2825 |
Scoord c_x, c_y; |
|
2826 |
||
2827 |
_SCOORD_ (x, c_x) |
|
2828 |
_SCOORD_ (y, c_y) |
|
2829 |
SETWIN(aGLXWindowId) |
|
1932 | 2830 |
#ifdef OPENGL |
2831 |
#else |
|
528 | 2832 |
rdr2s(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2833 |
#endif |
528 | 2834 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2835 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2836 |
"Modified: 22.3.1996 / 18:06:34 / cg" |
528 | 2837 |
! |
2838 |
||
2839 |
glxRdr:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2840 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2841 |
to a new 3D position, passing the relative distance in the vector v." |
528 | 2842 |
|
2843 |
%{ /* NOCONTEXT */ |
|
2844 |
float vec[3], *c_v; |
|
2845 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2846 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
528 | 2847 |
SETWIN(aGLXWindowId) |
1932 | 2848 |
#ifdef OPENGL |
2849 |
#else |
|
528 | 2850 |
rdr((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2851 |
#endif |
528 | 2852 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2853 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2854 |
"Modified: 22.3.1996 / 18:06:07 / cg" |
528 | 2855 |
! |
2856 |
||
2857 |
glxRdrX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2858 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2859 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2860 |
|
2861 |
%{ /* NOCONTEXT */ |
|
2862 |
Coord c_x, c_y, c_z; |
|
2863 |
||
2864 |
_COORD_ (x, c_x) |
|
2865 |
_COORD_ (y, c_y) |
|
2866 |
_COORD_ (z, c_z) |
|
2867 |
SETWIN(aGLXWindowId) |
|
1932 | 2868 |
#ifdef OPENGL |
2869 |
#else |
|
528 | 2870 |
rdr(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2871 |
#endif |
528 | 2872 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2873 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2874 |
"Modified: 22.3.1996 / 18:06:44 / cg" |
528 | 2875 |
! |
2876 |
||
2877 |
glxRdriX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2878 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2879 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2880 |
|
2881 |
%{ /* NOCONTEXT */ |
|
2882 |
Icoord c_x, c_y, c_z; |
|
2883 |
||
2884 |
_ICOORD_ (x, c_x) |
|
2885 |
_ICOORD_ (y, c_y) |
|
2886 |
_ICOORD_ (z, c_z) |
|
2887 |
SETWIN(aGLXWindowId) |
|
1932 | 2888 |
#ifdef OPENGL |
2889 |
#else |
|
528 | 2890 |
rdri(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2891 |
#endif |
528 | 2892 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2893 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2894 |
"Modified: 22.3.1996 / 18:06:51 / cg" |
528 | 2895 |
! |
2896 |
||
2897 |
glxRdrsX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2898 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2899 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2900 |
|
2901 |
%{ /* NOCONTEXT */ |
|
2902 |
Scoord c_x, c_y, c_z; |
|
2903 |
||
2904 |
_SCOORD_ (x, c_x) |
|
2905 |
_SCOORD_ (y, c_y) |
|
2906 |
_SCOORD_ (z, c_z) |
|
2907 |
SETWIN(aGLXWindowId) |
|
1932 | 2908 |
#ifdef OPENGL |
2909 |
#else |
|
528 | 2910 |
rdrs(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2911 |
#endif |
528 | 2912 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2913 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2914 |
"Modified: 22.3.1996 / 18:06:55 / cg" |
528 | 2915 |
! |
2916 |
||
2917 |
glxSetlinestyle: index in: aGLXWindowId |
|
2918 |
"set the linestyle" |
|
2919 |
||
2920 |
%{ /* NOCONTEXT */ |
|
2921 |
SETWIN(aGLXWindowId) |
|
1932 | 2922 |
#ifdef OPENGL |
2923 |
#else |
|
528 | 2924 |
setlinestyle(_shortVal(index)); |
1932 | 2925 |
#endif |
2926 |
%} |
|
528 | 2927 |
! ! |
2928 |
||
294 | 2929 |
!GLXWorkstation methodsFor:'materials & lights'! |
2930 |
||
2931 |
glxLmbind:target index:index in:aGLXWindowId |
|
2932 |
"select a material, light or lighting model. |
|
2933 |
target must be a symbol from: #material, #backMaterial, |
|
2934 |
#light0-light7 or #lightModel." |
|
2935 |
||
2936 |
%{ /* NOCONTEXT */ |
|
2937 |
#ifdef GLX |
|
2938 |
short defType; |
|
2939 |
short i_index; |
|
2940 |
||
2941 |
if (target == @symbol(material)) |
|
2942 |
defType = MATERIAL; |
|
2943 |
else if (target == @symbol(backMaterial)) |
|
2944 |
defType = BACKMATERIAL; |
|
2945 |
else if (target == @symbol(light0)) |
|
2946 |
defType = LIGHT0; |
|
2947 |
else if (target == @symbol(light1)) |
|
2948 |
defType = LIGHT1; |
|
2949 |
else if (target == @symbol(light2)) |
|
2950 |
defType = LIGHT2; |
|
2951 |
else if (target == @symbol(light3)) |
|
2952 |
defType = LIGHT3; |
|
2953 |
else if (target == @symbol(light4)) |
|
2954 |
defType = LIGHT4; |
|
2955 |
else if (target == @symbol(light5)) |
|
2956 |
defType = LIGHT5; |
|
2957 |
else if (target == @symbol(light6)) |
|
2958 |
defType = LIGHT6; |
|
2959 |
else if (target == @symbol(light7)) |
|
2960 |
defType = LIGHT7; |
|
2961 |
else if (target == @symbol(lightModel)) |
|
2962 |
defType = LMODEL; |
|
4718 | 2963 |
else { |
2964 |
RETURN (nil); |
|
294 | 2965 |
} |
2966 |
||
2967 |
_INT_ (index, i_index); |
|
2968 |
SETWIN(aGLXWindowId) |
|
2969 |
lmbind(defType, i_index); |
|
1932 | 2970 |
#endif |
2971 |
%} |
|
294 | 2972 |
! |
2973 |
||
2974 |
glxLmdef:what index:index np:np props:props in:aGLXWindowId |
|
2975 |
"define a material, light source or lighting model; |
|
2976 |
what must be one of #material, #light or #lightModel. |
|
2977 |
props must be a FloatArray or a subclass of FloatArray" |
|
2978 |
||
2979 |
%{ /* NOCONTEXT */ |
|
2980 |
#ifdef GLX |
|
2981 |
short defType; |
|
2982 |
short i_index, i_np; |
|
2983 |
float *fp; |
|
2984 |
OBJ cls; |
|
2985 |
int ninstVars, nInstBytes; |
|
2986 |
||
2987 |
if (what == @symbol(material)) |
|
2988 |
defType = DEFMATERIAL; |
|
2989 |
else if (what == @symbol(light)) |
|
2990 |
defType = DEFLIGHT; |
|
2991 |
else if (what == @symbol(lightModel)) |
|
2992 |
defType = DEFLMODEL; |
|
2993 |
else { |
|
1932 | 2994 |
RETURN (nil); |
294 | 2995 |
} |
2996 |
||
2997 |
_INT_ (index, i_index); |
|
2998 |
_INT_ (np, i_np); |
|
2999 |
||
3000 |
if (! _isNonNilObject(props)) fp = NULL; |
|
3001 |
else { |
|
3002 |
cls = __qClass(props); |
|
350 | 3003 |
if (cls == @global(FloatArray)) |
294 | 3004 |
fp = _FloatArrayInstPtr(props)->f_element; |
3005 |
else { |
|
3006 |
if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) { |
|
3007 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
3008 |
fp = (float *) &(_InstPtr(props)->i_instvars[ninstVars]); |
|
3009 |
} else { |
|
1932 | 3010 |
RETURN (nil); |
294 | 3011 |
} |
4718 | 3012 |
} |
294 | 3013 |
} |
3014 |
SETWIN(aGLXWindowId) |
|
3015 |
lmdef(defType, i_index, i_np, fp); |
|
1932 | 3016 |
#endif |
3017 |
%} |
|
294 | 3018 |
! |
3019 |
||
3020 |
glxTevbind:target index:index in:aGLXWindowId |
|
3021 |
"bind a texture environment; target must be 0 |
|
3022 |
or the symbol #env0." |
|
3023 |
||
3024 |
%{ /* NOCONTEXT */ |
|
3025 |
#ifdef GLX |
|
3026 |
long t; |
|
3027 |
||
3028 |
if (__isSmallInteger(target)) { |
|
3029 |
t = __intVal(target); |
|
3030 |
} else { |
|
3031 |
if (target == @symbol(env0)) { |
|
3032 |
t = TV_ENV0; |
|
3033 |
} else { |
|
1932 | 3034 |
RETURN (nil); |
294 | 3035 |
} |
3036 |
} |
|
3037 |
SETWIN(aGLXWindowId) |
|
3038 |
tevbind(t, __intVal(index)); |
|
1932 | 3039 |
#endif |
3040 |
%} |
|
294 | 3041 |
! |
3042 |
||
3043 |
glxTevdef:index np:np props:props in:aGLXWindowId |
|
3044 |
||
3045 |
%{ /* NOCONTEXT */ |
|
3046 |
#ifdef GLX |
|
3047 |
const float *fp; |
|
3048 |
float fbuff[30]; |
|
3049 |
||
3050 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3051 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
294 | 3052 |
tevdef(__intVal(index), __intVal(np), fp); |
1932 | 3053 |
#endif |
3054 |
%} |
|
294 | 3055 |
! |
3056 |
||
3057 |
glxTexDef2d:index nc:nc width:w height:h bits:image np:np props:props in:aGLXWindowId |
|
3058 |
"define a 2D texture. index is the 'name' of the texture; |
|
3059 |
nc is the number of components (1-4) per pixel; |
|
3060 |
w/h define the size of the texture; bits is a byteArray containing the |
|
3061 |
long-word aligned pixel data; np is the number of props found in |
|
3062 |
the floatArray props. Props must be delimited by a 0.0 entry." |
|
3063 |
||
3064 |
%{ /* NOCONTEXT */ |
|
5479
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3065 |
#ifdef GLX |
294 | 3066 |
unsigned char *cp; |
3067 |
const float *fp; |
|
3068 |
OBJ cls; |
|
3069 |
float fbuff[30]; |
|
3070 |
||
5479
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3071 |
if (__isByteArrayLike(image)) { |
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3072 |
cp = _ByteArrayInstPtr(image)->ba_element; |
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3073 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3074 |
|
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3075 |
SETWIN(aGLXWindowId) |
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3076 |
texdef2d(__intVal(index), __intVal(nc), __intVal(w), __intVal(h), |
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3077 |
(const unsigned long *)cp, __intVal(np), fp); |
294 | 3078 |
} |
3079 |
#endif |
|
3080 |
%} |
|
3081 |
! |
|
3082 |
||
3083 |
glxTexDef3d:index nc:nc width:w height:h depth:d bits:image np:np props:props in:aGLXWindowId |
|
3084 |
"define a 3D texture. index is the 'name' of the texture; |
|
3085 |
nc is the number of components (1-4) per pixel; |
|
3086 |
w/h/d define the size of the texture; bits is a byteArray containing the |
|
3087 |
long-word aligned pixel data; np is the number of props found in |
|
3088 |
the floatArray props. Props must be delimited by a 0.0 entry." |
|
3089 |
||
3090 |
%{ /* NOCONTEXT */ |
|
3091 |
#ifdef GLX |
|
3092 |
unsigned char *cp; |
|
3093 |
const float *fp; |
|
3094 |
OBJ cls; |
|
3095 |
float fbuff[30]; |
|
3096 |
||
5479
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3097 |
if (__isByteArrayLike(image)) { |
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3098 |
cp = _ByteArrayInstPtr(image)->ba_element; |
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3099 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3100 |
|
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3101 |
SETWIN(aGLXWindowId) |
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3102 |
texdef3d(__intVal(index), __intVal(nc), __intVal(w), __intVal(h), |
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3103 |
__intVal(d), |
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3104 |
(const unsigned long *)cp, __intVal(np), fp); |
294 | 3105 |
} |
3106 |
#endif |
|
3107 |
%} |
|
3108 |
! |
|
3109 |
||
3110 |
glxTexbind:target index:index in:aGLXWindowId |
|
3111 |
"bind a texture; target must be an integer or one |
|
3112 |
of the symbols #texture0, #textureDetail or #textureIdle." |
|
3113 |
||
3114 |
%{ /* NOCONTEXT */ |
|
3115 |
#ifdef GLX |
|
3116 |
long t; |
|
3117 |
||
3118 |
if (__isSmallInteger(target)) { |
|
3119 |
t = __intVal(target); |
|
3120 |
} else { |
|
3121 |
if (target == @symbol(texture0)) { |
|
3122 |
t = TX_TEXTURE_0; |
|
3123 |
} else if (target == @symbol(textureDetail)) { |
|
3124 |
t = TX_TEXTURE_DETAIL; |
|
3125 |
} else if (target == @symbol(textureIdle)) { |
|
3126 |
t = TX_TEXTURE_IDLE; |
|
3127 |
} else { |
|
1932 | 3128 |
RETURN (nil); |
294 | 3129 |
} |
3130 |
} |
|
3131 |
SETWIN(aGLXWindowId) |
|
3132 |
texbind(t, __intVal(index)); |
|
1932 | 3133 |
#endif |
3134 |
%} |
|
294 | 3135 |
! ! |
3136 |
||
3137 |
!GLXWorkstation methodsFor:'matrix stack'! |
|
3138 |
||
3139 |
glxGetMatrix:arrayOf16Floats in:aGLXWindowId |
|
3140 |
"argument must be an array (a matrix) of 16 floats. The current matrix |
|
3141 |
will be stored into that." |
|
3142 |
||
3143 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3144 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3145 |
#else |
294 | 3146 |
Matrix matrix; |
3147 |
||
3148 |
SETWIN(aGLXWindowId) |
|
3149 |
getmatrix(matrix); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3150 |
if (! __glx_putFloatsFromInto(matrix, arrayOf16Floats, 16)) RETURN(false); |
1932 | 3151 |
#endif |
3152 |
%} |
|
294 | 3153 |
! |
3154 |
||
3155 |
glxLoadMatrix:arrayOf16Floats in:aGLXWindowId |
|
3156 |
"argument must be an array(a matrix) of 16 floats. The current matrix |
|
3157 |
will be loaded from that." |
|
3158 |
||
3159 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3160 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3161 |
#else |
294 | 3162 |
Matrix matrix; |
3163 |
Matrix *m; |
|
3164 |
||
2814 | 3165 |
if (! (m = __glx_getFloatsFromMatrixInto(arrayOf16Floats, matrix))) RETURN (false); |
294 | 3166 |
SETWIN(aGLXWindowId) |
3167 |
loadmatrix(*m); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3168 |
#endif |
294 | 3169 |
%} |
3170 |
! |
|
3171 |
||
3172 |
glxMultMatrix:arrayOf16Floats in:aGLXWindowId |
|
3173 |
"argument must be an array(a matrix) of 16 floats containing a |
|
3174 |
matrix to multiply into the current matrix." |
|
3175 |
||
3176 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3177 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3178 |
#else |
294 | 3179 |
Matrix matrix; |
3180 |
Matrix *m; |
|
3181 |
||
2814 | 3182 |
if (! (m = __glx_getFloatsFromMatrixInto(arrayOf16Floats, matrix))) RETURN (false); |
294 | 3183 |
SETWIN(aGLXWindowId) |
3184 |
multmatrix(*m); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3185 |
#endif |
294 | 3186 |
%} |
3187 |
! |
|
3188 |
||
3189 |
glxPopmatrixIn:aGLXWindowId |
|
3190 |
"pop transformation stack" |
|
3191 |
||
3192 |
%{ /* NOCONTEXT */ |
|
3193 |
SETWIN(aGLXWindowId) |
|
1932 | 3194 |
#ifdef OPENGL |
3195 |
#else |
|
294 | 3196 |
popmatrix(); |
1932 | 3197 |
#endif |
294 | 3198 |
%} |
3199 |
! |
|
3200 |
||
3201 |
glxPushmatrixIn:aGLXWindowId |
|
3202 |
"push down transformation stack" |
|
3203 |
||
3204 |
%{ /* NOCONTEXT */ |
|
3205 |
SETWIN(aGLXWindowId) |
|
1932 | 3206 |
#ifdef OPENGL |
3207 |
#else |
|
294 | 3208 |
pushmatrix(); |
1932 | 3209 |
#endif |
294 | 3210 |
%} |
3211 |
! ! |
|
3212 |
||
3213 |
!GLXWorkstation methodsFor:'misc'! |
|
3214 |
||
3215 |
glxGconfigIn:aGLXWindowId |
|
3216 |
"must be sent after RGBmode, doubleBuffer etc. to have these |
|
3217 |
changes really take effect. See GLX manual. |
|
3218 |
(Actually, it seems to be not allowed - I dont really know)" |
|
3219 |
||
3220 |
%{ /* NOCONTEXT */ |
|
3221 |
SETWIN(aGLXWindowId) |
|
1932 | 3222 |
#ifdef OPENGL |
3223 |
#else |
|
294 | 3224 |
gconfig(); |
1932 | 3225 |
#endif |
294 | 3226 |
%} |
3227 |
! |
|
3228 |
||
3229 |
glxMmode:aSymbol in:aGLXWindowId |
|
3230 |
"set matrix mode: #single, #viewing, #projection or #texture" |
|
3231 |
||
3232 |
%{ /* NOCONTEXT */ |
|
3233 |
#ifdef GLX |
|
3234 |
if (aSymbol == @symbol(single)) { |
|
3235 |
mmode(MSINGLE); |
|
3236 |
RETURN (true); |
|
3237 |
} |
|
3238 |
if (aSymbol == @symbol(viewing)) { |
|
3239 |
mmode(MVIEWING); |
|
3240 |
RETURN (true); |
|
3241 |
} |
|
3242 |
if (aSymbol == @symbol(projection)) { |
|
3243 |
mmode(MPROJECTION); |
|
3244 |
RETURN (true); |
|
3245 |
} |
|
3246 |
if (aSymbol == @symbol(texture)) { |
|
3247 |
mmode(MTEXTURE); |
|
3248 |
RETURN (true); |
|
3249 |
} |
|
3250 |
#endif |
|
3251 |
%} |
|
3252 |
. |
|
3253 |
^ false |
|
3254 |
! |
|
3255 |
||
3256 |
glxNmode:aSymbol in:aGLXWindowId |
|
3257 |
"set normalize mode: #auto, #normalize" |
|
3258 |
||
3259 |
%{ /* NOCONTEXT */ |
|
3260 |
#ifdef GLX |
|
3261 |
if (aSymbol == @symbol(auto)) { |
|
3262 |
nmode(NAUTO); |
|
3263 |
RETURN (true); |
|
3264 |
} |
|
3265 |
if (aSymbol == @symbol(normalize)) { |
|
3266 |
nmode(NNORMALIZE); |
|
3267 |
RETURN (true); |
|
3268 |
} |
|
3269 |
#endif |
|
3270 |
%} |
|
3271 |
. |
|
3272 |
^ false |
|
3273 |
! |
|
3274 |
||
3275 |
glxRGBmodeIn:aGLXWindowId |
|
3276 |
"set true color mode (no colormap)" |
|
3277 |
||
3278 |
%{ /* NOCONTEXT */ |
|
3279 |
#ifdef GLX |
|
3280 |
SETWIN(aGLXWindowId) |
|
3281 |
RGBmode(); |
|
3282 |
RETURN (true); |
|
3283 |
#endif |
|
3284 |
%} |
|
3285 |
. |
|
3286 |
^ false |
|
3287 |
! ! |
|
3288 |
||
3289 |
!GLXWorkstation methodsFor:'objects'! |
|
3290 |
||
3291 |
glxCallObject:obj in:aGLXWindowId |
|
3292 |
"perform the commands of an object (macro)." |
|
3293 |
||
2075 | 3294 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3295 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3296 |
#else |
294 | 3297 |
if (__isSmallInteger(obj)) { |
3298 |
SETWIN(aGLXWindowId) |
|
3299 |
callobj(_objectVal(obj)); |
|
3300 |
RETURN (true); |
|
3301 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3302 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3303 |
%}. |
294 | 3304 |
^ false |
3305 |
! |
|
3306 |
||
3307 |
glxCloseObjectIn:aGLXWindowId |
|
3308 |
"end object defnition" |
|
3309 |
||
2075 | 3310 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3311 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3312 |
#else |
294 | 3313 |
SETWIN(aGLXWindowId) |
3314 |
closeobj(); |
|
3315 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3316 |
#endif |
294 | 3317 |
%} |
3318 |
! |
|
3319 |
||
3320 |
glxDeleteObject:obj in:aGLXWindowId |
|
3321 |
||
2075 | 3322 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3323 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3324 |
#else |
1882 | 3325 |
if (__isSmallInteger(obj)) { |
4718 | 3326 |
SETWIN(aGLXWindowId) |
3327 |
delobj(_objectVal(obj)); |
|
3328 |
RETURN (true); |
|
1882 | 3329 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3330 |
#endif |
294 | 3331 |
%} |
3332 |
! |
|
3333 |
||
3334 |
glxGenObjectIn:aGLXWindowId |
|
3335 |
"return a new (free & unused) object id for use |
|
3336 |
with makeObj" |
|
3337 |
||
3338 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3339 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3340 |
#else |
294 | 3341 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3342 |
RETURN (__MKSMALLINT(genobj())); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3343 |
#endif |
294 | 3344 |
%} |
3345 |
! |
|
3346 |
||
3347 |
glxGetopenobjIn:aGLXWindowId |
|
3348 |
"return the currently open objects id; -1 if none is open" |
|
3349 |
||
3350 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3351 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3352 |
#else |
294 | 3353 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3354 |
RETURN (__MKSMALLINT(getopenobj())); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3355 |
#endif |
294 | 3356 |
%} |
3357 |
! |
|
3358 |
||
3359 |
glxIsobj:obj in:aGLXWindowId |
|
3360 |
"return true, if obj is a valid object id" |
|
3361 |
||
3362 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3363 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3364 |
#else |
294 | 3365 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3366 |
RETURN (__MKBOOLEAN(isobj(_objectVal(obj)))); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3367 |
#endif |
294 | 3368 |
%} |
3369 |
! |
|
3370 |
||
3371 |
glxMakeObject:id in:aGLXWindowId |
|
3372 |
"start object definition - |
|
3373 |
another name conflict" |
|
3374 |
||
2075 | 3375 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3376 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3377 |
#else |
294 | 3378 |
if (__isSmallInteger(id)) { |
3379 |
SETWIN(aGLXWindowId) |
|
3380 |
makeobj(_objectVal(id)); |
|
3381 |
RETURN (true); |
|
3382 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3383 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3384 |
%}. |
294 | 3385 |
^ false |
3386 |
! ! |
|
3387 |
||
3388 |
!GLXWorkstation methodsFor:'patches & surfaces'! |
|
3389 |
||
3390 |
glxBeginCurveIn:aGLXWindowId |
|
3391 |
"start a NURBS curve def - in real GL only" |
|
3392 |
||
3393 |
%{ /* NOCONTEXT */ |
|
1932 | 3394 |
SETWIN(aGLXWindowId) |
3395 |
#ifdef GLX |
|
294 | 3396 |
bgncurve(); |
1932 | 3397 |
#endif |
3398 |
%} |
|
294 | 3399 |
! |
3400 |
||
3401 |
glxBeginSurfaceIn:aGLXWindowId |
|
3402 |
"start a NURBS surface def - in real GL only" |
|
3403 |
||
3404 |
%{ /* NOCONTEXT */ |
|
1932 | 3405 |
SETWIN(aGLXWindowId) |
3406 |
#ifdef GLX |
|
294 | 3407 |
bgnsurface(); |
1932 | 3408 |
#endif |
3409 |
%} |
|
294 | 3410 |
! |
3411 |
||
3412 |
glxDefBasis:id mat:aMatrix in:aGLXWindowId |
|
528 | 3413 |
"define the basis matrix for a patch or curve" |
294 | 3414 |
|
3415 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3416 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3417 |
#else |
294 | 3418 |
Matrix matrix; |
3419 |
Matrix *m; |
|
3420 |
||
2814 | 3421 |
if (! (m = __glx_getFloatsFromMatrixInto(aMatrix, matrix))) RETURN (false); |
294 | 3422 |
if (__isSmallInteger(id)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3423 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3424 |
defbasis((short)(__intVal(id)), *m); |
294 | 3425 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3426 |
#endif |
1932 | 3427 |
%} |
528 | 3428 |
|
3429 |
"Modified: 19.3.1996 / 18:52:56 / cg" |
|
294 | 3430 |
! |
3431 |
||
3432 |
glxEndCurveIn:aGLXWindowId |
|
3433 |
"end a NURBS curve def - in real GL only" |
|
3434 |
||
3435 |
%{ /* NOCONTEXT */ |
|
1932 | 3436 |
SETWIN(aGLXWindowId) |
3437 |
#ifdef GLX |
|
294 | 3438 |
endcurve(); |
1932 | 3439 |
#endif |
3440 |
%} |
|
294 | 3441 |
! |
3442 |
||
3443 |
glxEndSurfaceIn:aGLXWindowId |
|
3444 |
"end a NURBS surface def - in real GL only" |
|
3445 |
||
3446 |
%{ /* NOCONTEXT */ |
|
1932 | 3447 |
SETWIN(aGLXWindowId) |
3448 |
#ifdef GLX |
|
294 | 3449 |
endsurface(); |
1932 | 3450 |
#endif |
3451 |
%} |
|
294 | 3452 |
! |
3453 |
||
4718 | 3454 |
glxNurbsSurfaceUKnotCount: uKnotCount uKnot: uKnot |
294 | 3455 |
vKnotCount: vKnotCount vKnot: vKnot |
4718 | 3456 |
uOffset: uOffset vOffset: vOffset |
3457 |
ctlArray: ctlArray |
|
3458 |
uOrder: uOrder vOrder: vOrder |
|
294 | 3459 |
type: type in: aGLXWindowId |
3460 |
||
3461 |
| ctlPoints i | |
|
3462 |
ctlPoints := DoubleArray new: ctlArray size * (ctlArray first size). |
|
3463 |
i := 1. |
|
3464 |
ctlArray do: [:point | |
|
4718 | 3465 |
point do: [:coord | |
294 | 3466 |
ctlPoints at: i put: coord. |
3467 |
i := i + 1]]. |
|
3468 |
||
3469 |
%{ /* NOCONTEXT */ |
|
3470 |
#ifdef GLX |
|
3471 |
char *uKnotElements, *vKnotElements, *ctlElements; |
|
3472 |
OBJ cls; |
|
3473 |
int ninstVars, nInstBytes; |
|
3474 |
||
3475 |
SETWIN(aGLXWindowId) |
|
3476 |
cls = __qClass(ctlPoints); |
|
3477 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
3478 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
|
3479 |
||
3480 |
ctlElements = (char *)(_InstPtr(ctlPoints)) + nInstBytes; |
|
3481 |
uKnotElements = (char *)(_InstPtr(uKnot)) + nInstBytes; |
|
3482 |
vKnotElements = (char *)(_InstPtr(vKnot)) + nInstBytes; |
|
3483 |
||
3484 |
nurbssurface ( |
|
3485 |
__intVal(uKnotCount), (double *)uKnotElements, |
|
3486 |
__intVal(vKnotCount), (double *)vKnotElements, |
|
3487 |
__intVal(uOffset), __intVal(vOffset), |
|
4718 | 3488 |
(double *)ctlElements, |
294 | 3489 |
__intVal(uOrder), __intVal(vOrder), __intVal(type)); |
3490 |
RETURN(true); |
|
3491 |
#endif |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3492 |
%}. |
294 | 3493 |
^ false |
3494 |
! |
|
3495 |
||
3496 |
glxPatchBasisU:u v:v in:aGLXWindowId |
|
528 | 3497 |
"set the two basis matrices for a patch" |
294 | 3498 |
|
3499 |
%{ /* NOCONTEXT */ |
|
3500 |
if (__bothSmallInteger(u, v)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3501 |
SETWIN(aGLXWindowId) |
1932 | 3502 |
#ifdef OPENGL |
3503 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3504 |
patchbasis((long)__intVal(u), (long)__intVal(v)); |
1932 | 3505 |
#endif |
294 | 3506 |
} |
1932 | 3507 |
%} |
528 | 3508 |
|
3509 |
"Modified: 19.3.1996 / 18:53:18 / cg" |
|
294 | 3510 |
! |
3511 |
||
3512 |
glxPatchCurvesU:u v:v in:aGLXWindowId |
|
528 | 3513 |
"set the number of curves to be drawn in each direction on a patch" |
294 | 3514 |
|
3515 |
%{ /* NOCONTEXT */ |
|
3516 |
if (__bothSmallInteger(u, v)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3517 |
SETWIN(aGLXWindowId) |
1932 | 3518 |
#ifdef OPENGL |
3519 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3520 |
patchcurves((long)__intVal(u), (long)__intVal(v)); |
1932 | 3521 |
#endif |
294 | 3522 |
} |
1932 | 3523 |
%} |
528 | 3524 |
|
3525 |
"Modified: 19.3.1996 / 18:53:34 / cg" |
|
294 | 3526 |
! |
3527 |
||
3528 |
glxPatchPrecisionU:u v:v in:aGLXWindowId |
|
3529 |
"set the patch precision" |
|
3530 |
||
3531 |
%{ /* NOCONTEXT */ |
|
3532 |
if (__bothSmallInteger(u, v)) { |
|
3533 |
SETWIN(aGLXWindowId) |
|
1932 | 3534 |
#ifdef OPENGL |
3535 |
#else |
|
294 | 3536 |
patchprecision((long)__intVal(u), (long)__intVal(v)); |
1932 | 3537 |
#endif |
294 | 3538 |
} |
1932 | 3539 |
%} |
294 | 3540 |
! |
3541 |
||
3542 |
glxPatchX:arrayOf16XFloats y:arrayOf16YFloats z:arrayOf16ZFloats in:aGLXWindowId |
|
528 | 3543 |
"Draws a bicubic patch. |
3544 |
arguments must be arrays of 16 floats containing the patch" |
|
294 | 3545 |
|
3546 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3547 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3548 |
#else |
294 | 3549 |
Matrix matrixX, matrixY, matrixZ; |
3550 |
Matrix *mX, *mY, *mZ; |
|
3551 |
||
4718 | 3552 |
if (! (mX = __glx_getFloatsFromMatrixInto(arrayOf16XFloats, matrixX))) |
1932 | 3553 |
RETURN (nil); |
4718 | 3554 |
if (! (mY = __glx_getFloatsFromMatrixInto(arrayOf16YFloats, matrixY))) |
1932 | 3555 |
RETURN (nil); |
4718 | 3556 |
if (! (mZ = __glx_getFloatsFromMatrixInto(arrayOf16ZFloats, matrixZ))) |
1932 | 3557 |
RETURN (nil); |
294 | 3558 |
SETWIN(aGLXWindowId) |
3559 |
patch(*mX, *mY, *mZ); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3560 |
#endif |
294 | 3561 |
%} |
528 | 3562 |
|
3563 |
"Modified: 19.3.1996 / 18:54:02 / cg" |
|
3564 |
! |
|
3565 |
||
3566 |
glxRpatchX:arrayOf16XFloats y:arrayOf16YFloats z:arrayOf16ZFloats w:arrayOf16WFloats in:aGLXWindowId |
|
3567 |
"Draws a rational bicubic patch. |
|
3568 |
arguments must be arrays of 16 floats containing the patch" |
|
3569 |
||
3570 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3571 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3572 |
#else |
529 | 3573 |
Matrix matrixX, matrixY, matrixZ, matrixW; |
3574 |
Matrix *mX, *mY, *mZ, *mW; |
|
528 | 3575 |
|
4718 | 3576 |
if (! (mX = __glx_getFloatsFromMatrixInto(arrayOf16XFloats, matrixX))) |
1932 | 3577 |
RETURN (nil); |
4718 | 3578 |
if (! (mY = __glx_getFloatsFromMatrixInto(arrayOf16YFloats, matrixY))) |
1932 | 3579 |
RETURN (nil); |
4718 | 3580 |
if (! (mZ = __glx_getFloatsFromMatrixInto(arrayOf16ZFloats, matrixZ))) |
1932 | 3581 |
RETURN (nil); |
4718 | 3582 |
if (! (mW = __glx_getFloatsFromMatrixInto(arrayOf16WFloats, matrixW))) |
1932 | 3583 |
RETURN (nil); |
529 | 3584 |
SETWIN(aGLXWindowId) |
3585 |
rpatch(*mX, *mY, *mZ, *mW); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3586 |
#endif |
528 | 3587 |
%} |
3588 |
||
3589 |
"Modified: 19.3.1996 / 18:54:02 / cg" |
|
3590 |
"Created: 19.3.1996 / 18:56:34 / cg" |
|
3591 |
! ! |
|
3592 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3593 |
!GLXWorkstation methodsFor:'pixel copy'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3594 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3595 |
glxRectcopyX1: x1 y1: y1 x2: x2 y2: y2 newx: newx newy: newy in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3596 |
"copy a rectangular area in the view. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3597 |
For now, this is only supported with a true GL. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3598 |
readsource specifies which plane/buffer is affected by this operation." |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3599 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3600 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3601 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3602 |
SETWIN(aGLXWindowId) |
4718 | 3603 |
rectcopy(_screencoordVal(x1), _screencoordVal(y1), |
3604 |
_screencoordVal(x2), _screencoordVal(y2), |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3605 |
_screencoordVal(newx), _screencoordVal(newy)); |
1932 | 3606 |
#endif |
3607 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3608 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3609 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3610 |
!GLXWorkstation methodsFor:'pixel reading'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3611 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3612 |
glxReadpixelsTo:dest in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3613 |
"read pixels from the view. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3614 |
Dest must be an array and gets pixel values assigned, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3615 |
reading n pixels starting at the current x/y coordinate (pixel coordinates). |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3616 |
For now, pixel-reading is only supported with a true GL. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3617 |
Caveat: the number of pixels is limited to 256. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3618 |
In double buffer mode, the backBuffer is read." |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3619 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3620 |
|n| |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3621 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3622 |
n := dest size. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3623 |
n > 256 ifTrue:[^ 0]. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3624 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3625 |
%{ /* STACK:1024 */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3626 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3627 |
Colorindex buffer[256]; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3628 |
int i, nRead; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3629 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3630 |
if (__isArray(dest)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3631 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3632 |
nRead = readpixels(__intVal(n), buffer); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3633 |
for (i=0; i<nRead;i++) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3634 |
__ArrayInstPtr(dest)->a_element[i] = __MKSMALLINT(buffer[i]); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3635 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3636 |
RETURN (__MKSMALLINT(nRead)); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3637 |
} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3638 |
#endif |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3639 |
%}. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3640 |
^ 0 |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3641 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3642 |
"Modified: 22.3.1996 / 18:08:00 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3643 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3644 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3645 |
glxReadsource: src in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3646 |
"specify what is read with folowing readPixels requests. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3647 |
For now, pixel-reading is only supported with a true GL" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3648 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3649 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3650 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3651 |
OBJ s = src; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3652 |
int what; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3653 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3654 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3655 |
if (s == @symbol(auto)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3656 |
what = SRC_AUTO; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3657 |
} else if (s == @symbol(front)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3658 |
what = SRC_FRONT; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3659 |
} else if (s == @symbol(back)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3660 |
what = SRC_BACK; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3661 |
} else if (s == @symbol(zBuffer)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3662 |
what = SRC_ZBUFFER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3663 |
} else if (s == @symbol(frameGrabber)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3664 |
what = SRC_FRAMEGRABBER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3665 |
} else if (s == @symbol(over)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3666 |
what = SRC_OVER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3667 |
} else if (s == @symbol(under)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3668 |
what = SRC_UNDER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3669 |
} else if (s == @symbol(popUp)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3670 |
what = SRC_PUP; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3671 |
} else { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3672 |
what = _longVal(src); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3673 |
} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3674 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3675 |
readsource(what); |
1932 | 3676 |
#endif |
3677 |
%} |
|
538 | 3678 |
! |
3679 |
||
541 | 3680 |
glxRectreadX1:x1 y1:y1 x2:x2 y2:y2 h:viewHeight to:dest in:aGLXWindowId |
538 | 3681 |
"read pixels from a rectanglular area. |
3682 |
Dest must be an array and gets pixel values assigned, |
|
3683 |
reading n*m pixels. |
|
3684 |
For now, pixel-reading is only supported with a true GL. |
|
3685 |
Caveat: the number of pixels is limited to 256. |
|
3686 |
In double buffer mode, the backBuffer is read." |
|
3687 |
||
541 | 3688 |
|n idx sy1 sy2| |
3689 |
||
3690 |
"/ GLX's y coordinates go bottom to top ... |
|
3691 |
||
3692 |
sy1 := viewHeight - y1. |
|
3693 |
sy2 := viewHeight - y2. |
|
538 | 3694 |
|
3695 |
n := (x2 - x1 + 1) * (y2 - y1 + 1). |
|
3696 |
n > 256 ifTrue:[^ 0]. |
|
3697 |
dest size < n ifTrue:[^ 0]. |
|
3698 |
||
3699 |
%{ /* STACK:1024 */ |
|
3700 |
#ifdef GLX |
|
3701 |
Colorindex buffer[256]; |
|
3702 |
int i, nRead; |
|
3703 |
||
3704 |
if (__isArray(dest) |
|
3705 |
&& __isSmallInteger(x1) && __isSmallInteger(x2) |
|
541 | 3706 |
&& __isSmallInteger(sy1) && __isSmallInteger(sy2) |
538 | 3707 |
) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3708 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3709 |
nRead = rectread(__intVal(x1), __intVal(sy1), |
4718 | 3710 |
__intVal(x2), __intVal(sy2), |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3711 |
buffer); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3712 |
for (i=0; i<nRead;i++) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3713 |
__ArrayInstPtr(dest)->a_element[i] = __MKSMALLINT(buffer[i]); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3714 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3715 |
RETURN (__MKSMALLINT(nRead)); |
538 | 3716 |
} |
3717 |
#endif |
|
3718 |
%}. |
|
3719 |
"/ |
|
3720 |
"/ ok, this is not a GL - use XWorkstations pixel read method |
|
3721 |
"/ and convert |
|
3722 |
"/ |
|
3723 |
idx := 1. |
|
3724 |
y1 to:y2 do:[:y | |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3725 |
x1 to:x2 do:[:x | |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3726 |
|pix| |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3727 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3728 |
pix := self vglGetPixelX:x y:y in:aGLXWindowId. |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3729 |
dest at:idx put:pix |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3730 |
] |
538 | 3731 |
]. |
3732 |
^ n |
|
3733 |
||
3734 |
"Modified: 22.3.1996 / 18:08:00 / cg" |
|
542
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3735 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3736 |
! |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3737 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3738 |
glxXColorToGLColor:pixel |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3739 |
"only for VOGL: given a pixel as read from the view, |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3740 |
return the corresponding GL color" |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3741 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3742 |
%{ /* NOCONTEXT */ |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3743 |
#ifdef VGL |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3744 |
if (__isSmallInteger(pixel)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3745 |
RETURN (__MKSMALLINT(X11_invColor(__intVal(pixel)))); |
542
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3746 |
} |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3747 |
#endif |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3748 |
%}. |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3749 |
^ pixel |
543
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3750 |
! |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3751 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3752 |
vglGetPixelX:x y:y in:aGLXWindowId |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3753 |
"special for VGL" |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3754 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3755 |
%{ |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3756 |
#ifdef VGL |
1932 | 3757 |
if (__bothSmallInteger(x, y)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3758 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3759 |
RETURN (__MKSMALLINT(X11_getPixel(__intVal(x), __intVal(y)))); |
543
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3760 |
} |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3761 |
#endif |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3762 |
%}. |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3763 |
^ 0 |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3764 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3765 |
"Modified: 22.3.1996 / 18:08:00 / cg" |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3766 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3767 |
|
528 | 3768 |
!GLXWorkstation methodsFor:'points'! |
3769 |
||
3770 |
glxPnt2X: x y: y in: aGLXWindowId |
|
3771 |
"plot a point in x, y, 0." |
|
3772 |
||
3773 |
%{ /* NOCONTEXT */ |
|
3774 |
Coord c_x, c_y; |
|
3775 |
||
3776 |
_COORD_ (x, c_x) |
|
3777 |
_COORD_ (y, c_y) |
|
3778 |
SETWIN(aGLXWindowId) |
|
1932 | 3779 |
#ifdef OPENGL |
3780 |
#else |
|
528 | 3781 |
pnt2(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3782 |
#endif |
528 | 3783 |
%} |
3784 |
||
3785 |
"Modified: 19.3.1996 / 18:35:55 / cg" |
|
3786 |
! |
|
3787 |
||
3788 |
glxPnt2iX: x y: y in: aGLXWindowId |
|
3789 |
"plot a point in x, y, 0." |
|
3790 |
||
3791 |
%{ /* NOCONTEXT */ |
|
3792 |
Icoord c_x, c_y; |
|
3793 |
||
3794 |
_ICOORD_ (x, c_x) |
|
3795 |
_ICOORD_ (y, c_y) |
|
3796 |
SETWIN(aGLXWindowId) |
|
1932 | 3797 |
#ifdef OPENGL |
3798 |
#else |
|
528 | 3799 |
pnt2i(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3800 |
#endif |
528 | 3801 |
%} |
3802 |
||
3803 |
"Modified: 19.3.1996 / 18:35:59 / cg" |
|
3804 |
! |
|
3805 |
||
3806 |
glxPnt2sX: x y: y in: aGLXWindowId |
|
3807 |
"plot a point in x, y, 0." |
|
3808 |
||
3809 |
%{ /* NOCONTEXT */ |
|
3810 |
Scoord c_x, c_y; |
|
3811 |
||
3812 |
_SCOORD_ (x, c_x) |
|
3813 |
_SCOORD_ (y, c_y) |
|
3814 |
SETWIN(aGLXWindowId) |
|
1932 | 3815 |
#ifdef OPENGL |
3816 |
#else |
|
528 | 3817 |
pnt2s(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3818 |
#endif |
528 | 3819 |
%} |
3820 |
||
3821 |
"Modified: 19.3.1996 / 18:36:03 / cg" |
|
3822 |
! |
|
3823 |
||
3824 |
glxPntX: x y: y z: z in: aGLXWindowId |
|
3825 |
"plot a point in x, y, z." |
|
3826 |
||
3827 |
%{ /* NOCONTEXT */ |
|
3828 |
Coord c_x, c_y, c_z; |
|
3829 |
||
3830 |
_COORD_ (x, c_x) |
|
3831 |
_COORD_ (y, c_y) |
|
3832 |
_COORD_ (z, c_z) |
|
3833 |
SETWIN(aGLXWindowId) |
|
1932 | 3834 |
#ifdef OPENGL |
3835 |
#else |
|
528 | 3836 |
pnt(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3837 |
#endif |
528 | 3838 |
%} |
3839 |
||
3840 |
"Modified: 19.3.1996 / 18:36:08 / cg" |
|
3841 |
! |
|
3842 |
||
3843 |
glxPntiX: x y: y z: z in: aGLXWindowId |
|
3844 |
"plot a point in x, y, z." |
|
3845 |
||
3846 |
%{ /* NOCONTEXT */ |
|
3847 |
Icoord c_x, c_y, c_z; |
|
3848 |
||
3849 |
_ICOORD_ (x, c_x) |
|
3850 |
_ICOORD_ (y, c_y) |
|
3851 |
_ICOORD_ (z, c_z) |
|
3852 |
SETWIN(aGLXWindowId) |
|
1932 | 3853 |
#ifdef OPENGL |
3854 |
#else |
|
528 | 3855 |
pnti(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3856 |
#endif |
528 | 3857 |
%} |
3858 |
||
3859 |
"Modified: 19.3.1996 / 18:36:14 / cg" |
|
3860 |
! |
|
3861 |
||
3862 |
glxPntsX: x y: y z: z in: aGLXWindowId |
|
3863 |
"plot a point in x, y, z." |
|
3864 |
||
3865 |
%{ /* NOCONTEXT */ |
|
3866 |
Scoord c_x, c_y, c_z; |
|
3867 |
||
3868 |
_SCOORD_ (x, c_x) |
|
3869 |
_SCOORD_ (y, c_y) |
|
3870 |
_SCOORD_ (z, c_z) |
|
3871 |
SETWIN(aGLXWindowId) |
|
1932 | 3872 |
#ifdef OPENGL |
3873 |
#else |
|
528 | 3874 |
pnts(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3875 |
#endif |
528 | 3876 |
%} |
3877 |
||
3878 |
"Modified: 19.3.1996 / 18:36:17 / cg" |
|
3879 |
! |
|
3880 |
||
3881 |
glxPntsize: n in: aGLXWindowId |
|
3882 |
||
3883 |
%{ /* NOCONTEXT */ |
|
1932 | 3884 |
SETWIN(aGLXWindowId) |
3885 |
#ifdef GLX |
|
528 | 3886 |
pntsize(_shortVal(n)); |
1932 | 3887 |
#endif |
3888 |
%} |
|
528 | 3889 |
! |
3890 |
||
3891 |
glxPntsizef: n in: aGLXWindowId |
|
3892 |
||
3893 |
%{ /* NOCONTEXT */ |
|
1932 | 3894 |
SETWIN(aGLXWindowId) |
3895 |
#ifdef GLX |
|
528 | 3896 |
pntsizef(_floatVal(n)); |
1932 | 3897 |
#endif |
3898 |
%} |
|
528 | 3899 |
! ! |
3900 |
||
3901 |
!GLXWorkstation methodsFor:'polygons'! |
|
3902 |
||
3903 |
glxBackface: b in: aGLXWindowId |
|
4718 | 3904 |
"enable/disable culling of backfacing polygons (suppress its drawing). |
528 | 3905 |
A polygon is backfacing if it's orientation in *screen* coords is clockwise" |
3906 |
||
3907 |
%{ /* NOCONTEXT */ |
|
3908 |
SETWIN(aGLXWindowId) |
|
1932 | 3909 |
#ifdef OPENGL |
3910 |
#else |
|
528 | 3911 |
backface(_booleanVal(b)); |
1932 | 3912 |
#endif |
528 | 3913 |
%} |
3914 |
||
3915 |
"Modified: 19.3.1996 / 18:26:50 / cg" |
|
3916 |
! |
|
3917 |
||
3918 |
glxConcave: b in: aGLXWindowId |
|
3919 |
"signal wether or not polygons are concave" |
|
3920 |
||
3921 |
%{ /* NOCONTEXT */ |
|
3922 |
SETWIN(aGLXWindowId) |
|
1932 | 3923 |
#ifdef OPENGL |
3924 |
#else |
|
528 | 3925 |
concave(_booleanVal(b)); |
1932 | 3926 |
#endif |
528 | 3927 |
%} |
3928 |
! |
|
3929 |
||
3930 |
glxFrontface: b in: aGLXWindowId |
|
4718 | 3931 |
"enable/disable culling of frontfacing polygons (suppress its drawing). |
3932 |
A polygon is frontfacing if it's orientation in *screen* coords is |
|
528 | 3933 |
anti-clockwise" |
3934 |
||
3935 |
||
3936 |
%{ /* NOCONTEXT */ |
|
3937 |
SETWIN(aGLXWindowId) |
|
1932 | 3938 |
#ifdef OPENGL |
3939 |
#else |
|
528 | 3940 |
frontface(_booleanVal(b)); |
1932 | 3941 |
#endif |
3942 |
%} |
|
528 | 3943 |
! |
3944 |
||
3945 |
glxPdr2X: x y: y in: aGLXWindowId |
|
3946 |
"add another vertex to the polygon" |
|
3947 |
||
3948 |
%{ /* NOCONTEXT */ |
|
3949 |
Coord c_x, c_y; |
|
3950 |
||
3951 |
_COORD_ (x, c_x) |
|
3952 |
_COORD_ (y, c_y) |
|
3953 |
SETWIN(aGLXWindowId) |
|
1932 | 3954 |
#ifdef OPENGL |
3955 |
#else |
|
528 | 3956 |
pdr2(c_x, c_y); |
1932 | 3957 |
#endif |
3958 |
%} |
|
528 | 3959 |
! |
3960 |
||
3961 |
glxPdr2iX: x y: y in: aGLXWindowId |
|
3962 |
"add another vertex to the polygon" |
|
3963 |
||
3964 |
%{ /* NOCONTEXT */ |
|
3965 |
Icoord c_x, c_y; |
|
3966 |
||
3967 |
_ICOORD_ (x, c_x) |
|
3968 |
_ICOORD_ (y, c_y) |
|
3969 |
SETWIN(aGLXWindowId) |
|
1932 | 3970 |
#ifdef OPENGL |
3971 |
#else |
|
528 | 3972 |
pdr2i(c_x, c_y); |
1932 | 3973 |
#endif |
528 | 3974 |
%} |
3975 |
||
3976 |
"Modified: 19.3.1996 / 18:33:28 / cg" |
|
3977 |
! |
|
3978 |
||
3979 |
glxPdr2sX: x y: y in: aGLXWindowId |
|
3980 |
"add another vertex to the polygon" |
|
3981 |
||
3982 |
%{ /* NOCONTEXT */ |
|
3983 |
Scoord c_x, c_y; |
|
3984 |
||
3985 |
_SCOORD_ (x, c_x) |
|
3986 |
_SCOORD_ (y, c_y) |
|
3987 |
SETWIN(aGLXWindowId) |
|
1932 | 3988 |
#ifdef OPENGL |
3989 |
#else |
|
528 | 3990 |
pdr2s(c_x, c_y); |
1932 | 3991 |
#endif |
528 | 3992 |
%} |
3993 |
||
3994 |
"Modified: 19.3.1996 / 18:34:03 / cg" |
|
3995 |
! |
|
3996 |
||
3997 |
glxPdrX: x y: y z: z in: aGLXWindowId |
|
3998 |
"add another vertex to the polygon" |
|
3999 |
||
4000 |
%{ /* NOCONTEXT */ |
|
4001 |
Coord c_x, c_y, c_z; |
|
4002 |
||
4003 |
_COORD_ (x, c_x) |
|
4004 |
_COORD_ (y, c_y) |
|
4005 |
_COORD_ (z, c_z) |
|
4006 |
SETWIN(aGLXWindowId) |
|
1932 | 4007 |
#ifdef OPENGL |
4008 |
#else |
|
528 | 4009 |
pdr(c_x, c_y, c_z); |
1932 | 4010 |
#endif |
528 | 4011 |
%} |
4012 |
||
4013 |
"Modified: 19.3.1996 / 18:34:06 / cg" |
|
4014 |
! |
|
4015 |
||
4016 |
glxPdriX: x y: y z: z in: aGLXWindowId |
|
4017 |
"add another vertex to the polygon" |
|
4018 |
||
4019 |
%{ /* NOCONTEXT */ |
|
4020 |
Icoord c_x, c_y, c_z; |
|
4021 |
||
4022 |
_ICOORD_ (x, c_x) |
|
4023 |
_ICOORD_ (y, c_y) |
|
4024 |
_ICOORD_ (z, c_z) |
|
4025 |
SETWIN(aGLXWindowId) |
|
1932 | 4026 |
#ifdef OPENGL |
4027 |
#else |
|
528 | 4028 |
pdri(c_x, c_y, c_z); |
1932 | 4029 |
#endif |
528 | 4030 |
%} |
4031 |
||
4032 |
"Modified: 19.3.1996 / 18:34:11 / cg" |
|
4033 |
! |
|
4034 |
||
4035 |
glxPdrsX: x y: y z: z in: aGLXWindowId |
|
4036 |
"add another vertex to the polygon" |
|
4037 |
||
4038 |
%{ /* NOCONTEXT */ |
|
4039 |
Scoord c_x, c_y, c_z; |
|
4040 |
||
4041 |
_SCOORD_ (x, c_x) |
|
4042 |
_SCOORD_ (y, c_y) |
|
4043 |
_SCOORD_ (z, c_z) |
|
4044 |
SETWIN(aGLXWindowId) |
|
1932 | 4045 |
#ifdef OPENGL |
4046 |
#else |
|
528 | 4047 |
pdrs(c_x, c_y, c_z); |
1932 | 4048 |
#endif |
528 | 4049 |
%} |
4050 |
||
4051 |
"Modified: 19.3.1996 / 18:34:14 / cg" |
|
4052 |
! |
|
4053 |
||
4054 |
glxPmv2X: x y: y in: aGLXWindowId |
|
4055 |
"set the start position of a polygon" |
|
4056 |
||
4057 |
%{ /* NOCONTEXT */ |
|
4058 |
Coord c_x, c_y; |
|
4059 |
||
4060 |
_COORD_ (x, c_x) |
|
4061 |
_COORD_ (y, c_y) |
|
4062 |
SETWIN(aGLXWindowId) |
|
1932 | 4063 |
#ifdef OPENGL |
4064 |
#else |
|
528 | 4065 |
pmv2(c_x, c_y); |
1932 | 4066 |
#endif |
528 | 4067 |
%} |
4068 |
||
4069 |
"Modified: 19.3.1996 / 18:32:45 / cg" |
|
4070 |
! |
|
4071 |
||
4072 |
glxPmv2iX: x y: y in: aGLXWindowId |
|
4073 |
"set the start position of a polygon" |
|
4074 |
||
4075 |
%{ /* NOCONTEXT */ |
|
4076 |
Icoord c_x, c_y; |
|
4077 |
||
4078 |
_ICOORD_ (x, c_x) |
|
4079 |
_ICOORD_ (y, c_y) |
|
4080 |
SETWIN(aGLXWindowId) |
|
1932 | 4081 |
#ifdef OPENGL |
4082 |
#else |
|
528 | 4083 |
pmv2i(c_x, c_y); |
1932 | 4084 |
#endif |
528 | 4085 |
%} |
4086 |
||
4087 |
"Modified: 19.3.1996 / 18:32:42 / cg" |
|
4088 |
! |
|
4089 |
||
4090 |
glxPmv2sX: x y: y in: aGLXWindowId |
|
4091 |
"set the start position of a polygon" |
|
4092 |
||
4093 |
%{ /* NOCONTEXT */ |
|
4094 |
Scoord c_x, c_y; |
|
4095 |
||
4096 |
_SCOORD_ (x, c_x) |
|
4097 |
_SCOORD_ (y, c_y) |
|
4098 |
SETWIN(aGLXWindowId) |
|
1932 | 4099 |
#ifdef OPENGL |
4100 |
#else |
|
528 | 4101 |
pmv2s(c_x, c_y); |
1932 | 4102 |
#endif |
528 | 4103 |
%} |
4104 |
||
4105 |
"Modified: 19.3.1996 / 18:32:38 / cg" |
|
4106 |
! |
|
4107 |
||
4108 |
glxPmvX: x y: y z: z in: aGLXWindowId |
|
4109 |
"set the start position of a polygon" |
|
4110 |
||
4111 |
%{ /* NOCONTEXT */ |
|
4112 |
Coord c_x, c_y, c_z; |
|
4113 |
||
4114 |
_COORD_ (x, c_x) |
|
4115 |
_COORD_ (y, c_y) |
|
4116 |
_COORD_ (z, c_z) |
|
4117 |
SETWIN(aGLXWindowId) |
|
1932 | 4118 |
#ifdef OPENGL |
4119 |
#else |
|
528 | 4120 |
pmv(c_x, c_y, c_z); |
1932 | 4121 |
#endif |
528 | 4122 |
%} |
4123 |
||
4124 |
"Modified: 19.3.1996 / 18:31:52 / cg" |
|
4125 |
! |
|
4126 |
||
4127 |
glxPmviX: x y: y z: z in: aGLXWindowId |
|
4128 |
"set the start position of a polygon" |
|
4129 |
||
4130 |
%{ /* NOCONTEXT */ |
|
4131 |
Icoord c_x, c_y, c_z; |
|
4132 |
||
4133 |
_ICOORD_ (x, c_x) |
|
4134 |
_ICOORD_ (y, c_y) |
|
4135 |
_ICOORD_ (z, c_z) |
|
4136 |
SETWIN(aGLXWindowId) |
|
1932 | 4137 |
#ifdef OPENGL |
4138 |
#else |
|
528 | 4139 |
pmvi(c_x, c_y, c_z); |
1932 | 4140 |
#endif |
528 | 4141 |
%} |
4142 |
||
4143 |
"Modified: 19.3.1996 / 18:31:59 / cg" |
|
4144 |
! |
|
4145 |
||
4146 |
glxPmvsX: x y: y z: z in: aGLXWindowId |
|
4147 |
"set the start position of a polygon" |
|
4148 |
||
4149 |
%{ /* NOCONTEXT */ |
|
4150 |
Scoord c_x, c_y, c_z; |
|
4151 |
||
4152 |
_SCOORD_ (x, c_x) |
|
4153 |
_SCOORD_ (y, c_y) |
|
4154 |
_SCOORD_ (z, c_z) |
|
4155 |
SETWIN(aGLXWindowId) |
|
1932 | 4156 |
#ifdef OPENGL |
4157 |
#else |
|
528 | 4158 |
pmvs(c_x, c_y, c_z); |
1932 | 4159 |
#endif |
528 | 4160 |
%} |
4161 |
||
4162 |
"Modified: 19.3.1996 / 18:32:03 / cg" |
|
4163 |
! |
|
4164 |
||
4165 |
glxPolymode: mode in: aGLXWindowId |
|
4166 |
"Sets the polygon filling mode - only filled (1) or outlined (0) |
|
4167 |
are supported" |
|
4168 |
||
4169 |
%{ /* NOCONTEXT */ |
|
4170 |
SETWIN(aGLXWindowId) |
|
1932 | 4171 |
#ifdef OPENGL |
4172 |
#else |
|
528 | 4173 |
polymode(_longVal(mode)); |
1932 | 4174 |
#endif |
528 | 4175 |
%} |
4176 |
||
4177 |
"Modified: 19.3.1996 / 18:29:32 / cg" |
|
4178 |
! |
|
4179 |
||
4180 |
glxRpdr2X: x y: y in: aGLXWindowId |
|
4181 |
"add another relative vertex to the polygon" |
|
4182 |
||
4183 |
%{ /* NOCONTEXT */ |
|
4184 |
Coord c_x, c_y; |
|
4185 |
||
4186 |
_COORD_ (x, c_x) |
|
4187 |
_COORD_ (y, c_y) |
|
4188 |
SETWIN(aGLXWindowId) |
|
1932 | 4189 |
#ifdef OPENGL |
4190 |
#else |
|
528 | 4191 |
rpdr2(c_x, c_y); |
1932 | 4192 |
#endif |
528 | 4193 |
%} |
4194 |
||
4195 |
"Modified: 19.3.1996 / 18:34:31 / cg" |
|
4196 |
! |
|
4197 |
||
4198 |
glxRpdr2iX: x y: y in: aGLXWindowId |
|
4199 |
"add another relative vertex to the polygon" |
|
4200 |
||
4201 |
%{ /* NOCONTEXT */ |
|
4202 |
Icoord c_x, c_y; |
|
4203 |
||
4204 |
_ICOORD_ (x, c_x) |
|
4205 |
_ICOORD_ (y, c_y) |
|
4206 |
SETWIN(aGLXWindowId) |
|
1932 | 4207 |
#ifdef OPENGL |
4208 |
#else |
|
528 | 4209 |
rpdr2i(c_x, c_y); |
1932 | 4210 |
#endif |
528 | 4211 |
%} |
4212 |
||
4213 |
"Modified: 19.3.1996 / 18:34:36 / cg" |
|
4214 |
! |
|
4215 |
||
4216 |
glxRpdr2sX: x y: y in: aGLXWindowId |
|
4217 |
"add another relative vertex to the polygon" |
|
4218 |
||
4219 |
%{ /* NOCONTEXT */ |
|
4220 |
Scoord c_x, c_y; |
|
4221 |
||
4222 |
_SCOORD_ (x, c_x) |
|
4223 |
_SCOORD_ (y, c_y) |
|
4224 |
SETWIN(aGLXWindowId) |
|
1932 | 4225 |
#ifdef OPENGL |
4226 |
#else |
|
528 | 4227 |
rpdr2s(c_x, c_y); |
1932 | 4228 |
#endif |
528 | 4229 |
%} |
4230 |
||
4231 |
"Modified: 19.3.1996 / 18:34:40 / cg" |
|
4232 |
! |
|
4233 |
||
4234 |
glxRpdrX: x y: y z: z in: aGLXWindowId |
|
4235 |
"add another relative vertex to the polygon" |
|
4236 |
||
4237 |
%{ /* NOCONTEXT */ |
|
4238 |
Coord c_x, c_y, c_z; |
|
4239 |
||
4240 |
_COORD_ (x, c_x) |
|
4241 |
_COORD_ (y, c_y) |
|
4242 |
_COORD_ (z, c_z) |
|
4243 |
SETWIN(aGLXWindowId) |
|
1932 | 4244 |
#ifdef OPENGL |
4245 |
#else |
|
528 | 4246 |
rpdr(c_x, c_y, c_z); |
1932 | 4247 |
#endif |
528 | 4248 |
%} |
4249 |
||
4250 |
"Modified: 19.3.1996 / 18:34:48 / cg" |
|
4251 |
! |
|
4252 |
||
4253 |
glxRpdriX: x y: y z: z in: aGLXWindowId |
|
4254 |
"add another relative vertex to the polygon" |
|
4255 |
||
4256 |
%{ /* NOCONTEXT */ |
|
4257 |
Icoord c_x, c_y, c_z; |
|
4258 |
||
4259 |
_ICOORD_ (x, c_x) |
|
4260 |
_ICOORD_ (y, c_y) |
|
4261 |
_ICOORD_ (z, c_z) |
|
4262 |
SETWIN(aGLXWindowId) |
|
1932 | 4263 |
#ifdef OPENGL |
4264 |
#else |
|
528 | 4265 |
rpdri(c_x, c_y, c_z); |
1932 | 4266 |
#endif |
528 | 4267 |
%} |
4268 |
||
4269 |
"Modified: 19.3.1996 / 18:34:51 / cg" |
|
4270 |
! |
|
4271 |
||
4272 |
glxRpdrsX: x y: y z: z in: aGLXWindowId |
|
4273 |
"add another relative vertex to the polygon" |
|
4274 |
||
4275 |
%{ /* NOCONTEXT */ |
|
4276 |
Scoord c_x, c_y, c_z; |
|
4277 |
||
4278 |
_SCOORD_ (x, c_x) |
|
4279 |
_SCOORD_ (y, c_y) |
|
4280 |
_SCOORD_ (z, c_z) |
|
4281 |
SETWIN(aGLXWindowId) |
|
1932 | 4282 |
#ifdef OPENGL |
4283 |
#else |
|
528 | 4284 |
rpdrs(c_x, c_y, c_z); |
1932 | 4285 |
#endif |
528 | 4286 |
%} |
4287 |
||
4288 |
"Modified: 19.3.1996 / 18:34:55 / cg" |
|
4289 |
! |
|
4290 |
||
4291 |
glxRpmv2X: x y: y in: aGLXWindowId |
|
4292 |
"set the start position of a polygon" |
|
4293 |
||
4294 |
%{ /* NOCONTEXT */ |
|
4295 |
Coord c_x, c_y; |
|
4296 |
||
4297 |
_COORD_ (x, c_x) |
|
4298 |
_COORD_ (y, c_y) |
|
4299 |
SETWIN(aGLXWindowId) |
|
1932 | 4300 |
#ifdef OPENGL |
4301 |
#else |
|
528 | 4302 |
rpmv2(c_x, c_y); |
1932 | 4303 |
#endif |
528 | 4304 |
%} |
4305 |
||
4306 |
"Modified: 19.3.1996 / 18:37:15 / cg" |
|
4307 |
! |
|
4308 |
||
4309 |
glxRpmv2iX: x y: y in: aGLXWindowId |
|
4310 |
"set the start position of a polygon" |
|
4311 |
||
4312 |
%{ /* NOCONTEXT */ |
|
4313 |
Icoord c_x, c_y; |
|
4314 |
||
4315 |
_ICOORD_ (x, c_x) |
|
4316 |
_ICOORD_ (y, c_y) |
|
4317 |
SETWIN(aGLXWindowId) |
|
1932 | 4318 |
#ifdef OPENGL |
4319 |
#else |
|
528 | 4320 |
rpmv2i(c_x, c_y); |
1932 | 4321 |
#endif |
528 | 4322 |
%} |
4323 |
||
4324 |
"Modified: 19.3.1996 / 18:37:20 / cg" |
|
4325 |
! |
|
4326 |
||
4327 |
glxRpmv2sX: x y: y in: aGLXWindowId |
|
4328 |
"set the relative start position of a polygon" |
|
4329 |
||
4330 |
%{ /* NOCONTEXT */ |
|
4331 |
Scoord c_x, c_y; |
|
4332 |
||
4333 |
_SCOORD_ (x, c_x) |
|
4334 |
_SCOORD_ (y, c_y) |
|
4335 |
SETWIN(aGLXWindowId) |
|
1932 | 4336 |
#ifdef OPENGL |
4337 |
#else |
|
528 | 4338 |
rpmv2s(c_x, c_y); |
1932 | 4339 |
#endif |
528 | 4340 |
%} |
4341 |
||
4342 |
"Modified: 19.3.1996 / 18:38:06 / cg" |
|
4343 |
! |
|
4344 |
||
4345 |
glxRpmvX: x y: y z: z in: aGLXWindowId |
|
4346 |
"set the relative start position of a polygon" |
|
4347 |
||
4348 |
%{ /* NOCONTEXT */ |
|
4349 |
Coord c_x, c_y, c_z; |
|
4350 |
||
4351 |
_COORD_ (x, c_x) |
|
4352 |
_COORD_ (y, c_y) |
|
4353 |
_COORD_ (z, c_z) |
|
4354 |
SETWIN(aGLXWindowId) |
|
1932 | 4355 |
#ifdef OPENGL |
4356 |
#else |
|
528 | 4357 |
rpmv(c_x, c_y, c_z); |
1932 | 4358 |
#endif |
528 | 4359 |
%} |
4360 |
||
4361 |
"Modified: 19.3.1996 / 18:38:03 / cg" |
|
4362 |
! |
|
4363 |
||
4364 |
glxRpmviX: x y: y z: z in: aGLXWindowId |
|
4365 |
"set the relative start position of a polygon" |
|
4366 |
||
4367 |
%{ /* NOCONTEXT */ |
|
4368 |
Icoord c_x, c_y, c_z; |
|
4369 |
||
4370 |
_ICOORD_ (x, c_x) |
|
4371 |
_ICOORD_ (y, c_y) |
|
4372 |
_ICOORD_ (z, c_z) |
|
4373 |
SETWIN(aGLXWindowId) |
|
1932 | 4374 |
#ifdef OPENGL |
4375 |
#else |
|
528 | 4376 |
rpmvi(c_x, c_y, c_z); |
1932 | 4377 |
#endif |
528 | 4378 |
%} |
4379 |
||
4380 |
"Modified: 19.3.1996 / 18:37:53 / cg" |
|
4381 |
! |
|
4382 |
||
4383 |
glxRpmvsX: x y: y z: z in: aGLXWindowId |
|
4384 |
"set the relative start position of a polygon" |
|
4385 |
||
4386 |
%{ /* NOCONTEXT */ |
|
4387 |
Scoord c_x, c_y, c_z; |
|
4388 |
||
4389 |
_SCOORD_ (x, c_x) |
|
4390 |
_SCOORD_ (y, c_y) |
|
4391 |
_SCOORD_ (z, c_z) |
|
4392 |
SETWIN(aGLXWindowId) |
|
1932 | 4393 |
#ifdef OPENGL |
4394 |
#else |
|
528 | 4395 |
rpmvs(c_x, c_y, c_z); |
1932 | 4396 |
#endif |
528 | 4397 |
%} |
4398 |
||
4399 |
"Modified: 19.3.1996 / 18:37:58 / cg" |
|
294 | 4400 |
! ! |
4401 |
||
24 | 4402 |
!GLXWorkstation methodsFor:'queries'! |
4403 |
||
159 | 4404 |
glVersion |
4405 |
"return a string describing the GL version. |
|
4406 |
For informative use only; portable applications do not depend |
|
4407 |
on the returned string." |
|
4408 |
||
4409 |
%{ /* NOCONTEXT */ |
|
4410 |
#ifdef VGL |
|
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
4411 |
RETURN (__MKSTRING("vogl")); |
159 | 4412 |
#else |
1932 | 4413 |
# ifdef GLX |
159 | 4414 |
char buffer[128]; |
4415 |
||
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4416 |
if (_INST(glOK) == true) { |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4417 |
gversion(buffer); |
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
4418 |
RETURN (__MKSTRING(buffer)); |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4419 |
} |
1932 | 4420 |
RETURN (nil); |
4421 |
# else |
|
4422 |
RETURN (nil); |
|
4423 |
# endif |
|
159 | 4424 |
#endif |
4425 |
%} |
|
4426 |
||
4427 |
" |
|
4718 | 4428 |
Display glVersion |
159 | 4429 |
" |
4430 |
! |
|
4431 |
||
528 | 4432 |
glxGetplanesIn: aGLXWindowId |
4433 |
"Returns the number if bit planes available on the device." |
|
4434 |
||
4435 |
%{ /* NOCONTEXT */ |
|
1932 | 4436 |
SETWIN(aGLXWindowId) |
4437 |
#ifdef OPENGL |
|
4438 |
#else |
|
528 | 4439 |
RETURN (__MKSMALLINT(getplanes())); |
4440 |
#endif |
|
1932 | 4441 |
%}. |
4442 |
^ 0 |
|
528 | 4443 |
|
4444 |
"Modified: 19.3.1996 / 18:50:44 / cg" |
|
4445 |
! |
|
4446 |
||
294 | 4447 |
hasStereoExtension |
4448 |
"return true, if this workstation supports stereo GL drawing. |
|
4449 |
Both the server must support it, and the feature must have been |
|
4450 |
enabled in the smalltalk system, for true to be returned." |
|
4451 |
||
4452 |
^ hasStereoExtension |
|
4453 |
||
4454 |
" |
|
4718 | 4455 |
Display hasStereoExtension |
294 | 4456 |
" |
4457 |
! |
|
4458 |
||
3214 | 4459 |
isOpenGL |
4460 |
"return true, if this is an openGL (as opposed to a GL)" |
|
4461 |
||
4462 |
%{ /* NOCONTEXT */ |
|
4463 |
#ifdef OPENGL |
|
4464 |
RETURN ( true ); |
|
4465 |
#else |
|
4466 |
RETURN ( false ); |
|
4467 |
#endif |
|
4468 |
%} |
|
4469 |
! |
|
4470 |
||
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4471 |
isTrueGL |
1932 | 4472 |
"return true, if this is a true GL (as opposed to a simulated VOGL). |
4473 |
Returns false for all openGL systems." |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4474 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4475 |
%{ /* NOCONTEXT */ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4476 |
#ifdef VGL |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4477 |
RETURN ( false ); |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4478 |
#else |
1932 | 4479 |
# ifdef GLX |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4480 |
RETURN ( true ); |
1932 | 4481 |
# endif |
4482 |
#endif |
|
3214 | 4483 |
%}. |
4484 |
^ false |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4485 |
! |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4486 |
|
294 | 4487 |
maxZValue |
4488 |
"return the max. Z value (only valid if z-buffer is supported)" |
|
4718 | 4489 |
%{ |
1932 | 4490 |
#ifndef OPENGL |
4491 |
# ifdef GD_ZMAX |
|
294 | 4492 |
long zMax; |
4493 |
||
4494 |
if (_INST(glOK) == true) { |
|
4495 |
zMax = getgdesc(GD_ZMAX); |
|
4496 |
||
4497 |
if ((zMax >= _MIN_INT) && (zMax <= _MAX_INT)) { |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4498 |
RETURN ( __MKSMALLINT(zMax) ); |
294 | 4499 |
} |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4500 |
RETURN ( __MKLARGEINT(zMax) ); |
294 | 4501 |
} |
1932 | 4502 |
# endif |
294 | 4503 |
#endif |
4504 |
%}. |
|
4505 |
^ nil |
|
4506 |
! |
|
4507 |
||
4508 |
supportsDoubleBuffer |
|
4509 |
"return true, if this gl workstation supports double buffering. |
|
157 | 4510 |
For portable applications, always combine this with a query |
4511 |
if the display supports GL drawing at all." |
|
24 | 4512 |
|
4513 |
%{ /* NOCONTEXT */ |
|
294 | 4514 |
|
1932 | 4515 |
#ifndef OPENGL |
4516 |
# ifdef VGL |
|
4517 |
RETURN (true); |
|
4518 |
# else |
|
4519 |
# ifdef GD_BITS_NORM_DBL_RED |
|
294 | 4520 |
if (getgdesc(GD_BITS_NORM_DBL_RED) != 0) { |
4521 |
RETURN ( _INST(glOK) ); |
|
4522 |
} |
|
1932 | 4523 |
# endif |
4524 |
# endif |
|
24 | 4525 |
#endif |
89 | 4526 |
%}. |
4527 |
^ false |
|
4528 |
||
4529 |
" |
|
4718 | 4530 |
Display supportsDoubleBuffer |
294 | 4531 |
" |
4532 |
! |
|
4533 |
||
4534 |
supportsGLDrawing |
|
4535 |
"return true, if this device supports 3D GL drawing." |
|
4536 |
||
4537 |
^ glOK |
|
4538 |
||
4539 |
" |
|
4718 | 4540 |
Display supportsGLDrawing |
89 | 4541 |
" |
64 | 4542 |
! |
4543 |
||
4544 |
supportsLight |
|
157 | 4545 |
"return true, if this gl workstation supports light sources |
4546 |
(i.e. if its a real GL). |
|
4547 |
For portable applications, always combine this with a query |
|
4548 |
if the display supports GL drawing at all." |
|
89 | 4549 |
|
4550 |
%{ /* NOCONTEXT */ |
|
64 | 4551 |
#ifdef GLX |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4552 |
RETURN ( _INST(glOK) ); |
64 | 4553 |
#endif |
89 | 4554 |
%}. |
4555 |
^ false |
|
4556 |
||
4557 |
" |
|
4718 | 4558 |
Display supportsLight |
89 | 4559 |
" |
4560 |
! |
|
4561 |
||
294 | 4562 |
supportsRGB |
4563 |
"return true, if this gl workstation supports rgb |
|
4564 |
(in addition to indexed) colors. Actually, we return true |
|
4565 |
for a real GL engine, false for the simulator here. |
|
4566 |
For portable applications, always combine this with a query |
|
4567 |
if the display supports GL drawing at all." |
|
4568 |
||
4569 |
%{ /* NOCONTEXT */ |
|
4570 |
#ifdef GLX |
|
4571 |
RETURN ( _INST(glOK) ); |
|
4572 |
#endif |
|
4573 |
%}. |
|
4574 |
^ false |
|
4575 |
||
4576 |
" |
|
4718 | 4577 |
Display supportsRGB |
294 | 4578 |
" |
4579 |
! |
|
4580 |
||
89 | 4581 |
supportsTextures |
4582 |
"return true, if this gl workstation supports texture mapping |
|
157 | 4583 |
(i.e. if its a real GL). |
4584 |
For portable applications, always combine this with a query |
|
4585 |
if the display supports GL drawing at all." |
|
89 | 4586 |
|
4587 |
%{ /* NOCONTEXT */ |
|
1932 | 4588 |
#ifndef OPENGL |
4589 |
# ifdef GD_TEXTURE |
|
89 | 4590 |
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
|
4591 |
RETURN ( _INST(glOK) ); |
89 | 4592 |
} |
1932 | 4593 |
# endif |
89 | 4594 |
#endif |
4595 |
%}. |
|
4596 |
^ false |
|
4597 |
||
4598 |
" |
|
4718 | 4599 |
Display supportsTextures |
89 | 4600 |
" |
4601 |
! |
|
4602 |
||
4603 |
supportsZBuffer |
|
157 | 4604 |
"return true, if this gl workstation has z buffer support. |
4605 |
For portable applications, always combine this with a query |
|
4606 |
if the display supports GL drawing at all." |
|
4607 |
||
89 | 4608 |
%{ /* NOCONTEXT */ |
4609 |
||
1932 | 4610 |
#ifndef OPENGL |
4611 |
# ifdef GD_BITS_NORM_ZBUFFER |
|
89 | 4612 |
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
|
4613 |
RETURN ( _INST(glOK) ); |
89 | 4614 |
} |
1932 | 4615 |
# endif |
89 | 4616 |
#endif |
4617 |
%}. |
|
4618 |
^ false |
|
4619 |
||
4620 |
" |
|
4718 | 4621 |
Display supportsZBuffer |
89 | 4622 |
" |
294 | 4623 |
! ! |
4624 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4625 |
!GLXWorkstation methodsFor:'rectangles'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4626 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4627 |
glxRectX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4628 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4629 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4630 |
SETWIN(aGLXWindowId) |
1932 | 4631 |
#ifdef OPENGL |
4632 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4633 |
rect(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
1932 | 4634 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4635 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4636 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4637 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4638 |
glxRectfX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4639 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4640 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4641 |
SETWIN(aGLXWindowId) |
1932 | 4642 |
#ifdef OPENGL |
4643 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4644 |
rectf(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
1932 | 4645 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4646 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4647 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4648 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4649 |
glxRectfiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4650 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4651 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4652 |
SETWIN(aGLXWindowId) |
1932 | 4653 |
#ifdef OPENGL |
4654 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4655 |
rectfi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
1932 | 4656 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4657 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4658 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4659 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4660 |
glxRectfsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4661 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4662 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4663 |
SETWIN(aGLXWindowId) |
1932 | 4664 |
#ifdef OPENGL |
4665 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4666 |
rectfs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
1932 | 4667 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4668 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4669 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4670 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4671 |
glxRectiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4672 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4673 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4674 |
SETWIN(aGLXWindowId) |
1932 | 4675 |
#ifdef OPENGL |
4676 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4677 |
recti(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
1932 | 4678 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4679 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4680 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4681 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4682 |
glxRectsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4683 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4684 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4685 |
SETWIN(aGLXWindowId) |
1932 | 4686 |
#ifdef OPENGL |
4687 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4688 |
rects(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
1932 | 4689 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4690 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4691 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4692 |
|
528 | 4693 |
!GLXWorkstation methodsFor:'spheres'! |
294 | 4694 |
|
4695 |
glxSphDraw:arrayOf4Floats in:aGLXWindowId |
|
4696 |
"argument must be an array(a matrix) of 4 floats containing the |
|
4697 |
sphere - in real GL only" |
|
4698 |
||
4699 |
%{ /* NOCONTEXT */ |
|
4700 |
#ifdef GLX |
|
4701 |
float vec[4], *v; |
|
4702 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4703 |
if (! (v = __glx_getFloatsFromInto(arrayOf4Floats, vec, 4))) RETURN(false); |
294 | 4704 |
SETWIN(aGLXWindowId) |
4705 |
sphdraw(v); |
|
1932 | 4706 |
#endif |
4707 |
%} |
|
294 | 4708 |
! |
4709 |
||
4710 |
glxSphDrawX:x y:y z:z radius:r in:aGLXWindowId |
|
4711 |
"arguments must be convertable to floats - in real GL only" |
|
4712 |
||
4713 |
%{ /* NOCONTEXT */ |
|
4714 |
#ifdef GLX |
|
4715 |
float vec[4]; |
|
4716 |
||
4717 |
_FLOAT_(x, vec[0]) |
|
4718 |
_FLOAT_(y, vec[1]) |
|
4719 |
_FLOAT_(z, vec[2]) |
|
4720 |
_FLOAT_(r, vec[3]) |
|
4721 |
SETWIN(aGLXWindowId) |
|
4722 |
sphdraw(vec); |
|
1932 | 4723 |
#endif |
4724 |
%} |
|
294 | 4725 |
! |
4726 |
||
4727 |
glxSphfreeIn: aGLXWindowId |
|
4728 |
||
4729 |
%{ /* NOCONTEXT */ |
|
4730 |
#ifdef GLX |
|
4731 |
SETWIN(aGLXWindowId) |
|
4732 |
sphfree(); |
|
1932 | 4733 |
#endif |
4734 |
%} |
|
294 | 4735 |
! |
4736 |
||
4737 |
glxSphgnpolysIn: aGLXWindowId |
|
4738 |
||
4739 |
%{ /* NOCONTEXT */ |
|
4740 |
#ifdef GLX |
|
4741 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4742 |
RETURN (__MKSMALLINT(sphgnpolys())); |
294 | 4743 |
#endif |
4744 |
%} |
|
4745 |
! |
|
4746 |
||
4747 |
glxSphmode: attribute value: value in: aGLXWindowId |
|
4748 |
||
4749 |
%{ /* NOCONTEXT */ |
|
4750 |
#ifdef GLX |
|
4751 |
SETWIN(aGLXWindowId) |
|
4752 |
sphmode(__intVal(attribute), __intVal(value)); |
|
1932 | 4753 |
#endif |
4754 |
%} |
|
294 | 4755 |
! |
4756 |
||
4757 |
glxSphobj: objid in: aGLXWindowId |
|
4758 |
||
4759 |
%{ /* NOCONTEXT */ |
|
4760 |
#ifdef GLX |
|
4761 |
SETWIN(aGLXWindowId) |
|
4762 |
sphobj(_objectVal(objid)); |
|
1932 | 4763 |
#endif |
4764 |
%} |
|
294 | 4765 |
! |
4766 |
||
4767 |
glxSphrotmatrix: mat in: aGLXWindowId |
|
4768 |
||
4769 |
%{ /* NOCONTEXT */ |
|
4770 |
#ifdef GLX |
|
4771 |
Matrix matrix, *m; |
|
4772 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4773 |
if (! (m = __glx_getFloatsFromMatrixInto(mat, &matrix))) RETURN (false); |
294 | 4774 |
SETWIN(aGLXWindowId) |
4775 |
sphrotmatrix(*m); |
|
1932 | 4776 |
#endif |
4777 |
%} |
|
294 | 4778 |
! ! |
4779 |
||
4780 |
!GLXWorkstation methodsFor:'stereo extension'! |
|
4781 |
||
528 | 4782 |
glxLeftbuffer: bool in: aGLXWindowId |
4783 |
||
4784 |
%{ /* NOCONTEXT */ |
|
4785 |
#ifdef FULL_GLX |
|
4786 |
SETWIN(aGLXWindowId) |
|
4787 |
leftbuffer(_booleanVal(bool)); |
|
1932 | 4788 |
#endif |
4789 |
%} |
|
528 | 4790 |
! |
4791 |
||
4792 |
glxMonobufferIn: aGLXWindowId |
|
4793 |
||
4794 |
%{ /* NOCONTEXT */ |
|
4795 |
#ifdef FULL_GLX |
|
4796 |
SETWIN(aGLXWindowId) |
|
4797 |
monobuffer(); |
|
1932 | 4798 |
#endif |
4799 |
%} |
|
528 | 4800 |
! |
4801 |
||
4802 |
glxRightbuffer: bool in: aGLXWindowId |
|
4803 |
||
4804 |
%{ /* NOCONTEXT */ |
|
4805 |
#ifdef FULL_GLX |
|
4806 |
SETWIN(aGLXWindowId) |
|
4807 |
rightbuffer(_booleanVal(bool)); |
|
1932 | 4808 |
#endif |
4809 |
%} |
|
528 | 4810 |
! |
4811 |
||
294 | 4812 |
stereoExtensionBuffer:aBufferSymbol for:aWindowId |
4813 |
"set the current stereo buffer; the argument may be one of: |
|
4814 |
#left -> STEREO_BUFFER_LEFT |
|
4815 |
#right -> STEREO_BUFFER_RIGHT |
|
4816 |
" |
|
4817 |
||
4818 |
%{ /* NOCONTEXT */ |
|
4819 |
#if defined(XSGIStereo) && defined(GLX) |
|
4820 |
Status status; |
|
4821 |
int buffer; |
|
4822 |
Window win; |
|
4823 |
||
4718 | 4824 |
if (ISCONNECTED |
294 | 4825 |
&& __isExternalAddress(aWindowId)) { |
4826 |
win = _WindowVal(aWindowId); |
|
4827 |
if (aBufferSymbol == @symbol(left)) { |
|
4828 |
buffer = STEREO_BUFFER_LEFT; |
|
4829 |
} else { |
|
4830 |
if (aBufferSymbol == @symbol(right)) { |
|
4831 |
buffer = STEREO_BUFFER_RIGHT; |
|
4832 |
} else { |
|
4833 |
goto bad; |
|
4834 |
} |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4835 |
} |
294 | 4836 |
status = XSGISetStereoBuffer(myDpy, win, buffer); |
4837 |
RETURN ( status ? true : false); |
|
4838 |
} |
|
4839 |
bad: ; |
|
4840 |
#endif |
|
4841 |
%}. |
|
4842 |
self primitiveFailed |
|
4843 |
||
4844 |
" |
|
4845 |
|t v| |
|
4846 |
||
4847 |
t := StandardSystemView new. |
|
4848 |
t extent:300@300. |
|
4849 |
v := GLXView origin:0.0@0.0 corner:1.0@1.0 in:t. |
|
4850 |
t openAndWait. |
|
4851 |
||
4718 | 4852 |
v device stereoExtensionBuffer:#left for:(v id). |
294 | 4853 |
(Delay forSeconds:10) wait. |
4718 | 4854 |
v device stereoExtensionBuffer:#right for:(v id). |
294 | 4855 |
" |
4856 |
! |
|
4857 |
||
4858 |
stereoExtensionMode:aModeSymbol height:h offset:o for:aWindowId |
|
4859 |
"set the current stereo mode; the argument may be one of: |
|
4860 |
nil/false #off -> turn it off |
|
4861 |
#bottom -> STEREO_BOTTOM |
|
4862 |
#top -> STEREO_TOP |
|
4863 |
" |
|
4864 |
||
4865 |
%{ /* NOCONTEXT */ |
|
4866 |
#if defined(XSGIStereo) && defined(GLX) |
|
4867 |
Status status; |
|
4868 |
int mode; |
|
4869 |
unsigned short us_h, us_o; |
|
4870 |
Window win; |
|
4871 |
||
4718 | 4872 |
if (ISCONNECTED |
294 | 4873 |
&& __bothSmallInteger(h, o) |
4874 |
&& __isExternalAddress(aWindowId)) { |
|
4875 |
win = _WindowVal(aWindowId); |
|
4876 |
if ((aModeSymbol == nil) |
|
4877 |
|| (aModeSymbol == false) |
|
4878 |
|| (aModeSymbol == @symbol(off))) { |
|
4879 |
mode = STEREO_OFF; |
|
4880 |
} else { |
|
4881 |
if (aModeSymbol == @symbol(bottom)) { |
|
4882 |
mode = STEREO_BOTTOM; |
|
4883 |
} else { |
|
4884 |
if (aModeSymbol == @symbol(top)) { |
|
4885 |
mode = STEREO_TOP; |
|
4886 |
} else { |
|
4887 |
goto bad; |
|
4888 |
} |
|
4889 |
} |
|
4890 |
} |
|
4891 |
us_h = __intVal(h); |
|
4892 |
us_o = __intVal(o); |
|
4893 |
status = XSGISetStereoMode(myDpy, win, us_h, us_o, mode); |
|
4894 |
RETURN ( status ? true : false); |
|
4895 |
} |
|
4896 |
bad: ; |
|
4897 |
#endif |
|
4898 |
%}. |
|
4899 |
self primitiveFailed |
|
4900 |
||
4901 |
" |
|
4718 | 4902 |
Display stereoExtensionMode:#top height:492 offset:532 for:(Display rootWindowId). |
294 | 4903 |
(Delay forSeconds:10) wait. |
4718 | 4904 |
Display stereoExtensionMode:#off height:0 offset:0 for:(Display rootWindowId). |
294 | 4905 |
" |
4906 |
! |
|
4907 |
||
4908 |
stereoExtensionModeIn:aWindowId |
|
4909 |
"return the current stereo mode for some window" |
|
4910 |
||
4911 |
%{ /* NOCONTEXT */ |
|
4912 |
#if defined(XSGIStereo) && defined(GLX) |
|
4913 |
int mode; |
|
4914 |
Window win; |
|
4915 |
||
4916 |
if (ISCONNECTED && __isExternalAddress(aWindowId)) { |
|
4917 |
win = _WindowVal(aWindowId); |
|
4918 |
mode = XSGIQueryStereoMode(myDpy, win); |
|
4919 |
switch (mode) { |
|
4920 |
case STEREO_OFF: |
|
4921 |
RETURN ( @symbol(off) ); |
|
4922 |
case STEREO_BOTTOM: |
|
4923 |
RETURN ( @symbol(bottom) ); |
|
4924 |
case STEREO_TOP: |
|
4925 |
RETURN ( @symbol(top) ); |
|
4926 |
} |
|
4927 |
RETURN ( @symbol(unsupported) ); |
|
4928 |
} |
|
4929 |
#endif |
|
4930 |
%}. |
|
4931 |
self primitiveFailed |
|
4932 |
||
4933 |
" |
|
4934 |
|v| |
|
4935 |
||
4936 |
v := StandardSystemView new. |
|
4937 |
v extent:300@300. |
|
4938 |
v openAndWait. |
|
4939 |
v device stereoExtensionModeIn:(v id) |
|
4940 |
||
4718 | 4941 |
Display stereoExtensionModeIn:Display rootWindowId |
294 | 4942 |
" |
4943 |
! |
|
4944 |
||
4945 |
stereoExtensionVersion |
|
4946 |
"return the stereo extensions version as an array consisting of |
|
4947 |
major and minor numbers." |
|
4948 |
||
4949 |
%{ /* NOCONTEXT */ |
|
4950 |
#if defined(XSGIStereo) && defined(GLX) |
|
4951 |
Status status; |
|
4952 |
Display *dpy = myDpy; |
|
4953 |
int major, minor; |
|
4954 |
||
4955 |
if (ISCONNECTED) { |
|
4956 |
status = XSGIStereoQueryVersion(myDpy, &major, &minor); |
|
4957 |
if (status == True) { |
|
4958 |
RETURN ( __ARRAY_WITH2(__MKSMALLINT(major), __MKSMALLINT(minor))); |
|
4959 |
} |
|
89 | 4960 |
} |
4961 |
#endif |
|
4962 |
%}. |
|
294 | 4963 |
self primitiveFailed |
185 | 4964 |
|
4965 |
" |
|
294 | 4966 |
Display stereoExtensionVersion |
185 | 4967 |
" |
24 | 4968 |
! ! |
4969 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4970 |
!GLXWorkstation methodsFor:'texture data transfer'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4971 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4972 |
glxT2d: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4973 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4974 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4975 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4976 |
double vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4977 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4978 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4979 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4980 |
t2d(c_v); |
1932 | 4981 |
#endif |
4982 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4983 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4984 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4985 |
glxT2f: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4986 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4987 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4988 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4989 |
float vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4990 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4991 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4992 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4993 |
t2f(c_v); |
1932 | 4994 |
#endif |
4995 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4996 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4997 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4998 |
glxT2i: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4999 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5000 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5001 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5002 |
long vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5003 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5004 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5005 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5006 |
t2i(c_v); |
1932 | 5007 |
#endif |
5008 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5009 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5010 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5011 |
glxT2s: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5012 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5013 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5014 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5015 |
short vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5016 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5017 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5018 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5019 |
t2s(c_v); |
1932 | 5020 |
#endif |
5021 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5022 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5023 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5024 |
glxT3d:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5025 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5026 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5027 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5028 |
double vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5029 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5030 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5031 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5032 |
t3d(c_v); |
1932 | 5033 |
#endif |
5034 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5035 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5036 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5037 |
glxT3f:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5038 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5039 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5040 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5041 |
float vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5042 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5043 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5044 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5045 |
t3f(c_v); |
1932 | 5046 |
#endif |
5047 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5048 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5049 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5050 |
glxT3i:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5051 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5052 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5053 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5054 |
long vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5055 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5056 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5057 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5058 |
t3i(c_v); |
1932 | 5059 |
#endif |
5060 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5061 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5062 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5063 |
glxT3s:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5064 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5065 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5066 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5067 |
short vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5068 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5069 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5070 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5071 |
t3s(c_v); |
1932 | 5072 |
#endif |
5073 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5074 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5075 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5076 |
glxT4d: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5077 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5078 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5079 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5080 |
double vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5081 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5082 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5083 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5084 |
t4d(c_v); |
1932 | 5085 |
#endif |
5086 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5087 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5088 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5089 |
glxT4f: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5090 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5091 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5092 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5093 |
float vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5094 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5095 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5096 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5097 |
t4f(c_v); |
1932 | 5098 |
#endif |
5099 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5100 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5101 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5102 |
glxT4i: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5103 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5104 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5105 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5106 |
long vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5107 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5108 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5109 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5110 |
t4i(c_v); |
1932 | 5111 |
#endif |
5112 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5113 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5114 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5115 |
glxT4s: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5116 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5117 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5118 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5119 |
short vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5120 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5121 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5122 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5123 |
t4s(c_v); |
1932 | 5124 |
#endif |
5125 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5126 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5127 |
|
294 | 5128 |
!GLXWorkstation methodsFor:'transformations'! |
5129 |
||
5130 |
glxRotate:angle axis:axis in:aGLXWindowId |
|
5131 |
"rotate the current matrix around the axis given by the axis arg, |
|
5132 |
which must be one of the symbols: #x, #y or #z. |
|
5133 |
The angle is in degrees." |
|
5134 |
||
5135 |
%{ /* NOCONTEXT */ |
|
5136 |
||
5137 |
char c_axis; |
|
5138 |
||
5139 |
if (axis == @symbol(x)) |
|
5140 |
c_axis = 'x'; |
|
5141 |
else if (axis == @symbol(y)) |
|
5142 |
c_axis = 'y'; |
|
5143 |
else if (axis == @symbol(z)) |
|
5144 |
c_axis = 'z'; |
|
5145 |
else { |
|
5146 |
RETURN (false); |
|
5147 |
} |
|
5148 |
||
5149 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5150 |
RETURN ( __glx_doRotate(angle, c_axis) ); |
294 | 5151 |
%} |
5152 |
! |
|
5153 |
||
5154 |
glxRotate:arrayOf3Floats in:aGLXWindowId |
|
5155 |
"rotate current matrix, given a 3-element vector (or more). |
|
5156 |
The elements of the array are degrees." |
|
5157 |
||
5158 |
%{ /* NOCONTEXT */ |
|
5159 |
||
5160 |
float vec[3], *v; |
|
5161 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5162 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5163 |
|
5164 |
SETWIN(aGLXWindowId) |
|
1932 | 5165 |
#ifdef OPENGL |
5166 |
#else |
|
294 | 5167 |
rot(v[0], 'x'); |
5168 |
rot(v[1], 'y'); |
|
5169 |
rot(v[2], 'z'); |
|
1932 | 5170 |
#endif |
294 | 5171 |
%} |
5172 |
! |
|
5173 |
||
5174 |
glxRotateI:angle axis:axis in:aGLXWindowId |
|
5175 |
"rotate the current matrix around the axis given by the axis arg, |
|
5176 |
which must be one of the symbols: #x, #y or #z. |
|
5177 |
The angle is an integer specifying tenths of a degree." |
|
5178 |
||
5179 |
%{ /* NOCONTEXT */ |
|
5180 |
||
5181 |
char c_axis; |
|
5182 |
||
5183 |
if (axis == @symbol(x)) |
|
5184 |
c_axis = 'x'; |
|
5185 |
else if (axis == @symbol(y)) |
|
5186 |
c_axis = 'y'; |
|
5187 |
else if (axis == @symbol(z)) |
|
5188 |
c_axis = 'z'; |
|
5189 |
else { |
|
5190 |
RETURN (false); |
|
5191 |
} |
|
5192 |
||
5193 |
if (__isSmallInteger(angle)) { |
|
5194 |
SETWIN(aGLXWindowId) |
|
1932 | 5195 |
#ifdef OPENGL |
5196 |
#else |
|
294 | 5197 |
rotate(__intVal(angle), c_axis); |
1932 | 5198 |
#endif |
294 | 5199 |
} |
5200 |
%} |
|
5201 |
! |
|
5202 |
||
5203 |
glxRotateIX:angle in:aGLXWindowId |
|
5204 |
"rotate the current matrix on x axis. |
|
5205 |
The angle is an integer specifying tenths of a degree." |
|
5206 |
||
5207 |
%{ /* NOCONTEXT */ |
|
5208 |
||
5209 |
if (__isSmallInteger(angle)) { |
|
5210 |
SETWIN(aGLXWindowId) |
|
1932 | 5211 |
#ifdef OPENGL |
5212 |
#else |
|
294 | 5213 |
rotate(__intVal(angle), 'x'); |
1932 | 5214 |
#endif |
294 | 5215 |
} |
5216 |
%} |
|
5217 |
! |
|
5218 |
||
5219 |
glxRotateIX:xAngle y:yAngle z:zAngle in:aGLXWindowId |
|
5220 |
"rotate the current matrix on all axes, given individual x, y and z values. |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5221 |
The values are smallIntegers specifying tenths of a degree." |
294 | 5222 |
|
5223 |
%{ /* NOCONTEXT */ |
|
5224 |
||
5225 |
if (__bothSmallInteger(xAngle, yAngle) |
|
5226 |
&& __isSmallInteger(zAngle)) { |
|
5227 |
SETWIN(aGLXWindowId) |
|
1932 | 5228 |
#ifdef OPENGL |
5229 |
#else |
|
294 | 5230 |
rotate(__intVal(xAngle), 'x'); |
5231 |
rotate(__intVal(yAngle), 'y'); |
|
5232 |
rotate(__intVal(zAngle), 'z'); |
|
1932 | 5233 |
#endif |
294 | 5234 |
} |
5235 |
%} |
|
5236 |
! |
|
5237 |
||
5238 |
glxRotateIY:angle in:aGLXWindowId |
|
5239 |
"rotate the current matrix on x axis. |
|
5240 |
The angle is an integer specifying tenths of a degree." |
|
5241 |
||
5242 |
%{ /* NOCONTEXT */ |
|
5243 |
||
5244 |
if (__isSmallInteger(angle)) { |
|
5245 |
SETWIN(aGLXWindowId) |
|
1932 | 5246 |
#ifdef OPENGL |
5247 |
#else |
|
294 | 5248 |
rotate(__intVal(angle), 'y'); |
1932 | 5249 |
#endif |
294 | 5250 |
} |
5251 |
%} |
|
5252 |
! |
|
5253 |
||
5254 |
glxRotateIZ:angle in:aGLXWindowId |
|
5255 |
"rotate the current matrix on x axis. |
|
5256 |
The angle is an integer specifying tenths of a degree." |
|
5257 |
||
5258 |
%{ /* NOCONTEXT */ |
|
5259 |
||
5260 |
if (__isSmallInteger(angle)) { |
|
5261 |
SETWIN(aGLXWindowId) |
|
1932 | 5262 |
#ifdef OPENGL |
5263 |
#else |
|
294 | 5264 |
rotate(__intVal(angle), 'z'); |
1932 | 5265 |
#endif |
294 | 5266 |
} |
5267 |
%} |
|
5268 |
! |
|
5269 |
||
5270 |
glxRotateX:angle in:aGLXWindowId |
|
5271 |
"rotate the current matrix on x axis. |
|
5272 |
The angle is in degrees." |
|
5273 |
||
5274 |
%{ /* NOCONTEXT */ |
|
5275 |
||
5276 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5277 |
RETURN (__glx_doRotate(angle, 'x')); |
294 | 5278 |
%} |
5279 |
! |
|
5280 |
||
5281 |
glxRotateX:xAngle y:yAngle z:zAngle in:aGLXWindowId |
|
5282 |
"rotate the current matrix on all axes, given individual x, y and z values. |
|
5283 |
The values are in degrees" |
|
5284 |
||
5285 |
%{ /* NOCONTEXT */ |
|
5286 |
||
5287 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5288 |
if ( __glx_doRotate(xAngle, 'x') == true) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5289 |
if ( __glx_doRotate(yAngle, 'y') == true) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5290 |
RETURN (__glx_doRotate(zAngle, 'z')); |
294 | 5291 |
} |
5292 |
} |
|
5293 |
%} |
|
5294 |
! |
|
5295 |
||
5296 |
glxRotateY:angle in:aGLXWindowId |
|
5297 |
"rotate the current matrix on y axis. |
|
5298 |
The angle is in degrees." |
|
5299 |
||
5300 |
%{ /* NOCONTEXT */ |
|
5301 |
||
5302 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5303 |
RETURN (__glx_doRotate(angle, 'y')); |
294 | 5304 |
%} |
5305 |
! |
|
5306 |
||
5307 |
glxRotateZ:angle in:aGLXWindowId |
|
5308 |
"rotate the current matrix on z axis. |
|
5309 |
The angle is in degrees." |
|
5310 |
||
5311 |
%{ /* NOCONTEXT */ |
|
5312 |
||
5313 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5314 |
RETURN (__glx_doRotate(angle, 'z')); |
294 | 5315 |
%} |
5316 |
! |
|
5317 |
||
5318 |
glxScale:arrayOf3Floats in:aGLXWindowId |
|
5319 |
"scale current matrix, given a 3-element vector" |
|
5320 |
||
5321 |
%{ /* NOCONTEXT */ |
|
5322 |
||
5323 |
float vec[3], *v; |
|
5324 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5325 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5326 |
|
5327 |
SETWIN(aGLXWindowId) |
|
1932 | 5328 |
#ifdef OPENGL |
5329 |
#else |
|
294 | 5330 |
scale(v[0], v[1], v[2]); |
1932 | 5331 |
#endif |
294 | 5332 |
%} |
5333 |
! |
|
5334 |
||
5335 |
glxScaleX:x in:aGLXWindowId |
|
5336 |
"scale in x direction" |
|
5337 |
||
5338 |
%{ /* NOCONTEXT */ |
|
5339 |
||
5340 |
float f_x; |
|
5341 |
||
5342 |
_FLOAT_ (x, f_x) |
|
5343 |
SETWIN(aGLXWindowId) |
|
1932 | 5344 |
#ifdef OPENGL |
5345 |
#else |
|
294 | 5346 |
scale(f_x, (float)0, (float)0); |
1932 | 5347 |
#endif |
294 | 5348 |
%} |
5349 |
! |
|
5350 |
||
5351 |
glxScaleX:x y:y z:z in:aGLXWindowId |
|
5352 |
"scale & mirror current matrix, given individual x, y and z values" |
|
5353 |
||
5354 |
%{ /* NOCONTEXT */ |
|
5355 |
||
5356 |
float f_x, f_y, f_z; |
|
5357 |
||
5358 |
_FLOAT_ (x, f_x) |
|
5359 |
_FLOAT_ (y, f_y) |
|
5360 |
_FLOAT_ (z, f_z) |
|
5361 |
SETWIN(aGLXWindowId) |
|
1932 | 5362 |
#ifdef OPENGL |
5363 |
#else |
|
294 | 5364 |
scale(f_x, f_y, f_z); |
1932 | 5365 |
#endif |
294 | 5366 |
%} |
5367 |
! |
|
5368 |
||
5369 |
glxScaleY:y in:aGLXWindowId |
|
5370 |
"scale in y direction" |
|
5371 |
||
5372 |
%{ /* NOCONTEXT */ |
|
5373 |
||
5374 |
float f_y; |
|
5375 |
||
5376 |
_FLOAT_ (y, f_y) |
|
5377 |
SETWIN(aGLXWindowId) |
|
1932 | 5378 |
#ifdef OPENGL |
5379 |
#else |
|
294 | 5380 |
scale((float)0, f_y, (float)0); |
1932 | 5381 |
#endif |
294 | 5382 |
%} |
5383 |
! |
|
5384 |
||
5385 |
glxScaleZ:z in:aGLXWindowId |
|
5386 |
"scale in z direction" |
|
5387 |
||
5388 |
%{ /* NOCONTEXT */ |
|
5389 |
||
5390 |
float f_z; |
|
5391 |
||
5392 |
_FLOAT_ (z, f_z) |
|
5393 |
SETWIN(aGLXWindowId) |
|
1932 | 5394 |
#ifdef OPENGL |
5395 |
#else |
|
294 | 5396 |
scale((float)0, (float)0, f_z); |
1932 | 5397 |
#endif |
294 | 5398 |
%} |
5399 |
! |
|
5400 |
||
5401 |
glxTranslate:arrayOf3Floats in:aGLXWindowId |
|
5402 |
"translate current matrix, given a 3-element vector" |
|
5403 |
||
5404 |
%{ /* NOCONTEXT */ |
|
5405 |
||
5406 |
float vec[3], *v; |
|
5407 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5408 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5409 |
|
5410 |
SETWIN(aGLXWindowId) |
|
1932 | 5411 |
#ifdef OPENGL |
5412 |
#else |
|
294 | 5413 |
translate((Coord)(v[0]), (Coord)(v[1]), (Coord)(v[2])); |
1932 | 5414 |
#endif |
294 | 5415 |
%} |
5416 |
! |
|
5417 |
||
5418 |
glxTranslateX:x in:aGLXWindowId |
|
5419 |
"translate current matrix on X axis" |
|
5420 |
||
5421 |
%{ /* NOCONTEXT */ |
|
5422 |
||
5423 |
Coord c_x; |
|
5424 |
||
5425 |
_COORD_ (x, c_x) |
|
5426 |
SETWIN(aGLXWindowId) |
|
1932 | 5427 |
#ifdef OPENGL |
5428 |
#else |
|
294 | 5429 |
translate(c_x, (Coord)0, (Coord)0); |
1932 | 5430 |
#endif |
294 | 5431 |
%} |
5432 |
! |
|
5433 |
||
5434 |
glxTranslateX:x y:y z:z in:aGLXWindowId |
|
5435 |
"translate current matrix, given individual x, y and z values" |
|
5436 |
||
5437 |
%{ /* NOCONTEXT */ |
|
5438 |
||
5439 |
Coord c_x, c_y, c_z; |
|
5440 |
||
5441 |
_COORD_ (x, c_x) |
|
5442 |
_COORD_ (y, c_y) |
|
5443 |
_COORD_ (z, c_z) |
|
5444 |
SETWIN(aGLXWindowId) |
|
1932 | 5445 |
#ifdef OPENGL |
5446 |
#else |
|
294 | 5447 |
translate(c_x, c_y, c_z); |
1932 | 5448 |
#endif |
294 | 5449 |
%} |
5450 |
! |
|
5451 |
||
5452 |
glxTranslateY:y in:aGLXWindowId |
|
5453 |
"translate current matrix on Y axis" |
|
5454 |
||
5455 |
%{ /* NOCONTEXT */ |
|
5456 |
||
5457 |
Coord c_y; |
|
5458 |
||
5459 |
_COORD_ (y, c_y) |
|
5460 |
SETWIN(aGLXWindowId) |
|
1932 | 5461 |
#ifdef OPENGL |
5462 |
#else |
|
294 | 5463 |
translate((Coord)0, c_y, (Coord)0); |
1932 | 5464 |
#endif |
294 | 5465 |
%} |
5466 |
! |
|
5467 |
||
5468 |
glxTranslateZ:z in:aGLXWindowId |
|
5469 |
"translate current matrix on Z axis" |
|
5470 |
||
5471 |
%{ /* NOCONTEXT */ |
|
5472 |
||
5473 |
Coord c_z; |
|
5474 |
||
5475 |
_COORD_ (z, c_z) |
|
5476 |
SETWIN(aGLXWindowId) |
|
1932 | 5477 |
#ifdef OPENGL |
5478 |
#else |
|
294 | 5479 |
translate((Coord)0, (Coord)0, c_z); |
1932 | 5480 |
#endif |
294 | 5481 |
%} |
5482 |
! ! |
|
5483 |
||
5484 |
!GLXWorkstation methodsFor:'unspecified rest'! |
|
5485 |
||
5486 |
glxAcbufOp:op value:value in:aGLXWindowId |
|
5487 |
||
5488 |
%{ /* NOCONTEXT */ |
|
1932 | 5489 |
SETWIN(aGLXWindowId) |
5490 |
#ifdef GLX |
|
294 | 5491 |
acbuf(__intVal(op), _floatVal(value)); |
1932 | 5492 |
#endif |
5493 |
%} |
|
294 | 5494 |
! |
5495 |
||
5496 |
glxAcsizePlanes: planes in: aGLXWindowId |
|
5497 |
||
5498 |
%{ /* NOCONTEXT */ |
|
1932 | 5499 |
SETWIN(aGLXWindowId) |
5500 |
#ifdef GLX |
|
294 | 5501 |
acsize(__intVal(planes)); |
1932 | 5502 |
#endif |
5503 |
%} |
|
294 | 5504 |
! |
5505 |
||
5506 |
glxAfunctionRef: ref func: func in: aGLXWindowId |
|
5507 |
||
5508 |
%{ /* NOCONTEXT */ |
|
1932 | 5509 |
SETWIN(aGLXWindowId) |
5510 |
#ifdef GLX |
|
294 | 5511 |
afunction(__intVal(ref), __intVal(func)); |
1932 | 5512 |
#endif |
5513 |
%} |
|
294 | 5514 |
! |
5515 |
||
5516 |
glxBbox2Xmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5517 |
||
5518 |
%{ /* NOCONTEXT */ |
|
5519 |
Screencoord c_xmin, c_ymin; |
|
4718 | 5520 |
Coord c_x1, c_y1, c_x2, c_y2; |
294 | 5521 |
|
5522 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5523 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5524 |
_COORD_ (x1, c_x1) |
|
5525 |
_COORD_ (y1, c_y1) |
|
5526 |
_COORD_ (x2, c_x2) |
|
5527 |
_COORD_ (y2, c_y2) |
|
5528 |
SETWIN(aGLXWindowId) |
|
1932 | 5529 |
#ifdef GLX |
294 | 5530 |
bbox2(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5531 |
#endif |
5532 |
%} |
|
294 | 5533 |
! |
5534 |
||
5535 |
glxBbox2iXmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5536 |
||
5537 |
%{ /* NOCONTEXT */ |
|
5538 |
Screencoord c_xmin, c_ymin; |
|
4718 | 5539 |
Icoord c_x1, c_y1, c_x2, c_y2; |
294 | 5540 |
|
5541 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5542 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5543 |
_ICOORD_ (x1, c_x1) |
|
5544 |
_ICOORD_ (y1, c_y1) |
|
5545 |
_ICOORD_ (x2, c_x2) |
|
5546 |
_ICOORD_ (y2, c_y2) |
|
5547 |
SETWIN(aGLXWindowId) |
|
1932 | 5548 |
#ifdef GLX |
294 | 5549 |
bbox2i(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5550 |
#endif |
5551 |
%} |
|
294 | 5552 |
! |
5553 |
||
5554 |
glxBbox2sXmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5555 |
||
5556 |
%{ /* NOCONTEXT */ |
|
5557 |
Screencoord c_xmin, c_ymin; |
|
4718 | 5558 |
Scoord c_x1, c_y1, c_x2, c_y2; |
294 | 5559 |
|
5560 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5561 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5562 |
_SCOORD_ (x1, c_x1) |
|
5563 |
_SCOORD_ (y1, c_y1) |
|
5564 |
_SCOORD_ (x2, c_x2) |
|
5565 |
_SCOORD_ (y2, c_y2) |
|
5566 |
SETWIN(aGLXWindowId) |
|
1932 | 5567 |
#ifdef GLX |
294 | 5568 |
bbox2s(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5569 |
#endif |
5570 |
%} |
|
294 | 5571 |
! |
5572 |
||
5573 |
glxBeginTrimIn: aGLXWindowId |
|
5574 |
||
5575 |
%{ /* NOCONTEXT */ |
|
1932 | 5576 |
SETWIN(aGLXWindowId) |
5577 |
#ifdef GLX |
|
294 | 5578 |
bgntrim(); |
1932 | 5579 |
#endif |
5580 |
%} |
|
294 | 5581 |
! |
5582 |
||
5583 |
glxBlankscreen: b in: aGLXWindowId |
|
5584 |
||
5585 |
%{ /* NOCONTEXT */ |
|
1932 | 5586 |
SETWIN(aGLXWindowId) |
5587 |
#ifdef GLX |
|
294 | 5588 |
blankscreen(_booleanVal(b)); |
1932 | 5589 |
#endif |
5590 |
%} |
|
294 | 5591 |
! |
5592 |
||
5593 |
glxBlanktime: count in: aGLXWindowId |
|
5594 |
||
5595 |
%{ /* NOCONTEXT */ |
|
1932 | 5596 |
SETWIN(aGLXWindowId) |
5597 |
#ifdef GLX |
|
294 | 5598 |
blanktime(__intVal(count)); |
1932 | 5599 |
#endif |
5600 |
%} |
|
294 | 5601 |
! |
5602 |
||
5603 |
glxBlendcolorRed: red green: green blue: blue alpha: alpha in: aGLXWindowId |
|
5604 |
||
5605 |
%{ /* NOCONTEXT */ |
|
1932 | 5606 |
SETWIN(aGLXWindowId) |
294 | 5607 |
#ifdef FULL_GLX |
4718 | 5608 |
blendcolor(_floatVal(red), _floatVal(green), _floatVal(blue), _floatVal(alpha)); |
1932 | 5609 |
#endif |
5610 |
%} |
|
294 | 5611 |
! |
5612 |
||
5613 |
glxBlendfunctionSfactr: sfactr dfactr: dfactr in: aGLXWindowId |
|
5614 |
||
5615 |
%{ /* NOCONTEXT */ |
|
1932 | 5616 |
SETWIN(aGLXWindowId) |
5617 |
#ifdef GLX |
|
294 | 5618 |
blendfunction(__intVal(sfactr), __intVal(dfactr)); |
1932 | 5619 |
#endif |
5620 |
%} |
|
294 | 5621 |
! |
5622 |
||
5623 |
glxBlinkRate: rate i: i red: red green: green blue: blue in: aGLXWindowId |
|
5624 |
||
5625 |
%{ /* NOCONTEXT */ |
|
1932 | 5626 |
SETWIN(aGLXWindowId) |
5627 |
#ifdef GLX |
|
4718 | 5628 |
blink(_shortVal(rate), _colorindexVal(i), |
294 | 5629 |
_shortVal(red), _shortVal(green), _shortVal(blue)); |
1932 | 5630 |
#endif |
5631 |
%} |
|
294 | 5632 |
! |
5633 |
||
5634 |
glxBlkqreadData: data n: n in: aGLXWindowId |
|
5635 |
||
5636 |
%{ /* NOCONTEXT */ |
|
1932 | 5637 |
int rslt = -1; |
5638 |
||
5639 |
SETWIN(aGLXWindowId) |
|
5640 |
#ifdef GLX |
|
5641 |
rslt = blkqread((short *)_indexedArea(data), __intVal(n)); |
|
5642 |
#endif |
|
5643 |
RETURN (__MKSMALLINT(rslt)); |
|
5644 |
%} |
|
294 | 5645 |
! |
5646 |
||
5647 |
glxC3f: v in: aGLXWindowId |
|
5648 |
||
5649 |
%{ /* NOCONTEXT */ |
|
5650 |
float vec[3], *c_v; |
|
5651 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5652 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
294 | 5653 |
SETWIN(aGLXWindowId) |
1932 | 5654 |
#ifdef GLX |
294 | 5655 |
c3f(c_v); |
1932 | 5656 |
#endif |
5657 |
%} |
|
294 | 5658 |
! |
5659 |
||
5660 |
glxC3i: v in: aGLXWindowId |
|
5661 |
||
5662 |
%{ /* NOCONTEXT */ |
|
5663 |
long vec[3], *c_v; |
|
5664 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5665 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
294 | 5666 |
SETWIN(aGLXWindowId) |
1932 | 5667 |
#ifdef GLX |
294 | 5668 |
c3i(c_v); |
1932 | 5669 |
#endif |
5670 |
%} |
|
294 | 5671 |
! |
5672 |
||
5673 |
glxC3s: v in: aGLXWindowId |
|
5674 |
||
5675 |
%{ /* NOCONTEXT */ |
|
5676 |
short vec[3], *c_v; |
|
5677 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5678 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
294 | 5679 |
SETWIN(aGLXWindowId) |
1932 | 5680 |
#ifdef GLX |
294 | 5681 |
c3s(c_v); |
1932 | 5682 |
#endif |
5683 |
%} |
|
294 | 5684 |
! |
5685 |
||
5686 |
glxC4f: v in: aGLXWindowId |
|
5687 |
||
5688 |
%{ /* NOCONTEXT */ |
|
5689 |
float vec[4], *c_v; |
|
5690 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5691 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
294 | 5692 |
SETWIN(aGLXWindowId) |
1932 | 5693 |
#ifdef GLX |
294 | 5694 |
c4f(c_v); |
1932 | 5695 |
#endif |
5696 |
%} |
|
294 | 5697 |
! |
5698 |
||
5699 |
glxC4i: v in: aGLXWindowId |
|
5700 |
||
5701 |
%{ /* NOCONTEXT */ |
|
5702 |
long vec[4], *c_v; |
|
5703 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5704 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
294 | 5705 |
SETWIN(aGLXWindowId) |
1932 | 5706 |
#ifdef GLX |
294 | 5707 |
c4i(c_v); |
1932 | 5708 |
#endif |
5709 |
%} |
|
294 | 5710 |
! |
5711 |
||
5712 |
glxC4s: v in: aGLXWindowId |
|
5713 |
||
5714 |
%{ /* NOCONTEXT */ |
|
5715 |
short vec[4], *c_v; |
|
5716 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5717 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
294 | 5718 |
SETWIN(aGLXWindowId) |
1932 | 5719 |
#ifdef GLX |
294 | 5720 |
c4s(c_v); |
1932 | 5721 |
#endif |
5722 |
%} |
|
294 | 5723 |
! |
5724 |
||
5725 |
glxClearhitcodeIn: aGLXWindowId |
|
5726 |
||
5727 |
%{ /* NOCONTEXT */ |
|
1932 | 5728 |
SETWIN(aGLXWindowId) |
5729 |
#ifdef GLX |
|
294 | 5730 |
clearhitcode(); |
1932 | 5731 |
#endif |
5732 |
%} |
|
294 | 5733 |
! |
5734 |
||
5735 |
glxClipplaneIndex: index mode: mode params: params in: aGLXWindowId |
|
5736 |
||
5737 |
%{ /* NOCONTEXT */ |
|
5738 |
float vec[4], *v; |
|
5739 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5740 |
if (! (v = __glx_getFloatsFromInto(params, vec, 4))) RETURN(false); |
294 | 5741 |
SETWIN(aGLXWindowId) |
1932 | 5742 |
#ifdef GLX |
294 | 5743 |
clipplane(__intVal(index), __intVal(mode), v); |
1932 | 5744 |
#endif |
5745 |
%} |
|
294 | 5746 |
! |
5747 |
||
5748 |
glxCmodeIn: aGLXWindowId |
|
5749 |
||
5750 |
%{ /* NOCONTEXT */ |
|
1932 | 5751 |
SETWIN(aGLXWindowId) |
5752 |
#ifdef GLX |
|
294 | 5753 |
cmode(); |
1932 | 5754 |
#endif |
5755 |
%} |
|
294 | 5756 |
! |
5757 |
||
5758 |
glxColorfIndex: index in: aGLXWindowId |
|
5759 |
||
5760 |
^self glxColor: index in: aGLXWindowId |
|
5761 |
! |
|
5762 |
||
5763 |
glxCuroriginN: n xorigin: xorigin yorigin: yorigin in: aGLXWindowId |
|
5764 |
||
5765 |
%{ /* NOCONTEXT */ |
|
1932 | 5766 |
SETWIN(aGLXWindowId) |
5767 |
#ifdef GLX |
|
294 | 5768 |
curorigin(_shortVal(n), _shortVal(xorigin), _shortVal(yorigin)); |
1932 | 5769 |
#endif |
5770 |
%} |
|
294 | 5771 |
! |
5772 |
||
5773 |
glxCursoffIn: aGLXWindowId |
|
5774 |
||
5775 |
%{ /* NOCONTEXT */ |
|
1932 | 5776 |
SETWIN(aGLXWindowId) |
5777 |
#ifdef GLX |
|
294 | 5778 |
cursoff(); |
1932 | 5779 |
#endif |
5780 |
%} |
|
294 | 5781 |
! |
5782 |
||
5783 |
glxCursonIn: aGLXWindowId |
|
5784 |
||
5785 |
%{ /* NOCONTEXT */ |
|
1932 | 5786 |
SETWIN(aGLXWindowId) |
5787 |
#ifdef GLX |
|
294 | 5788 |
curson(); |
1932 | 5789 |
#endif |
5790 |
%} |
|
294 | 5791 |
! |
5792 |
||
5793 |
glxCurstype: type in: aGLXWindowId |
|
5794 |
||
5795 |
%{ /* NOCONTEXT */ |
|
1932 | 5796 |
SETWIN(aGLXWindowId) |
5797 |
#ifdef GLX |
|
294 | 5798 |
curstype(__intVal(type)); |
1932 | 5799 |
#endif |
5800 |
%} |
|
294 | 5801 |
! |
5802 |
||
5803 |
glxCyclemapDuration: duration map: map nxtmap: nxtmap in: aGLXWindowId |
|
5804 |
||
5805 |
%{ /* NOCONTEXT */ |
|
1932 | 5806 |
SETWIN(aGLXWindowId) |
5807 |
#ifdef GLX |
|
294 | 5808 |
cyclemap(_shortVal(duration), _shortVal(map), _shortVal(nxtmap)); |
1932 | 5809 |
#endif |
5810 |
%} |
|
294 | 5811 |
! |
5812 |
||
5813 |
glxDefpatternN: n size: size mask: mask in: aGLXWindowId |
|
5814 |
||
5815 |
%{ /* NOCONTEXT */ |
|
1932 | 5816 |
SETWIN(aGLXWindowId) |
5817 |
#ifdef GLX |
|
294 | 5818 |
defpattern(_shortVal(n), _shortVal(size), (unsigned short *)_indexedArea(mask)); |
1932 | 5819 |
#endif |
5820 |
%} |
|
294 | 5821 |
! |
5822 |
||
5823 |
glxDeltag: t in: aGLXWindowId |
|
5824 |
||
5825 |
%{ /* NOCONTEXT */ |
|
1932 | 5826 |
SETWIN(aGLXWindowId) |
5827 |
#ifdef GLX |
|
294 | 5828 |
deltag(_tagVal(t)); |
1932 | 5829 |
#endif |
5830 |
%} |
|
294 | 5831 |
! |
5832 |
||
5833 |
glxDepthcueMode: mode in: aGLXWindowId |
|
5834 |
||
5835 |
%{ /* NOCONTEXT */ |
|
1932 | 5836 |
SETWIN(aGLXWindowId) |
5837 |
#ifdef GLX |
|
294 | 5838 |
depthcue(_booleanVal(mode)); |
1932 | 5839 |
#endif |
5840 |
%} |
|
294 | 5841 |
! |
5842 |
||
5843 |
glxDitherMode: mode in: aGLXWindowId |
|
5844 |
||
5845 |
%{ /* NOCONTEXT */ |
|
1932 | 5846 |
SETWIN(aGLXWindowId) |
5847 |
#ifdef GLX |
|
294 | 5848 |
dither(_longVal(mode)); |
1932 | 5849 |
#endif |
5850 |
%} |
|
294 | 5851 |
! |
5852 |
||
5853 |
glxDopup: pup in: aGLXWindowId |
|
5854 |
||
5855 |
%{ /* NOCONTEXT */ |
|
1932 | 5856 |
SETWIN(aGLXWindowId) |
5857 |
#ifdef GLX |
|
294 | 5858 |
dopup(_longVal(pup)); |
1932 | 5859 |
#endif |
5860 |
%} |
|
294 | 5861 |
! |
5862 |
||
5863 |
glxDrawmode: mode in: aGLXWindowId |
|
5864 |
||
5865 |
%{ /* NOCONTEXT */ |
|
1932 | 5866 |
SETWIN(aGLXWindowId) |
5867 |
#ifdef GLX |
|
294 | 5868 |
drawmode(_longVal(mode)); |
1932 | 5869 |
#endif |
5870 |
%} |
|
294 | 5871 |
! |
5872 |
||
5873 |
glxEditobj: obj in: aGLXWindowId |
|
5874 |
||
5875 |
%{ /* NOCONTEXT */ |
|
1932 | 5876 |
SETWIN(aGLXWindowId) |
5877 |
#ifdef GLX |
|
294 | 5878 |
editobj(_objectVal(obj)); |
1932 | 5879 |
#endif |
5880 |
%} |
|
294 | 5881 |
! |
5882 |
||
5883 |
glxEndTrimIn: aGLXWindowId |
|
5884 |
||
5885 |
%{ /* NOCONTEXT */ |
|
1932 | 5886 |
SETWIN(aGLXWindowId) |
5887 |
#ifdef GLX |
|
294 | 5888 |
endtrim(); |
1932 | 5889 |
#endif |
5890 |
%} |
|
294 | 5891 |
! |
5892 |
||
5893 |
glxEndfullscrnIn: aGLXWindowId |
|
5894 |
||
5895 |
%{ /* NOCONTEXT */ |
|
1932 | 5896 |
SETWIN(aGLXWindowId) |
5897 |
#ifdef GLX |
|
294 | 5898 |
endfullscrn(); |
1932 | 5899 |
#endif |
5900 |
%} |
|
294 | 5901 |
! |
5902 |
||
5903 |
glxEndpupmodeIn: aGLXWindowId |
|
5904 |
||
5905 |
%{ /* NOCONTEXT */ |
|
1932 | 5906 |
SETWIN(aGLXWindowId) |
5907 |
#ifdef GLX |
|
294 | 5908 |
endpupmode(); |
1932 | 5909 |
#endif |
5910 |
%} |
|
294 | 5911 |
! |
5912 |
||
5913 |
glxFinishIn: aGLXWindowId |
|
5914 |
||
5915 |
%{ /* NOCONTEXT */ |
|
1932 | 5916 |
SETWIN(aGLXWindowId) |
5917 |
#ifdef GLX |
|
294 | 5918 |
finish(); |
1932 | 5919 |
#endif |
5920 |
%} |
|
294 | 5921 |
! |
5922 |
||
5923 |
glxFont: fntnum in: aGLXWindowId |
|
5924 |
||
5925 |
%{ /* NOCONTEXT */ |
|
5926 |
SETWIN(aGLXWindowId) |
|
1932 | 5927 |
#ifdef GLX |
294 | 5928 |
font(_shortVal(fntnum)); |
1932 | 5929 |
#endif |
294 | 5930 |
%} |
5931 |
! |
|
5932 |
||
5933 |
glxForegroundIn: aGLXWindowId |
|
5934 |
||
5935 |
%{ /* NOCONTEXT */ |
|
5936 |
SETWIN(aGLXWindowId) |
|
1932 | 5937 |
#ifdef OPENGL |
5938 |
#else |
|
294 | 5939 |
foreground(); |
1932 | 5940 |
#endif |
294 | 5941 |
%} |
5942 |
! |
|
5943 |
||
5944 |
glxFreepup: pup in: aGLXWindowId |
|
5945 |
||
5946 |
%{ /* NOCONTEXT */ |
|
1932 | 5947 |
SETWIN(aGLXWindowId) |
5948 |
#ifdef GLX |
|
294 | 5949 |
freepup(_longVal(pup)); |
1932 | 5950 |
#endif |
5951 |
%} |
|
294 | 5952 |
! |
5953 |
||
5954 |
glxFudgeXfudge: xfudge yfudge: yfudge in: aGLXWindowId |
|
5955 |
||
5956 |
%{ /* NOCONTEXT */ |
|
1932 | 5957 |
SETWIN(aGLXWindowId) |
5958 |
#ifdef GLX |
|
294 | 5959 |
fudge(_longVal(xfudge), _longVal(yfudge)); |
1932 | 5960 |
#endif |
5961 |
%} |
|
294 | 5962 |
! |
5963 |
||
5964 |
glxFullscrnIn: aGLXWindowId |
|
5965 |
||
5966 |
%{ /* NOCONTEXT */ |
|
1932 | 5967 |
SETWIN(aGLXWindowId) |
5968 |
#ifdef GLX |
|
294 | 5969 |
fullscrn(); |
1932 | 5970 |
#endif |
5971 |
%} |
|
294 | 5972 |
! |
5973 |
||
5974 |
glxGbeginIn: aGLXWindowId |
|
5975 |
||
5976 |
%{ /* NOCONTEXT */ |
|
1932 | 5977 |
SETWIN(aGLXWindowId) |
5978 |
#ifdef GLX |
|
294 | 5979 |
gbegin(); |
1932 | 5980 |
#endif |
5981 |
%} |
|
294 | 5982 |
! |
5983 |
||
5984 |
glxGentagIn: aGLXWindowId |
|
5985 |
||
5986 |
%{ /* NOCONTEXT */ |
|
1932 | 5987 |
int rslt = -1; |
5988 |
||
5989 |
#ifdef GLX |
|
5990 |
SETWIN(aGLXWindowId) |
|
5991 |
rslt = gentag(); |
|
5992 |
#endif |
|
5993 |
RETURN (__MKSMALLINT(rslt)); |
|
5994 |
%} |
|
294 | 5995 |
! |
5996 |
||
5997 |
glxGetbackfaceIn: aGLXWindowId |
|
5998 |
||
5999 |
%{ /* NOCONTEXT */ |
|
1932 | 6000 |
int rslt = -1; |
6001 |
||
6002 |
#ifdef GLX |
|
6003 |
SETWIN(aGLXWindowId) |
|
6004 |
rslt = getbackface(); |
|
6005 |
#endif |
|
6006 |
RETURN (__MKSMALLINT(rslt)); |
|
6007 |
%} |
|
294 | 6008 |
! |
6009 |
||
6010 |
glxGetbufferIn: aGLXWindowId |
|
6011 |
||
6012 |
%{ /* NOCONTEXT */ |
|
1932 | 6013 |
int rslt = -1; |
6014 |
||
6015 |
#ifdef GLX |
|
6016 |
SETWIN(aGLXWindowId) |
|
6017 |
rslt = getbuffer(); |
|
6018 |
#endif |
|
6019 |
RETURN (__MKSMALLINT(rslt)); |
|
6020 |
%} |
|
294 | 6021 |
! |
6022 |
||
6023 |
glxGetbutton: num in: aGLXWindowId |
|
6024 |
||
6025 |
%{ /* NOCONTEXT */ |
|
1932 | 6026 |
int rslt = -1; |
6027 |
||
6028 |
SETWIN(aGLXWindowId) |
|
6029 |
#ifdef OPENGL |
|
6030 |
#else |
|
6031 |
rslt = getbutton(_deviceVal(num)); |
|
6032 |
#endif |
|
6033 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6034 |
%} |
6035 |
! |
|
6036 |
||
6037 |
glxGetcmmodeIn: aGLXWindowId |
|
6038 |
||
6039 |
%{ /* NOCONTEXT */ |
|
1932 | 6040 |
int rslt = 0; |
6041 |
||
6042 |
SETWIN(aGLXWindowId) |
|
6043 |
#ifdef GLX |
|
6044 |
rslt = getcmmode(); |
|
6045 |
#endif |
|
6046 |
RETURN (__MKBOOLEAN(rslt)); |
|
6047 |
%} |
|
294 | 6048 |
! |
6049 |
||
6050 |
glxGetcolorIn: aGLXWindowId |
|
6051 |
"return the current drawing color" |
|
6052 |
||
6053 |
%{ /* NOCONTEXT */ |
|
1932 | 6054 |
int rslt = -1; |
6055 |
||
6056 |
SETWIN(aGLXWindowId) |
|
6057 |
#ifdef OPENGL |
|
6058 |
#else |
|
6059 |
rslt = getcolor(); |
|
6060 |
#endif |
|
6061 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6062 |
%} |
6063 |
! |
|
6064 |
||
6065 |
glxGetdcmIn: aGLXWindowId |
|
6066 |
||
6067 |
%{ /* NOCONTEXT */ |
|
6068 |
#ifdef GLX |
|
6069 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6070 |
RETURN (__MKBOOLEAN(getdcm())); |
294 | 6071 |
#endif |
6072 |
%} |
|
6073 |
. |
|
6074 |
^ false |
|
6075 |
! |
|
6076 |
||
6077 |
glxGetdescenderIn: aGLXWindowId |
|
6078 |
||
6079 |
%{ /* NOCONTEXT */ |
|
6080 |
#ifdef GLX |
|
6081 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6082 |
RETURN (__MKSMALLINT(getdescender())); |
294 | 6083 |
#endif |
6084 |
%} |
|
6085 |
. |
|
6086 |
^ false |
|
6087 |
! |
|
6088 |
||
6089 |
glxGetdisplaymodeIn: aGLXWindowId |
|
6090 |
||
6091 |
%{ /* NOCONTEXT */ |
|
6092 |
#ifdef GLX |
|
6093 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6094 |
RETURN (__MKSMALLINT(getdisplaymode())); |
294 | 6095 |
#endif |
6096 |
%} |
|
6097 |
. |
|
6098 |
^ false |
|
6099 |
! |
|
6100 |
||
6101 |
glxGetdrawmodeIn: aGLXWindowId |
|
6102 |
||
6103 |
%{ /* NOCONTEXT */ |
|
6104 |
#ifdef GLX |
|
6105 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6106 |
RETURN (__MKSMALLINT(getdrawmode())); |
294 | 6107 |
#endif |
6108 |
%} |
|
6109 |
. |
|
6110 |
^ false |
|
6111 |
! |
|
6112 |
||
6113 |
glxGetfontIn: aGLXWindowId |
|
6114 |
||
6115 |
%{ /* NOCONTEXT */ |
|
6116 |
#ifdef GLX |
|
6117 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6118 |
RETURN (__MKSMALLINT(getfont())); |
294 | 6119 |
#endif |
6120 |
%} |
|
6121 |
. |
|
6122 |
^ false |
|
6123 |
! |
|
6124 |
||
6125 |
glxGetgconfigBuffer: buffer in: aGLXWindowId |
|
6126 |
||
6127 |
%{ /* NOCONTEXT */ |
|
6128 |
#ifdef FULL_GLX |
|
6129 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6130 |
RETURN (__MKSMALLINT(getgconfig(_longVal(buffer)))); |
294 | 6131 |
#endif |
6132 |
%} |
|
6133 |
. |
|
6134 |
^ false |
|
6135 |
! |
|
6136 |
||
6137 |
glxGetgdescInquiry: inquiry in: aGLXWindowId |
|
6138 |
||
6139 |
%{ /* NOCONTEXT */ |
|
1932 | 6140 |
int rslt = 0; |
6141 |
||
6142 |
SETWIN(aGLXWindowId) |
|
6143 |
#ifdef OPENGL |
|
6144 |
#else |
|
6145 |
rslt = getgdesc(_longVal(inquiry)); |
|
6146 |
#endif |
|
6147 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6148 |
%} |
6149 |
! |
|
6150 |
||
6151 |
glxGetheightIn: aGLXWindowId |
|
6152 |
||
6153 |
%{ /* NOCONTEXT */ |
|
1932 | 6154 |
int rslt = 0; |
6155 |
||
6156 |
SETWIN(aGLXWindowId) |
|
6157 |
#ifdef OPENGL |
|
6158 |
#else |
|
6159 |
rslt = getheight(); |
|
6160 |
#endif |
|
6161 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6162 |
%} |
6163 |
! |
|
6164 |
||
6165 |
glxGethitcodeIn: aGLXWindowId |
|
6166 |
||
6167 |
%{ /* NOCONTEXT */ |
|
6168 |
#ifdef GLX |
|
6169 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6170 |
RETURN (__MKSMALLINT(gethitcode())); |
294 | 6171 |
#endif |
6172 |
%} |
|
6173 |
. |
|
6174 |
^ false |
|
6175 |
! |
|
6176 |
||
6177 |
glxGetlsbackupIn: aGLXWindowId |
|
6178 |
||
6179 |
%{ /* NOCONTEXT */ |
|
6180 |
#ifdef GLX |
|
6181 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6182 |
RETURN (__MKBOOLEAN(getlsbackup())); |
294 | 6183 |
#endif |
6184 |
%} |
|
6185 |
. |
|
6186 |
^ false |
|
6187 |
! |
|
6188 |
||
6189 |
glxGetlsrepeatIn: aGLXWindowId |
|
6190 |
||
6191 |
%{ /* NOCONTEXT */ |
|
6192 |
#ifdef GLX |
|
6193 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6194 |
RETURN (__MKSMALLINT(getlsrepeat())); |
294 | 6195 |
#endif |
6196 |
%} |
|
6197 |
. |
|
6198 |
^ false |
|
6199 |
! |
|
6200 |
||
6201 |
glxGetlstyleIn: aGLXWindowId |
|
6202 |
||
6203 |
%{ /* NOCONTEXT */ |
|
6204 |
#ifdef GLX |
|
6205 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6206 |
RETURN (__MKSMALLINT(getlstyle())); |
294 | 6207 |
#endif |
6208 |
%} |
|
6209 |
. |
|
6210 |
^ false |
|
6211 |
! |
|
6212 |
||
6213 |
glxGetlwidthIn: aGLXWindowId |
|
6214 |
||
6215 |
%{ /* NOCONTEXT */ |
|
6216 |
#ifdef GLX |
|
6217 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6218 |
RETURN (__MKSMALLINT(getlwidth())); |
294 | 6219 |
#endif |
6220 |
%} |
|
6221 |
. |
|
6222 |
^ false |
|
6223 |
! |
|
6224 |
||
6225 |
glxGetmapIn: aGLXWindowId |
|
6226 |
||
6227 |
%{ /* NOCONTEXT */ |
|
6228 |
#ifdef GLX |
|
6229 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6230 |
RETURN (__MKSMALLINT(getmap())); |
294 | 6231 |
#endif |
6232 |
%} |
|
6233 |
. |
|
6234 |
^ false |
|
6235 |
! |
|
6236 |
||
6237 |
glxGetmmodeIn: aGLXWindowId |
|
6238 |
||
6239 |
%{ /* NOCONTEXT */ |
|
6240 |
#ifdef GLX |
|
6241 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6242 |
RETURN (__MKSMALLINT(getmmode())); |
294 | 6243 |
#endif |
6244 |
%} |
|
6245 |
. |
|
6246 |
^ false |
|
6247 |
! |
|
6248 |
||
6249 |
glxGetmonitorIn: aGLXWindowId |
|
6250 |
||
6251 |
%{ /* NOCONTEXT */ |
|
6252 |
#ifdef GLX |
|
6253 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6254 |
RETURN (__MKSMALLINT(getmonitor())); |
294 | 6255 |
#endif |
6256 |
%} |
|
6257 |
. |
|
6258 |
^ false |
|
6259 |
! |
|
6260 |
||
6261 |
glxGetmultisampleIn: aGLXWindowId |
|
6262 |
||
6263 |
%{ /* NOCONTEXT */ |
|
6264 |
#ifdef FULL_GLX |
|
6265 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6266 |
RETURN (__MKBOOLEAN(getmultisample())); |
294 | 6267 |
#endif |
6268 |
%} |
|
6269 |
. |
|
6270 |
^ false |
|
6271 |
! |
|
6272 |
||
6273 |
glxGetothermonitorIn: aGLXWindowId |
|
6274 |
||
6275 |
%{ /* NOCONTEXT */ |
|
6276 |
#ifdef GLX |
|
6277 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6278 |
RETURN (__MKSMALLINT(getothermonitor())); |
294 | 6279 |
#endif |
6280 |
%} |
|
6281 |
. |
|
6282 |
^ false |
|
6283 |
! |
|
6284 |
||
6285 |
glxGetpatternIn: aGLXWindowId |
|
6286 |
||
6287 |
%{ /* NOCONTEXT */ |
|
6288 |
#ifdef GLX |
|
6289 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6290 |
RETURN (__MKSMALLINT(getpattern())); |
294 | 6291 |
#endif |
6292 |
%} |
|
6293 |
. |
|
6294 |
^ false |
|
6295 |
! |
|
6296 |
||
6297 |
glxGetresetlsIn: aGLXWindowId |
|
6298 |
||
6299 |
%{ /* NOCONTEXT */ |
|
6300 |
#ifdef GLX |
|
6301 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6302 |
RETURN (__MKBOOLEAN(getresetls())); |
294 | 6303 |
#endif |
6304 |
%} |
|
6305 |
. |
|
6306 |
^ false |
|
6307 |
! |
|
6308 |
||
6309 |
glxGetshadeIn: aGLXWindowId |
|
6310 |
||
6311 |
%{ /* NOCONTEXT */ |
|
6312 |
#ifdef GLX |
|
6313 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6314 |
RETURN (__MKSMALLINT(getshade())); |
294 | 6315 |
#endif |
6316 |
%} |
|
6317 |
. |
|
6318 |
^ false |
|
6319 |
! |
|
6320 |
||
6321 |
glxGetsmIn: aGLXWindowId |
|
6322 |
||
6323 |
%{ /* NOCONTEXT */ |
|
6324 |
#ifdef GLX |
|
6325 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6326 |
RETURN (__MKSMALLINT(getsm())); |
294 | 6327 |
#endif |
6328 |
%} |
|
6329 |
. |
|
6330 |
^ false |
|
6331 |
! |
|
6332 |
||
6333 |
glxGetvaluator: dev in: aGLXWindowId |
|
6334 |
||
6335 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
6336 |
#ifndef OPENGL |
294 | 6337 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6338 |
RETURN (__MKSMALLINT(getvaluator(_deviceVal(dev)))); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
6339 |
#endif |
294 | 6340 |
%} |
6341 |
. |
|
6342 |
^ false |
|
6343 |
! |
|
6344 |
||
6345 |
glxGetvideo: reg in: aGLXWindowId |
|
6346 |
||
6347 |
%{ /* NOCONTEXT */ |
|
6348 |
#ifdef GLX |
|
6349 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6350 |
RETURN (__MKSMALLINT(getvideo(_longVal(reg)))); |
294 | 6351 |
#endif |
6352 |
%} |
|
6353 |
. |
|
6354 |
^ false |
|
6355 |
! |
|
6356 |
||
6357 |
glxGetwritemaskIn: aGLXWindowId |
|
6358 |
||
6359 |
%{ /* NOCONTEXT */ |
|
6360 |
#ifdef GLX |
|
6361 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6362 |
RETURN (__MKSMALLINT(getwritemask())); |
294 | 6363 |
#endif |
6364 |
%} |
|
6365 |
. |
|
6366 |
^ false |
|
6367 |
! |
|
6368 |
||
6369 |
glxGetwscrnIn: aGLXWindowId |
|
6370 |
||
6371 |
%{ /* NOCONTEXT */ |
|
6372 |
#ifdef GLX |
|
6373 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6374 |
RETURN (__MKSMALLINT(getwscrn())); |
294 | 6375 |
#endif |
6376 |
%} |
|
6377 |
. |
|
6378 |
^ false |
|
6379 |
! |
|
6380 |
||
6381 |
glxGetzbufferIn: aGLXWindowId |
|
6382 |
||
6383 |
%{ /* NOCONTEXT */ |
|
6384 |
#ifdef GLX |
|
6385 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6386 |
RETURN (__MKBOOLEAN(getzbuffer())); |
294 | 6387 |
#endif |
6388 |
%} |
|
6389 |
. |
|
6390 |
^ false |
|
6391 |
! |
|
6392 |
||
6393 |
glxGexitIn: aGLXWindowId |
|
6394 |
||
6395 |
%{ /* NOCONTEXT */ |
|
1932 | 6396 |
SETWIN(aGLXWindowId) |
6397 |
#ifdef OPENGL |
|
6398 |
#else |
|
294 | 6399 |
gexit(); |
1932 | 6400 |
#endif |
6401 |
%} |
|
294 | 6402 |
! |
6403 |
||
6404 |
glxGflushIn: aGLXWindowId |
|
6405 |
||
6406 |
%{ /* NOCONTEXT */ |
|
6407 |
#ifdef GLX |
|
6408 |
SETWIN(aGLXWindowId) |
|
6409 |
gflush(); |
|
1932 | 6410 |
#endif |
6411 |
%} |
|
294 | 6412 |
! |
6413 |
||
6414 |
glxGinitIn: aGLXWindowId |
|
6415 |
||
6416 |
%{ /* NOCONTEXT */ |
|
1932 | 6417 |
SETWIN(aGLXWindowId) |
6418 |
#ifdef OPENGL |
|
6419 |
#else |
|
294 | 6420 |
ginit(); |
1932 | 6421 |
#endif |
6422 |
%} |
|
294 | 6423 |
! |
6424 |
||
6425 |
glxGlcompatMode: mode value: value in: aGLXWindowId |
|
6426 |
||
6427 |
%{ /* NOCONTEXT */ |
|
6428 |
#ifdef GLX |
|
6429 |
SETWIN(aGLXWindowId) |
|
6430 |
glcompat(_longVal(mode), _longVal(value)); |
|
1932 | 6431 |
#endif |
6432 |
%} |
|
294 | 6433 |
! |
6434 |
||
6435 |
glxGresetIn: aGLXWindowId |
|
6436 |
||
6437 |
%{ /* NOCONTEXT */ |
|
6438 |
#ifdef GLX |
|
6439 |
SETWIN(aGLXWindowId) |
|
6440 |
greset(); |
|
1932 | 6441 |
#endif |
6442 |
%} |
|
294 | 6443 |
! |
6444 |
||
6445 |
glxGsyncIn: aGLXWindowId |
|
6446 |
||
6447 |
%{ /* NOCONTEXT */ |
|
6448 |
#ifdef GLX |
|
6449 |
SETWIN(aGLXWindowId) |
|
6450 |
gsync(); |
|
1932 | 6451 |
#endif |
6452 |
%} |
|
294 | 6453 |
! |
6454 |
||
6455 |
glxIconsizeX: x y: y in: aGLXWindowId |
|
6456 |
||
6457 |
%{ /* NOCONTEXT */ |
|
6458 |
#ifdef GLX |
|
6459 |
SETWIN(aGLXWindowId) |
|
6460 |
iconsize(_longVal(x), _longVal(y)); |
|
1932 | 6461 |
#endif |
6462 |
%} |
|
294 | 6463 |
! |
6464 |
||
6465 |
glxImakebackgroundIn: aGLXWindowId |
|
6466 |
||
6467 |
%{ /* NOCONTEXT */ |
|
6468 |
#ifdef GLX |
|
6469 |
SETWIN(aGLXWindowId) |
|
6470 |
imakebackground(); |
|
1932 | 6471 |
#endif |
6472 |
%} |
|
294 | 6473 |
! |
6474 |
||
6475 |
glxInitnamesIn: aGLXWindowId |
|
6476 |
||
6477 |
%{ /* NOCONTEXT */ |
|
6478 |
#ifdef GLX |
|
6479 |
SETWIN(aGLXWindowId) |
|
6480 |
initnames(); |
|
1932 | 6481 |
#endif |
6482 |
%} |
|
294 | 6483 |
! |
6484 |
||
6485 |
glxIsqueued: dev in: aGLXWindowId |
|
6486 |
||
6487 |
%{ /* NOCONTEXT */ |
|
6488 |
#ifdef GLX |
|
6489 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6490 |
RETURN (__MKBOOLEAN(isqueued(_deviceVal(dev)))); |
294 | 6491 |
#endif |
6492 |
%} |
|
6493 |
. |
|
6494 |
^ false |
|
6495 |
! |
|
6496 |
||
6497 |
glxIstag: t in: aGLXWindowId |
|
6498 |
||
6499 |
%{ /* NOCONTEXT */ |
|
6500 |
#ifdef GLX |
|
6501 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6502 |
RETURN (__MKBOOLEAN(istag(_tagVal(t)))); |
294 | 6503 |
#endif |
6504 |
%} |
|
6505 |
. |
|
6506 |
^ false |
|
6507 |
! |
|
6508 |
||
6509 |
glxKeepaspectX: x y: y in: aGLXWindowId |
|
6510 |
||
6511 |
%{ /* NOCONTEXT */ |
|
6512 |
#ifdef GLX |
|
6513 |
SETWIN(aGLXWindowId) |
|
6514 |
keepaspect(_longVal(x), _longVal(y)); |
|
6515 |
RETURN (true); |
|
6516 |
#endif |
|
6517 |
%} |
|
6518 |
. |
|
6519 |
^ false |
|
6520 |
! |
|
6521 |
||
6522 |
glxLinesmoothMode: mode in: aGLXWindowId |
|
6523 |
||
6524 |
%{ /* NOCONTEXT */ |
|
6525 |
#ifdef GLX |
|
6526 |
SETWIN(aGLXWindowId) |
|
6527 |
linesmooth((ulong)__intVal(mode)); |
|
6528 |
RETURN (true); |
|
6529 |
#endif |
|
6530 |
%} |
|
6531 |
. |
|
6532 |
^ false |
|
6533 |
! |
|
6534 |
||
6535 |
glxLmcolorMode: mode in: aGLXWindowId |
|
6536 |
||
6537 |
%{ /* NOCONTEXT */ |
|
6538 |
#ifdef GLX |
|
6539 |
SETWIN(aGLXWindowId) |
|
6540 |
lmcolor(_longVal(mode)); |
|
6541 |
RETURN (true); |
|
6542 |
#endif |
|
6543 |
%} |
|
6544 |
. |
|
6545 |
^ false |
|
6546 |
! |
|
6547 |
||
6548 |
glxLoadname: name in: aGLXWindowId |
|
6549 |
||
6550 |
%{ /* NOCONTEXT */ |
|
6551 |
#ifdef GLX |
|
6552 |
SETWIN(aGLXWindowId) |
|
6553 |
loadname(_shortVal(name)); |
|
6554 |
RETURN (true); |
|
6555 |
#endif |
|
6556 |
%} |
|
6557 |
. |
|
6558 |
^ false |
|
6559 |
! |
|
6560 |
||
6561 |
glxLogicop: opcode in: aGLXWindowId |
|
6562 |
||
6563 |
%{ /* NOCONTEXT */ |
|
6564 |
#ifdef GLX |
|
6565 |
SETWIN(aGLXWindowId) |
|
6566 |
logicop(_longVal(opcode)); |
|
6567 |
RETURN (true); |
|
6568 |
#endif |
|
6569 |
%} |
|
6570 |
. |
|
6571 |
^ false |
|
6572 |
! |
|
6573 |
||
6574 |
glxLsbackup: b in: aGLXWindowId |
|
6575 |
||
6576 |
%{ /* NOCONTEXT */ |
|
6577 |
#ifdef GLX |
|
6578 |
SETWIN(aGLXWindowId) |
|
6579 |
lsbackup(_booleanVal(b)); |
|
6580 |
RETURN (true); |
|
6581 |
#endif |
|
6582 |
%} |
|
6583 |
. |
|
6584 |
^ false |
|
6585 |
! |
|
6586 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6587 |
glxLsetdepthNear:znear far:zfar in: aGLXWindowId |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6588 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6589 |
%{ /* NOCONTEXT */ |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6590 |
#ifdef GLX |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6591 |
SETWIN(aGLXWindowId) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6592 |
lsetdepth(_longVal(znear), _longVal(zfar)); |
294 | 6593 |
RETURN (true); |
6594 |
#endif |
|
6595 |
%} |
|
6596 |
. |
|
6597 |
^ false |
|
6598 |
! |
|
6599 |
||
6600 |
glxLshaderangeLowin: lowin hiwin: hiwin znear: znear zfar: zfar in: aGLXWindowId |
|
6601 |
||
6602 |
%{ /* NOCONTEXT */ |
|
6603 |
#ifdef GLX |
|
6604 |
SETWIN(aGLXWindowId) |
|
4718 | 6605 |
lshaderange(_colorindexVal(lowin), _colorindexVal(hiwin), |
294 | 6606 |
_longVal(znear), _longVal(zfar)); |
6607 |
RETURN (true); |
|
6608 |
#endif |
|
6609 |
%} |
|
6610 |
. |
|
6611 |
^ false |
|
6612 |
! |
|
6613 |
||
6614 |
glxLsrepeatFactor: factor in: aGLXWindowId |
|
6615 |
||
6616 |
%{ /* NOCONTEXT */ |
|
6617 |
#ifdef GLX |
|
6618 |
SETWIN(aGLXWindowId) |
|
6619 |
lsrepeat(_longVal(factor)); |
|
6620 |
RETURN (true); |
|
6621 |
#endif |
|
6622 |
%} |
|
6623 |
. |
|
6624 |
^ false |
|
6625 |
! |
|
6626 |
||
6627 |
glxMaketag: t in: aGLXWindowId |
|
6628 |
||
6629 |
%{ /* NOCONTEXT */ |
|
6630 |
#ifdef GLX |
|
6631 |
SETWIN(aGLXWindowId) |
|
6632 |
maketag(_tagVal(t)); |
|
6633 |
RETURN (true); |
|
6634 |
#endif |
|
6635 |
%} |
|
6636 |
. |
|
6637 |
^ false |
|
6638 |
! |
|
6639 |
||
6640 |
glxMaxsizeX: x y: y in: aGLXWindowId |
|
6641 |
||
6642 |
%{ /* NOCONTEXT */ |
|
6643 |
#ifdef GLX |
|
6644 |
SETWIN(aGLXWindowId) |
|
6645 |
maxsize(_longVal(x), _longVal(y)); |
|
6646 |
RETURN (true); |
|
6647 |
#endif |
|
6648 |
%} |
|
6649 |
. |
|
6650 |
^ false |
|
6651 |
! |
|
6652 |
||
6653 |
glxMinsizeX: x y: y in: aGLXWindowId |
|
6654 |
||
6655 |
%{ /* NOCONTEXT */ |
|
6656 |
#ifdef GLX |
|
6657 |
SETWIN(aGLXWindowId) |
|
6658 |
minsize(_longVal(x), _longVal(y)); |
|
6659 |
RETURN (true); |
|
6660 |
#endif |
|
6661 |
%} |
|
6662 |
. |
|
6663 |
^ false |
|
6664 |
! |
|
6665 |
||
6666 |
glxMsalphaMode: mode in: aGLXWindowId |
|
6667 |
||
6668 |
%{ /* NOCONTEXT */ |
|
6669 |
#ifdef FULL_GLX |
|
6670 |
SETWIN(aGLXWindowId) |
|
6671 |
msalpha(_longVal(mode)); |
|
6672 |
RETURN (true); |
|
6673 |
#endif |
|
6674 |
%} |
|
6675 |
. |
|
6676 |
^ false |
|
6677 |
! |
|
6678 |
||
6679 |
glxMsmask: mask inverse: inverse in: aGLXWindowId |
|
6680 |
||
6681 |
%{ /* NOCONTEXT */ |
|
6682 |
#ifdef FULL_GLX |
|
6683 |
SETWIN(aGLXWindowId) |
|
6684 |
msmask(_floatVal(mask), _booleanVal(inverse)); |
|
6685 |
RETURN (true); |
|
6686 |
#endif |
|
6687 |
%} |
|
6688 |
. |
|
6689 |
^ false |
|
6690 |
! |
|
6691 |
||
6692 |
glxMspattern: pattern in: aGLXWindowId |
|
6693 |
||
6694 |
%{ /* NOCONTEXT */ |
|
6695 |
#ifdef FULL_GLX |
|
6696 |
SETWIN(aGLXWindowId) |
|
6697 |
mspattern(_longVal(pattern)); |
|
6698 |
RETURN (true); |
|
6699 |
#endif |
|
6700 |
%} |
|
6701 |
. |
|
6702 |
^ false |
|
6703 |
! |
|
6704 |
||
6705 |
glxMssizeSamples: samples zsize: zsize ssize: ssize in: aGLXWindowId |
|
6706 |
||
6707 |
%{ /* NOCONTEXT */ |
|
6708 |
#ifdef FULL_GLX |
|
6709 |
SETWIN(aGLXWindowId) |
|
6710 |
mssize(_longVal(samples), _longVal(zsize), _longVal(ssize)); |
|
6711 |
RETURN (true); |
|
6712 |
#endif |
|
6713 |
%} |
|
6714 |
. |
|
6715 |
^ false |
|
6716 |
! |
|
6717 |
||
6718 |
glxMswapbuffers: fbuf in: aGLXWindowId |
|
6719 |
||
6720 |
%{ /* NOCONTEXT */ |
|
6721 |
#ifdef GLX |
|
6722 |
SETWIN(aGLXWindowId) |
|
6723 |
mswapbuffers(_longVal(fbuf)); |
|
6724 |
RETURN (true); |
|
6725 |
#endif |
|
6726 |
%} |
|
6727 |
. |
|
6728 |
^ false |
|
6729 |
! |
|
6730 |
||
6731 |
glxMultimapIn: aGLXWindowId |
|
6732 |
||
6733 |
%{ /* NOCONTEXT */ |
|
6734 |
#ifdef GLX |
|
6735 |
SETWIN(aGLXWindowId) |
|
6736 |
multimap(); |
|
6737 |
RETURN (true); |
|
6738 |
#endif |
|
6739 |
%} |
|
6740 |
. |
|
6741 |
^ false |
|
6742 |
! |
|
6743 |
||
6744 |
glxMultisample: bool in: aGLXWindowId |
|
6745 |
||
6746 |
%{ /* NOCONTEXT */ |
|
6747 |
#ifdef FULL_GLX |
|
6748 |
SETWIN(aGLXWindowId) |
|
6749 |
multisample(_booleanVal(bool)); |
|
6750 |
RETURN (true); |
|
6751 |
#endif |
|
6752 |
%} |
|
6753 |
. |
|
6754 |
^ false |
|
6755 |
! |
|
6756 |
||
6757 |
glxNewpupIn: aGLXWindowId |
|
6758 |
||
6759 |
%{ /* NOCONTEXT */ |
|
6760 |
#ifdef GLX |
|
6761 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6762 |
RETURN (__MKSMALLINT(newpup())); |
294 | 6763 |
#endif |
6764 |
%} |
|
6765 |
. |
|
6766 |
^ false |
|
6767 |
! |
|
6768 |
||
6769 |
glxNewtag: newtg oldtg: oldtg offst: offst in: aGLXWindowId |
|
6770 |
||
6771 |
%{ /* NOCONTEXT */ |
|
6772 |
#ifdef GLX |
|
6773 |
SETWIN(aGLXWindowId) |
|
6774 |
newtag(_tagVal(newtg), _tagVal(oldtg), _offsetVal(offst)); |
|
6775 |
RETURN (true); |
|
6776 |
#endif |
|
6777 |
%} |
|
6778 |
. |
|
6779 |
^ false |
|
6780 |
! |
|
6781 |
||
6782 |
glxNoborderIn: aGLXWindowId |
|
6783 |
||
6784 |
%{ /* NOCONTEXT */ |
|
6785 |
#ifdef GLX |
|
6786 |
SETWIN(aGLXWindowId) |
|
6787 |
noborder(); |
|
6788 |
RETURN (true); |
|
6789 |
#endif |
|
6790 |
%} |
|
6791 |
. |
|
6792 |
^ false |
|
6793 |
! |
|
6794 |
||
6795 |
glxNoise: v delta: delta in: aGLXWindowId |
|
6796 |
||
6797 |
%{ /* NOCONTEXT */ |
|
6798 |
#ifdef GLX |
|
6799 |
SETWIN(aGLXWindowId) |
|
6800 |
noise(_deviceVal(v), _shortVal(delta)); |
|
6801 |
RETURN (true); |
|
6802 |
#endif |
|
6803 |
%} |
|
6804 |
. |
|
6805 |
^ false |
|
6806 |
! |
|
6807 |
||
6808 |
glxNoportIn: aGLXWindowId |
|
6809 |
||
6810 |
%{ /* NOCONTEXT */ |
|
6811 |
#ifdef GLX |
|
6812 |
SETWIN(aGLXWindowId) |
|
6813 |
noport(); |
|
6814 |
RETURN (true); |
|
6815 |
#endif |
|
6816 |
%} |
|
6817 |
. |
|
6818 |
^ false |
|
6819 |
! |
|
6820 |
||
6821 |
glxNurbscurveKnotCount: knotCount knotList: knotList |
|
4718 | 6822 |
offset: offset ctlArray: ctlArray |
294 | 6823 |
order: order type: type in: aGLXWindowId |
6824 |
||
6825 |
| ctlPoints i | |
|
6826 |
ctlPoints := DoubleArray new: ctlArray size * (ctlArray first size). |
|
6827 |
i := 1. |
|
6828 |
ctlArray do: [:point | |
|
4718 | 6829 |
point do: [:coord | |
294 | 6830 |
ctlPoints at: i put: coord. |
6831 |
i := i + 1]]. |
|
6832 |
||
6833 |
%{ /* NOCONTEXT */ |
|
6834 |
#ifdef GLX |
|
6835 |
char *knotElements, *ctlElements; |
|
6836 |
OBJ cls; |
|
6837 |
int ninstVars, nInstBytes; |
|
6838 |
||
6839 |
SETWIN(aGLXWindowId) |
|
6840 |
cls = __qClass(ctlPoints); |
|
6841 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
6842 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
|
6843 |
||
6844 |
ctlElements = (char *)(_InstPtr(ctlPoints)) + nInstBytes; |
|
6845 |
knotElements = (char *)(_InstPtr(knotList)) + nInstBytes; |
|
6846 |
||
6847 |
nurbscurve ( |
|
6848 |
_longVal(knotCount), (double *)knotElements, |
|
4718 | 6849 |
_longVal(offset), (double *)ctlElements, |
294 | 6850 |
_longVal(order), _longVal(type)); |
6851 |
RETURN(true); |
|
6852 |
#endif |
|
6853 |
%} |
|
6854 |
. |
|
6855 |
^ false |
|
6856 |
! |
|
6857 |
||
6858 |
glxObjdeleteTag1: tag1 tag2: tag2 in: aGLXWindowId |
|
6859 |
||
6860 |
%{ /* NOCONTEXT */ |
|
6861 |
#ifdef GLX |
|
6862 |
SETWIN(aGLXWindowId) |
|
6863 |
objdelete(_tagVal(tag1), _tagVal(tag2)); |
|
6864 |
RETURN (true); |
|
6865 |
#endif |
|
6866 |
%} |
|
6867 |
. |
|
6868 |
^ false |
|
6869 |
! |
|
6870 |
||
6871 |
glxObjinsert: t in: aGLXWindowId |
|
6872 |
||
6873 |
%{ /* NOCONTEXT */ |
|
6874 |
#ifdef GLX |
|
6875 |
SETWIN(aGLXWindowId) |
|
6876 |
objinsert(_tagVal(t)); |
|
6877 |
RETURN (true); |
|
6878 |
#endif |
|
6879 |
%} |
|
6880 |
. |
|
6881 |
^ false |
|
6882 |
! |
|
6883 |
||
6884 |
glxObjreplace: t in: aGLXWindowId |
|
6885 |
||
6886 |
%{ /* NOCONTEXT */ |
|
6887 |
#ifdef GLX |
|
6888 |
SETWIN(aGLXWindowId) |
|
6889 |
objreplace(_tagVal(t)); |
|
6890 |
RETURN (true); |
|
6891 |
#endif |
|
6892 |
%} |
|
6893 |
. |
|
6894 |
^ false |
|
6895 |
! |
|
6896 |
||
6897 |
glxOnemapIn: aGLXWindowId |
|
6898 |
||
6899 |
%{ /* NOCONTEXT */ |
|
6900 |
#ifdef GLX |
|
6901 |
SETWIN(aGLXWindowId) |
|
6902 |
onemap(); |
|
6903 |
RETURN (true); |
|
6904 |
#endif |
|
6905 |
%} |
|
6906 |
. |
|
6907 |
^ false |
|
6908 |
! |
|
6909 |
||
6910 |
glxPagecolor: pcolor in: aGLXWindowId |
|
6911 |
||
6912 |
%{ /* NOCONTEXT */ |
|
6913 |
#ifdef GLX |
|
6914 |
SETWIN(aGLXWindowId) |
|
6915 |
pagecolor(_colorindexVal(pcolor)); |
|
6916 |
RETURN (true); |
|
6917 |
#endif |
|
6918 |
%} |
|
6919 |
. |
|
6920 |
^ false |
|
6921 |
! |
|
6922 |
||
6923 |
glxPassthroughToken: token in: aGLXWindowId |
|
6924 |
||
6925 |
%{ /* NOCONTEXT */ |
|
6926 |
#ifdef GLX |
|
6927 |
SETWIN(aGLXWindowId) |
|
6928 |
passthrough(_shortVal(token)); |
|
6929 |
RETURN (true); |
|
6930 |
#endif |
|
6931 |
%} |
|
6932 |
. |
|
6933 |
^ false |
|
6934 |
! |
|
6935 |
||
6936 |
glxPclosIn: aGLXWindowId |
|
6937 |
||
6938 |
%{ /* NOCONTEXT */ |
|
6939 |
#ifdef GLX |
|
6940 |
SETWIN(aGLXWindowId) |
|
6941 |
pclos(); |
|
6942 |
RETURN (true); |
|
6943 |
#endif |
|
6944 |
%} |
|
6945 |
. |
|
6946 |
^ false |
|
6947 |
! |
|
6948 |
||
6949 |
glxPicksizeX: x y: y in: aGLXWindowId |
|
6950 |
||
6951 |
%{ /* NOCONTEXT */ |
|
6952 |
#ifdef GLX |
|
6953 |
SETWIN(aGLXWindowId) |
|
6954 |
picksize(_shortVal(x), _shortVal(y)); |
|
6955 |
RETURN (true); |
|
6956 |
#endif |
|
6957 |
%} |
|
6958 |
. |
|
6959 |
^ false |
|
6960 |
! |
|
6961 |
||
6962 |
glxPixmode: mode value: value in: aGLXWindowId |
|
6963 |
||
6964 |
%{ /* NOCONTEXT */ |
|
6965 |
#ifdef GLX |
|
6966 |
SETWIN(aGLXWindowId) |
|
6967 |
pixmode(_longVal(mode), _longVal(value)); |
|
6968 |
RETURN (true); |
|
6969 |
#endif |
|
6970 |
%} |
|
6971 |
. |
|
6972 |
^ false |
|
6973 |
! |
|
6974 |
||
6975 |
glxPntsmoothMode: mode in: aGLXWindowId |
|
6976 |
||
6977 |
%{ /* NOCONTEXT */ |
|
6978 |
#ifdef GLX |
|
6979 |
SETWIN(aGLXWindowId) |
|
6980 |
pntsmooth((ulong)__intVal(mode)); |
|
6981 |
RETURN (true); |
|
6982 |
#endif |
|
6983 |
%} |
|
6984 |
. |
|
6985 |
^ false |
|
6986 |
! |
|
6987 |
||
6988 |
glxPolysmoothMode: mode in: aGLXWindowId |
|
6989 |
||
6990 |
%{ /* NOCONTEXT */ |
|
6991 |
#ifdef GLX |
|
6992 |
SETWIN(aGLXWindowId) |
|
6993 |
polysmooth(_longVal(mode)); |
|
6994 |
RETURN (true); |
|
6995 |
#endif |
|
6996 |
%} |
|
6997 |
. |
|
6998 |
^ false |
|
6999 |
! |
|
7000 |
||
7001 |
glxPopnameIn: aGLXWindowId |
|
7002 |
||
7003 |
%{ /* NOCONTEXT */ |
|
7004 |
#ifdef GLX |
|
7005 |
SETWIN(aGLXWindowId) |
|
7006 |
popname(); |
|
7007 |
RETURN (true); |
|
7008 |
#endif |
|
7009 |
%} |
|
7010 |
. |
|
7011 |
^ false |
|
7012 |
! |
|
7013 |
||
7014 |
glxPrefpositionX1: x1 x2: x2 y1: y1 y2: y2 in: aGLXWindowId |
|
7015 |
||
7016 |
%{ /* NOCONTEXT */ |
|
7017 |
SETWIN(aGLXWindowId) |
|
1932 | 7018 |
#ifdef OPENGL |
7019 |
#else |
|
294 | 7020 |
prefposition(_longVal(x1), _longVal(x2), _longVal(y1), _longVal(y2)); |
1932 | 7021 |
#endif |
294 | 7022 |
RETURN (true); |
7023 |
%} |
|
7024 |
! |
|
7025 |
||
7026 |
glxPrefsizeX: x y: y in: aGLXWindowId |
|
7027 |
||
7028 |
%{ /* NOCONTEXT */ |
|
7029 |
SETWIN(aGLXWindowId) |
|
1932 | 7030 |
#ifdef OPENGL |
7031 |
#else |
|
294 | 7032 |
prefsize(_longVal(x), _longVal(y)); |
1932 | 7033 |
#endif |
294 | 7034 |
RETURN (true); |
7035 |
%} |
|
7036 |
! |
|
7037 |
||
7038 |
glxPupmodeIn: aGLXWindowId |
|
7039 |
||
7040 |
%{ /* NOCONTEXT */ |
|
7041 |
#ifdef GLX |
|
7042 |
SETWIN(aGLXWindowId) |
|
7043 |
pupmode(); |
|
7044 |
RETURN (true); |
|
7045 |
#endif |
|
7046 |
%} |
|
7047 |
. |
|
7048 |
^ false |
|
7049 |
! |
|
7050 |
||
7051 |
glxPushname: name In: aGLXWindowId |
|
7052 |
||
7053 |
%{ /* NOCONTEXT */ |
|
7054 |
#ifdef GLX |
|
7055 |
SETWIN(aGLXWindowId) |
|
7056 |
pushname(_shortVal(name)); |
|
7057 |
RETURN (true); |
|
7058 |
#endif |
|
7059 |
%} |
|
7060 |
. |
|
7061 |
^ false |
|
7062 |
! |
|
7063 |
||
7064 |
glxQdevice: dev in: aGLXWindowId |
|
7065 |
||
7066 |
%{ /* NOCONTEXT */ |
|
1932 | 7067 |
SETWIN(aGLXWindowId) |
7068 |
#ifdef OPENGL |
|
7069 |
#else |
|
294 | 7070 |
qdevice(_deviceVal(dev)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7071 |
#endif |
294 | 7072 |
%} |
7073 |
! |
|
7074 |
||
7075 |
glxQenterDev: dev val: val in: aGLXWindowId |
|
7076 |
||
7077 |
%{ /* NOCONTEXT */ |
|
7078 |
SETWIN(aGLXWindowId) |
|
1932 | 7079 |
#ifdef OPENGL |
7080 |
#else |
|
294 | 7081 |
qenter(_deviceVal(dev), _shortVal(val)); |
1932 | 7082 |
#endif |
294 | 7083 |
%} |
7084 |
! |
|
7085 |
||
7086 |
glxQgetfdIn: aGLXWindowId |
|
7087 |
||
7088 |
%{ /* NOCONTEXT */ |
|
7089 |
#ifdef GLX |
|
7090 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7091 |
RETURN (__MKSMALLINT(qgetfd())); |
294 | 7092 |
#endif |
7093 |
%} |
|
7094 |
. |
|
7095 |
^ false |
|
7096 |
! |
|
7097 |
||
7098 |
glxQreadIn: aGLXWindowId |
|
7099 |
||
7100 |
| dev data | |
|
4718 | 7101 |
%{ |
294 | 7102 |
short c_data; |
7103 |
||
7104 |
SETWIN(aGLXWindowId) |
|
1932 | 7105 |
#ifdef OPENGL |
7106 |
#else |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7107 |
dev = __MKSMALLINT(qread(&c_data)); |
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7108 |
data = __MKSMALLINT(c_data); |
1932 | 7109 |
#endif |
294 | 7110 |
%} |
7111 |
. |
|
7112 |
^ Array with: dev with: data |
|
7113 |
! |
|
7114 |
||
7115 |
glxQresetIn: aGLXWindowId |
|
7116 |
||
7117 |
%{ /* NOCONTEXT */ |
|
7118 |
SETWIN(aGLXWindowId) |
|
1932 | 7119 |
#ifdef OPENGL |
7120 |
#else |
|
294 | 7121 |
qreset(); |
1932 | 7122 |
#endif |
294 | 7123 |
RETURN (true); |
7124 |
%} |
|
7125 |
! |
|
7126 |
||
7127 |
glxQtestIn: aGLXWindowId |
|
7128 |
||
7129 |
%{ /* NOCONTEXT */ |
|
1932 | 7130 |
int rslt = 0; |
7131 |
||
7132 |
SETWIN(aGLXWindowId) |
|
7133 |
#ifdef OPENGL |
|
7134 |
#else |
|
7135 |
rslt = qtest(); |
|
7136 |
#endif |
|
7137 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 7138 |
%} |
7139 |
! |
|
7140 |
||
4718 | 7141 |
glxRGBcursorIndex: index red: red green: green blue: blue |
294 | 7142 |
redm: redm greenm: greenm bluem: bluem in: aGLXWindowId |
7143 |
||
7144 |
%{ /* NOCONTEXT */ |
|
7145 |
#ifdef GLX |
|
7146 |
SETWIN(aGLXWindowId) |
|
4718 | 7147 |
RGBcursor(_shortVal(index), |
7148 |
_shortVal(red), _shortVal(green), _shortVal(blue), |
|
294 | 7149 |
_shortVal(redm), _shortVal(greenm), _shortVal(bluem)); |
7150 |
RETURN (true); |
|
7151 |
#endif |
|
7152 |
%} |
|
7153 |
. |
|
7154 |
^ false |
|
7155 |
! |
|
7156 |
||
7157 |
glxRGBwritemaskRed: red green: green blue: blue in: aGLXWindowId |
|
7158 |
||
7159 |
%{ /* NOCONTEXT */ |
|
7160 |
#ifdef GLX |
|
7161 |
SETWIN(aGLXWindowId) |
|
7162 |
RGBwritemask(_shortVal(red), _shortVal(green), _shortVal(blue)); |
|
7163 |
RETURN (true); |
|
7164 |
#endif |
|
7165 |
%} |
|
7166 |
. |
|
7167 |
^ false |
|
7168 |
! |
|
7169 |
||
7170 |
glxRectzoomX: xfactor y: yfactor in: aGLXWindowId |
|
7171 |
||
7172 |
%{ /* NOCONTEXT */ |
|
7173 |
#ifdef GLX |
|
7174 |
SETWIN(aGLXWindowId) |
|
7175 |
rectzoom(_floatVal(xfactor), _floatVal(yfactor)); |
|
7176 |
RETURN (true); |
|
7177 |
#endif |
|
7178 |
%} |
|
7179 |
. |
|
7180 |
^ false |
|
7181 |
! |
|
7182 |
||
7183 |
glxResetls: b in: aGLXWindowId |
|
7184 |
||
7185 |
%{ /* NOCONTEXT */ |
|
7186 |
#ifdef GLX |
|
7187 |
SETWIN(aGLXWindowId) |
|
7188 |
resetls(_booleanVal(b)); |
|
7189 |
RETURN (true); |
|
7190 |
#endif |
|
7191 |
%} |
|
7192 |
. |
|
7193 |
^ false |
|
7194 |
! |
|
7195 |
||
7196 |
glxRingbellIn: aGLXWindowId |
|
7197 |
||
7198 |
%{ /* NOCONTEXT */ |
|
7199 |
#ifdef GLX |
|
7200 |
SETWIN(aGLXWindowId) |
|
7201 |
ringbell(); |
|
7202 |
RETURN (true); |
|
7203 |
#endif |
|
7204 |
%} |
|
7205 |
. |
|
7206 |
^ false |
|
7207 |
! |
|
7208 |
||
7209 |
glxSboxX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7210 |
||
7211 |
%{ /* NOCONTEXT */ |
|
7212 |
#ifdef GLX |
|
7213 |
SETWIN(aGLXWindowId) |
|
7214 |
sbox(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
7215 |
RETURN (true); |
|
7216 |
#endif |
|
7217 |
%} |
|
7218 |
. |
|
7219 |
^ false |
|
7220 |
! |
|
7221 |
||
7222 |
glxSboxfX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7223 |
||
7224 |
%{ /* NOCONTEXT */ |
|
7225 |
#ifdef GLX |
|
7226 |
SETWIN(aGLXWindowId) |
|
7227 |
sboxf(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
7228 |
RETURN (true); |
|
7229 |
#endif |
|
7230 |
%} |
|
7231 |
. |
|
7232 |
^ false |
|
7233 |
! |
|
7234 |
||
7235 |
glxSboxfiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7236 |
||
7237 |
%{ /* NOCONTEXT */ |
|
7238 |
#ifdef GLX |
|
7239 |
SETWIN(aGLXWindowId) |
|
7240 |
sboxfi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
7241 |
RETURN (true); |
|
7242 |
#endif |
|
7243 |
%} |
|
7244 |
. |
|
7245 |
^ false |
|
7246 |
! |
|
7247 |
||
7248 |
glxSboxfsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7249 |
||
7250 |
%{ /* NOCONTEXT */ |
|
7251 |
#ifdef GLX |
|
7252 |
SETWIN(aGLXWindowId) |
|
7253 |
sboxfs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
7254 |
RETURN (true); |
|
7255 |
#endif |
|
7256 |
%} |
|
7257 |
. |
|
7258 |
^ false |
|
7259 |
! |
|
7260 |
||
7261 |
glxSboxiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7262 |
||
7263 |
%{ /* NOCONTEXT */ |
|
7264 |
#ifdef GLX |
|
7265 |
SETWIN(aGLXWindowId) |
|
7266 |
sboxi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
7267 |
RETURN (true); |
|
7268 |
#endif |
|
7269 |
%} |
|
7270 |
. |
|
7271 |
^ false |
|
7272 |
! |
|
7273 |
||
7274 |
glxSboxsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7275 |
||
7276 |
%{ /* NOCONTEXT */ |
|
7277 |
#ifdef GLX |
|
7278 |
SETWIN(aGLXWindowId) |
|
7279 |
sboxs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
7280 |
RETURN (true); |
|
7281 |
#endif |
|
7282 |
%} |
|
7283 |
. |
|
7284 |
^ false |
|
7285 |
! |
|
7286 |
||
7287 |
glxSclearSval: sval in: aGLXWindowId |
|
7288 |
||
7289 |
%{ /* NOCONTEXT */ |
|
7290 |
#ifdef GLX |
|
7291 |
SETWIN(aGLXWindowId) |
|
7292 |
sclear((ulong)__intVal(sval)); |
|
7293 |
RETURN (true); |
|
7294 |
#endif |
|
7295 |
%} |
|
7296 |
. |
|
7297 |
^ false |
|
7298 |
! |
|
7299 |
||
7300 |
glxScrbox: arg in: aGLXWindowId |
|
7301 |
||
7302 |
%{ /* NOCONTEXT */ |
|
7303 |
#ifdef GLX |
|
7304 |
SETWIN(aGLXWindowId) |
|
7305 |
scrbox(_longVal(arg)); |
|
7306 |
RETURN (true); |
|
7307 |
#endif |
|
7308 |
%} |
|
7309 |
. |
|
7310 |
^ false |
|
7311 |
! |
|
7312 |
||
7313 |
glxScreenspaceIn: aGLXWindowId |
|
7314 |
||
7315 |
%{ /* NOCONTEXT */ |
|
7316 |
#ifdef GLX |
|
7317 |
SETWIN(aGLXWindowId) |
|
7318 |
screenspace(); |
|
7319 |
RETURN (true); |
|
7320 |
#endif |
|
7321 |
%} |
|
7322 |
. |
|
7323 |
^ false |
|
7324 |
! |
|
7325 |
||
7326 |
glxScrmaskLeft: left right: right bottom: bottom top: top in: aGLXWindowId |
|
7327 |
||
7328 |
%{ /* NOCONTEXT */ |
|
7329 |
#ifdef GLX |
|
7330 |
SETWIN(aGLXWindowId) |
|
4718 | 7331 |
scrmask(_screencoordVal(left), _screencoordVal(right), |
294 | 7332 |
_screencoordVal(bottom), _screencoordVal(top)); |
7333 |
RETURN (true); |
|
7334 |
#endif |
|
7335 |
%} |
|
7336 |
. |
|
7337 |
^ false |
|
7338 |
! |
|
7339 |
||
7340 |
glxScrnattach: gsnr in: aGLXWindowId |
|
7341 |
||
7342 |
%{ /* NOCONTEXT */ |
|
7343 |
#ifdef GLX |
|
7344 |
SETWIN(aGLXWindowId) |
|
7345 |
scrnattach(_longVal(gsnr)); |
|
7346 |
RETURN (true); |
|
7347 |
#endif |
|
7348 |
%} |
|
7349 |
. |
|
7350 |
^ false |
|
7351 |
! |
|
7352 |
||
7353 |
glxScrnselect: gsnr in: aGLXWindowId |
|
7354 |
||
7355 |
%{ /* NOCONTEXT */ |
|
7356 |
#ifdef GLX |
|
7357 |
SETWIN(aGLXWindowId) |
|
7358 |
scrnselect(_longVal(gsnr)); |
|
7359 |
RETURN (true); |
|
7360 |
#endif |
|
7361 |
%} |
|
7362 |
. |
|
7363 |
^ false |
|
7364 |
! |
|
7365 |
||
7366 |
glxSetcursorIndex: index color: color wtn: wtn in: aGLXWindowId |
|
7367 |
||
7368 |
%{ /* NOCONTEXT */ |
|
7369 |
#ifdef GLX |
|
7370 |
SETWIN(aGLXWindowId) |
|
7371 |
setcursor(_shortVal(index), _colorindexVal(color), _colorindexVal(wtn)); |
|
7372 |
RETURN (true); |
|
7373 |
#endif |
|
7374 |
%} |
|
7375 |
. |
|
7376 |
^ false |
|
7377 |
! |
|
7378 |
||
7379 |
glxSetdblightsMask: mask in: aGLXWindowId |
|
7380 |
||
7381 |
%{ /* NOCONTEXT */ |
|
7382 |
#ifdef GLX |
|
7383 |
SETWIN(aGLXWindowId) |
|
7384 |
setdblights((ulong)__intVal(mask)); |
|
7385 |
RETURN (true); |
|
7386 |
#endif |
|
7387 |
%} |
|
7388 |
. |
|
7389 |
^ false |
|
7390 |
! |
|
7391 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7392 |
glxSetdepthNear:znear far:zfar in: aGLXWindowId |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7393 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7394 |
%{ /* NOCONTEXT */ |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7395 |
#ifdef GLX |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7396 |
SETWIN(aGLXWindowId) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7397 |
setdepth(_screencoordVal(znear), _screencoordVal(zfar)); |
294 | 7398 |
RETURN (true); |
7399 |
#endif |
|
7400 |
%} |
|
7401 |
. |
|
7402 |
^ false |
|
7403 |
! |
|
7404 |
||
7405 |
glxSetmap: mapnum in: aGLXWindowId |
|
7406 |
||
7407 |
%{ /* NOCONTEXT */ |
|
7408 |
#ifdef GLX |
|
7409 |
SETWIN(aGLXWindowId) |
|
7410 |
setmap(_shortVal(mapnum)); |
|
7411 |
RETURN (true); |
|
7412 |
#endif |
|
7413 |
%} |
|
7414 |
. |
|
7415 |
^ false |
|
7416 |
! |
|
7417 |
||
7418 |
glxSetmonitor: mtype in: aGLXWindowId |
|
7419 |
||
7420 |
%{ /* NOCONTEXT */ |
|
7421 |
#ifdef GLX |
|
7422 |
SETWIN(aGLXWindowId) |
|
7423 |
setmonitor(_shortVal(mtype)); |
|
7424 |
RETURN (true); |
|
7425 |
#endif |
|
7426 |
%} |
|
7427 |
. |
|
7428 |
^ false |
|
7429 |
! |
|
7430 |
||
7431 |
glxSetnurbsproperty: property value: value in: aGLXWindowId |
|
7432 |
||
7433 |
%{ /* NOCONTEXT */ |
|
7434 |
#ifdef GLX |
|
7435 |
SETWIN(aGLXWindowId) |
|
7436 |
setnurbsproperty(_longVal(property), _floatVal(value)); |
|
7437 |
RETURN (true); |
|
7438 |
#endif |
|
7439 |
%} |
|
7440 |
. |
|
7441 |
^ false |
|
7442 |
! |
|
7443 |
||
7444 |
glxSetpattern: index in: aGLXWindowId |
|
7445 |
||
7446 |
%{ /* NOCONTEXT */ |
|
7447 |
#ifdef GLX |
|
7448 |
SETWIN(aGLXWindowId) |
|
7449 |
setpattern(_shortVal(index)); |
|
7450 |
RETURN (true); |
|
7451 |
#endif |
|
7452 |
%} |
|
7453 |
. |
|
7454 |
^ false |
|
7455 |
! |
|
7456 |
||
7457 |
glxSetpup: pup entry: entry mode: mode in: aGLXWindowId |
|
7458 |
||
7459 |
%{ /* NOCONTEXT */ |
|
7460 |
#ifdef GLX |
|
7461 |
SETWIN(aGLXWindowId) |
|
7462 |
setpup(_longVal(pup), _longVal(entry), (ulong)__intVal(mode)); |
|
7463 |
RETURN (true); |
|
7464 |
#endif |
|
7465 |
%} |
|
7466 |
. |
|
7467 |
^ false |
|
7468 |
! |
|
7469 |
||
7470 |
glxSetvaluator: v init: init vmin: vmin vmax: vmax in: aGLXWindowId |
|
7471 |
||
7472 |
%{ /* NOCONTEXT */ |
|
7473 |
#ifdef GLX |
|
7474 |
SETWIN(aGLXWindowId) |
|
7475 |
setvaluator(_deviceVal(v), _shortVal(init), _shortVal(vmin), _shortVal(vmax)); |
|
7476 |
RETURN (true); |
|
7477 |
#endif |
|
7478 |
%} |
|
7479 |
. |
|
7480 |
^ false |
|
7481 |
! |
|
7482 |
||
7483 |
glxSetvideo: reg value: value in: aGLXWindowId |
|
7484 |
||
7485 |
%{ /* NOCONTEXT */ |
|
7486 |
#ifdef GLX |
|
7487 |
SETWIN(aGLXWindowId) |
|
7488 |
setvideo(_longVal(reg), _longVal(value)); |
|
7489 |
RETURN (true); |
|
7490 |
#endif |
|
7491 |
%} |
|
7492 |
. |
|
7493 |
^ false |
|
7494 |
! |
|
7495 |
||
7496 |
glxShademodel: model in: aGLXWindowId |
|
7497 |
||
7498 |
%{ /* NOCONTEXT */ |
|
7499 |
#ifdef GLX |
|
7500 |
SETWIN(aGLXWindowId) |
|
7501 |
shademodel(_longVal(model)); |
|
7502 |
RETURN (true); |
|
7503 |
#endif |
|
7504 |
%} |
|
7505 |
. |
|
7506 |
^ false |
|
7507 |
! |
|
7508 |
||
7509 |
glxShaderangeLowin: lowin hiwin: hiwin z1: z1 z2: z2 in: aGLXWindowId |
|
7510 |
||
7511 |
%{ /* NOCONTEXT */ |
|
7512 |
#ifdef GLX |
|
7513 |
SETWIN(aGLXWindowId) |
|
4718 | 7514 |
shaderange(_colorindexVal(lowin), _colorindexVal(hiwin), |
294 | 7515 |
_screencoordVal(z1), _screencoordVal(z2)); |
7516 |
RETURN (true); |
|
7517 |
#endif |
|
7518 |
%} |
|
7519 |
. |
|
7520 |
^ false |
|
7521 |
! |
|
7522 |
||
7523 |
glxSmoothline: mode in: aGLXWindowId |
|
7524 |
||
7525 |
%{ /* NOCONTEXT */ |
|
7526 |
#ifdef GLX |
|
7527 |
SETWIN(aGLXWindowId) |
|
7528 |
smoothline(_longVal(mode)); |
|
7529 |
RETURN (true); |
|
7530 |
#endif |
|
7531 |
%} |
|
7532 |
. |
|
7533 |
^ false |
|
7534 |
! |
|
7535 |
||
4718 | 7536 |
glxStencilEnable: enable ref: ref func: func mask: mask fail: fail |
294 | 7537 |
pass: pass zpass: zpass in: aGLXWindowId |
7538 |
||
7539 |
%{ /* NOCONTEXT */ |
|
7540 |
#ifdef GLX |
|
7541 |
SETWIN(aGLXWindowId) |
|
4718 | 7542 |
stencil(_longVal(enable), (ulong)__intVal(ref), _longVal(func), |
294 | 7543 |
(ulong)__intVal(mask), _longVal(fail), _longVal(pass), _longVal(zpass)); |
7544 |
RETURN (true); |
|
7545 |
#endif |
|
7546 |
%} |
|
7547 |
. |
|
7548 |
^ false |
|
7549 |
! |
|
7550 |
||
7551 |
glxStensize: planes in: aGLXWindowId |
|
7552 |
||
7553 |
%{ /* NOCONTEXT */ |
|
7554 |
#ifdef GLX |
|
7555 |
SETWIN(aGLXWindowId) |
|
7556 |
stensize(_longVal(planes)); |
|
7557 |
RETURN (true); |
|
7558 |
#endif |
|
7559 |
%} |
|
7560 |
. |
|
7561 |
^ false |
|
7562 |
! |
|
7563 |
||
7564 |
glxStepunitX: x y: y in: aGLXWindowId |
|
7565 |
||
7566 |
%{ /* NOCONTEXT */ |
|
7567 |
#ifdef GLX |
|
7568 |
SETWIN(aGLXWindowId) |
|
7569 |
stepunit(_longVal(x), _longVal(y)); |
|
7570 |
RETURN (true); |
|
7571 |
#endif |
|
7572 |
%} |
|
7573 |
. |
|
7574 |
^ false |
|
7575 |
! |
|
7576 |
||
7577 |
glxSubpixel: b in: aGLXWindowId |
|
7578 |
||
7579 |
%{ /* NOCONTEXT */ |
|
7580 |
#ifdef GLX |
|
7581 |
SETWIN(aGLXWindowId) |
|
7582 |
subpixel(_booleanVal(b)); |
|
7583 |
RETURN (true); |
|
7584 |
#endif |
|
7585 |
%} |
|
7586 |
. |
|
7587 |
^ false |
|
7588 |
! |
|
7589 |
||
7590 |
glxSwapinterval: i in: aGLXWindowId |
|
7591 |
||
7592 |
%{ /* NOCONTEXT */ |
|
7593 |
#ifdef GLX |
|
7594 |
SETWIN(aGLXWindowId) |
|
7595 |
swapinterval(_shortVal(i)); |
|
7596 |
RETURN (true); |
|
7597 |
#endif |
|
7598 |
%} |
|
7599 |
. |
|
7600 |
^ false |
|
7601 |
! |
|
7602 |
||
7603 |
glxSwaptmeshIn: aGLXWindowId |
|
7604 |
||
7605 |
%{ /* NOCONTEXT */ |
|
7606 |
#ifdef GLX |
|
7607 |
SETWIN(aGLXWindowId) |
|
7608 |
swaptmesh(); |
|
7609 |
RETURN (true); |
|
7610 |
#endif |
|
7611 |
%} |
|
7612 |
. |
|
7613 |
^ false |
|
7614 |
! |
|
7615 |
||
7616 |
glxSwinopen: parent in: aGLXWindowId |
|
7617 |
||
7618 |
%{ /* NOCONTEXT */ |
|
7619 |
#ifdef GLX |
|
7620 |
SETWIN(aGLXWindowId) |
|
7621 |
swinopen(_longVal(parent)); |
|
7622 |
RETURN (true); |
|
7623 |
#endif |
|
7624 |
%} |
|
7625 |
. |
|
7626 |
^ false |
|
7627 |
! |
|
7628 |
||
7629 |
glxSwritemask: mask in: aGLXWindowId |
|
7630 |
||
7631 |
%{ /* NOCONTEXT */ |
|
7632 |
#ifdef GLX |
|
7633 |
SETWIN(aGLXWindowId) |
|
7634 |
swritemask((ulong)__intVal(mask)); |
|
7635 |
RETURN (true); |
|
7636 |
#endif |
|
7637 |
%} |
|
7638 |
. |
|
7639 |
^ false |
|
7640 |
! |
|
7641 |
||
7642 |
glxTextinitIn: aGLXWindowId |
|
7643 |
||
7644 |
%{ /* NOCONTEXT */ |
|
7645 |
#ifdef GLX |
|
7646 |
SETWIN(aGLXWindowId) |
|
7647 |
textinit(); |
|
7648 |
RETURN (true); |
|
7649 |
#endif |
|
7650 |
%} |
|
7651 |
. |
|
7652 |
^ false |
|
7653 |
! |
|
7654 |
||
7655 |
glxTextportLeft: left right: right bottom: bottom top: top in: aGLXWindowId |
|
7656 |
||
7657 |
%{ /* NOCONTEXT */ |
|
7658 |
#ifdef GLX |
|
7659 |
SETWIN(aGLXWindowId) |
|
4718 | 7660 |
textport(_screencoordVal(left), _screencoordVal(right), |
294 | 7661 |
_screencoordVal(bottom), _screencoordVal(top)); |
7662 |
RETURN (true); |
|
7663 |
#endif |
|
7664 |
%} |
|
7665 |
. |
|
7666 |
^ false |
|
7667 |
! |
|
7668 |
||
7669 |
glxTieB: b v1: v1 v2: v2 in: aGLXWindowId |
|
7670 |
||
7671 |
%{ /* NOCONTEXT */ |
|
7672 |
#ifdef GLX |
|
7673 |
SETWIN(aGLXWindowId) |
|
7674 |
tie(_deviceVal(b), _deviceVal(v1), _deviceVal(v2)); |
|
7675 |
RETURN (true); |
|
7676 |
#endif |
|
7677 |
%} |
|
7678 |
. |
|
7679 |
^ false |
|
7680 |
! |
|
7681 |
||
7682 |
glxTlutbind: target index: index in: aGLXWindowId |
|
7683 |
||
7684 |
%{ /* NOCONTEXT */ |
|
7685 |
#ifdef FULL_GLX |
|
7686 |
SETWIN(aGLXWindowId) |
|
7687 |
tlutbind(_longVal(target), _longVal(index)); |
|
7688 |
RETURN (true); |
|
7689 |
#endif |
|
7690 |
%} |
|
7691 |
. |
|
7692 |
^ false |
|
7693 |
! |
|
7694 |
||
7695 |
glxTpoffIn: aGLXWindowId |
|
7696 |
||
7697 |
%{ /* NOCONTEXT */ |
|
7698 |
#ifdef GLX |
|
7699 |
SETWIN(aGLXWindowId) |
|
7700 |
tpoff(); |
|
7701 |
RETURN (true); |
|
7702 |
#endif |
|
7703 |
%} |
|
7704 |
. |
|
7705 |
^ false |
|
7706 |
! |
|
7707 |
||
7708 |
glxTponIn: aGLXWindowId |
|
7709 |
||
7710 |
%{ /* NOCONTEXT */ |
|
7711 |
#ifdef GLX |
|
7712 |
SETWIN(aGLXWindowId) |
|
7713 |
tpon(); |
|
7714 |
RETURN (true); |
|
7715 |
#endif |
|
7716 |
%} |
|
7717 |
. |
|
7718 |
^ false |
|
7719 |
! |
|
7720 |
||
7721 |
glxUnqdevice: dev in: aGLXWindowId |
|
7722 |
||
7723 |
%{ /* NOCONTEXT */ |
|
1932 | 7724 |
SETWIN(aGLXWindowId) |
7725 |
#ifdef OPENGL |
|
7726 |
#else |
|
294 | 7727 |
unqdevice(_deviceVal(dev)); |
1932 | 7728 |
#endif |
7729 |
%} |
|
294 | 7730 |
! |
7731 |
||
7732 |
glxWmpack: pack in: aGLXWindowId |
|
7733 |
||
7734 |
%{ /* NOCONTEXT */ |
|
7735 |
#ifdef GLX |
|
7736 |
SETWIN(aGLXWindowId) |
|
7737 |
wmpack((ulong)__intVal(pack)); |
|
7738 |
RETURN (true); |
|
7739 |
#endif |
|
7740 |
%} |
|
7741 |
. |
|
7742 |
^ false |
|
7743 |
! |
|
7744 |
||
7745 |
glxWritemask: wtm in: aGLXWindowId |
|
7746 |
||
7747 |
%{ /* NOCONTEXT */ |
|
7748 |
#ifdef GLX |
|
7749 |
SETWIN(aGLXWindowId) |
|
7750 |
writemask(_colorindexVal(wtm)); |
|
7751 |
RETURN (true); |
|
7752 |
#endif |
|
7753 |
%} |
|
7754 |
. |
|
7755 |
^ false |
|
7756 |
! |
|
7757 |
||
7758 |
glxXfpt2X: x y: y in: aGLXWindowId |
|
7759 |
||
7760 |
%{ /* NOCONTEXT */ |
|
7761 |
#ifdef GLX |
|
7762 |
Coord c_x, c_y; |
|
7763 |
||
7764 |
_COORD_ (x, c_x) |
|
7765 |
_COORD_ (y, c_y) |
|
7766 |
SETWIN(aGLXWindowId) |
|
7767 |
xfpt2(c_x, c_y); |
|
7768 |
RETURN (true); |
|
7769 |
#endif |
|
7770 |
%} |
|
7771 |
. |
|
7772 |
^ false |
|
7773 |
! |
|
7774 |
||
7775 |
glxXfpt2iX: x y: y in: aGLXWindowId |
|
7776 |
||
7777 |
%{ /* NOCONTEXT */ |
|
7778 |
#ifdef GLX |
|
7779 |
Icoord c_x, c_y; |
|
7780 |
||
7781 |
_ICOORD_ (x, c_x) |
|
7782 |
_ICOORD_ (y, c_y) |
|
7783 |
SETWIN(aGLXWindowId) |
|
7784 |
xfpt2i(c_x, c_y); |
|
7785 |
RETURN (true); |
|
7786 |
#endif |
|
7787 |
%} |
|
7788 |
. |
|
7789 |
^ false |
|
7790 |
! |
|
7791 |
||
7792 |
glxXfpt2sX: x y: y in: aGLXWindowId |
|
7793 |
||
7794 |
%{ /* NOCONTEXT */ |
|
7795 |
#ifdef GLX |
|
7796 |
Scoord c_x, c_y; |
|
7797 |
||
7798 |
_SCOORD_ (x, c_x) |
|
7799 |
_SCOORD_ (y, c_y) |
|
7800 |
SETWIN(aGLXWindowId) |
|
7801 |
xfpt2s(c_x, c_y); |
|
7802 |
RETURN (true); |
|
7803 |
#endif |
|
7804 |
%} |
|
7805 |
. |
|
7806 |
^ false |
|
7807 |
! |
|
7808 |
||
7809 |
glxXfpt4X: x y: y z: z w: w in: aGLXWindowId |
|
7810 |
||
7811 |
%{ /* NOCONTEXT */ |
|
7812 |
#ifdef GLX |
|
7813 |
Coord c_x, c_y, c_z, c_w; |
|
7814 |
||
7815 |
_COORD_ (x, c_x) |
|
7816 |
_COORD_ (y, c_y) |
|
7817 |
_COORD_ (z, c_z) |
|
7818 |
_COORD_ (w, c_w) |
|
7819 |
SETWIN(aGLXWindowId) |
|
7820 |
xfpt4(c_x, c_y, c_z, c_w); |
|
7821 |
RETURN (true); |
|
7822 |
#endif |
|
7823 |
%} |
|
7824 |
. |
|
7825 |
^ false |
|
7826 |
! |
|
7827 |
||
7828 |
glxXfpt4iX: x y: y z: z w: w in: aGLXWindowId |
|
7829 |
||
7830 |
%{ /* NOCONTEXT */ |
|
7831 |
#ifdef GLX |
|
7832 |
Icoord c_x, c_y, c_z, c_w; |
|
7833 |
||
7834 |
_ICOORD_ (x, c_x) |
|
7835 |
_ICOORD_ (y, c_y) |
|
7836 |
_ICOORD_ (z, c_z) |
|
7837 |
_ICOORD_ (w, c_w) |
|
7838 |
SETWIN(aGLXWindowId) |
|
7839 |
xfpt4i(c_x, c_y, c_z, c_w); |
|
7840 |
RETURN (true); |
|
7841 |
#endif |
|
7842 |
%} |
|
7843 |
. |
|
7844 |
^ false |
|
7845 |
! |
|
7846 |
||
7847 |
glxXfpt4sX: x y: y z: z w: w in: aGLXWindowId |
|
7848 |
||
7849 |
%{ /* NOCONTEXT */ |
|
7850 |
#ifdef GLX |
|
7851 |
Scoord c_x, c_y, c_z, c_w; |
|
7852 |
||
7853 |
_SCOORD_ (x, c_x) |
|
7854 |
_SCOORD_ (y, c_y) |
|
7855 |
_SCOORD_ (z, c_z) |
|
7856 |
_SCOORD_ (w, c_w) |
|
7857 |
SETWIN(aGLXWindowId) |
|
7858 |
xfpt4s(c_x, c_y, c_z, c_w); |
|
7859 |
RETURN (true); |
|
7860 |
#endif |
|
7861 |
%} |
|
7862 |
. |
|
7863 |
^ false |
|
7864 |
! |
|
7865 |
||
7866 |
glxXfptX: x y: y z: z in: aGLXWindowId |
|
7867 |
||
7868 |
%{ /* NOCONTEXT */ |
|
7869 |
#ifdef GLX |
|
7870 |
Coord c_x, c_y, c_z; |
|
7871 |
||
7872 |
_COORD_ (x, c_x) |
|
7873 |
_COORD_ (y, c_y) |
|
7874 |
_COORD_ (z, c_z) |
|
7875 |
SETWIN(aGLXWindowId) |
|
7876 |
xfpt(c_x, c_y, c_z); |
|
7877 |
RETURN (true); |
|
7878 |
#endif |
|
7879 |
%} |
|
7880 |
. |
|
7881 |
^ false |
|
7882 |
! |
|
7883 |
||
7884 |
glxXfptiX: x y: y z: z in: aGLXWindowId |
|
7885 |
||
7886 |
%{ /* NOCONTEXT */ |
|
7887 |
#ifdef GLX |
|
7888 |
Icoord c_x, c_y, c_z; |
|
7889 |
||
7890 |
_ICOORD_ (x, c_x) |
|
7891 |
_ICOORD_ (y, c_y) |
|
7892 |
_ICOORD_ (z, c_z) |
|
7893 |
SETWIN(aGLXWindowId) |
|
7894 |
xfpti(c_x, c_y, c_z); |
|
7895 |
RETURN (true); |
|
7896 |
#endif |
|
7897 |
%} |
|
7898 |
. |
|
7899 |
^ false |
|
7900 |
! |
|
7901 |
||
7902 |
glxXfptsX: x y: y z: z in: aGLXWindowId |
|
7903 |
||
7904 |
%{ /* NOCONTEXT */ |
|
7905 |
#ifdef GLX |
|
7906 |
Scoord c_x, c_y, c_z; |
|
7907 |
||
7908 |
_SCOORD_ (x, c_x) |
|
7909 |
_SCOORD_ (y, c_y) |
|
7910 |
_SCOORD_ (z, c_z) |
|
7911 |
SETWIN(aGLXWindowId) |
|
7912 |
xfpts(c_x, c_y, c_z); |
|
7913 |
RETURN (true); |
|
7914 |
#endif |
|
7915 |
%} |
|
7916 |
. |
|
7917 |
^ false |
|
7918 |
! ! |
|
7919 |
||
7920 |
!GLXWorkstation methodsFor:'vertex data transfer'! |
|
7921 |
||
7922 |
glxN3f:arrayOf3Floats in:aGLXWindowId |
|
7923 |
"argument must be an array of 3 floats containing the |
|
7924 |
current vertex normal - in real GL only" |
|
7925 |
||
7926 |
%{ /* NOCONTEXT */ |
|
7927 |
#ifdef GLX |
|
7928 |
float vec[3], *v; |
|
7929 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7930 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 7931 |
SETWIN(aGLXWindowId) |
7932 |
n3f(v); |
|
7933 |
RETURN (true); |
|
7934 |
#endif |
|
7935 |
%} |
|
7936 |
. |
|
7937 |
^ false |
|
7938 |
! |
|
7939 |
||
7940 |
glxV2d:v in:aGLXWindowId |
|
7941 |
"pass a vertex; v must be a vector with 2 doubles; z is taken as 0" |
|
7942 |
||
7943 |
%{ /* NOCONTEXT */ |
|
7944 |
double vec[2], *c_v; |
|
7945 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7946 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 2))) RETURN(false); |
294 | 7947 |
SETWIN(aGLXWindowId) |
1932 | 7948 |
#ifdef OPENGL |
7949 |
#else |
|
294 | 7950 |
v2d(c_v); |
1932 | 7951 |
#endif |
294 | 7952 |
RETURN (true); |
7953 |
%} |
|
7954 |
! |
|
7955 |
||
7956 |
glxV2f:v in:aGLXWindowId |
|
7957 |
"pass a vertex; v must be a vector with 2 floats; z is taken as 0" |
|
7958 |
||
7959 |
%{ /* NOCONTEXT */ |
|
7960 |
float vec[2], *c_v; |
|
7961 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7962 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
294 | 7963 |
SETWIN(aGLXWindowId) |
1932 | 7964 |
#ifdef OPENGL |
7965 |
#else |
|
294 | 7966 |
v2f(c_v); |
1932 | 7967 |
#endif |
294 | 7968 |
RETURN (true); |
7969 |
%} |
|
7970 |
! |
|
7971 |
||
7972 |
glxV2fX:x y:y in:aGLXWindowId |
|
7973 |
"pass a vertex from individual x and y values; z is taken as 0.0" |
|
7974 |
||
7975 |
%{ /* NOCONTEXT */ |
|
7976 |
float vec[2]; |
|
7977 |
||
7978 |
_FLOAT_(x, vec[0]) |
|
7979 |
_FLOAT_(y, vec[1]) |
|
7980 |
SETWIN(aGLXWindowId) |
|
1932 | 7981 |
#ifdef OPENGL |
7982 |
#else |
|
294 | 7983 |
v2f(vec); |
1932 | 7984 |
#endif |
294 | 7985 |
RETURN (true); |
7986 |
%} |
|
7987 |
! |
|
7988 |
||
7989 |
glxV2i:v in:aGLXWindowId |
|
7990 |
"pass a vertex; v must be a vector with 2 longs; z is taken as 0" |
|
7991 |
||
7992 |
%{ /* NOCONTEXT */ |
|
7993 |
long vec[2], *c_v; |
|
7994 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7995 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 2))) RETURN(false); |
294 | 7996 |
SETWIN(aGLXWindowId) |
1932 | 7997 |
#ifdef OPENGL |
7998 |
#else |
|
294 | 7999 |
v2i(c_v); |
1932 | 8000 |
#endif |
294 | 8001 |
RETURN (true); |
8002 |
%} |
|
8003 |
! |
|
8004 |
||
8005 |
glxV2s:v in:aGLXWindowId |
|
8006 |
"pass a vertex; v must be a vector with 2 shorts; z is taken as 0" |
|
8007 |
||
8008 |
%{ /* NOCONTEXT */ |
|
8009 |
short vec[2], *c_v; |
|
8010 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8011 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 2))) RETURN(false); |
294 | 8012 |
SETWIN(aGLXWindowId) |
1932 | 8013 |
#ifdef OPENGL |
8014 |
#else |
|
294 | 8015 |
v2s(c_v); |
1932 | 8016 |
#endif |
294 | 8017 |
RETURN (true); |
8018 |
%} |
|
8019 |
! |
|
8020 |
||
8021 |
glxV3d:v in:aGLXWindowId |
|
8022 |
"pass a vertex; v must be a 3-element double-vector" |
|
8023 |
||
8024 |
%{ /* NOCONTEXT */ |
|
8025 |
double vec[3], *c_v; |
|
8026 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8027 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 3))) RETURN(false); |
294 | 8028 |
SETWIN(aGLXWindowId) |
1932 | 8029 |
#ifdef OPENGL |
8030 |
#else |
|
294 | 8031 |
v3d(c_v); |
1932 | 8032 |
#endif |
294 | 8033 |
RETURN (true); |
8034 |
%} |
|
8035 |
. |
|
8036 |
^ false |
|
8037 |
! |
|
8038 |
||
8039 |
glxV3f:v in:aGLXWindowId |
|
8040 |
"pass a vertex; v must be a 3-element float-vector" |
|
8041 |
||
8042 |
%{ /* NOCONTEXT */ |
|
8043 |
float vec[3], *c_v; |
|
8044 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8045 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
294 | 8046 |
SETWIN(aGLXWindowId) |
1932 | 8047 |
#ifdef OPENGL |
8048 |
#else |
|
294 | 8049 |
v3f(c_v); |
1932 | 8050 |
#endif |
294 | 8051 |
RETURN (true); |
8052 |
%} |
|
8053 |
! |
|
8054 |
||
8055 |
glxV3fX:x y:y z:z in: aGLXWindowId |
|
8056 |
"pass a vector from individual x, y and z (float) values" |
|
8057 |
||
8058 |
%{ /* NOCONTEXT */ |
|
8059 |
float vec[3]; |
|
8060 |
||
8061 |
_FLOAT_(x, vec[0]) |
|
8062 |
_FLOAT_(y, vec[1]) |
|
8063 |
_FLOAT_(z, vec[2]) |
|
8064 |
SETWIN(aGLXWindowId) |
|
1932 | 8065 |
#ifdef OPENGL |
8066 |
#else |
|
294 | 8067 |
v3f(vec); |
1932 | 8068 |
#endif |
294 | 8069 |
RETURN (true); |
8070 |
%} |
|
8071 |
! |
|
8072 |
||
8073 |
glxV3i:v in:aGLXWindowId |
|
8074 |
"pass a vertex; v must be a vector with 3 longs" |
|
8075 |
||
8076 |
%{ /* NOCONTEXT */ |
|
8077 |
long vec[3], *c_v; |
|
8078 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8079 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
294 | 8080 |
SETWIN(aGLXWindowId) |
1932 | 8081 |
#ifdef OPENGL |
8082 |
#else |
|
294 | 8083 |
v3i(c_v); |
1932 | 8084 |
#endif |
294 | 8085 |
RETURN (true); |
8086 |
%} |
|
8087 |
! |
|
8088 |
||
8089 |
glxV3s:v in:aGLXWindowId |
|
8090 |
"pass a vertex; v must be a vector with 3 shorts" |
|
8091 |
||
8092 |
%{ /* NOCONTEXT */ |
|
8093 |
short vec[3], *c_v; |
|
8094 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8095 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
294 | 8096 |
SETWIN(aGLXWindowId) |
1932 | 8097 |
#ifdef OPENGL |
8098 |
#else |
|
294 | 8099 |
v3s(c_v); |
1932 | 8100 |
#endif |
294 | 8101 |
RETURN (true); |
8102 |
%} |
|
8103 |
! |
|
8104 |
||
8105 |
glxV4d:v in:aGLXWindowId |
|
8106 |
"pass a vertex; v must be a 4-element double-vector, |
|
8107 |
containing x, y, z and w" |
|
8108 |
||
8109 |
%{ /* NOCONTEXT */ |
|
8110 |
double vec[4], *c_v; |
|
8111 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8112 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 4))) RETURN(false); |
294 | 8113 |
SETWIN(aGLXWindowId) |
1932 | 8114 |
#ifdef OPENGL |
8115 |
#else |
|
294 | 8116 |
v4d(c_v); |
1932 | 8117 |
#endif |
294 | 8118 |
RETURN (true); |
8119 |
%} |
|
8120 |
! |
|
8121 |
||
8122 |
glxV4f:v in:aGLXWindowId |
|
8123 |
"pass a vertex; v must be a 4-element float-vector, |
|
8124 |
containing x, y, z and w" |
|
8125 |
||
8126 |
%{ /* NOCONTEXT */ |
|
8127 |
float vec[4], *c_v; |
|
8128 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8129 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
294 | 8130 |
SETWIN(aGLXWindowId) |
1932 | 8131 |
#ifdef OPENGL |
8132 |
#else |
|
294 | 8133 |
v4f(c_v); |
1932 | 8134 |
#endif |
294 | 8135 |
RETURN (true); |
8136 |
%} |
|
8137 |
! |
|
8138 |
||
8139 |
glxV4i:v in:aGLXWindowId |
|
8140 |
"pass a vertex; v must be a 4-element int-vector, |
|
8141 |
containing x, y, z and w" |
|
8142 |
||
8143 |
%{ /* NOCONTEXT */ |
|
8144 |
long vec[4], *c_v; |
|
8145 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8146 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
294 | 8147 |
SETWIN(aGLXWindowId) |
1932 | 8148 |
#ifdef OPENGL |
8149 |
#else |
|
294 | 8150 |
v4i(c_v); |
1932 | 8151 |
#endif |
294 | 8152 |
RETURN (true); |
8153 |
%} |
|
8154 |
! |
|
8155 |
||
8156 |
glxV4s:v in:aGLXWindowId |
|
8157 |
"pass a vertex; v must be a 4-element short-vector, |
|
8158 |
containing x, y, z and w" |
|
8159 |
||
8160 |
%{ /* NOCONTEXT */ |
|
8161 |
short vec[4], *c_v; |
|
8162 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8163 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
294 | 8164 |
SETWIN(aGLXWindowId) |
1932 | 8165 |
#ifdef OPENGL |
8166 |
#else |
|
294 | 8167 |
v4s(c_v); |
1932 | 8168 |
#endif |
294 | 8169 |
RETURN (true); |
8170 |
%} |
|
8171 |
! |
|
8172 |
||
8173 |
glxVOriginIn:aGLXWindowId |
|
8174 |
"pass a 0.0/0.0/0.0 vector. |
|
8175 |
This is the same as v3f:#(0.0 0.0 0.0), but, since its so |
|
8176 |
common, this somewhat faster method has been provided" |
|
8177 |
||
8178 |
%{ /* NOCONTEXT */ |
|
8179 |
static float vec[3] = {0.0, 0.0, 0.0}; |
|
8180 |
||
8181 |
SETWIN(aGLXWindowId) |
|
1932 | 8182 |
#ifdef OPENGL |
8183 |
#else |
|
294 | 8184 |
v3f(vec); |
1932 | 8185 |
#endif |
294 | 8186 |
RETURN (true); |
8187 |
%} |
|
8188 |
! |
|
8189 |
||
8190 |
glxVUnitXIn:aGLXWindowId |
|
8191 |
"pass a 1.0/0.0/0.0 vector. |
|
8192 |
This is the same as v3f:#(1.0 0.0 0.0), but, since its so |
|
8193 |
common, this somewhat faster method has been provided" |
|
8194 |
||
8195 |
%{ /* NOCONTEXT */ |
|
8196 |
static float vec[3] = {1.0, 0.0, 0.0}; |
|
8197 |
||
8198 |
SETWIN(aGLXWindowId) |
|
1932 | 8199 |
#ifdef OPENGL |
8200 |
#else |
|
294 | 8201 |
v3f(vec); |
1932 | 8202 |
#endif |
294 | 8203 |
RETURN (true); |
8204 |
%} |
|
8205 |
! |
|
8206 |
||
8207 |
glxVUnitYIn:aGLXWindowId |
|
8208 |
"pass a 0.0/1.0/0.0 vector. |
|
8209 |
This is the same as v3f:#(0.0 1.0 0.0), but, since its so |
|
8210 |
common, this somewhat faster method has been provided" |
|
8211 |
||
8212 |
%{ /* NOCONTEXT */ |
|
8213 |
static float vec[3] = {0.0, 1.0, 0.0}; |
|
8214 |
||
8215 |
SETWIN(aGLXWindowId) |
|
1932 | 8216 |
#ifdef OPENGL |
8217 |
#else |
|
294 | 8218 |
v3f(vec); |
1932 | 8219 |
#endif |
294 | 8220 |
RETURN (true); |
8221 |
%} |
|
8222 |
! |
|
8223 |
||
8224 |
glxVUnitZIn:aGLXWindowId |
|
8225 |
"pass a 0.0/0.0/1.0 vector. |
|
8226 |
This is the same as v3f:#(0.0 0.0 1.0), but, since its so |
|
8227 |
common, this somewhat faster method has been provided" |
|
8228 |
||
8229 |
%{ /* NOCONTEXT */ |
|
8230 |
static float vec[3] = {0.0, 0.0, 1.0}; |
|
8231 |
||
8232 |
SETWIN(aGLXWindowId) |
|
1932 | 8233 |
#ifdef OPENGL |
8234 |
#else |
|
294 | 8235 |
v3f(vec); |
1932 | 8236 |
#endif |
294 | 8237 |
RETURN (true); |
8238 |
%} |
|
8239 |
! ! |
|
8240 |
||
8241 |
!GLXWorkstation methodsFor:'video and planes'! |
|
8242 |
||
8243 |
glxOverlayPlanes: planes in: aGLXWindowId |
|
8244 |
||
8245 |
%{ /* NOCONTEXT */ |
|
8246 |
#ifdef GLX |
|
8247 |
SETWIN(aGLXWindowId) |
|
8248 |
overlay(_longVal(planes)); |
|
8249 |
RETURN (true); |
|
8250 |
#endif |
|
8251 |
%} |
|
8252 |
. |
|
8253 |
^ false |
|
8254 |
! |
|
8255 |
||
8256 |
glxStereobufferIn: aGLXWindowId |
|
8257 |
||
8258 |
%{ /* NOCONTEXT */ |
|
8259 |
#ifdef FULL_GLX |
|
8260 |
SETWIN(aGLXWindowId) |
|
8261 |
stereobuffer(); |
|
8262 |
RETURN (true); |
|
8263 |
#endif |
|
8264 |
%} |
|
8265 |
. |
|
8266 |
^ false |
|
8267 |
! |
|
8268 |
||
8269 |
glxUnderlay: planes in: aGLXWindowId |
|
8270 |
||
8271 |
%{ /* NOCONTEXT */ |
|
8272 |
#ifdef GLX |
|
8273 |
SETWIN(aGLXWindowId) |
|
8274 |
underlay(_longVal(planes)); |
|
8275 |
RETURN (true); |
|
8276 |
#endif |
|
8277 |
%} |
|
8278 |
. |
|
8279 |
^ false |
|
8280 |
! |
|
8281 |
||
8282 |
glxVideocmd:cmd in:aGLXWindowId |
|
8283 |
||
8284 |
%{ /* NOCONTEXT */ |
|
8285 |
#ifdef GLX |
|
8286 |
SETWIN(aGLXWindowId) |
|
8287 |
videocmd(_longVal(cmd)); |
|
8288 |
RETURN (true); |
|
8289 |
#endif |
|
8290 |
%} |
|
8291 |
. |
|
8292 |
^ false |
|
8293 |
! ! |
|
8294 |
||
8295 |
!GLXWorkstation methodsFor:'viewing'! |
|
8296 |
||
8297 |
glxLookatVx:vx vy:vy vz:vz px:px py:py pz:pz twist:twist in:aGLXWindowId |
|
8298 |
"define viewing transformation" |
|
8299 |
||
8300 |
%{ /* NOCONTEXT */ |
|
8301 |
||
8302 |
Coord f_vx, f_vy, f_vz, f_px, f_py, f_pz; |
|
8303 |
Angle a_twist; |
|
8304 |
||
8305 |
_COORD_ (vx, f_vx) |
|
8306 |
_COORD_ (vy, f_vy) |
|
8307 |
_COORD_ (vz, f_vz) |
|
8308 |
_COORD_ (px, f_px) |
|
8309 |
_COORD_ (py, f_py) |
|
8310 |
_COORD_ (pz, f_pz) |
|
8311 |
_ANGLE_ (twist, a_twist) |
|
8312 |
SETWIN(aGLXWindowId) |
|
1932 | 8313 |
#ifdef OPENGL |
8314 |
#else |
|
294 | 8315 |
lookat(f_vx, f_vy, f_vz, f_px, f_py, f_pz, a_twist); |
1932 | 8316 |
#endif |
294 | 8317 |
%} |
8318 |
! |
|
8319 |
||
8320 |
glxOrtho2Left: left right: right bottom: bottom top: top in: aGLXWindowId |
|
8321 |
"define 2D orthogonal projection" |
|
8322 |
||
8323 |
%{ /* NOCONTEXT */ |
|
8324 |
float f_left, f_right, f_top, f_bottom; |
|
8325 |
||
8326 |
SETWIN(aGLXWindowId) |
|
8327 |
_FLOAT_(left, f_left) |
|
8328 |
_FLOAT_(right, f_right) |
|
8329 |
_FLOAT_(bottom, f_bottom) |
|
8330 |
_FLOAT_(top, f_top) |
|
1932 | 8331 |
#ifdef OPENGL |
8332 |
#else |
|
294 | 8333 |
ortho2(f_left, f_right, f_bottom, f_top); |
1932 | 8334 |
#endif |
8335 |
%} |
|
294 | 8336 |
! |
8337 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8338 |
glxOrthoLeft: left right: right bottom: bottom top: top near: znear far: zfar in: aGLXWindowId |
294 | 8339 |
"define orthogonal projection" |
8340 |
||
8341 |
%{ /* NOCONTEXT */ |
|
8342 |
float f_left, f_right, f_bottom, f_top, |
|
8343 |
f_near, f_far; |
|
8344 |
||
8345 |
_FLOAT_(left, f_left) |
|
8346 |
_FLOAT_(right, f_right) |
|
8347 |
_FLOAT_(bottom, f_bottom) |
|
8348 |
_FLOAT_(top, f_top) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8349 |
_FLOAT_(znear, f_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8350 |
_FLOAT_(zfar, f_far) |
294 | 8351 |
SETWIN(aGLXWindowId) |
1932 | 8352 |
#ifdef OPENGL |
8353 |
#else |
|
294 | 8354 |
ortho(f_left, f_right, f_bottom, f_top, f_near, f_far); |
1932 | 8355 |
#endif |
294 | 8356 |
%} |
8357 |
! |
|
8358 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8359 |
glxPerspectiveFovy:fovy aspect:aspect near:znear far:zfar in:aGLXWindowId |
294 | 8360 |
"define perspective projection" |
8361 |
||
8362 |
%{ /* NOCONTEXT */ |
|
8363 |
||
8364 |
Angle a_fovy; |
|
8365 |
Coord c_near, c_far; |
|
8366 |
float f_aspect; |
|
8367 |
||
8368 |
_ANGLE_ (fovy, a_fovy) |
|
8369 |
_FLOAT_ (aspect, f_aspect) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8370 |
_COORD_ (znear, c_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8371 |
_COORD_ (zfar, c_far) |
294 | 8372 |
|
8373 |
SETWIN(aGLXWindowId) |
|
1932 | 8374 |
#ifdef OPENGL |
8375 |
#else |
|
294 | 8376 |
perspective(a_fovy, f_aspect, c_near, c_far); |
1932 | 8377 |
#endif |
294 | 8378 |
%} |
8379 |
! |
|
8380 |
||
8381 |
glxPolarviewDist: dist azim: azim inc: inc twist: twist in: aGLXWindowId |
|
8382 |
||
8383 |
%{ /* NOCONTEXT */ |
|
8384 |
Coord c_dist; |
|
8385 |
Angle a_azim, a_inc, a_twist; |
|
8386 |
||
8387 |
_COORD_(dist, c_dist) |
|
8388 |
_ANGLE_(azim, a_azim) |
|
8389 |
_ANGLE_(inc, a_inc) |
|
8390 |
_ANGLE_(twist, a_twist) |
|
8391 |
SETWIN(aGLXWindowId) |
|
1932 | 8392 |
#ifdef OPENGL |
8393 |
#else |
|
294 | 8394 |
polarview(c_dist, a_azim, a_inc, a_twist); |
1932 | 8395 |
#endif |
294 | 8396 |
%} |
8397 |
! |
|
8398 |
||
528 | 8399 |
glxPopviewportIn: aGLXWindowId |
8400 |
"pops the top viewport off the viewport stack" |
|
8401 |
||
8402 |
%{ /* NOCONTEXT */ |
|
8403 |
SETWIN(aGLXWindowId) |
|
1932 | 8404 |
#ifdef OPENGL |
8405 |
#else |
|
528 | 8406 |
popviewport(); |
1932 | 8407 |
#endif |
528 | 8408 |
%} |
8409 |
||
8410 |
"Modified: 19.3.1996 / 18:58:24 / cg" |
|
8411 |
! |
|
8412 |
||
8413 |
glxPushviewportIn: aGLXWindowId |
|
8414 |
"pushes the current viewport on the viewport stack" |
|
8415 |
||
8416 |
%{ /* NOCONTEXT */ |
|
8417 |
SETWIN(aGLXWindowId) |
|
1932 | 8418 |
#ifdef OPENGL |
8419 |
#else |
|
528 | 8420 |
pushviewport(); |
1932 | 8421 |
#endif |
528 | 8422 |
%} |
8423 |
||
8424 |
"Modified: 19.3.1996 / 18:58:02 / cg" |
|
8425 |
! |
|
8426 |
||
294 | 8427 |
glxReshapeViewPortIn: aGLXWindowId |
8428 |
||
8429 |
%{ /* NOCONTEXT */ |
|
8430 |
SETWIN(aGLXWindowId) |
|
1932 | 8431 |
#ifdef OPENGL |
8432 |
#else |
|
294 | 8433 |
reshapeviewport(); |
1932 | 8434 |
#endif |
8435 |
%} |
|
294 | 8436 |
! |
8437 |
||
8438 |
glxViewportLeft:left right:right bottom:bottom top:top in:aGLXWindowId |
|
8439 |
||
8440 |
%{ /* NOCONTEXT */ |
|
8441 |
SETWIN(aGLXWindowId) |
|
1932 | 8442 |
#ifdef OPENGL |
8443 |
#else |
|
4718 | 8444 |
viewport(_screencoordVal(left), _screencoordVal(right), |
294 | 8445 |
_screencoordVal(bottom), _screencoordVal(top)); |
1932 | 8446 |
#endif |
294 | 8447 |
%} |
8448 |
! |
|
8449 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8450 |
glxWindowLeft: left right: right bottom: bottom top: top near: znear far: zfar in: aGLXWindowId |
294 | 8451 |
"this one was added independently by JEFF - kept for his programs ..." |
8452 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8453 |
self glxWindowLeft:left right:right top:top bottom:bottom near:znear far:zfar in:aGLXWindowId |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8454 |
! |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8455 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8456 |
glxWindowLeft:left right:right top:top bottom:bottom near:znear far:zfar in:aGLXWindowId |
294 | 8457 |
"define perspective viewing pyramid" |
8458 |
||
8459 |
%{ /* NOCONTEXT */ |
|
8460 |
Coord c_left, c_right, c_top, c_bot, c_near, c_far; |
|
8461 |
||
8462 |
_COORD_ (left, c_left) |
|
8463 |
_COORD_ (right, c_right) |
|
8464 |
_COORD_ (top, c_top) |
|
8465 |
_COORD_ (bottom, c_bot) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8466 |
_COORD_ (znear, c_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8467 |
_COORD_ (zfar, c_far) |
294 | 8468 |
SETWIN(aGLXWindowId) |
1932 | 8469 |
#ifdef OPENGL |
8470 |
#else |
|
294 | 8471 |
window(c_left, c_right, c_bot, c_top, c_near, c_far); |
1932 | 8472 |
#endif |
294 | 8473 |
%} |
8474 |
! ! |
|
8475 |
||
8476 |
!GLXWorkstation methodsFor:'window control'! |
|
8477 |
||
2045 | 8478 |
glxResizedView:aGLXWindowId width:width height:height |
2048 | 8479 |
"pass down resize info to the GL - this adjusts the viewport. |
8480 |
This only works with VGL or openGL" |
|
8481 |
||
8482 |
%{ /* NOCONTEXT */ |
|
2074 | 8483 |
SETWIN(aGLXWindowId) |
8484 |
#ifdef VGL |
|
2045 | 8485 |
X11_resized(__intVal(width), __intVal(height)); |
8486 |
RETURN (true); |
|
8487 |
#endif |
|
8488 |
%} |
|
8489 |
. |
|
8490 |
^ false |
|
8491 |
! |
|
8492 |
||
294 | 8493 |
glxWinclose:gwid in:aGLXWindowId |
8494 |
||
8495 |
%{ /* NOCONTEXT */ |
|
8496 |
#ifdef GLX |
|
8497 |
SETWIN(aGLXWindowId) |
|
8498 |
winclose(_longVal(gwid)); |
|
8499 |
RETURN (true); |
|
8500 |
#endif |
|
8501 |
%} |
|
8502 |
. |
|
8503 |
^ false |
|
8504 |
! |
|
8505 |
||
8506 |
glxWinconstraintsIn: aGLXWindowId |
|
8507 |
||
8508 |
%{ /* NOCONTEXT */ |
|
8509 |
#ifdef GLX |
|
8510 |
SETWIN(aGLXWindowId) |
|
8511 |
winconstraints(); |
|
8512 |
RETURN (true); |
|
8513 |
#endif |
|
8514 |
%} |
|
8515 |
. |
|
8516 |
^ false |
|
8517 |
! |
|
8518 |
||
8519 |
glxWindepth: gwid in: aGLXWindowId |
|
8520 |
||
8521 |
%{ /* NOCONTEXT */ |
|
8522 |
#ifdef GLX |
|
8523 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
8524 |
RETURN (__MKSMALLINT(windepth(_longVal(gwid)))); |
294 | 8525 |
#endif |
8526 |
%} |
|
8527 |
. |
|
8528 |
^ false |
|
8529 |
! |
|
8530 |
||
8531 |
glxWingetIn: aGLXWindowId |
|
8532 |
||
8533 |
%{ /* NOCONTEXT */ |
|
8534 |
#ifdef GLX |
|
8535 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
8536 |
RETURN (__MKSMALLINT(winget())); |
294 | 8537 |
#endif |
8538 |
%} |
|
8539 |
. |
|
8540 |
^ false |
|
8541 |
! |
|
8542 |
||
8543 |
glxWinmoveX: x y: y in: aGLXWindowId |
|
8544 |
||
8545 |
%{ /* NOCONTEXT */ |
|
8546 |
#ifdef GLX |
|
8547 |
SETWIN(aGLXWindowId) |
|
8548 |
winmove(_longVal(x), _longVal(y)); |
|
8549 |
RETURN (true); |
|
8550 |
#endif |
|
8551 |
%} |
|
8552 |
. |
|
8553 |
^ false |
|
8554 |
! |
|
8555 |
||
8556 |
glxWinpopIn: aGLXWindowId |
|
8557 |
||
8558 |
%{ /* NOCONTEXT */ |
|
8559 |
#ifdef GLX |
|
8560 |
SETWIN(aGLXWindowId) |
|
8561 |
winpop(); |
|
8562 |
RETURN (true); |
|
8563 |
#endif |
|
8564 |
%} |
|
8565 |
. |
|
8566 |
^ false |
|
8567 |
! |
|
8568 |
||
8569 |
glxWinpositionX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
8570 |
||
8571 |
%{ /* NOCONTEXT */ |
|
8572 |
#ifdef GLX |
|
8573 |
SETWIN(aGLXWindowId) |
|
8574 |
winposition(_longVal(x1), _longVal(y1), _longVal(x2), _longVal(y2)); |
|
8575 |
RETURN (true); |
|
8576 |
#endif |
|
8577 |
%} |
|
8578 |
. |
|
8579 |
^ false |
|
8580 |
! |
|
8581 |
||
8582 |
glxWinpushIn: aGLXWindowId |
|
8583 |
||
8584 |
%{ /* NOCONTEXT */ |
|
8585 |
#ifdef GLX |
|
8586 |
SETWIN(aGLXWindowId) |
|
8587 |
winpush(); |
|
8588 |
RETURN (true); |
|
8589 |
#endif |
|
8590 |
%} |
|
8591 |
. |
|
8592 |
^ false |
|
8593 |
! |
|
8594 |
||
8595 |
glxWinset: gwid in: aGLXWindowId |
|
8596 |
||
8597 |
%{ /* NOCONTEXT */ |
|
8598 |
#ifdef GLX |
|
8599 |
SETWIN(aGLXWindowId) |
|
8600 |
winset(_longVal(gwid)); |
|
8601 |
RETURN (true); |
|
8602 |
#endif |
|
8603 |
%} |
|
8604 |
. |
|
8605 |
^ false |
|
8606 |
! ! |
|
8607 |
||
0 | 8608 |
!GLXWorkstation methodsFor:'window creation'! |
8609 |
||
12 | 8610 |
createGLXWindowFor:aView left:xpos top:ypos width:wwidth height:wheight type:glxType |
157 | 8611 |
|ext wsuperView wsuperViewId windowId| |
0 | 8612 |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
8613 |
glOK ifFalse:[^ nil]. |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
8614 |
|
793 | 8615 |
wsuperView := aView superView view. |
0 | 8616 |
wsuperView notNil ifTrue:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8617 |
wsuperViewId := wsuperView id |
0 | 8618 |
]. |
8619 |
||
524 | 8620 |
%{ /* CALLSSTACK: 20000 */ |
0 | 8621 |
Display *dpy = myDpy; |
185 | 8622 |
int screen = __intVal(_INST(screen)); |
0 | 8623 |
Window newWindow, parentWindow; |
12 | 8624 |
int t; |
0 | 8625 |
|
97 | 8626 |
if (__isSmallInteger(xpos) && __isSmallInteger(ypos) |
8627 |
&& __isSmallInteger(wwidth) && __isSmallInteger(wheight)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8628 |
if (__isExternalAddress(wsuperViewId)) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8629 |
parentWindow = _WindowVal(wsuperViewId); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8630 |
} else { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8631 |
parentWindow = RootWindow(dpy, screen); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8632 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8633 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8634 |
if (glxType == @symbol(colorIndexSingleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8635 |
t = GLXcolorIndexSingleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8636 |
else if (glxType == @symbol(colorIndexDoubleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8637 |
t = GLXcolorIndexDoubleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8638 |
else if (glxType == @symbol(rgbSingleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8639 |
t = GLXrgbSingleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8640 |
else if (glxType == @symbol(rgbDoubleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8641 |
t = GLXrgbDoubleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8642 |
else { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8643 |
RETURN ( nil ); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8644 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8645 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8646 |
ENTERGLX; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8647 |
newWindow = __GLXCreateWindow(dpy, parentWindow, |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8648 |
__intVal(xpos), __intVal(ypos), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8649 |
__intVal(wwidth), __intVal(wheight), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8650 |
0, t); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8651 |
LEAVEGLX; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8652 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8653 |
if (! newWindow) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8654 |
RETURN ( nil ); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8655 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8656 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8657 |
windowId = __MKOBJ(newWindow); |
0 | 8658 |
} |
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
8659 |
%}. |
0 | 8660 |
windowId notNil ifTrue:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8661 |
self addKnownView:aView withId:windowId. |
0 | 8662 |
]. |
8663 |
^ windowId |
|
20 | 8664 |
! |
8665 |
||
8666 |
unlinkGLXView:aGLXWindowId |
|
8667 |
"remove X/GLX link" |
|
524 | 8668 |
|
8669 |
%{ /* CALLSSTACK: 20000 */ |
|
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
8670 |
if (__isExternalAddress(aGLXWindowId)) { |
134 | 8671 |
ENTERGLX; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8672 |
__GLXUnlinkWindow(myDpy, _WindowVal(aGLXWindowId)); |
134 | 8673 |
LEAVEGLX; |
8674 |
} |
|
20 | 8675 |
%} |
0 | 8676 |
! ! |
8677 |
||
294 | 8678 |
!GLXWorkstation methodsFor:'zbuffer'! |
8679 |
||
8680 |
glxZbsize: planes in: aGLXWindowId |
|
127 | 8681 |
|
8682 |
%{ /* NOCONTEXT */ |
|
8683 |
#ifdef FULL_GLX |
|
8684 |
SETWIN(aGLXWindowId) |
|
294 | 8685 |
zbsize(_longVal(planes)); |
8686 |
RETURN (true); |
|
8687 |
#endif |
|
8688 |
%} |
|
8689 |
. |
|
8690 |
^ false |
|
8691 |
! |
|
64 | 8692 |
|
8693 |
glxZbuffer:aBoolean in:aGLXWindowId |
|
8694 |
"enable/disable z-buffer operation" |
|
8695 |
||
8696 |
%{ /* NOCONTEXT */ |
|
8697 |
#ifdef GLX |
|
8698 |
SETWIN(aGLXWindowId) |
|
8699 |
zbuffer(aBoolean == false ? FALSE : TRUE); |
|
8700 |
RETURN (true); |
|
8701 |
#endif |
|
8702 |
%} |
|
8703 |
. |
|
8704 |
^ false |
|
294 | 8705 |
! |
64 | 8706 |
|
8707 |
glxZdraw: b in: aGLXWindowId |
|
8708 |
"enable/disable drawing into the z-buffer" |
|
8709 |
||
8710 |
%{ /* NOCONTEXT */ |
|
8711 |
#ifdef GLX |
|
8712 |
SETWIN(aGLXWindowId) |
|
8713 |
zdraw(_booleanVal(b)); |
|
8714 |
RETURN (true); |
|
8715 |
#endif |
|
8716 |
%} |
|
8717 |
. |
|
8718 |
^ false |
|
294 | 8719 |
! |
64 | 8720 |
|
8721 |
glxZfunction: func in: aGLXWindowId |
|
8722 |
"set the z-buffer comparison function. |
|
8723 |
func may be either the numeric value or a symbol (preferred)" |
|
8724 |
||
8725 |
%{ /* NOCONTEXT */ |
|
8726 |
#ifdef GLX |
|
8727 |
long f; |
|
8728 |
||
8729 |
SETWIN(aGLXWindowId) |
|
8730 |
if (func == @symbol(NEVER)) |
|
77 | 8731 |
f = ZF_NEVER; |
64 | 8732 |
else if (func == @symbol(LESS)) |
77 | 8733 |
f = ZF_LESS; |
64 | 8734 |
else if (func == @symbol(EQUAL)) |
77 | 8735 |
f = ZF_EQUAL; |
64 | 8736 |
else if (func == @symbol(LEQUAL)) |
77 | 8737 |
f = ZF_LEQUAL; |
64 | 8738 |
else if (func == @symbol(GREATER)) |
77 | 8739 |
f = ZF_GREATER; |
64 | 8740 |
else if (func == @symbol(NOTEQUAL)) |
77 | 8741 |
f = ZF_NOTEQUAL; |
64 | 8742 |
else if (func == @symbol(GEQUAL)) |
77 | 8743 |
f = ZF_GEQUAL; |
64 | 8744 |
else if (func == @symbol(ALWAYS)) |
77 | 8745 |
f = ZF_ALWAYS; |
64 | 8746 |
else |
77 | 8747 |
f = _longVal(func); |
64 | 8748 |
zfunction(f); |
8749 |
RETURN (true); |
|
8750 |
#endif |
|
8751 |
%} |
|
8752 |
. |
|
8753 |
^ false |
|
294 | 8754 |
! |
64 | 8755 |
|
8756 |
glxZsource: src in: aGLXWindowId |
|
8757 |
||
8758 |
%{ /* NOCONTEXT */ |
|
8759 |
#ifdef GLX |
|
8760 |
SETWIN(aGLXWindowId) |
|
8761 |
zsource(_longVal(src)); |
|
8762 |
RETURN (true); |
|
8763 |
#endif |
|
8764 |
%} |
|
8765 |
. |
|
8766 |
^ false |
|
294 | 8767 |
! |
64 | 8768 |
|
8769 |
glxZwritemask: mask in: aGLXWindowId |
|
8770 |
||
8771 |
%{ /* NOCONTEXT */ |
|
8772 |
#ifdef GLX |
|
8773 |
SETWIN(aGLXWindowId) |
|
185 | 8774 |
zwritemask((ulong)__intVal(mask)); |
64 | 8775 |
RETURN (true); |
8776 |
#endif |
|
8777 |
%} |
|
8778 |
. |
|
8779 |
^ false |
|
8780 |
! ! |
|
8781 |
||
294 | 8782 |
!GLXWorkstation class methodsFor:'documentation'! |
8783 |
||
8784 |
version |
|
5479
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
8785 |
^ '$Header: /cvs/stx/stx/libview/GLXWorkstation.st,v 1.85 2009-11-05 14:37:38 stefan Exp $' |
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
8786 |
! |
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
8787 |
|
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
8788 |
version_CVS |
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
8789 |
^ '$Header: /cvs/stx/stx/libview/GLXWorkstation.st,v 1.85 2009-11-05 14:37:38 stefan Exp $' |
89 | 8790 |
! ! |