author | Stefan Vogel <sv@exept.de> |
Tue, 11 May 2004 10:01:01 +0200 | |
changeset 4169 | 35c1ee146ffb |
parent 4164 | 390662205891 |
child 4251 | ae0f46130d9f |
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 |
" |
|
12 |
||
3214 | 13 |
"{ Package: 'stx:libview' }" |
14 |
||
0 | 15 |
XWorkstation subclass:#GLXWorkstation |
528 | 16 |
instanceVariableNames:'activeWindow hasStereoExtension glOK' |
17 |
classVariableNames:'ForceGL' |
|
18 |
poolDictionaries:'' |
|
19 |
category:'Interface-Graphics' |
|
294 | 20 |
! |
77 | 21 |
|
89 | 22 |
!GLXWorkstation primitiveDefinitions! |
0 | 23 |
%{ |
24 | 24 |
/* |
25 |
* on SGI, this class is compiled with -DGLX, while |
|
29 | 26 |
* for simulation (using vogl), this is compiled with -DVGL |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
27 |
* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
28 |
* New note: starting to support openGL (tm) (compile with -DOPENGL) |
1932 | 29 |
* or its simulation (compile with -DMESA) |
24 | 30 |
*/ |
29 | 31 |
|
0 | 32 |
/* |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
33 |
* SAD, SAD: |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
34 |
* 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
|
35 |
* some include the functions below, others dont. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
36 |
* To avoid getting undefined symbol errors when linking, these |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
37 |
* functions are not included by default. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
38 |
* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
39 |
* 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
|
40 |
* the following: |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
41 |
* |
46 | 42 |
* blendcolor getgconfig getmultisample leftbuffer rightbuffer monobuffer |
43 |
* msalpha msmask mspattern mssize multisample stereobuffer |
|
44 |
* t3s t3i t3f t3d t4s t4i t4f t4d tlutbind zbsize |
|
45 |
* |
|
46 |
* these are not available on all gl's |
|
47 |
*/ |
|
48 |
||
1932 | 49 |
#ifdef GLX |
46 | 50 |
/* #define FULL_GLX */ |
1932 | 51 |
#endif |
46 | 52 |
|
53 |
/* |
|
554
34cc776bcc0f
compilable with String/Object definition
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
54 |
* 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
|
55 |
* ... and xlib defines True and False |
554
34cc776bcc0f
compilable with String/Object definition
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
56 |
* It might be a better idea, to completely separate GLX stuff from ST/X |
0 | 57 |
*/ |
1899 | 58 |
#ifdef String |
59 |
# undef String |
|
60 |
#endif |
|
61 |
#define String GLX_String |
|
62 |
||
63 |
#ifdef Object |
|
64 |
# undef Object |
|
65 |
#endif |
|
66 |
#define Object GLX_Object |
|
67 |
||
68 |
#undef True |
|
69 |
#undef False |
|
70 |
||
2768 | 71 |
#ifdef Time |
72 |
# undef Time |
|
73 |
#endif |
|
74 |
#define Time X_Time |
|
75 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
76 |
|
1899 | 77 |
#ifdef __VMS__ |
78 |
# include "vms_Xnames.h" |
|
79 |
#endif |
|
24 | 80 |
|
168 | 81 |
#include <stdio.h> |
82 |
||
1932 | 83 |
#ifndef OPENGL |
84 |
# ifdef MESA |
|
85 |
# define OPENGL |
|
86 |
# endif |
|
87 |
#endif |
|
88 |
||
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
89 |
#ifdef OPENGL /* SGI or others OPENGL library */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
90 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
91 |
# include "GL/gl.h" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
92 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
93 |
# ifdef MESA /* GNU MESA openGL simulation */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
94 |
# include "GL/xmesa.h" |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
95 |
# define OPENGLCONTEXT XMesaContext |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
96 |
# define GLXMAKECURRENT(dpy, draw, con) XMesaMakeCurrent(con) |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
97 |
# else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
98 |
/* 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
|
99 |
# define OPENGLCONTEXT GLXContext |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
100 |
# 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
|
101 |
# endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
102 |
|
24 | 103 |
#else |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
104 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
105 |
# ifdef GLX /* SGI's GL library */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
106 |
# include <gl/glws.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
107 |
# include <gl/sphere.h> |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
108 |
# else /* VOGL GL simulation */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
109 |
# undef memset |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
110 |
# include <vogl.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
111 |
# undef move |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
112 |
# include <X11/Xlib.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
113 |
# endif |
24 | 114 |
#endif |
0 | 115 |
|
185 | 116 |
/* |
117 |
* XSGIStereo extension - if available |
|
118 |
*/ |
|
119 |
#ifdef XSGIStereo |
|
120 |
# include <X11/extensions/SGIStereo.h> |
|
121 |
#endif |
|
122 |
||
35 | 123 |
#ifndef NULL |
58 | 124 |
# define NULL (char *)0 /* sigh */ |
35 | 125 |
#endif |
126 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
127 |
|
0 | 128 |
typedef enum { |
129 |
GLXcolorIndexSingleBuffer, |
|
130 |
GLXcolorIndexDoubleBuffer, |
|
131 |
GLXrgbSingleBuffer, |
|
132 |
GLXrgbDoubleBuffer |
|
133 |
} GLXWindowType; |
|
134 |
||
333 | 135 |
# define ENTERGLX __BEGIN_PROTECT_REGISTERS__ |
136 |
# define LEAVEGLX __END_PROTECT_REGISTERS__ |
|
134 | 137 |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
138 |
/* |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
139 |
* 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
|
140 |
*/ |
0 | 141 |
#undef String |
969 | 142 |
#ifdef __DEF_String |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
143 |
# define String __DEF_String |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
144 |
#endif |
969 | 145 |
#undef Object |
146 |
#ifdef __DEF_Object |
|
147 |
# define Object __DEF_Object |
|
148 |
#endif |
|
0 | 149 |
|
150 |
/* |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
151 |
* mhmh - openGL has its separate gl-context, |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
152 |
* which is distinct (?) from the windowID. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
153 |
* We dont want to add another instvar to View - do we ? |
0 | 154 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
155 |
#if defined(OPENGL) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
156 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
157 |
# ifndef MAX_OPENGL_VIEWS |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
158 |
# define MAX_OPENGL_VIEWS 50 |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
159 |
# endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
160 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
161 |
struct windowIDToGLContextMapping { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
162 |
Window win; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
163 |
OPENGLCONTEXT con; |
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 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
166 |
static struct windowIDToGLContextMapping windowIDToGLContextMapping[MAX_OPENGL_VIEWS]; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
167 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
168 |
static OPENGLCONTEXT |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
169 |
__glxWindowIdToGLContext(xId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
170 |
Window xId; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
171 |
{ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
172 |
int i; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
173 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
174 |
for (i=0; i<MAX_OPENGL_VIEWS; i++) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
175 |
if (windowIDToGLContextMapping[i].win == xId) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
176 |
return windowIDToGLContextMapping[i].con; |
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 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
179 |
return (OPENGLCONTEXT) 0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
180 |
} |
0 | 181 |
|
157 | 182 |
/* |
183 |
* set the GLXWindow for followup drawing |
|
184 |
*/ |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
185 |
#define SETWIN(aGLXWindowId) \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
186 |
{ \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
187 |
OPENGLCONTEXT context; \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
188 |
\ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
189 |
if (_INST(activeWindow) != aGLXWindowId) { \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
190 |
if (! ISCONNECTED ) { \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
191 |
RETURN (false); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
192 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
193 |
if (! __isExternalAddress(aGLXWindowId)) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
194 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
195 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
196 |
context = (OPENGLCONTEXT) __glxWindowIdToGLContext(_WindowVal(aGLXWindowId)); \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
197 |
if (! context) { \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
198 |
RETURN (false); \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
199 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
200 |
GLXMAKECURRENT(myDpy, _WindowVal(aGLXWindowId), context ); \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
201 |
_INST(activeWindow) = aGLXWindowId; \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
202 |
__STORE(self, aGLXWindowId); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
203 |
} else { \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
204 |
if (aGLXWindowId == nil) { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
205 |
RETURN (false); \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
206 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
207 |
} \ |
12 | 208 |
} |
209 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
210 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
211 |
#else /* old GL */ |
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 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
214 |
* set the GLXWindow for followup drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
215 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
216 |
#define SETWIN(aGLXWindowId) \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
217 |
{ \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
218 |
if (_INST(activeWindow) != aGLXWindowId) { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
219 |
if (! ISCONNECTED ) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
220 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
221 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
222 |
if (! __isExternalAddress(aGLXWindowId)) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
223 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
224 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
225 |
if (GLXwinset(myDpy, _WindowVal(aGLXWindowId)) < 0) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
226 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
227 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
228 |
_INST(activeWindow) = aGLXWindowId; \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
229 |
__STORE(self, aGLXWindowId); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
230 |
} else { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
231 |
if (aGLXWindowId == nil) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
232 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
233 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
234 |
} \ |
553
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 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
237 |
#endif /* old GL */ |
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 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
240 |
* some defines - tired of typing ... |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
241 |
* 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
|
242 |
* put/pack them into corresponding c variables. |
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 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
245 |
#ifdef OPENGL |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
246 |
# define Boolean int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
247 |
# define TRUE 1 |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
248 |
# define FALSE 0 |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
249 |
# define Coord float |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
250 |
# define Icoord int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
251 |
# define Scoord int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
252 |
# define Colorindex int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
253 |
# define Linestyle int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
254 |
# define Offset int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
255 |
# define Angle int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
256 |
# define Screencoord int |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
257 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
258 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
259 |
#define myDpy (Display *)(__MKCP(_INST(displayId))) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
260 |
#define ISCONNECTED (_INST(displayId) != nil) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
261 |
#define _WindowVal(o) (Window)(__MKCP(o)) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
262 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
263 |
#define __MKBOOLEAN(b) ((b==FALSE) ? false : true) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
264 |
#define _booleanVal(b) ((b==false) ? (Boolean)FALSE : (Boolean)TRUE) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
265 |
#define _coordVal(c) ((__isFloat(c)) ? (Coord)(_floatVal(c)) : (Coord)(__intVal(c))) |
185 | 266 |
#define _icoordVal(c) ((Icoord)(__intVal(c))) |
267 |
#define _scoordVal(c) ((Scoord)(__intVal(c))) |
|
268 |
#define _screencoordVal(c) ((Screencoord)(__intVal(c))) |
|
269 |
#define _colorindexVal(c) ((Colorindex)(__intVal(c))) |
|
270 |
#define _linestyleVal(l) ((Linestyle)(__intVal(l))) |
|
271 |
#define _shortVal(l) ((short)(__intVal(l))) |
|
272 |
#define _longVal(l) ((long)(__intVal(l))) |
|
273 |
#define _deviceVal(l) ((Device)(__intVal(l))) |
|
274 |
#define _tagVal(l) ((Tag)(__intVal(l))) |
|
969 | 275 |
#define _objectVal(l) ((GLX_Object)(__intVal(l))) |
185 | 276 |
#define _offsetVal(l) ((Offset)(__intVal(l))) |
277 |
#define _rgbVal(l) ((RGBvalue)(__intVal(l))) |
|
278 |
#define _angleVal(c) ((Angle)(__intVal(c))) |
|
157 | 279 |
|
29 | 280 |
/* |
281 |
* 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
|
282 |
* ST-object must be true or false. Return from method if invalid. |
29 | 283 |
*/ |
284 |
#define _BOOLEAN_(arg, dst) \ |
|
30 | 285 |
if (arg==true) \ |
77 | 286 |
dst = (Boolean)TRUE; \ |
30 | 287 |
else if (arg==false) \ |
77 | 288 |
dst = (Boolean)FALSE; \ |
29 | 289 |
else { RETURN(false); } |
290 |
||
291 |
/* |
|
292 |
* check for and fetch a coord from ST-arg into C-dst |
|
157 | 293 |
* ST-object must be Float, SmallInteger or Fraction. |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
294 |
* Return from method if invalid. |
29 | 295 |
*/ |
0 | 296 |
#define _COORD_(arg, dst) \ |
97 | 297 |
if (__isFloat(arg)) \ |
77 | 298 |
dst = (Coord)(_floatVal(arg)); \ |
97 | 299 |
else if (__isSmallInteger(arg)) \ |
185 | 300 |
dst = (Coord)(__intVal(arg)); \ |
97 | 301 |
else if (__isFraction(arg) \ |
302 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_numerator) \ |
|
303 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_denominator)) { \ |
|
77 | 304 |
float n, d; \ |
305 |
\ |
|
185 | 306 |
n = (float)(__intVal(_FractionInstPtr(arg)->f_numerator)); \ |
307 |
d = (float)(__intVal(_FractionInstPtr(arg)->f_denominator)); \ |
|
77 | 308 |
dst = (Coord)(n / d); \ |
29 | 309 |
} else { RETURN(false); } |
310 |
||
311 |
/* |
|
312 |
* check for and fetch an icoord from ST-arg into C-dst |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
313 |
* ST-object must be SmallInteger. Return from method if invalid. |
29 | 314 |
*/ |
315 |
#define _ICOORD_(arg, dst) \ |
|
97 | 316 |
if (__isSmallInteger(arg)) \ |
185 | 317 |
dst = (Icoord)(__intVal(arg)); \ |
29 | 318 |
else { RETURN(false); } |
319 |
||
320 |
/* |
|
157 | 321 |
* check for and fetch an scoord from ST-arg into C-dst |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
322 |
* ST-object must be SmallInteger. Return from method if invalid. |
29 | 323 |
*/ |
324 |
#define _SCOORD_(arg, dst) \ |
|
97 | 325 |
if (__isSmallInteger(arg)) \ |
185 | 326 |
dst = (Scoord)(__intVal(arg)); \ |
29 | 327 |
else { RETURN(false); } |
328 |
||
329 |
#define _SCREENCOORD_(arg, dst) \ |
|
97 | 330 |
if (__isSmallInteger(arg)) \ |
185 | 331 |
dst = (Screencoord)(__intVal(arg)); \ |
29 | 332 |
else { RETURN(false); } |
333 |
||
334 |
#define _COLORINDEX_(arg, dst) \ |
|
97 | 335 |
if (__isSmallInteger(arg)) \ |
185 | 336 |
dst = (Colorindex)(__intVal(arg)); \ |
29 | 337 |
else { RETURN(false); } |
338 |
||
339 |
#define _ANGLE_(arg, dst) \ |
|
97 | 340 |
if (__isSmallInteger(arg)) \ |
185 | 341 |
dst = (Angle)(__intVal(arg)); \ |
29 | 342 |
else { RETURN(false); } |
0 | 343 |
|
344 |
#define _FLOAT_(arg, dst) \ |
|
97 | 345 |
if (__isFloat(arg)) \ |
77 | 346 |
dst = (float)(_floatVal(arg)); \ |
97 | 347 |
else if (__isSmallInteger(arg)) \ |
185 | 348 |
dst = (float)(__intVal(arg)); \ |
97 | 349 |
else if (__isFraction(arg) \ |
350 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_numerator) \ |
|
351 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_denominator)) { \ |
|
77 | 352 |
float n, d; \ |
353 |
\ |
|
185 | 354 |
n = (float)(__intVal(_FractionInstPtr(arg)->f_numerator)); \ |
355 |
d = (float)(__intVal(_FractionInstPtr(arg)->f_denominator)); \ |
|
77 | 356 |
dst = (float)(n / d); \ |
29 | 357 |
} else { RETURN(false); } |
0 | 358 |
|
359 |
#define _INT_(arg, dst) \ |
|
97 | 360 |
if (__isSmallInteger(arg)) \ |
185 | 361 |
dst = (int)(__intVal(arg)); \ |
29 | 362 |
else { RETURN(false); } |
363 |
||
30 | 364 |
#define _indexedArea(object) \ |
365 |
(((char *) (_InstPtr(object))) \ |
|
77 | 366 |
+ OHDR_SIZE \ |
185 | 367 |
+ (__intVal(_ClassInstPtr(__qClass(object))->c_ninstvars)) * sizeof(OBJ)) |
77 | 368 |
%} |
369 |
! ! |
|
370 |
||
168 | 371 |
!GLXWorkstation primitiveVariables! |
372 |
%{ |
|
373 |
/* |
|
374 |
* remembered info from private error handler |
|
375 |
*/ |
|
4164
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
376 |
static char lastErrorMsg[128] = ""; |
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
377 |
static unsigned INT lastRequestCode = 0; |
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
378 |
static unsigned INT lastMinorCode = 0; |
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
379 |
static unsigned INT lastResource = 0; |
168 | 380 |
|
381 |
%} |
|
382 |
! ! |
|
383 |
||
89 | 384 |
!GLXWorkstation primitiveFunctions! |
77 | 385 |
%{ |
151 | 386 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
387 |
#ifdef DYNAMICALLY_LOADABLE |
168 | 388 |
/* |
389 |
* catch X-errors and forward as errorInterrupt:#DisplayError, |
|
390 |
* (which itself invokes my handler and optionally raises an exceptionSignal) |
|
391 |
* the implementation below is somewhat wrong: it will |
|
392 |
* report all errors for Display, even though there could be |
|
393 |
* more than one display connection. (being fixed, new errorInterrupt mechanism |
|
394 |
* allows passing an additional argument, which is the displayID ...) |
|
395 |
* |
|
396 |
* this dublicates the functionality as found in XWorkstation; |
|
397 |
* the reason is to allow dynamic loading systems to load this module |
|
398 |
* before XWorkstation (which was not possible otherwise, due to unresolved |
|
399 |
* external references while loading this one) |
|
400 |
*/ |
|
401 |
static |
|
402 |
__XErrorHandler__(dpy, event) |
|
403 |
Display *dpy; |
|
404 |
XErrorEvent *event; |
|
405 |
{ |
|
406 |
XGetErrorText(dpy, event->error_code, lastErrorMsg, 80); |
|
407 |
if (lastErrorMsg[0] == '\0') { |
|
185 | 408 |
sprintf(lastErrorMsg, "code: %d", event->error_code); |
168 | 409 |
} |
410 |
lastRequestCode = event->request_code; |
|
411 |
lastMinorCode = event->minor_code; |
|
412 |
lastResource = event->resourceid; |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
413 |
if ((event->error_code == BadWindow) && (lastRequestCode == 4) && (lastMinorCode == 0)) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
414 |
/* |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
415 |
* this is a BadWindow error for X_DestroyWindow. |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
416 |
* ignore it here, since it results from the GC freeing windows |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
417 |
* in non bottom-up window order. |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
418 |
*/ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
419 |
return 0; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
420 |
} |
168 | 421 |
|
218
10072d9beba5
can now turn off Xlib error messages from the errorHandler
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
422 |
if (@global(ErrorPrinting) == true) { |
1932 | 423 |
fprintf(stderr, "GLXWORKSTAT: x-error caught maj=%d (0x%x) min=%d (0x%x) resource=%x\n", |
219
9ff0660f447f
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
218
diff
changeset
|
424 |
event->request_code, event->request_code, |
9ff0660f447f
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
218
diff
changeset
|
425 |
event->minor_code, event->minor_code, event->resourceid); |
1932 | 426 |
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
|
427 |
} |
168 | 428 |
|
207
9124817bbb03
use new c-pointer wrapper macros (based on externalAddress)
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
429 |
__errorInterruptWithIDAndParameter__(@symbol(DisplayError), __MKOBJ(dpy)); |
168 | 430 |
return 0; |
431 |
} |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
432 |
#else |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
433 |
extern __XErrorHandler__(); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
434 |
#endif |
168 | 435 |
|
151 | 436 |
/* |
437 |
* begin moved from GLXsupport.c |
|
438 |
*/ |
|
439 |
||
440 |
/* |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
441 |
* This provides a helper function "GLXCreateWindow", which does |
151 | 442 |
* all the necessary magic to create an X window suitable for GL drawing |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
443 |
* to take place within. See the definition of GLXCreateWindow for a |
151 | 444 |
* description of how to call it. |
445 |
* |
|
446 |
* claus: I really had no time to look into all this, |
|
447 |
* this file has been just copied from a 4Dgifts demo .. |
|
448 |
* (will need more than a day to show more ...) |
|
449 |
*/ |
|
1932 | 450 |
#if !defined(OPENGL) |
151 | 451 |
|
1899 | 452 |
# include <X11/Xlib.h> |
453 |
# include <X11/Xutil.h> |
|
454 |
# ifndef VGL |
|
455 |
# include <gl/glws.h> |
|
456 |
# endif |
|
457 |
# include <signal.h> |
|
458 |
# include <setjmp.h> |
|
459 |
# include "stcIntern.h" |
|
151 | 460 |
|
461 |
/* |
|
462 |
* glxhelper.h: |
|
463 |
* |
|
464 |
* List of drawing modes supported by GLXCreateWindow (in glxhelper.c). |
|
465 |
* More than this are possible with mixed model, but this is just an |
|
466 |
* example. You can either expand this list (and the corresponding code in |
|
467 |
* GLXCreateWindow) or call the mixed model calls yourself, using |
|
468 |
* GLXCreateWindow as an example. |
|
469 |
*/ |
|
470 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
471 |
static char * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
472 |
typeToName[] = { |
151 | 473 |
"color index single buffer", |
474 |
"color index double buffer", |
|
475 |
"rgb single buffer", |
|
476 |
"rgb double buffer", |
|
477 |
}; |
|
478 |
||
1932 | 479 |
#endif /* GLX || VGL */ |
480 |
||
481 |
#if defined(GLX) && !defined(VGL) |
|
151 | 482 |
/* |
483 |
* Dorky little helper function used to build up a GLXconfig array. |
|
484 |
*/ |
|
485 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
486 |
static void |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
487 |
set_entry (GLXconfig* ptr, int b, int m, int a) |
151 | 488 |
{ |
489 |
ptr->buffer = b; |
|
490 |
ptr->mode = m; |
|
491 |
ptr->arg = a; |
|
492 |
} |
|
1932 | 493 |
#endif /* GLX & not VGL */ |
151 | 494 |
|
495 |
static JMP_BUF errorReturn; |
|
496 |
||
497 |
static void |
|
498 |
glAbort() { |
|
499 |
longjmp(errorReturn, 1); |
|
500 |
} |
|
501 |
||
502 |
/* |
|
503 |
* GLXCreateWindow(dpy, parent, x, y, w, h, boderWidth, type) |
|
504 |
* |
|
505 |
* Return value is the X window id of the newly created window. |
|
506 |
* |
|
507 |
* Arguments are: |
|
508 |
* dpy The X "Display*" returned by XOpenDisplay |
|
509 |
* parent The parent of the newly created window, |
|
510 |
* a typical value for this is |
|
511 |
* RootWindow(dpy, DefaultScreen(dpy)) |
|
512 |
* x,y The location of the window to be created, |
|
513 |
* y coordinate is measured from the top down. |
|
514 |
* w,h size of the new window |
|
515 |
* borderWidth the X border size for this window, should probably |
|
516 |
* be zero. |
|
517 |
* type the GLXWindowType (see glxhelper.h) desribing the |
|
518 |
* typer of GL drawing to be done in this window |
|
519 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
520 |
Window |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
521 |
__GLXCreateWindow(dpy, parent, x, y, w, h, borderWidth, type) |
151 | 522 |
Display* dpy; |
523 |
Window parent; |
|
524 |
GLXWindowType type; |
|
525 |
{ |
|
1932 | 526 |
#if !defined(OPENGL) |
527 |
# ifndef VGL |
|
151 | 528 |
GLXconfig params[50]; |
529 |
GLXconfig* next; |
|
530 |
GLXconfig* retconfig; |
|
531 |
Colormap cmap = DefaultColormap(dpy, DefaultScreen(dpy)); |
|
1932 | 532 |
# endif |
533 |
#endif |
|
534 |
Visual visual; |
|
151 | 535 |
XVisualInfo *vis; |
536 |
XVisualInfo template; |
|
537 |
XColor white; |
|
538 |
XSetWindowAttributes cwa; |
|
539 |
XWindowAttributes pwa; |
|
540 |
int scr, i, nret; |
|
541 |
Window win; |
|
1932 | 542 |
#ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
543 |
struct sigaction oldSig, newSig; |
1932 | 544 |
#else |
151 | 545 |
void *oldSig; |
1932 | 546 |
#endif |
547 |
||
548 |
#if !defined(OPENGL) |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
549 |
__catchExit(1); |
1932 | 550 |
#endif |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
551 |
|
151 | 552 |
if (setjmp(errorReturn)) { |
3468 | 553 |
fprintf(stderr, "hard error in GL - return\n"); |
1932 | 554 |
#ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
555 |
sigaction(SIGSEGV, &oldSig, 0); |
1932 | 556 |
#else |
151 | 557 |
signal(SIGSEGV, oldSig); |
1932 | 558 |
#endif |
559 |
#if !defined(OPENGL) |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
560 |
__catchExit(0); |
1932 | 561 |
#endif |
151 | 562 |
return 0; |
563 |
} |
|
564 |
__CONT__ |
|
565 |
||
1932 | 566 |
if (w <= 0) { |
3468 | 567 |
fprintf(stderr, "GL: bad width: %d\n", w); |
1932 | 568 |
w = 1; |
569 |
} |
|
570 |
if (h <= 0) { |
|
3468 | 571 |
fprintf(stderr, "GL: bad height: %d\n", h); |
1932 | 572 |
h = 1; |
573 |
} |
|
574 |
||
575 |
#if !defined(OPENGL) |
|
1899 | 576 |
# ifdef VGL |
151 | 577 |
/* |
578 |
* I know what VGL supports; its somewhat unclean to hard code it here |
|
579 |
*/ |
|
580 |
switch (type) { |
|
581 |
case GLXcolorIndexSingleBuffer: |
|
582 |
case GLXcolorIndexDoubleBuffer: |
|
583 |
break; |
|
584 |
||
585 |
case GLXrgbSingleBuffer: |
|
586 |
case GLXrgbDoubleBuffer: |
|
3468 | 587 |
fprintf(stderr, "Sorry, VGL can't support %s type of windows\n", typeToName[type]); |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
588 |
__catchExit(0); |
151 | 589 |
return 0; |
590 |
} |
|
591 |
||
592 |
scr = DefaultScreen(dpy); |
|
593 |
visual.visualid = CopyFromParent; |
|
594 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
595 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
596 |
borderWidth, DisplayPlanes(dpy, scr), |
|
597 |
InputOutput, &visual, |
|
598 |
CWBorderPixel, &cwa); |
|
599 |
||
600 |
/* |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
601 |
* on some, seg-violations occur in the GL, if too many |
151 | 602 |
* views are created ... just to make certain, we catch those |
603 |
* in GL too. |
|
604 |
*/ |
|
1899 | 605 |
# ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
606 |
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
|
607 |
newSig = oldSig; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
608 |
newSig.sa_handler = glAbort; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
609 |
sigaction(SIGSEGV, &newSig, (struct sigaction *)0); |
1899 | 610 |
# else |
151 | 611 |
oldSig = signal(SIGSEGV, glAbort); |
1899 | 612 |
# endif |
151 | 613 |
i = GLXlink(dpy, win); |
1899 | 614 |
# ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
615 |
sigaction(SIGSEGV, &oldSig, (struct sigaction *)0); |
1899 | 616 |
# else |
151 | 617 |
signal(SIGSEGV, oldSig); |
1899 | 618 |
# endif |
151 | 619 |
|
620 |
if (i < 0) { |
|
3468 | 621 |
fprintf(stderr, "GLXlink returned %d\n", i); |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
622 |
__catchExit(0); |
151 | 623 |
return 0; |
624 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
625 |
|
1899 | 626 |
# else /* not VGL */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
627 |
|
151 | 628 |
/* |
629 |
* This builds an array in "params" that describes for GLXgetconfig(3G) |
|
630 |
* the type of GL drawing that will be done. |
|
631 |
*/ |
|
632 |
next = params; |
|
633 |
switch (type) { |
|
634 |
case GLXcolorIndexSingleBuffer: |
|
635 |
set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE); |
|
636 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE); |
|
637 |
break; |
|
638 |
case GLXcolorIndexDoubleBuffer: |
|
639 |
set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE); |
|
640 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE); |
|
641 |
break; |
|
642 |
case GLXrgbSingleBuffer: |
|
643 |
set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE); |
|
644 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE); |
|
645 |
break; |
|
646 |
case GLXrgbDoubleBuffer: |
|
647 |
set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE); |
|
648 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE); |
|
649 |
break; |
|
650 |
} |
|
651 |
set_entry(next, 0, 0, 0); /* The input to GLXgetconfig is null terminated */ |
|
652 |
||
653 |
/* |
|
654 |
* Get configuration data for a window based on above parameters |
|
655 |
* First we have to find out which screen the parent window is on, |
|
656 |
* then we can call GXLgetconfig() |
|
657 |
*/ |
|
658 |
XGetWindowAttributes(dpy, parent, &pwa); |
|
659 |
retconfig = GLXgetconfig(dpy, XScreenNumberOfScreen(pwa.screen), params); |
|
660 |
if (retconfig == 0) { |
|
3468 | 661 |
fprintf(stderr, "Sorry, can't support %s type of windows\n", typeToName[type]); |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
662 |
__catchExit(0); |
151 | 663 |
return 0; |
664 |
} |
|
665 |
||
666 |
/* |
|
667 |
* Scan through config info, pulling info needed to create a window |
|
668 |
* that supports the rendering mode. |
|
669 |
*/ |
|
670 |
for (next = retconfig; next->buffer; next++) { |
|
671 |
unsigned long buffer = next->buffer; |
|
672 |
unsigned long mode = next->mode; |
|
673 |
unsigned long value = next->arg; |
|
674 |
switch (mode) { |
|
675 |
case GLX_COLORMAP: |
|
676 |
if (buffer == GLX_NORMAL) { |
|
677 |
cmap = value; |
|
678 |
} |
|
679 |
break; |
|
680 |
case GLX_VISUAL: |
|
681 |
if (buffer == GLX_NORMAL) { |
|
682 |
template.visualid = value; |
|
683 |
template.screen = DefaultScreen(dpy); |
|
684 |
vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask, |
|
685 |
&template, &nret); |
|
686 |
} |
|
687 |
break; |
|
688 |
} |
|
689 |
} |
|
690 |
||
691 |
/* |
|
692 |
* Create the window |
|
693 |
*/ |
|
694 |
cwa.colormap = cmap; |
|
695 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
696 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
697 |
borderWidth, vis->depth, InputOutput, vis->visual, |
|
698 |
CWColormap|CWBorderPixel, &cwa); |
|
699 |
||
700 |
/* |
|
701 |
* Rescan configuration info and find window slot that getconfig |
|
702 |
* provided. Fill it in with the window we just created. |
|
703 |
*/ |
|
704 |
for (next = retconfig; next->buffer; next++) { |
|
705 |
if ((next->buffer == GLX_NORMAL) && (next->mode == GLX_WINDOW)) { |
|
706 |
next->arg = win; |
|
707 |
break; |
|
708 |
} |
|
709 |
} |
|
710 |
||
711 |
/* |
|
712 |
* Now "retconfig" contains all the information the GL needs to |
|
713 |
* configure the window and its own internal state. |
|
714 |
*/ |
|
715 |
/* |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
716 |
* on iris, seg-violations occur in the GL, if too many |
151 | 717 |
* views are created ... |
718 |
*/ |
|
1899 | 719 |
# ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
720 |
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
|
721 |
newSig = oldSig; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
722 |
newSig.sa_handler = glAbort; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
723 |
sigaction(SIGSEGV, &newSig, (struct sigaction *)0); |
1899 | 724 |
# else |
151 | 725 |
oldSig = signal(SIGSEGV, glAbort); |
1899 | 726 |
# endif |
151 | 727 |
i = GLXlink(dpy, retconfig); |
1899 | 728 |
# ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
729 |
sigaction(SIGSEGV, &oldSig, (struct sigaction *)0); |
1899 | 730 |
# else |
151 | 731 |
signal(SIGSEGV, oldSig); |
1899 | 732 |
# endif |
151 | 733 |
|
734 |
if (i < 0) { |
|
3468 | 735 |
fprintf(stderr, "GLXlink returned %d\n", i); |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
736 |
__catchExit(0); |
151 | 737 |
return 0; |
738 |
} |
|
739 |
||
740 |
/* |
|
741 |
* The GL sets its own X error handlers, which exits - this is not what we want |
|
742 |
*/ |
|
743 |
XSetErrorHandler(__XErrorHandler__); |
|
1899 | 744 |
# endif /* not VGL */ |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
745 |
__catchExit(0); |
1932 | 746 |
|
747 |
#else /* OPENGL | MESA */ |
|
748 |
||
749 |
scr = DefaultScreen(dpy); |
|
750 |
visual.visualid = CopyFromParent; |
|
751 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
752 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
753 |
borderWidth, DisplayPlanes(dpy, scr), |
|
754 |
InputOutput, &visual, |
|
755 |
CWBorderPixel, &cwa); |
|
756 |
||
757 |
vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask, &visual, &nret); |
|
3468 | 758 |
fprintf(stderr, "vis is %x\n", vis); |
1932 | 759 |
#endif /* GLX || VGL */ |
760 |
||
151 | 761 |
return win; |
762 |
} |
|
763 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
764 |
__GLXUnlinkWindow(dpy, win) |
151 | 765 |
Display* dpy; |
766 |
Window win; |
|
767 |
{ |
|
768 |
/* |
|
769 |
* only needed for VGL - GLX does it automatically |
|
770 |
*/ |
|
1932 | 771 |
#ifdef VGL |
151 | 772 |
GLXunlink(dpy, win); |
1932 | 773 |
#endif |
151 | 774 |
} |
775 |
||
29 | 776 |
/* |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
777 |
* helper for rotation - calls rot() |
29 | 778 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
779 |
OBJ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
780 |
__glx_doRotate(angle, axis) |
29 | 781 |
OBJ angle; |
782 |
char axis; |
|
783 |
{ |
|
784 |
float f_angle; |
|
785 |
||
35 | 786 |
if (__isFloat(angle)) { |
77 | 787 |
f_angle = (float)(_floatVal(angle)); |
1932 | 788 |
if (f_angle != 0.0) { |
789 |
#ifdef OPENGL |
|
790 |
#else |
|
77 | 791 |
rot(f_angle, axis); |
1932 | 792 |
#endif |
793 |
} |
|
77 | 794 |
return (true); |
29 | 795 |
} |
35 | 796 |
if (__isFraction(angle) |
97 | 797 |
&& __isSmallInteger(_FractionInstPtr(angle)->f_numerator) |
798 |
&& __isSmallInteger(_FractionInstPtr(angle)->f_denominator)) { |
|
77 | 799 |
float n, d; |
800 |
||
185 | 801 |
n = (float)(__intVal(_FractionInstPtr(angle)->f_numerator)); |
802 |
d = (float)(__intVal(_FractionInstPtr(angle)->f_denominator)); |
|
77 | 803 |
f_angle = n / d; |
1932 | 804 |
if (f_angle != 0.0) { |
805 |
#ifdef OPENGL |
|
806 |
#else |
|
77 | 807 |
rot(f_angle, axis); |
1932 | 808 |
#endif |
809 |
} |
|
77 | 810 |
return (true); |
29 | 811 |
} |
97 | 812 |
if (__isSmallInteger(angle)) { |
185 | 813 |
f_angle = (float)(__intVal(angle)); |
1932 | 814 |
if (f_angle != 0.0) { |
815 |
#ifdef OPENGL |
|
816 |
#else |
|
77 | 817 |
rot(f_angle, axis); |
1932 | 818 |
#endif |
819 |
} |
|
77 | 820 |
return (true); |
29 | 821 |
} |
822 |
return false; |
|
823 |
} |
|
0 | 824 |
|
24 | 825 |
/* |
29 | 826 |
* fetch integers from an st-array (elements must be smallIntegers) |
827 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
828 |
long * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
829 |
__glx_getLongsFromInto(obj, vec, count) |
29 | 830 |
OBJ obj; |
831 |
long *vec; |
|
832 |
{ |
|
833 |
OBJ cls, o; |
|
834 |
int nByte, i, ninstVars, nInstBytes; |
|
835 |
char *pElem; |
|
836 |
||
837 |
if (! _isNonNilObject(obj)) return (long *)NULL; |
|
134 | 838 |
cls = __qClass(obj); |
185 | 839 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 840 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 841 |
nByte = __qSize(obj) - nInstBytes; |
29 | 842 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
843 |
if (nByte < (count * sizeof(OBJ))) return (long *)NULL; |
|
844 |
for (i=0; i<count; i++) { |
|
77 | 845 |
o = *(OBJ *)pElem; |
97 | 846 |
if (! __isSmallInteger(o)) return (long *)NULL; |
185 | 847 |
vec[i] = (long)__intVal(o); |
77 | 848 |
pElem += sizeof(OBJ); |
29 | 849 |
} |
850 |
return vec; |
|
851 |
} |
|
852 |
||
853 |
/* |
|
854 |
* fetch shorts from an st-array (elements must be smallIntegers) |
|
855 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
856 |
short * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
857 |
__glx_getShortsFromInto(obj, vec, count) |
29 | 858 |
OBJ obj; |
859 |
short *vec; |
|
860 |
{ |
|
861 |
OBJ cls, o; |
|
862 |
int nByte, i, ninstVars, nInstBytes; |
|
863 |
char *pElem; |
|
864 |
||
865 |
if (! _isNonNilObject(obj)) return (short *)NULL; |
|
134 | 866 |
cls = __qClass(obj); |
185 | 867 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 868 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 869 |
nByte = __qSize(obj) - nInstBytes; |
29 | 870 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
871 |
if (nByte < (count * sizeof(OBJ))) return (short *)NULL; |
|
872 |
for (i=0; i<count; i++) { |
|
77 | 873 |
o = *(OBJ *)pElem; |
97 | 874 |
if (! __isSmallInteger(o)) return (short *)NULL; |
185 | 875 |
vec[i] = (short)__intVal(o); |
77 | 876 |
pElem += sizeof(OBJ); |
29 | 877 |
} |
878 |
return vec; |
|
879 |
} |
|
880 |
||
881 |
/* |
|
882 |
* fetch floats from an st-object into a c-float array |
|
883 |
* which may be a floatArray, doubleArray or array-of-something, |
|
884 |
* where something may be a float, fraction or smallInteger, |
|
24 | 885 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
886 |
float * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
887 |
__glx_getFloatsFromInto(obj, vec, count) |
12 | 888 |
OBJ obj; |
889 |
float *vec; |
|
890 |
{ |
|
891 |
OBJ cls; |
|
892 |
int nByte; |
|
893 |
OBJ o; |
|
894 |
int i, ninstVars, nInstBytes; |
|
895 |
char *pElem; |
|
896 |
||
897 |
if (! _isNonNilObject(obj)) return (float *)0; |
|
898 |
||
134 | 899 |
cls = __qClass(obj); |
185 | 900 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
12 | 901 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 902 |
nByte = __qSize(obj) - nInstBytes; |
12 | 903 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
904 |
||
185 | 905 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
12 | 906 |
case FLOATARRAY: |
77 | 907 |
/* |
908 |
* best speed for float array |
|
909 |
* - the data is already as we want it |
|
910 |
*/ |
|
911 |
if (nByte < (count * sizeof(float))) return (float *)0; |
|
912 |
return (float *)pElem; |
|
12 | 913 |
|
914 |
case DOUBLEARRAY: |
|
77 | 915 |
/* |
916 |
* for double array, have to copy-and-cast |
|
917 |
*/ |
|
918 |
if (nByte < (count * sizeof(double))) return (float *)0; |
|
919 |
for (i=0; i<count; i++) { |
|
920 |
vec[i] = *((double *)pElem); |
|
921 |
pElem += sizeof(double); |
|
922 |
} |
|
923 |
return vec; |
|
12 | 924 |
|
925 |
case POINTERARRAY: |
|
77 | 926 |
/* |
927 |
* for other array, have to fetch, check and store |
|
928 |
* the elements can be floats, smallintegers or fractions |
|
929 |
*/ |
|
930 |
if (nByte < (count * sizeof(OBJ))) return (float *)0; |
|
931 |
/* get elements one-by-one */ |
|
932 |
for (i=0; i<count; i++) { |
|
933 |
o = *(OBJ *)pElem; |
|
934 |
if (__isFloat(o)) { |
|
935 |
vec[i] = _floatVal(o); |
|
97 | 936 |
} else if (__isSmallInteger(o)) { |
185 | 937 |
vec[i] = (float)(__intVal(o)); |
77 | 938 |
} else if (__isFraction(o) |
97 | 939 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
940 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
77 | 941 |
float n, d; |
942 |
||
185 | 943 |
n = (float)(__intVal(_FractionInstPtr(o)->f_numerator)); |
944 |
d = (float)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
77 | 945 |
vec[i] = n / d; |
946 |
} else |
|
947 |
return 0; |
|
948 |
pElem += sizeof(OBJ); |
|
949 |
} |
|
950 |
return vec; |
|
12 | 951 |
} |
952 |
return (float *)0; |
|
953 |
} |
|
954 |
||
29 | 955 |
/* |
956 |
* fetch doubles from an st-object into a c-double array |
|
957 |
* which may be a floatArray, doubleArray or array-of-something, |
|
958 |
* where something may be a float, fraction or smallInteger, |
|
959 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
960 |
double * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
961 |
__glx_getDoublesFromInto(obj, vec, count) |
29 | 962 |
OBJ obj; |
963 |
double *vec; |
|
964 |
{ |
|
965 |
OBJ cls, o; |
|
966 |
int nByte, i, ninstVars, nInstBytes; |
|
967 |
char *pElem; |
|
968 |
||
969 |
if (! _isNonNilObject(obj)) return (double *)0; |
|
134 | 970 |
cls = __qClass(obj); |
185 | 971 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 972 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 973 |
nByte = __qSize(obj) - nInstBytes; |
29 | 974 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
975 |
||
185 | 976 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
29 | 977 |
case DOUBLEARRAY: |
77 | 978 |
/* best speed for double array - the data is already as we want it */ |
979 |
if (nByte < (count * sizeof(double))) return (double *)0; |
|
980 |
return (double *)pElem; |
|
29 | 981 |
|
982 |
case FLOATARRAY: |
|
77 | 983 |
if (nByte < (count * sizeof(float))) return (double *)0; |
984 |
for (i=0; i<count; i++) { |
|
985 |
vec[i] = *((float *)pElem); |
|
986 |
pElem += sizeof(float); |
|
987 |
} |
|
988 |
return vec; |
|
29 | 989 |
|
990 |
case POINTERARRAY: |
|
77 | 991 |
if (nByte < (count * sizeof(OBJ))) return (double *)0; |
992 |
/* get elements one-by-one */ |
|
993 |
for (i=0; i<count; i++) { |
|
994 |
o = *(OBJ *)pElem; |
|
995 |
if (__isFloat(o)) |
|
996 |
vec[i] = _floatVal(o); |
|
97 | 997 |
else if (__isSmallInteger(o)) |
185 | 998 |
vec[i] = (double)(__intVal(o)); |
77 | 999 |
else if (__isFraction(o) |
97 | 1000 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
1001 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
77 | 1002 |
double n, d; |
1003 |
||
185 | 1004 |
n = (double)(__intVal(_FractionInstPtr(o)->f_numerator)); |
1005 |
d = (double)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
77 | 1006 |
vec[i] = n / d; |
1007 |
||
1008 |
} else |
|
1009 |
return 0; |
|
1010 |
pElem += sizeof(OBJ); |
|
1011 |
} |
|
1012 |
return vec; |
|
29 | 1013 |
} |
1014 |
return (double *)0; |
|
1015 |
} |
|
1016 |
||
1017 |
/* |
|
1018 |
* move from a c-float array into an st-object, |
|
1019 |
* the st-object MUST be either a float- or double array |
|
1020 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1021 |
__glx_putFloatsFromInto(vec, obj, count) |
12 | 1022 |
OBJ obj; |
1023 |
float *vec; |
|
1024 |
{ |
|
1025 |
OBJ cls; |
|
1026 |
int nByte; |
|
1027 |
OBJ o; |
|
1028 |
int i, ninstVars, nInstBytes; |
|
1029 |
char *pElem; |
|
1030 |
||
1031 |
if (! _isNonNilObject(obj)) return 0; |
|
1032 |
||
134 | 1033 |
cls = __qClass(obj); |
185 | 1034 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
12 | 1035 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1036 |
nByte = __qSize(obj) - nInstBytes; |
12 | 1037 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1038 |
||
185 | 1039 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
12 | 1040 |
case FLOATARRAY: |
77 | 1041 |
if (nByte < (count * sizeof(float))) return 0; |
1042 |
for (i=0; i<count; i++) { |
|
1043 |
*(float *)pElem = vec[i]; |
|
1044 |
pElem += sizeof(float); |
|
1045 |
} |
|
1046 |
return 1; |
|
12 | 1047 |
|
1048 |
case DOUBLEARRAY: |
|
77 | 1049 |
if (nByte < (count * sizeof(float))) return 0; |
1050 |
for (i=0; i<count; i++) { |
|
1051 |
*(double *)pElem = vec[i]; |
|
1052 |
pElem += sizeof(double); |
|
1053 |
} |
|
1054 |
return 1; |
|
12 | 1055 |
} |
1056 |
/* not implemented for others */ |
|
1057 |
||
1058 |
return 0; |
|
1059 |
} |
|
1060 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1061 |
#ifndef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1062 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1063 |
Matrix * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1064 |
__glx_getFloatsFromMatrixInto(obj, mp) |
12 | 1065 |
OBJ obj; |
1066 |
Matrix *mp; |
|
1067 |
{ |
|
1068 |
OBJ cls; |
|
1069 |
int nByte; |
|
1070 |
OBJ o; |
|
29 | 1071 |
int ninstVars, nInstBytes; |
1072 |
char *pElem; |
|
1073 |
int x = 0; |
|
1074 |
int i,j; |
|
12 | 1075 |
|
1076 |
if (! _isNonNilObject(obj)) return (Matrix *)0; |
|
1077 |
||
134 | 1078 |
cls = __qClass(obj); |
185 | 1079 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 1080 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1081 |
nByte = __qSize(obj) - nInstBytes; |
29 | 1082 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1083 |
||
185 | 1084 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1085 |
case FLOATARRAY: |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1086 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1087 |
* very easy for FLOATARRAY objects - no copying needed |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1088 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1089 |
if (nByte < (16 * sizeof(float))) return (Matrix *)0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1090 |
return (Matrix *) _FloatArrayInstPtr(obj)->f_element; |
12 | 1091 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1092 |
case DOUBLEARRAY: |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1093 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1094 |
* for DOUBLEARRAY objects copy and cast |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1095 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1096 |
if (nByte < (16 * sizeof(double))) return (Matrix *)0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1097 |
for (i=0; i<4; i++) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1098 |
for (j=0; j<4; j++) { |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1099 |
(*mp)[i][j] = _DoubleArrayInstPtr(obj)->d_element[x]; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1100 |
x++; |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1101 |
} |
77 | 1102 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1103 |
return mp; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1104 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1105 |
case POINTERARRAY: |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1106 |
if (nByte < (16 * sizeof(OBJ))) return (Matrix *)0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1107 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1108 |
* get elements one-by-one |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1109 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1110 |
for (i=0; i<4; i++) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1111 |
for (j=0; j<4; j++) { |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1112 |
o = _ArrayInstPtr(obj)->a_element[x]; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1113 |
if (__isFloat(o)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1114 |
(*mp)[i][j] = _floatVal(o); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1115 |
} else if (__isSmallInteger(o)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1116 |
(*mp)[i][j] = (double)__intVal(o); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1117 |
} else if (__isFraction(o) |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1118 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1119 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1120 |
double n, d; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1121 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1122 |
n = (double)(__intVal(_FractionInstPtr(o)->f_numerator)); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1123 |
d = (double)(__intVal(_FractionInstPtr(o)->f_denominator)); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1124 |
(*mp)[i][j] = n / d; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1125 |
} else |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1126 |
return (Matrix *)0; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1127 |
x++; |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1128 |
} |
77 | 1129 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1130 |
return mp; |
12 | 1131 |
} |
1132 |
return (Matrix *)0; |
|
1133 |
} |
|
1134 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1135 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1136 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1137 |
float* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1138 |
__glx_getFloatsFromFloatArrayInto(obj, fp) |
46 | 1139 |
OBJ obj; |
1140 |
float *fp; |
|
1141 |
{ |
|
1142 |
OBJ cls; |
|
1143 |
int ninstVars; |
|
1144 |
||
1145 |
if (! _isNonNilObject(obj)) return (float *)0; |
|
134 | 1146 |
cls = __qClass(obj); |
350 | 1147 |
if (cls == @global(FloatArray)) |
77 | 1148 |
return _FloatArrayInstPtr(obj)->f_element; |
46 | 1149 |
|
185 | 1150 |
if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) { |
1151 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
77 | 1152 |
return (float *) &(_InstPtr(obj)->i_instvars[ninstVars]); |
46 | 1153 |
} |
1154 |
||
1155 |
/* |
|
1156 |
* need more here (i.e. convert from array-of-floats) |
|
1157 |
*/ |
|
1158 |
return (float *)0; |
|
1159 |
} |
|
1160 |
||
1161 |
%} |
|
1162 |
! ! |
|
0 | 1163 |
|
294 | 1164 |
!GLXWorkstation class methodsFor:'documentation'! |
1165 |
||
1166 |
copyright |
|
1167 |
" |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1168 |
COPYRIGHT (c) 1993 by Claus Gittinger |
294 | 1169 |
All Rights Reserved |
1170 |
||
1171 |
This software is furnished under a license and may be used |
|
1172 |
only in accordance with the terms of that license and with the |
|
1173 |
inclusion of the above copyright notice. This software may not |
|
1174 |
be provided or otherwise made available to, or used by, any |
|
1175 |
other person. No title to or ownership of the software is |
|
1176 |
hereby transferred. |
|
1177 |
" |
|
1178 |
! |
|
1179 |
||
1180 |
documentation |
|
1181 |
" |
|
1182 |
this class was originally written as a demo on how an interface to |
|
1183 |
a c graphics library could be implemented. In the mean time, it has become |
|
1184 |
quite complete ... |
|
1185 |
||
1186 |
It provides an interface to either a real GL (on SGI workstations) |
|
1187 |
or a simulated VGL (i.e. GL-light; low nicotine). |
|
1188 |
The GL simulation is derived from the PD vogl library, with slight |
|
1189 |
modifictions to support multiple GL views. |
|
1190 |
||
1191 |
Most of the hard work was done by Jeff (thanks indeed) ... |
|
1192 |
||
1193 |
||
1194 |
Some notes: |
|
1195 |
||
1196 |
I do not really know what most of these functions do - for more |
|
1197 |
detail, see the GL man pages (on SGI) or the doc provided with VGL. |
|
1198 |
||
1199 |
The interface offered here provides a very very low level (i.e one-to-one) |
|
1200 |
interface to GL functions. More high-level stuff is required, to make |
|
1201 |
3D drawing be more object-oriented. |
|
1202 |
(see a bit of this in 'clients/IRIS-specials') |
|
1203 |
||
1204 |
Some functions are duplicated, Jeff and I developed those in parallel - |
|
1205 |
for now, both will remain - finally they will be merged and duplicates removed ... |
|
1206 |
(examples are makeobj and makeObject). |
|
1207 |
||
1208 |
Also, in a hurry to implement all those methods, many do no or only |
|
1209 |
limited argument checking - make certain, that you pass the correct |
|
1210 |
arguments. |
|
1211 |
||
1212 |
There might be some confusion in the v3[sifd] functions: basically they |
|
1213 |
all do the same, and could be mapped onto one st-method (such as vertex3). |
|
1214 |
However, the C-functions expect different argument types - I dont know if |
|
1215 |
one or another of these functions suffers from any performance penalties. |
|
1216 |
Therefore, I leave the direct 1-to-1 mapping; GL experts might know more |
|
1217 |
about this (I use v3f in all of my code). |
|
1218 |
||
1219 |
written june 93 by claus |
|
1220 |
VGL stuff dec 93 |
|
1221 |
many many additions jan 94 by Jeff McAffer <jeff@is.s.u-tokyo.ac.jp> |
|
1222 |
||
1223 |
Since this is a demo (consider it a free add-on goody) there is |
|
1224 |
*** NO WARRANTY ** for this. |
|
1225 |
||
1226 |
Notice: this should be rewritten to use the openGL library functions |
|
1227 |
(actually, to not loose the VGL interface, another OpenGLWorkstation |
|
1228 |
class should be written) |
|
614 | 1229 |
|
1230 |
[author:] |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1231 |
Claus Gittinger |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1232 |
Jeff McAffer |
294 | 1233 |
" |
1234 |
! ! |
|
1235 |
||
168 | 1236 |
!GLXWorkstation class methodsFor:'error handling'! |
1237 |
||
294 | 1238 |
errorStringOfLastError |
1239 |
%{ |
|
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1240 |
RETURN ( __MKSTRING(lastErrorMsg) ); |
168 | 1241 |
%} |
1242 |
! |
|
1243 |
||
528 | 1244 |
forceGL:aBoolean |
1245 |
ForceGL := aBoolean. |
|
1246 |
AllScreens notNil ifTrue:[ |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1247 |
AllScreens do:[:screen | screen initializeScreenProperties] |
528 | 1248 |
]. |
1249 |
! |
|
1250 |
||
168 | 1251 |
minorCodeOfLastError |
1252 |
%{ /* NOCONTEXT */ |
|
1253 |
||
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
1254 |
RETURN ( __MKSMALLINT(lastMinorCode) ); |
168 | 1255 |
%} |
1256 |
! |
|
1257 |
||
294 | 1258 |
requestCodeOfLastError |
1259 |
%{ /* NOCONTEXT */ |
|
1260 |
||
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
1261 |
RETURN ( __MKSMALLINT(lastRequestCode) ); |
294 | 1262 |
%} |
1263 |
! |
|
1264 |
||
168 | 1265 |
resourceIdOfLastError |
4169
35c1ee146ffb
Distinguish no-resource when handling display errors.
Stefan Vogel <sv@exept.de>
parents:
4164
diff
changeset
|
1266 |
%{ /* NOCONTEXT */ |
35c1ee146ffb
Distinguish no-resource when handling display errors.
Stefan Vogel <sv@exept.de>
parents:
4164
diff
changeset
|
1267 |
|
35c1ee146ffb
Distinguish no-resource when handling display errors.
Stefan Vogel <sv@exept.de>
parents:
4164
diff
changeset
|
1268 |
if (lastResource != 0) { |
35c1ee146ffb
Distinguish no-resource when handling display errors.
Stefan Vogel <sv@exept.de>
parents:
4164
diff
changeset
|
1269 |
RETURN ( __MKEXTERNALADDRESS(lastResource) ); |
35c1ee146ffb
Distinguish no-resource when handling display errors.
Stefan Vogel <sv@exept.de>
parents:
4164
diff
changeset
|
1270 |
} |
35c1ee146ffb
Distinguish no-resource when handling display errors.
Stefan Vogel <sv@exept.de>
parents:
4164
diff
changeset
|
1271 |
%}. |
35c1ee146ffb
Distinguish no-resource when handling display errors.
Stefan Vogel <sv@exept.de>
parents:
4164
diff
changeset
|
1272 |
|
35c1ee146ffb
Distinguish no-resource when handling display errors.
Stefan Vogel <sv@exept.de>
parents:
4164
diff
changeset
|
1273 |
^ nil |
35c1ee146ffb
Distinguish no-resource when handling display errors.
Stefan Vogel <sv@exept.de>
parents:
4164
diff
changeset
|
1274 |
|
35c1ee146ffb
Distinguish no-resource when handling display errors.
Stefan Vogel <sv@exept.de>
parents:
4164
diff
changeset
|
1275 |
|
35c1ee146ffb
Distinguish no-resource when handling display errors.
Stefan Vogel <sv@exept.de>
parents:
4164
diff
changeset
|
1276 |
" |
35c1ee146ffb
Distinguish no-resource when handling display errors.
Stefan Vogel <sv@exept.de>
parents:
4164
diff
changeset
|
1277 |
Screen resourceIdOfLastError |
35c1ee146ffb
Distinguish no-resource when handling display errors.
Stefan Vogel <sv@exept.de>
parents:
4164
diff
changeset
|
1278 |
" |
294 | 1279 |
! ! |
1280 |
||
1281 |
!GLXWorkstation methodsFor:'arcs and circles'! |
|
1282 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1283 |
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
|
1284 |
"draw an arc at a given location. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1285 |
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
|
1286 |
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
|
1287 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1288 |
%{ /* NOCONTEXT */ |
294 | 1289 |
Coord c_x, c_y, c_radius; |
1290 |
Angle a_startang, a_endang; |
|
1291 |
||
1292 |
_COORD_(x, c_x) |
|
1293 |
_COORD_(y, c_y) |
|
1294 |
_COORD_(radius, c_radius) |
|
1295 |
_ANGLE_(startang, a_startang) |
|
1296 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1297 |
|
294 | 1298 |
SETWIN(aGLXWindowId) |
1932 | 1299 |
#ifdef OPENGL |
1300 |
#else |
|
294 | 1301 |
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
|
1302 |
#endif |
294 | 1303 |
%} |
528 | 1304 |
|
1305 |
"Modified: 19.3.1996 / 18:43:52 / cg" |
|
294 | 1306 |
! |
1307 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1308 |
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
|
1309 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1310 |
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
|
1311 |
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
|
1312 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1313 |
%{ /* NOCONTEXT */ |
294 | 1314 |
Coord c_x, c_y, c_radius; |
1315 |
Angle a_startang, a_endang; |
|
1316 |
||
1317 |
_COORD_(x, c_x) |
|
1318 |
_COORD_(y, c_y) |
|
1319 |
_COORD_(radius, c_radius) |
|
1320 |
_ANGLE_(startang, a_startang) |
|
1321 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1322 |
|
294 | 1323 |
SETWIN(aGLXWindowId) |
1932 | 1324 |
#ifdef OPENGL |
1325 |
#else |
|
294 | 1326 |
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
|
1327 |
#endif |
294 | 1328 |
%} |
1329 |
! |
|
1330 |
||
1331 |
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
|
1332 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1333 |
All arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1334 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1335 |
%{ /* NOCONTEXT */ |
294 | 1336 |
Icoord c_x, c_y, c_radius; |
1337 |
Angle a_startang, a_endang; |
|
1338 |
||
1339 |
_ICOORD_(x, c_x) |
|
1340 |
_ICOORD_(y, c_y) |
|
1341 |
_ICOORD_(radius, c_radius) |
|
1342 |
_ANGLE_(startang, a_startang); |
|
1343 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1344 |
|
294 | 1345 |
SETWIN(aGLXWindowId) |
1932 | 1346 |
#ifdef OPENGL |
1347 |
#else |
|
294 | 1348 |
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
|
1349 |
#endif |
294 | 1350 |
%} |
1351 |
! |
|
1352 |
||
1353 |
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
|
1354 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1355 |
All arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1356 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1357 |
%{ /* NOCONTEXT */ |
294 | 1358 |
Scoord c_x, c_y, c_radius; |
1359 |
Angle a_startang, a_endang; |
|
1360 |
||
1361 |
_SCOORD_(x, c_x) |
|
1362 |
_SCOORD_(y, c_y) |
|
1363 |
_SCOORD_(radius, c_radius) |
|
1364 |
_ANGLE_(startang, a_startang) |
|
1365 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1366 |
|
294 | 1367 |
SETWIN(aGLXWindowId) |
1932 | 1368 |
#ifdef OPENGL |
1369 |
#else |
|
294 | 1370 |
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
|
1371 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1372 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1373 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1374 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1375 |
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
|
1376 |
"draw an (unfilled) arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1377 |
All arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1378 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1379 |
%{ /* NOCONTEXT */ |
294 | 1380 |
Icoord c_x, c_y, c_radius; |
1381 |
Angle a_startang, a_endang; |
|
1382 |
||
1383 |
_ICOORD_(x, c_x) |
|
1384 |
_ICOORD_(y, c_y) |
|
1385 |
_ICOORD_(radius, c_radius) |
|
1386 |
_ANGLE_(startang, a_startang) |
|
1387 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1388 |
|
294 | 1389 |
SETWIN(aGLXWindowId) |
1932 | 1390 |
#ifdef OPENGL |
1391 |
#else |
|
294 | 1392 |
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
|
1393 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1394 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1395 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1396 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1397 |
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
|
1398 |
"draw an (unfilled) arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1399 |
All arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1400 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1401 |
%{ /* NOCONTEXT */ |
1932 | 1402 |
Scoord c_x, c_y, c_radius; |
1403 |
Angle a_startang, a_endang; |
|
1404 |
||
1405 |
_SCOORD_(x, c_x) |
|
1406 |
_SCOORD_(y, c_y) |
|
1407 |
_SCOORD_(radius, c_radius) |
|
1408 |
_ANGLE_(startang, a_startang) |
|
1409 |
_ANGLE_(endang, a_endang) |
|
1410 |
||
1411 |
SETWIN(aGLXWindowId) |
|
1412 |
#ifdef OPENGL |
|
1413 |
#else |
|
1414 |
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
|
1415 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1416 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1417 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1418 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1419 |
glxCircX:x y:y radius: radius in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1420 |
"draw a circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1421 |
x/y/radius may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1422 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1423 |
%{ /* NOCONTEXT */ |
1932 | 1424 |
Coord c_x, c_y, c_radius; |
1425 |
||
1426 |
_COORD_ (x, c_x) |
|
1427 |
_COORD_ (y, c_y) |
|
1428 |
_COORD_ (radius, c_radius) |
|
1429 |
||
1430 |
SETWIN(aGLXWindowId) |
|
1431 |
#ifdef OPENGL |
|
1432 |
#else |
|
1433 |
circ(c_x, c_y, c_radius); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1434 |
#endif |
294 | 1435 |
%} |
1436 |
! |
|
1437 |
||
1438 |
glxCircfX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1439 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1440 |
x/y/radius may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1441 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1442 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1443 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1444 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1445 |
Coord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1446 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1447 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1448 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1449 |
_COORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1450 |
|
1932 | 1451 |
#ifdef OPENGL |
1452 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1453 |
circf(c_x, c_y, c_radius); |
1932 | 1454 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1455 |
} |
294 | 1456 |
%} |
1457 |
! |
|
1458 |
||
1459 |
glxCircfiX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1460 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1461 |
x/y/radius must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1462 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1463 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1464 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1465 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1466 |
Icoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1467 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1468 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1469 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1470 |
_ICOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1471 |
|
1932 | 1472 |
#ifdef OPENGL |
1473 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1474 |
circfi(c_x, c_y, c_radius); |
1932 | 1475 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1476 |
} |
294 | 1477 |
%} |
1478 |
! |
|
1479 |
||
1480 |
glxCircfsX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1481 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1482 |
x/y/radius must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1483 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1484 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1485 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1486 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1487 |
Scoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1488 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1489 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1490 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1491 |
_SCOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1492 |
|
1932 | 1493 |
#ifdef OPENGL |
1494 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1495 |
circfs(c_x, c_y, c_radius); |
1932 | 1496 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1497 |
} |
294 | 1498 |
%} |
1499 |
! |
|
1500 |
||
1501 |
glxCirciX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1502 |
"draw a circle (unfilled). |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1503 |
x/y/radius must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1504 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1505 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1506 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1507 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1508 |
Icoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1509 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1510 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1511 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1512 |
_ICOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1513 |
|
1932 | 1514 |
#ifdef OPENGL |
1515 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1516 |
circi(c_x, c_y, c_radius); |
1932 | 1517 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1518 |
} |
294 | 1519 |
%} |
1520 |
! |
|
1521 |
||
1522 |
glxCircsX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1523 |
"draw a circle (unfilled) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1524 |
x/y/radius must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1525 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1526 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1527 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1528 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1529 |
Scoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1530 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1531 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1532 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1533 |
_SCOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1534 |
|
1932 | 1535 |
#ifdef OPENGL |
1536 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1537 |
circs(c_x, c_y, c_radius); |
1932 | 1538 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1539 |
} |
294 | 1540 |
%} |
1541 |
! ! |
|
1542 |
||
528 | 1543 |
!GLXWorkstation methodsFor:'attribute stack'! |
1544 |
||
1545 |
glxPopattributesIn: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1546 |
"pop (and forget) the top entry on the attribute stack" |
528 | 1547 |
|
1548 |
%{ /* NOCONTEXT */ |
|
1549 |
SETWIN(aGLXWindowId) |
|
1932 | 1550 |
#ifndef OPENGL |
528 | 1551 |
popattributes(); |
1932 | 1552 |
#endif |
528 | 1553 |
%} |
1554 |
||
1555 |
"Modified: 19.3.1996 / 18:42:53 / cg" |
|
1556 |
! |
|
1557 |
||
1558 |
glxPushattributesIn: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1559 |
"save the current attributes on the attribute stack" |
528 | 1560 |
|
1561 |
%{ /* NOCONTEXT */ |
|
1562 |
SETWIN(aGLXWindowId) |
|
1932 | 1563 |
#ifndef OPENGL |
528 | 1564 |
pushattributes(); |
1932 | 1565 |
#endif |
528 | 1566 |
%} |
1567 |
||
1568 |
"Modified: 19.3.1996 / 18:43:04 / cg" |
|
1569 |
! ! |
|
1570 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1571 |
!GLXWorkstation methodsFor:'character position'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1572 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1573 |
glxCmov2X: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1574 |
"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
|
1575 |
The arguments may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1576 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1577 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1578 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1579 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1580 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1581 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1582 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1583 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1584 |
|
1932 | 1585 |
#ifdef OPENGL |
1586 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1587 |
cmov2(c_x, c_y); |
1932 | 1588 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1589 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1590 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1591 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1592 |
"Modified: 22.3.1996 / 18:17:38 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1593 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1594 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1595 |
glxCmov2iX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1596 |
"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
|
1597 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1598 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1599 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1600 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1601 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1602 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1603 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1604 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1605 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1606 |
|
1932 | 1607 |
#ifdef OPENGL |
1608 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1609 |
cmov2i(c_x, c_y); |
1932 | 1610 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1611 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1612 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1613 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1614 |
"Modified: 22.3.1996 / 18:17:43 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1615 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1616 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1617 |
glxCmov2sX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1618 |
"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
|
1619 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1620 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1621 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1622 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1623 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1624 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1625 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1626 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1627 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1628 |
|
1932 | 1629 |
#ifdef OPENGL |
1630 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1631 |
cmov2s(c_x, c_y); |
1932 | 1632 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1633 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1634 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1635 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1636 |
"Modified: 22.3.1996 / 18:17:47 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1637 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1638 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1639 |
glxCmovX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1640 |
"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
|
1641 |
The arguments may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1642 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1643 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1644 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1645 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1646 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1647 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1648 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1649 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1650 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1651 |
|
1932 | 1652 |
#ifdef OPENGL |
1653 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1654 |
cmov(c_x, c_y, c_z); |
1932 | 1655 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1656 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1657 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1658 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1659 |
"Modified: 22.3.1996 / 18:17:22 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1660 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1661 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1662 |
glxCmoviX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1663 |
"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
|
1664 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1665 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1666 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1667 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1668 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1669 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1670 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1671 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1672 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1673 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1674 |
|
1932 | 1675 |
#ifdef OPENGL |
1676 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1677 |
cmovi(c_x, c_y, c_z); |
1932 | 1678 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1679 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1680 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1681 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1682 |
"Modified: 22.3.1996 / 18:17:55 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1683 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1684 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1685 |
glxCmovsX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1686 |
"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
|
1687 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1688 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1689 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1690 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1691 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1692 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1693 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1694 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1695 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1696 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1697 |
|
1932 | 1698 |
#ifdef OPENGL |
1699 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1700 |
cmovs(c_x, c_y, c_z); |
1932 | 1701 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1702 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1703 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1704 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1705 |
"Modified: 22.3.1996 / 18:17:59 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1706 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1707 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1708 |
glxGetcposIn: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1709 |
"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
|
1710 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1711 |
| x y | |
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 |
short s_x, s_y; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1714 |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1715 |
SETWIN(aGLXWindowId) |
1932 | 1716 |
#ifdef OPENGL |
1717 |
#else |
|
1718 |
# ifdef GLX |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1719 |
getcpos(&s_x, &s_y); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1720 |
x = __MKSMALLINT(s_x); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1721 |
y = __MKSMALLINT(s_y); |
1932 | 1722 |
# endif |
1723 |
#endif |
|
1724 |
%}. |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1725 |
^x @ y |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1726 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1727 |
|
294 | 1728 |
!GLXWorkstation methodsFor:'clearing'! |
1729 |
||
1730 |
glxClearIn:aGLXWindowId |
|
1731 |
"clear to current color" |
|
1732 |
||
1733 |
%{ /* NOCONTEXT */ |
|
1734 |
SETWIN(aGLXWindowId) |
|
1932 | 1735 |
#ifdef OPENGL |
1736 |
#else |
|
294 | 1737 |
clear(); |
1932 | 1738 |
#endif |
294 | 1739 |
%} |
1740 |
! |
|
1741 |
||
1742 |
glxCzclearCval:cval zval:zval in:aGLXWindowId |
|
1743 |
"clear to a color (cval) and clear z buffer to zval simultaniously" |
|
1744 |
||
1745 |
%{ /* NOCONTEXT */ |
|
1932 | 1746 |
SETWIN(aGLXWindowId) |
1747 |
#ifdef OPENGL |
|
1748 |
#else |
|
1749 |
# ifdef GLX |
|
294 | 1750 |
czclear((ulong)__intVal(cval), __intVal(zval)); |
1932 | 1751 |
# endif |
1752 |
#endif |
|
1753 |
%} |
|
294 | 1754 |
! |
1755 |
||
1756 |
glxZClearIn:aGLXWindowId |
|
1757 |
"clear z buffer" |
|
1758 |
||
1759 |
%{ /* NOCONTEXT */ |
|
1932 | 1760 |
SETWIN(aGLXWindowId) |
1761 |
#ifdef OPENGL |
|
1762 |
#else |
|
1763 |
# ifdef GLX |
|
294 | 1764 |
zclear(); |
1932 | 1765 |
# endif |
1766 |
#endif |
|
1767 |
%} |
|
294 | 1768 |
! ! |
1769 |
||
1770 |
!GLXWorkstation methodsFor:'color'! |
|
1771 |
||
1772 |
glxColor:index in:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1773 |
"set the drawing color; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1774 |
for non gouraud shading, we dont care if the argument is integer or float; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1775 |
otherwise, better results are expected with float values." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1776 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1777 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1778 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1779 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1780 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1781 |
#else |
294 | 1782 |
if (__isSmallInteger(index)) { |
1783 |
color((Colorindex)(__intVal(index))); |
|
1932 | 1784 |
RETURN (self); |
294 | 1785 |
} |
1786 |
if (__isFloat(index)) { |
|
1787 |
colorf((float)(_floatVal(index))); |
|
1932 | 1788 |
RETURN (self); |
294 | 1789 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1790 |
#endif |
1932 | 1791 |
%} |
294 | 1792 |
! |
1793 |
||
1794 |
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
|
1795 |
"set the drawing color, including alpha value. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1796 |
The args must be integer values within 0..255" |
294 | 1797 |
|
1798 |
%{ /* NOCONTEXT */ |
|
1799 |
short s_r, s_g, s_b, s_a; |
|
1800 |
||
1801 |
_INT_(r, s_r); |
|
1802 |
_INT_(g, s_g); |
|
1803 |
_INT_(b, s_b); |
|
1804 |
_INT_(a, s_a); |
|
1805 |
SETWIN(aGLXWindowId) |
|
1932 | 1806 |
#ifdef GLX |
294 | 1807 |
cpack((((((s_a<<8) | s_b) << 8) | s_g) << 8) | s_r); |
1932 | 1808 |
#endif |
1809 |
%} |
|
294 | 1810 |
! |
1811 |
||
1812 |
glxColorRed:r green:g blue:b in:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1813 |
"set the drawing color. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1814 |
The args must be integer values in 0..255" |
294 | 1815 |
|
1816 |
%{ /* NOCONTEXT */ |
|
1817 |
short s_r, s_g, s_b; |
|
1818 |
||
1819 |
_INT_(r, s_r); |
|
1820 |
_INT_(g, s_g); |
|
1821 |
_INT_(b, s_b); |
|
1822 |
SETWIN(aGLXWindowId) |
|
1932 | 1823 |
#ifdef GLX |
294 | 1824 |
RGBcolor(s_r, s_g, s_b); |
1932 | 1825 |
#endif |
1826 |
%} |
|
294 | 1827 |
! |
1828 |
||
528 | 1829 |
glxLrgbrangeRmin: rmin gmin: gmin bmin: bmin rmax: rmax gmax: gmax bmax: bmax |
1830 |
znear: znear zfar: zfar in: aGLXWindowId |
|
1831 |
||
1832 |
%{ /* NOCONTEXT */ |
|
1932 | 1833 |
SETWIN(aGLXWindowId) |
1834 |
#ifdef GLX |
|
528 | 1835 |
lRGBrange(_shortVal(rmin), _shortVal(gmin), _shortVal(bmin), |
1836 |
_shortVal(rmax), _shortVal(gmax), _shortVal(bmax), |
|
1837 |
_longVal(znear), _longVal(zfar)); |
|
1932 | 1838 |
#endif |
1839 |
%} |
|
528 | 1840 |
! |
1841 |
||
1842 |
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
|
1843 |
"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
|
1844 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1845 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1846 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1847 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1848 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1849 |
#else |
528 | 1850 |
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
|
1851 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1852 |
%} |
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 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1855 |
glxTextcolor:tcolor in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1856 |
"change the color used for text drawing" |
294 | 1857 |
|
1858 |
%{ /* NOCONTEXT */ |
|
1932 | 1859 |
SETWIN(aGLXWindowId) |
1860 |
#ifdef GLX |
|
294 | 1861 |
textcolor(_colorindexVal(tcolor)); |
1932 | 1862 |
#endif |
1863 |
%} |
|
294 | 1864 |
! ! |
1865 |
||
528 | 1866 |
!GLXWorkstation methodsFor:'curves'! |
1867 |
||
1868 |
glxCurvebasis: basid in: aGLXWindowId |
|
1869 |
"sets the basis type of curves" |
|
1870 |
||
1871 |
%{ /* NOCONTEXT */ |
|
1872 |
SETWIN(aGLXWindowId) |
|
1932 | 1873 |
#ifdef GLX |
528 | 1874 |
curvebasis(_shortVal(basid)); |
1932 | 1875 |
#endif |
528 | 1876 |
%} |
1877 |
||
1878 |
"Modified: 19.3.1996 / 18:47:09 / cg" |
|
1879 |
! |
|
1880 |
||
1881 |
glxCurveit: iterationcount in: aGLXWindowId |
|
1882 |
"Iterates the top matrix on the stack as a forward difference |
|
1883 |
matrix, drawing as it goes along." |
|
1884 |
||
1885 |
%{ /* NOCONTEXT */ |
|
1886 |
SETWIN(aGLXWindowId) |
|
1932 | 1887 |
#ifdef GLX |
528 | 1888 |
curveit(_shortVal(iterationcount)); |
1932 | 1889 |
#endif |
528 | 1890 |
%} |
1891 |
||
1892 |
"Modified: 19.3.1996 / 18:48:57 / cg" |
|
1893 |
! |
|
1894 |
||
1895 |
glxCurveprecision: nsegments in: aGLXWindowId |
|
1896 |
"sets the number of line segments that make up a curve segment" |
|
1897 |
||
1898 |
%{ /* NOCONTEXT */ |
|
1899 |
SETWIN(aGLXWindowId) |
|
1932 | 1900 |
#ifdef GLX |
528 | 1901 |
curveprecision(_shortVal(nsegments)); |
1932 | 1902 |
#endif |
528 | 1903 |
%} |
1904 |
||
1905 |
"Modified: 19.3.1996 / 18:47:43 / cg" |
|
1906 |
! ! |
|
1907 |
||
294 | 1908 |
!GLXWorkstation methodsFor:'double buffering'! |
1909 |
||
1910 |
glxBackBufferIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1911 |
"switch to back buffer drawing - turning frontbuffer drawing off" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1912 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1913 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1914 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1915 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1916 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1917 |
# ifdef GLX |
294 | 1918 |
frontbuffer(FALSE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1919 |
# endif |
294 | 1920 |
backbuffer(TRUE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1921 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1922 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1923 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1924 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1925 |
glxBackbuffer:b in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1926 |
"turn backBuffer drawing on/off. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1927 |
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
|
1928 |
... enabling the backbuffer automatically disables frontbuffer drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1929 |
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
|
1930 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1931 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1932 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1933 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1934 |
#else |
294 | 1935 |
backbuffer(_booleanVal(b)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1936 |
#endif |
294 | 1937 |
%} |
528 | 1938 |
|
1939 |
"Modified: 19.3.1996 / 18:45:05 / cg" |
|
294 | 1940 |
! |
1941 |
||
1942 |
glxDoubleBufferIn:aGLXWindowId |
|
1943 |
"set double buffer mode" |
|
1944 |
||
1945 |
%{ /* NOCONTEXT */ |
|
1946 |
SETWIN(aGLXWindowId) |
|
1932 | 1947 |
#ifdef OPENGL |
1948 |
#else |
|
294 | 1949 |
doublebuffer(); |
1932 | 1950 |
#endif |
294 | 1951 |
%} |
1952 |
! |
|
1953 |
||
1954 |
glxFrontBufferIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1955 |
"switch to front buffer drawing - turning backbuffer drawing off" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1956 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1957 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1958 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1959 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1960 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1961 |
# ifdef GLX |
294 | 1962 |
backbuffer(FALSE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1963 |
# endif |
294 | 1964 |
frontbuffer(TRUE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1965 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1966 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1967 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1968 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1969 |
glxFrontbuffer:b in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1970 |
"turn on/off frontbuffer drawing. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1971 |
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
|
1972 |
... enabling the backbuffer automatically disables frontbuffer drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1973 |
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
|
1974 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1975 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1976 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1977 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1978 |
#else |
294 | 1979 |
frontbuffer(_booleanVal(b)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1980 |
#endif |
294 | 1981 |
%} |
528 | 1982 |
|
1983 |
"Modified: 19.3.1996 / 18:45:31 / cg" |
|
294 | 1984 |
! |
1985 |
||
1986 |
glxSingleBufferIn: aGLXWindowId |
|
1987 |
"set single buffer mode" |
|
1988 |
||
1989 |
%{ /* NOCONTEXT */ |
|
1990 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1991 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1992 |
#else |
294 | 1993 |
singlebuffer(); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1994 |
#endif |
294 | 1995 |
%} |
1996 |
! |
|
1997 |
||
1998 |
glxSwapBuffersIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1999 |
"swap the back and front buffers. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2000 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2001 |
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
|
2002 |
displayed and swap them for every frame." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2003 |
|
1903 | 2004 |
%{ /* UNLIMITEDSTACK */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2005 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2006 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2007 |
#else |
294 | 2008 |
swapbuffers(); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2009 |
#endif |
294 | 2010 |
%} |
528 | 2011 |
|
2012 |
"Modified: 19.3.1996 / 18:45:47 / cg" |
|
294 | 2013 |
! ! |
2014 |
||
2015 |
!GLXWorkstation methodsFor:'flat drawing'! |
|
2016 |
||
2017 |
glxBeginClosedLineIn:aGLXWindowId |
|
2018 |
"start a closed line" |
|
2019 |
||
2020 |
%{ /* NOCONTEXT */ |
|
1932 | 2021 |
#ifdef OPENGL |
2022 |
#else |
|
294 | 2023 |
SETWIN(aGLXWindowId) |
2024 |
bgnclosedline(); |
|
1932 | 2025 |
#endif |
294 | 2026 |
%} |
2027 |
! |
|
2028 |
||
2029 |
glxBeginLineIn:aGLXWindowId |
|
2030 |
"start a line group" |
|
2031 |
||
2075 | 2032 |
%{ /* NOCONTEXT STACK:32000 */ |
1932 | 2033 |
#ifdef OPENGL |
2034 |
#else |
|
294 | 2035 |
SETWIN(aGLXWindowId) |
2036 |
bgnline(); |
|
1932 | 2037 |
#endif |
294 | 2038 |
%} |
2039 |
! |
|
2040 |
||
2041 |
glxBeginPointIn:aGLXWindowId |
|
2042 |
"start a point-group" |
|
2043 |
||
2044 |
%{ /* NOCONTEXT */ |
|
1932 | 2045 |
#ifdef OPENGL |
2046 |
#else |
|
294 | 2047 |
SETWIN(aGLXWindowId) |
2048 |
bgnpoint(); |
|
1932 | 2049 |
#endif |
294 | 2050 |
%} |
2051 |
! |
|
2052 |
||
2053 |
glxBeginPolygonIn:aGLXWindowId |
|
2054 |
"start a polygon" |
|
2055 |
||
2056 |
%{ /* NOCONTEXT */ |
|
1932 | 2057 |
#ifdef OPENGL |
2058 |
#else |
|
294 | 2059 |
SETWIN(aGLXWindowId) |
2060 |
bgnpolygon(); |
|
1932 | 2061 |
#endif |
294 | 2062 |
%} |
2063 |
! |
|
2064 |
||
2065 |
glxBeginQuadrilateralStripIn:aGLXWindowId |
|
2066 |
"start a quadrilateral strip" |
|
2067 |
||
2068 |
%{ /* NOCONTEXT */ |
|
1932 | 2069 |
#ifdef OPENGL |
2070 |
#else |
|
294 | 2071 |
SETWIN(aGLXWindowId) |
2072 |
bgnqstrip(); |
|
1932 | 2073 |
#endif |
294 | 2074 |
%} |
2075 |
! |
|
2076 |
||
2077 |
glxBeginTriangleMeshIn:aGLXWindowId |
|
2078 |
"start a triangle mesh" |
|
2079 |
||
2080 |
%{ /* NOCONTEXT */ |
|
1932 | 2081 |
#ifdef OPENGL |
2082 |
#else |
|
294 | 2083 |
SETWIN(aGLXWindowId) |
2084 |
bgntmesh(); |
|
1932 | 2085 |
#endif |
294 | 2086 |
%} |
2087 |
! |
|
2088 |
||
2089 |
glxEndClosedLineIn:aGLXWindowId |
|
2090 |
"end a closed line" |
|
2091 |
||
2092 |
%{ /* NOCONTEXT */ |
|
1932 | 2093 |
#ifdef OPENGL |
2094 |
#else |
|
294 | 2095 |
SETWIN(aGLXWindowId) |
2096 |
endclosedline(); |
|
1932 | 2097 |
#endif |
294 | 2098 |
%} |
2099 |
! |
|
2100 |
||
2101 |
glxEndLineIn:aGLXWindowId |
|
2102 |
"end a line group" |
|
2103 |
||
2075 | 2104 |
%{ /* NOCONTEXT STACK:32000 */ |
1932 | 2105 |
#ifdef OPENGL |
2106 |
#else |
|
294 | 2107 |
SETWIN(aGLXWindowId) |
2108 |
endline(); |
|
1932 | 2109 |
#endif |
294 | 2110 |
%} |
2111 |
! |
|
2112 |
||
2113 |
glxEndPointIn:aGLXWindowId |
|
2114 |
"end a point group" |
|
2115 |
||
2116 |
%{ /* NOCONTEXT */ |
|
1932 | 2117 |
#ifdef OPENGL |
2118 |
#else |
|
294 | 2119 |
SETWIN(aGLXWindowId) |
2120 |
endpoint(); |
|
1932 | 2121 |
#endif |
294 | 2122 |
%} |
2123 |
! |
|
2124 |
||
2125 |
glxEndPolygonIn:aGLXWindowId |
|
2126 |
"end a polygon" |
|
2127 |
||
2128 |
%{ /* NOCONTEXT */ |
|
1932 | 2129 |
#ifdef OPENGL |
2130 |
#else |
|
294 | 2131 |
SETWIN(aGLXWindowId) |
2132 |
endpolygon(); |
|
1932 | 2133 |
#endif |
294 | 2134 |
%} |
2135 |
! |
|
2136 |
||
2137 |
glxEndQuadrilateralStripIn:aGLXWindowId |
|
2138 |
"end a quadrilateral strip" |
|
2139 |
||
2140 |
%{ /* NOCONTEXT */ |
|
1932 | 2141 |
#ifdef OPENGL |
2142 |
#else |
|
294 | 2143 |
SETWIN(aGLXWindowId) |
2144 |
endqstrip(); |
|
1932 | 2145 |
#endif |
294 | 2146 |
%} |
2147 |
! |
|
2148 |
||
2149 |
glxEndTriangleMeshIn:aGLXWindowId |
|
2150 |
"end a triangle mesh" |
|
2151 |
||
2152 |
%{ /* NOCONTEXT */ |
|
1932 | 2153 |
#ifdef OPENGL |
2154 |
#else |
|
294 | 2155 |
SETWIN(aGLXWindowId) |
2156 |
endtmesh(); |
|
1932 | 2157 |
#endif |
168 | 2158 |
%} |
2159 |
! ! |
|
2160 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2161 |
!GLXWorkstation methodsFor:'graphics position'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2162 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2163 |
glxMove2:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2164 |
"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
|
2165 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2166 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2167 |
float vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2168 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2169 |
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
|
2170 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2171 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2172 |
#else |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2173 |
move2((Coord)(c_v[0]), (Coord)(c_v[1])); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2174 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2175 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2176 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2177 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2178 |
"Modified: 22.3.1996 / 18:15:23 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2179 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2180 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2181 |
glxMove2X: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2182 |
"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
|
2183 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2184 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2185 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2186 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2187 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2188 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2189 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2190 |
SETWIN(aGLXWindowId) |
1932 | 2191 |
#ifdef OPENGL |
2192 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2193 |
move2(c_x, c_y); |
1932 | 2194 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2195 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2196 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2197 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2198 |
"Modified: 22.3.1996 / 18:15:02 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2199 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2200 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2201 |
glxMove2iX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2202 |
"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
|
2203 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2204 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2205 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2206 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2207 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2208 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2209 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2210 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2211 |
SETWIN(aGLXWindowId) |
1932 | 2212 |
#ifdef OPENGL |
2213 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2214 |
move2i(c_x, c_y); |
1932 | 2215 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2216 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2217 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2218 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2219 |
"Modified: 22.3.1996 / 18:15:08 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2220 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2221 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2222 |
glxMove2sX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2223 |
"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
|
2224 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2225 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2226 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2227 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2228 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2229 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2230 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2231 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2232 |
SETWIN(aGLXWindowId) |
1932 | 2233 |
#ifdef OPENGL |
2234 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2235 |
move2s(c_x, c_y); |
1932 | 2236 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2237 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2238 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2239 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2240 |
"Modified: 22.3.1996 / 18:15:13 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2241 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2242 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2243 |
glxMove:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2244 |
"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
|
2245 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2246 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2247 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2248 |
float vec[3], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2249 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2250 |
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
|
2251 |
SETWIN(aGLXWindowId) |
1932 | 2252 |
#ifdef OPENGL |
2253 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2254 |
move((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
1932 | 2255 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2256 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2257 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2258 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2259 |
"Modified: 22.3.1996 / 18:14:29 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2260 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2261 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2262 |
glxMoveX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2263 |
"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
|
2264 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2265 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2266 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2267 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2268 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2269 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2270 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2271 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2272 |
SETWIN(aGLXWindowId) |
1932 | 2273 |
#ifdef OPENGL |
2274 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2275 |
move(c_x, c_y, c_z); |
1932 | 2276 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2277 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2278 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2279 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2280 |
"Modified: 22.3.1996 / 18:14:38 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2281 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2282 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2283 |
glxMoveiX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2284 |
"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
|
2285 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2286 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2287 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2288 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2289 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2290 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2291 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2292 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2293 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2294 |
SETWIN(aGLXWindowId) |
1932 | 2295 |
#ifdef OPENGL |
2296 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2297 |
movei(c_x, c_y, c_z); |
1932 | 2298 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2299 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2300 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2301 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2302 |
"Modified: 22.3.1996 / 18:14:44 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2303 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2304 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2305 |
glxMovesX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2306 |
"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
|
2307 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2308 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2309 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2310 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2311 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2312 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2313 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2314 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2315 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2316 |
SETWIN(aGLXWindowId) |
1932 | 2317 |
#ifdef OPENGL |
2318 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2319 |
moves(c_x, c_y, c_z); |
1932 | 2320 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2321 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2322 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2323 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2324 |
"Modified: 22.3.1996 / 18:14:48 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2325 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2326 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2327 |
glxRmv2:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2328 |
"change the graphics position to a 2D point, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2329 |
the relative distance is passed in vector v" |
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 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2332 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2333 |
float vec[2], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2334 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2335 |
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
|
2336 |
SETWIN(aGLXWindowId) |
1932 | 2337 |
#ifdef OPENGL |
2338 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2339 |
rmv2((Coord)(c_v[0]), (Coord)(c_v[1])); |
1932 | 2340 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2341 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2342 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2343 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2344 |
"Modified: 22.3.1996 / 18:15:57 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2345 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2346 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2347 |
glxRmv2X: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2348 |
"change the graphics position to a 2D point, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2349 |
the relative distance is passed in x/y" |
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 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2352 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2353 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2354 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2355 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2356 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2357 |
SETWIN(aGLXWindowId) |
1932 | 2358 |
#ifdef OPENGL |
2359 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2360 |
rmv2(c_x, c_y); |
1932 | 2361 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2362 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2363 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2364 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2365 |
"Modified: 22.3.1996 / 18:16:42 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2366 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2367 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2368 |
glxRmv2iX: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2369 |
"change the graphics position to a 2D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2370 |
the relative distance is passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2371 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2372 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2373 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2374 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2375 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2376 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2377 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2378 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2379 |
SETWIN(aGLXWindowId) |
1932 | 2380 |
#ifdef OPENGL |
2381 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2382 |
rmv2i(c_x, c_y); |
1932 | 2383 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2384 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2385 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2386 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2387 |
"Modified: 22.3.1996 / 18:16:39 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2388 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2389 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2390 |
glxRmv2sX: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2391 |
"change the graphics position to a 2D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2392 |
the relative distance is passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2393 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2394 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2395 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2396 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2397 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2398 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2399 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2400 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2401 |
SETWIN(aGLXWindowId) |
1932 | 2402 |
#ifdef OPENGL |
2403 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2404 |
rmv2s(c_x, c_y); |
1932 | 2405 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2406 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2407 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2408 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2409 |
"Modified: 22.3.1996 / 18:16:33 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2410 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2411 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2412 |
glxRmv:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2413 |
"change the graphics position to a 3D point, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2414 |
the relative distance is passed in vector v" |
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 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2417 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2418 |
float vec[3], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2419 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2420 |
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
|
2421 |
SETWIN(aGLXWindowId) |
1932 | 2422 |
#ifdef OPENGL |
2423 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2424 |
rmv((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
1932 | 2425 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2426 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2427 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2428 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2429 |
"Modified: 22.3.1996 / 18:16:08 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2430 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2431 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2432 |
glxRmvX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2433 |
"change the graphics position to a 3D point, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2434 |
the relative distance is passed in x/y/z" |
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 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2437 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2438 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2439 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2440 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2441 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2442 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2443 |
SETWIN(aGLXWindowId) |
1932 | 2444 |
#ifdef OPENGL |
2445 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2446 |
rmv(c_x, c_y, c_z); |
1932 | 2447 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2448 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2449 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2450 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2451 |
"Modified: 22.3.1996 / 18:16:16 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2452 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2453 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2454 |
glxRmviX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2455 |
"change the graphics position to a 3D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2456 |
the relative distance is passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2457 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2458 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2459 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2460 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2461 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2462 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2463 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2464 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2465 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2466 |
SETWIN(aGLXWindowId) |
1932 | 2467 |
#ifdef OPENGL |
2468 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2469 |
rmvi(c_x, c_y, c_z); |
1932 | 2470 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2471 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2472 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2473 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2474 |
"Modified: 22.3.1996 / 18:16:21 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2475 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2476 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2477 |
glxRmvsX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2478 |
"change the graphics position to a 3D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2479 |
the relative distance is passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2480 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2481 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2482 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2483 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2484 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2485 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2486 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2487 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2488 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2489 |
SETWIN(aGLXWindowId) |
1932 | 2490 |
#ifdef OPENGL |
2491 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2492 |
rmvs(c_x, c_y, c_z); |
1932 | 2493 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2494 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2495 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2496 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2497 |
"Modified: 22.3.1996 / 18:16:25 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2498 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2499 |
|
168 | 2500 |
!GLXWorkstation methodsFor:'initialization'! |
2501 |
||
2502 |
initializeFor:aDisplayName |
|
169 | 2503 |
(super initializeFor:aDisplayName) isNil ifTrue:[^ nil]. |
168 | 2504 |
%{ |
2505 |
if (_INST(displayId) != nil) { |
|
185 | 2506 |
XSetErrorHandler(__XErrorHandler__); |
2507 |
} |
|
2508 |
%} |
|
2509 |
! |
|
2510 |
||
2511 |
initializeScreenProperties |
|
2512 |
super initializeScreenProperties. |
|
2513 |
||
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2514 |
"/ 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
|
2515 |
"/ 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
|
2516 |
"/ 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
|
2517 |
"/ 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
|
2518 |
"/ 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
|
2519 |
"/ 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
|
2520 |
"/ 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
|
2521 |
"/ have no documentation). |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2522 |
"/ Late note: setting the ForceGL classVar overrides above behavior. |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2523 |
"/ it may be set from a startupScript with: 'GLXWorkstation forceGL:true' |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2524 |
"/ however: be careful: only set it to true, if you are certain that remoteGL works |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2525 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2526 |
(self isTrueGL and:[ForceGL ~~ true]) ifTrue:[ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2527 |
glOK := (displayName = ':0') or:[displayName = ':0.0']. |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2528 |
] ifFalse:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2529 |
glOK := true. |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2530 |
]. |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2531 |
|
185 | 2532 |
%{ |
2533 |
Display *dpy = myDpy; |
|
2534 |
int dummy; |
|
2535 |
||
2536 |
if (ISCONNECTED) { |
|
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2537 |
_INST(hasStereoExtension) = false; |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2538 |
|
1932 | 2539 |
#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
|
2540 |
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
|
2541 |
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
|
2542 |
_INST(hasStereoExtension) = true; |
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2543 |
} |
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2544 |
#endif |
168 | 2545 |
} |
2546 |
%} |
|
2547 |
! ! |
|
2548 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2549 |
!GLXWorkstation methodsFor:'lines'! |
528 | 2550 |
|
2551 |
glxDeflinestyleN: n ls: ls in: aGLXWindowId |
|
2552 |
"define a line style" |
|
2553 |
||
2554 |
%{ /* NOCONTEXT */ |
|
1932 | 2555 |
SETWIN(aGLXWindowId) |
2556 |
#ifdef OPENGL |
|
2557 |
#else |
|
528 | 2558 |
deflinestyle(_shortVal(n), _linestyleVal(ls)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2559 |
#endif |
528 | 2560 |
%} |
2561 |
! |
|
2562 |
||
2563 |
glxDraw2:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2564 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2565 |
to a new 2D position, passed in vector v." |
528 | 2566 |
|
2567 |
%{ /* NOCONTEXT */ |
|
2568 |
float vec[2], *c_v; |
|
2569 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2570 |
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
|
2571 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2572 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2573 |
#else |
528 | 2574 |
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
|
2575 |
#endif |
528 | 2576 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2577 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2578 |
"Modified: 22.3.1996 / 18:03:29 / cg" |
528 | 2579 |
! |
2580 |
||
2581 |
glxDraw2X: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2582 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2583 |
to a new 2D position, passed in x/y." |
528 | 2584 |
|
2585 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2586 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2587 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2588 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2589 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2590 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2591 |
SETWIN(aGLXWindowId) |
1932 | 2592 |
#ifdef OPENGL |
2593 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2594 |
draw2(c_x, c_y); |
1932 | 2595 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2596 |
} |
528 | 2597 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2598 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2599 |
"Modified: 22.3.1996 / 18:03:50 / cg" |
528 | 2600 |
! |
2601 |
||
2602 |
glxDraw2iX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2603 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2604 |
to a new 2D position, passed in x/y." |
528 | 2605 |
|
2606 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2607 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2608 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2609 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2610 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2611 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2612 |
SETWIN(aGLXWindowId) |
1932 | 2613 |
#ifdef OPENGL |
2614 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2615 |
draw2i(c_x, c_y); |
1932 | 2616 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2617 |
} |
528 | 2618 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2619 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2620 |
"Modified: 22.3.1996 / 18:04:07 / cg" |
528 | 2621 |
! |
2622 |
||
2623 |
glxDraw2sX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2624 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2625 |
to a new 2D position, passed in x/y." |
528 | 2626 |
|
2627 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2628 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2629 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2630 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2631 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2632 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2633 |
SETWIN(aGLXWindowId) |
1932 | 2634 |
#ifdef OPENGL |
2635 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2636 |
draw2s(c_x, c_y); |
1932 | 2637 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2638 |
} |
528 | 2639 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2640 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2641 |
"Modified: 22.3.1996 / 18:04:19 / cg" |
528 | 2642 |
! |
2643 |
||
2644 |
glxDraw:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2645 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2646 |
to a new 3D position, passed in vector v." |
528 | 2647 |
|
2648 |
%{ /* NOCONTEXT */ |
|
2649 |
float vec[3], *c_v; |
|
2650 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2651 |
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
|
2652 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2653 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2654 |
#else |
528 | 2655 |
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
|
2656 |
#endif |
528 | 2657 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2658 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2659 |
"Modified: 22.3.1996 / 18:04:34 / cg" |
528 | 2660 |
! |
2661 |
||
2662 |
glxDrawX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2663 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2664 |
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
|
2665 |
The arguments may be floats, fractions or smallIntegers" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2666 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2667 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2668 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2669 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2670 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2671 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2672 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2673 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2674 |
SETWIN(aGLXWindowId) |
1932 | 2675 |
#ifdef OPENGL |
2676 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2677 |
draw(c_x, c_y, c_z); |
1932 | 2678 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2679 |
} |
528 | 2680 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2681 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2682 |
"Modified: 22.3.1996 / 18:04:46 / cg" |
528 | 2683 |
! |
2684 |
||
2685 |
glxDrawiX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2686 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2687 |
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
|
2688 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2689 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2690 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2691 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2692 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2693 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2694 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2695 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2696 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2697 |
SETWIN(aGLXWindowId) |
1932 | 2698 |
#ifdef OPENGL |
2699 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2700 |
drawi(c_x, c_y, c_z); |
1932 | 2701 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2702 |
} |
528 | 2703 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2704 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2705 |
"Modified: 22.3.1996 / 18:04:54 / cg" |
528 | 2706 |
! |
2707 |
||
2708 |
glxDrawsX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2709 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2710 |
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
|
2711 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2712 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2713 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2714 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2715 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2716 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2717 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2718 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2719 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2720 |
SETWIN(aGLXWindowId) |
1932 | 2721 |
#ifdef OPENGL |
2722 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2723 |
draws(c_x, c_y, c_z); |
1932 | 2724 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2725 |
} |
528 | 2726 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2727 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2728 |
"Modified: 22.3.1996 / 18:05:01 / cg" |
528 | 2729 |
! |
2730 |
||
2731 |
glxLinewidth: n in: aGLXWindowId |
|
2732 |
"set the linewidth" |
|
2733 |
||
2734 |
%{ /* NOCONTEXT */ |
|
2735 |
SETWIN(aGLXWindowId) |
|
1932 | 2736 |
#ifdef OPENGL |
2737 |
#else |
|
528 | 2738 |
linewidth(_shortVal(n)); |
1932 | 2739 |
#endif |
528 | 2740 |
%} |
2741 |
! |
|
2742 |
||
2743 |
glxLinewidthf: n in: aGLXWindowId |
|
2744 |
"set the linewidth" |
|
2745 |
||
2746 |
%{ /* NOCONTEXT */ |
|
2747 |
SETWIN(aGLXWindowId) |
|
1932 | 2748 |
#ifdef OPENGL |
2749 |
#else |
|
528 | 2750 |
linewidthf(_floatVal(n)); |
1932 | 2751 |
#endif |
528 | 2752 |
RETURN (true); |
2753 |
%} |
|
2754 |
! |
|
2755 |
||
2756 |
glxRdr2:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2757 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2758 |
to a new 2D position, passing the relative distance in the vector v." |
528 | 2759 |
|
2760 |
%{ /* NOCONTEXT */ |
|
2761 |
float vec[2], *c_v; |
|
2762 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2763 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
528 | 2764 |
SETWIN(aGLXWindowId) |
1932 | 2765 |
#ifdef OPENGL |
2766 |
#else |
|
528 | 2767 |
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
|
2768 |
#endif |
528 | 2769 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2770 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2771 |
"Modified: 22.3.1996 / 18:05:54 / cg" |
528 | 2772 |
! |
2773 |
||
2774 |
glxRdr2X: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2775 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2776 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2777 |
|
2778 |
%{ /* NOCONTEXT */ |
|
2779 |
Coord c_x, c_y; |
|
2780 |
||
2781 |
_COORD_ (x, c_x) |
|
2782 |
_COORD_ (y, c_y) |
|
2783 |
SETWIN(aGLXWindowId) |
|
1932 | 2784 |
#ifdef OPENGL |
2785 |
#else |
|
528 | 2786 |
rdr2(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2787 |
#endif |
528 | 2788 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2789 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2790 |
"Modified: 22.3.1996 / 18:06:20 / cg" |
528 | 2791 |
! |
2792 |
||
2793 |
glxRdr2iX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2794 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2795 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2796 |
|
2797 |
%{ /* NOCONTEXT */ |
|
2798 |
Icoord c_x, c_y; |
|
2799 |
||
2800 |
_ICOORD_ (x, c_x) |
|
2801 |
_ICOORD_ (y, c_y) |
|
2802 |
SETWIN(aGLXWindowId) |
|
1932 | 2803 |
#ifdef OPENGL |
2804 |
#else |
|
528 | 2805 |
rdr2i(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2806 |
#endif |
528 | 2807 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2808 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2809 |
"Modified: 22.3.1996 / 18:06:28 / cg" |
528 | 2810 |
! |
2811 |
||
2812 |
glxRdr2sX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2813 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2814 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2815 |
|
2816 |
%{ /* NOCONTEXT */ |
|
2817 |
Scoord c_x, c_y; |
|
2818 |
||
2819 |
_SCOORD_ (x, c_x) |
|
2820 |
_SCOORD_ (y, c_y) |
|
2821 |
SETWIN(aGLXWindowId) |
|
1932 | 2822 |
#ifdef OPENGL |
2823 |
#else |
|
528 | 2824 |
rdr2s(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2825 |
#endif |
528 | 2826 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2827 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2828 |
"Modified: 22.3.1996 / 18:06:34 / cg" |
528 | 2829 |
! |
2830 |
||
2831 |
glxRdr:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2832 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2833 |
to a new 3D position, passing the relative distance in the vector v." |
528 | 2834 |
|
2835 |
%{ /* NOCONTEXT */ |
|
2836 |
float vec[3], *c_v; |
|
2837 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2838 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
528 | 2839 |
SETWIN(aGLXWindowId) |
1932 | 2840 |
#ifdef OPENGL |
2841 |
#else |
|
528 | 2842 |
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
|
2843 |
#endif |
528 | 2844 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2845 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2846 |
"Modified: 22.3.1996 / 18:06:07 / cg" |
528 | 2847 |
! |
2848 |
||
2849 |
glxRdrX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2850 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2851 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2852 |
|
2853 |
%{ /* NOCONTEXT */ |
|
2854 |
Coord c_x, c_y, c_z; |
|
2855 |
||
2856 |
_COORD_ (x, c_x) |
|
2857 |
_COORD_ (y, c_y) |
|
2858 |
_COORD_ (z, c_z) |
|
2859 |
SETWIN(aGLXWindowId) |
|
1932 | 2860 |
#ifdef OPENGL |
2861 |
#else |
|
528 | 2862 |
rdr(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2863 |
#endif |
528 | 2864 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2865 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2866 |
"Modified: 22.3.1996 / 18:06:44 / cg" |
528 | 2867 |
! |
2868 |
||
2869 |
glxRdriX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2870 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2871 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2872 |
|
2873 |
%{ /* NOCONTEXT */ |
|
2874 |
Icoord c_x, c_y, c_z; |
|
2875 |
||
2876 |
_ICOORD_ (x, c_x) |
|
2877 |
_ICOORD_ (y, c_y) |
|
2878 |
_ICOORD_ (z, c_z) |
|
2879 |
SETWIN(aGLXWindowId) |
|
1932 | 2880 |
#ifdef OPENGL |
2881 |
#else |
|
528 | 2882 |
rdri(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2883 |
#endif |
528 | 2884 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2885 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2886 |
"Modified: 22.3.1996 / 18:06:51 / cg" |
528 | 2887 |
! |
2888 |
||
2889 |
glxRdrsX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2890 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2891 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2892 |
|
2893 |
%{ /* NOCONTEXT */ |
|
2894 |
Scoord c_x, c_y, c_z; |
|
2895 |
||
2896 |
_SCOORD_ (x, c_x) |
|
2897 |
_SCOORD_ (y, c_y) |
|
2898 |
_SCOORD_ (z, c_z) |
|
2899 |
SETWIN(aGLXWindowId) |
|
1932 | 2900 |
#ifdef OPENGL |
2901 |
#else |
|
528 | 2902 |
rdrs(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2903 |
#endif |
528 | 2904 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2905 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2906 |
"Modified: 22.3.1996 / 18:06:55 / cg" |
528 | 2907 |
! |
2908 |
||
2909 |
glxSetlinestyle: index in: aGLXWindowId |
|
2910 |
"set the linestyle" |
|
2911 |
||
2912 |
%{ /* NOCONTEXT */ |
|
2913 |
SETWIN(aGLXWindowId) |
|
1932 | 2914 |
#ifdef OPENGL |
2915 |
#else |
|
528 | 2916 |
setlinestyle(_shortVal(index)); |
1932 | 2917 |
#endif |
2918 |
%} |
|
528 | 2919 |
! ! |
2920 |
||
294 | 2921 |
!GLXWorkstation methodsFor:'materials & lights'! |
2922 |
||
2923 |
glxLmbind:target index:index in:aGLXWindowId |
|
2924 |
"select a material, light or lighting model. |
|
2925 |
target must be a symbol from: #material, #backMaterial, |
|
2926 |
#light0-light7 or #lightModel." |
|
2927 |
||
2928 |
%{ /* NOCONTEXT */ |
|
2929 |
#ifdef GLX |
|
2930 |
short defType; |
|
2931 |
short i_index; |
|
2932 |
||
2933 |
if (target == @symbol(material)) |
|
2934 |
defType = MATERIAL; |
|
2935 |
else if (target == @symbol(backMaterial)) |
|
2936 |
defType = BACKMATERIAL; |
|
2937 |
else if (target == @symbol(light0)) |
|
2938 |
defType = LIGHT0; |
|
2939 |
else if (target == @symbol(light1)) |
|
2940 |
defType = LIGHT1; |
|
2941 |
else if (target == @symbol(light2)) |
|
2942 |
defType = LIGHT2; |
|
2943 |
else if (target == @symbol(light3)) |
|
2944 |
defType = LIGHT3; |
|
2945 |
else if (target == @symbol(light4)) |
|
2946 |
defType = LIGHT4; |
|
2947 |
else if (target == @symbol(light5)) |
|
2948 |
defType = LIGHT5; |
|
2949 |
else if (target == @symbol(light6)) |
|
2950 |
defType = LIGHT6; |
|
2951 |
else if (target == @symbol(light7)) |
|
2952 |
defType = LIGHT7; |
|
2953 |
else if (target == @symbol(lightModel)) |
|
2954 |
defType = LMODEL; |
|
2955 |
else { |
|
1932 | 2956 |
RETURN (nil); |
294 | 2957 |
} |
2958 |
||
2959 |
_INT_ (index, i_index); |
|
2960 |
SETWIN(aGLXWindowId) |
|
2961 |
lmbind(defType, i_index); |
|
1932 | 2962 |
#endif |
2963 |
%} |
|
294 | 2964 |
! |
2965 |
||
2966 |
glxLmdef:what index:index np:np props:props in:aGLXWindowId |
|
2967 |
"define a material, light source or lighting model; |
|
2968 |
what must be one of #material, #light or #lightModel. |
|
2969 |
props must be a FloatArray or a subclass of FloatArray" |
|
2970 |
||
2971 |
%{ /* NOCONTEXT */ |
|
2972 |
#ifdef GLX |
|
2973 |
short defType; |
|
2974 |
short i_index, i_np; |
|
2975 |
float *fp; |
|
2976 |
OBJ cls; |
|
2977 |
int ninstVars, nInstBytes; |
|
2978 |
||
2979 |
if (what == @symbol(material)) |
|
2980 |
defType = DEFMATERIAL; |
|
2981 |
else if (what == @symbol(light)) |
|
2982 |
defType = DEFLIGHT; |
|
2983 |
else if (what == @symbol(lightModel)) |
|
2984 |
defType = DEFLMODEL; |
|
2985 |
else { |
|
1932 | 2986 |
RETURN (nil); |
294 | 2987 |
} |
2988 |
||
2989 |
_INT_ (index, i_index); |
|
2990 |
_INT_ (np, i_np); |
|
2991 |
||
2992 |
if (! _isNonNilObject(props)) fp = NULL; |
|
2993 |
else { |
|
2994 |
cls = __qClass(props); |
|
350 | 2995 |
if (cls == @global(FloatArray)) |
294 | 2996 |
fp = _FloatArrayInstPtr(props)->f_element; |
2997 |
else { |
|
2998 |
if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) { |
|
2999 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
3000 |
fp = (float *) &(_InstPtr(props)->i_instvars[ninstVars]); |
|
3001 |
} else { |
|
1932 | 3002 |
RETURN (nil); |
294 | 3003 |
} |
3004 |
} |
|
3005 |
} |
|
3006 |
SETWIN(aGLXWindowId) |
|
3007 |
lmdef(defType, i_index, i_np, fp); |
|
1932 | 3008 |
#endif |
3009 |
%} |
|
294 | 3010 |
! |
3011 |
||
3012 |
glxTevbind:target index:index in:aGLXWindowId |
|
3013 |
"bind a texture environment; target must be 0 |
|
3014 |
or the symbol #env0." |
|
3015 |
||
3016 |
%{ /* NOCONTEXT */ |
|
3017 |
#ifdef GLX |
|
3018 |
long t; |
|
3019 |
||
3020 |
if (__isSmallInteger(target)) { |
|
3021 |
t = __intVal(target); |
|
3022 |
} else { |
|
3023 |
if (target == @symbol(env0)) { |
|
3024 |
t = TV_ENV0; |
|
3025 |
} else { |
|
1932 | 3026 |
RETURN (nil); |
294 | 3027 |
} |
3028 |
} |
|
3029 |
SETWIN(aGLXWindowId) |
|
3030 |
tevbind(t, __intVal(index)); |
|
1932 | 3031 |
#endif |
3032 |
%} |
|
294 | 3033 |
! |
3034 |
||
3035 |
glxTevdef:index np:np props:props in:aGLXWindowId |
|
3036 |
||
3037 |
%{ /* NOCONTEXT */ |
|
3038 |
#ifdef GLX |
|
3039 |
const float *fp; |
|
3040 |
float fbuff[30]; |
|
3041 |
||
3042 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3043 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
294 | 3044 |
tevdef(__intVal(index), __intVal(np), fp); |
1932 | 3045 |
#endif |
3046 |
%} |
|
294 | 3047 |
! |
3048 |
||
3049 |
glxTexDef2d:index nc:nc width:w height:h bits:image np:np props:props in:aGLXWindowId |
|
3050 |
"define a 2D texture. index is the 'name' of the texture; |
|
3051 |
nc is the number of components (1-4) per pixel; |
|
3052 |
w/h define the size of the texture; bits is a byteArray containing the |
|
3053 |
long-word aligned pixel data; np is the number of props found in |
|
3054 |
the floatArray props. Props must be delimited by a 0.0 entry." |
|
3055 |
||
3056 |
%{ /* NOCONTEXT */ |
|
3057 |
#ifdef GLX |
|
3058 |
unsigned char *cp; |
|
3059 |
const float *fp; |
|
3060 |
OBJ cls; |
|
3061 |
float fbuff[30]; |
|
3062 |
||
3063 |
if (__isByteArray(image)) { |
|
3064 |
cp = _ByteArrayInstPtr(image)->ba_element; |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3065 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
294 | 3066 |
|
3067 |
SETWIN(aGLXWindowId) |
|
3068 |
texdef2d(__intVal(index), __intVal(nc), __intVal(w), __intVal(h), |
|
3069 |
(const unsigned long *)cp, __intVal(np), fp); |
|
3070 |
} |
|
3071 |
#endif |
|
3072 |
%} |
|
3073 |
! |
|
3074 |
||
3075 |
glxTexDef3d:index nc:nc width:w height:h depth:d bits:image np:np props:props in:aGLXWindowId |
|
3076 |
"define a 3D texture. index is the 'name' of the texture; |
|
3077 |
nc is the number of components (1-4) per pixel; |
|
3078 |
w/h/d define the size of the texture; bits is a byteArray containing the |
|
3079 |
long-word aligned pixel data; np is the number of props found in |
|
3080 |
the floatArray props. Props must be delimited by a 0.0 entry." |
|
3081 |
||
3082 |
%{ /* NOCONTEXT */ |
|
3083 |
#ifdef GLX |
|
3084 |
unsigned char *cp; |
|
3085 |
const float *fp; |
|
3086 |
OBJ cls; |
|
3087 |
float fbuff[30]; |
|
3088 |
||
3089 |
if (__isByteArray(image)) { |
|
3090 |
cp = _ByteArrayInstPtr(image)->ba_element; |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3091 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
294 | 3092 |
|
3093 |
SETWIN(aGLXWindowId) |
|
3094 |
texdef3d(__intVal(index), __intVal(nc), __intVal(w), __intVal(h), |
|
3095 |
__intVal(d), |
|
3096 |
(const unsigned long *)cp, __intVal(np), fp); |
|
3097 |
} |
|
3098 |
#endif |
|
3099 |
%} |
|
3100 |
! |
|
3101 |
||
3102 |
glxTexbind:target index:index in:aGLXWindowId |
|
3103 |
"bind a texture; target must be an integer or one |
|
3104 |
of the symbols #texture0, #textureDetail or #textureIdle." |
|
3105 |
||
3106 |
%{ /* NOCONTEXT */ |
|
3107 |
#ifdef GLX |
|
3108 |
long t; |
|
3109 |
||
3110 |
if (__isSmallInteger(target)) { |
|
3111 |
t = __intVal(target); |
|
3112 |
} else { |
|
3113 |
if (target == @symbol(texture0)) { |
|
3114 |
t = TX_TEXTURE_0; |
|
3115 |
} else if (target == @symbol(textureDetail)) { |
|
3116 |
t = TX_TEXTURE_DETAIL; |
|
3117 |
} else if (target == @symbol(textureIdle)) { |
|
3118 |
t = TX_TEXTURE_IDLE; |
|
3119 |
} else { |
|
1932 | 3120 |
RETURN (nil); |
294 | 3121 |
} |
3122 |
} |
|
3123 |
SETWIN(aGLXWindowId) |
|
3124 |
texbind(t, __intVal(index)); |
|
1932 | 3125 |
#endif |
3126 |
%} |
|
294 | 3127 |
! ! |
3128 |
||
3129 |
!GLXWorkstation methodsFor:'matrix stack'! |
|
3130 |
||
3131 |
glxGetMatrix:arrayOf16Floats in:aGLXWindowId |
|
3132 |
"argument must be an array (a matrix) of 16 floats. The current matrix |
|
3133 |
will be stored into that." |
|
3134 |
||
3135 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3136 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3137 |
#else |
294 | 3138 |
Matrix matrix; |
3139 |
||
3140 |
SETWIN(aGLXWindowId) |
|
3141 |
getmatrix(matrix); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3142 |
if (! __glx_putFloatsFromInto(matrix, arrayOf16Floats, 16)) RETURN(false); |
1932 | 3143 |
#endif |
3144 |
%} |
|
294 | 3145 |
! |
3146 |
||
3147 |
glxLoadMatrix:arrayOf16Floats in:aGLXWindowId |
|
3148 |
"argument must be an array(a matrix) of 16 floats. The current matrix |
|
3149 |
will be loaded from that." |
|
3150 |
||
3151 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3152 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3153 |
#else |
294 | 3154 |
Matrix matrix; |
3155 |
Matrix *m; |
|
3156 |
||
2814 | 3157 |
if (! (m = __glx_getFloatsFromMatrixInto(arrayOf16Floats, matrix))) RETURN (false); |
294 | 3158 |
SETWIN(aGLXWindowId) |
3159 |
loadmatrix(*m); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3160 |
#endif |
294 | 3161 |
%} |
3162 |
! |
|
3163 |
||
3164 |
glxMultMatrix:arrayOf16Floats in:aGLXWindowId |
|
3165 |
"argument must be an array(a matrix) of 16 floats containing a |
|
3166 |
matrix to multiply into the current matrix." |
|
3167 |
||
3168 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3169 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3170 |
#else |
294 | 3171 |
Matrix matrix; |
3172 |
Matrix *m; |
|
3173 |
||
2814 | 3174 |
if (! (m = __glx_getFloatsFromMatrixInto(arrayOf16Floats, matrix))) RETURN (false); |
294 | 3175 |
SETWIN(aGLXWindowId) |
3176 |
multmatrix(*m); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3177 |
#endif |
294 | 3178 |
%} |
3179 |
! |
|
3180 |
||
3181 |
glxPopmatrixIn:aGLXWindowId |
|
3182 |
"pop transformation stack" |
|
3183 |
||
3184 |
%{ /* NOCONTEXT */ |
|
3185 |
SETWIN(aGLXWindowId) |
|
1932 | 3186 |
#ifdef OPENGL |
3187 |
#else |
|
294 | 3188 |
popmatrix(); |
1932 | 3189 |
#endif |
294 | 3190 |
%} |
3191 |
! |
|
3192 |
||
3193 |
glxPushmatrixIn:aGLXWindowId |
|
3194 |
"push down transformation stack" |
|
3195 |
||
3196 |
%{ /* NOCONTEXT */ |
|
3197 |
SETWIN(aGLXWindowId) |
|
1932 | 3198 |
#ifdef OPENGL |
3199 |
#else |
|
294 | 3200 |
pushmatrix(); |
1932 | 3201 |
#endif |
294 | 3202 |
%} |
3203 |
! ! |
|
3204 |
||
3205 |
!GLXWorkstation methodsFor:'misc'! |
|
3206 |
||
3207 |
glxGconfigIn:aGLXWindowId |
|
3208 |
"must be sent after RGBmode, doubleBuffer etc. to have these |
|
3209 |
changes really take effect. See GLX manual. |
|
3210 |
(Actually, it seems to be not allowed - I dont really know)" |
|
3211 |
||
3212 |
%{ /* NOCONTEXT */ |
|
3213 |
SETWIN(aGLXWindowId) |
|
1932 | 3214 |
#ifdef OPENGL |
3215 |
#else |
|
294 | 3216 |
gconfig(); |
1932 | 3217 |
#endif |
294 | 3218 |
%} |
3219 |
! |
|
3220 |
||
3221 |
glxMmode:aSymbol in:aGLXWindowId |
|
3222 |
"set matrix mode: #single, #viewing, #projection or #texture" |
|
3223 |
||
3224 |
%{ /* NOCONTEXT */ |
|
3225 |
#ifdef GLX |
|
3226 |
if (aSymbol == @symbol(single)) { |
|
3227 |
mmode(MSINGLE); |
|
3228 |
RETURN (true); |
|
3229 |
} |
|
3230 |
if (aSymbol == @symbol(viewing)) { |
|
3231 |
mmode(MVIEWING); |
|
3232 |
RETURN (true); |
|
3233 |
} |
|
3234 |
if (aSymbol == @symbol(projection)) { |
|
3235 |
mmode(MPROJECTION); |
|
3236 |
RETURN (true); |
|
3237 |
} |
|
3238 |
if (aSymbol == @symbol(texture)) { |
|
3239 |
mmode(MTEXTURE); |
|
3240 |
RETURN (true); |
|
3241 |
} |
|
3242 |
#endif |
|
3243 |
%} |
|
3244 |
. |
|
3245 |
^ false |
|
3246 |
! |
|
3247 |
||
3248 |
glxNmode:aSymbol in:aGLXWindowId |
|
3249 |
"set normalize mode: #auto, #normalize" |
|
3250 |
||
3251 |
%{ /* NOCONTEXT */ |
|
3252 |
#ifdef GLX |
|
3253 |
if (aSymbol == @symbol(auto)) { |
|
3254 |
nmode(NAUTO); |
|
3255 |
RETURN (true); |
|
3256 |
} |
|
3257 |
if (aSymbol == @symbol(normalize)) { |
|
3258 |
nmode(NNORMALIZE); |
|
3259 |
RETURN (true); |
|
3260 |
} |
|
3261 |
#endif |
|
3262 |
%} |
|
3263 |
. |
|
3264 |
^ false |
|
3265 |
! |
|
3266 |
||
3267 |
glxRGBmodeIn:aGLXWindowId |
|
3268 |
"set true color mode (no colormap)" |
|
3269 |
||
3270 |
%{ /* NOCONTEXT */ |
|
3271 |
#ifdef GLX |
|
3272 |
SETWIN(aGLXWindowId) |
|
3273 |
RGBmode(); |
|
3274 |
RETURN (true); |
|
3275 |
#endif |
|
3276 |
%} |
|
3277 |
. |
|
3278 |
^ false |
|
3279 |
! ! |
|
3280 |
||
3281 |
!GLXWorkstation methodsFor:'objects'! |
|
3282 |
||
3283 |
glxCallObject:obj in:aGLXWindowId |
|
3284 |
"perform the commands of an object (macro)." |
|
3285 |
||
2075 | 3286 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3287 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3288 |
#else |
294 | 3289 |
if (__isSmallInteger(obj)) { |
3290 |
SETWIN(aGLXWindowId) |
|
3291 |
callobj(_objectVal(obj)); |
|
3292 |
RETURN (true); |
|
3293 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3294 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3295 |
%}. |
294 | 3296 |
^ false |
3297 |
! |
|
3298 |
||
3299 |
glxCloseObjectIn:aGLXWindowId |
|
3300 |
"end object defnition" |
|
3301 |
||
2075 | 3302 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3303 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3304 |
#else |
294 | 3305 |
SETWIN(aGLXWindowId) |
3306 |
closeobj(); |
|
3307 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3308 |
#endif |
294 | 3309 |
%} |
3310 |
! |
|
3311 |
||
3312 |
glxDeleteObject:obj in:aGLXWindowId |
|
3313 |
||
2075 | 3314 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3315 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3316 |
#else |
1882 | 3317 |
if (__isSmallInteger(obj)) { |
3318 |
SETWIN(aGLXWindowId) |
|
3319 |
delobj(_objectVal(obj)); |
|
3320 |
RETURN (true); |
|
3321 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3322 |
#endif |
294 | 3323 |
%} |
3324 |
! |
|
3325 |
||
3326 |
glxGenObjectIn:aGLXWindowId |
|
3327 |
"return a new (free & unused) object id for use |
|
3328 |
with makeObj" |
|
3329 |
||
3330 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3331 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3332 |
#else |
294 | 3333 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3334 |
RETURN (__MKSMALLINT(genobj())); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3335 |
#endif |
294 | 3336 |
%} |
3337 |
! |
|
3338 |
||
3339 |
glxGetopenobjIn:aGLXWindowId |
|
3340 |
"return the currently open objects id; -1 if none is open" |
|
3341 |
||
3342 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3343 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3344 |
#else |
294 | 3345 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3346 |
RETURN (__MKSMALLINT(getopenobj())); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3347 |
#endif |
294 | 3348 |
%} |
3349 |
! |
|
3350 |
||
3351 |
glxIsobj:obj in:aGLXWindowId |
|
3352 |
"return true, if obj is a valid object id" |
|
3353 |
||
3354 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3355 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3356 |
#else |
294 | 3357 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3358 |
RETURN (__MKBOOLEAN(isobj(_objectVal(obj)))); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3359 |
#endif |
294 | 3360 |
%} |
3361 |
! |
|
3362 |
||
3363 |
glxMakeObject:id in:aGLXWindowId |
|
3364 |
"start object definition - |
|
3365 |
another name conflict" |
|
3366 |
||
2075 | 3367 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3368 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3369 |
#else |
294 | 3370 |
if (__isSmallInteger(id)) { |
3371 |
SETWIN(aGLXWindowId) |
|
3372 |
makeobj(_objectVal(id)); |
|
3373 |
RETURN (true); |
|
3374 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3375 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3376 |
%}. |
294 | 3377 |
^ false |
3378 |
! ! |
|
3379 |
||
3380 |
!GLXWorkstation methodsFor:'patches & surfaces'! |
|
3381 |
||
3382 |
glxBeginCurveIn:aGLXWindowId |
|
3383 |
"start a NURBS curve def - in real GL only" |
|
3384 |
||
3385 |
%{ /* NOCONTEXT */ |
|
1932 | 3386 |
SETWIN(aGLXWindowId) |
3387 |
#ifdef GLX |
|
294 | 3388 |
bgncurve(); |
1932 | 3389 |
#endif |
3390 |
%} |
|
294 | 3391 |
! |
3392 |
||
3393 |
glxBeginSurfaceIn:aGLXWindowId |
|
3394 |
"start a NURBS surface def - in real GL only" |
|
3395 |
||
3396 |
%{ /* NOCONTEXT */ |
|
1932 | 3397 |
SETWIN(aGLXWindowId) |
3398 |
#ifdef GLX |
|
294 | 3399 |
bgnsurface(); |
1932 | 3400 |
#endif |
3401 |
%} |
|
294 | 3402 |
! |
3403 |
||
3404 |
glxDefBasis:id mat:aMatrix in:aGLXWindowId |
|
528 | 3405 |
"define the basis matrix for a patch or curve" |
294 | 3406 |
|
3407 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3408 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3409 |
#else |
294 | 3410 |
Matrix matrix; |
3411 |
Matrix *m; |
|
3412 |
||
2814 | 3413 |
if (! (m = __glx_getFloatsFromMatrixInto(aMatrix, matrix))) RETURN (false); |
294 | 3414 |
if (__isSmallInteger(id)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3415 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3416 |
defbasis((short)(__intVal(id)), *m); |
294 | 3417 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3418 |
#endif |
1932 | 3419 |
%} |
528 | 3420 |
|
3421 |
"Modified: 19.3.1996 / 18:52:56 / cg" |
|
294 | 3422 |
! |
3423 |
||
3424 |
glxEndCurveIn:aGLXWindowId |
|
3425 |
"end a NURBS curve def - in real GL only" |
|
3426 |
||
3427 |
%{ /* NOCONTEXT */ |
|
1932 | 3428 |
SETWIN(aGLXWindowId) |
3429 |
#ifdef GLX |
|
294 | 3430 |
endcurve(); |
1932 | 3431 |
#endif |
3432 |
%} |
|
294 | 3433 |
! |
3434 |
||
3435 |
glxEndSurfaceIn:aGLXWindowId |
|
3436 |
"end a NURBS surface def - in real GL only" |
|
3437 |
||
3438 |
%{ /* NOCONTEXT */ |
|
1932 | 3439 |
SETWIN(aGLXWindowId) |
3440 |
#ifdef GLX |
|
294 | 3441 |
endsurface(); |
1932 | 3442 |
#endif |
3443 |
%} |
|
294 | 3444 |
! |
3445 |
||
3446 |
glxNurbsSurfaceUKnotCount: uKnotCount uKnot: uKnot |
|
3447 |
vKnotCount: vKnotCount vKnot: vKnot |
|
3448 |
uOffset: uOffset vOffset: vOffset |
|
3449 |
ctlArray: ctlArray |
|
3450 |
uOrder: uOrder vOrder: vOrder |
|
3451 |
type: type in: aGLXWindowId |
|
3452 |
||
3453 |
| ctlPoints i | |
|
3454 |
ctlPoints := DoubleArray new: ctlArray size * (ctlArray first size). |
|
3455 |
i := 1. |
|
3456 |
ctlArray do: [:point | |
|
3457 |
point do: [:coord | |
|
3458 |
ctlPoints at: i put: coord. |
|
3459 |
i := i + 1]]. |
|
3460 |
||
3461 |
%{ /* NOCONTEXT */ |
|
3462 |
#ifdef GLX |
|
3463 |
char *uKnotElements, *vKnotElements, *ctlElements; |
|
3464 |
OBJ cls; |
|
3465 |
int ninstVars, nInstBytes; |
|
3466 |
||
3467 |
SETWIN(aGLXWindowId) |
|
3468 |
cls = __qClass(ctlPoints); |
|
3469 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
3470 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
|
3471 |
||
3472 |
ctlElements = (char *)(_InstPtr(ctlPoints)) + nInstBytes; |
|
3473 |
uKnotElements = (char *)(_InstPtr(uKnot)) + nInstBytes; |
|
3474 |
vKnotElements = (char *)(_InstPtr(vKnot)) + nInstBytes; |
|
3475 |
||
3476 |
nurbssurface ( |
|
3477 |
__intVal(uKnotCount), (double *)uKnotElements, |
|
3478 |
__intVal(vKnotCount), (double *)vKnotElements, |
|
3479 |
__intVal(uOffset), __intVal(vOffset), |
|
3480 |
(double *)ctlElements, |
|
3481 |
__intVal(uOrder), __intVal(vOrder), __intVal(type)); |
|
3482 |
RETURN(true); |
|
3483 |
#endif |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3484 |
%}. |
294 | 3485 |
^ false |
3486 |
! |
|
3487 |
||
3488 |
glxPatchBasisU:u v:v in:aGLXWindowId |
|
528 | 3489 |
"set the two basis matrices for a patch" |
294 | 3490 |
|
3491 |
%{ /* NOCONTEXT */ |
|
3492 |
if (__bothSmallInteger(u, v)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3493 |
SETWIN(aGLXWindowId) |
1932 | 3494 |
#ifdef OPENGL |
3495 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3496 |
patchbasis((long)__intVal(u), (long)__intVal(v)); |
1932 | 3497 |
#endif |
294 | 3498 |
} |
1932 | 3499 |
%} |
528 | 3500 |
|
3501 |
"Modified: 19.3.1996 / 18:53:18 / cg" |
|
294 | 3502 |
! |
3503 |
||
3504 |
glxPatchCurvesU:u v:v in:aGLXWindowId |
|
528 | 3505 |
"set the number of curves to be drawn in each direction on a patch" |
294 | 3506 |
|
3507 |
%{ /* NOCONTEXT */ |
|
3508 |
if (__bothSmallInteger(u, v)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3509 |
SETWIN(aGLXWindowId) |
1932 | 3510 |
#ifdef OPENGL |
3511 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3512 |
patchcurves((long)__intVal(u), (long)__intVal(v)); |
1932 | 3513 |
#endif |
294 | 3514 |
} |
1932 | 3515 |
%} |
528 | 3516 |
|
3517 |
"Modified: 19.3.1996 / 18:53:34 / cg" |
|
294 | 3518 |
! |
3519 |
||
3520 |
glxPatchPrecisionU:u v:v in:aGLXWindowId |
|
3521 |
"set the patch precision" |
|
3522 |
||
3523 |
%{ /* NOCONTEXT */ |
|
3524 |
if (__bothSmallInteger(u, v)) { |
|
3525 |
SETWIN(aGLXWindowId) |
|
1932 | 3526 |
#ifdef OPENGL |
3527 |
#else |
|
294 | 3528 |
patchprecision((long)__intVal(u), (long)__intVal(v)); |
1932 | 3529 |
#endif |
294 | 3530 |
} |
1932 | 3531 |
%} |
294 | 3532 |
! |
3533 |
||
3534 |
glxPatchX:arrayOf16XFloats y:arrayOf16YFloats z:arrayOf16ZFloats in:aGLXWindowId |
|
528 | 3535 |
"Draws a bicubic patch. |
3536 |
arguments must be arrays of 16 floats containing the patch" |
|
294 | 3537 |
|
3538 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3539 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3540 |
#else |
294 | 3541 |
Matrix matrixX, matrixY, matrixZ; |
3542 |
Matrix *mX, *mY, *mZ; |
|
3543 |
||
2814 | 3544 |
if (! (mX = __glx_getFloatsFromMatrixInto(arrayOf16XFloats, matrixX))) |
1932 | 3545 |
RETURN (nil); |
2814 | 3546 |
if (! (mY = __glx_getFloatsFromMatrixInto(arrayOf16YFloats, matrixY))) |
1932 | 3547 |
RETURN (nil); |
2814 | 3548 |
if (! (mZ = __glx_getFloatsFromMatrixInto(arrayOf16ZFloats, matrixZ))) |
1932 | 3549 |
RETURN (nil); |
294 | 3550 |
SETWIN(aGLXWindowId) |
3551 |
patch(*mX, *mY, *mZ); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3552 |
#endif |
294 | 3553 |
%} |
528 | 3554 |
|
3555 |
"Modified: 19.3.1996 / 18:54:02 / cg" |
|
3556 |
! |
|
3557 |
||
3558 |
glxRpatchX:arrayOf16XFloats y:arrayOf16YFloats z:arrayOf16ZFloats w:arrayOf16WFloats in:aGLXWindowId |
|
3559 |
"Draws a rational bicubic patch. |
|
3560 |
arguments must be arrays of 16 floats containing the patch" |
|
3561 |
||
3562 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3563 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3564 |
#else |
529 | 3565 |
Matrix matrixX, matrixY, matrixZ, matrixW; |
3566 |
Matrix *mX, *mY, *mZ, *mW; |
|
528 | 3567 |
|
2814 | 3568 |
if (! (mX = __glx_getFloatsFromMatrixInto(arrayOf16XFloats, matrixX))) |
1932 | 3569 |
RETURN (nil); |
2814 | 3570 |
if (! (mY = __glx_getFloatsFromMatrixInto(arrayOf16YFloats, matrixY))) |
1932 | 3571 |
RETURN (nil); |
2814 | 3572 |
if (! (mZ = __glx_getFloatsFromMatrixInto(arrayOf16ZFloats, matrixZ))) |
1932 | 3573 |
RETURN (nil); |
2814 | 3574 |
if (! (mW = __glx_getFloatsFromMatrixInto(arrayOf16WFloats, matrixW))) |
1932 | 3575 |
RETURN (nil); |
529 | 3576 |
SETWIN(aGLXWindowId) |
3577 |
rpatch(*mX, *mY, *mZ, *mW); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3578 |
#endif |
528 | 3579 |
%} |
3580 |
||
3581 |
"Modified: 19.3.1996 / 18:54:02 / cg" |
|
3582 |
"Created: 19.3.1996 / 18:56:34 / cg" |
|
3583 |
! ! |
|
3584 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3585 |
!GLXWorkstation methodsFor:'pixel copy'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3586 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3587 |
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
|
3588 |
"copy a rectangular area in the view. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3589 |
For now, this is only supported with a true GL. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3590 |
readsource specifies which plane/buffer is affected by this operation." |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3591 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3592 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3593 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3594 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3595 |
rectcopy(_screencoordVal(x1), _screencoordVal(y1), |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3596 |
_screencoordVal(x2), _screencoordVal(y2), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3597 |
_screencoordVal(newx), _screencoordVal(newy)); |
1932 | 3598 |
#endif |
3599 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3600 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3601 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3602 |
!GLXWorkstation methodsFor:'pixel reading'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3603 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3604 |
glxReadpixelsTo:dest in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3605 |
"read pixels from the view. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3606 |
Dest must be an array and gets pixel values assigned, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3607 |
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
|
3608 |
For now, pixel-reading is only supported with a true GL. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3609 |
Caveat: the number of pixels is limited to 256. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3610 |
In double buffer mode, the backBuffer is read." |
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 |
|n| |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3613 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3614 |
n := dest size. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3615 |
n > 256 ifTrue:[^ 0]. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3616 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3617 |
%{ /* STACK:1024 */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3618 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3619 |
Colorindex buffer[256]; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3620 |
int i, nRead; |
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 |
if (__isArray(dest)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3623 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3624 |
nRead = readpixels(__intVal(n), buffer); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3625 |
for (i=0; i<nRead;i++) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3626 |
__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
|
3627 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3628 |
RETURN (__MKSMALLINT(nRead)); |
537
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 |
#endif |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3631 |
%}. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3632 |
^ 0 |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3633 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3634 |
"Modified: 22.3.1996 / 18:08:00 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3635 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3636 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3637 |
glxReadsource: src in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3638 |
"specify what is read with folowing readPixels requests. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3639 |
For now, pixel-reading is only supported with a true GL" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3640 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3641 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3642 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3643 |
OBJ s = src; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3644 |
int what; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3645 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3646 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3647 |
if (s == @symbol(auto)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3648 |
what = SRC_AUTO; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3649 |
} else if (s == @symbol(front)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3650 |
what = SRC_FRONT; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3651 |
} else if (s == @symbol(back)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3652 |
what = SRC_BACK; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3653 |
} else if (s == @symbol(zBuffer)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3654 |
what = SRC_ZBUFFER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3655 |
} else if (s == @symbol(frameGrabber)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3656 |
what = SRC_FRAMEGRABBER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3657 |
} else if (s == @symbol(over)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3658 |
what = SRC_OVER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3659 |
} else if (s == @symbol(under)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3660 |
what = SRC_UNDER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3661 |
} else if (s == @symbol(popUp)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3662 |
what = SRC_PUP; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3663 |
} else { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3664 |
what = _longVal(src); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3665 |
} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3666 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3667 |
readsource(what); |
1932 | 3668 |
#endif |
3669 |
%} |
|
538 | 3670 |
! |
3671 |
||
541 | 3672 |
glxRectreadX1:x1 y1:y1 x2:x2 y2:y2 h:viewHeight to:dest in:aGLXWindowId |
538 | 3673 |
"read pixels from a rectanglular area. |
3674 |
Dest must be an array and gets pixel values assigned, |
|
3675 |
reading n*m pixels. |
|
3676 |
For now, pixel-reading is only supported with a true GL. |
|
3677 |
Caveat: the number of pixels is limited to 256. |
|
3678 |
In double buffer mode, the backBuffer is read." |
|
3679 |
||
541 | 3680 |
|n idx sy1 sy2| |
3681 |
||
3682 |
"/ GLX's y coordinates go bottom to top ... |
|
3683 |
||
3684 |
sy1 := viewHeight - y1. |
|
3685 |
sy2 := viewHeight - y2. |
|
538 | 3686 |
|
3687 |
n := (x2 - x1 + 1) * (y2 - y1 + 1). |
|
3688 |
n > 256 ifTrue:[^ 0]. |
|
3689 |
dest size < n ifTrue:[^ 0]. |
|
3690 |
||
3691 |
%{ /* STACK:1024 */ |
|
3692 |
#ifdef GLX |
|
3693 |
Colorindex buffer[256]; |
|
3694 |
int i, nRead; |
|
3695 |
||
3696 |
if (__isArray(dest) |
|
3697 |
&& __isSmallInteger(x1) && __isSmallInteger(x2) |
|
541 | 3698 |
&& __isSmallInteger(sy1) && __isSmallInteger(sy2) |
538 | 3699 |
) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3700 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3701 |
nRead = rectread(__intVal(x1), __intVal(sy1), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3702 |
__intVal(x2), __intVal(sy2), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3703 |
buffer); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3704 |
for (i=0; i<nRead;i++) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3705 |
__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
|
3706 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3707 |
RETURN (__MKSMALLINT(nRead)); |
538 | 3708 |
} |
3709 |
#endif |
|
3710 |
%}. |
|
3711 |
"/ |
|
3712 |
"/ ok, this is not a GL - use XWorkstations pixel read method |
|
3713 |
"/ and convert |
|
3714 |
"/ |
|
3715 |
idx := 1. |
|
3716 |
y1 to:y2 do:[:y | |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3717 |
x1 to:x2 do:[:x | |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3718 |
|pix| |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3719 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3720 |
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
|
3721 |
dest at:idx put:pix |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3722 |
] |
538 | 3723 |
]. |
3724 |
^ n |
|
3725 |
||
3726 |
"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
|
3727 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3728 |
! |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3729 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3730 |
glxXColorToGLColor:pixel |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3731 |
"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
|
3732 |
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
|
3733 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3734 |
%{ /* NOCONTEXT */ |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3735 |
#ifdef VGL |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3736 |
if (__isSmallInteger(pixel)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3737 |
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
|
3738 |
} |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3739 |
#endif |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3740 |
%}. |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3741 |
^ pixel |
543
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3742 |
! |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3743 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3744 |
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
|
3745 |
"special for VGL" |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3746 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3747 |
%{ |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3748 |
#ifdef VGL |
1932 | 3749 |
if (__bothSmallInteger(x, y)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3750 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3751 |
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
|
3752 |
} |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3753 |
#endif |
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 |
^ 0 |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3756 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3757 |
"Modified: 22.3.1996 / 18:08:00 / cg" |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3758 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3759 |
|
528 | 3760 |
!GLXWorkstation methodsFor:'points'! |
3761 |
||
3762 |
glxPnt2X: x y: y in: aGLXWindowId |
|
3763 |
"plot a point in x, y, 0." |
|
3764 |
||
3765 |
%{ /* NOCONTEXT */ |
|
3766 |
Coord c_x, c_y; |
|
3767 |
||
3768 |
_COORD_ (x, c_x) |
|
3769 |
_COORD_ (y, c_y) |
|
3770 |
SETWIN(aGLXWindowId) |
|
1932 | 3771 |
#ifdef OPENGL |
3772 |
#else |
|
528 | 3773 |
pnt2(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3774 |
#endif |
528 | 3775 |
%} |
3776 |
||
3777 |
"Modified: 19.3.1996 / 18:35:55 / cg" |
|
3778 |
! |
|
3779 |
||
3780 |
glxPnt2iX: x y: y in: aGLXWindowId |
|
3781 |
"plot a point in x, y, 0." |
|
3782 |
||
3783 |
%{ /* NOCONTEXT */ |
|
3784 |
Icoord c_x, c_y; |
|
3785 |
||
3786 |
_ICOORD_ (x, c_x) |
|
3787 |
_ICOORD_ (y, c_y) |
|
3788 |
SETWIN(aGLXWindowId) |
|
1932 | 3789 |
#ifdef OPENGL |
3790 |
#else |
|
528 | 3791 |
pnt2i(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3792 |
#endif |
528 | 3793 |
%} |
3794 |
||
3795 |
"Modified: 19.3.1996 / 18:35:59 / cg" |
|
3796 |
! |
|
3797 |
||
3798 |
glxPnt2sX: x y: y in: aGLXWindowId |
|
3799 |
"plot a point in x, y, 0." |
|
3800 |
||
3801 |
%{ /* NOCONTEXT */ |
|
3802 |
Scoord c_x, c_y; |
|
3803 |
||
3804 |
_SCOORD_ (x, c_x) |
|
3805 |
_SCOORD_ (y, c_y) |
|
3806 |
SETWIN(aGLXWindowId) |
|
1932 | 3807 |
#ifdef OPENGL |
3808 |
#else |
|
528 | 3809 |
pnt2s(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3810 |
#endif |
528 | 3811 |
%} |
3812 |
||
3813 |
"Modified: 19.3.1996 / 18:36:03 / cg" |
|
3814 |
! |
|
3815 |
||
3816 |
glxPntX: x y: y z: z in: aGLXWindowId |
|
3817 |
"plot a point in x, y, z." |
|
3818 |
||
3819 |
%{ /* NOCONTEXT */ |
|
3820 |
Coord c_x, c_y, c_z; |
|
3821 |
||
3822 |
_COORD_ (x, c_x) |
|
3823 |
_COORD_ (y, c_y) |
|
3824 |
_COORD_ (z, c_z) |
|
3825 |
SETWIN(aGLXWindowId) |
|
1932 | 3826 |
#ifdef OPENGL |
3827 |
#else |
|
528 | 3828 |
pnt(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3829 |
#endif |
528 | 3830 |
%} |
3831 |
||
3832 |
"Modified: 19.3.1996 / 18:36:08 / cg" |
|
3833 |
! |
|
3834 |
||
3835 |
glxPntiX: x y: y z: z in: aGLXWindowId |
|
3836 |
"plot a point in x, y, z." |
|
3837 |
||
3838 |
%{ /* NOCONTEXT */ |
|
3839 |
Icoord c_x, c_y, c_z; |
|
3840 |
||
3841 |
_ICOORD_ (x, c_x) |
|
3842 |
_ICOORD_ (y, c_y) |
|
3843 |
_ICOORD_ (z, c_z) |
|
3844 |
SETWIN(aGLXWindowId) |
|
1932 | 3845 |
#ifdef OPENGL |
3846 |
#else |
|
528 | 3847 |
pnti(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3848 |
#endif |
528 | 3849 |
%} |
3850 |
||
3851 |
"Modified: 19.3.1996 / 18:36:14 / cg" |
|
3852 |
! |
|
3853 |
||
3854 |
glxPntsX: x y: y z: z in: aGLXWindowId |
|
3855 |
"plot a point in x, y, z." |
|
3856 |
||
3857 |
%{ /* NOCONTEXT */ |
|
3858 |
Scoord c_x, c_y, c_z; |
|
3859 |
||
3860 |
_SCOORD_ (x, c_x) |
|
3861 |
_SCOORD_ (y, c_y) |
|
3862 |
_SCOORD_ (z, c_z) |
|
3863 |
SETWIN(aGLXWindowId) |
|
1932 | 3864 |
#ifdef OPENGL |
3865 |
#else |
|
528 | 3866 |
pnts(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3867 |
#endif |
528 | 3868 |
%} |
3869 |
||
3870 |
"Modified: 19.3.1996 / 18:36:17 / cg" |
|
3871 |
! |
|
3872 |
||
3873 |
glxPntsize: n in: aGLXWindowId |
|
3874 |
||
3875 |
%{ /* NOCONTEXT */ |
|
1932 | 3876 |
SETWIN(aGLXWindowId) |
3877 |
#ifdef GLX |
|
528 | 3878 |
pntsize(_shortVal(n)); |
1932 | 3879 |
#endif |
3880 |
%} |
|
528 | 3881 |
! |
3882 |
||
3883 |
glxPntsizef: n in: aGLXWindowId |
|
3884 |
||
3885 |
%{ /* NOCONTEXT */ |
|
1932 | 3886 |
SETWIN(aGLXWindowId) |
3887 |
#ifdef GLX |
|
528 | 3888 |
pntsizef(_floatVal(n)); |
1932 | 3889 |
#endif |
3890 |
%} |
|
528 | 3891 |
! ! |
3892 |
||
3893 |
!GLXWorkstation methodsFor:'polygons'! |
|
3894 |
||
3895 |
glxBackface: b in: aGLXWindowId |
|
3896 |
"enable/disable culling of backfacing polygons (suppress its drawing). |
|
3897 |
A polygon is backfacing if it's orientation in *screen* coords is clockwise" |
|
3898 |
||
3899 |
%{ /* NOCONTEXT */ |
|
3900 |
SETWIN(aGLXWindowId) |
|
1932 | 3901 |
#ifdef OPENGL |
3902 |
#else |
|
528 | 3903 |
backface(_booleanVal(b)); |
1932 | 3904 |
#endif |
528 | 3905 |
%} |
3906 |
||
3907 |
"Modified: 19.3.1996 / 18:26:50 / cg" |
|
3908 |
! |
|
3909 |
||
3910 |
glxConcave: b in: aGLXWindowId |
|
3911 |
"signal wether or not polygons are concave" |
|
3912 |
||
3913 |
%{ /* NOCONTEXT */ |
|
3914 |
SETWIN(aGLXWindowId) |
|
1932 | 3915 |
#ifdef OPENGL |
3916 |
#else |
|
528 | 3917 |
concave(_booleanVal(b)); |
1932 | 3918 |
#endif |
528 | 3919 |
%} |
3920 |
! |
|
3921 |
||
3922 |
glxFrontface: b in: aGLXWindowId |
|
3923 |
"enable/disable culling of frontfacing polygons (suppress its drawing). |
|
3924 |
A polygon is frontfacing if it's orientation in *screen* coords is |
|
3925 |
anti-clockwise" |
|
3926 |
||
3927 |
||
3928 |
%{ /* NOCONTEXT */ |
|
3929 |
SETWIN(aGLXWindowId) |
|
1932 | 3930 |
#ifdef OPENGL |
3931 |
#else |
|
528 | 3932 |
frontface(_booleanVal(b)); |
1932 | 3933 |
#endif |
3934 |
%} |
|
528 | 3935 |
! |
3936 |
||
3937 |
glxPdr2X: x y: y in: aGLXWindowId |
|
3938 |
"add another vertex to the polygon" |
|
3939 |
||
3940 |
%{ /* NOCONTEXT */ |
|
3941 |
Coord c_x, c_y; |
|
3942 |
||
3943 |
_COORD_ (x, c_x) |
|
3944 |
_COORD_ (y, c_y) |
|
3945 |
SETWIN(aGLXWindowId) |
|
1932 | 3946 |
#ifdef OPENGL |
3947 |
#else |
|
528 | 3948 |
pdr2(c_x, c_y); |
1932 | 3949 |
#endif |
3950 |
%} |
|
528 | 3951 |
! |
3952 |
||
3953 |
glxPdr2iX: x y: y in: aGLXWindowId |
|
3954 |
"add another vertex to the polygon" |
|
3955 |
||
3956 |
%{ /* NOCONTEXT */ |
|
3957 |
Icoord c_x, c_y; |
|
3958 |
||
3959 |
_ICOORD_ (x, c_x) |
|
3960 |
_ICOORD_ (y, c_y) |
|
3961 |
SETWIN(aGLXWindowId) |
|
1932 | 3962 |
#ifdef OPENGL |
3963 |
#else |
|
528 | 3964 |
pdr2i(c_x, c_y); |
1932 | 3965 |
#endif |
528 | 3966 |
%} |
3967 |
||
3968 |
"Modified: 19.3.1996 / 18:33:28 / cg" |
|
3969 |
! |
|
3970 |
||
3971 |
glxPdr2sX: x y: y in: aGLXWindowId |
|
3972 |
"add another vertex to the polygon" |
|
3973 |
||
3974 |
%{ /* NOCONTEXT */ |
|
3975 |
Scoord c_x, c_y; |
|
3976 |
||
3977 |
_SCOORD_ (x, c_x) |
|
3978 |
_SCOORD_ (y, c_y) |
|
3979 |
SETWIN(aGLXWindowId) |
|
1932 | 3980 |
#ifdef OPENGL |
3981 |
#else |
|
528 | 3982 |
pdr2s(c_x, c_y); |
1932 | 3983 |
#endif |
528 | 3984 |
%} |
3985 |
||
3986 |
"Modified: 19.3.1996 / 18:34:03 / cg" |
|
3987 |
! |
|
3988 |
||
3989 |
glxPdrX: x y: y z: z in: aGLXWindowId |
|
3990 |
"add another vertex to the polygon" |
|
3991 |
||
3992 |
%{ /* NOCONTEXT */ |
|
3993 |
Coord c_x, c_y, c_z; |
|
3994 |
||
3995 |
_COORD_ (x, c_x) |
|
3996 |
_COORD_ (y, c_y) |
|
3997 |
_COORD_ (z, c_z) |
|
3998 |
SETWIN(aGLXWindowId) |
|
1932 | 3999 |
#ifdef OPENGL |
4000 |
#else |
|
528 | 4001 |
pdr(c_x, c_y, c_z); |
1932 | 4002 |
#endif |
528 | 4003 |
%} |
4004 |
||
4005 |
"Modified: 19.3.1996 / 18:34:06 / cg" |
|
4006 |
! |
|
4007 |
||
4008 |
glxPdriX: x y: y z: z in: aGLXWindowId |
|
4009 |
"add another vertex to the polygon" |
|
4010 |
||
4011 |
%{ /* NOCONTEXT */ |
|
4012 |
Icoord c_x, c_y, c_z; |
|
4013 |
||
4014 |
_ICOORD_ (x, c_x) |
|
4015 |
_ICOORD_ (y, c_y) |
|
4016 |
_ICOORD_ (z, c_z) |
|
4017 |
SETWIN(aGLXWindowId) |
|
1932 | 4018 |
#ifdef OPENGL |
4019 |
#else |
|
528 | 4020 |
pdri(c_x, c_y, c_z); |
1932 | 4021 |
#endif |
528 | 4022 |
%} |
4023 |
||
4024 |
"Modified: 19.3.1996 / 18:34:11 / cg" |
|
4025 |
! |
|
4026 |
||
4027 |
glxPdrsX: x y: y z: z in: aGLXWindowId |
|
4028 |
"add another vertex to the polygon" |
|
4029 |
||
4030 |
%{ /* NOCONTEXT */ |
|
4031 |
Scoord c_x, c_y, c_z; |
|
4032 |
||
4033 |
_SCOORD_ (x, c_x) |
|
4034 |
_SCOORD_ (y, c_y) |
|
4035 |
_SCOORD_ (z, c_z) |
|
4036 |
SETWIN(aGLXWindowId) |
|
1932 | 4037 |
#ifdef OPENGL |
4038 |
#else |
|
528 | 4039 |
pdrs(c_x, c_y, c_z); |
1932 | 4040 |
#endif |
528 | 4041 |
%} |
4042 |
||
4043 |
"Modified: 19.3.1996 / 18:34:14 / cg" |
|
4044 |
! |
|
4045 |
||
4046 |
glxPmv2X: x y: y in: aGLXWindowId |
|
4047 |
"set the start position of a polygon" |
|
4048 |
||
4049 |
%{ /* NOCONTEXT */ |
|
4050 |
Coord c_x, c_y; |
|
4051 |
||
4052 |
_COORD_ (x, c_x) |
|
4053 |
_COORD_ (y, c_y) |
|
4054 |
SETWIN(aGLXWindowId) |
|
1932 | 4055 |
#ifdef OPENGL |
4056 |
#else |
|
528 | 4057 |
pmv2(c_x, c_y); |
1932 | 4058 |
#endif |
528 | 4059 |
%} |
4060 |
||
4061 |
"Modified: 19.3.1996 / 18:32:45 / cg" |
|
4062 |
! |
|
4063 |
||
4064 |
glxPmv2iX: x y: y in: aGLXWindowId |
|
4065 |
"set the start position of a polygon" |
|
4066 |
||
4067 |
%{ /* NOCONTEXT */ |
|
4068 |
Icoord c_x, c_y; |
|
4069 |
||
4070 |
_ICOORD_ (x, c_x) |
|
4071 |
_ICOORD_ (y, c_y) |
|
4072 |
SETWIN(aGLXWindowId) |
|
1932 | 4073 |
#ifdef OPENGL |
4074 |
#else |
|
528 | 4075 |
pmv2i(c_x, c_y); |
1932 | 4076 |
#endif |
528 | 4077 |
%} |
4078 |
||
4079 |
"Modified: 19.3.1996 / 18:32:42 / cg" |
|
4080 |
! |
|
4081 |
||
4082 |
glxPmv2sX: x y: y in: aGLXWindowId |
|
4083 |
"set the start position of a polygon" |
|
4084 |
||
4085 |
%{ /* NOCONTEXT */ |
|
4086 |
Scoord c_x, c_y; |
|
4087 |
||
4088 |
_SCOORD_ (x, c_x) |
|
4089 |
_SCOORD_ (y, c_y) |
|
4090 |
SETWIN(aGLXWindowId) |
|
1932 | 4091 |
#ifdef OPENGL |
4092 |
#else |
|
528 | 4093 |
pmv2s(c_x, c_y); |
1932 | 4094 |
#endif |
528 | 4095 |
%} |
4096 |
||
4097 |
"Modified: 19.3.1996 / 18:32:38 / cg" |
|
4098 |
! |
|
4099 |
||
4100 |
glxPmvX: x y: y z: z in: aGLXWindowId |
|
4101 |
"set the start position of a polygon" |
|
4102 |
||
4103 |
%{ /* NOCONTEXT */ |
|
4104 |
Coord c_x, c_y, c_z; |
|
4105 |
||
4106 |
_COORD_ (x, c_x) |
|
4107 |
_COORD_ (y, c_y) |
|
4108 |
_COORD_ (z, c_z) |
|
4109 |
SETWIN(aGLXWindowId) |
|
1932 | 4110 |
#ifdef OPENGL |
4111 |
#else |
|
528 | 4112 |
pmv(c_x, c_y, c_z); |
1932 | 4113 |
#endif |
528 | 4114 |
%} |
4115 |
||
4116 |
"Modified: 19.3.1996 / 18:31:52 / cg" |
|
4117 |
! |
|
4118 |
||
4119 |
glxPmviX: x y: y z: z in: aGLXWindowId |
|
4120 |
"set the start position of a polygon" |
|
4121 |
||
4122 |
%{ /* NOCONTEXT */ |
|
4123 |
Icoord c_x, c_y, c_z; |
|
4124 |
||
4125 |
_ICOORD_ (x, c_x) |
|
4126 |
_ICOORD_ (y, c_y) |
|
4127 |
_ICOORD_ (z, c_z) |
|
4128 |
SETWIN(aGLXWindowId) |
|
1932 | 4129 |
#ifdef OPENGL |
4130 |
#else |
|
528 | 4131 |
pmvi(c_x, c_y, c_z); |
1932 | 4132 |
#endif |
528 | 4133 |
%} |
4134 |
||
4135 |
"Modified: 19.3.1996 / 18:31:59 / cg" |
|
4136 |
! |
|
4137 |
||
4138 |
glxPmvsX: x y: y z: z in: aGLXWindowId |
|
4139 |
"set the start position of a polygon" |
|
4140 |
||
4141 |
%{ /* NOCONTEXT */ |
|
4142 |
Scoord c_x, c_y, c_z; |
|
4143 |
||
4144 |
_SCOORD_ (x, c_x) |
|
4145 |
_SCOORD_ (y, c_y) |
|
4146 |
_SCOORD_ (z, c_z) |
|
4147 |
SETWIN(aGLXWindowId) |
|
1932 | 4148 |
#ifdef OPENGL |
4149 |
#else |
|
528 | 4150 |
pmvs(c_x, c_y, c_z); |
1932 | 4151 |
#endif |
528 | 4152 |
%} |
4153 |
||
4154 |
"Modified: 19.3.1996 / 18:32:03 / cg" |
|
4155 |
! |
|
4156 |
||
4157 |
glxPolymode: mode in: aGLXWindowId |
|
4158 |
"Sets the polygon filling mode - only filled (1) or outlined (0) |
|
4159 |
are supported" |
|
4160 |
||
4161 |
%{ /* NOCONTEXT */ |
|
4162 |
SETWIN(aGLXWindowId) |
|
1932 | 4163 |
#ifdef OPENGL |
4164 |
#else |
|
528 | 4165 |
polymode(_longVal(mode)); |
1932 | 4166 |
#endif |
528 | 4167 |
%} |
4168 |
||
4169 |
"Modified: 19.3.1996 / 18:29:32 / cg" |
|
4170 |
! |
|
4171 |
||
4172 |
glxRpdr2X: x y: y in: aGLXWindowId |
|
4173 |
"add another relative vertex to the polygon" |
|
4174 |
||
4175 |
%{ /* NOCONTEXT */ |
|
4176 |
Coord c_x, c_y; |
|
4177 |
||
4178 |
_COORD_ (x, c_x) |
|
4179 |
_COORD_ (y, c_y) |
|
4180 |
SETWIN(aGLXWindowId) |
|
1932 | 4181 |
#ifdef OPENGL |
4182 |
#else |
|
528 | 4183 |
rpdr2(c_x, c_y); |
1932 | 4184 |
#endif |
528 | 4185 |
%} |
4186 |
||
4187 |
"Modified: 19.3.1996 / 18:34:31 / cg" |
|
4188 |
! |
|
4189 |
||
4190 |
glxRpdr2iX: x y: y in: aGLXWindowId |
|
4191 |
"add another relative vertex to the polygon" |
|
4192 |
||
4193 |
%{ /* NOCONTEXT */ |
|
4194 |
Icoord c_x, c_y; |
|
4195 |
||
4196 |
_ICOORD_ (x, c_x) |
|
4197 |
_ICOORD_ (y, c_y) |
|
4198 |
SETWIN(aGLXWindowId) |
|
1932 | 4199 |
#ifdef OPENGL |
4200 |
#else |
|
528 | 4201 |
rpdr2i(c_x, c_y); |
1932 | 4202 |
#endif |
528 | 4203 |
%} |
4204 |
||
4205 |
"Modified: 19.3.1996 / 18:34:36 / cg" |
|
4206 |
! |
|
4207 |
||
4208 |
glxRpdr2sX: x y: y in: aGLXWindowId |
|
4209 |
"add another relative vertex to the polygon" |
|
4210 |
||
4211 |
%{ /* NOCONTEXT */ |
|
4212 |
Scoord c_x, c_y; |
|
4213 |
||
4214 |
_SCOORD_ (x, c_x) |
|
4215 |
_SCOORD_ (y, c_y) |
|
4216 |
SETWIN(aGLXWindowId) |
|
1932 | 4217 |
#ifdef OPENGL |
4218 |
#else |
|
528 | 4219 |
rpdr2s(c_x, c_y); |
1932 | 4220 |
#endif |
528 | 4221 |
%} |
4222 |
||
4223 |
"Modified: 19.3.1996 / 18:34:40 / cg" |
|
4224 |
! |
|
4225 |
||
4226 |
glxRpdrX: x y: y z: z in: aGLXWindowId |
|
4227 |
"add another relative vertex to the polygon" |
|
4228 |
||
4229 |
%{ /* NOCONTEXT */ |
|
4230 |
Coord c_x, c_y, c_z; |
|
4231 |
||
4232 |
_COORD_ (x, c_x) |
|
4233 |
_COORD_ (y, c_y) |
|
4234 |
_COORD_ (z, c_z) |
|
4235 |
SETWIN(aGLXWindowId) |
|
1932 | 4236 |
#ifdef OPENGL |
4237 |
#else |
|
528 | 4238 |
rpdr(c_x, c_y, c_z); |
1932 | 4239 |
#endif |
528 | 4240 |
%} |
4241 |
||
4242 |
"Modified: 19.3.1996 / 18:34:48 / cg" |
|
4243 |
! |
|
4244 |
||
4245 |
glxRpdriX: x y: y z: z in: aGLXWindowId |
|
4246 |
"add another relative vertex to the polygon" |
|
4247 |
||
4248 |
%{ /* NOCONTEXT */ |
|
4249 |
Icoord c_x, c_y, c_z; |
|
4250 |
||
4251 |
_ICOORD_ (x, c_x) |
|
4252 |
_ICOORD_ (y, c_y) |
|
4253 |
_ICOORD_ (z, c_z) |
|
4254 |
SETWIN(aGLXWindowId) |
|
1932 | 4255 |
#ifdef OPENGL |
4256 |
#else |
|
528 | 4257 |
rpdri(c_x, c_y, c_z); |
1932 | 4258 |
#endif |
528 | 4259 |
%} |
4260 |
||
4261 |
"Modified: 19.3.1996 / 18:34:51 / cg" |
|
4262 |
! |
|
4263 |
||
4264 |
glxRpdrsX: x y: y z: z in: aGLXWindowId |
|
4265 |
"add another relative vertex to the polygon" |
|
4266 |
||
4267 |
%{ /* NOCONTEXT */ |
|
4268 |
Scoord c_x, c_y, c_z; |
|
4269 |
||
4270 |
_SCOORD_ (x, c_x) |
|
4271 |
_SCOORD_ (y, c_y) |
|
4272 |
_SCOORD_ (z, c_z) |
|
4273 |
SETWIN(aGLXWindowId) |
|
1932 | 4274 |
#ifdef OPENGL |
4275 |
#else |
|
528 | 4276 |
rpdrs(c_x, c_y, c_z); |
1932 | 4277 |
#endif |
528 | 4278 |
%} |
4279 |
||
4280 |
"Modified: 19.3.1996 / 18:34:55 / cg" |
|
4281 |
! |
|
4282 |
||
4283 |
glxRpmv2X: x y: y in: aGLXWindowId |
|
4284 |
"set the start position of a polygon" |
|
4285 |
||
4286 |
%{ /* NOCONTEXT */ |
|
4287 |
Coord c_x, c_y; |
|
4288 |
||
4289 |
_COORD_ (x, c_x) |
|
4290 |
_COORD_ (y, c_y) |
|
4291 |
SETWIN(aGLXWindowId) |
|
1932 | 4292 |
#ifdef OPENGL |
4293 |
#else |
|
528 | 4294 |
rpmv2(c_x, c_y); |
1932 | 4295 |
#endif |
528 | 4296 |
%} |
4297 |
||
4298 |
"Modified: 19.3.1996 / 18:37:15 / cg" |
|
4299 |
! |
|
4300 |
||
4301 |
glxRpmv2iX: x y: y in: aGLXWindowId |
|
4302 |
"set the start position of a polygon" |
|
4303 |
||
4304 |
%{ /* NOCONTEXT */ |
|
4305 |
Icoord c_x, c_y; |
|
4306 |
||
4307 |
_ICOORD_ (x, c_x) |
|
4308 |
_ICOORD_ (y, c_y) |
|
4309 |
SETWIN(aGLXWindowId) |
|
1932 | 4310 |
#ifdef OPENGL |
4311 |
#else |
|
528 | 4312 |
rpmv2i(c_x, c_y); |
1932 | 4313 |
#endif |
528 | 4314 |
%} |
4315 |
||
4316 |
"Modified: 19.3.1996 / 18:37:20 / cg" |
|
4317 |
! |
|
4318 |
||
4319 |
glxRpmv2sX: x y: y in: aGLXWindowId |
|
4320 |
"set the relative start position of a polygon" |
|
4321 |
||
4322 |
%{ /* NOCONTEXT */ |
|
4323 |
Scoord c_x, c_y; |
|
4324 |
||
4325 |
_SCOORD_ (x, c_x) |
|
4326 |
_SCOORD_ (y, c_y) |
|
4327 |
SETWIN(aGLXWindowId) |
|
1932 | 4328 |
#ifdef OPENGL |
4329 |
#else |
|
528 | 4330 |
rpmv2s(c_x, c_y); |
1932 | 4331 |
#endif |
528 | 4332 |
%} |
4333 |
||
4334 |
"Modified: 19.3.1996 / 18:38:06 / cg" |
|
4335 |
! |
|
4336 |
||
4337 |
glxRpmvX: x y: y z: z in: aGLXWindowId |
|
4338 |
"set the relative start position of a polygon" |
|
4339 |
||
4340 |
%{ /* NOCONTEXT */ |
|
4341 |
Coord c_x, c_y, c_z; |
|
4342 |
||
4343 |
_COORD_ (x, c_x) |
|
4344 |
_COORD_ (y, c_y) |
|
4345 |
_COORD_ (z, c_z) |
|
4346 |
SETWIN(aGLXWindowId) |
|
1932 | 4347 |
#ifdef OPENGL |
4348 |
#else |
|
528 | 4349 |
rpmv(c_x, c_y, c_z); |
1932 | 4350 |
#endif |
528 | 4351 |
%} |
4352 |
||
4353 |
"Modified: 19.3.1996 / 18:38:03 / cg" |
|
4354 |
! |
|
4355 |
||
4356 |
glxRpmviX: x y: y z: z in: aGLXWindowId |
|
4357 |
"set the relative start position of a polygon" |
|
4358 |
||
4359 |
%{ /* NOCONTEXT */ |
|
4360 |
Icoord c_x, c_y, c_z; |
|
4361 |
||
4362 |
_ICOORD_ (x, c_x) |
|
4363 |
_ICOORD_ (y, c_y) |
|
4364 |
_ICOORD_ (z, c_z) |
|
4365 |
SETWIN(aGLXWindowId) |
|
1932 | 4366 |
#ifdef OPENGL |
4367 |
#else |
|
528 | 4368 |
rpmvi(c_x, c_y, c_z); |
1932 | 4369 |
#endif |
528 | 4370 |
%} |
4371 |
||
4372 |
"Modified: 19.3.1996 / 18:37:53 / cg" |
|
4373 |
! |
|
4374 |
||
4375 |
glxRpmvsX: x y: y z: z in: aGLXWindowId |
|
4376 |
"set the relative start position of a polygon" |
|
4377 |
||
4378 |
%{ /* NOCONTEXT */ |
|
4379 |
Scoord c_x, c_y, c_z; |
|
4380 |
||
4381 |
_SCOORD_ (x, c_x) |
|
4382 |
_SCOORD_ (y, c_y) |
|
4383 |
_SCOORD_ (z, c_z) |
|
4384 |
SETWIN(aGLXWindowId) |
|
1932 | 4385 |
#ifdef OPENGL |
4386 |
#else |
|
528 | 4387 |
rpmvs(c_x, c_y, c_z); |
1932 | 4388 |
#endif |
528 | 4389 |
%} |
4390 |
||
4391 |
"Modified: 19.3.1996 / 18:37:58 / cg" |
|
294 | 4392 |
! ! |
4393 |
||
24 | 4394 |
!GLXWorkstation methodsFor:'queries'! |
4395 |
||
159 | 4396 |
glVersion |
4397 |
"return a string describing the GL version. |
|
4398 |
For informative use only; portable applications do not depend |
|
4399 |
on the returned string." |
|
4400 |
||
4401 |
%{ /* NOCONTEXT */ |
|
4402 |
#ifdef VGL |
|
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
4403 |
RETURN (__MKSTRING("vogl")); |
159 | 4404 |
#else |
1932 | 4405 |
# ifdef GLX |
159 | 4406 |
char buffer[128]; |
4407 |
||
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4408 |
if (_INST(glOK) == true) { |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4409 |
gversion(buffer); |
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
4410 |
RETURN (__MKSTRING(buffer)); |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4411 |
} |
1932 | 4412 |
RETURN (nil); |
4413 |
# else |
|
4414 |
RETURN (nil); |
|
4415 |
# endif |
|
159 | 4416 |
#endif |
4417 |
%} |
|
4418 |
||
4419 |
" |
|
4420 |
Display glVersion |
|
4421 |
" |
|
4422 |
! |
|
4423 |
||
528 | 4424 |
glxGetplanesIn: aGLXWindowId |
4425 |
"Returns the number if bit planes available on the device." |
|
4426 |
||
4427 |
%{ /* NOCONTEXT */ |
|
1932 | 4428 |
SETWIN(aGLXWindowId) |
4429 |
#ifdef OPENGL |
|
4430 |
#else |
|
528 | 4431 |
RETURN (__MKSMALLINT(getplanes())); |
4432 |
#endif |
|
1932 | 4433 |
%}. |
4434 |
^ 0 |
|
528 | 4435 |
|
4436 |
"Modified: 19.3.1996 / 18:50:44 / cg" |
|
4437 |
! |
|
4438 |
||
294 | 4439 |
hasStereoExtension |
4440 |
"return true, if this workstation supports stereo GL drawing. |
|
4441 |
Both the server must support it, and the feature must have been |
|
4442 |
enabled in the smalltalk system, for true to be returned." |
|
4443 |
||
4444 |
^ hasStereoExtension |
|
4445 |
||
4446 |
" |
|
4447 |
Display hasStereoExtension |
|
4448 |
" |
|
4449 |
! |
|
4450 |
||
3214 | 4451 |
isOpenGL |
4452 |
"return true, if this is an openGL (as opposed to a GL)" |
|
4453 |
||
4454 |
%{ /* NOCONTEXT */ |
|
4455 |
#ifdef OPENGL |
|
4456 |
RETURN ( true ); |
|
4457 |
#else |
|
4458 |
RETURN ( false ); |
|
4459 |
#endif |
|
4460 |
%} |
|
4461 |
! |
|
4462 |
||
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4463 |
isTrueGL |
1932 | 4464 |
"return true, if this is a true GL (as opposed to a simulated VOGL). |
4465 |
Returns false for all openGL systems." |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4466 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4467 |
%{ /* NOCONTEXT */ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4468 |
#ifdef VGL |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4469 |
RETURN ( false ); |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4470 |
#else |
1932 | 4471 |
# ifdef GLX |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4472 |
RETURN ( true ); |
1932 | 4473 |
# endif |
4474 |
#endif |
|
3214 | 4475 |
%}. |
4476 |
^ false |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4477 |
! |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4478 |
|
294 | 4479 |
maxZValue |
4480 |
"return the max. Z value (only valid if z-buffer is supported)" |
|
4481 |
%{ |
|
1932 | 4482 |
#ifndef OPENGL |
4483 |
# ifdef GD_ZMAX |
|
294 | 4484 |
long zMax; |
4485 |
||
4486 |
if (_INST(glOK) == true) { |
|
4487 |
zMax = getgdesc(GD_ZMAX); |
|
4488 |
||
4489 |
if ((zMax >= _MIN_INT) && (zMax <= _MAX_INT)) { |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4490 |
RETURN ( __MKSMALLINT(zMax) ); |
294 | 4491 |
} |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4492 |
RETURN ( __MKLARGEINT(zMax) ); |
294 | 4493 |
} |
1932 | 4494 |
# endif |
294 | 4495 |
#endif |
4496 |
%}. |
|
4497 |
^ nil |
|
4498 |
! |
|
4499 |
||
4500 |
supportsDoubleBuffer |
|
4501 |
"return true, if this gl workstation supports double buffering. |
|
157 | 4502 |
For portable applications, always combine this with a query |
4503 |
if the display supports GL drawing at all." |
|
24 | 4504 |
|
4505 |
%{ /* NOCONTEXT */ |
|
294 | 4506 |
|
1932 | 4507 |
#ifndef OPENGL |
4508 |
# ifdef VGL |
|
4509 |
RETURN (true); |
|
4510 |
# else |
|
4511 |
# ifdef GD_BITS_NORM_DBL_RED |
|
294 | 4512 |
if (getgdesc(GD_BITS_NORM_DBL_RED) != 0) { |
4513 |
RETURN ( _INST(glOK) ); |
|
4514 |
} |
|
1932 | 4515 |
# endif |
4516 |
# endif |
|
24 | 4517 |
#endif |
89 | 4518 |
%}. |
4519 |
^ false |
|
4520 |
||
4521 |
" |
|
294 | 4522 |
Display supportsDoubleBuffer |
4523 |
" |
|
4524 |
! |
|
4525 |
||
4526 |
supportsGLDrawing |
|
4527 |
"return true, if this device supports 3D GL drawing." |
|
4528 |
||
4529 |
^ glOK |
|
4530 |
||
4531 |
" |
|
4532 |
Display supportsGLDrawing |
|
89 | 4533 |
" |
64 | 4534 |
! |
4535 |
||
4536 |
supportsLight |
|
157 | 4537 |
"return true, if this gl workstation supports light sources |
4538 |
(i.e. if its a real GL). |
|
4539 |
For portable applications, always combine this with a query |
|
4540 |
if the display supports GL drawing at all." |
|
89 | 4541 |
|
4542 |
%{ /* NOCONTEXT */ |
|
64 | 4543 |
#ifdef GLX |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4544 |
RETURN ( _INST(glOK) ); |
64 | 4545 |
#endif |
89 | 4546 |
%}. |
4547 |
^ false |
|
4548 |
||
4549 |
" |
|
4550 |
Display supportsLight |
|
4551 |
" |
|
4552 |
! |
|
4553 |
||
294 | 4554 |
supportsRGB |
4555 |
"return true, if this gl workstation supports rgb |
|
4556 |
(in addition to indexed) colors. Actually, we return true |
|
4557 |
for a real GL engine, false for the simulator here. |
|
4558 |
For portable applications, always combine this with a query |
|
4559 |
if the display supports GL drawing at all." |
|
4560 |
||
4561 |
%{ /* NOCONTEXT */ |
|
4562 |
#ifdef GLX |
|
4563 |
RETURN ( _INST(glOK) ); |
|
4564 |
#endif |
|
4565 |
%}. |
|
4566 |
^ false |
|
4567 |
||
4568 |
" |
|
4569 |
Display supportsRGB |
|
4570 |
" |
|
4571 |
! |
|
4572 |
||
89 | 4573 |
supportsTextures |
4574 |
"return true, if this gl workstation supports texture mapping |
|
157 | 4575 |
(i.e. if its a real GL). |
4576 |
For portable applications, always combine this with a query |
|
4577 |
if the display supports GL drawing at all." |
|
89 | 4578 |
|
4579 |
%{ /* NOCONTEXT */ |
|
1932 | 4580 |
#ifndef OPENGL |
4581 |
# ifdef GD_TEXTURE |
|
89 | 4582 |
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
|
4583 |
RETURN ( _INST(glOK) ); |
89 | 4584 |
} |
1932 | 4585 |
# endif |
89 | 4586 |
#endif |
4587 |
%}. |
|
4588 |
^ false |
|
4589 |
||
4590 |
" |
|
4591 |
Display supportsTextures |
|
4592 |
" |
|
4593 |
! |
|
4594 |
||
4595 |
supportsZBuffer |
|
157 | 4596 |
"return true, if this gl workstation has z buffer support. |
4597 |
For portable applications, always combine this with a query |
|
4598 |
if the display supports GL drawing at all." |
|
4599 |
||
89 | 4600 |
%{ /* NOCONTEXT */ |
4601 |
||
1932 | 4602 |
#ifndef OPENGL |
4603 |
# ifdef GD_BITS_NORM_ZBUFFER |
|
89 | 4604 |
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
|
4605 |
RETURN ( _INST(glOK) ); |
89 | 4606 |
} |
1932 | 4607 |
# endif |
89 | 4608 |
#endif |
4609 |
%}. |
|
4610 |
^ false |
|
4611 |
||
4612 |
" |
|
4613 |
Display supportsZBuffer |
|
4614 |
" |
|
294 | 4615 |
! ! |
4616 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4617 |
!GLXWorkstation methodsFor:'rectangles'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4618 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4619 |
glxRectX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4620 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4621 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4622 |
SETWIN(aGLXWindowId) |
1932 | 4623 |
#ifdef OPENGL |
4624 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4625 |
rect(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
1932 | 4626 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4627 |
%} |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4630 |
glxRectfX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4631 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4632 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4633 |
SETWIN(aGLXWindowId) |
1932 | 4634 |
#ifdef OPENGL |
4635 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4636 |
rectf(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
1932 | 4637 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4638 |
%} |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4641 |
glxRectfiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4642 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4643 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4644 |
SETWIN(aGLXWindowId) |
1932 | 4645 |
#ifdef OPENGL |
4646 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4647 |
rectfi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
1932 | 4648 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4649 |
%} |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4652 |
glxRectfsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4653 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4654 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4655 |
SETWIN(aGLXWindowId) |
1932 | 4656 |
#ifdef OPENGL |
4657 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4658 |
rectfs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
1932 | 4659 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4660 |
%} |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4663 |
glxRectiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4664 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4665 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4666 |
SETWIN(aGLXWindowId) |
1932 | 4667 |
#ifdef OPENGL |
4668 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4669 |
recti(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
1932 | 4670 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4671 |
%} |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4674 |
glxRectsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4675 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4676 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4677 |
SETWIN(aGLXWindowId) |
1932 | 4678 |
#ifdef OPENGL |
4679 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4680 |
rects(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
1932 | 4681 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4682 |
%} |
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 |
|
528 | 4685 |
!GLXWorkstation methodsFor:'spheres'! |
294 | 4686 |
|
4687 |
glxSphDraw:arrayOf4Floats in:aGLXWindowId |
|
4688 |
"argument must be an array(a matrix) of 4 floats containing the |
|
4689 |
sphere - in real GL only" |
|
4690 |
||
4691 |
%{ /* NOCONTEXT */ |
|
4692 |
#ifdef GLX |
|
4693 |
float vec[4], *v; |
|
4694 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4695 |
if (! (v = __glx_getFloatsFromInto(arrayOf4Floats, vec, 4))) RETURN(false); |
294 | 4696 |
SETWIN(aGLXWindowId) |
4697 |
sphdraw(v); |
|
1932 | 4698 |
#endif |
4699 |
%} |
|
294 | 4700 |
! |
4701 |
||
4702 |
glxSphDrawX:x y:y z:z radius:r in:aGLXWindowId |
|
4703 |
"arguments must be convertable to floats - in real GL only" |
|
4704 |
||
4705 |
%{ /* NOCONTEXT */ |
|
4706 |
#ifdef GLX |
|
4707 |
float vec[4]; |
|
4708 |
||
4709 |
_FLOAT_(x, vec[0]) |
|
4710 |
_FLOAT_(y, vec[1]) |
|
4711 |
_FLOAT_(z, vec[2]) |
|
4712 |
_FLOAT_(r, vec[3]) |
|
4713 |
SETWIN(aGLXWindowId) |
|
4714 |
sphdraw(vec); |
|
1932 | 4715 |
#endif |
4716 |
%} |
|
294 | 4717 |
! |
4718 |
||
4719 |
glxSphfreeIn: aGLXWindowId |
|
4720 |
||
4721 |
%{ /* NOCONTEXT */ |
|
4722 |
#ifdef GLX |
|
4723 |
SETWIN(aGLXWindowId) |
|
4724 |
sphfree(); |
|
1932 | 4725 |
#endif |
4726 |
%} |
|
294 | 4727 |
! |
4728 |
||
4729 |
glxSphgnpolysIn: aGLXWindowId |
|
4730 |
||
4731 |
%{ /* NOCONTEXT */ |
|
4732 |
#ifdef GLX |
|
4733 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4734 |
RETURN (__MKSMALLINT(sphgnpolys())); |
294 | 4735 |
#endif |
4736 |
%} |
|
4737 |
! |
|
4738 |
||
4739 |
glxSphmode: attribute value: value in: aGLXWindowId |
|
4740 |
||
4741 |
%{ /* NOCONTEXT */ |
|
4742 |
#ifdef GLX |
|
4743 |
SETWIN(aGLXWindowId) |
|
4744 |
sphmode(__intVal(attribute), __intVal(value)); |
|
1932 | 4745 |
#endif |
4746 |
%} |
|
294 | 4747 |
! |
4748 |
||
4749 |
glxSphobj: objid in: aGLXWindowId |
|
4750 |
||
4751 |
%{ /* NOCONTEXT */ |
|
4752 |
#ifdef GLX |
|
4753 |
SETWIN(aGLXWindowId) |
|
4754 |
sphobj(_objectVal(objid)); |
|
1932 | 4755 |
#endif |
4756 |
%} |
|
294 | 4757 |
! |
4758 |
||
4759 |
glxSphrotmatrix: mat in: aGLXWindowId |
|
4760 |
||
4761 |
%{ /* NOCONTEXT */ |
|
4762 |
#ifdef GLX |
|
4763 |
Matrix matrix, *m; |
|
4764 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4765 |
if (! (m = __glx_getFloatsFromMatrixInto(mat, &matrix))) RETURN (false); |
294 | 4766 |
SETWIN(aGLXWindowId) |
4767 |
sphrotmatrix(*m); |
|
1932 | 4768 |
#endif |
4769 |
%} |
|
294 | 4770 |
! ! |
4771 |
||
4772 |
!GLXWorkstation methodsFor:'stereo extension'! |
|
4773 |
||
528 | 4774 |
glxLeftbuffer: bool in: aGLXWindowId |
4775 |
||
4776 |
%{ /* NOCONTEXT */ |
|
4777 |
#ifdef FULL_GLX |
|
4778 |
SETWIN(aGLXWindowId) |
|
4779 |
leftbuffer(_booleanVal(bool)); |
|
1932 | 4780 |
#endif |
4781 |
%} |
|
528 | 4782 |
! |
4783 |
||
4784 |
glxMonobufferIn: aGLXWindowId |
|
4785 |
||
4786 |
%{ /* NOCONTEXT */ |
|
4787 |
#ifdef FULL_GLX |
|
4788 |
SETWIN(aGLXWindowId) |
|
4789 |
monobuffer(); |
|
1932 | 4790 |
#endif |
4791 |
%} |
|
528 | 4792 |
! |
4793 |
||
4794 |
glxRightbuffer: bool in: aGLXWindowId |
|
4795 |
||
4796 |
%{ /* NOCONTEXT */ |
|
4797 |
#ifdef FULL_GLX |
|
4798 |
SETWIN(aGLXWindowId) |
|
4799 |
rightbuffer(_booleanVal(bool)); |
|
1932 | 4800 |
#endif |
4801 |
%} |
|
528 | 4802 |
! |
4803 |
||
294 | 4804 |
stereoExtensionBuffer:aBufferSymbol for:aWindowId |
4805 |
"set the current stereo buffer; the argument may be one of: |
|
4806 |
#left -> STEREO_BUFFER_LEFT |
|
4807 |
#right -> STEREO_BUFFER_RIGHT |
|
4808 |
" |
|
4809 |
||
4810 |
%{ /* NOCONTEXT */ |
|
4811 |
#if defined(XSGIStereo) && defined(GLX) |
|
4812 |
Status status; |
|
4813 |
int buffer; |
|
4814 |
Window win; |
|
4815 |
||
4816 |
if (ISCONNECTED |
|
4817 |
&& __isExternalAddress(aWindowId)) { |
|
4818 |
win = _WindowVal(aWindowId); |
|
4819 |
if (aBufferSymbol == @symbol(left)) { |
|
4820 |
buffer = STEREO_BUFFER_LEFT; |
|
4821 |
} else { |
|
4822 |
if (aBufferSymbol == @symbol(right)) { |
|
4823 |
buffer = STEREO_BUFFER_RIGHT; |
|
4824 |
} else { |
|
4825 |
goto bad; |
|
4826 |
} |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4827 |
} |
294 | 4828 |
status = XSGISetStereoBuffer(myDpy, win, buffer); |
4829 |
RETURN ( status ? true : false); |
|
4830 |
} |
|
4831 |
bad: ; |
|
4832 |
#endif |
|
4833 |
%}. |
|
4834 |
self primitiveFailed |
|
4835 |
||
4836 |
" |
|
4837 |
|t v| |
|
4838 |
||
4839 |
t := StandardSystemView new. |
|
4840 |
t extent:300@300. |
|
4841 |
v := GLXView origin:0.0@0.0 corner:1.0@1.0 in:t. |
|
4842 |
t openAndWait. |
|
4843 |
||
4844 |
v device stereoExtensionBuffer:#left for:(v id). |
|
4845 |
(Delay forSeconds:10) wait. |
|
4846 |
v device stereoExtensionBuffer:#right for:(v id). |
|
4847 |
" |
|
4848 |
! |
|
4849 |
||
4850 |
stereoExtensionMode:aModeSymbol height:h offset:o for:aWindowId |
|
4851 |
"set the current stereo mode; the argument may be one of: |
|
4852 |
nil/false #off -> turn it off |
|
4853 |
#bottom -> STEREO_BOTTOM |
|
4854 |
#top -> STEREO_TOP |
|
4855 |
" |
|
4856 |
||
4857 |
%{ /* NOCONTEXT */ |
|
4858 |
#if defined(XSGIStereo) && defined(GLX) |
|
4859 |
Status status; |
|
4860 |
int mode; |
|
4861 |
unsigned short us_h, us_o; |
|
4862 |
Window win; |
|
4863 |
||
4864 |
if (ISCONNECTED |
|
4865 |
&& __bothSmallInteger(h, o) |
|
4866 |
&& __isExternalAddress(aWindowId)) { |
|
4867 |
win = _WindowVal(aWindowId); |
|
4868 |
if ((aModeSymbol == nil) |
|
4869 |
|| (aModeSymbol == false) |
|
4870 |
|| (aModeSymbol == @symbol(off))) { |
|
4871 |
mode = STEREO_OFF; |
|
4872 |
} else { |
|
4873 |
if (aModeSymbol == @symbol(bottom)) { |
|
4874 |
mode = STEREO_BOTTOM; |
|
4875 |
} else { |
|
4876 |
if (aModeSymbol == @symbol(top)) { |
|
4877 |
mode = STEREO_TOP; |
|
4878 |
} else { |
|
4879 |
goto bad; |
|
4880 |
} |
|
4881 |
} |
|
4882 |
} |
|
4883 |
us_h = __intVal(h); |
|
4884 |
us_o = __intVal(o); |
|
4885 |
status = XSGISetStereoMode(myDpy, win, us_h, us_o, mode); |
|
4886 |
RETURN ( status ? true : false); |
|
4887 |
} |
|
4888 |
bad: ; |
|
4889 |
#endif |
|
4890 |
%}. |
|
4891 |
self primitiveFailed |
|
4892 |
||
4893 |
" |
|
4894 |
Display stereoExtensionMode:#top height:492 offset:532 for:(Display rootWindowId). |
|
4895 |
(Delay forSeconds:10) wait. |
|
4896 |
Display stereoExtensionMode:#off height:0 offset:0 for:(Display rootWindowId). |
|
4897 |
" |
|
4898 |
! |
|
4899 |
||
4900 |
stereoExtensionModeIn:aWindowId |
|
4901 |
"return the current stereo mode for some window" |
|
4902 |
||
4903 |
%{ /* NOCONTEXT */ |
|
4904 |
#if defined(XSGIStereo) && defined(GLX) |
|
4905 |
int mode; |
|
4906 |
Window win; |
|
4907 |
||
4908 |
if (ISCONNECTED && __isExternalAddress(aWindowId)) { |
|
4909 |
win = _WindowVal(aWindowId); |
|
4910 |
mode = XSGIQueryStereoMode(myDpy, win); |
|
4911 |
switch (mode) { |
|
4912 |
case STEREO_OFF: |
|
4913 |
RETURN ( @symbol(off) ); |
|
4914 |
case STEREO_BOTTOM: |
|
4915 |
RETURN ( @symbol(bottom) ); |
|
4916 |
case STEREO_TOP: |
|
4917 |
RETURN ( @symbol(top) ); |
|
4918 |
} |
|
4919 |
RETURN ( @symbol(unsupported) ); |
|
4920 |
} |
|
4921 |
#endif |
|
4922 |
%}. |
|
4923 |
self primitiveFailed |
|
4924 |
||
4925 |
" |
|
4926 |
|v| |
|
4927 |
||
4928 |
v := StandardSystemView new. |
|
4929 |
v extent:300@300. |
|
4930 |
v openAndWait. |
|
4931 |
v device stereoExtensionModeIn:(v id) |
|
4932 |
||
4933 |
Display stereoExtensionModeIn:Display rootWindowId |
|
4934 |
" |
|
4935 |
! |
|
4936 |
||
4937 |
stereoExtensionVersion |
|
4938 |
"return the stereo extensions version as an array consisting of |
|
4939 |
major and minor numbers." |
|
4940 |
||
4941 |
%{ /* NOCONTEXT */ |
|
4942 |
#if defined(XSGIStereo) && defined(GLX) |
|
4943 |
Status status; |
|
4944 |
Display *dpy = myDpy; |
|
4945 |
int major, minor; |
|
4946 |
||
4947 |
if (ISCONNECTED) { |
|
4948 |
status = XSGIStereoQueryVersion(myDpy, &major, &minor); |
|
4949 |
if (status == True) { |
|
4950 |
RETURN ( __ARRAY_WITH2(__MKSMALLINT(major), __MKSMALLINT(minor))); |
|
4951 |
} |
|
89 | 4952 |
} |
4953 |
#endif |
|
4954 |
%}. |
|
294 | 4955 |
self primitiveFailed |
185 | 4956 |
|
4957 |
" |
|
294 | 4958 |
Display stereoExtensionVersion |
185 | 4959 |
" |
24 | 4960 |
! ! |
4961 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4962 |
!GLXWorkstation methodsFor:'texture data transfer'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4963 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4964 |
glxT2d: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4965 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4966 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4967 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4968 |
double vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4969 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4970 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4971 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4972 |
t2d(c_v); |
1932 | 4973 |
#endif |
4974 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4975 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4976 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4977 |
glxT2f: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4978 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4979 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4980 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4981 |
float vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4982 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4983 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4984 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4985 |
t2f(c_v); |
1932 | 4986 |
#endif |
4987 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4988 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4989 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4990 |
glxT2i: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4991 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4992 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4993 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4994 |
long vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4995 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4996 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4997 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4998 |
t2i(c_v); |
1932 | 4999 |
#endif |
5000 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5001 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5002 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5003 |
glxT2s: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5004 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5005 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5006 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5007 |
short vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5008 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5009 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5010 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5011 |
t2s(c_v); |
1932 | 5012 |
#endif |
5013 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5014 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5015 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5016 |
glxT3d:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5017 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5018 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5019 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5020 |
double vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5021 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5022 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5023 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5024 |
t3d(c_v); |
1932 | 5025 |
#endif |
5026 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5027 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5028 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5029 |
glxT3f:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5030 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5031 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5032 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5033 |
float vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5034 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5035 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5036 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5037 |
t3f(c_v); |
1932 | 5038 |
#endif |
5039 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5040 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5041 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5042 |
glxT3i:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5043 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5044 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5045 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5046 |
long vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5047 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5048 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5049 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5050 |
t3i(c_v); |
1932 | 5051 |
#endif |
5052 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5053 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5054 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5055 |
glxT3s:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5056 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5057 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5058 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5059 |
short vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5060 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5061 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5062 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5063 |
t3s(c_v); |
1932 | 5064 |
#endif |
5065 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5066 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5067 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5068 |
glxT4d: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5069 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5070 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5071 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5072 |
double vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5073 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5074 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5075 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5076 |
t4d(c_v); |
1932 | 5077 |
#endif |
5078 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5079 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5080 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5081 |
glxT4f: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5082 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5083 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5084 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5085 |
float vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5086 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5087 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5088 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5089 |
t4f(c_v); |
1932 | 5090 |
#endif |
5091 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5092 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5093 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5094 |
glxT4i: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5095 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5096 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5097 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5098 |
long vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5099 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5100 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5101 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5102 |
t4i(c_v); |
1932 | 5103 |
#endif |
5104 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5105 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5106 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5107 |
glxT4s: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5108 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5109 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5110 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5111 |
short vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5112 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5113 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5114 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5115 |
t4s(c_v); |
1932 | 5116 |
#endif |
5117 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5118 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5119 |
|
294 | 5120 |
!GLXWorkstation methodsFor:'transformations'! |
5121 |
||
5122 |
glxRotate:angle axis:axis in:aGLXWindowId |
|
5123 |
"rotate the current matrix around the axis given by the axis arg, |
|
5124 |
which must be one of the symbols: #x, #y or #z. |
|
5125 |
The angle is in degrees." |
|
5126 |
||
5127 |
%{ /* NOCONTEXT */ |
|
5128 |
||
5129 |
char c_axis; |
|
5130 |
||
5131 |
if (axis == @symbol(x)) |
|
5132 |
c_axis = 'x'; |
|
5133 |
else if (axis == @symbol(y)) |
|
5134 |
c_axis = 'y'; |
|
5135 |
else if (axis == @symbol(z)) |
|
5136 |
c_axis = 'z'; |
|
5137 |
else { |
|
5138 |
RETURN (false); |
|
5139 |
} |
|
5140 |
||
5141 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5142 |
RETURN ( __glx_doRotate(angle, c_axis) ); |
294 | 5143 |
%} |
5144 |
! |
|
5145 |
||
5146 |
glxRotate:arrayOf3Floats in:aGLXWindowId |
|
5147 |
"rotate current matrix, given a 3-element vector (or more). |
|
5148 |
The elements of the array are degrees." |
|
5149 |
||
5150 |
%{ /* NOCONTEXT */ |
|
5151 |
||
5152 |
float vec[3], *v; |
|
5153 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5154 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5155 |
|
5156 |
SETWIN(aGLXWindowId) |
|
1932 | 5157 |
#ifdef OPENGL |
5158 |
#else |
|
294 | 5159 |
rot(v[0], 'x'); |
5160 |
rot(v[1], 'y'); |
|
5161 |
rot(v[2], 'z'); |
|
1932 | 5162 |
#endif |
294 | 5163 |
%} |
5164 |
! |
|
5165 |
||
5166 |
glxRotateI:angle axis:axis in:aGLXWindowId |
|
5167 |
"rotate the current matrix around the axis given by the axis arg, |
|
5168 |
which must be one of the symbols: #x, #y or #z. |
|
5169 |
The angle is an integer specifying tenths of a degree." |
|
5170 |
||
5171 |
%{ /* NOCONTEXT */ |
|
5172 |
||
5173 |
char c_axis; |
|
5174 |
||
5175 |
if (axis == @symbol(x)) |
|
5176 |
c_axis = 'x'; |
|
5177 |
else if (axis == @symbol(y)) |
|
5178 |
c_axis = 'y'; |
|
5179 |
else if (axis == @symbol(z)) |
|
5180 |
c_axis = 'z'; |
|
5181 |
else { |
|
5182 |
RETURN (false); |
|
5183 |
} |
|
5184 |
||
5185 |
if (__isSmallInteger(angle)) { |
|
5186 |
SETWIN(aGLXWindowId) |
|
1932 | 5187 |
#ifdef OPENGL |
5188 |
#else |
|
294 | 5189 |
rotate(__intVal(angle), c_axis); |
1932 | 5190 |
#endif |
294 | 5191 |
} |
5192 |
%} |
|
5193 |
! |
|
5194 |
||
5195 |
glxRotateIX:angle in:aGLXWindowId |
|
5196 |
"rotate the current matrix on x axis. |
|
5197 |
The angle is an integer specifying tenths of a degree." |
|
5198 |
||
5199 |
%{ /* NOCONTEXT */ |
|
5200 |
||
5201 |
if (__isSmallInteger(angle)) { |
|
5202 |
SETWIN(aGLXWindowId) |
|
1932 | 5203 |
#ifdef OPENGL |
5204 |
#else |
|
294 | 5205 |
rotate(__intVal(angle), 'x'); |
1932 | 5206 |
#endif |
294 | 5207 |
} |
5208 |
%} |
|
5209 |
! |
|
5210 |
||
5211 |
glxRotateIX:xAngle y:yAngle z:zAngle in:aGLXWindowId |
|
5212 |
"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
|
5213 |
The values are smallIntegers specifying tenths of a degree." |
294 | 5214 |
|
5215 |
%{ /* NOCONTEXT */ |
|
5216 |
||
5217 |
if (__bothSmallInteger(xAngle, yAngle) |
|
5218 |
&& __isSmallInteger(zAngle)) { |
|
5219 |
SETWIN(aGLXWindowId) |
|
1932 | 5220 |
#ifdef OPENGL |
5221 |
#else |
|
294 | 5222 |
rotate(__intVal(xAngle), 'x'); |
5223 |
rotate(__intVal(yAngle), 'y'); |
|
5224 |
rotate(__intVal(zAngle), 'z'); |
|
1932 | 5225 |
#endif |
294 | 5226 |
} |
5227 |
%} |
|
5228 |
! |
|
5229 |
||
5230 |
glxRotateIY:angle in:aGLXWindowId |
|
5231 |
"rotate the current matrix on x axis. |
|
5232 |
The angle is an integer specifying tenths of a degree." |
|
5233 |
||
5234 |
%{ /* NOCONTEXT */ |
|
5235 |
||
5236 |
if (__isSmallInteger(angle)) { |
|
5237 |
SETWIN(aGLXWindowId) |
|
1932 | 5238 |
#ifdef OPENGL |
5239 |
#else |
|
294 | 5240 |
rotate(__intVal(angle), 'y'); |
1932 | 5241 |
#endif |
294 | 5242 |
} |
5243 |
%} |
|
5244 |
! |
|
5245 |
||
5246 |
glxRotateIZ:angle in:aGLXWindowId |
|
5247 |
"rotate the current matrix on x axis. |
|
5248 |
The angle is an integer specifying tenths of a degree." |
|
5249 |
||
5250 |
%{ /* NOCONTEXT */ |
|
5251 |
||
5252 |
if (__isSmallInteger(angle)) { |
|
5253 |
SETWIN(aGLXWindowId) |
|
1932 | 5254 |
#ifdef OPENGL |
5255 |
#else |
|
294 | 5256 |
rotate(__intVal(angle), 'z'); |
1932 | 5257 |
#endif |
294 | 5258 |
} |
5259 |
%} |
|
5260 |
! |
|
5261 |
||
5262 |
glxRotateX:angle in:aGLXWindowId |
|
5263 |
"rotate the current matrix on x axis. |
|
5264 |
The angle is in degrees." |
|
5265 |
||
5266 |
%{ /* NOCONTEXT */ |
|
5267 |
||
5268 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5269 |
RETURN (__glx_doRotate(angle, 'x')); |
294 | 5270 |
%} |
5271 |
! |
|
5272 |
||
5273 |
glxRotateX:xAngle y:yAngle z:zAngle in:aGLXWindowId |
|
5274 |
"rotate the current matrix on all axes, given individual x, y and z values. |
|
5275 |
The values are in degrees" |
|
5276 |
||
5277 |
%{ /* NOCONTEXT */ |
|
5278 |
||
5279 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5280 |
if ( __glx_doRotate(xAngle, 'x') == true) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5281 |
if ( __glx_doRotate(yAngle, 'y') == true) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5282 |
RETURN (__glx_doRotate(zAngle, 'z')); |
294 | 5283 |
} |
5284 |
} |
|
5285 |
%} |
|
5286 |
! |
|
5287 |
||
5288 |
glxRotateY:angle in:aGLXWindowId |
|
5289 |
"rotate the current matrix on y axis. |
|
5290 |
The angle is in degrees." |
|
5291 |
||
5292 |
%{ /* NOCONTEXT */ |
|
5293 |
||
5294 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5295 |
RETURN (__glx_doRotate(angle, 'y')); |
294 | 5296 |
%} |
5297 |
! |
|
5298 |
||
5299 |
glxRotateZ:angle in:aGLXWindowId |
|
5300 |
"rotate the current matrix on z axis. |
|
5301 |
The angle is in degrees." |
|
5302 |
||
5303 |
%{ /* NOCONTEXT */ |
|
5304 |
||
5305 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5306 |
RETURN (__glx_doRotate(angle, 'z')); |
294 | 5307 |
%} |
5308 |
! |
|
5309 |
||
5310 |
glxScale:arrayOf3Floats in:aGLXWindowId |
|
5311 |
"scale current matrix, given a 3-element vector" |
|
5312 |
||
5313 |
%{ /* NOCONTEXT */ |
|
5314 |
||
5315 |
float vec[3], *v; |
|
5316 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5317 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5318 |
|
5319 |
SETWIN(aGLXWindowId) |
|
1932 | 5320 |
#ifdef OPENGL |
5321 |
#else |
|
294 | 5322 |
scale(v[0], v[1], v[2]); |
1932 | 5323 |
#endif |
294 | 5324 |
%} |
5325 |
! |
|
5326 |
||
5327 |
glxScaleX:x in:aGLXWindowId |
|
5328 |
"scale in x direction" |
|
5329 |
||
5330 |
%{ /* NOCONTEXT */ |
|
5331 |
||
5332 |
float f_x; |
|
5333 |
||
5334 |
_FLOAT_ (x, f_x) |
|
5335 |
SETWIN(aGLXWindowId) |
|
1932 | 5336 |
#ifdef OPENGL |
5337 |
#else |
|
294 | 5338 |
scale(f_x, (float)0, (float)0); |
1932 | 5339 |
#endif |
294 | 5340 |
%} |
5341 |
! |
|
5342 |
||
5343 |
glxScaleX:x y:y z:z in:aGLXWindowId |
|
5344 |
"scale & mirror current matrix, given individual x, y and z values" |
|
5345 |
||
5346 |
%{ /* NOCONTEXT */ |
|
5347 |
||
5348 |
float f_x, f_y, f_z; |
|
5349 |
||
5350 |
_FLOAT_ (x, f_x) |
|
5351 |
_FLOAT_ (y, f_y) |
|
5352 |
_FLOAT_ (z, f_z) |
|
5353 |
SETWIN(aGLXWindowId) |
|
1932 | 5354 |
#ifdef OPENGL |
5355 |
#else |
|
294 | 5356 |
scale(f_x, f_y, f_z); |
1932 | 5357 |
#endif |
294 | 5358 |
%} |
5359 |
! |
|
5360 |
||
5361 |
glxScaleY:y in:aGLXWindowId |
|
5362 |
"scale in y direction" |
|
5363 |
||
5364 |
%{ /* NOCONTEXT */ |
|
5365 |
||
5366 |
float f_y; |
|
5367 |
||
5368 |
_FLOAT_ (y, f_y) |
|
5369 |
SETWIN(aGLXWindowId) |
|
1932 | 5370 |
#ifdef OPENGL |
5371 |
#else |
|
294 | 5372 |
scale((float)0, f_y, (float)0); |
1932 | 5373 |
#endif |
294 | 5374 |
%} |
5375 |
! |
|
5376 |
||
5377 |
glxScaleZ:z in:aGLXWindowId |
|
5378 |
"scale in z direction" |
|
5379 |
||
5380 |
%{ /* NOCONTEXT */ |
|
5381 |
||
5382 |
float f_z; |
|
5383 |
||
5384 |
_FLOAT_ (z, f_z) |
|
5385 |
SETWIN(aGLXWindowId) |
|
1932 | 5386 |
#ifdef OPENGL |
5387 |
#else |
|
294 | 5388 |
scale((float)0, (float)0, f_z); |
1932 | 5389 |
#endif |
294 | 5390 |
%} |
5391 |
! |
|
5392 |
||
5393 |
glxTranslate:arrayOf3Floats in:aGLXWindowId |
|
5394 |
"translate current matrix, given a 3-element vector" |
|
5395 |
||
5396 |
%{ /* NOCONTEXT */ |
|
5397 |
||
5398 |
float vec[3], *v; |
|
5399 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5400 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5401 |
|
5402 |
SETWIN(aGLXWindowId) |
|
1932 | 5403 |
#ifdef OPENGL |
5404 |
#else |
|
294 | 5405 |
translate((Coord)(v[0]), (Coord)(v[1]), (Coord)(v[2])); |
1932 | 5406 |
#endif |
294 | 5407 |
%} |
5408 |
! |
|
5409 |
||
5410 |
glxTranslateX:x in:aGLXWindowId |
|
5411 |
"translate current matrix on X axis" |
|
5412 |
||
5413 |
%{ /* NOCONTEXT */ |
|
5414 |
||
5415 |
Coord c_x; |
|
5416 |
||
5417 |
_COORD_ (x, c_x) |
|
5418 |
SETWIN(aGLXWindowId) |
|
1932 | 5419 |
#ifdef OPENGL |
5420 |
#else |
|
294 | 5421 |
translate(c_x, (Coord)0, (Coord)0); |
1932 | 5422 |
#endif |
294 | 5423 |
%} |
5424 |
! |
|
5425 |
||
5426 |
glxTranslateX:x y:y z:z in:aGLXWindowId |
|
5427 |
"translate current matrix, given individual x, y and z values" |
|
5428 |
||
5429 |
%{ /* NOCONTEXT */ |
|
5430 |
||
5431 |
Coord c_x, c_y, c_z; |
|
5432 |
||
5433 |
_COORD_ (x, c_x) |
|
5434 |
_COORD_ (y, c_y) |
|
5435 |
_COORD_ (z, c_z) |
|
5436 |
SETWIN(aGLXWindowId) |
|
1932 | 5437 |
#ifdef OPENGL |
5438 |
#else |
|
294 | 5439 |
translate(c_x, c_y, c_z); |
1932 | 5440 |
#endif |
294 | 5441 |
%} |
5442 |
! |
|
5443 |
||
5444 |
glxTranslateY:y in:aGLXWindowId |
|
5445 |
"translate current matrix on Y axis" |
|
5446 |
||
5447 |
%{ /* NOCONTEXT */ |
|
5448 |
||
5449 |
Coord c_y; |
|
5450 |
||
5451 |
_COORD_ (y, c_y) |
|
5452 |
SETWIN(aGLXWindowId) |
|
1932 | 5453 |
#ifdef OPENGL |
5454 |
#else |
|
294 | 5455 |
translate((Coord)0, c_y, (Coord)0); |
1932 | 5456 |
#endif |
294 | 5457 |
%} |
5458 |
! |
|
5459 |
||
5460 |
glxTranslateZ:z in:aGLXWindowId |
|
5461 |
"translate current matrix on Z axis" |
|
5462 |
||
5463 |
%{ /* NOCONTEXT */ |
|
5464 |
||
5465 |
Coord c_z; |
|
5466 |
||
5467 |
_COORD_ (z, c_z) |
|
5468 |
SETWIN(aGLXWindowId) |
|
1932 | 5469 |
#ifdef OPENGL |
5470 |
#else |
|
294 | 5471 |
translate((Coord)0, (Coord)0, c_z); |
1932 | 5472 |
#endif |
294 | 5473 |
%} |
5474 |
! ! |
|
5475 |
||
5476 |
!GLXWorkstation methodsFor:'unspecified rest'! |
|
5477 |
||
5478 |
glxAcbufOp:op value:value in:aGLXWindowId |
|
5479 |
||
5480 |
%{ /* NOCONTEXT */ |
|
1932 | 5481 |
SETWIN(aGLXWindowId) |
5482 |
#ifdef GLX |
|
294 | 5483 |
acbuf(__intVal(op), _floatVal(value)); |
1932 | 5484 |
#endif |
5485 |
%} |
|
294 | 5486 |
! |
5487 |
||
5488 |
glxAcsizePlanes: planes in: aGLXWindowId |
|
5489 |
||
5490 |
%{ /* NOCONTEXT */ |
|
1932 | 5491 |
SETWIN(aGLXWindowId) |
5492 |
#ifdef GLX |
|
294 | 5493 |
acsize(__intVal(planes)); |
1932 | 5494 |
#endif |
5495 |
%} |
|
294 | 5496 |
! |
5497 |
||
5498 |
glxAfunctionRef: ref func: func in: aGLXWindowId |
|
5499 |
||
5500 |
%{ /* NOCONTEXT */ |
|
1932 | 5501 |
SETWIN(aGLXWindowId) |
5502 |
#ifdef GLX |
|
294 | 5503 |
afunction(__intVal(ref), __intVal(func)); |
1932 | 5504 |
#endif |
5505 |
%} |
|
294 | 5506 |
! |
5507 |
||
5508 |
glxBbox2Xmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5509 |
||
5510 |
%{ /* NOCONTEXT */ |
|
5511 |
Screencoord c_xmin, c_ymin; |
|
5512 |
Coord c_x1, c_y1, c_x2, c_y2; |
|
5513 |
||
5514 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5515 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5516 |
_COORD_ (x1, c_x1) |
|
5517 |
_COORD_ (y1, c_y1) |
|
5518 |
_COORD_ (x2, c_x2) |
|
5519 |
_COORD_ (y2, c_y2) |
|
5520 |
SETWIN(aGLXWindowId) |
|
1932 | 5521 |
#ifdef GLX |
294 | 5522 |
bbox2(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5523 |
#endif |
5524 |
%} |
|
294 | 5525 |
! |
5526 |
||
5527 |
glxBbox2iXmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5528 |
||
5529 |
%{ /* NOCONTEXT */ |
|
5530 |
Screencoord c_xmin, c_ymin; |
|
5531 |
Icoord c_x1, c_y1, c_x2, c_y2; |
|
5532 |
||
5533 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5534 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5535 |
_ICOORD_ (x1, c_x1) |
|
5536 |
_ICOORD_ (y1, c_y1) |
|
5537 |
_ICOORD_ (x2, c_x2) |
|
5538 |
_ICOORD_ (y2, c_y2) |
|
5539 |
SETWIN(aGLXWindowId) |
|
1932 | 5540 |
#ifdef GLX |
294 | 5541 |
bbox2i(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5542 |
#endif |
5543 |
%} |
|
294 | 5544 |
! |
5545 |
||
5546 |
glxBbox2sXmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5547 |
||
5548 |
%{ /* NOCONTEXT */ |
|
5549 |
Screencoord c_xmin, c_ymin; |
|
5550 |
Scoord c_x1, c_y1, c_x2, c_y2; |
|
5551 |
||
5552 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5553 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5554 |
_SCOORD_ (x1, c_x1) |
|
5555 |
_SCOORD_ (y1, c_y1) |
|
5556 |
_SCOORD_ (x2, c_x2) |
|
5557 |
_SCOORD_ (y2, c_y2) |
|
5558 |
SETWIN(aGLXWindowId) |
|
1932 | 5559 |
#ifdef GLX |
294 | 5560 |
bbox2s(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5561 |
#endif |
5562 |
%} |
|
294 | 5563 |
! |
5564 |
||
5565 |
glxBeginTrimIn: aGLXWindowId |
|
5566 |
||
5567 |
%{ /* NOCONTEXT */ |
|
1932 | 5568 |
SETWIN(aGLXWindowId) |
5569 |
#ifdef GLX |
|
294 | 5570 |
bgntrim(); |
1932 | 5571 |
#endif |
5572 |
%} |
|
294 | 5573 |
! |
5574 |
||
5575 |
glxBlankscreen: b in: aGLXWindowId |
|
5576 |
||
5577 |
%{ /* NOCONTEXT */ |
|
1932 | 5578 |
SETWIN(aGLXWindowId) |
5579 |
#ifdef GLX |
|
294 | 5580 |
blankscreen(_booleanVal(b)); |
1932 | 5581 |
#endif |
5582 |
%} |
|
294 | 5583 |
! |
5584 |
||
5585 |
glxBlanktime: count in: aGLXWindowId |
|
5586 |
||
5587 |
%{ /* NOCONTEXT */ |
|
1932 | 5588 |
SETWIN(aGLXWindowId) |
5589 |
#ifdef GLX |
|
294 | 5590 |
blanktime(__intVal(count)); |
1932 | 5591 |
#endif |
5592 |
%} |
|
294 | 5593 |
! |
5594 |
||
5595 |
glxBlendcolorRed: red green: green blue: blue alpha: alpha in: aGLXWindowId |
|
5596 |
||
5597 |
%{ /* NOCONTEXT */ |
|
1932 | 5598 |
SETWIN(aGLXWindowId) |
294 | 5599 |
#ifdef FULL_GLX |
5600 |
blendcolor(_floatVal(red), _floatVal(green), _floatVal(blue), _floatVal(alpha)); |
|
1932 | 5601 |
#endif |
5602 |
%} |
|
294 | 5603 |
! |
5604 |
||
5605 |
glxBlendfunctionSfactr: sfactr dfactr: dfactr in: aGLXWindowId |
|
5606 |
||
5607 |
%{ /* NOCONTEXT */ |
|
1932 | 5608 |
SETWIN(aGLXWindowId) |
5609 |
#ifdef GLX |
|
294 | 5610 |
blendfunction(__intVal(sfactr), __intVal(dfactr)); |
1932 | 5611 |
#endif |
5612 |
%} |
|
294 | 5613 |
! |
5614 |
||
5615 |
glxBlinkRate: rate i: i red: red green: green blue: blue in: aGLXWindowId |
|
5616 |
||
5617 |
%{ /* NOCONTEXT */ |
|
1932 | 5618 |
SETWIN(aGLXWindowId) |
5619 |
#ifdef GLX |
|
294 | 5620 |
blink(_shortVal(rate), _colorindexVal(i), |
5621 |
_shortVal(red), _shortVal(green), _shortVal(blue)); |
|
1932 | 5622 |
#endif |
5623 |
%} |
|
294 | 5624 |
! |
5625 |
||
5626 |
glxBlkqreadData: data n: n in: aGLXWindowId |
|
5627 |
||
5628 |
%{ /* NOCONTEXT */ |
|
1932 | 5629 |
int rslt = -1; |
5630 |
||
5631 |
SETWIN(aGLXWindowId) |
|
5632 |
#ifdef GLX |
|
5633 |
rslt = blkqread((short *)_indexedArea(data), __intVal(n)); |
|
5634 |
#endif |
|
5635 |
RETURN (__MKSMALLINT(rslt)); |
|
5636 |
%} |
|
294 | 5637 |
! |
5638 |
||
5639 |
glxC3f: v in: aGLXWindowId |
|
5640 |
||
5641 |
%{ /* NOCONTEXT */ |
|
5642 |
float vec[3], *c_v; |
|
5643 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5644 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
294 | 5645 |
SETWIN(aGLXWindowId) |
1932 | 5646 |
#ifdef GLX |
294 | 5647 |
c3f(c_v); |
1932 | 5648 |
#endif |
5649 |
%} |
|
294 | 5650 |
! |
5651 |
||
5652 |
glxC3i: v in: aGLXWindowId |
|
5653 |
||
5654 |
%{ /* NOCONTEXT */ |
|
5655 |
long vec[3], *c_v; |
|
5656 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5657 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
294 | 5658 |
SETWIN(aGLXWindowId) |
1932 | 5659 |
#ifdef GLX |
294 | 5660 |
c3i(c_v); |
1932 | 5661 |
#endif |
5662 |
%} |
|
294 | 5663 |
! |
5664 |
||
5665 |
glxC3s: v in: aGLXWindowId |
|
5666 |
||
5667 |
%{ /* NOCONTEXT */ |
|
5668 |
short vec[3], *c_v; |
|
5669 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5670 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
294 | 5671 |
SETWIN(aGLXWindowId) |
1932 | 5672 |
#ifdef GLX |
294 | 5673 |
c3s(c_v); |
1932 | 5674 |
#endif |
5675 |
%} |
|
294 | 5676 |
! |
5677 |
||
5678 |
glxC4f: v in: aGLXWindowId |
|
5679 |
||
5680 |
%{ /* NOCONTEXT */ |
|
5681 |
float vec[4], *c_v; |
|
5682 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5683 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
294 | 5684 |
SETWIN(aGLXWindowId) |
1932 | 5685 |
#ifdef GLX |
294 | 5686 |
c4f(c_v); |
1932 | 5687 |
#endif |
5688 |
%} |
|
294 | 5689 |
! |
5690 |
||
5691 |
glxC4i: v in: aGLXWindowId |
|
5692 |
||
5693 |
%{ /* NOCONTEXT */ |
|
5694 |
long vec[4], *c_v; |
|
5695 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5696 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
294 | 5697 |
SETWIN(aGLXWindowId) |
1932 | 5698 |
#ifdef GLX |
294 | 5699 |
c4i(c_v); |
1932 | 5700 |
#endif |
5701 |
%} |
|
294 | 5702 |
! |
5703 |
||
5704 |
glxC4s: v in: aGLXWindowId |
|
5705 |
||
5706 |
%{ /* NOCONTEXT */ |
|
5707 |
short vec[4], *c_v; |
|
5708 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5709 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
294 | 5710 |
SETWIN(aGLXWindowId) |
1932 | 5711 |
#ifdef GLX |
294 | 5712 |
c4s(c_v); |
1932 | 5713 |
#endif |
5714 |
%} |
|
294 | 5715 |
! |
5716 |
||
5717 |
glxClearhitcodeIn: aGLXWindowId |
|
5718 |
||
5719 |
%{ /* NOCONTEXT */ |
|
1932 | 5720 |
SETWIN(aGLXWindowId) |
5721 |
#ifdef GLX |
|
294 | 5722 |
clearhitcode(); |
1932 | 5723 |
#endif |
5724 |
%} |
|
294 | 5725 |
! |
5726 |
||
5727 |
glxClipplaneIndex: index mode: mode params: params in: aGLXWindowId |
|
5728 |
||
5729 |
%{ /* NOCONTEXT */ |
|
5730 |
float vec[4], *v; |
|
5731 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5732 |
if (! (v = __glx_getFloatsFromInto(params, vec, 4))) RETURN(false); |
294 | 5733 |
SETWIN(aGLXWindowId) |
1932 | 5734 |
#ifdef GLX |
294 | 5735 |
clipplane(__intVal(index), __intVal(mode), v); |
1932 | 5736 |
#endif |
5737 |
%} |
|
294 | 5738 |
! |
5739 |
||
5740 |
glxCmodeIn: aGLXWindowId |
|
5741 |
||
5742 |
%{ /* NOCONTEXT */ |
|
1932 | 5743 |
SETWIN(aGLXWindowId) |
5744 |
#ifdef GLX |
|
294 | 5745 |
cmode(); |
1932 | 5746 |
#endif |
5747 |
%} |
|
294 | 5748 |
! |
5749 |
||
5750 |
glxColorfIndex: index in: aGLXWindowId |
|
5751 |
||
5752 |
^self glxColor: index in: aGLXWindowId |
|
5753 |
! |
|
5754 |
||
5755 |
glxCuroriginN: n xorigin: xorigin yorigin: yorigin in: aGLXWindowId |
|
5756 |
||
5757 |
%{ /* NOCONTEXT */ |
|
1932 | 5758 |
SETWIN(aGLXWindowId) |
5759 |
#ifdef GLX |
|
294 | 5760 |
curorigin(_shortVal(n), _shortVal(xorigin), _shortVal(yorigin)); |
1932 | 5761 |
#endif |
5762 |
%} |
|
294 | 5763 |
! |
5764 |
||
5765 |
glxCursoffIn: aGLXWindowId |
|
5766 |
||
5767 |
%{ /* NOCONTEXT */ |
|
1932 | 5768 |
SETWIN(aGLXWindowId) |
5769 |
#ifdef GLX |
|
294 | 5770 |
cursoff(); |
1932 | 5771 |
#endif |
5772 |
%} |
|
294 | 5773 |
! |
5774 |
||
5775 |
glxCursonIn: aGLXWindowId |
|
5776 |
||
5777 |
%{ /* NOCONTEXT */ |
|
1932 | 5778 |
SETWIN(aGLXWindowId) |
5779 |
#ifdef GLX |
|
294 | 5780 |
curson(); |
1932 | 5781 |
#endif |
5782 |
%} |
|
294 | 5783 |
! |
5784 |
||
5785 |
glxCurstype: type in: aGLXWindowId |
|
5786 |
||
5787 |
%{ /* NOCONTEXT */ |
|
1932 | 5788 |
SETWIN(aGLXWindowId) |
5789 |
#ifdef GLX |
|
294 | 5790 |
curstype(__intVal(type)); |
1932 | 5791 |
#endif |
5792 |
%} |
|
294 | 5793 |
! |
5794 |
||
5795 |
glxCyclemapDuration: duration map: map nxtmap: nxtmap in: aGLXWindowId |
|
5796 |
||
5797 |
%{ /* NOCONTEXT */ |
|
1932 | 5798 |
SETWIN(aGLXWindowId) |
5799 |
#ifdef GLX |
|
294 | 5800 |
cyclemap(_shortVal(duration), _shortVal(map), _shortVal(nxtmap)); |
1932 | 5801 |
#endif |
5802 |
%} |
|
294 | 5803 |
! |
5804 |
||
5805 |
glxDefpatternN: n size: size mask: mask in: aGLXWindowId |
|
5806 |
||
5807 |
%{ /* NOCONTEXT */ |
|
1932 | 5808 |
SETWIN(aGLXWindowId) |
5809 |
#ifdef GLX |
|
294 | 5810 |
defpattern(_shortVal(n), _shortVal(size), (unsigned short *)_indexedArea(mask)); |
1932 | 5811 |
#endif |
5812 |
%} |
|
294 | 5813 |
! |
5814 |
||
5815 |
glxDeltag: t in: aGLXWindowId |
|
5816 |
||
5817 |
%{ /* NOCONTEXT */ |
|
1932 | 5818 |
SETWIN(aGLXWindowId) |
5819 |
#ifdef GLX |
|
294 | 5820 |
deltag(_tagVal(t)); |
1932 | 5821 |
#endif |
5822 |
%} |
|
294 | 5823 |
! |
5824 |
||
5825 |
glxDepthcueMode: mode in: aGLXWindowId |
|
5826 |
||
5827 |
%{ /* NOCONTEXT */ |
|
1932 | 5828 |
SETWIN(aGLXWindowId) |
5829 |
#ifdef GLX |
|
294 | 5830 |
depthcue(_booleanVal(mode)); |
1932 | 5831 |
#endif |
5832 |
%} |
|
294 | 5833 |
! |
5834 |
||
5835 |
glxDitherMode: mode in: aGLXWindowId |
|
5836 |
||
5837 |
%{ /* NOCONTEXT */ |
|
1932 | 5838 |
SETWIN(aGLXWindowId) |
5839 |
#ifdef GLX |
|
294 | 5840 |
dither(_longVal(mode)); |
1932 | 5841 |
#endif |
5842 |
%} |
|
294 | 5843 |
! |
5844 |
||
5845 |
glxDopup: pup in: aGLXWindowId |
|
5846 |
||
5847 |
%{ /* NOCONTEXT */ |
|
1932 | 5848 |
SETWIN(aGLXWindowId) |
5849 |
#ifdef GLX |
|
294 | 5850 |
dopup(_longVal(pup)); |
1932 | 5851 |
#endif |
5852 |
%} |
|
294 | 5853 |
! |
5854 |
||
5855 |
glxDrawmode: mode in: aGLXWindowId |
|
5856 |
||
5857 |
%{ /* NOCONTEXT */ |
|
1932 | 5858 |
SETWIN(aGLXWindowId) |
5859 |
#ifdef GLX |
|
294 | 5860 |
drawmode(_longVal(mode)); |
1932 | 5861 |
#endif |
5862 |
%} |
|
294 | 5863 |
! |
5864 |
||
5865 |
glxEditobj: obj in: aGLXWindowId |
|
5866 |
||
5867 |
%{ /* NOCONTEXT */ |
|
1932 | 5868 |
SETWIN(aGLXWindowId) |
5869 |
#ifdef GLX |
|
294 | 5870 |
editobj(_objectVal(obj)); |
1932 | 5871 |
#endif |
5872 |
%} |
|
294 | 5873 |
! |
5874 |
||
5875 |
glxEndTrimIn: aGLXWindowId |
|
5876 |
||
5877 |
%{ /* NOCONTEXT */ |
|
1932 | 5878 |
SETWIN(aGLXWindowId) |
5879 |
#ifdef GLX |
|
294 | 5880 |
endtrim(); |
1932 | 5881 |
#endif |
5882 |
%} |
|
294 | 5883 |
! |
5884 |
||
5885 |
glxEndfullscrnIn: aGLXWindowId |
|
5886 |
||
5887 |
%{ /* NOCONTEXT */ |
|
1932 | 5888 |
SETWIN(aGLXWindowId) |
5889 |
#ifdef GLX |
|
294 | 5890 |
endfullscrn(); |
1932 | 5891 |
#endif |
5892 |
%} |
|
294 | 5893 |
! |
5894 |
||
5895 |
glxEndpupmodeIn: aGLXWindowId |
|
5896 |
||
5897 |
%{ /* NOCONTEXT */ |
|
1932 | 5898 |
SETWIN(aGLXWindowId) |
5899 |
#ifdef GLX |
|
294 | 5900 |
endpupmode(); |
1932 | 5901 |
#endif |
5902 |
%} |
|
294 | 5903 |
! |
5904 |
||
5905 |
glxFinishIn: aGLXWindowId |
|
5906 |
||
5907 |
%{ /* NOCONTEXT */ |
|
1932 | 5908 |
SETWIN(aGLXWindowId) |
5909 |
#ifdef GLX |
|
294 | 5910 |
finish(); |
1932 | 5911 |
#endif |
5912 |
%} |
|
294 | 5913 |
! |
5914 |
||
5915 |
glxFont: fntnum in: aGLXWindowId |
|
5916 |
||
5917 |
%{ /* NOCONTEXT */ |
|
5918 |
SETWIN(aGLXWindowId) |
|
1932 | 5919 |
#ifdef GLX |
294 | 5920 |
font(_shortVal(fntnum)); |
1932 | 5921 |
#endif |
294 | 5922 |
%} |
5923 |
! |
|
5924 |
||
5925 |
glxForegroundIn: aGLXWindowId |
|
5926 |
||
5927 |
%{ /* NOCONTEXT */ |
|
5928 |
SETWIN(aGLXWindowId) |
|
1932 | 5929 |
#ifdef OPENGL |
5930 |
#else |
|
294 | 5931 |
foreground(); |
1932 | 5932 |
#endif |
294 | 5933 |
%} |
5934 |
! |
|
5935 |
||
5936 |
glxFreepup: pup in: aGLXWindowId |
|
5937 |
||
5938 |
%{ /* NOCONTEXT */ |
|
1932 | 5939 |
SETWIN(aGLXWindowId) |
5940 |
#ifdef GLX |
|
294 | 5941 |
freepup(_longVal(pup)); |
1932 | 5942 |
#endif |
5943 |
%} |
|
294 | 5944 |
! |
5945 |
||
5946 |
glxFudgeXfudge: xfudge yfudge: yfudge in: aGLXWindowId |
|
5947 |
||
5948 |
%{ /* NOCONTEXT */ |
|
1932 | 5949 |
SETWIN(aGLXWindowId) |
5950 |
#ifdef GLX |
|
294 | 5951 |
fudge(_longVal(xfudge), _longVal(yfudge)); |
1932 | 5952 |
#endif |
5953 |
%} |
|
294 | 5954 |
! |
5955 |
||
5956 |
glxFullscrnIn: aGLXWindowId |
|
5957 |
||
5958 |
%{ /* NOCONTEXT */ |
|
1932 | 5959 |
SETWIN(aGLXWindowId) |
5960 |
#ifdef GLX |
|
294 | 5961 |
fullscrn(); |
1932 | 5962 |
#endif |
5963 |
%} |
|
294 | 5964 |
! |
5965 |
||
5966 |
glxGbeginIn: aGLXWindowId |
|
5967 |
||
5968 |
%{ /* NOCONTEXT */ |
|
1932 | 5969 |
SETWIN(aGLXWindowId) |
5970 |
#ifdef GLX |
|
294 | 5971 |
gbegin(); |
1932 | 5972 |
#endif |
5973 |
%} |
|
294 | 5974 |
! |
5975 |
||
5976 |
glxGentagIn: aGLXWindowId |
|
5977 |
||
5978 |
%{ /* NOCONTEXT */ |
|
1932 | 5979 |
int rslt = -1; |
5980 |
||
5981 |
#ifdef GLX |
|
5982 |
SETWIN(aGLXWindowId) |
|
5983 |
rslt = gentag(); |
|
5984 |
#endif |
|
5985 |
RETURN (__MKSMALLINT(rslt)); |
|
5986 |
%} |
|
294 | 5987 |
! |
5988 |
||
5989 |
glxGetbackfaceIn: aGLXWindowId |
|
5990 |
||
5991 |
%{ /* NOCONTEXT */ |
|
1932 | 5992 |
int rslt = -1; |
5993 |
||
5994 |
#ifdef GLX |
|
5995 |
SETWIN(aGLXWindowId) |
|
5996 |
rslt = getbackface(); |
|
5997 |
#endif |
|
5998 |
RETURN (__MKSMALLINT(rslt)); |
|
5999 |
%} |
|
294 | 6000 |
! |
6001 |
||
6002 |
glxGetbufferIn: aGLXWindowId |
|
6003 |
||
6004 |
%{ /* NOCONTEXT */ |
|
1932 | 6005 |
int rslt = -1; |
6006 |
||
6007 |
#ifdef GLX |
|
6008 |
SETWIN(aGLXWindowId) |
|
6009 |
rslt = getbuffer(); |
|
6010 |
#endif |
|
6011 |
RETURN (__MKSMALLINT(rslt)); |
|
6012 |
%} |
|
294 | 6013 |
! |
6014 |
||
6015 |
glxGetbutton: num in: aGLXWindowId |
|
6016 |
||
6017 |
%{ /* NOCONTEXT */ |
|
1932 | 6018 |
int rslt = -1; |
6019 |
||
6020 |
SETWIN(aGLXWindowId) |
|
6021 |
#ifdef OPENGL |
|
6022 |
#else |
|
6023 |
rslt = getbutton(_deviceVal(num)); |
|
6024 |
#endif |
|
6025 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6026 |
%} |
6027 |
! |
|
6028 |
||
6029 |
glxGetcmmodeIn: aGLXWindowId |
|
6030 |
||
6031 |
%{ /* NOCONTEXT */ |
|
1932 | 6032 |
int rslt = 0; |
6033 |
||
6034 |
SETWIN(aGLXWindowId) |
|
6035 |
#ifdef GLX |
|
6036 |
rslt = getcmmode(); |
|
6037 |
#endif |
|
6038 |
RETURN (__MKBOOLEAN(rslt)); |
|
6039 |
%} |
|
294 | 6040 |
! |
6041 |
||
6042 |
glxGetcolorIn: aGLXWindowId |
|
6043 |
"return the current drawing color" |
|
6044 |
||
6045 |
%{ /* NOCONTEXT */ |
|
1932 | 6046 |
int rslt = -1; |
6047 |
||
6048 |
SETWIN(aGLXWindowId) |
|
6049 |
#ifdef OPENGL |
|
6050 |
#else |
|
6051 |
rslt = getcolor(); |
|
6052 |
#endif |
|
6053 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6054 |
%} |
6055 |
! |
|
6056 |
||
6057 |
glxGetdcmIn: aGLXWindowId |
|
6058 |
||
6059 |
%{ /* NOCONTEXT */ |
|
6060 |
#ifdef GLX |
|
6061 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6062 |
RETURN (__MKBOOLEAN(getdcm())); |
294 | 6063 |
#endif |
6064 |
%} |
|
6065 |
. |
|
6066 |
^ false |
|
6067 |
! |
|
6068 |
||
6069 |
glxGetdescenderIn: aGLXWindowId |
|
6070 |
||
6071 |
%{ /* NOCONTEXT */ |
|
6072 |
#ifdef GLX |
|
6073 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6074 |
RETURN (__MKSMALLINT(getdescender())); |
294 | 6075 |
#endif |
6076 |
%} |
|
6077 |
. |
|
6078 |
^ false |
|
6079 |
! |
|
6080 |
||
6081 |
glxGetdisplaymodeIn: aGLXWindowId |
|
6082 |
||
6083 |
%{ /* NOCONTEXT */ |
|
6084 |
#ifdef GLX |
|
6085 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6086 |
RETURN (__MKSMALLINT(getdisplaymode())); |
294 | 6087 |
#endif |
6088 |
%} |
|
6089 |
. |
|
6090 |
^ false |
|
6091 |
! |
|
6092 |
||
6093 |
glxGetdrawmodeIn: aGLXWindowId |
|
6094 |
||
6095 |
%{ /* NOCONTEXT */ |
|
6096 |
#ifdef GLX |
|
6097 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6098 |
RETURN (__MKSMALLINT(getdrawmode())); |
294 | 6099 |
#endif |
6100 |
%} |
|
6101 |
. |
|
6102 |
^ false |
|
6103 |
! |
|
6104 |
||
6105 |
glxGetfontIn: aGLXWindowId |
|
6106 |
||
6107 |
%{ /* NOCONTEXT */ |
|
6108 |
#ifdef GLX |
|
6109 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6110 |
RETURN (__MKSMALLINT(getfont())); |
294 | 6111 |
#endif |
6112 |
%} |
|
6113 |
. |
|
6114 |
^ false |
|
6115 |
! |
|
6116 |
||
6117 |
glxGetgconfigBuffer: buffer in: aGLXWindowId |
|
6118 |
||
6119 |
%{ /* NOCONTEXT */ |
|
6120 |
#ifdef FULL_GLX |
|
6121 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6122 |
RETURN (__MKSMALLINT(getgconfig(_longVal(buffer)))); |
294 | 6123 |
#endif |
6124 |
%} |
|
6125 |
. |
|
6126 |
^ false |
|
6127 |
! |
|
6128 |
||
6129 |
glxGetgdescInquiry: inquiry in: aGLXWindowId |
|
6130 |
||
6131 |
%{ /* NOCONTEXT */ |
|
1932 | 6132 |
int rslt = 0; |
6133 |
||
6134 |
SETWIN(aGLXWindowId) |
|
6135 |
#ifdef OPENGL |
|
6136 |
#else |
|
6137 |
rslt = getgdesc(_longVal(inquiry)); |
|
6138 |
#endif |
|
6139 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6140 |
%} |
6141 |
! |
|
6142 |
||
6143 |
glxGetheightIn: aGLXWindowId |
|
6144 |
||
6145 |
%{ /* NOCONTEXT */ |
|
1932 | 6146 |
int rslt = 0; |
6147 |
||
6148 |
SETWIN(aGLXWindowId) |
|
6149 |
#ifdef OPENGL |
|
6150 |
#else |
|
6151 |
rslt = getheight(); |
|
6152 |
#endif |
|
6153 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6154 |
%} |
6155 |
! |
|
6156 |
||
6157 |
glxGethitcodeIn: aGLXWindowId |
|
6158 |
||
6159 |
%{ /* NOCONTEXT */ |
|
6160 |
#ifdef GLX |
|
6161 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6162 |
RETURN (__MKSMALLINT(gethitcode())); |
294 | 6163 |
#endif |
6164 |
%} |
|
6165 |
. |
|
6166 |
^ false |
|
6167 |
! |
|
6168 |
||
6169 |
glxGetlsbackupIn: aGLXWindowId |
|
6170 |
||
6171 |
%{ /* NOCONTEXT */ |
|
6172 |
#ifdef GLX |
|
6173 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6174 |
RETURN (__MKBOOLEAN(getlsbackup())); |
294 | 6175 |
#endif |
6176 |
%} |
|
6177 |
. |
|
6178 |
^ false |
|
6179 |
! |
|
6180 |
||
6181 |
glxGetlsrepeatIn: aGLXWindowId |
|
6182 |
||
6183 |
%{ /* NOCONTEXT */ |
|
6184 |
#ifdef GLX |
|
6185 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6186 |
RETURN (__MKSMALLINT(getlsrepeat())); |
294 | 6187 |
#endif |
6188 |
%} |
|
6189 |
. |
|
6190 |
^ false |
|
6191 |
! |
|
6192 |
||
6193 |
glxGetlstyleIn: aGLXWindowId |
|
6194 |
||
6195 |
%{ /* NOCONTEXT */ |
|
6196 |
#ifdef GLX |
|
6197 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6198 |
RETURN (__MKSMALLINT(getlstyle())); |
294 | 6199 |
#endif |
6200 |
%} |
|
6201 |
. |
|
6202 |
^ false |
|
6203 |
! |
|
6204 |
||
6205 |
glxGetlwidthIn: aGLXWindowId |
|
6206 |
||
6207 |
%{ /* NOCONTEXT */ |
|
6208 |
#ifdef GLX |
|
6209 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6210 |
RETURN (__MKSMALLINT(getlwidth())); |
294 | 6211 |
#endif |
6212 |
%} |
|
6213 |
. |
|
6214 |
^ false |
|
6215 |
! |
|
6216 |
||
6217 |
glxGetmapIn: aGLXWindowId |
|
6218 |
||
6219 |
%{ /* NOCONTEXT */ |
|
6220 |
#ifdef GLX |
|
6221 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6222 |
RETURN (__MKSMALLINT(getmap())); |
294 | 6223 |
#endif |
6224 |
%} |
|
6225 |
. |
|
6226 |
^ false |
|
6227 |
! |
|
6228 |
||
6229 |
glxGetmmodeIn: aGLXWindowId |
|
6230 |
||
6231 |
%{ /* NOCONTEXT */ |
|
6232 |
#ifdef GLX |
|
6233 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6234 |
RETURN (__MKSMALLINT(getmmode())); |
294 | 6235 |
#endif |
6236 |
%} |
|
6237 |
. |
|
6238 |
^ false |
|
6239 |
! |
|
6240 |
||
6241 |
glxGetmonitorIn: aGLXWindowId |
|
6242 |
||
6243 |
%{ /* NOCONTEXT */ |
|
6244 |
#ifdef GLX |
|
6245 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6246 |
RETURN (__MKSMALLINT(getmonitor())); |
294 | 6247 |
#endif |
6248 |
%} |
|
6249 |
. |
|
6250 |
^ false |
|
6251 |
! |
|
6252 |
||
6253 |
glxGetmultisampleIn: aGLXWindowId |
|
6254 |
||
6255 |
%{ /* NOCONTEXT */ |
|
6256 |
#ifdef FULL_GLX |
|
6257 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6258 |
RETURN (__MKBOOLEAN(getmultisample())); |
294 | 6259 |
#endif |
6260 |
%} |
|
6261 |
. |
|
6262 |
^ false |
|
6263 |
! |
|
6264 |
||
6265 |
glxGetothermonitorIn: aGLXWindowId |
|
6266 |
||
6267 |
%{ /* NOCONTEXT */ |
|
6268 |
#ifdef GLX |
|
6269 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6270 |
RETURN (__MKSMALLINT(getothermonitor())); |
294 | 6271 |
#endif |
6272 |
%} |
|
6273 |
. |
|
6274 |
^ false |
|
6275 |
! |
|
6276 |
||
6277 |
glxGetpatternIn: aGLXWindowId |
|
6278 |
||
6279 |
%{ /* NOCONTEXT */ |
|
6280 |
#ifdef GLX |
|
6281 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6282 |
RETURN (__MKSMALLINT(getpattern())); |
294 | 6283 |
#endif |
6284 |
%} |
|
6285 |
. |
|
6286 |
^ false |
|
6287 |
! |
|
6288 |
||
6289 |
glxGetresetlsIn: aGLXWindowId |
|
6290 |
||
6291 |
%{ /* NOCONTEXT */ |
|
6292 |
#ifdef GLX |
|
6293 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6294 |
RETURN (__MKBOOLEAN(getresetls())); |
294 | 6295 |
#endif |
6296 |
%} |
|
6297 |
. |
|
6298 |
^ false |
|
6299 |
! |
|
6300 |
||
6301 |
glxGetshadeIn: aGLXWindowId |
|
6302 |
||
6303 |
%{ /* NOCONTEXT */ |
|
6304 |
#ifdef GLX |
|
6305 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6306 |
RETURN (__MKSMALLINT(getshade())); |
294 | 6307 |
#endif |
6308 |
%} |
|
6309 |
. |
|
6310 |
^ false |
|
6311 |
! |
|
6312 |
||
6313 |
glxGetsmIn: aGLXWindowId |
|
6314 |
||
6315 |
%{ /* NOCONTEXT */ |
|
6316 |
#ifdef GLX |
|
6317 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6318 |
RETURN (__MKSMALLINT(getsm())); |
294 | 6319 |
#endif |
6320 |
%} |
|
6321 |
. |
|
6322 |
^ false |
|
6323 |
! |
|
6324 |
||
6325 |
glxGetvaluator: dev in: aGLXWindowId |
|
6326 |
||
6327 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
6328 |
#ifndef OPENGL |
294 | 6329 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6330 |
RETURN (__MKSMALLINT(getvaluator(_deviceVal(dev)))); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
6331 |
#endif |
294 | 6332 |
%} |
6333 |
. |
|
6334 |
^ false |
|
6335 |
! |
|
6336 |
||
6337 |
glxGetvideo: reg in: aGLXWindowId |
|
6338 |
||
6339 |
%{ /* NOCONTEXT */ |
|
6340 |
#ifdef GLX |
|
6341 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6342 |
RETURN (__MKSMALLINT(getvideo(_longVal(reg)))); |
294 | 6343 |
#endif |
6344 |
%} |
|
6345 |
. |
|
6346 |
^ false |
|
6347 |
! |
|
6348 |
||
6349 |
glxGetwritemaskIn: aGLXWindowId |
|
6350 |
||
6351 |
%{ /* NOCONTEXT */ |
|
6352 |
#ifdef GLX |
|
6353 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6354 |
RETURN (__MKSMALLINT(getwritemask())); |
294 | 6355 |
#endif |
6356 |
%} |
|
6357 |
. |
|
6358 |
^ false |
|
6359 |
! |
|
6360 |
||
6361 |
glxGetwscrnIn: aGLXWindowId |
|
6362 |
||
6363 |
%{ /* NOCONTEXT */ |
|
6364 |
#ifdef GLX |
|
6365 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6366 |
RETURN (__MKSMALLINT(getwscrn())); |
294 | 6367 |
#endif |
6368 |
%} |
|
6369 |
. |
|
6370 |
^ false |
|
6371 |
! |
|
6372 |
||
6373 |
glxGetzbufferIn: aGLXWindowId |
|
6374 |
||
6375 |
%{ /* NOCONTEXT */ |
|
6376 |
#ifdef GLX |
|
6377 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6378 |
RETURN (__MKBOOLEAN(getzbuffer())); |
294 | 6379 |
#endif |
6380 |
%} |
|
6381 |
. |
|
6382 |
^ false |
|
6383 |
! |
|
6384 |
||
6385 |
glxGexitIn: aGLXWindowId |
|
6386 |
||
6387 |
%{ /* NOCONTEXT */ |
|
1932 | 6388 |
SETWIN(aGLXWindowId) |
6389 |
#ifdef OPENGL |
|
6390 |
#else |
|
294 | 6391 |
gexit(); |
1932 | 6392 |
#endif |
6393 |
%} |
|
294 | 6394 |
! |
6395 |
||
6396 |
glxGflushIn: aGLXWindowId |
|
6397 |
||
6398 |
%{ /* NOCONTEXT */ |
|
6399 |
#ifdef GLX |
|
6400 |
SETWIN(aGLXWindowId) |
|
6401 |
gflush(); |
|
1932 | 6402 |
#endif |
6403 |
%} |
|
294 | 6404 |
! |
6405 |
||
6406 |
glxGinitIn: aGLXWindowId |
|
6407 |
||
6408 |
%{ /* NOCONTEXT */ |
|
1932 | 6409 |
SETWIN(aGLXWindowId) |
6410 |
#ifdef OPENGL |
|
6411 |
#else |
|
294 | 6412 |
ginit(); |
1932 | 6413 |
#endif |
6414 |
%} |
|
294 | 6415 |
! |
6416 |
||
6417 |
glxGlcompatMode: mode value: value in: aGLXWindowId |
|
6418 |
||
6419 |
%{ /* NOCONTEXT */ |
|
6420 |
#ifdef GLX |
|
6421 |
SETWIN(aGLXWindowId) |
|
6422 |
glcompat(_longVal(mode), _longVal(value)); |
|
1932 | 6423 |
#endif |
6424 |
%} |
|
294 | 6425 |
! |
6426 |
||
6427 |
glxGresetIn: aGLXWindowId |
|
6428 |
||
6429 |
%{ /* NOCONTEXT */ |
|
6430 |
#ifdef GLX |
|
6431 |
SETWIN(aGLXWindowId) |
|
6432 |
greset(); |
|
1932 | 6433 |
#endif |
6434 |
%} |
|
294 | 6435 |
! |
6436 |
||
6437 |
glxGsyncIn: aGLXWindowId |
|
6438 |
||
6439 |
%{ /* NOCONTEXT */ |
|
6440 |
#ifdef GLX |
|
6441 |
SETWIN(aGLXWindowId) |
|
6442 |
gsync(); |
|
1932 | 6443 |
#endif |
6444 |
%} |
|
294 | 6445 |
! |
6446 |
||
6447 |
glxIconsizeX: x y: y in: aGLXWindowId |
|
6448 |
||
6449 |
%{ /* NOCONTEXT */ |
|
6450 |
#ifdef GLX |
|
6451 |
SETWIN(aGLXWindowId) |
|
6452 |
iconsize(_longVal(x), _longVal(y)); |
|
1932 | 6453 |
#endif |
6454 |
%} |
|
294 | 6455 |
! |
6456 |
||
6457 |
glxImakebackgroundIn: aGLXWindowId |
|
6458 |
||
6459 |
%{ /* NOCONTEXT */ |
|
6460 |
#ifdef GLX |
|
6461 |
SETWIN(aGLXWindowId) |
|
6462 |
imakebackground(); |
|
1932 | 6463 |
#endif |
6464 |
%} |
|
294 | 6465 |
! |
6466 |
||
6467 |
glxInitnamesIn: aGLXWindowId |
|
6468 |
||
6469 |
%{ /* NOCONTEXT */ |
|
6470 |
#ifdef GLX |
|
6471 |
SETWIN(aGLXWindowId) |
|
6472 |
initnames(); |
|
1932 | 6473 |
#endif |
6474 |
%} |
|
294 | 6475 |
! |
6476 |
||
6477 |
glxIsqueued: dev in: aGLXWindowId |
|
6478 |
||
6479 |
%{ /* NOCONTEXT */ |
|
6480 |
#ifdef GLX |
|
6481 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6482 |
RETURN (__MKBOOLEAN(isqueued(_deviceVal(dev)))); |
294 | 6483 |
#endif |
6484 |
%} |
|
6485 |
. |
|
6486 |
^ false |
|
6487 |
! |
|
6488 |
||
6489 |
glxIstag: t in: aGLXWindowId |
|
6490 |
||
6491 |
%{ /* NOCONTEXT */ |
|
6492 |
#ifdef GLX |
|
6493 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6494 |
RETURN (__MKBOOLEAN(istag(_tagVal(t)))); |
294 | 6495 |
#endif |
6496 |
%} |
|
6497 |
. |
|
6498 |
^ false |
|
6499 |
! |
|
6500 |
||
6501 |
glxKeepaspectX: x y: y in: aGLXWindowId |
|
6502 |
||
6503 |
%{ /* NOCONTEXT */ |
|
6504 |
#ifdef GLX |
|
6505 |
SETWIN(aGLXWindowId) |
|
6506 |
keepaspect(_longVal(x), _longVal(y)); |
|
6507 |
RETURN (true); |
|
6508 |
#endif |
|
6509 |
%} |
|
6510 |
. |
|
6511 |
^ false |
|
6512 |
! |
|
6513 |
||
6514 |
glxLinesmoothMode: mode in: aGLXWindowId |
|
6515 |
||
6516 |
%{ /* NOCONTEXT */ |
|
6517 |
#ifdef GLX |
|
6518 |
SETWIN(aGLXWindowId) |
|
6519 |
linesmooth((ulong)__intVal(mode)); |
|
6520 |
RETURN (true); |
|
6521 |
#endif |
|
6522 |
%} |
|
6523 |
. |
|
6524 |
^ false |
|
6525 |
! |
|
6526 |
||
6527 |
glxLmcolorMode: mode in: aGLXWindowId |
|
6528 |
||
6529 |
%{ /* NOCONTEXT */ |
|
6530 |
#ifdef GLX |
|
6531 |
SETWIN(aGLXWindowId) |
|
6532 |
lmcolor(_longVal(mode)); |
|
6533 |
RETURN (true); |
|
6534 |
#endif |
|
6535 |
%} |
|
6536 |
. |
|
6537 |
^ false |
|
6538 |
! |
|
6539 |
||
6540 |
glxLoadname: name in: aGLXWindowId |
|
6541 |
||
6542 |
%{ /* NOCONTEXT */ |
|
6543 |
#ifdef GLX |
|
6544 |
SETWIN(aGLXWindowId) |
|
6545 |
loadname(_shortVal(name)); |
|
6546 |
RETURN (true); |
|
6547 |
#endif |
|
6548 |
%} |
|
6549 |
. |
|
6550 |
^ false |
|
6551 |
! |
|
6552 |
||
6553 |
glxLogicop: opcode in: aGLXWindowId |
|
6554 |
||
6555 |
%{ /* NOCONTEXT */ |
|
6556 |
#ifdef GLX |
|
6557 |
SETWIN(aGLXWindowId) |
|
6558 |
logicop(_longVal(opcode)); |
|
6559 |
RETURN (true); |
|
6560 |
#endif |
|
6561 |
%} |
|
6562 |
. |
|
6563 |
^ false |
|
6564 |
! |
|
6565 |
||
6566 |
glxLsbackup: b in: aGLXWindowId |
|
6567 |
||
6568 |
%{ /* NOCONTEXT */ |
|
6569 |
#ifdef GLX |
|
6570 |
SETWIN(aGLXWindowId) |
|
6571 |
lsbackup(_booleanVal(b)); |
|
6572 |
RETURN (true); |
|
6573 |
#endif |
|
6574 |
%} |
|
6575 |
. |
|
6576 |
^ false |
|
6577 |
! |
|
6578 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6579 |
glxLsetdepthNear:znear far:zfar in: aGLXWindowId |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6580 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6581 |
%{ /* NOCONTEXT */ |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6582 |
#ifdef GLX |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6583 |
SETWIN(aGLXWindowId) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6584 |
lsetdepth(_longVal(znear), _longVal(zfar)); |
294 | 6585 |
RETURN (true); |
6586 |
#endif |
|
6587 |
%} |
|
6588 |
. |
|
6589 |
^ false |
|
6590 |
! |
|
6591 |
||
6592 |
glxLshaderangeLowin: lowin hiwin: hiwin znear: znear zfar: zfar in: aGLXWindowId |
|
6593 |
||
6594 |
%{ /* NOCONTEXT */ |
|
6595 |
#ifdef GLX |
|
6596 |
SETWIN(aGLXWindowId) |
|
6597 |
lshaderange(_colorindexVal(lowin), _colorindexVal(hiwin), |
|
6598 |
_longVal(znear), _longVal(zfar)); |
|
6599 |
RETURN (true); |
|
6600 |
#endif |
|
6601 |
%} |
|
6602 |
. |
|
6603 |
^ false |
|
6604 |
! |
|
6605 |
||
6606 |
glxLsrepeatFactor: factor in: aGLXWindowId |
|
6607 |
||
6608 |
%{ /* NOCONTEXT */ |
|
6609 |
#ifdef GLX |
|
6610 |
SETWIN(aGLXWindowId) |
|
6611 |
lsrepeat(_longVal(factor)); |
|
6612 |
RETURN (true); |
|
6613 |
#endif |
|
6614 |
%} |
|
6615 |
. |
|
6616 |
^ false |
|
6617 |
! |
|
6618 |
||
6619 |
glxMaketag: t in: aGLXWindowId |
|
6620 |
||
6621 |
%{ /* NOCONTEXT */ |
|
6622 |
#ifdef GLX |
|
6623 |
SETWIN(aGLXWindowId) |
|
6624 |
maketag(_tagVal(t)); |
|
6625 |
RETURN (true); |
|
6626 |
#endif |
|
6627 |
%} |
|
6628 |
. |
|
6629 |
^ false |
|
6630 |
! |
|
6631 |
||
6632 |
glxMaxsizeX: x y: y in: aGLXWindowId |
|
6633 |
||
6634 |
%{ /* NOCONTEXT */ |
|
6635 |
#ifdef GLX |
|
6636 |
SETWIN(aGLXWindowId) |
|
6637 |
maxsize(_longVal(x), _longVal(y)); |
|
6638 |
RETURN (true); |
|
6639 |
#endif |
|
6640 |
%} |
|
6641 |
. |
|
6642 |
^ false |
|
6643 |
! |
|
6644 |
||
6645 |
glxMinsizeX: x y: y in: aGLXWindowId |
|
6646 |
||
6647 |
%{ /* NOCONTEXT */ |
|
6648 |
#ifdef GLX |
|
6649 |
SETWIN(aGLXWindowId) |
|
6650 |
minsize(_longVal(x), _longVal(y)); |
|
6651 |
RETURN (true); |
|
6652 |
#endif |
|
6653 |
%} |
|
6654 |
. |
|
6655 |
^ false |
|
6656 |
! |
|
6657 |
||
6658 |
glxMsalphaMode: mode in: aGLXWindowId |
|
6659 |
||
6660 |
%{ /* NOCONTEXT */ |
|
6661 |
#ifdef FULL_GLX |
|
6662 |
SETWIN(aGLXWindowId) |
|
6663 |
msalpha(_longVal(mode)); |
|
6664 |
RETURN (true); |
|
6665 |
#endif |
|
6666 |
%} |
|
6667 |
. |
|
6668 |
^ false |
|
6669 |
! |
|
6670 |
||
6671 |
glxMsmask: mask inverse: inverse in: aGLXWindowId |
|
6672 |
||
6673 |
%{ /* NOCONTEXT */ |
|
6674 |
#ifdef FULL_GLX |
|
6675 |
SETWIN(aGLXWindowId) |
|
6676 |
msmask(_floatVal(mask), _booleanVal(inverse)); |
|
6677 |
RETURN (true); |
|
6678 |
#endif |
|
6679 |
%} |
|
6680 |
. |
|
6681 |
^ false |
|
6682 |
! |
|
6683 |
||
6684 |
glxMspattern: pattern in: aGLXWindowId |
|
6685 |
||
6686 |
%{ /* NOCONTEXT */ |
|
6687 |
#ifdef FULL_GLX |
|
6688 |
SETWIN(aGLXWindowId) |
|
6689 |
mspattern(_longVal(pattern)); |
|
6690 |
RETURN (true); |
|
6691 |
#endif |
|
6692 |
%} |
|
6693 |
. |
|
6694 |
^ false |
|
6695 |
! |
|
6696 |
||
6697 |
glxMssizeSamples: samples zsize: zsize ssize: ssize in: aGLXWindowId |
|
6698 |
||
6699 |
%{ /* NOCONTEXT */ |
|
6700 |
#ifdef FULL_GLX |
|
6701 |
SETWIN(aGLXWindowId) |
|
6702 |
mssize(_longVal(samples), _longVal(zsize), _longVal(ssize)); |
|
6703 |
RETURN (true); |
|
6704 |
#endif |
|
6705 |
%} |
|
6706 |
. |
|
6707 |
^ false |
|
6708 |
! |
|
6709 |
||
6710 |
glxMswapbuffers: fbuf in: aGLXWindowId |
|
6711 |
||
6712 |
%{ /* NOCONTEXT */ |
|
6713 |
#ifdef GLX |
|
6714 |
SETWIN(aGLXWindowId) |
|
6715 |
mswapbuffers(_longVal(fbuf)); |
|
6716 |
RETURN (true); |
|
6717 |
#endif |
|
6718 |
%} |
|
6719 |
. |
|
6720 |
^ false |
|
6721 |
! |
|
6722 |
||
6723 |
glxMultimapIn: aGLXWindowId |
|
6724 |
||
6725 |
%{ /* NOCONTEXT */ |
|
6726 |
#ifdef GLX |
|
6727 |
SETWIN(aGLXWindowId) |
|
6728 |
multimap(); |
|
6729 |
RETURN (true); |
|
6730 |
#endif |
|
6731 |
%} |
|
6732 |
. |
|
6733 |
^ false |
|
6734 |
! |
|
6735 |
||
6736 |
glxMultisample: bool in: aGLXWindowId |
|
6737 |
||
6738 |
%{ /* NOCONTEXT */ |
|
6739 |
#ifdef FULL_GLX |
|
6740 |
SETWIN(aGLXWindowId) |
|
6741 |
multisample(_booleanVal(bool)); |
|
6742 |
RETURN (true); |
|
6743 |
#endif |
|
6744 |
%} |
|
6745 |
. |
|
6746 |
^ false |
|
6747 |
! |
|
6748 |
||
6749 |
glxNewpupIn: aGLXWindowId |
|
6750 |
||
6751 |
%{ /* NOCONTEXT */ |
|
6752 |
#ifdef GLX |
|
6753 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6754 |
RETURN (__MKSMALLINT(newpup())); |
294 | 6755 |
#endif |
6756 |
%} |
|
6757 |
. |
|
6758 |
^ false |
|
6759 |
! |
|
6760 |
||
6761 |
glxNewtag: newtg oldtg: oldtg offst: offst in: aGLXWindowId |
|
6762 |
||
6763 |
%{ /* NOCONTEXT */ |
|
6764 |
#ifdef GLX |
|
6765 |
SETWIN(aGLXWindowId) |
|
6766 |
newtag(_tagVal(newtg), _tagVal(oldtg), _offsetVal(offst)); |
|
6767 |
RETURN (true); |
|
6768 |
#endif |
|
6769 |
%} |
|
6770 |
. |
|
6771 |
^ false |
|
6772 |
! |
|
6773 |
||
6774 |
glxNoborderIn: aGLXWindowId |
|
6775 |
||
6776 |
%{ /* NOCONTEXT */ |
|
6777 |
#ifdef GLX |
|
6778 |
SETWIN(aGLXWindowId) |
|
6779 |
noborder(); |
|
6780 |
RETURN (true); |
|
6781 |
#endif |
|
6782 |
%} |
|
6783 |
. |
|
6784 |
^ false |
|
6785 |
! |
|
6786 |
||
6787 |
glxNoise: v delta: delta in: aGLXWindowId |
|
6788 |
||
6789 |
%{ /* NOCONTEXT */ |
|
6790 |
#ifdef GLX |
|
6791 |
SETWIN(aGLXWindowId) |
|
6792 |
noise(_deviceVal(v), _shortVal(delta)); |
|
6793 |
RETURN (true); |
|
6794 |
#endif |
|
6795 |
%} |
|
6796 |
. |
|
6797 |
^ false |
|
6798 |
! |
|
6799 |
||
6800 |
glxNoportIn: aGLXWindowId |
|
6801 |
||
6802 |
%{ /* NOCONTEXT */ |
|
6803 |
#ifdef GLX |
|
6804 |
SETWIN(aGLXWindowId) |
|
6805 |
noport(); |
|
6806 |
RETURN (true); |
|
6807 |
#endif |
|
6808 |
%} |
|
6809 |
. |
|
6810 |
^ false |
|
6811 |
! |
|
6812 |
||
6813 |
glxNurbscurveKnotCount: knotCount knotList: knotList |
|
6814 |
offset: offset ctlArray: ctlArray |
|
6815 |
order: order type: type in: aGLXWindowId |
|
6816 |
||
6817 |
| ctlPoints i | |
|
6818 |
ctlPoints := DoubleArray new: ctlArray size * (ctlArray first size). |
|
6819 |
i := 1. |
|
6820 |
ctlArray do: [:point | |
|
6821 |
point do: [:coord | |
|
6822 |
ctlPoints at: i put: coord. |
|
6823 |
i := i + 1]]. |
|
6824 |
||
6825 |
%{ /* NOCONTEXT */ |
|
6826 |
#ifdef GLX |
|
6827 |
char *knotElements, *ctlElements; |
|
6828 |
OBJ cls; |
|
6829 |
int ninstVars, nInstBytes; |
|
6830 |
||
6831 |
SETWIN(aGLXWindowId) |
|
6832 |
cls = __qClass(ctlPoints); |
|
6833 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
6834 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
|
6835 |
||
6836 |
ctlElements = (char *)(_InstPtr(ctlPoints)) + nInstBytes; |
|
6837 |
knotElements = (char *)(_InstPtr(knotList)) + nInstBytes; |
|
6838 |
||
6839 |
nurbscurve ( |
|
6840 |
_longVal(knotCount), (double *)knotElements, |
|
6841 |
_longVal(offset), (double *)ctlElements, |
|
6842 |
_longVal(order), _longVal(type)); |
|
6843 |
RETURN(true); |
|
6844 |
#endif |
|
6845 |
%} |
|
6846 |
. |
|
6847 |
^ false |
|
6848 |
! |
|
6849 |
||
6850 |
glxObjdeleteTag1: tag1 tag2: tag2 in: aGLXWindowId |
|
6851 |
||
6852 |
%{ /* NOCONTEXT */ |
|
6853 |
#ifdef GLX |
|
6854 |
SETWIN(aGLXWindowId) |
|
6855 |
objdelete(_tagVal(tag1), _tagVal(tag2)); |
|
6856 |
RETURN (true); |
|
6857 |
#endif |
|
6858 |
%} |
|
6859 |
. |
|
6860 |
^ false |
|
6861 |
! |
|
6862 |
||
6863 |
glxObjinsert: t in: aGLXWindowId |
|
6864 |
||
6865 |
%{ /* NOCONTEXT */ |
|
6866 |
#ifdef GLX |
|
6867 |
SETWIN(aGLXWindowId) |
|
6868 |
objinsert(_tagVal(t)); |
|
6869 |
RETURN (true); |
|
6870 |
#endif |
|
6871 |
%} |
|
6872 |
. |
|
6873 |
^ false |
|
6874 |
! |
|
6875 |
||
6876 |
glxObjreplace: t in: aGLXWindowId |
|
6877 |
||
6878 |
%{ /* NOCONTEXT */ |
|
6879 |
#ifdef GLX |
|
6880 |
SETWIN(aGLXWindowId) |
|
6881 |
objreplace(_tagVal(t)); |
|
6882 |
RETURN (true); |
|
6883 |
#endif |
|
6884 |
%} |
|
6885 |
. |
|
6886 |
^ false |
|
6887 |
! |
|
6888 |
||
6889 |
glxOnemapIn: aGLXWindowId |
|
6890 |
||
6891 |
%{ /* NOCONTEXT */ |
|
6892 |
#ifdef GLX |
|
6893 |
SETWIN(aGLXWindowId) |
|
6894 |
onemap(); |
|
6895 |
RETURN (true); |
|
6896 |
#endif |
|
6897 |
%} |
|
6898 |
. |
|
6899 |
^ false |
|
6900 |
! |
|
6901 |
||
6902 |
glxPagecolor: pcolor in: aGLXWindowId |
|
6903 |
||
6904 |
%{ /* NOCONTEXT */ |
|
6905 |
#ifdef GLX |
|
6906 |
SETWIN(aGLXWindowId) |
|
6907 |
pagecolor(_colorindexVal(pcolor)); |
|
6908 |
RETURN (true); |
|
6909 |
#endif |
|
6910 |
%} |
|
6911 |
. |
|
6912 |
^ false |
|
6913 |
! |
|
6914 |
||
6915 |
glxPassthroughToken: token in: aGLXWindowId |
|
6916 |
||
6917 |
%{ /* NOCONTEXT */ |
|
6918 |
#ifdef GLX |
|
6919 |
SETWIN(aGLXWindowId) |
|
6920 |
passthrough(_shortVal(token)); |
|
6921 |
RETURN (true); |
|
6922 |
#endif |
|
6923 |
%} |
|
6924 |
. |
|
6925 |
^ false |
|
6926 |
! |
|
6927 |
||
6928 |
glxPclosIn: aGLXWindowId |
|
6929 |
||
6930 |
%{ /* NOCONTEXT */ |
|
6931 |
#ifdef GLX |
|
6932 |
SETWIN(aGLXWindowId) |
|
6933 |
pclos(); |
|
6934 |
RETURN (true); |
|
6935 |
#endif |
|
6936 |
%} |
|
6937 |
. |
|
6938 |
^ false |
|
6939 |
! |
|
6940 |
||
6941 |
glxPicksizeX: x y: y in: aGLXWindowId |
|
6942 |
||
6943 |
%{ /* NOCONTEXT */ |
|
6944 |
#ifdef GLX |
|
6945 |
SETWIN(aGLXWindowId) |
|
6946 |
picksize(_shortVal(x), _shortVal(y)); |
|
6947 |
RETURN (true); |
|
6948 |
#endif |
|
6949 |
%} |
|
6950 |
. |
|
6951 |
^ false |
|
6952 |
! |
|
6953 |
||
6954 |
glxPixmode: mode value: value in: aGLXWindowId |
|
6955 |
||
6956 |
%{ /* NOCONTEXT */ |
|
6957 |
#ifdef GLX |
|
6958 |
SETWIN(aGLXWindowId) |
|
6959 |
pixmode(_longVal(mode), _longVal(value)); |
|
6960 |
RETURN (true); |
|
6961 |
#endif |
|
6962 |
%} |
|
6963 |
. |
|
6964 |
^ false |
|
6965 |
! |
|
6966 |
||
6967 |
glxPntsmoothMode: mode in: aGLXWindowId |
|
6968 |
||
6969 |
%{ /* NOCONTEXT */ |
|
6970 |
#ifdef GLX |
|
6971 |
SETWIN(aGLXWindowId) |
|
6972 |
pntsmooth((ulong)__intVal(mode)); |
|
6973 |
RETURN (true); |
|
6974 |
#endif |
|
6975 |
%} |
|
6976 |
. |
|
6977 |
^ false |
|
6978 |
! |
|
6979 |
||
6980 |
glxPolysmoothMode: mode in: aGLXWindowId |
|
6981 |
||
6982 |
%{ /* NOCONTEXT */ |
|
6983 |
#ifdef GLX |
|
6984 |
SETWIN(aGLXWindowId) |
|
6985 |
polysmooth(_longVal(mode)); |
|
6986 |
RETURN (true); |
|
6987 |
#endif |
|
6988 |
%} |
|
6989 |
. |
|
6990 |
^ false |
|
6991 |
! |
|
6992 |
||
6993 |
glxPopnameIn: aGLXWindowId |
|
6994 |
||
6995 |
%{ /* NOCONTEXT */ |
|
6996 |
#ifdef GLX |
|
6997 |
SETWIN(aGLXWindowId) |
|
6998 |
popname(); |
|
6999 |
RETURN (true); |
|
7000 |
#endif |
|
7001 |
%} |
|
7002 |
. |
|
7003 |
^ false |
|
7004 |
! |
|
7005 |
||
7006 |
glxPrefpositionX1: x1 x2: x2 y1: y1 y2: y2 in: aGLXWindowId |
|
7007 |
||
7008 |
%{ /* NOCONTEXT */ |
|
7009 |
SETWIN(aGLXWindowId) |
|
1932 | 7010 |
#ifdef OPENGL |
7011 |
#else |
|
294 | 7012 |
prefposition(_longVal(x1), _longVal(x2), _longVal(y1), _longVal(y2)); |
1932 | 7013 |
#endif |
294 | 7014 |
RETURN (true); |
7015 |
%} |
|
7016 |
! |
|
7017 |
||
7018 |
glxPrefsizeX: x y: y in: aGLXWindowId |
|
7019 |
||
7020 |
%{ /* NOCONTEXT */ |
|
7021 |
SETWIN(aGLXWindowId) |
|
1932 | 7022 |
#ifdef OPENGL |
7023 |
#else |
|
294 | 7024 |
prefsize(_longVal(x), _longVal(y)); |
1932 | 7025 |
#endif |
294 | 7026 |
RETURN (true); |
7027 |
%} |
|
7028 |
! |
|
7029 |
||
7030 |
glxPupmodeIn: aGLXWindowId |
|
7031 |
||
7032 |
%{ /* NOCONTEXT */ |
|
7033 |
#ifdef GLX |
|
7034 |
SETWIN(aGLXWindowId) |
|
7035 |
pupmode(); |
|
7036 |
RETURN (true); |
|
7037 |
#endif |
|
7038 |
%} |
|
7039 |
. |
|
7040 |
^ false |
|
7041 |
! |
|
7042 |
||
7043 |
glxPushname: name In: aGLXWindowId |
|
7044 |
||
7045 |
%{ /* NOCONTEXT */ |
|
7046 |
#ifdef GLX |
|
7047 |
SETWIN(aGLXWindowId) |
|
7048 |
pushname(_shortVal(name)); |
|
7049 |
RETURN (true); |
|
7050 |
#endif |
|
7051 |
%} |
|
7052 |
. |
|
7053 |
^ false |
|
7054 |
! |
|
7055 |
||
7056 |
glxQdevice: dev in: aGLXWindowId |
|
7057 |
||
7058 |
%{ /* NOCONTEXT */ |
|
1932 | 7059 |
SETWIN(aGLXWindowId) |
7060 |
#ifdef OPENGL |
|
7061 |
#else |
|
294 | 7062 |
qdevice(_deviceVal(dev)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7063 |
#endif |
294 | 7064 |
%} |
7065 |
! |
|
7066 |
||
7067 |
glxQenterDev: dev val: val in: aGLXWindowId |
|
7068 |
||
7069 |
%{ /* NOCONTEXT */ |
|
7070 |
SETWIN(aGLXWindowId) |
|
1932 | 7071 |
#ifdef OPENGL |
7072 |
#else |
|
294 | 7073 |
qenter(_deviceVal(dev), _shortVal(val)); |
1932 | 7074 |
#endif |
294 | 7075 |
%} |
7076 |
! |
|
7077 |
||
7078 |
glxQgetfdIn: aGLXWindowId |
|
7079 |
||
7080 |
%{ /* NOCONTEXT */ |
|
7081 |
#ifdef GLX |
|
7082 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7083 |
RETURN (__MKSMALLINT(qgetfd())); |
294 | 7084 |
#endif |
7085 |
%} |
|
7086 |
. |
|
7087 |
^ false |
|
7088 |
! |
|
7089 |
||
7090 |
glxQreadIn: aGLXWindowId |
|
7091 |
||
7092 |
| dev data | |
|
7093 |
%{ |
|
7094 |
short c_data; |
|
7095 |
||
7096 |
SETWIN(aGLXWindowId) |
|
1932 | 7097 |
#ifdef OPENGL |
7098 |
#else |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7099 |
dev = __MKSMALLINT(qread(&c_data)); |
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7100 |
data = __MKSMALLINT(c_data); |
1932 | 7101 |
#endif |
294 | 7102 |
%} |
7103 |
. |
|
7104 |
^ Array with: dev with: data |
|
7105 |
! |
|
7106 |
||
7107 |
glxQresetIn: aGLXWindowId |
|
7108 |
||
7109 |
%{ /* NOCONTEXT */ |
|
7110 |
SETWIN(aGLXWindowId) |
|
1932 | 7111 |
#ifdef OPENGL |
7112 |
#else |
|
294 | 7113 |
qreset(); |
1932 | 7114 |
#endif |
294 | 7115 |
RETURN (true); |
7116 |
%} |
|
7117 |
! |
|
7118 |
||
7119 |
glxQtestIn: aGLXWindowId |
|
7120 |
||
7121 |
%{ /* NOCONTEXT */ |
|
1932 | 7122 |
int rslt = 0; |
7123 |
||
7124 |
SETWIN(aGLXWindowId) |
|
7125 |
#ifdef OPENGL |
|
7126 |
#else |
|
7127 |
rslt = qtest(); |
|
7128 |
#endif |
|
7129 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 7130 |
%} |
7131 |
! |
|
7132 |
||
7133 |
glxRGBcursorIndex: index red: red green: green blue: blue |
|
7134 |
redm: redm greenm: greenm bluem: bluem in: aGLXWindowId |
|
7135 |
||
7136 |
%{ /* NOCONTEXT */ |
|
7137 |
#ifdef GLX |
|
7138 |
SETWIN(aGLXWindowId) |
|
7139 |
RGBcursor(_shortVal(index), |
|
7140 |
_shortVal(red), _shortVal(green), _shortVal(blue), |
|
7141 |
_shortVal(redm), _shortVal(greenm), _shortVal(bluem)); |
|
7142 |
RETURN (true); |
|
7143 |
#endif |
|
7144 |
%} |
|
7145 |
. |
|
7146 |
^ false |
|
7147 |
! |
|
7148 |
||
7149 |
glxRGBwritemaskRed: red green: green blue: blue in: aGLXWindowId |
|
7150 |
||
7151 |
%{ /* NOCONTEXT */ |
|
7152 |
#ifdef GLX |
|
7153 |
SETWIN(aGLXWindowId) |
|
7154 |
RGBwritemask(_shortVal(red), _shortVal(green), _shortVal(blue)); |
|
7155 |
RETURN (true); |
|
7156 |
#endif |
|
7157 |
%} |
|
7158 |
. |
|
7159 |
^ false |
|
7160 |
! |
|
7161 |
||
7162 |
glxRectzoomX: xfactor y: yfactor in: aGLXWindowId |
|
7163 |
||
7164 |
%{ /* NOCONTEXT */ |
|
7165 |
#ifdef GLX |
|
7166 |
SETWIN(aGLXWindowId) |
|
7167 |
rectzoom(_floatVal(xfactor), _floatVal(yfactor)); |
|
7168 |
RETURN (true); |
|
7169 |
#endif |
|
7170 |
%} |
|
7171 |
. |
|
7172 |
^ false |
|
7173 |
! |
|
7174 |
||
7175 |
glxResetls: b in: aGLXWindowId |
|
7176 |
||
7177 |
%{ /* NOCONTEXT */ |
|
7178 |
#ifdef GLX |
|
7179 |
SETWIN(aGLXWindowId) |
|
7180 |
resetls(_booleanVal(b)); |
|
7181 |
RETURN (true); |
|
7182 |
#endif |
|
7183 |
%} |
|
7184 |
. |
|
7185 |
^ false |
|
7186 |
! |
|
7187 |
||
7188 |
glxRingbellIn: aGLXWindowId |
|
7189 |
||
7190 |
%{ /* NOCONTEXT */ |
|
7191 |
#ifdef GLX |
|
7192 |
SETWIN(aGLXWindowId) |
|
7193 |
ringbell(); |
|
7194 |
RETURN (true); |
|
7195 |
#endif |
|
7196 |
%} |
|
7197 |
. |
|
7198 |
^ false |
|
7199 |
! |
|
7200 |
||
7201 |
glxSboxX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7202 |
||
7203 |
%{ /* NOCONTEXT */ |
|
7204 |
#ifdef GLX |
|
7205 |
SETWIN(aGLXWindowId) |
|
7206 |
sbox(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
7207 |
RETURN (true); |
|
7208 |
#endif |
|
7209 |
%} |
|
7210 |
. |
|
7211 |
^ false |
|
7212 |
! |
|
7213 |
||
7214 |
glxSboxfX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7215 |
||
7216 |
%{ /* NOCONTEXT */ |
|
7217 |
#ifdef GLX |
|
7218 |
SETWIN(aGLXWindowId) |
|
7219 |
sboxf(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
7220 |
RETURN (true); |
|
7221 |
#endif |
|
7222 |
%} |
|
7223 |
. |
|
7224 |
^ false |
|
7225 |
! |
|
7226 |
||
7227 |
glxSboxfiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7228 |
||
7229 |
%{ /* NOCONTEXT */ |
|
7230 |
#ifdef GLX |
|
7231 |
SETWIN(aGLXWindowId) |
|
7232 |
sboxfi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
7233 |
RETURN (true); |
|
7234 |
#endif |
|
7235 |
%} |
|
7236 |
. |
|
7237 |
^ false |
|
7238 |
! |
|
7239 |
||
7240 |
glxSboxfsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7241 |
||
7242 |
%{ /* NOCONTEXT */ |
|
7243 |
#ifdef GLX |
|
7244 |
SETWIN(aGLXWindowId) |
|
7245 |
sboxfs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
7246 |
RETURN (true); |
|
7247 |
#endif |
|
7248 |
%} |
|
7249 |
. |
|
7250 |
^ false |
|
7251 |
! |
|
7252 |
||
7253 |
glxSboxiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7254 |
||
7255 |
%{ /* NOCONTEXT */ |
|
7256 |
#ifdef GLX |
|
7257 |
SETWIN(aGLXWindowId) |
|
7258 |
sboxi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
7259 |
RETURN (true); |
|
7260 |
#endif |
|
7261 |
%} |
|
7262 |
. |
|
7263 |
^ false |
|
7264 |
! |
|
7265 |
||
7266 |
glxSboxsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7267 |
||
7268 |
%{ /* NOCONTEXT */ |
|
7269 |
#ifdef GLX |
|
7270 |
SETWIN(aGLXWindowId) |
|
7271 |
sboxs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
7272 |
RETURN (true); |
|
7273 |
#endif |
|
7274 |
%} |
|
7275 |
. |
|
7276 |
^ false |
|
7277 |
! |
|
7278 |
||
7279 |
glxSclearSval: sval in: aGLXWindowId |
|
7280 |
||
7281 |
%{ /* NOCONTEXT */ |
|
7282 |
#ifdef GLX |
|
7283 |
SETWIN(aGLXWindowId) |
|
7284 |
sclear((ulong)__intVal(sval)); |
|
7285 |
RETURN (true); |
|
7286 |
#endif |
|
7287 |
%} |
|
7288 |
. |
|
7289 |
^ false |
|
7290 |
! |
|
7291 |
||
7292 |
glxScrbox: arg in: aGLXWindowId |
|
7293 |
||
7294 |
%{ /* NOCONTEXT */ |
|
7295 |
#ifdef GLX |
|
7296 |
SETWIN(aGLXWindowId) |
|
7297 |
scrbox(_longVal(arg)); |
|
7298 |
RETURN (true); |
|
7299 |
#endif |
|
7300 |
%} |
|
7301 |
. |
|
7302 |
^ false |
|
7303 |
! |
|
7304 |
||
7305 |
glxScreenspaceIn: aGLXWindowId |
|
7306 |
||
7307 |
%{ /* NOCONTEXT */ |
|
7308 |
#ifdef GLX |
|
7309 |
SETWIN(aGLXWindowId) |
|
7310 |
screenspace(); |
|
7311 |
RETURN (true); |
|
7312 |
#endif |
|
7313 |
%} |
|
7314 |
. |
|
7315 |
^ false |
|
7316 |
! |
|
7317 |
||
7318 |
glxScrmaskLeft: left right: right bottom: bottom top: top in: aGLXWindowId |
|
7319 |
||
7320 |
%{ /* NOCONTEXT */ |
|
7321 |
#ifdef GLX |
|
7322 |
SETWIN(aGLXWindowId) |
|
7323 |
scrmask(_screencoordVal(left), _screencoordVal(right), |
|
7324 |
_screencoordVal(bottom), _screencoordVal(top)); |
|
7325 |
RETURN (true); |
|
7326 |
#endif |
|
7327 |
%} |
|
7328 |
. |
|
7329 |
^ false |
|
7330 |
! |
|
7331 |
||
7332 |
glxScrnattach: gsnr in: aGLXWindowId |
|
7333 |
||
7334 |
%{ /* NOCONTEXT */ |
|
7335 |
#ifdef GLX |
|
7336 |
SETWIN(aGLXWindowId) |
|
7337 |
scrnattach(_longVal(gsnr)); |
|
7338 |
RETURN (true); |
|
7339 |
#endif |
|
7340 |
%} |
|
7341 |
. |
|
7342 |
^ false |
|
7343 |
! |
|
7344 |
||
7345 |
glxScrnselect: gsnr in: aGLXWindowId |
|
7346 |
||
7347 |
%{ /* NOCONTEXT */ |
|
7348 |
#ifdef GLX |
|
7349 |
SETWIN(aGLXWindowId) |
|
7350 |
scrnselect(_longVal(gsnr)); |
|
7351 |
RETURN (true); |
|
7352 |
#endif |
|
7353 |
%} |
|
7354 |
. |
|
7355 |
^ false |
|
7356 |
! |
|
7357 |
||
7358 |
glxSetcursorIndex: index color: color wtn: wtn in: aGLXWindowId |
|
7359 |
||
7360 |
%{ /* NOCONTEXT */ |
|
7361 |
#ifdef GLX |
|
7362 |
SETWIN(aGLXWindowId) |
|
7363 |
setcursor(_shortVal(index), _colorindexVal(color), _colorindexVal(wtn)); |
|
7364 |
RETURN (true); |
|
7365 |
#endif |
|
7366 |
%} |
|
7367 |
. |
|
7368 |
^ false |
|
7369 |
! |
|
7370 |
||
7371 |
glxSetdblightsMask: mask in: aGLXWindowId |
|
7372 |
||
7373 |
%{ /* NOCONTEXT */ |
|
7374 |
#ifdef GLX |
|
7375 |
SETWIN(aGLXWindowId) |
|
7376 |
setdblights((ulong)__intVal(mask)); |
|
7377 |
RETURN (true); |
|
7378 |
#endif |
|
7379 |
%} |
|
7380 |
. |
|
7381 |
^ false |
|
7382 |
! |
|
7383 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7384 |
glxSetdepthNear:znear far:zfar in: aGLXWindowId |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7385 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7386 |
%{ /* NOCONTEXT */ |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7387 |
#ifdef GLX |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7388 |
SETWIN(aGLXWindowId) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7389 |
setdepth(_screencoordVal(znear), _screencoordVal(zfar)); |
294 | 7390 |
RETURN (true); |
7391 |
#endif |
|
7392 |
%} |
|
7393 |
. |
|
7394 |
^ false |
|
7395 |
! |
|
7396 |
||
7397 |
glxSetmap: mapnum in: aGLXWindowId |
|
7398 |
||
7399 |
%{ /* NOCONTEXT */ |
|
7400 |
#ifdef GLX |
|
7401 |
SETWIN(aGLXWindowId) |
|
7402 |
setmap(_shortVal(mapnum)); |
|
7403 |
RETURN (true); |
|
7404 |
#endif |
|
7405 |
%} |
|
7406 |
. |
|
7407 |
^ false |
|
7408 |
! |
|
7409 |
||
7410 |
glxSetmonitor: mtype in: aGLXWindowId |
|
7411 |
||
7412 |
%{ /* NOCONTEXT */ |
|
7413 |
#ifdef GLX |
|
7414 |
SETWIN(aGLXWindowId) |
|
7415 |
setmonitor(_shortVal(mtype)); |
|
7416 |
RETURN (true); |
|
7417 |
#endif |
|
7418 |
%} |
|
7419 |
. |
|
7420 |
^ false |
|
7421 |
! |
|
7422 |
||
7423 |
glxSetnurbsproperty: property value: value in: aGLXWindowId |
|
7424 |
||
7425 |
%{ /* NOCONTEXT */ |
|
7426 |
#ifdef GLX |
|
7427 |
SETWIN(aGLXWindowId) |
|
7428 |
setnurbsproperty(_longVal(property), _floatVal(value)); |
|
7429 |
RETURN (true); |
|
7430 |
#endif |
|
7431 |
%} |
|
7432 |
. |
|
7433 |
^ false |
|
7434 |
! |
|
7435 |
||
7436 |
glxSetpattern: index in: aGLXWindowId |
|
7437 |
||
7438 |
%{ /* NOCONTEXT */ |
|
7439 |
#ifdef GLX |
|
7440 |
SETWIN(aGLXWindowId) |
|
7441 |
setpattern(_shortVal(index)); |
|
7442 |
RETURN (true); |
|
7443 |
#endif |
|
7444 |
%} |
|
7445 |
. |
|
7446 |
^ false |
|
7447 |
! |
|
7448 |
||
7449 |
glxSetpup: pup entry: entry mode: mode in: aGLXWindowId |
|
7450 |
||
7451 |
%{ /* NOCONTEXT */ |
|
7452 |
#ifdef GLX |
|
7453 |
SETWIN(aGLXWindowId) |
|
7454 |
setpup(_longVal(pup), _longVal(entry), (ulong)__intVal(mode)); |
|
7455 |
RETURN (true); |
|
7456 |
#endif |
|
7457 |
%} |
|
7458 |
. |
|
7459 |
^ false |
|
7460 |
! |
|
7461 |
||
7462 |
glxSetvaluator: v init: init vmin: vmin vmax: vmax in: aGLXWindowId |
|
7463 |
||
7464 |
%{ /* NOCONTEXT */ |
|
7465 |
#ifdef GLX |
|
7466 |
SETWIN(aGLXWindowId) |
|
7467 |
setvaluator(_deviceVal(v), _shortVal(init), _shortVal(vmin), _shortVal(vmax)); |
|
7468 |
RETURN (true); |
|
7469 |
#endif |
|
7470 |
%} |
|
7471 |
. |
|
7472 |
^ false |
|
7473 |
! |
|
7474 |
||
7475 |
glxSetvideo: reg value: value in: aGLXWindowId |
|
7476 |
||
7477 |
%{ /* NOCONTEXT */ |
|
7478 |
#ifdef GLX |
|
7479 |
SETWIN(aGLXWindowId) |
|
7480 |
setvideo(_longVal(reg), _longVal(value)); |
|
7481 |
RETURN (true); |
|
7482 |
#endif |
|
7483 |
%} |
|
7484 |
. |
|
7485 |
^ false |
|
7486 |
! |
|
7487 |
||
7488 |
glxShademodel: model in: aGLXWindowId |
|
7489 |
||
7490 |
%{ /* NOCONTEXT */ |
|
7491 |
#ifdef GLX |
|
7492 |
SETWIN(aGLXWindowId) |
|
7493 |
shademodel(_longVal(model)); |
|
7494 |
RETURN (true); |
|
7495 |
#endif |
|
7496 |
%} |
|
7497 |
. |
|
7498 |
^ false |
|
7499 |
! |
|
7500 |
||
7501 |
glxShaderangeLowin: lowin hiwin: hiwin z1: z1 z2: z2 in: aGLXWindowId |
|
7502 |
||
7503 |
%{ /* NOCONTEXT */ |
|
7504 |
#ifdef GLX |
|
7505 |
SETWIN(aGLXWindowId) |
|
7506 |
shaderange(_colorindexVal(lowin), _colorindexVal(hiwin), |
|
7507 |
_screencoordVal(z1), _screencoordVal(z2)); |
|
7508 |
RETURN (true); |
|
7509 |
#endif |
|
7510 |
%} |
|
7511 |
. |
|
7512 |
^ false |
|
7513 |
! |
|
7514 |
||
7515 |
glxSmoothline: mode in: aGLXWindowId |
|
7516 |
||
7517 |
%{ /* NOCONTEXT */ |
|
7518 |
#ifdef GLX |
|
7519 |
SETWIN(aGLXWindowId) |
|
7520 |
smoothline(_longVal(mode)); |
|
7521 |
RETURN (true); |
|
7522 |
#endif |
|
7523 |
%} |
|
7524 |
. |
|
7525 |
^ false |
|
7526 |
! |
|
7527 |
||
7528 |
glxStencilEnable: enable ref: ref func: func mask: mask fail: fail |
|
7529 |
pass: pass zpass: zpass in: aGLXWindowId |
|
7530 |
||
7531 |
%{ /* NOCONTEXT */ |
|
7532 |
#ifdef GLX |
|
7533 |
SETWIN(aGLXWindowId) |
|
7534 |
stencil(_longVal(enable), (ulong)__intVal(ref), _longVal(func), |
|
7535 |
(ulong)__intVal(mask), _longVal(fail), _longVal(pass), _longVal(zpass)); |
|
7536 |
RETURN (true); |
|
7537 |
#endif |
|
7538 |
%} |
|
7539 |
. |
|
7540 |
^ false |
|
7541 |
! |
|
7542 |
||
7543 |
glxStensize: planes in: aGLXWindowId |
|
7544 |
||
7545 |
%{ /* NOCONTEXT */ |
|
7546 |
#ifdef GLX |
|
7547 |
SETWIN(aGLXWindowId) |
|
7548 |
stensize(_longVal(planes)); |
|
7549 |
RETURN (true); |
|
7550 |
#endif |
|
7551 |
%} |
|
7552 |
. |
|
7553 |
^ false |
|
7554 |
! |
|
7555 |
||
7556 |
glxStepunitX: x y: y in: aGLXWindowId |
|
7557 |
||
7558 |
%{ /* NOCONTEXT */ |
|
7559 |
#ifdef GLX |
|
7560 |
SETWIN(aGLXWindowId) |
|
7561 |
stepunit(_longVal(x), _longVal(y)); |
|
7562 |
RETURN (true); |
|
7563 |
#endif |
|
7564 |
%} |
|
7565 |
. |
|
7566 |
^ false |
|
7567 |
! |
|
7568 |
||
7569 |
glxSubpixel: b in: aGLXWindowId |
|
7570 |
||
7571 |
%{ /* NOCONTEXT */ |
|
7572 |
#ifdef GLX |
|
7573 |
SETWIN(aGLXWindowId) |
|
7574 |
subpixel(_booleanVal(b)); |
|
7575 |
RETURN (true); |
|
7576 |
#endif |
|
7577 |
%} |
|
7578 |
. |
|
7579 |
^ false |
|
7580 |
! |
|
7581 |
||
7582 |
glxSwapinterval: i in: aGLXWindowId |
|
7583 |
||
7584 |
%{ /* NOCONTEXT */ |
|
7585 |
#ifdef GLX |
|
7586 |
SETWIN(aGLXWindowId) |
|
7587 |
swapinterval(_shortVal(i)); |
|
7588 |
RETURN (true); |
|
7589 |
#endif |
|
7590 |
%} |
|
7591 |
. |
|
7592 |
^ false |
|
7593 |
! |
|
7594 |
||
7595 |
glxSwaptmeshIn: aGLXWindowId |
|
7596 |
||
7597 |
%{ /* NOCONTEXT */ |
|
7598 |
#ifdef GLX |
|
7599 |
SETWIN(aGLXWindowId) |
|
7600 |
swaptmesh(); |
|
7601 |
RETURN (true); |
|
7602 |
#endif |
|
7603 |
%} |
|
7604 |
. |
|
7605 |
^ false |
|
7606 |
! |
|
7607 |
||
7608 |
glxSwinopen: parent in: aGLXWindowId |
|
7609 |
||
7610 |
%{ /* NOCONTEXT */ |
|
7611 |
#ifdef GLX |
|
7612 |
SETWIN(aGLXWindowId) |
|
7613 |
swinopen(_longVal(parent)); |
|
7614 |
RETURN (true); |
|
7615 |
#endif |
|
7616 |
%} |
|
7617 |
. |
|
7618 |
^ false |
|
7619 |
! |
|
7620 |
||
7621 |
glxSwritemask: mask in: aGLXWindowId |
|
7622 |
||
7623 |
%{ /* NOCONTEXT */ |
|
7624 |
#ifdef GLX |
|
7625 |
SETWIN(aGLXWindowId) |
|
7626 |
swritemask((ulong)__intVal(mask)); |
|
7627 |
RETURN (true); |
|
7628 |
#endif |
|
7629 |
%} |
|
7630 |
. |
|
7631 |
^ false |
|
7632 |
! |
|
7633 |
||
7634 |
glxTextinitIn: aGLXWindowId |
|
7635 |
||
7636 |
%{ /* NOCONTEXT */ |
|
7637 |
#ifdef GLX |
|
7638 |
SETWIN(aGLXWindowId) |
|
7639 |
textinit(); |
|
7640 |
RETURN (true); |
|
7641 |
#endif |
|
7642 |
%} |
|
7643 |
. |
|
7644 |
^ false |
|
7645 |
! |
|
7646 |
||
7647 |
glxTextportLeft: left right: right bottom: bottom top: top in: aGLXWindowId |
|
7648 |
||
7649 |
%{ /* NOCONTEXT */ |
|
7650 |
#ifdef GLX |
|
7651 |
SETWIN(aGLXWindowId) |
|
7652 |
textport(_screencoordVal(left), _screencoordVal(right), |
|
7653 |
_screencoordVal(bottom), _screencoordVal(top)); |
|
7654 |
RETURN (true); |
|
7655 |
#endif |
|
7656 |
%} |
|
7657 |
. |
|
7658 |
^ false |
|
7659 |
! |
|
7660 |
||
7661 |
glxTieB: b v1: v1 v2: v2 in: aGLXWindowId |
|
7662 |
||
7663 |
%{ /* NOCONTEXT */ |
|
7664 |
#ifdef GLX |
|
7665 |
SETWIN(aGLXWindowId) |
|
7666 |
tie(_deviceVal(b), _deviceVal(v1), _deviceVal(v2)); |
|
7667 |
RETURN (true); |
|
7668 |
#endif |
|
7669 |
%} |
|
7670 |
. |
|
7671 |
^ false |
|
7672 |
! |
|
7673 |
||
7674 |
glxTlutbind: target index: index in: aGLXWindowId |
|
7675 |
||
7676 |
%{ /* NOCONTEXT */ |
|
7677 |
#ifdef FULL_GLX |
|
7678 |
SETWIN(aGLXWindowId) |
|
7679 |
tlutbind(_longVal(target), _longVal(index)); |
|
7680 |
RETURN (true); |
|
7681 |
#endif |
|
7682 |
%} |
|
7683 |
. |
|
7684 |
^ false |
|
7685 |
! |
|
7686 |
||
7687 |
glxTpoffIn: aGLXWindowId |
|
7688 |
||
7689 |
%{ /* NOCONTEXT */ |
|
7690 |
#ifdef GLX |
|
7691 |
SETWIN(aGLXWindowId) |
|
7692 |
tpoff(); |
|
7693 |
RETURN (true); |
|
7694 |
#endif |
|
7695 |
%} |
|
7696 |
. |
|
7697 |
^ false |
|
7698 |
! |
|
7699 |
||
7700 |
glxTponIn: aGLXWindowId |
|
7701 |
||
7702 |
%{ /* NOCONTEXT */ |
|
7703 |
#ifdef GLX |
|
7704 |
SETWIN(aGLXWindowId) |
|
7705 |
tpon(); |
|
7706 |
RETURN (true); |
|
7707 |
#endif |
|
7708 |
%} |
|
7709 |
. |
|
7710 |
^ false |
|
7711 |
! |
|
7712 |
||
7713 |
glxUnqdevice: dev in: aGLXWindowId |
|
7714 |
||
7715 |
%{ /* NOCONTEXT */ |
|
1932 | 7716 |
SETWIN(aGLXWindowId) |
7717 |
#ifdef OPENGL |
|
7718 |
#else |
|
294 | 7719 |
unqdevice(_deviceVal(dev)); |
1932 | 7720 |
#endif |
7721 |
%} |
|
294 | 7722 |
! |
7723 |
||
7724 |
glxWmpack: pack in: aGLXWindowId |
|
7725 |
||
7726 |
%{ /* NOCONTEXT */ |
|
7727 |
#ifdef GLX |
|
7728 |
SETWIN(aGLXWindowId) |
|
7729 |
wmpack((ulong)__intVal(pack)); |
|
7730 |
RETURN (true); |
|
7731 |
#endif |
|
7732 |
%} |
|
7733 |
. |
|
7734 |
^ false |
|
7735 |
! |
|
7736 |
||
7737 |
glxWritemask: wtm in: aGLXWindowId |
|
7738 |
||
7739 |
%{ /* NOCONTEXT */ |
|
7740 |
#ifdef GLX |
|
7741 |
SETWIN(aGLXWindowId) |
|
7742 |
writemask(_colorindexVal(wtm)); |
|
7743 |
RETURN (true); |
|
7744 |
#endif |
|
7745 |
%} |
|
7746 |
. |
|
7747 |
^ false |
|
7748 |
! |
|
7749 |
||
7750 |
glxXfpt2X: x y: y in: aGLXWindowId |
|
7751 |
||
7752 |
%{ /* NOCONTEXT */ |
|
7753 |
#ifdef GLX |
|
7754 |
Coord c_x, c_y; |
|
7755 |
||
7756 |
_COORD_ (x, c_x) |
|
7757 |
_COORD_ (y, c_y) |
|
7758 |
SETWIN(aGLXWindowId) |
|
7759 |
xfpt2(c_x, c_y); |
|
7760 |
RETURN (true); |
|
7761 |
#endif |
|
7762 |
%} |
|
7763 |
. |
|
7764 |
^ false |
|
7765 |
! |
|
7766 |
||
7767 |
glxXfpt2iX: x y: y in: aGLXWindowId |
|
7768 |
||
7769 |
%{ /* NOCONTEXT */ |
|
7770 |
#ifdef GLX |
|
7771 |
Icoord c_x, c_y; |
|
7772 |
||
7773 |
_ICOORD_ (x, c_x) |
|
7774 |
_ICOORD_ (y, c_y) |
|
7775 |
SETWIN(aGLXWindowId) |
|
7776 |
xfpt2i(c_x, c_y); |
|
7777 |
RETURN (true); |
|
7778 |
#endif |
|
7779 |
%} |
|
7780 |
. |
|
7781 |
^ false |
|
7782 |
! |
|
7783 |
||
7784 |
glxXfpt2sX: x y: y in: aGLXWindowId |
|
7785 |
||
7786 |
%{ /* NOCONTEXT */ |
|
7787 |
#ifdef GLX |
|
7788 |
Scoord c_x, c_y; |
|
7789 |
||
7790 |
_SCOORD_ (x, c_x) |
|
7791 |
_SCOORD_ (y, c_y) |
|
7792 |
SETWIN(aGLXWindowId) |
|
7793 |
xfpt2s(c_x, c_y); |
|
7794 |
RETURN (true); |
|
7795 |
#endif |
|
7796 |
%} |
|
7797 |
. |
|
7798 |
^ false |
|
7799 |
! |
|
7800 |
||
7801 |
glxXfpt4X: x y: y z: z w: w in: aGLXWindowId |
|
7802 |
||
7803 |
%{ /* NOCONTEXT */ |
|
7804 |
#ifdef GLX |
|
7805 |
Coord c_x, c_y, c_z, c_w; |
|
7806 |
||
7807 |
_COORD_ (x, c_x) |
|
7808 |
_COORD_ (y, c_y) |
|
7809 |
_COORD_ (z, c_z) |
|
7810 |
_COORD_ (w, c_w) |
|
7811 |
SETWIN(aGLXWindowId) |
|
7812 |
xfpt4(c_x, c_y, c_z, c_w); |
|
7813 |
RETURN (true); |
|
7814 |
#endif |
|
7815 |
%} |
|
7816 |
. |
|
7817 |
^ false |
|
7818 |
! |
|
7819 |
||
7820 |
glxXfpt4iX: x y: y z: z w: w in: aGLXWindowId |
|
7821 |
||
7822 |
%{ /* NOCONTEXT */ |
|
7823 |
#ifdef GLX |
|
7824 |
Icoord c_x, c_y, c_z, c_w; |
|
7825 |
||
7826 |
_ICOORD_ (x, c_x) |
|
7827 |
_ICOORD_ (y, c_y) |
|
7828 |
_ICOORD_ (z, c_z) |
|
7829 |
_ICOORD_ (w, c_w) |
|
7830 |
SETWIN(aGLXWindowId) |
|
7831 |
xfpt4i(c_x, c_y, c_z, c_w); |
|
7832 |
RETURN (true); |
|
7833 |
#endif |
|
7834 |
%} |
|
7835 |
. |
|
7836 |
^ false |
|
7837 |
! |
|
7838 |
||
7839 |
glxXfpt4sX: x y: y z: z w: w in: aGLXWindowId |
|
7840 |
||
7841 |
%{ /* NOCONTEXT */ |
|
7842 |
#ifdef GLX |
|
7843 |
Scoord c_x, c_y, c_z, c_w; |
|
7844 |
||
7845 |
_SCOORD_ (x, c_x) |
|
7846 |
_SCOORD_ (y, c_y) |
|
7847 |
_SCOORD_ (z, c_z) |
|
7848 |
_SCOORD_ (w, c_w) |
|
7849 |
SETWIN(aGLXWindowId) |
|
7850 |
xfpt4s(c_x, c_y, c_z, c_w); |
|
7851 |
RETURN (true); |
|
7852 |
#endif |
|
7853 |
%} |
|
7854 |
. |
|
7855 |
^ false |
|
7856 |
! |
|
7857 |
||
7858 |
glxXfptX: x y: y z: z in: aGLXWindowId |
|
7859 |
||
7860 |
%{ /* NOCONTEXT */ |
|
7861 |
#ifdef GLX |
|
7862 |
Coord c_x, c_y, c_z; |
|
7863 |
||
7864 |
_COORD_ (x, c_x) |
|
7865 |
_COORD_ (y, c_y) |
|
7866 |
_COORD_ (z, c_z) |
|
7867 |
SETWIN(aGLXWindowId) |
|
7868 |
xfpt(c_x, c_y, c_z); |
|
7869 |
RETURN (true); |
|
7870 |
#endif |
|
7871 |
%} |
|
7872 |
. |
|
7873 |
^ false |
|
7874 |
! |
|
7875 |
||
7876 |
glxXfptiX: x y: y z: z in: aGLXWindowId |
|
7877 |
||
7878 |
%{ /* NOCONTEXT */ |
|
7879 |
#ifdef GLX |
|
7880 |
Icoord c_x, c_y, c_z; |
|
7881 |
||
7882 |
_ICOORD_ (x, c_x) |
|
7883 |
_ICOORD_ (y, c_y) |
|
7884 |
_ICOORD_ (z, c_z) |
|
7885 |
SETWIN(aGLXWindowId) |
|
7886 |
xfpti(c_x, c_y, c_z); |
|
7887 |
RETURN (true); |
|
7888 |
#endif |
|
7889 |
%} |
|
7890 |
. |
|
7891 |
^ false |
|
7892 |
! |
|
7893 |
||
7894 |
glxXfptsX: x y: y z: z in: aGLXWindowId |
|
7895 |
||
7896 |
%{ /* NOCONTEXT */ |
|
7897 |
#ifdef GLX |
|
7898 |
Scoord c_x, c_y, c_z; |
|
7899 |
||
7900 |
_SCOORD_ (x, c_x) |
|
7901 |
_SCOORD_ (y, c_y) |
|
7902 |
_SCOORD_ (z, c_z) |
|
7903 |
SETWIN(aGLXWindowId) |
|
7904 |
xfpts(c_x, c_y, c_z); |
|
7905 |
RETURN (true); |
|
7906 |
#endif |
|
7907 |
%} |
|
7908 |
. |
|
7909 |
^ false |
|
7910 |
! ! |
|
7911 |
||
7912 |
!GLXWorkstation methodsFor:'vertex data transfer'! |
|
7913 |
||
7914 |
glxN3f:arrayOf3Floats in:aGLXWindowId |
|
7915 |
"argument must be an array of 3 floats containing the |
|
7916 |
current vertex normal - in real GL only" |
|
7917 |
||
7918 |
%{ /* NOCONTEXT */ |
|
7919 |
#ifdef GLX |
|
7920 |
float vec[3], *v; |
|
7921 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7922 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 7923 |
SETWIN(aGLXWindowId) |
7924 |
n3f(v); |
|
7925 |
RETURN (true); |
|
7926 |
#endif |
|
7927 |
%} |
|
7928 |
. |
|
7929 |
^ false |
|
7930 |
! |
|
7931 |
||
7932 |
glxV2d:v in:aGLXWindowId |
|
7933 |
"pass a vertex; v must be a vector with 2 doubles; z is taken as 0" |
|
7934 |
||
7935 |
%{ /* NOCONTEXT */ |
|
7936 |
double vec[2], *c_v; |
|
7937 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7938 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 2))) RETURN(false); |
294 | 7939 |
SETWIN(aGLXWindowId) |
1932 | 7940 |
#ifdef OPENGL |
7941 |
#else |
|
294 | 7942 |
v2d(c_v); |
1932 | 7943 |
#endif |
294 | 7944 |
RETURN (true); |
7945 |
%} |
|
7946 |
! |
|
7947 |
||
7948 |
glxV2f:v in:aGLXWindowId |
|
7949 |
"pass a vertex; v must be a vector with 2 floats; z is taken as 0" |
|
7950 |
||
7951 |
%{ /* NOCONTEXT */ |
|
7952 |
float vec[2], *c_v; |
|
7953 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7954 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
294 | 7955 |
SETWIN(aGLXWindowId) |
1932 | 7956 |
#ifdef OPENGL |
7957 |
#else |
|
294 | 7958 |
v2f(c_v); |
1932 | 7959 |
#endif |
294 | 7960 |
RETURN (true); |
7961 |
%} |
|
7962 |
! |
|
7963 |
||
7964 |
glxV2fX:x y:y in:aGLXWindowId |
|
7965 |
"pass a vertex from individual x and y values; z is taken as 0.0" |
|
7966 |
||
7967 |
%{ /* NOCONTEXT */ |
|
7968 |
float vec[2]; |
|
7969 |
||
7970 |
_FLOAT_(x, vec[0]) |
|
7971 |
_FLOAT_(y, vec[1]) |
|
7972 |
SETWIN(aGLXWindowId) |
|
1932 | 7973 |
#ifdef OPENGL |
7974 |
#else |
|
294 | 7975 |
v2f(vec); |
1932 | 7976 |
#endif |
294 | 7977 |
RETURN (true); |
7978 |
%} |
|
7979 |
! |
|
7980 |
||
7981 |
glxV2i:v in:aGLXWindowId |
|
7982 |
"pass a vertex; v must be a vector with 2 longs; z is taken as 0" |
|
7983 |
||
7984 |
%{ /* NOCONTEXT */ |
|
7985 |
long vec[2], *c_v; |
|
7986 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7987 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 2))) RETURN(false); |
294 | 7988 |
SETWIN(aGLXWindowId) |
1932 | 7989 |
#ifdef OPENGL |
7990 |
#else |
|
294 | 7991 |
v2i(c_v); |
1932 | 7992 |
#endif |
294 | 7993 |
RETURN (true); |
7994 |
%} |
|
7995 |
! |
|
7996 |
||
7997 |
glxV2s:v in:aGLXWindowId |
|
7998 |
"pass a vertex; v must be a vector with 2 shorts; z is taken as 0" |
|
7999 |
||
8000 |
%{ /* NOCONTEXT */ |
|
8001 |
short vec[2], *c_v; |
|
8002 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8003 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 2))) RETURN(false); |
294 | 8004 |
SETWIN(aGLXWindowId) |
1932 | 8005 |
#ifdef OPENGL |
8006 |
#else |
|
294 | 8007 |
v2s(c_v); |
1932 | 8008 |
#endif |
294 | 8009 |
RETURN (true); |
8010 |
%} |
|
8011 |
! |
|
8012 |
||
8013 |
glxV3d:v in:aGLXWindowId |
|
8014 |
"pass a vertex; v must be a 3-element double-vector" |
|
8015 |
||
8016 |
%{ /* NOCONTEXT */ |
|
8017 |
double vec[3], *c_v; |
|
8018 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8019 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 3))) RETURN(false); |
294 | 8020 |
SETWIN(aGLXWindowId) |
1932 | 8021 |
#ifdef OPENGL |
8022 |
#else |
|
294 | 8023 |
v3d(c_v); |
1932 | 8024 |
#endif |
294 | 8025 |
RETURN (true); |
8026 |
%} |
|
8027 |
. |
|
8028 |
^ false |
|
8029 |
! |
|
8030 |
||
8031 |
glxV3f:v in:aGLXWindowId |
|
8032 |
"pass a vertex; v must be a 3-element float-vector" |
|
8033 |
||
8034 |
%{ /* NOCONTEXT */ |
|
8035 |
float vec[3], *c_v; |
|
8036 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8037 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
294 | 8038 |
SETWIN(aGLXWindowId) |
1932 | 8039 |
#ifdef OPENGL |
8040 |
#else |
|
294 | 8041 |
v3f(c_v); |
1932 | 8042 |
#endif |
294 | 8043 |
RETURN (true); |
8044 |
%} |
|
8045 |
! |
|
8046 |
||
8047 |
glxV3fX:x y:y z:z in: aGLXWindowId |
|
8048 |
"pass a vector from individual x, y and z (float) values" |
|
8049 |
||
8050 |
%{ /* NOCONTEXT */ |
|
8051 |
float vec[3]; |
|
8052 |
||
8053 |
_FLOAT_(x, vec[0]) |
|
8054 |
_FLOAT_(y, vec[1]) |
|
8055 |
_FLOAT_(z, vec[2]) |
|
8056 |
SETWIN(aGLXWindowId) |
|
1932 | 8057 |
#ifdef OPENGL |
8058 |
#else |
|
294 | 8059 |
v3f(vec); |
1932 | 8060 |
#endif |
294 | 8061 |
RETURN (true); |
8062 |
%} |
|
8063 |
! |
|
8064 |
||
8065 |
glxV3i:v in:aGLXWindowId |
|
8066 |
"pass a vertex; v must be a vector with 3 longs" |
|
8067 |
||
8068 |
%{ /* NOCONTEXT */ |
|
8069 |
long vec[3], *c_v; |
|
8070 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8071 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
294 | 8072 |
SETWIN(aGLXWindowId) |
1932 | 8073 |
#ifdef OPENGL |
8074 |
#else |
|
294 | 8075 |
v3i(c_v); |
1932 | 8076 |
#endif |
294 | 8077 |
RETURN (true); |
8078 |
%} |
|
8079 |
! |
|
8080 |
||
8081 |
glxV3s:v in:aGLXWindowId |
|
8082 |
"pass a vertex; v must be a vector with 3 shorts" |
|
8083 |
||
8084 |
%{ /* NOCONTEXT */ |
|
8085 |
short vec[3], *c_v; |
|
8086 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8087 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
294 | 8088 |
SETWIN(aGLXWindowId) |
1932 | 8089 |
#ifdef OPENGL |
8090 |
#else |
|
294 | 8091 |
v3s(c_v); |
1932 | 8092 |
#endif |
294 | 8093 |
RETURN (true); |
8094 |
%} |
|
8095 |
! |
|
8096 |
||
8097 |
glxV4d:v in:aGLXWindowId |
|
8098 |
"pass a vertex; v must be a 4-element double-vector, |
|
8099 |
containing x, y, z and w" |
|
8100 |
||
8101 |
%{ /* NOCONTEXT */ |
|
8102 |
double vec[4], *c_v; |
|
8103 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8104 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 4))) RETURN(false); |
294 | 8105 |
SETWIN(aGLXWindowId) |
1932 | 8106 |
#ifdef OPENGL |
8107 |
#else |
|
294 | 8108 |
v4d(c_v); |
1932 | 8109 |
#endif |
294 | 8110 |
RETURN (true); |
8111 |
%} |
|
8112 |
! |
|
8113 |
||
8114 |
glxV4f:v in:aGLXWindowId |
|
8115 |
"pass a vertex; v must be a 4-element float-vector, |
|
8116 |
containing x, y, z and w" |
|
8117 |
||
8118 |
%{ /* NOCONTEXT */ |
|
8119 |
float vec[4], *c_v; |
|
8120 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8121 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
294 | 8122 |
SETWIN(aGLXWindowId) |
1932 | 8123 |
#ifdef OPENGL |
8124 |
#else |
|
294 | 8125 |
v4f(c_v); |
1932 | 8126 |
#endif |
294 | 8127 |
RETURN (true); |
8128 |
%} |
|
8129 |
! |
|
8130 |
||
8131 |
glxV4i:v in:aGLXWindowId |
|
8132 |
"pass a vertex; v must be a 4-element int-vector, |
|
8133 |
containing x, y, z and w" |
|
8134 |
||
8135 |
%{ /* NOCONTEXT */ |
|
8136 |
long vec[4], *c_v; |
|
8137 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8138 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
294 | 8139 |
SETWIN(aGLXWindowId) |
1932 | 8140 |
#ifdef OPENGL |
8141 |
#else |
|
294 | 8142 |
v4i(c_v); |
1932 | 8143 |
#endif |
294 | 8144 |
RETURN (true); |
8145 |
%} |
|
8146 |
! |
|
8147 |
||
8148 |
glxV4s:v in:aGLXWindowId |
|
8149 |
"pass a vertex; v must be a 4-element short-vector, |
|
8150 |
containing x, y, z and w" |
|
8151 |
||
8152 |
%{ /* NOCONTEXT */ |
|
8153 |
short vec[4], *c_v; |
|
8154 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8155 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
294 | 8156 |
SETWIN(aGLXWindowId) |
1932 | 8157 |
#ifdef OPENGL |
8158 |
#else |
|
294 | 8159 |
v4s(c_v); |
1932 | 8160 |
#endif |
294 | 8161 |
RETURN (true); |
8162 |
%} |
|
8163 |
! |
|
8164 |
||
8165 |
glxVOriginIn:aGLXWindowId |
|
8166 |
"pass a 0.0/0.0/0.0 vector. |
|
8167 |
This is the same as v3f:#(0.0 0.0 0.0), but, since its so |
|
8168 |
common, this somewhat faster method has been provided" |
|
8169 |
||
8170 |
%{ /* NOCONTEXT */ |
|
8171 |
static float vec[3] = {0.0, 0.0, 0.0}; |
|
8172 |
||
8173 |
SETWIN(aGLXWindowId) |
|
1932 | 8174 |
#ifdef OPENGL |
8175 |
#else |
|
294 | 8176 |
v3f(vec); |
1932 | 8177 |
#endif |
294 | 8178 |
RETURN (true); |
8179 |
%} |
|
8180 |
! |
|
8181 |
||
8182 |
glxVUnitXIn:aGLXWindowId |
|
8183 |
"pass a 1.0/0.0/0.0 vector. |
|
8184 |
This is the same as v3f:#(1.0 0.0 0.0), but, since its so |
|
8185 |
common, this somewhat faster method has been provided" |
|
8186 |
||
8187 |
%{ /* NOCONTEXT */ |
|
8188 |
static float vec[3] = {1.0, 0.0, 0.0}; |
|
8189 |
||
8190 |
SETWIN(aGLXWindowId) |
|
1932 | 8191 |
#ifdef OPENGL |
8192 |
#else |
|
294 | 8193 |
v3f(vec); |
1932 | 8194 |
#endif |
294 | 8195 |
RETURN (true); |
8196 |
%} |
|
8197 |
! |
|
8198 |
||
8199 |
glxVUnitYIn:aGLXWindowId |
|
8200 |
"pass a 0.0/1.0/0.0 vector. |
|
8201 |
This is the same as v3f:#(0.0 1.0 0.0), but, since its so |
|
8202 |
common, this somewhat faster method has been provided" |
|
8203 |
||
8204 |
%{ /* NOCONTEXT */ |
|
8205 |
static float vec[3] = {0.0, 1.0, 0.0}; |
|
8206 |
||
8207 |
SETWIN(aGLXWindowId) |
|
1932 | 8208 |
#ifdef OPENGL |
8209 |
#else |
|
294 | 8210 |
v3f(vec); |
1932 | 8211 |
#endif |
294 | 8212 |
RETURN (true); |
8213 |
%} |
|
8214 |
! |
|
8215 |
||
8216 |
glxVUnitZIn:aGLXWindowId |
|
8217 |
"pass a 0.0/0.0/1.0 vector. |
|
8218 |
This is the same as v3f:#(0.0 0.0 1.0), but, since its so |
|
8219 |
common, this somewhat faster method has been provided" |
|
8220 |
||
8221 |
%{ /* NOCONTEXT */ |
|
8222 |
static float vec[3] = {0.0, 0.0, 1.0}; |
|
8223 |
||
8224 |
SETWIN(aGLXWindowId) |
|
1932 | 8225 |
#ifdef OPENGL |
8226 |
#else |
|
294 | 8227 |
v3f(vec); |
1932 | 8228 |
#endif |
294 | 8229 |
RETURN (true); |
8230 |
%} |
|
8231 |
! ! |
|
8232 |
||
8233 |
!GLXWorkstation methodsFor:'video and planes'! |
|
8234 |
||
8235 |
glxOverlayPlanes: planes in: aGLXWindowId |
|
8236 |
||
8237 |
%{ /* NOCONTEXT */ |
|
8238 |
#ifdef GLX |
|
8239 |
SETWIN(aGLXWindowId) |
|
8240 |
overlay(_longVal(planes)); |
|
8241 |
RETURN (true); |
|
8242 |
#endif |
|
8243 |
%} |
|
8244 |
. |
|
8245 |
^ false |
|
8246 |
! |
|
8247 |
||
8248 |
glxStereobufferIn: aGLXWindowId |
|
8249 |
||
8250 |
%{ /* NOCONTEXT */ |
|
8251 |
#ifdef FULL_GLX |
|
8252 |
SETWIN(aGLXWindowId) |
|
8253 |
stereobuffer(); |
|
8254 |
RETURN (true); |
|
8255 |
#endif |
|
8256 |
%} |
|
8257 |
. |
|
8258 |
^ false |
|
8259 |
! |
|
8260 |
||
8261 |
glxUnderlay: planes in: aGLXWindowId |
|
8262 |
||
8263 |
%{ /* NOCONTEXT */ |
|
8264 |
#ifdef GLX |
|
8265 |
SETWIN(aGLXWindowId) |
|
8266 |
underlay(_longVal(planes)); |
|
8267 |
RETURN (true); |
|
8268 |
#endif |
|
8269 |
%} |
|
8270 |
. |
|
8271 |
^ false |
|
8272 |
! |
|
8273 |
||
8274 |
glxVideocmd:cmd in:aGLXWindowId |
|
8275 |
||
8276 |
%{ /* NOCONTEXT */ |
|
8277 |
#ifdef GLX |
|
8278 |
SETWIN(aGLXWindowId) |
|
8279 |
videocmd(_longVal(cmd)); |
|
8280 |
RETURN (true); |
|
8281 |
#endif |
|
8282 |
%} |
|
8283 |
. |
|
8284 |
^ false |
|
8285 |
! ! |
|
8286 |
||
8287 |
!GLXWorkstation methodsFor:'viewing'! |
|
8288 |
||
8289 |
glxLookatVx:vx vy:vy vz:vz px:px py:py pz:pz twist:twist in:aGLXWindowId |
|
8290 |
"define viewing transformation" |
|
8291 |
||
8292 |
%{ /* NOCONTEXT */ |
|
8293 |
||
8294 |
Coord f_vx, f_vy, f_vz, f_px, f_py, f_pz; |
|
8295 |
Angle a_twist; |
|
8296 |
||
8297 |
_COORD_ (vx, f_vx) |
|
8298 |
_COORD_ (vy, f_vy) |
|
8299 |
_COORD_ (vz, f_vz) |
|
8300 |
_COORD_ (px, f_px) |
|
8301 |
_COORD_ (py, f_py) |
|
8302 |
_COORD_ (pz, f_pz) |
|
8303 |
_ANGLE_ (twist, a_twist) |
|
8304 |
SETWIN(aGLXWindowId) |
|
1932 | 8305 |
#ifdef OPENGL |
8306 |
#else |
|
294 | 8307 |
lookat(f_vx, f_vy, f_vz, f_px, f_py, f_pz, a_twist); |
1932 | 8308 |
#endif |
294 | 8309 |
%} |
8310 |
! |
|
8311 |
||
8312 |
glxOrtho2Left: left right: right bottom: bottom top: top in: aGLXWindowId |
|
8313 |
"define 2D orthogonal projection" |
|
8314 |
||
8315 |
%{ /* NOCONTEXT */ |
|
8316 |
float f_left, f_right, f_top, f_bottom; |
|
8317 |
||
8318 |
SETWIN(aGLXWindowId) |
|
8319 |
_FLOAT_(left, f_left) |
|
8320 |
_FLOAT_(right, f_right) |
|
8321 |
_FLOAT_(bottom, f_bottom) |
|
8322 |
_FLOAT_(top, f_top) |
|
1932 | 8323 |
#ifdef OPENGL |
8324 |
#else |
|
294 | 8325 |
ortho2(f_left, f_right, f_bottom, f_top); |
1932 | 8326 |
#endif |
8327 |
%} |
|
294 | 8328 |
! |
8329 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8330 |
glxOrthoLeft: left right: right bottom: bottom top: top near: znear far: zfar in: aGLXWindowId |
294 | 8331 |
"define orthogonal projection" |
8332 |
||
8333 |
%{ /* NOCONTEXT */ |
|
8334 |
float f_left, f_right, f_bottom, f_top, |
|
8335 |
f_near, f_far; |
|
8336 |
||
8337 |
_FLOAT_(left, f_left) |
|
8338 |
_FLOAT_(right, f_right) |
|
8339 |
_FLOAT_(bottom, f_bottom) |
|
8340 |
_FLOAT_(top, f_top) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8341 |
_FLOAT_(znear, f_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8342 |
_FLOAT_(zfar, f_far) |
294 | 8343 |
SETWIN(aGLXWindowId) |
1932 | 8344 |
#ifdef OPENGL |
8345 |
#else |
|
294 | 8346 |
ortho(f_left, f_right, f_bottom, f_top, f_near, f_far); |
1932 | 8347 |
#endif |
294 | 8348 |
%} |
8349 |
! |
|
8350 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8351 |
glxPerspectiveFovy:fovy aspect:aspect near:znear far:zfar in:aGLXWindowId |
294 | 8352 |
"define perspective projection" |
8353 |
||
8354 |
%{ /* NOCONTEXT */ |
|
8355 |
||
8356 |
Angle a_fovy; |
|
8357 |
Coord c_near, c_far; |
|
8358 |
float f_aspect; |
|
8359 |
||
8360 |
_ANGLE_ (fovy, a_fovy) |
|
8361 |
_FLOAT_ (aspect, f_aspect) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8362 |
_COORD_ (znear, c_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8363 |
_COORD_ (zfar, c_far) |
294 | 8364 |
|
8365 |
SETWIN(aGLXWindowId) |
|
1932 | 8366 |
#ifdef OPENGL |
8367 |
#else |
|
294 | 8368 |
perspective(a_fovy, f_aspect, c_near, c_far); |
1932 | 8369 |
#endif |
294 | 8370 |
%} |
8371 |
! |
|
8372 |
||
8373 |
glxPolarviewDist: dist azim: azim inc: inc twist: twist in: aGLXWindowId |
|
8374 |
||
8375 |
%{ /* NOCONTEXT */ |
|
8376 |
Coord c_dist; |
|
8377 |
Angle a_azim, a_inc, a_twist; |
|
8378 |
||
8379 |
_COORD_(dist, c_dist) |
|
8380 |
_ANGLE_(azim, a_azim) |
|
8381 |
_ANGLE_(inc, a_inc) |
|
8382 |
_ANGLE_(twist, a_twist) |
|
8383 |
SETWIN(aGLXWindowId) |
|
1932 | 8384 |
#ifdef OPENGL |
8385 |
#else |
|
294 | 8386 |
polarview(c_dist, a_azim, a_inc, a_twist); |
1932 | 8387 |
#endif |
294 | 8388 |
%} |
8389 |
! |
|
8390 |
||
528 | 8391 |
glxPopviewportIn: aGLXWindowId |
8392 |
"pops the top viewport off the viewport stack" |
|
8393 |
||
8394 |
%{ /* NOCONTEXT */ |
|
8395 |
SETWIN(aGLXWindowId) |
|
1932 | 8396 |
#ifdef OPENGL |
8397 |
#else |
|
528 | 8398 |
popviewport(); |
1932 | 8399 |
#endif |
528 | 8400 |
%} |
8401 |
||
8402 |
"Modified: 19.3.1996 / 18:58:24 / cg" |
|
8403 |
! |
|
8404 |
||
8405 |
glxPushviewportIn: aGLXWindowId |
|
8406 |
"pushes the current viewport on the viewport stack" |
|
8407 |
||
8408 |
%{ /* NOCONTEXT */ |
|
8409 |
SETWIN(aGLXWindowId) |
|
1932 | 8410 |
#ifdef OPENGL |
8411 |
#else |
|
528 | 8412 |
pushviewport(); |
1932 | 8413 |
#endif |
528 | 8414 |
%} |
8415 |
||
8416 |
"Modified: 19.3.1996 / 18:58:02 / cg" |
|
8417 |
! |
|
8418 |
||
294 | 8419 |
glxReshapeViewPortIn: aGLXWindowId |
8420 |
||
8421 |
%{ /* NOCONTEXT */ |
|
8422 |
SETWIN(aGLXWindowId) |
|
1932 | 8423 |
#ifdef OPENGL |
8424 |
#else |
|
294 | 8425 |
reshapeviewport(); |
1932 | 8426 |
#endif |
8427 |
%} |
|
294 | 8428 |
! |
8429 |
||
8430 |
glxViewportLeft:left right:right bottom:bottom top:top in:aGLXWindowId |
|
8431 |
||
8432 |
%{ /* NOCONTEXT */ |
|
8433 |
SETWIN(aGLXWindowId) |
|
1932 | 8434 |
#ifdef OPENGL |
8435 |
#else |
|
294 | 8436 |
viewport(_screencoordVal(left), _screencoordVal(right), |
8437 |
_screencoordVal(bottom), _screencoordVal(top)); |
|
1932 | 8438 |
#endif |
294 | 8439 |
%} |
8440 |
! |
|
8441 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8442 |
glxWindowLeft: left right: right bottom: bottom top: top near: znear far: zfar in: aGLXWindowId |
294 | 8443 |
"this one was added independently by JEFF - kept for his programs ..." |
8444 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8445 |
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
|
8446 |
! |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8447 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8448 |
glxWindowLeft:left right:right top:top bottom:bottom near:znear far:zfar in:aGLXWindowId |
294 | 8449 |
"define perspective viewing pyramid" |
8450 |
||
8451 |
%{ /* NOCONTEXT */ |
|
8452 |
Coord c_left, c_right, c_top, c_bot, c_near, c_far; |
|
8453 |
||
8454 |
_COORD_ (left, c_left) |
|
8455 |
_COORD_ (right, c_right) |
|
8456 |
_COORD_ (top, c_top) |
|
8457 |
_COORD_ (bottom, c_bot) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8458 |
_COORD_ (znear, c_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8459 |
_COORD_ (zfar, c_far) |
294 | 8460 |
SETWIN(aGLXWindowId) |
1932 | 8461 |
#ifdef OPENGL |
8462 |
#else |
|
294 | 8463 |
window(c_left, c_right, c_bot, c_top, c_near, c_far); |
1932 | 8464 |
#endif |
294 | 8465 |
%} |
8466 |
! ! |
|
8467 |
||
8468 |
!GLXWorkstation methodsFor:'window control'! |
|
8469 |
||
2045 | 8470 |
glxResizedView:aGLXWindowId width:width height:height |
2048 | 8471 |
"pass down resize info to the GL - this adjusts the viewport. |
8472 |
This only works with VGL or openGL" |
|
8473 |
||
8474 |
%{ /* NOCONTEXT */ |
|
2074 | 8475 |
SETWIN(aGLXWindowId) |
8476 |
#ifdef VGL |
|
2045 | 8477 |
X11_resized(__intVal(width), __intVal(height)); |
8478 |
RETURN (true); |
|
8479 |
#endif |
|
8480 |
%} |
|
8481 |
. |
|
8482 |
^ false |
|
8483 |
! |
|
8484 |
||
294 | 8485 |
glxWinclose:gwid in:aGLXWindowId |
8486 |
||
8487 |
%{ /* NOCONTEXT */ |
|
8488 |
#ifdef GLX |
|
8489 |
SETWIN(aGLXWindowId) |
|
8490 |
winclose(_longVal(gwid)); |
|
8491 |
RETURN (true); |
|
8492 |
#endif |
|
8493 |
%} |
|
8494 |
. |
|
8495 |
^ false |
|
8496 |
! |
|
8497 |
||
8498 |
glxWinconstraintsIn: aGLXWindowId |
|
8499 |
||
8500 |
%{ /* NOCONTEXT */ |
|
8501 |
#ifdef GLX |
|
8502 |
SETWIN(aGLXWindowId) |
|
8503 |
winconstraints(); |
|
8504 |
RETURN (true); |
|
8505 |
#endif |
|
8506 |
%} |
|
8507 |
. |
|
8508 |
^ false |
|
8509 |
! |
|
8510 |
||
8511 |
glxWindepth: gwid in: aGLXWindowId |
|
8512 |
||
8513 |
%{ /* NOCONTEXT */ |
|
8514 |
#ifdef GLX |
|
8515 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
8516 |
RETURN (__MKSMALLINT(windepth(_longVal(gwid)))); |
294 | 8517 |
#endif |
8518 |
%} |
|
8519 |
. |
|
8520 |
^ false |
|
8521 |
! |
|
8522 |
||
8523 |
glxWingetIn: aGLXWindowId |
|
8524 |
||
8525 |
%{ /* NOCONTEXT */ |
|
8526 |
#ifdef GLX |
|
8527 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
8528 |
RETURN (__MKSMALLINT(winget())); |
294 | 8529 |
#endif |
8530 |
%} |
|
8531 |
. |
|
8532 |
^ false |
|
8533 |
! |
|
8534 |
||
8535 |
glxWinmoveX: x y: y in: aGLXWindowId |
|
8536 |
||
8537 |
%{ /* NOCONTEXT */ |
|
8538 |
#ifdef GLX |
|
8539 |
SETWIN(aGLXWindowId) |
|
8540 |
winmove(_longVal(x), _longVal(y)); |
|
8541 |
RETURN (true); |
|
8542 |
#endif |
|
8543 |
%} |
|
8544 |
. |
|
8545 |
^ false |
|
8546 |
! |
|
8547 |
||
8548 |
glxWinpopIn: aGLXWindowId |
|
8549 |
||
8550 |
%{ /* NOCONTEXT */ |
|
8551 |
#ifdef GLX |
|
8552 |
SETWIN(aGLXWindowId) |
|
8553 |
winpop(); |
|
8554 |
RETURN (true); |
|
8555 |
#endif |
|
8556 |
%} |
|
8557 |
. |
|
8558 |
^ false |
|
8559 |
! |
|
8560 |
||
8561 |
glxWinpositionX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
8562 |
||
8563 |
%{ /* NOCONTEXT */ |
|
8564 |
#ifdef GLX |
|
8565 |
SETWIN(aGLXWindowId) |
|
8566 |
winposition(_longVal(x1), _longVal(y1), _longVal(x2), _longVal(y2)); |
|
8567 |
RETURN (true); |
|
8568 |
#endif |
|
8569 |
%} |
|
8570 |
. |
|
8571 |
^ false |
|
8572 |
! |
|
8573 |
||
8574 |
glxWinpushIn: aGLXWindowId |
|
8575 |
||
8576 |
%{ /* NOCONTEXT */ |
|
8577 |
#ifdef GLX |
|
8578 |
SETWIN(aGLXWindowId) |
|
8579 |
winpush(); |
|
8580 |
RETURN (true); |
|
8581 |
#endif |
|
8582 |
%} |
|
8583 |
. |
|
8584 |
^ false |
|
8585 |
! |
|
8586 |
||
8587 |
glxWinset: gwid in: aGLXWindowId |
|
8588 |
||
8589 |
%{ /* NOCONTEXT */ |
|
8590 |
#ifdef GLX |
|
8591 |
SETWIN(aGLXWindowId) |
|
8592 |
winset(_longVal(gwid)); |
|
8593 |
RETURN (true); |
|
8594 |
#endif |
|
8595 |
%} |
|
8596 |
. |
|
8597 |
^ false |
|
8598 |
! ! |
|
8599 |
||
0 | 8600 |
!GLXWorkstation methodsFor:'window creation'! |
8601 |
||
12 | 8602 |
createGLXWindowFor:aView left:xpos top:ypos width:wwidth height:wheight type:glxType |
157 | 8603 |
|ext wsuperView wsuperViewId windowId| |
0 | 8604 |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
8605 |
glOK ifFalse:[^ nil]. |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
8606 |
|
793 | 8607 |
wsuperView := aView superView view. |
0 | 8608 |
wsuperView notNil ifTrue:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8609 |
wsuperViewId := wsuperView id |
0 | 8610 |
]. |
8611 |
||
524 | 8612 |
%{ /* CALLSSTACK: 20000 */ |
0 | 8613 |
Display *dpy = myDpy; |
185 | 8614 |
int screen = __intVal(_INST(screen)); |
0 | 8615 |
Window newWindow, parentWindow; |
12 | 8616 |
int t; |
0 | 8617 |
|
97 | 8618 |
if (__isSmallInteger(xpos) && __isSmallInteger(ypos) |
8619 |
&& __isSmallInteger(wwidth) && __isSmallInteger(wheight)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8620 |
if (__isExternalAddress(wsuperViewId)) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8621 |
parentWindow = _WindowVal(wsuperViewId); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8622 |
} else { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8623 |
parentWindow = RootWindow(dpy, screen); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8624 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8625 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8626 |
if (glxType == @symbol(colorIndexSingleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8627 |
t = GLXcolorIndexSingleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8628 |
else if (glxType == @symbol(colorIndexDoubleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8629 |
t = GLXcolorIndexDoubleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8630 |
else if (glxType == @symbol(rgbSingleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8631 |
t = GLXrgbSingleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8632 |
else if (glxType == @symbol(rgbDoubleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8633 |
t = GLXrgbDoubleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8634 |
else { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8635 |
RETURN ( nil ); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8636 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8637 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8638 |
ENTERGLX; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8639 |
newWindow = __GLXCreateWindow(dpy, parentWindow, |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8640 |
__intVal(xpos), __intVal(ypos), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8641 |
__intVal(wwidth), __intVal(wheight), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8642 |
0, t); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8643 |
LEAVEGLX; |
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 |
if (! newWindow) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8646 |
RETURN ( nil ); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8647 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8648 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8649 |
windowId = __MKOBJ(newWindow); |
0 | 8650 |
} |
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
8651 |
%}. |
0 | 8652 |
windowId notNil ifTrue:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8653 |
self addKnownView:aView withId:windowId. |
0 | 8654 |
]. |
8655 |
^ windowId |
|
20 | 8656 |
! |
8657 |
||
8658 |
unlinkGLXView:aGLXWindowId |
|
8659 |
"remove X/GLX link" |
|
524 | 8660 |
|
8661 |
%{ /* CALLSSTACK: 20000 */ |
|
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
8662 |
if (__isExternalAddress(aGLXWindowId)) { |
134 | 8663 |
ENTERGLX; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8664 |
__GLXUnlinkWindow(myDpy, _WindowVal(aGLXWindowId)); |
134 | 8665 |
LEAVEGLX; |
8666 |
} |
|
20 | 8667 |
%} |
0 | 8668 |
! ! |
8669 |
||
294 | 8670 |
!GLXWorkstation methodsFor:'zbuffer'! |
8671 |
||
8672 |
glxZbsize: planes in: aGLXWindowId |
|
127 | 8673 |
|
8674 |
%{ /* NOCONTEXT */ |
|
8675 |
#ifdef FULL_GLX |
|
8676 |
SETWIN(aGLXWindowId) |
|
294 | 8677 |
zbsize(_longVal(planes)); |
8678 |
RETURN (true); |
|
8679 |
#endif |
|
8680 |
%} |
|
8681 |
. |
|
8682 |
^ false |
|
8683 |
! |
|
64 | 8684 |
|
8685 |
glxZbuffer:aBoolean in:aGLXWindowId |
|
8686 |
"enable/disable z-buffer operation" |
|
8687 |
||
8688 |
%{ /* NOCONTEXT */ |
|
8689 |
#ifdef GLX |
|
8690 |
SETWIN(aGLXWindowId) |
|
8691 |
zbuffer(aBoolean == false ? FALSE : TRUE); |
|
8692 |
RETURN (true); |
|
8693 |
#endif |
|
8694 |
%} |
|
8695 |
. |
|
8696 |
^ false |
|
294 | 8697 |
! |
64 | 8698 |
|
8699 |
glxZdraw: b in: aGLXWindowId |
|
8700 |
"enable/disable drawing into the z-buffer" |
|
8701 |
||
8702 |
%{ /* NOCONTEXT */ |
|
8703 |
#ifdef GLX |
|
8704 |
SETWIN(aGLXWindowId) |
|
8705 |
zdraw(_booleanVal(b)); |
|
8706 |
RETURN (true); |
|
8707 |
#endif |
|
8708 |
%} |
|
8709 |
. |
|
8710 |
^ false |
|
294 | 8711 |
! |
64 | 8712 |
|
8713 |
glxZfunction: func in: aGLXWindowId |
|
8714 |
"set the z-buffer comparison function. |
|
8715 |
func may be either the numeric value or a symbol (preferred)" |
|
8716 |
||
8717 |
%{ /* NOCONTEXT */ |
|
8718 |
#ifdef GLX |
|
8719 |
long f; |
|
8720 |
||
8721 |
SETWIN(aGLXWindowId) |
|
8722 |
if (func == @symbol(NEVER)) |
|
77 | 8723 |
f = ZF_NEVER; |
64 | 8724 |
else if (func == @symbol(LESS)) |
77 | 8725 |
f = ZF_LESS; |
64 | 8726 |
else if (func == @symbol(EQUAL)) |
77 | 8727 |
f = ZF_EQUAL; |
64 | 8728 |
else if (func == @symbol(LEQUAL)) |
77 | 8729 |
f = ZF_LEQUAL; |
64 | 8730 |
else if (func == @symbol(GREATER)) |
77 | 8731 |
f = ZF_GREATER; |
64 | 8732 |
else if (func == @symbol(NOTEQUAL)) |
77 | 8733 |
f = ZF_NOTEQUAL; |
64 | 8734 |
else if (func == @symbol(GEQUAL)) |
77 | 8735 |
f = ZF_GEQUAL; |
64 | 8736 |
else if (func == @symbol(ALWAYS)) |
77 | 8737 |
f = ZF_ALWAYS; |
64 | 8738 |
else |
77 | 8739 |
f = _longVal(func); |
64 | 8740 |
zfunction(f); |
8741 |
RETURN (true); |
|
8742 |
#endif |
|
8743 |
%} |
|
8744 |
. |
|
8745 |
^ false |
|
294 | 8746 |
! |
64 | 8747 |
|
8748 |
glxZsource: src in: aGLXWindowId |
|
8749 |
||
8750 |
%{ /* NOCONTEXT */ |
|
8751 |
#ifdef GLX |
|
8752 |
SETWIN(aGLXWindowId) |
|
8753 |
zsource(_longVal(src)); |
|
8754 |
RETURN (true); |
|
8755 |
#endif |
|
8756 |
%} |
|
8757 |
. |
|
8758 |
^ false |
|
294 | 8759 |
! |
64 | 8760 |
|
8761 |
glxZwritemask: mask in: aGLXWindowId |
|
8762 |
||
8763 |
%{ /* NOCONTEXT */ |
|
8764 |
#ifdef GLX |
|
8765 |
SETWIN(aGLXWindowId) |
|
185 | 8766 |
zwritemask((ulong)__intVal(mask)); |
64 | 8767 |
RETURN (true); |
8768 |
#endif |
|
8769 |
%} |
|
8770 |
. |
|
8771 |
^ false |
|
8772 |
! ! |
|
8773 |
||
294 | 8774 |
!GLXWorkstation class methodsFor:'documentation'! |
8775 |
||
8776 |
version |
|
4169
35c1ee146ffb
Distinguish no-resource when handling display errors.
Stefan Vogel <sv@exept.de>
parents:
4164
diff
changeset
|
8777 |
^ '$Header: /cvs/stx/stx/libview/GLXWorkstation.st,v 1.81 2004-05-11 08:00:54 stefan Exp $' |
89 | 8778 |
! ! |