author | Claus Gittinger <cg@exept.de> |
Fri, 30 Jul 1999 20:12:20 +0200 | |
changeset 2814 | bf957c990130 |
parent 2768 | 57079243282f |
child 3214 | 359316f51b9f |
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 |
||
13 |
XWorkstation subclass:#GLXWorkstation |
|
528 | 14 |
instanceVariableNames:'activeWindow hasStereoExtension glOK' |
15 |
classVariableNames:'ForceGL' |
|
16 |
poolDictionaries:'' |
|
17 |
category:'Interface-Graphics' |
|
294 | 18 |
! |
77 | 19 |
|
89 | 20 |
!GLXWorkstation primitiveDefinitions! |
0 | 21 |
%{ |
24 | 22 |
/* |
23 |
* on SGI, this class is compiled with -DGLX, while |
|
29 | 24 |
* 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
|
25 |
* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
26 |
* New note: starting to support openGL (tm) (compile with -DOPENGL) |
1932 | 27 |
* or its simulation (compile with -DMESA) |
24 | 28 |
*/ |
29 | 29 |
|
0 | 30 |
/* |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
31 |
* SAD, SAD: |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
32 |
* 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
|
33 |
* some include the functions below, others dont. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
34 |
* To avoid getting undefined symbol errors when linking, these |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
35 |
* functions are not included by default. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
36 |
* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
37 |
* 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
|
38 |
* the following: |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
39 |
* |
46 | 40 |
* blendcolor getgconfig getmultisample leftbuffer rightbuffer monobuffer |
41 |
* msalpha msmask mspattern mssize multisample stereobuffer |
|
42 |
* t3s t3i t3f t3d t4s t4i t4f t4d tlutbind zbsize |
|
43 |
* |
|
44 |
* these are not available on all gl's |
|
45 |
*/ |
|
46 |
||
1932 | 47 |
#ifdef GLX |
46 | 48 |
/* #define FULL_GLX */ |
1932 | 49 |
#endif |
46 | 50 |
|
51 |
/* |
|
554
34cc776bcc0f
compilable with String/Object definition
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
52 |
* 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
|
53 |
* ... and xlib defines True and False |
554
34cc776bcc0f
compilable with String/Object definition
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
54 |
* It might be a better idea, to completely separate GLX stuff from ST/X |
0 | 55 |
*/ |
1899 | 56 |
#ifdef String |
57 |
# undef String |
|
58 |
#endif |
|
59 |
#define String GLX_String |
|
60 |
||
61 |
#ifdef Object |
|
62 |
# undef Object |
|
63 |
#endif |
|
64 |
#define Object GLX_Object |
|
65 |
||
66 |
#undef True |
|
67 |
#undef False |
|
68 |
||
2768 | 69 |
#ifdef Time |
70 |
# undef Time |
|
71 |
#endif |
|
72 |
#define Time X_Time |
|
73 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
74 |
|
1899 | 75 |
#ifdef __VMS__ |
76 |
# include "vms_Xnames.h" |
|
77 |
#endif |
|
24 | 78 |
|
168 | 79 |
#include <stdio.h> |
80 |
||
1932 | 81 |
#ifndef OPENGL |
82 |
# ifdef MESA |
|
83 |
# define OPENGL |
|
84 |
# endif |
|
85 |
#endif |
|
86 |
||
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
87 |
#ifdef OPENGL /* SGI or others OPENGL library */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
88 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
89 |
# include "GL/gl.h" |
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 |
# ifdef MESA /* GNU MESA openGL simulation */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
92 |
# include "GL/xmesa.h" |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
93 |
# define OPENGLCONTEXT XMesaContext |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
94 |
# define GLXMAKECURRENT(dpy, draw, con) XMesaMakeCurrent(con) |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
95 |
# else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
96 |
/* 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
|
97 |
# define OPENGLCONTEXT GLXContext |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
98 |
# 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
|
99 |
# endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
100 |
|
24 | 101 |
#else |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
102 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
103 |
# ifdef GLX /* SGI's GL library */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
104 |
# include <gl/glws.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
105 |
# include <gl/sphere.h> |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
106 |
# else /* VOGL GL simulation */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
107 |
# undef memset |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
108 |
# include <vogl.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
109 |
# undef move |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
110 |
# include <X11/Xlib.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
111 |
# endif |
24 | 112 |
#endif |
0 | 113 |
|
185 | 114 |
/* |
115 |
* XSGIStereo extension - if available |
|
116 |
*/ |
|
117 |
#ifdef XSGIStereo |
|
118 |
# include <X11/extensions/SGIStereo.h> |
|
119 |
#endif |
|
120 |
||
35 | 121 |
#ifndef NULL |
58 | 122 |
# define NULL (char *)0 /* sigh */ |
35 | 123 |
#endif |
124 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
125 |
|
0 | 126 |
typedef enum { |
127 |
GLXcolorIndexSingleBuffer, |
|
128 |
GLXcolorIndexDoubleBuffer, |
|
129 |
GLXrgbSingleBuffer, |
|
130 |
GLXrgbDoubleBuffer |
|
131 |
} GLXWindowType; |
|
132 |
||
333 | 133 |
# define ENTERGLX __BEGIN_PROTECT_REGISTERS__ |
134 |
# define LEAVEGLX __END_PROTECT_REGISTERS__ |
|
134 | 135 |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
136 |
/* |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
137 |
* 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
|
138 |
*/ |
0 | 139 |
#undef String |
969 | 140 |
#ifdef __DEF_String |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
141 |
# define String __DEF_String |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
142 |
#endif |
969 | 143 |
#undef Object |
144 |
#ifdef __DEF_Object |
|
145 |
# define Object __DEF_Object |
|
146 |
#endif |
|
0 | 147 |
|
148 |
/* |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
149 |
* mhmh - openGL has its separate gl-context, |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
150 |
* which is distinct (?) from the windowID. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
151 |
* We dont want to add another instvar to View - do we ? |
0 | 152 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
153 |
#if defined(OPENGL) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
154 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
155 |
# ifndef MAX_OPENGL_VIEWS |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
156 |
# define MAX_OPENGL_VIEWS 50 |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
157 |
# endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
158 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
159 |
struct windowIDToGLContextMapping { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
160 |
Window win; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
161 |
OPENGLCONTEXT con; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
162 |
}; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
163 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
164 |
static struct windowIDToGLContextMapping windowIDToGLContextMapping[MAX_OPENGL_VIEWS]; |
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 OPENGLCONTEXT |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
167 |
__glxWindowIdToGLContext(xId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
168 |
Window xId; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
169 |
{ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
170 |
int i; |
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 |
for (i=0; i<MAX_OPENGL_VIEWS; i++) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
173 |
if (windowIDToGLContextMapping[i].win == xId) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
174 |
return windowIDToGLContextMapping[i].con; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
175 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
176 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
177 |
return (OPENGLCONTEXT) 0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
178 |
} |
0 | 179 |
|
157 | 180 |
/* |
181 |
* set the GLXWindow for followup drawing |
|
182 |
*/ |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
183 |
#define SETWIN(aGLXWindowId) \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
184 |
{ \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
185 |
OPENGLCONTEXT context; \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
186 |
\ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
187 |
if (_INST(activeWindow) != aGLXWindowId) { \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
188 |
if (! ISCONNECTED ) { \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
189 |
RETURN (false); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
190 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
191 |
if (! __isExternalAddress(aGLXWindowId)) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
192 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
193 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
194 |
context = (OPENGLCONTEXT) __glxWindowIdToGLContext(_WindowVal(aGLXWindowId)); \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
195 |
if (! context) { \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
196 |
RETURN (false); \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
197 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
198 |
GLXMAKECURRENT(myDpy, _WindowVal(aGLXWindowId), context ); \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
199 |
_INST(activeWindow) = aGLXWindowId; \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
200 |
__STORE(self, aGLXWindowId); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
201 |
} else { \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
202 |
if (aGLXWindowId == nil) { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
203 |
RETURN (false); \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
204 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
205 |
} \ |
12 | 206 |
} |
207 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
208 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
209 |
#else /* old GL */ |
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 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
212 |
* set the GLXWindow for followup drawing |
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 |
#define SETWIN(aGLXWindowId) \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
215 |
{ \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
216 |
if (_INST(activeWindow) != aGLXWindowId) { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
217 |
if (! ISCONNECTED ) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
218 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
219 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
220 |
if (! __isExternalAddress(aGLXWindowId)) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
221 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
222 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
223 |
if (GLXwinset(myDpy, _WindowVal(aGLXWindowId)) < 0) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
224 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
225 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
226 |
_INST(activeWindow) = aGLXWindowId; \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
227 |
__STORE(self, aGLXWindowId); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
228 |
} else { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
229 |
if (aGLXWindowId == nil) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
230 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
231 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
232 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
233 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
234 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
235 |
#endif /* old GL */ |
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 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
238 |
* some defines - tired of typing ... |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
239 |
* 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
|
240 |
* put/pack them into corresponding c variables. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
241 |
* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
242 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
243 |
#ifdef OPENGL |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
244 |
# define Boolean int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
245 |
# define TRUE 1 |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
246 |
# define FALSE 0 |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
247 |
# define Coord float |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
248 |
# define Icoord int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
249 |
# define Scoord int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
250 |
# define Colorindex int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
251 |
# define Linestyle int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
252 |
# define Offset int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
253 |
# define Angle int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
254 |
# define Screencoord int |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
255 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
256 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
257 |
#define myDpy (Display *)(__MKCP(_INST(displayId))) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
258 |
#define ISCONNECTED (_INST(displayId) != nil) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
259 |
#define _WindowVal(o) (Window)(__MKCP(o)) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
260 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
261 |
#define __MKBOOLEAN(b) ((b==FALSE) ? false : true) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
262 |
#define _booleanVal(b) ((b==false) ? (Boolean)FALSE : (Boolean)TRUE) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
263 |
#define _coordVal(c) ((__isFloat(c)) ? (Coord)(_floatVal(c)) : (Coord)(__intVal(c))) |
185 | 264 |
#define _icoordVal(c) ((Icoord)(__intVal(c))) |
265 |
#define _scoordVal(c) ((Scoord)(__intVal(c))) |
|
266 |
#define _screencoordVal(c) ((Screencoord)(__intVal(c))) |
|
267 |
#define _colorindexVal(c) ((Colorindex)(__intVal(c))) |
|
268 |
#define _linestyleVal(l) ((Linestyle)(__intVal(l))) |
|
269 |
#define _shortVal(l) ((short)(__intVal(l))) |
|
270 |
#define _longVal(l) ((long)(__intVal(l))) |
|
271 |
#define _deviceVal(l) ((Device)(__intVal(l))) |
|
272 |
#define _tagVal(l) ((Tag)(__intVal(l))) |
|
969 | 273 |
#define _objectVal(l) ((GLX_Object)(__intVal(l))) |
185 | 274 |
#define _offsetVal(l) ((Offset)(__intVal(l))) |
275 |
#define _rgbVal(l) ((RGBvalue)(__intVal(l))) |
|
276 |
#define _angleVal(c) ((Angle)(__intVal(c))) |
|
157 | 277 |
|
29 | 278 |
/* |
279 |
* 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
|
280 |
* ST-object must be true or false. Return from method if invalid. |
29 | 281 |
*/ |
282 |
#define _BOOLEAN_(arg, dst) \ |
|
30 | 283 |
if (arg==true) \ |
77 | 284 |
dst = (Boolean)TRUE; \ |
30 | 285 |
else if (arg==false) \ |
77 | 286 |
dst = (Boolean)FALSE; \ |
29 | 287 |
else { RETURN(false); } |
288 |
||
289 |
/* |
|
290 |
* check for and fetch a coord from ST-arg into C-dst |
|
157 | 291 |
* ST-object must be Float, SmallInteger or Fraction. |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
292 |
* Return from method if invalid. |
29 | 293 |
*/ |
0 | 294 |
#define _COORD_(arg, dst) \ |
97 | 295 |
if (__isFloat(arg)) \ |
77 | 296 |
dst = (Coord)(_floatVal(arg)); \ |
97 | 297 |
else if (__isSmallInteger(arg)) \ |
185 | 298 |
dst = (Coord)(__intVal(arg)); \ |
97 | 299 |
else if (__isFraction(arg) \ |
300 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_numerator) \ |
|
301 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_denominator)) { \ |
|
77 | 302 |
float n, d; \ |
303 |
\ |
|
185 | 304 |
n = (float)(__intVal(_FractionInstPtr(arg)->f_numerator)); \ |
305 |
d = (float)(__intVal(_FractionInstPtr(arg)->f_denominator)); \ |
|
77 | 306 |
dst = (Coord)(n / d); \ |
29 | 307 |
} else { RETURN(false); } |
308 |
||
309 |
/* |
|
310 |
* 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
|
311 |
* ST-object must be SmallInteger. Return from method if invalid. |
29 | 312 |
*/ |
313 |
#define _ICOORD_(arg, dst) \ |
|
97 | 314 |
if (__isSmallInteger(arg)) \ |
185 | 315 |
dst = (Icoord)(__intVal(arg)); \ |
29 | 316 |
else { RETURN(false); } |
317 |
||
318 |
/* |
|
157 | 319 |
* 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
|
320 |
* ST-object must be SmallInteger. Return from method if invalid. |
29 | 321 |
*/ |
322 |
#define _SCOORD_(arg, dst) \ |
|
97 | 323 |
if (__isSmallInteger(arg)) \ |
185 | 324 |
dst = (Scoord)(__intVal(arg)); \ |
29 | 325 |
else { RETURN(false); } |
326 |
||
327 |
#define _SCREENCOORD_(arg, dst) \ |
|
97 | 328 |
if (__isSmallInteger(arg)) \ |
185 | 329 |
dst = (Screencoord)(__intVal(arg)); \ |
29 | 330 |
else { RETURN(false); } |
331 |
||
332 |
#define _COLORINDEX_(arg, dst) \ |
|
97 | 333 |
if (__isSmallInteger(arg)) \ |
185 | 334 |
dst = (Colorindex)(__intVal(arg)); \ |
29 | 335 |
else { RETURN(false); } |
336 |
||
337 |
#define _ANGLE_(arg, dst) \ |
|
97 | 338 |
if (__isSmallInteger(arg)) \ |
185 | 339 |
dst = (Angle)(__intVal(arg)); \ |
29 | 340 |
else { RETURN(false); } |
0 | 341 |
|
342 |
#define _FLOAT_(arg, dst) \ |
|
97 | 343 |
if (__isFloat(arg)) \ |
77 | 344 |
dst = (float)(_floatVal(arg)); \ |
97 | 345 |
else if (__isSmallInteger(arg)) \ |
185 | 346 |
dst = (float)(__intVal(arg)); \ |
97 | 347 |
else if (__isFraction(arg) \ |
348 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_numerator) \ |
|
349 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_denominator)) { \ |
|
77 | 350 |
float n, d; \ |
351 |
\ |
|
185 | 352 |
n = (float)(__intVal(_FractionInstPtr(arg)->f_numerator)); \ |
353 |
d = (float)(__intVal(_FractionInstPtr(arg)->f_denominator)); \ |
|
77 | 354 |
dst = (float)(n / d); \ |
29 | 355 |
} else { RETURN(false); } |
0 | 356 |
|
357 |
#define _INT_(arg, dst) \ |
|
97 | 358 |
if (__isSmallInteger(arg)) \ |
185 | 359 |
dst = (int)(__intVal(arg)); \ |
29 | 360 |
else { RETURN(false); } |
361 |
||
30 | 362 |
#define _indexedArea(object) \ |
363 |
(((char *) (_InstPtr(object))) \ |
|
77 | 364 |
+ OHDR_SIZE \ |
185 | 365 |
+ (__intVal(_ClassInstPtr(__qClass(object))->c_ninstvars)) * sizeof(OBJ)) |
77 | 366 |
%} |
367 |
! ! |
|
368 |
||
168 | 369 |
!GLXWorkstation primitiveVariables! |
370 |
%{ |
|
371 |
/* |
|
372 |
* remembered info from private error handler |
|
373 |
*/ |
|
374 |
static char lastErrorMsg[80] = ""; |
|
375 |
static unsigned lastRequestCode = 0; |
|
376 |
static unsigned lastMinorCode = 0; |
|
377 |
static unsigned lastResource = 0; |
|
378 |
||
379 |
%} |
|
380 |
! ! |
|
381 |
||
89 | 382 |
!GLXWorkstation primitiveFunctions! |
77 | 383 |
%{ |
151 | 384 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
385 |
#ifdef DYNAMICALLY_LOADABLE |
168 | 386 |
/* |
387 |
* catch X-errors and forward as errorInterrupt:#DisplayError, |
|
388 |
* (which itself invokes my handler and optionally raises an exceptionSignal) |
|
389 |
* the implementation below is somewhat wrong: it will |
|
390 |
* report all errors for Display, even though there could be |
|
391 |
* more than one display connection. (being fixed, new errorInterrupt mechanism |
|
392 |
* allows passing an additional argument, which is the displayID ...) |
|
393 |
* |
|
394 |
* this dublicates the functionality as found in XWorkstation; |
|
395 |
* the reason is to allow dynamic loading systems to load this module |
|
396 |
* before XWorkstation (which was not possible otherwise, due to unresolved |
|
397 |
* external references while loading this one) |
|
398 |
*/ |
|
399 |
static |
|
400 |
__XErrorHandler__(dpy, event) |
|
401 |
Display *dpy; |
|
402 |
XErrorEvent *event; |
|
403 |
{ |
|
404 |
XGetErrorText(dpy, event->error_code, lastErrorMsg, 80); |
|
405 |
if (lastErrorMsg[0] == '\0') { |
|
185 | 406 |
sprintf(lastErrorMsg, "code: %d", event->error_code); |
168 | 407 |
} |
408 |
lastRequestCode = event->request_code; |
|
409 |
lastMinorCode = event->minor_code; |
|
410 |
lastResource = event->resourceid; |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
411 |
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
|
412 |
/* |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
413 |
* 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
|
414 |
* 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
|
415 |
* in non bottom-up window order. |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
416 |
*/ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
417 |
return 0; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
418 |
} |
168 | 419 |
|
218
10072d9beba5
can now turn off Xlib error messages from the errorHandler
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
420 |
if (@global(ErrorPrinting) == true) { |
1932 | 421 |
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
|
422 |
event->request_code, event->request_code, |
9ff0660f447f
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
218
diff
changeset
|
423 |
event->minor_code, event->minor_code, event->resourceid); |
1932 | 424 |
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
|
425 |
} |
168 | 426 |
|
207
9124817bbb03
use new c-pointer wrapper macros (based on externalAddress)
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
427 |
__errorInterruptWithIDAndParameter__(@symbol(DisplayError), __MKOBJ(dpy)); |
168 | 428 |
return 0; |
429 |
} |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
430 |
#else |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
431 |
extern __XErrorHandler__(); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
432 |
#endif |
168 | 433 |
|
151 | 434 |
/* |
435 |
* begin moved from GLXsupport.c |
|
436 |
*/ |
|
437 |
||
438 |
/* |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
439 |
* This provides a helper function "GLXCreateWindow", which does |
151 | 440 |
* 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
|
441 |
* to take place within. See the definition of GLXCreateWindow for a |
151 | 442 |
* description of how to call it. |
443 |
* |
|
444 |
* claus: I really had no time to look into all this, |
|
445 |
* this file has been just copied from a 4Dgifts demo .. |
|
446 |
* (will need more than a day to show more ...) |
|
447 |
*/ |
|
1932 | 448 |
#if !defined(OPENGL) |
151 | 449 |
|
1899 | 450 |
# include <X11/Xlib.h> |
451 |
# include <X11/Xutil.h> |
|
452 |
# ifndef VGL |
|
453 |
# include <gl/glws.h> |
|
454 |
# endif |
|
455 |
# include <signal.h> |
|
456 |
# include <setjmp.h> |
|
457 |
# include "stcIntern.h" |
|
151 | 458 |
|
459 |
/* |
|
460 |
* glxhelper.h: |
|
461 |
* |
|
462 |
* List of drawing modes supported by GLXCreateWindow (in glxhelper.c). |
|
463 |
* More than this are possible with mixed model, but this is just an |
|
464 |
* example. You can either expand this list (and the corresponding code in |
|
465 |
* GLXCreateWindow) or call the mixed model calls yourself, using |
|
466 |
* GLXCreateWindow as an example. |
|
467 |
*/ |
|
468 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
469 |
static char * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
470 |
typeToName[] = { |
151 | 471 |
"color index single buffer", |
472 |
"color index double buffer", |
|
473 |
"rgb single buffer", |
|
474 |
"rgb double buffer", |
|
475 |
}; |
|
476 |
||
1932 | 477 |
#endif /* GLX || VGL */ |
478 |
||
479 |
#if defined(GLX) && !defined(VGL) |
|
151 | 480 |
/* |
481 |
* Dorky little helper function used to build up a GLXconfig array. |
|
482 |
*/ |
|
483 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
484 |
static void |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
485 |
set_entry (GLXconfig* ptr, int b, int m, int a) |
151 | 486 |
{ |
487 |
ptr->buffer = b; |
|
488 |
ptr->mode = m; |
|
489 |
ptr->arg = a; |
|
490 |
} |
|
1932 | 491 |
#endif /* GLX & not VGL */ |
151 | 492 |
|
493 |
static JMP_BUF errorReturn; |
|
494 |
||
495 |
static void |
|
496 |
glAbort() { |
|
497 |
longjmp(errorReturn, 1); |
|
498 |
} |
|
499 |
||
500 |
/* |
|
501 |
* GLXCreateWindow(dpy, parent, x, y, w, h, boderWidth, type) |
|
502 |
* |
|
503 |
* Return value is the X window id of the newly created window. |
|
504 |
* |
|
505 |
* Arguments are: |
|
506 |
* dpy The X "Display*" returned by XOpenDisplay |
|
507 |
* parent The parent of the newly created window, |
|
508 |
* a typical value for this is |
|
509 |
* RootWindow(dpy, DefaultScreen(dpy)) |
|
510 |
* x,y The location of the window to be created, |
|
511 |
* y coordinate is measured from the top down. |
|
512 |
* w,h size of the new window |
|
513 |
* borderWidth the X border size for this window, should probably |
|
514 |
* be zero. |
|
515 |
* type the GLXWindowType (see glxhelper.h) desribing the |
|
516 |
* typer of GL drawing to be done in this window |
|
517 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
518 |
Window |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
519 |
__GLXCreateWindow(dpy, parent, x, y, w, h, borderWidth, type) |
151 | 520 |
Display* dpy; |
521 |
Window parent; |
|
522 |
GLXWindowType type; |
|
523 |
{ |
|
1932 | 524 |
#if !defined(OPENGL) |
525 |
# ifndef VGL |
|
151 | 526 |
GLXconfig params[50]; |
527 |
GLXconfig* next; |
|
528 |
GLXconfig* retconfig; |
|
529 |
Colormap cmap = DefaultColormap(dpy, DefaultScreen(dpy)); |
|
1932 | 530 |
# endif |
531 |
#endif |
|
532 |
Visual visual; |
|
151 | 533 |
XVisualInfo *vis; |
534 |
XVisualInfo template; |
|
535 |
XColor white; |
|
536 |
XSetWindowAttributes cwa; |
|
537 |
XWindowAttributes pwa; |
|
538 |
int scr, i, nret; |
|
539 |
Window win; |
|
1932 | 540 |
#ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
541 |
struct sigaction oldSig, newSig; |
1932 | 542 |
#else |
151 | 543 |
void *oldSig; |
1932 | 544 |
#endif |
545 |
||
546 |
#if !defined(OPENGL) |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
547 |
__catchExit(1); |
1932 | 548 |
#endif |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
549 |
|
151 | 550 |
if (setjmp(errorReturn)) { |
551 |
printf("hard error in GL - return\n"); |
|
1932 | 552 |
#ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
553 |
sigaction(SIGSEGV, &oldSig, 0); |
1932 | 554 |
#else |
151 | 555 |
signal(SIGSEGV, oldSig); |
1932 | 556 |
#endif |
557 |
#if !defined(OPENGL) |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
558 |
__catchExit(0); |
1932 | 559 |
#endif |
151 | 560 |
return 0; |
561 |
} |
|
562 |
__CONT__ |
|
563 |
||
1932 | 564 |
if (w <= 0) { |
565 |
printf("GL: bad width: %d\n", w); |
|
566 |
w = 1; |
|
567 |
} |
|
568 |
if (h <= 0) { |
|
569 |
printf("GL: bad height: %d\n", h); |
|
570 |
h = 1; |
|
571 |
} |
|
572 |
||
573 |
#if !defined(OPENGL) |
|
1899 | 574 |
# ifdef VGL |
151 | 575 |
/* |
576 |
* I know what VGL supports; its somewhat unclean to hard code it here |
|
577 |
*/ |
|
578 |
switch (type) { |
|
579 |
case GLXcolorIndexSingleBuffer: |
|
580 |
case GLXcolorIndexDoubleBuffer: |
|
581 |
break; |
|
582 |
||
583 |
case GLXrgbSingleBuffer: |
|
584 |
case GLXrgbDoubleBuffer: |
|
585 |
printf("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
|
586 |
__catchExit(0); |
151 | 587 |
return 0; |
588 |
} |
|
589 |
||
590 |
scr = DefaultScreen(dpy); |
|
591 |
visual.visualid = CopyFromParent; |
|
592 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
593 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
594 |
borderWidth, DisplayPlanes(dpy, scr), |
|
595 |
InputOutput, &visual, |
|
596 |
CWBorderPixel, &cwa); |
|
597 |
||
598 |
/* |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
599 |
* on some, seg-violations occur in the GL, if too many |
151 | 600 |
* views are created ... just to make certain, we catch those |
601 |
* in GL too. |
|
602 |
*/ |
|
1899 | 603 |
# ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
604 |
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
|
605 |
newSig = oldSig; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
606 |
newSig.sa_handler = glAbort; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
607 |
sigaction(SIGSEGV, &newSig, (struct sigaction *)0); |
1899 | 608 |
# else |
151 | 609 |
oldSig = signal(SIGSEGV, glAbort); |
1899 | 610 |
# endif |
151 | 611 |
i = GLXlink(dpy, win); |
1899 | 612 |
# ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
613 |
sigaction(SIGSEGV, &oldSig, (struct sigaction *)0); |
1899 | 614 |
# else |
151 | 615 |
signal(SIGSEGV, oldSig); |
1899 | 616 |
# endif |
151 | 617 |
|
618 |
if (i < 0) { |
|
619 |
printf("GLXlink returned %d\n", i); |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
620 |
__catchExit(0); |
151 | 621 |
return 0; |
622 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
623 |
|
1899 | 624 |
# else /* not VGL */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
625 |
|
151 | 626 |
/* |
627 |
* This builds an array in "params" that describes for GLXgetconfig(3G) |
|
628 |
* the type of GL drawing that will be done. |
|
629 |
*/ |
|
630 |
next = params; |
|
631 |
switch (type) { |
|
632 |
case GLXcolorIndexSingleBuffer: |
|
633 |
set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE); |
|
634 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE); |
|
635 |
break; |
|
636 |
case GLXcolorIndexDoubleBuffer: |
|
637 |
set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE); |
|
638 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE); |
|
639 |
break; |
|
640 |
case GLXrgbSingleBuffer: |
|
641 |
set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE); |
|
642 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE); |
|
643 |
break; |
|
644 |
case GLXrgbDoubleBuffer: |
|
645 |
set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE); |
|
646 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE); |
|
647 |
break; |
|
648 |
} |
|
649 |
set_entry(next, 0, 0, 0); /* The input to GLXgetconfig is null terminated */ |
|
650 |
||
651 |
/* |
|
652 |
* Get configuration data for a window based on above parameters |
|
653 |
* First we have to find out which screen the parent window is on, |
|
654 |
* then we can call GXLgetconfig() |
|
655 |
*/ |
|
656 |
XGetWindowAttributes(dpy, parent, &pwa); |
|
657 |
retconfig = GLXgetconfig(dpy, XScreenNumberOfScreen(pwa.screen), params); |
|
658 |
if (retconfig == 0) { |
|
659 |
printf("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
|
660 |
__catchExit(0); |
151 | 661 |
return 0; |
662 |
} |
|
663 |
||
664 |
/* |
|
665 |
* Scan through config info, pulling info needed to create a window |
|
666 |
* that supports the rendering mode. |
|
667 |
*/ |
|
668 |
for (next = retconfig; next->buffer; next++) { |
|
669 |
unsigned long buffer = next->buffer; |
|
670 |
unsigned long mode = next->mode; |
|
671 |
unsigned long value = next->arg; |
|
672 |
switch (mode) { |
|
673 |
case GLX_COLORMAP: |
|
674 |
if (buffer == GLX_NORMAL) { |
|
675 |
cmap = value; |
|
676 |
} |
|
677 |
break; |
|
678 |
case GLX_VISUAL: |
|
679 |
if (buffer == GLX_NORMAL) { |
|
680 |
template.visualid = value; |
|
681 |
template.screen = DefaultScreen(dpy); |
|
682 |
vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask, |
|
683 |
&template, &nret); |
|
684 |
} |
|
685 |
break; |
|
686 |
} |
|
687 |
} |
|
688 |
||
689 |
/* |
|
690 |
* Create the window |
|
691 |
*/ |
|
692 |
cwa.colormap = cmap; |
|
693 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
694 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
695 |
borderWidth, vis->depth, InputOutput, vis->visual, |
|
696 |
CWColormap|CWBorderPixel, &cwa); |
|
697 |
||
698 |
/* |
|
699 |
* Rescan configuration info and find window slot that getconfig |
|
700 |
* provided. Fill it in with the window we just created. |
|
701 |
*/ |
|
702 |
for (next = retconfig; next->buffer; next++) { |
|
703 |
if ((next->buffer == GLX_NORMAL) && (next->mode == GLX_WINDOW)) { |
|
704 |
next->arg = win; |
|
705 |
break; |
|
706 |
} |
|
707 |
} |
|
708 |
||
709 |
/* |
|
710 |
* Now "retconfig" contains all the information the GL needs to |
|
711 |
* configure the window and its own internal state. |
|
712 |
*/ |
|
713 |
/* |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
714 |
* on iris, seg-violations occur in the GL, if too many |
151 | 715 |
* views are created ... |
716 |
*/ |
|
1899 | 717 |
# ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
718 |
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
|
719 |
newSig = oldSig; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
720 |
newSig.sa_handler = glAbort; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
721 |
sigaction(SIGSEGV, &newSig, (struct sigaction *)0); |
1899 | 722 |
# else |
151 | 723 |
oldSig = signal(SIGSEGV, glAbort); |
1899 | 724 |
# endif |
151 | 725 |
i = GLXlink(dpy, retconfig); |
1899 | 726 |
# ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
727 |
sigaction(SIGSEGV, &oldSig, (struct sigaction *)0); |
1899 | 728 |
# else |
151 | 729 |
signal(SIGSEGV, oldSig); |
1899 | 730 |
# endif |
151 | 731 |
|
732 |
if (i < 0) { |
|
733 |
printf("GLXlink returned %d\n", i); |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
734 |
__catchExit(0); |
151 | 735 |
return 0; |
736 |
} |
|
737 |
||
738 |
/* |
|
739 |
* The GL sets its own X error handlers, which exits - this is not what we want |
|
740 |
*/ |
|
741 |
XSetErrorHandler(__XErrorHandler__); |
|
1899 | 742 |
# endif /* not VGL */ |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
743 |
__catchExit(0); |
1932 | 744 |
|
745 |
#else /* OPENGL | MESA */ |
|
746 |
||
747 |
scr = DefaultScreen(dpy); |
|
748 |
visual.visualid = CopyFromParent; |
|
749 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
750 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
751 |
borderWidth, DisplayPlanes(dpy, scr), |
|
752 |
InputOutput, &visual, |
|
753 |
CWBorderPixel, &cwa); |
|
754 |
||
755 |
vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask, &visual, &nret); |
|
756 |
printf("vis is %x\n", vis); |
|
757 |
#endif /* GLX || VGL */ |
|
758 |
||
151 | 759 |
return win; |
760 |
} |
|
761 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
762 |
__GLXUnlinkWindow(dpy, win) |
151 | 763 |
Display* dpy; |
764 |
Window win; |
|
765 |
{ |
|
766 |
/* |
|
767 |
* only needed for VGL - GLX does it automatically |
|
768 |
*/ |
|
1932 | 769 |
#ifdef VGL |
151 | 770 |
GLXunlink(dpy, win); |
1932 | 771 |
#endif |
151 | 772 |
} |
773 |
||
29 | 774 |
/* |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
775 |
* helper for rotation - calls rot() |
29 | 776 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
777 |
OBJ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
778 |
__glx_doRotate(angle, axis) |
29 | 779 |
OBJ angle; |
780 |
char axis; |
|
781 |
{ |
|
782 |
float f_angle; |
|
783 |
||
35 | 784 |
if (__isFloat(angle)) { |
77 | 785 |
f_angle = (float)(_floatVal(angle)); |
1932 | 786 |
if (f_angle != 0.0) { |
787 |
#ifdef OPENGL |
|
788 |
#else |
|
77 | 789 |
rot(f_angle, axis); |
1932 | 790 |
#endif |
791 |
} |
|
77 | 792 |
return (true); |
29 | 793 |
} |
35 | 794 |
if (__isFraction(angle) |
97 | 795 |
&& __isSmallInteger(_FractionInstPtr(angle)->f_numerator) |
796 |
&& __isSmallInteger(_FractionInstPtr(angle)->f_denominator)) { |
|
77 | 797 |
float n, d; |
798 |
||
185 | 799 |
n = (float)(__intVal(_FractionInstPtr(angle)->f_numerator)); |
800 |
d = (float)(__intVal(_FractionInstPtr(angle)->f_denominator)); |
|
77 | 801 |
f_angle = n / d; |
1932 | 802 |
if (f_angle != 0.0) { |
803 |
#ifdef OPENGL |
|
804 |
#else |
|
77 | 805 |
rot(f_angle, axis); |
1932 | 806 |
#endif |
807 |
} |
|
77 | 808 |
return (true); |
29 | 809 |
} |
97 | 810 |
if (__isSmallInteger(angle)) { |
185 | 811 |
f_angle = (float)(__intVal(angle)); |
1932 | 812 |
if (f_angle != 0.0) { |
813 |
#ifdef OPENGL |
|
814 |
#else |
|
77 | 815 |
rot(f_angle, axis); |
1932 | 816 |
#endif |
817 |
} |
|
77 | 818 |
return (true); |
29 | 819 |
} |
820 |
return false; |
|
821 |
} |
|
0 | 822 |
|
24 | 823 |
/* |
29 | 824 |
* fetch integers from an st-array (elements must be smallIntegers) |
825 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
826 |
long * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
827 |
__glx_getLongsFromInto(obj, vec, count) |
29 | 828 |
OBJ obj; |
829 |
long *vec; |
|
830 |
{ |
|
831 |
OBJ cls, o; |
|
832 |
int nByte, i, ninstVars, nInstBytes; |
|
833 |
char *pElem; |
|
834 |
||
835 |
if (! _isNonNilObject(obj)) return (long *)NULL; |
|
134 | 836 |
cls = __qClass(obj); |
185 | 837 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 838 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 839 |
nByte = __qSize(obj) - nInstBytes; |
29 | 840 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
841 |
if (nByte < (count * sizeof(OBJ))) return (long *)NULL; |
|
842 |
for (i=0; i<count; i++) { |
|
77 | 843 |
o = *(OBJ *)pElem; |
97 | 844 |
if (! __isSmallInteger(o)) return (long *)NULL; |
185 | 845 |
vec[i] = (long)__intVal(o); |
77 | 846 |
pElem += sizeof(OBJ); |
29 | 847 |
} |
848 |
return vec; |
|
849 |
} |
|
850 |
||
851 |
/* |
|
852 |
* fetch shorts from an st-array (elements must be smallIntegers) |
|
853 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
854 |
short * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
855 |
__glx_getShortsFromInto(obj, vec, count) |
29 | 856 |
OBJ obj; |
857 |
short *vec; |
|
858 |
{ |
|
859 |
OBJ cls, o; |
|
860 |
int nByte, i, ninstVars, nInstBytes; |
|
861 |
char *pElem; |
|
862 |
||
863 |
if (! _isNonNilObject(obj)) return (short *)NULL; |
|
134 | 864 |
cls = __qClass(obj); |
185 | 865 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 866 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 867 |
nByte = __qSize(obj) - nInstBytes; |
29 | 868 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
869 |
if (nByte < (count * sizeof(OBJ))) return (short *)NULL; |
|
870 |
for (i=0; i<count; i++) { |
|
77 | 871 |
o = *(OBJ *)pElem; |
97 | 872 |
if (! __isSmallInteger(o)) return (short *)NULL; |
185 | 873 |
vec[i] = (short)__intVal(o); |
77 | 874 |
pElem += sizeof(OBJ); |
29 | 875 |
} |
876 |
return vec; |
|
877 |
} |
|
878 |
||
879 |
/* |
|
880 |
* fetch floats from an st-object into a c-float array |
|
881 |
* which may be a floatArray, doubleArray or array-of-something, |
|
882 |
* where something may be a float, fraction or smallInteger, |
|
24 | 883 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
884 |
float * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
885 |
__glx_getFloatsFromInto(obj, vec, count) |
12 | 886 |
OBJ obj; |
887 |
float *vec; |
|
888 |
{ |
|
889 |
OBJ cls; |
|
890 |
int nByte; |
|
891 |
OBJ o; |
|
892 |
int i, ninstVars, nInstBytes; |
|
893 |
char *pElem; |
|
894 |
||
895 |
if (! _isNonNilObject(obj)) return (float *)0; |
|
896 |
||
134 | 897 |
cls = __qClass(obj); |
185 | 898 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
12 | 899 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 900 |
nByte = __qSize(obj) - nInstBytes; |
12 | 901 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
902 |
||
185 | 903 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
12 | 904 |
case FLOATARRAY: |
77 | 905 |
/* |
906 |
* best speed for float array |
|
907 |
* - the data is already as we want it |
|
908 |
*/ |
|
909 |
if (nByte < (count * sizeof(float))) return (float *)0; |
|
910 |
return (float *)pElem; |
|
12 | 911 |
|
912 |
case DOUBLEARRAY: |
|
77 | 913 |
/* |
914 |
* for double array, have to copy-and-cast |
|
915 |
*/ |
|
916 |
if (nByte < (count * sizeof(double))) return (float *)0; |
|
917 |
for (i=0; i<count; i++) { |
|
918 |
vec[i] = *((double *)pElem); |
|
919 |
pElem += sizeof(double); |
|
920 |
} |
|
921 |
return vec; |
|
12 | 922 |
|
923 |
case POINTERARRAY: |
|
77 | 924 |
/* |
925 |
* for other array, have to fetch, check and store |
|
926 |
* the elements can be floats, smallintegers or fractions |
|
927 |
*/ |
|
928 |
if (nByte < (count * sizeof(OBJ))) return (float *)0; |
|
929 |
/* get elements one-by-one */ |
|
930 |
for (i=0; i<count; i++) { |
|
931 |
o = *(OBJ *)pElem; |
|
932 |
if (__isFloat(o)) { |
|
933 |
vec[i] = _floatVal(o); |
|
97 | 934 |
} else if (__isSmallInteger(o)) { |
185 | 935 |
vec[i] = (float)(__intVal(o)); |
77 | 936 |
} else if (__isFraction(o) |
97 | 937 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
938 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
77 | 939 |
float n, d; |
940 |
||
185 | 941 |
n = (float)(__intVal(_FractionInstPtr(o)->f_numerator)); |
942 |
d = (float)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
77 | 943 |
vec[i] = n / d; |
944 |
} else |
|
945 |
return 0; |
|
946 |
pElem += sizeof(OBJ); |
|
947 |
} |
|
948 |
return vec; |
|
12 | 949 |
} |
950 |
return (float *)0; |
|
951 |
} |
|
952 |
||
29 | 953 |
/* |
954 |
* fetch doubles from an st-object into a c-double array |
|
955 |
* which may be a floatArray, doubleArray or array-of-something, |
|
956 |
* where something may be a float, fraction or smallInteger, |
|
957 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
958 |
double * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
959 |
__glx_getDoublesFromInto(obj, vec, count) |
29 | 960 |
OBJ obj; |
961 |
double *vec; |
|
962 |
{ |
|
963 |
OBJ cls, o; |
|
964 |
int nByte, i, ninstVars, nInstBytes; |
|
965 |
char *pElem; |
|
966 |
||
967 |
if (! _isNonNilObject(obj)) return (double *)0; |
|
134 | 968 |
cls = __qClass(obj); |
185 | 969 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 970 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 971 |
nByte = __qSize(obj) - nInstBytes; |
29 | 972 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
973 |
||
185 | 974 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
29 | 975 |
case DOUBLEARRAY: |
77 | 976 |
/* best speed for double array - the data is already as we want it */ |
977 |
if (nByte < (count * sizeof(double))) return (double *)0; |
|
978 |
return (double *)pElem; |
|
29 | 979 |
|
980 |
case FLOATARRAY: |
|
77 | 981 |
if (nByte < (count * sizeof(float))) return (double *)0; |
982 |
for (i=0; i<count; i++) { |
|
983 |
vec[i] = *((float *)pElem); |
|
984 |
pElem += sizeof(float); |
|
985 |
} |
|
986 |
return vec; |
|
29 | 987 |
|
988 |
case POINTERARRAY: |
|
77 | 989 |
if (nByte < (count * sizeof(OBJ))) return (double *)0; |
990 |
/* get elements one-by-one */ |
|
991 |
for (i=0; i<count; i++) { |
|
992 |
o = *(OBJ *)pElem; |
|
993 |
if (__isFloat(o)) |
|
994 |
vec[i] = _floatVal(o); |
|
97 | 995 |
else if (__isSmallInteger(o)) |
185 | 996 |
vec[i] = (double)(__intVal(o)); |
77 | 997 |
else if (__isFraction(o) |
97 | 998 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
999 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
77 | 1000 |
double n, d; |
1001 |
||
185 | 1002 |
n = (double)(__intVal(_FractionInstPtr(o)->f_numerator)); |
1003 |
d = (double)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
77 | 1004 |
vec[i] = n / d; |
1005 |
||
1006 |
} else |
|
1007 |
return 0; |
|
1008 |
pElem += sizeof(OBJ); |
|
1009 |
} |
|
1010 |
return vec; |
|
29 | 1011 |
} |
1012 |
return (double *)0; |
|
1013 |
} |
|
1014 |
||
1015 |
/* |
|
1016 |
* move from a c-float array into an st-object, |
|
1017 |
* the st-object MUST be either a float- or double array |
|
1018 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1019 |
__glx_putFloatsFromInto(vec, obj, count) |
12 | 1020 |
OBJ obj; |
1021 |
float *vec; |
|
1022 |
{ |
|
1023 |
OBJ cls; |
|
1024 |
int nByte; |
|
1025 |
OBJ o; |
|
1026 |
int i, ninstVars, nInstBytes; |
|
1027 |
char *pElem; |
|
1028 |
||
1029 |
if (! _isNonNilObject(obj)) return 0; |
|
1030 |
||
134 | 1031 |
cls = __qClass(obj); |
185 | 1032 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
12 | 1033 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1034 |
nByte = __qSize(obj) - nInstBytes; |
12 | 1035 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1036 |
||
185 | 1037 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
12 | 1038 |
case FLOATARRAY: |
77 | 1039 |
if (nByte < (count * sizeof(float))) return 0; |
1040 |
for (i=0; i<count; i++) { |
|
1041 |
*(float *)pElem = vec[i]; |
|
1042 |
pElem += sizeof(float); |
|
1043 |
} |
|
1044 |
return 1; |
|
12 | 1045 |
|
1046 |
case DOUBLEARRAY: |
|
77 | 1047 |
if (nByte < (count * sizeof(float))) return 0; |
1048 |
for (i=0; i<count; i++) { |
|
1049 |
*(double *)pElem = vec[i]; |
|
1050 |
pElem += sizeof(double); |
|
1051 |
} |
|
1052 |
return 1; |
|
12 | 1053 |
} |
1054 |
/* not implemented for others */ |
|
1055 |
||
1056 |
return 0; |
|
1057 |
} |
|
1058 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1059 |
#ifndef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1060 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1061 |
Matrix * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1062 |
__glx_getFloatsFromMatrixInto(obj, mp) |
12 | 1063 |
OBJ obj; |
1064 |
Matrix *mp; |
|
1065 |
{ |
|
1066 |
OBJ cls; |
|
1067 |
int nByte; |
|
1068 |
OBJ o; |
|
29 | 1069 |
int ninstVars, nInstBytes; |
1070 |
char *pElem; |
|
1071 |
int x = 0; |
|
1072 |
int i,j; |
|
12 | 1073 |
|
1074 |
if (! _isNonNilObject(obj)) return (Matrix *)0; |
|
1075 |
||
134 | 1076 |
cls = __qClass(obj); |
185 | 1077 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 1078 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1079 |
nByte = __qSize(obj) - nInstBytes; |
29 | 1080 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1081 |
||
185 | 1082 |
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
|
1083 |
case FLOATARRAY: |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1084 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1085 |
* very easy for FLOATARRAY objects - no copying needed |
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 |
if (nByte < (16 * sizeof(float))) return (Matrix *)0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1088 |
return (Matrix *) _FloatArrayInstPtr(obj)->f_element; |
12 | 1089 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1090 |
case DOUBLEARRAY: |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1091 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1092 |
* for DOUBLEARRAY objects copy and cast |
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 |
if (nByte < (16 * sizeof(double))) return (Matrix *)0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1095 |
for (i=0; i<4; i++) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1096 |
for (j=0; j<4; j++) { |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1097 |
(*mp)[i][j] = _DoubleArrayInstPtr(obj)->d_element[x]; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1098 |
x++; |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1099 |
} |
77 | 1100 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1101 |
return mp; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1102 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1103 |
case POINTERARRAY: |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1104 |
if (nByte < (16 * sizeof(OBJ))) return (Matrix *)0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1105 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1106 |
* get elements one-by-one |
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 |
for (i=0; i<4; i++) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1109 |
for (j=0; j<4; j++) { |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1110 |
o = _ArrayInstPtr(obj)->a_element[x]; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1111 |
if (__isFloat(o)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1112 |
(*mp)[i][j] = _floatVal(o); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1113 |
} else if (__isSmallInteger(o)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1114 |
(*mp)[i][j] = (double)__intVal(o); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1115 |
} else if (__isFraction(o) |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1116 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1117 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1118 |
double n, d; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1119 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1120 |
n = (double)(__intVal(_FractionInstPtr(o)->f_numerator)); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1121 |
d = (double)(__intVal(_FractionInstPtr(o)->f_denominator)); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1122 |
(*mp)[i][j] = n / d; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1123 |
} else |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1124 |
return (Matrix *)0; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1125 |
x++; |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1126 |
} |
77 | 1127 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1128 |
return mp; |
12 | 1129 |
} |
1130 |
return (Matrix *)0; |
|
1131 |
} |
|
1132 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1133 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1134 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1135 |
float* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1136 |
__glx_getFloatsFromFloatArrayInto(obj, fp) |
46 | 1137 |
OBJ obj; |
1138 |
float *fp; |
|
1139 |
{ |
|
1140 |
OBJ cls; |
|
1141 |
int ninstVars; |
|
1142 |
||
1143 |
if (! _isNonNilObject(obj)) return (float *)0; |
|
134 | 1144 |
cls = __qClass(obj); |
350 | 1145 |
if (cls == @global(FloatArray)) |
77 | 1146 |
return _FloatArrayInstPtr(obj)->f_element; |
46 | 1147 |
|
185 | 1148 |
if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) { |
1149 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
77 | 1150 |
return (float *) &(_InstPtr(obj)->i_instvars[ninstVars]); |
46 | 1151 |
} |
1152 |
||
1153 |
/* |
|
1154 |
* need more here (i.e. convert from array-of-floats) |
|
1155 |
*/ |
|
1156 |
return (float *)0; |
|
1157 |
} |
|
1158 |
||
1159 |
%} |
|
1160 |
! ! |
|
0 | 1161 |
|
294 | 1162 |
!GLXWorkstation class methodsFor:'documentation'! |
1163 |
||
1164 |
copyright |
|
1165 |
" |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1166 |
COPYRIGHT (c) 1993 by Claus Gittinger |
294 | 1167 |
All Rights Reserved |
1168 |
||
1169 |
This software is furnished under a license and may be used |
|
1170 |
only in accordance with the terms of that license and with the |
|
1171 |
inclusion of the above copyright notice. This software may not |
|
1172 |
be provided or otherwise made available to, or used by, any |
|
1173 |
other person. No title to or ownership of the software is |
|
1174 |
hereby transferred. |
|
1175 |
" |
|
1176 |
! |
|
1177 |
||
1178 |
documentation |
|
1179 |
" |
|
1180 |
this class was originally written as a demo on how an interface to |
|
1181 |
a c graphics library could be implemented. In the mean time, it has become |
|
1182 |
quite complete ... |
|
1183 |
||
1184 |
It provides an interface to either a real GL (on SGI workstations) |
|
1185 |
or a simulated VGL (i.e. GL-light; low nicotine). |
|
1186 |
The GL simulation is derived from the PD vogl library, with slight |
|
1187 |
modifictions to support multiple GL views. |
|
1188 |
||
1189 |
Most of the hard work was done by Jeff (thanks indeed) ... |
|
1190 |
||
1191 |
||
1192 |
Some notes: |
|
1193 |
||
1194 |
I do not really know what most of these functions do - for more |
|
1195 |
detail, see the GL man pages (on SGI) or the doc provided with VGL. |
|
1196 |
||
1197 |
The interface offered here provides a very very low level (i.e one-to-one) |
|
1198 |
interface to GL functions. More high-level stuff is required, to make |
|
1199 |
3D drawing be more object-oriented. |
|
1200 |
(see a bit of this in 'clients/IRIS-specials') |
|
1201 |
||
1202 |
Some functions are duplicated, Jeff and I developed those in parallel - |
|
1203 |
for now, both will remain - finally they will be merged and duplicates removed ... |
|
1204 |
(examples are makeobj and makeObject). |
|
1205 |
||
1206 |
Also, in a hurry to implement all those methods, many do no or only |
|
1207 |
limited argument checking - make certain, that you pass the correct |
|
1208 |
arguments. |
|
1209 |
||
1210 |
There might be some confusion in the v3[sifd] functions: basically they |
|
1211 |
all do the same, and could be mapped onto one st-method (such as vertex3). |
|
1212 |
However, the C-functions expect different argument types - I dont know if |
|
1213 |
one or another of these functions suffers from any performance penalties. |
|
1214 |
Therefore, I leave the direct 1-to-1 mapping; GL experts might know more |
|
1215 |
about this (I use v3f in all of my code). |
|
1216 |
||
1217 |
written june 93 by claus |
|
1218 |
VGL stuff dec 93 |
|
1219 |
many many additions jan 94 by Jeff McAffer <jeff@is.s.u-tokyo.ac.jp> |
|
1220 |
||
1221 |
Since this is a demo (consider it a free add-on goody) there is |
|
1222 |
*** NO WARRANTY ** for this. |
|
1223 |
||
1224 |
Notice: this should be rewritten to use the openGL library functions |
|
1225 |
(actually, to not loose the VGL interface, another OpenGLWorkstation |
|
1226 |
class should be written) |
|
614 | 1227 |
|
1228 |
[author:] |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1229 |
Claus Gittinger |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1230 |
Jeff McAffer |
294 | 1231 |
" |
1232 |
! ! |
|
1233 |
||
168 | 1234 |
!GLXWorkstation class methodsFor:'error handling'! |
1235 |
||
294 | 1236 |
errorStringOfLastError |
1237 |
%{ |
|
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1238 |
RETURN ( __MKSTRING(lastErrorMsg) ); |
168 | 1239 |
%} |
1240 |
! |
|
1241 |
||
528 | 1242 |
forceGL:aBoolean |
1243 |
ForceGL := aBoolean. |
|
1244 |
AllScreens notNil ifTrue:[ |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1245 |
AllScreens do:[:screen | screen initializeScreenProperties] |
528 | 1246 |
]. |
1247 |
! |
|
1248 |
||
168 | 1249 |
minorCodeOfLastError |
1250 |
%{ /* NOCONTEXT */ |
|
1251 |
||
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
1252 |
RETURN ( __MKSMALLINT(lastMinorCode) ); |
168 | 1253 |
%} |
1254 |
! |
|
1255 |
||
294 | 1256 |
requestCodeOfLastError |
1257 |
%{ /* NOCONTEXT */ |
|
1258 |
||
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
1259 |
RETURN ( __MKSMALLINT(lastRequestCode) ); |
294 | 1260 |
%} |
1261 |
! |
|
1262 |
||
168 | 1263 |
resourceIdOfLastError |
1264 |
%{ /* NOCONTEXT */ |
|
1265 |
||
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
1266 |
RETURN ( __MKSMALLINT(lastResource) ); |
168 | 1267 |
%} |
294 | 1268 |
! ! |
1269 |
||
1270 |
!GLXWorkstation methodsFor:'arcs and circles'! |
|
1271 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1272 |
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
|
1273 |
"draw an arc at a given location. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1274 |
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
|
1275 |
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
|
1276 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1277 |
%{ /* NOCONTEXT */ |
294 | 1278 |
Coord c_x, c_y, c_radius; |
1279 |
Angle a_startang, a_endang; |
|
1280 |
||
1281 |
_COORD_(x, c_x) |
|
1282 |
_COORD_(y, c_y) |
|
1283 |
_COORD_(radius, c_radius) |
|
1284 |
_ANGLE_(startang, a_startang) |
|
1285 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1286 |
|
294 | 1287 |
SETWIN(aGLXWindowId) |
1932 | 1288 |
#ifdef OPENGL |
1289 |
#else |
|
294 | 1290 |
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
|
1291 |
#endif |
294 | 1292 |
%} |
528 | 1293 |
|
1294 |
"Modified: 19.3.1996 / 18:43:52 / cg" |
|
294 | 1295 |
! |
1296 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1297 |
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
|
1298 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1299 |
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
|
1300 |
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
|
1301 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1302 |
%{ /* NOCONTEXT */ |
294 | 1303 |
Coord c_x, c_y, c_radius; |
1304 |
Angle a_startang, a_endang; |
|
1305 |
||
1306 |
_COORD_(x, c_x) |
|
1307 |
_COORD_(y, c_y) |
|
1308 |
_COORD_(radius, c_radius) |
|
1309 |
_ANGLE_(startang, a_startang) |
|
1310 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1311 |
|
294 | 1312 |
SETWIN(aGLXWindowId) |
1932 | 1313 |
#ifdef OPENGL |
1314 |
#else |
|
294 | 1315 |
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
|
1316 |
#endif |
294 | 1317 |
%} |
1318 |
! |
|
1319 |
||
1320 |
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
|
1321 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1322 |
All arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1323 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1324 |
%{ /* NOCONTEXT */ |
294 | 1325 |
Icoord c_x, c_y, c_radius; |
1326 |
Angle a_startang, a_endang; |
|
1327 |
||
1328 |
_ICOORD_(x, c_x) |
|
1329 |
_ICOORD_(y, c_y) |
|
1330 |
_ICOORD_(radius, c_radius) |
|
1331 |
_ANGLE_(startang, a_startang); |
|
1332 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1333 |
|
294 | 1334 |
SETWIN(aGLXWindowId) |
1932 | 1335 |
#ifdef OPENGL |
1336 |
#else |
|
294 | 1337 |
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
|
1338 |
#endif |
294 | 1339 |
%} |
1340 |
! |
|
1341 |
||
1342 |
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
|
1343 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1344 |
All arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1345 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1346 |
%{ /* NOCONTEXT */ |
294 | 1347 |
Scoord c_x, c_y, c_radius; |
1348 |
Angle a_startang, a_endang; |
|
1349 |
||
1350 |
_SCOORD_(x, c_x) |
|
1351 |
_SCOORD_(y, c_y) |
|
1352 |
_SCOORD_(radius, c_radius) |
|
1353 |
_ANGLE_(startang, a_startang) |
|
1354 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1355 |
|
294 | 1356 |
SETWIN(aGLXWindowId) |
1932 | 1357 |
#ifdef OPENGL |
1358 |
#else |
|
294 | 1359 |
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
|
1360 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1361 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1362 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1363 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1364 |
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
|
1365 |
"draw an (unfilled) arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1366 |
All arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1367 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1368 |
%{ /* NOCONTEXT */ |
294 | 1369 |
Icoord c_x, c_y, c_radius; |
1370 |
Angle a_startang, a_endang; |
|
1371 |
||
1372 |
_ICOORD_(x, c_x) |
|
1373 |
_ICOORD_(y, c_y) |
|
1374 |
_ICOORD_(radius, c_radius) |
|
1375 |
_ANGLE_(startang, a_startang) |
|
1376 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1377 |
|
294 | 1378 |
SETWIN(aGLXWindowId) |
1932 | 1379 |
#ifdef OPENGL |
1380 |
#else |
|
294 | 1381 |
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
|
1382 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1383 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1384 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1385 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1386 |
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
|
1387 |
"draw an (unfilled) arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1388 |
All arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1389 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1390 |
%{ /* NOCONTEXT */ |
1932 | 1391 |
Scoord c_x, c_y, c_radius; |
1392 |
Angle a_startang, a_endang; |
|
1393 |
||
1394 |
_SCOORD_(x, c_x) |
|
1395 |
_SCOORD_(y, c_y) |
|
1396 |
_SCOORD_(radius, c_radius) |
|
1397 |
_ANGLE_(startang, a_startang) |
|
1398 |
_ANGLE_(endang, a_endang) |
|
1399 |
||
1400 |
SETWIN(aGLXWindowId) |
|
1401 |
#ifdef OPENGL |
|
1402 |
#else |
|
1403 |
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
|
1404 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1405 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1406 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1407 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1408 |
glxCircX:x y:y radius: radius in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1409 |
"draw a circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1410 |
x/y/radius may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1411 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1412 |
%{ /* NOCONTEXT */ |
1932 | 1413 |
Coord c_x, c_y, c_radius; |
1414 |
||
1415 |
_COORD_ (x, c_x) |
|
1416 |
_COORD_ (y, c_y) |
|
1417 |
_COORD_ (radius, c_radius) |
|
1418 |
||
1419 |
SETWIN(aGLXWindowId) |
|
1420 |
#ifdef OPENGL |
|
1421 |
#else |
|
1422 |
circ(c_x, c_y, c_radius); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1423 |
#endif |
294 | 1424 |
%} |
1425 |
! |
|
1426 |
||
1427 |
glxCircfX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1428 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1429 |
x/y/radius may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1430 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1431 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1432 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1433 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1434 |
Coord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1435 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1436 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1437 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1438 |
_COORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1439 |
|
1932 | 1440 |
#ifdef OPENGL |
1441 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1442 |
circf(c_x, c_y, c_radius); |
1932 | 1443 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1444 |
} |
294 | 1445 |
%} |
1446 |
! |
|
1447 |
||
1448 |
glxCircfiX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1449 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1450 |
x/y/radius must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1451 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1452 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1453 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1454 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1455 |
Icoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1456 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1457 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1458 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1459 |
_ICOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1460 |
|
1932 | 1461 |
#ifdef OPENGL |
1462 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1463 |
circfi(c_x, c_y, c_radius); |
1932 | 1464 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1465 |
} |
294 | 1466 |
%} |
1467 |
! |
|
1468 |
||
1469 |
glxCircfsX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1470 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1471 |
x/y/radius must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1472 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1473 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1474 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1475 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1476 |
Scoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1477 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1478 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1479 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1480 |
_SCOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1481 |
|
1932 | 1482 |
#ifdef OPENGL |
1483 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1484 |
circfs(c_x, c_y, c_radius); |
1932 | 1485 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1486 |
} |
294 | 1487 |
%} |
1488 |
! |
|
1489 |
||
1490 |
glxCirciX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1491 |
"draw a circle (unfilled). |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1492 |
x/y/radius must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1493 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1494 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1495 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1496 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1497 |
Icoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1498 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1499 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1500 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1501 |
_ICOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1502 |
|
1932 | 1503 |
#ifdef OPENGL |
1504 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1505 |
circi(c_x, c_y, c_radius); |
1932 | 1506 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1507 |
} |
294 | 1508 |
%} |
1509 |
! |
|
1510 |
||
1511 |
glxCircsX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1512 |
"draw a circle (unfilled) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1513 |
x/y/radius must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1514 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1515 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1516 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1517 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1518 |
Scoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1519 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1520 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1521 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1522 |
_SCOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1523 |
|
1932 | 1524 |
#ifdef OPENGL |
1525 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1526 |
circs(c_x, c_y, c_radius); |
1932 | 1527 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1528 |
} |
294 | 1529 |
%} |
1530 |
! ! |
|
1531 |
||
528 | 1532 |
!GLXWorkstation methodsFor:'attribute stack'! |
1533 |
||
1534 |
glxPopattributesIn: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1535 |
"pop (and forget) the top entry on the attribute stack" |
528 | 1536 |
|
1537 |
%{ /* NOCONTEXT */ |
|
1538 |
SETWIN(aGLXWindowId) |
|
1932 | 1539 |
#ifndef OPENGL |
528 | 1540 |
popattributes(); |
1932 | 1541 |
#endif |
528 | 1542 |
%} |
1543 |
||
1544 |
"Modified: 19.3.1996 / 18:42:53 / cg" |
|
1545 |
! |
|
1546 |
||
1547 |
glxPushattributesIn: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1548 |
"save the current attributes on the attribute stack" |
528 | 1549 |
|
1550 |
%{ /* NOCONTEXT */ |
|
1551 |
SETWIN(aGLXWindowId) |
|
1932 | 1552 |
#ifndef OPENGL |
528 | 1553 |
pushattributes(); |
1932 | 1554 |
#endif |
528 | 1555 |
%} |
1556 |
||
1557 |
"Modified: 19.3.1996 / 18:43:04 / cg" |
|
1558 |
! ! |
|
1559 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1560 |
!GLXWorkstation methodsFor:'character position'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1561 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1562 |
glxCmov2X: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1563 |
"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
|
1564 |
The arguments may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1565 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1566 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1567 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1568 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1569 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1570 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1571 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1572 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1573 |
|
1932 | 1574 |
#ifdef OPENGL |
1575 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1576 |
cmov2(c_x, c_y); |
1932 | 1577 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1578 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1579 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1580 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1581 |
"Modified: 22.3.1996 / 18:17:38 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1582 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1583 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1584 |
glxCmov2iX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1585 |
"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
|
1586 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1587 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1588 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1589 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1590 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1591 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1592 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1593 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1594 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1595 |
|
1932 | 1596 |
#ifdef OPENGL |
1597 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1598 |
cmov2i(c_x, c_y); |
1932 | 1599 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1600 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1601 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1602 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1603 |
"Modified: 22.3.1996 / 18:17:43 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1604 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1605 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1606 |
glxCmov2sX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1607 |
"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
|
1608 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1609 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1610 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1611 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1612 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1613 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1614 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1615 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1616 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1617 |
|
1932 | 1618 |
#ifdef OPENGL |
1619 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1620 |
cmov2s(c_x, c_y); |
1932 | 1621 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1622 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1623 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1624 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1625 |
"Modified: 22.3.1996 / 18:17:47 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1626 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1627 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1628 |
glxCmovX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1629 |
"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
|
1630 |
The arguments may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1631 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1632 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1633 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1634 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1635 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1636 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1637 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1638 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1639 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1640 |
|
1932 | 1641 |
#ifdef OPENGL |
1642 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1643 |
cmov(c_x, c_y, c_z); |
1932 | 1644 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1645 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1646 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1647 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1648 |
"Modified: 22.3.1996 / 18:17:22 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1649 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1650 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1651 |
glxCmoviX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1652 |
"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
|
1653 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1654 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1655 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1656 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1657 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1658 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1659 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1660 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1661 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1662 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1663 |
|
1932 | 1664 |
#ifdef OPENGL |
1665 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1666 |
cmovi(c_x, c_y, c_z); |
1932 | 1667 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1668 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1669 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1670 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1671 |
"Modified: 22.3.1996 / 18:17:55 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1672 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1673 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1674 |
glxCmovsX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1675 |
"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
|
1676 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1677 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1678 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1679 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1680 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1681 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1682 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1683 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1684 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1685 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1686 |
|
1932 | 1687 |
#ifdef OPENGL |
1688 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1689 |
cmovs(c_x, c_y, c_z); |
1932 | 1690 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1691 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1692 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1693 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1694 |
"Modified: 22.3.1996 / 18:17:59 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1695 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1696 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1697 |
glxGetcposIn: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1698 |
"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
|
1699 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1700 |
| x y | |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1701 |
%{ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1702 |
short s_x, s_y; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1703 |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1704 |
SETWIN(aGLXWindowId) |
1932 | 1705 |
#ifdef OPENGL |
1706 |
#else |
|
1707 |
# ifdef GLX |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1708 |
getcpos(&s_x, &s_y); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1709 |
x = __MKSMALLINT(s_x); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1710 |
y = __MKSMALLINT(s_y); |
1932 | 1711 |
# endif |
1712 |
#endif |
|
1713 |
%}. |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1714 |
^x @ y |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1715 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1716 |
|
294 | 1717 |
!GLXWorkstation methodsFor:'clearing'! |
1718 |
||
1719 |
glxClearIn:aGLXWindowId |
|
1720 |
"clear to current color" |
|
1721 |
||
1722 |
%{ /* NOCONTEXT */ |
|
1723 |
SETWIN(aGLXWindowId) |
|
1932 | 1724 |
#ifdef OPENGL |
1725 |
#else |
|
294 | 1726 |
clear(); |
1932 | 1727 |
#endif |
294 | 1728 |
%} |
1729 |
! |
|
1730 |
||
1731 |
glxCzclearCval:cval zval:zval in:aGLXWindowId |
|
1732 |
"clear to a color (cval) and clear z buffer to zval simultaniously" |
|
1733 |
||
1734 |
%{ /* NOCONTEXT */ |
|
1932 | 1735 |
SETWIN(aGLXWindowId) |
1736 |
#ifdef OPENGL |
|
1737 |
#else |
|
1738 |
# ifdef GLX |
|
294 | 1739 |
czclear((ulong)__intVal(cval), __intVal(zval)); |
1932 | 1740 |
# endif |
1741 |
#endif |
|
1742 |
%} |
|
294 | 1743 |
! |
1744 |
||
1745 |
glxZClearIn:aGLXWindowId |
|
1746 |
"clear z buffer" |
|
1747 |
||
1748 |
%{ /* NOCONTEXT */ |
|
1932 | 1749 |
SETWIN(aGLXWindowId) |
1750 |
#ifdef OPENGL |
|
1751 |
#else |
|
1752 |
# ifdef GLX |
|
294 | 1753 |
zclear(); |
1932 | 1754 |
# endif |
1755 |
#endif |
|
1756 |
%} |
|
294 | 1757 |
! ! |
1758 |
||
1759 |
!GLXWorkstation methodsFor:'color'! |
|
1760 |
||
1761 |
glxColor:index in:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1762 |
"set the drawing color; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1763 |
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
|
1764 |
otherwise, better results are expected with float values." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1765 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1766 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1767 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1768 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1769 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1770 |
#else |
294 | 1771 |
if (__isSmallInteger(index)) { |
1772 |
color((Colorindex)(__intVal(index))); |
|
1932 | 1773 |
RETURN (self); |
294 | 1774 |
} |
1775 |
if (__isFloat(index)) { |
|
1776 |
colorf((float)(_floatVal(index))); |
|
1932 | 1777 |
RETURN (self); |
294 | 1778 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1779 |
#endif |
1932 | 1780 |
%} |
294 | 1781 |
! |
1782 |
||
1783 |
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
|
1784 |
"set the drawing color, including alpha value. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1785 |
The args must be integer values within 0..255" |
294 | 1786 |
|
1787 |
%{ /* NOCONTEXT */ |
|
1788 |
short s_r, s_g, s_b, s_a; |
|
1789 |
||
1790 |
_INT_(r, s_r); |
|
1791 |
_INT_(g, s_g); |
|
1792 |
_INT_(b, s_b); |
|
1793 |
_INT_(a, s_a); |
|
1794 |
SETWIN(aGLXWindowId) |
|
1932 | 1795 |
#ifdef GLX |
294 | 1796 |
cpack((((((s_a<<8) | s_b) << 8) | s_g) << 8) | s_r); |
1932 | 1797 |
#endif |
1798 |
%} |
|
294 | 1799 |
! |
1800 |
||
1801 |
glxColorRed:r green:g blue:b in:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1802 |
"set the drawing color. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1803 |
The args must be integer values in 0..255" |
294 | 1804 |
|
1805 |
%{ /* NOCONTEXT */ |
|
1806 |
short s_r, s_g, s_b; |
|
1807 |
||
1808 |
_INT_(r, s_r); |
|
1809 |
_INT_(g, s_g); |
|
1810 |
_INT_(b, s_b); |
|
1811 |
SETWIN(aGLXWindowId) |
|
1932 | 1812 |
#ifdef GLX |
294 | 1813 |
RGBcolor(s_r, s_g, s_b); |
1932 | 1814 |
#endif |
1815 |
%} |
|
294 | 1816 |
! |
1817 |
||
528 | 1818 |
glxLrgbrangeRmin: rmin gmin: gmin bmin: bmin rmax: rmax gmax: gmax bmax: bmax |
1819 |
znear: znear zfar: zfar in: aGLXWindowId |
|
1820 |
||
1821 |
%{ /* NOCONTEXT */ |
|
1932 | 1822 |
SETWIN(aGLXWindowId) |
1823 |
#ifdef GLX |
|
528 | 1824 |
lRGBrange(_shortVal(rmin), _shortVal(gmin), _shortVal(bmin), |
1825 |
_shortVal(rmax), _shortVal(gmax), _shortVal(bmax), |
|
1826 |
_longVal(znear), _longVal(zfar)); |
|
1932 | 1827 |
#endif |
1828 |
%} |
|
528 | 1829 |
! |
1830 |
||
1831 |
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
|
1832 |
"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
|
1833 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1834 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1835 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1836 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1837 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1838 |
#else |
528 | 1839 |
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
|
1840 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1841 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1842 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1843 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1844 |
glxTextcolor:tcolor in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1845 |
"change the color used for text drawing" |
294 | 1846 |
|
1847 |
%{ /* NOCONTEXT */ |
|
1932 | 1848 |
SETWIN(aGLXWindowId) |
1849 |
#ifdef GLX |
|
294 | 1850 |
textcolor(_colorindexVal(tcolor)); |
1932 | 1851 |
#endif |
1852 |
%} |
|
294 | 1853 |
! ! |
1854 |
||
528 | 1855 |
!GLXWorkstation methodsFor:'curves'! |
1856 |
||
1857 |
glxCurvebasis: basid in: aGLXWindowId |
|
1858 |
"sets the basis type of curves" |
|
1859 |
||
1860 |
%{ /* NOCONTEXT */ |
|
1861 |
SETWIN(aGLXWindowId) |
|
1932 | 1862 |
#ifdef GLX |
528 | 1863 |
curvebasis(_shortVal(basid)); |
1932 | 1864 |
#endif |
528 | 1865 |
%} |
1866 |
||
1867 |
"Modified: 19.3.1996 / 18:47:09 / cg" |
|
1868 |
! |
|
1869 |
||
1870 |
glxCurveit: iterationcount in: aGLXWindowId |
|
1871 |
"Iterates the top matrix on the stack as a forward difference |
|
1872 |
matrix, drawing as it goes along." |
|
1873 |
||
1874 |
%{ /* NOCONTEXT */ |
|
1875 |
SETWIN(aGLXWindowId) |
|
1932 | 1876 |
#ifdef GLX |
528 | 1877 |
curveit(_shortVal(iterationcount)); |
1932 | 1878 |
#endif |
528 | 1879 |
%} |
1880 |
||
1881 |
"Modified: 19.3.1996 / 18:48:57 / cg" |
|
1882 |
! |
|
1883 |
||
1884 |
glxCurveprecision: nsegments in: aGLXWindowId |
|
1885 |
"sets the number of line segments that make up a curve segment" |
|
1886 |
||
1887 |
%{ /* NOCONTEXT */ |
|
1888 |
SETWIN(aGLXWindowId) |
|
1932 | 1889 |
#ifdef GLX |
528 | 1890 |
curveprecision(_shortVal(nsegments)); |
1932 | 1891 |
#endif |
528 | 1892 |
%} |
1893 |
||
1894 |
"Modified: 19.3.1996 / 18:47:43 / cg" |
|
1895 |
! ! |
|
1896 |
||
294 | 1897 |
!GLXWorkstation methodsFor:'double buffering'! |
1898 |
||
1899 |
glxBackBufferIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1900 |
"switch to back buffer drawing - turning frontbuffer drawing off" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1901 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1902 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1903 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1904 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1905 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1906 |
# ifdef GLX |
294 | 1907 |
frontbuffer(FALSE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1908 |
# endif |
294 | 1909 |
backbuffer(TRUE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1910 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1911 |
%} |
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 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1914 |
glxBackbuffer:b in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1915 |
"turn backBuffer drawing on/off. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1916 |
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
|
1917 |
... enabling the backbuffer automatically disables frontbuffer drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1918 |
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
|
1919 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1920 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1921 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1922 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1923 |
#else |
294 | 1924 |
backbuffer(_booleanVal(b)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1925 |
#endif |
294 | 1926 |
%} |
528 | 1927 |
|
1928 |
"Modified: 19.3.1996 / 18:45:05 / cg" |
|
294 | 1929 |
! |
1930 |
||
1931 |
glxDoubleBufferIn:aGLXWindowId |
|
1932 |
"set double buffer mode" |
|
1933 |
||
1934 |
%{ /* NOCONTEXT */ |
|
1935 |
SETWIN(aGLXWindowId) |
|
1932 | 1936 |
#ifdef OPENGL |
1937 |
#else |
|
294 | 1938 |
doublebuffer(); |
1932 | 1939 |
#endif |
294 | 1940 |
%} |
1941 |
! |
|
1942 |
||
1943 |
glxFrontBufferIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1944 |
"switch to front buffer drawing - turning backbuffer drawing off" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1945 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1946 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1947 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1948 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1949 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1950 |
# ifdef GLX |
294 | 1951 |
backbuffer(FALSE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1952 |
# endif |
294 | 1953 |
frontbuffer(TRUE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1954 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1955 |
%} |
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 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1958 |
glxFrontbuffer:b in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1959 |
"turn on/off frontbuffer drawing. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1960 |
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
|
1961 |
... enabling the backbuffer automatically disables frontbuffer drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1962 |
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
|
1963 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1964 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1965 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1966 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1967 |
#else |
294 | 1968 |
frontbuffer(_booleanVal(b)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1969 |
#endif |
294 | 1970 |
%} |
528 | 1971 |
|
1972 |
"Modified: 19.3.1996 / 18:45:31 / cg" |
|
294 | 1973 |
! |
1974 |
||
1975 |
glxSingleBufferIn: aGLXWindowId |
|
1976 |
"set single buffer mode" |
|
1977 |
||
1978 |
%{ /* NOCONTEXT */ |
|
1979 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1980 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1981 |
#else |
294 | 1982 |
singlebuffer(); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1983 |
#endif |
294 | 1984 |
%} |
1985 |
! |
|
1986 |
||
1987 |
glxSwapBuffersIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1988 |
"swap the back and front buffers. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1989 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1990 |
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
|
1991 |
displayed and swap them for every frame." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1992 |
|
1903 | 1993 |
%{ /* UNLIMITEDSTACK */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1994 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1995 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1996 |
#else |
294 | 1997 |
swapbuffers(); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1998 |
#endif |
294 | 1999 |
%} |
528 | 2000 |
|
2001 |
"Modified: 19.3.1996 / 18:45:47 / cg" |
|
294 | 2002 |
! ! |
2003 |
||
2004 |
!GLXWorkstation methodsFor:'flat drawing'! |
|
2005 |
||
2006 |
glxBeginClosedLineIn:aGLXWindowId |
|
2007 |
"start a closed line" |
|
2008 |
||
2009 |
%{ /* NOCONTEXT */ |
|
1932 | 2010 |
#ifdef OPENGL |
2011 |
#else |
|
294 | 2012 |
SETWIN(aGLXWindowId) |
2013 |
bgnclosedline(); |
|
1932 | 2014 |
#endif |
294 | 2015 |
%} |
2016 |
! |
|
2017 |
||
2018 |
glxBeginLineIn:aGLXWindowId |
|
2019 |
"start a line group" |
|
2020 |
||
2075 | 2021 |
%{ /* NOCONTEXT STACK:32000 */ |
1932 | 2022 |
#ifdef OPENGL |
2023 |
#else |
|
294 | 2024 |
SETWIN(aGLXWindowId) |
2025 |
bgnline(); |
|
1932 | 2026 |
#endif |
294 | 2027 |
%} |
2028 |
! |
|
2029 |
||
2030 |
glxBeginPointIn:aGLXWindowId |
|
2031 |
"start a point-group" |
|
2032 |
||
2033 |
%{ /* NOCONTEXT */ |
|
1932 | 2034 |
#ifdef OPENGL |
2035 |
#else |
|
294 | 2036 |
SETWIN(aGLXWindowId) |
2037 |
bgnpoint(); |
|
1932 | 2038 |
#endif |
294 | 2039 |
%} |
2040 |
! |
|
2041 |
||
2042 |
glxBeginPolygonIn:aGLXWindowId |
|
2043 |
"start a polygon" |
|
2044 |
||
2045 |
%{ /* NOCONTEXT */ |
|
1932 | 2046 |
#ifdef OPENGL |
2047 |
#else |
|
294 | 2048 |
SETWIN(aGLXWindowId) |
2049 |
bgnpolygon(); |
|
1932 | 2050 |
#endif |
294 | 2051 |
%} |
2052 |
! |
|
2053 |
||
2054 |
glxBeginQuadrilateralStripIn:aGLXWindowId |
|
2055 |
"start a quadrilateral strip" |
|
2056 |
||
2057 |
%{ /* NOCONTEXT */ |
|
1932 | 2058 |
#ifdef OPENGL |
2059 |
#else |
|
294 | 2060 |
SETWIN(aGLXWindowId) |
2061 |
bgnqstrip(); |
|
1932 | 2062 |
#endif |
294 | 2063 |
%} |
2064 |
! |
|
2065 |
||
2066 |
glxBeginTriangleMeshIn:aGLXWindowId |
|
2067 |
"start a triangle mesh" |
|
2068 |
||
2069 |
%{ /* NOCONTEXT */ |
|
1932 | 2070 |
#ifdef OPENGL |
2071 |
#else |
|
294 | 2072 |
SETWIN(aGLXWindowId) |
2073 |
bgntmesh(); |
|
1932 | 2074 |
#endif |
294 | 2075 |
%} |
2076 |
! |
|
2077 |
||
2078 |
glxEndClosedLineIn:aGLXWindowId |
|
2079 |
"end a closed line" |
|
2080 |
||
2081 |
%{ /* NOCONTEXT */ |
|
1932 | 2082 |
#ifdef OPENGL |
2083 |
#else |
|
294 | 2084 |
SETWIN(aGLXWindowId) |
2085 |
endclosedline(); |
|
1932 | 2086 |
#endif |
294 | 2087 |
%} |
2088 |
! |
|
2089 |
||
2090 |
glxEndLineIn:aGLXWindowId |
|
2091 |
"end a line group" |
|
2092 |
||
2075 | 2093 |
%{ /* NOCONTEXT STACK:32000 */ |
1932 | 2094 |
#ifdef OPENGL |
2095 |
#else |
|
294 | 2096 |
SETWIN(aGLXWindowId) |
2097 |
endline(); |
|
1932 | 2098 |
#endif |
294 | 2099 |
%} |
2100 |
! |
|
2101 |
||
2102 |
glxEndPointIn:aGLXWindowId |
|
2103 |
"end a point group" |
|
2104 |
||
2105 |
%{ /* NOCONTEXT */ |
|
1932 | 2106 |
#ifdef OPENGL |
2107 |
#else |
|
294 | 2108 |
SETWIN(aGLXWindowId) |
2109 |
endpoint(); |
|
1932 | 2110 |
#endif |
294 | 2111 |
%} |
2112 |
! |
|
2113 |
||
2114 |
glxEndPolygonIn:aGLXWindowId |
|
2115 |
"end a polygon" |
|
2116 |
||
2117 |
%{ /* NOCONTEXT */ |
|
1932 | 2118 |
#ifdef OPENGL |
2119 |
#else |
|
294 | 2120 |
SETWIN(aGLXWindowId) |
2121 |
endpolygon(); |
|
1932 | 2122 |
#endif |
294 | 2123 |
%} |
2124 |
! |
|
2125 |
||
2126 |
glxEndQuadrilateralStripIn:aGLXWindowId |
|
2127 |
"end a quadrilateral strip" |
|
2128 |
||
2129 |
%{ /* NOCONTEXT */ |
|
1932 | 2130 |
#ifdef OPENGL |
2131 |
#else |
|
294 | 2132 |
SETWIN(aGLXWindowId) |
2133 |
endqstrip(); |
|
1932 | 2134 |
#endif |
294 | 2135 |
%} |
2136 |
! |
|
2137 |
||
2138 |
glxEndTriangleMeshIn:aGLXWindowId |
|
2139 |
"end a triangle mesh" |
|
2140 |
||
2141 |
%{ /* NOCONTEXT */ |
|
1932 | 2142 |
#ifdef OPENGL |
2143 |
#else |
|
294 | 2144 |
SETWIN(aGLXWindowId) |
2145 |
endtmesh(); |
|
1932 | 2146 |
#endif |
168 | 2147 |
%} |
2148 |
! ! |
|
2149 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2150 |
!GLXWorkstation methodsFor:'graphics position'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2151 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2152 |
glxMove2:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2153 |
"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
|
2154 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2155 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2156 |
float vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2157 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2158 |
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
|
2159 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2160 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2161 |
#else |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2162 |
move2((Coord)(c_v[0]), (Coord)(c_v[1])); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2163 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2164 |
#endif |
537
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2167 |
"Modified: 22.3.1996 / 18:15:23 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2168 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2169 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2170 |
glxMove2X: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2171 |
"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
|
2172 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2173 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2174 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2175 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2176 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2177 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2178 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2179 |
SETWIN(aGLXWindowId) |
1932 | 2180 |
#ifdef OPENGL |
2181 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2182 |
move2(c_x, c_y); |
1932 | 2183 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2184 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2185 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2186 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2187 |
"Modified: 22.3.1996 / 18:15:02 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2188 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2189 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2190 |
glxMove2iX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2191 |
"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
|
2192 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2193 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2194 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2195 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2196 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2197 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2198 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2199 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2200 |
SETWIN(aGLXWindowId) |
1932 | 2201 |
#ifdef OPENGL |
2202 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2203 |
move2i(c_x, c_y); |
1932 | 2204 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2205 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2206 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2207 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2208 |
"Modified: 22.3.1996 / 18:15:08 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2209 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2210 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2211 |
glxMove2sX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2212 |
"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
|
2213 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2214 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2215 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2216 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2217 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2218 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2219 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2220 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2221 |
SETWIN(aGLXWindowId) |
1932 | 2222 |
#ifdef OPENGL |
2223 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2224 |
move2s(c_x, c_y); |
1932 | 2225 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2226 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2227 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2228 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2229 |
"Modified: 22.3.1996 / 18:15:13 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2230 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2231 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2232 |
glxMove:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2233 |
"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
|
2234 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2235 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2236 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2237 |
float vec[3], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2238 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2239 |
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
|
2240 |
SETWIN(aGLXWindowId) |
1932 | 2241 |
#ifdef OPENGL |
2242 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2243 |
move((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
1932 | 2244 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2245 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2246 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2247 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2248 |
"Modified: 22.3.1996 / 18:14:29 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2249 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2250 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2251 |
glxMoveX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2252 |
"change the graphics position to a 3D point, as passed in x/y/z" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2253 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2254 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2255 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2256 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2257 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2258 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2259 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2260 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2261 |
SETWIN(aGLXWindowId) |
1932 | 2262 |
#ifdef OPENGL |
2263 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2264 |
move(c_x, c_y, c_z); |
1932 | 2265 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2266 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2267 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2268 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2269 |
"Modified: 22.3.1996 / 18:14:38 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2270 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2271 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2272 |
glxMoveiX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2273 |
"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
|
2274 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2275 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2276 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2277 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2278 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2279 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2280 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2281 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2282 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2283 |
SETWIN(aGLXWindowId) |
1932 | 2284 |
#ifdef OPENGL |
2285 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2286 |
movei(c_x, c_y, c_z); |
1932 | 2287 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2288 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2289 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2290 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2291 |
"Modified: 22.3.1996 / 18:14:44 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2292 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2293 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2294 |
glxMovesX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2295 |
"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
|
2296 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2297 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2298 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2299 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2300 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2301 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2302 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2303 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2304 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2305 |
SETWIN(aGLXWindowId) |
1932 | 2306 |
#ifdef OPENGL |
2307 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2308 |
moves(c_x, c_y, c_z); |
1932 | 2309 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2310 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2311 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2312 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2313 |
"Modified: 22.3.1996 / 18:14:48 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2314 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2315 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2316 |
glxRmv2:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2317 |
"change the graphics position to a 2D point, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2318 |
the relative distance is passed in vector v" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2319 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2320 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2321 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2322 |
float vec[2], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2323 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2324 |
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
|
2325 |
SETWIN(aGLXWindowId) |
1932 | 2326 |
#ifdef OPENGL |
2327 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2328 |
rmv2((Coord)(c_v[0]), (Coord)(c_v[1])); |
1932 | 2329 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2330 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2331 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2332 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2333 |
"Modified: 22.3.1996 / 18:15:57 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2334 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2335 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2336 |
glxRmv2X: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2337 |
"change the graphics position to a 2D point, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2338 |
the relative distance is passed in x/y" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2339 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2340 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2341 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2342 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2343 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2344 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2345 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2346 |
SETWIN(aGLXWindowId) |
1932 | 2347 |
#ifdef OPENGL |
2348 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2349 |
rmv2(c_x, c_y); |
1932 | 2350 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2351 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2352 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2353 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2354 |
"Modified: 22.3.1996 / 18:16:42 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2355 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2356 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2357 |
glxRmv2iX: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2358 |
"change the graphics position to a 2D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2359 |
the relative distance is passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2360 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2361 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2362 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2363 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2364 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2365 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2366 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2367 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2368 |
SETWIN(aGLXWindowId) |
1932 | 2369 |
#ifdef OPENGL |
2370 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2371 |
rmv2i(c_x, c_y); |
1932 | 2372 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2373 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2374 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2375 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2376 |
"Modified: 22.3.1996 / 18:16:39 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2377 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2378 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2379 |
glxRmv2sX: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2380 |
"change the graphics position to a 2D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2381 |
the relative distance is passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2382 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2383 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2384 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2385 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2386 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2387 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2388 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2389 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2390 |
SETWIN(aGLXWindowId) |
1932 | 2391 |
#ifdef OPENGL |
2392 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2393 |
rmv2s(c_x, c_y); |
1932 | 2394 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2395 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2396 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2397 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2398 |
"Modified: 22.3.1996 / 18:16:33 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2399 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2400 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2401 |
glxRmv:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2402 |
"change the graphics position to a 3D point, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2403 |
the relative distance is passed in vector v" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2404 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2405 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2406 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2407 |
float vec[3], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2408 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2409 |
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
|
2410 |
SETWIN(aGLXWindowId) |
1932 | 2411 |
#ifdef OPENGL |
2412 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2413 |
rmv((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
1932 | 2414 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2415 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2416 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2417 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2418 |
"Modified: 22.3.1996 / 18:16:08 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2419 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2420 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2421 |
glxRmvX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2422 |
"change the graphics position to a 3D point, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2423 |
the relative distance is passed in x/y/z" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2424 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2425 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2426 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2427 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2428 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2429 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2430 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2431 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2432 |
SETWIN(aGLXWindowId) |
1932 | 2433 |
#ifdef OPENGL |
2434 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2435 |
rmv(c_x, c_y, c_z); |
1932 | 2436 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2437 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2438 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2439 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2440 |
"Modified: 22.3.1996 / 18:16:16 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2441 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2442 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2443 |
glxRmviX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2444 |
"change the graphics position to a 3D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2445 |
the relative distance is passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2446 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2447 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2448 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2449 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2450 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2451 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2452 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2453 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2454 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2455 |
SETWIN(aGLXWindowId) |
1932 | 2456 |
#ifdef OPENGL |
2457 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2458 |
rmvi(c_x, c_y, c_z); |
1932 | 2459 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2460 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2461 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2462 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2463 |
"Modified: 22.3.1996 / 18:16:21 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2464 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2465 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2466 |
glxRmvsX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2467 |
"change the graphics position to a 3D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2468 |
the relative distance is passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2469 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2470 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2471 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2472 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2473 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2474 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2475 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2476 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2477 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2478 |
SETWIN(aGLXWindowId) |
1932 | 2479 |
#ifdef OPENGL |
2480 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2481 |
rmvs(c_x, c_y, c_z); |
1932 | 2482 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2483 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2484 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2485 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2486 |
"Modified: 22.3.1996 / 18:16:25 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2487 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2488 |
|
168 | 2489 |
!GLXWorkstation methodsFor:'initialization'! |
2490 |
||
2491 |
initializeFor:aDisplayName |
|
169 | 2492 |
(super initializeFor:aDisplayName) isNil ifTrue:[^ nil]. |
168 | 2493 |
%{ |
2494 |
if (_INST(displayId) != nil) { |
|
185 | 2495 |
XSetErrorHandler(__XErrorHandler__); |
2496 |
} |
|
2497 |
%} |
|
2498 |
! |
|
2499 |
||
2500 |
initializeScreenProperties |
|
2501 |
super initializeScreenProperties. |
|
2502 |
||
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2503 |
"/ 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
|
2504 |
"/ 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
|
2505 |
"/ 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
|
2506 |
"/ 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
|
2507 |
"/ 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
|
2508 |
"/ 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
|
2509 |
"/ 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
|
2510 |
"/ have no documentation). |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2511 |
"/ 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
|
2512 |
"/ 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
|
2513 |
"/ 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
|
2514 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2515 |
(self isTrueGL and:[ForceGL ~~ true]) ifTrue:[ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2516 |
glOK := (displayName = ':0') or:[displayName = ':0.0']. |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2517 |
] ifFalse:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2518 |
glOK := true. |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2519 |
]. |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2520 |
|
185 | 2521 |
%{ |
2522 |
Display *dpy = myDpy; |
|
2523 |
int dummy; |
|
2524 |
||
2525 |
if (ISCONNECTED) { |
|
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2526 |
_INST(hasStereoExtension) = false; |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2527 |
|
1932 | 2528 |
#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
|
2529 |
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
|
2530 |
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
|
2531 |
_INST(hasStereoExtension) = true; |
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2532 |
} |
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2533 |
#endif |
168 | 2534 |
} |
2535 |
%} |
|
2536 |
! ! |
|
2537 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2538 |
!GLXWorkstation methodsFor:'lines'! |
528 | 2539 |
|
2540 |
glxDeflinestyleN: n ls: ls in: aGLXWindowId |
|
2541 |
"define a line style" |
|
2542 |
||
2543 |
%{ /* NOCONTEXT */ |
|
1932 | 2544 |
SETWIN(aGLXWindowId) |
2545 |
#ifdef OPENGL |
|
2546 |
#else |
|
528 | 2547 |
deflinestyle(_shortVal(n), _linestyleVal(ls)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2548 |
#endif |
528 | 2549 |
%} |
2550 |
! |
|
2551 |
||
2552 |
glxDraw2:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2553 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2554 |
to a new 2D position, passed in vector v." |
528 | 2555 |
|
2556 |
%{ /* NOCONTEXT */ |
|
2557 |
float vec[2], *c_v; |
|
2558 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2559 |
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
|
2560 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2561 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2562 |
#else |
528 | 2563 |
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
|
2564 |
#endif |
528 | 2565 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2566 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2567 |
"Modified: 22.3.1996 / 18:03:29 / cg" |
528 | 2568 |
! |
2569 |
||
2570 |
glxDraw2X: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2571 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2572 |
to a new 2D position, passed in x/y." |
528 | 2573 |
|
2574 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2575 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2576 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2577 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2578 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2579 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2580 |
SETWIN(aGLXWindowId) |
1932 | 2581 |
#ifdef OPENGL |
2582 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2583 |
draw2(c_x, c_y); |
1932 | 2584 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2585 |
} |
528 | 2586 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2587 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2588 |
"Modified: 22.3.1996 / 18:03:50 / cg" |
528 | 2589 |
! |
2590 |
||
2591 |
glxDraw2iX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2592 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2593 |
to a new 2D position, passed in x/y." |
528 | 2594 |
|
2595 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2596 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2597 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2598 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2599 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2600 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2601 |
SETWIN(aGLXWindowId) |
1932 | 2602 |
#ifdef OPENGL |
2603 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2604 |
draw2i(c_x, c_y); |
1932 | 2605 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2606 |
} |
528 | 2607 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2608 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2609 |
"Modified: 22.3.1996 / 18:04:07 / cg" |
528 | 2610 |
! |
2611 |
||
2612 |
glxDraw2sX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2613 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2614 |
to a new 2D position, passed in x/y." |
528 | 2615 |
|
2616 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2617 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2618 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2619 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2620 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2621 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2622 |
SETWIN(aGLXWindowId) |
1932 | 2623 |
#ifdef OPENGL |
2624 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2625 |
draw2s(c_x, c_y); |
1932 | 2626 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2627 |
} |
528 | 2628 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2629 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2630 |
"Modified: 22.3.1996 / 18:04:19 / cg" |
528 | 2631 |
! |
2632 |
||
2633 |
glxDraw:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2634 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2635 |
to a new 3D position, passed in vector v." |
528 | 2636 |
|
2637 |
%{ /* NOCONTEXT */ |
|
2638 |
float vec[3], *c_v; |
|
2639 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2640 |
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
|
2641 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2642 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2643 |
#else |
528 | 2644 |
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
|
2645 |
#endif |
528 | 2646 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2647 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2648 |
"Modified: 22.3.1996 / 18:04:34 / cg" |
528 | 2649 |
! |
2650 |
||
2651 |
glxDrawX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2652 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2653 |
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
|
2654 |
The arguments may be floats, fractions or smallIntegers" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2655 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2656 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2657 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2658 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2659 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2660 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2661 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2662 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2663 |
SETWIN(aGLXWindowId) |
1932 | 2664 |
#ifdef OPENGL |
2665 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2666 |
draw(c_x, c_y, c_z); |
1932 | 2667 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2668 |
} |
528 | 2669 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2670 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2671 |
"Modified: 22.3.1996 / 18:04:46 / cg" |
528 | 2672 |
! |
2673 |
||
2674 |
glxDrawiX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2675 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2676 |
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
|
2677 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2678 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2679 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2680 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2681 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2682 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2683 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2684 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2685 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2686 |
SETWIN(aGLXWindowId) |
1932 | 2687 |
#ifdef OPENGL |
2688 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2689 |
drawi(c_x, c_y, c_z); |
1932 | 2690 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2691 |
} |
528 | 2692 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2693 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2694 |
"Modified: 22.3.1996 / 18:04:54 / cg" |
528 | 2695 |
! |
2696 |
||
2697 |
glxDrawsX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2698 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2699 |
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
|
2700 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2701 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2702 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2703 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2704 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2705 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2706 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2707 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2708 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2709 |
SETWIN(aGLXWindowId) |
1932 | 2710 |
#ifdef OPENGL |
2711 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2712 |
draws(c_x, c_y, c_z); |
1932 | 2713 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2714 |
} |
528 | 2715 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2716 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2717 |
"Modified: 22.3.1996 / 18:05:01 / cg" |
528 | 2718 |
! |
2719 |
||
2720 |
glxLinewidth: n in: aGLXWindowId |
|
2721 |
"set the linewidth" |
|
2722 |
||
2723 |
%{ /* NOCONTEXT */ |
|
2724 |
SETWIN(aGLXWindowId) |
|
1932 | 2725 |
#ifdef OPENGL |
2726 |
#else |
|
528 | 2727 |
linewidth(_shortVal(n)); |
1932 | 2728 |
#endif |
528 | 2729 |
%} |
2730 |
! |
|
2731 |
||
2732 |
glxLinewidthf: n in: aGLXWindowId |
|
2733 |
"set the linewidth" |
|
2734 |
||
2735 |
%{ /* NOCONTEXT */ |
|
2736 |
SETWIN(aGLXWindowId) |
|
1932 | 2737 |
#ifdef OPENGL |
2738 |
#else |
|
528 | 2739 |
linewidthf(_floatVal(n)); |
1932 | 2740 |
#endif |
528 | 2741 |
RETURN (true); |
2742 |
%} |
|
2743 |
! |
|
2744 |
||
2745 |
glxRdr2:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2746 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2747 |
to a new 2D position, passing the relative distance in the vector v." |
528 | 2748 |
|
2749 |
%{ /* NOCONTEXT */ |
|
2750 |
float vec[2], *c_v; |
|
2751 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2752 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
528 | 2753 |
SETWIN(aGLXWindowId) |
1932 | 2754 |
#ifdef OPENGL |
2755 |
#else |
|
528 | 2756 |
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
|
2757 |
#endif |
528 | 2758 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2759 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2760 |
"Modified: 22.3.1996 / 18:05:54 / cg" |
528 | 2761 |
! |
2762 |
||
2763 |
glxRdr2X: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2764 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2765 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2766 |
|
2767 |
%{ /* NOCONTEXT */ |
|
2768 |
Coord c_x, c_y; |
|
2769 |
||
2770 |
_COORD_ (x, c_x) |
|
2771 |
_COORD_ (y, c_y) |
|
2772 |
SETWIN(aGLXWindowId) |
|
1932 | 2773 |
#ifdef OPENGL |
2774 |
#else |
|
528 | 2775 |
rdr2(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2776 |
#endif |
528 | 2777 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2778 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2779 |
"Modified: 22.3.1996 / 18:06:20 / cg" |
528 | 2780 |
! |
2781 |
||
2782 |
glxRdr2iX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2783 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2784 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2785 |
|
2786 |
%{ /* NOCONTEXT */ |
|
2787 |
Icoord c_x, c_y; |
|
2788 |
||
2789 |
_ICOORD_ (x, c_x) |
|
2790 |
_ICOORD_ (y, c_y) |
|
2791 |
SETWIN(aGLXWindowId) |
|
1932 | 2792 |
#ifdef OPENGL |
2793 |
#else |
|
528 | 2794 |
rdr2i(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2795 |
#endif |
528 | 2796 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2797 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2798 |
"Modified: 22.3.1996 / 18:06:28 / cg" |
528 | 2799 |
! |
2800 |
||
2801 |
glxRdr2sX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2802 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2803 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2804 |
|
2805 |
%{ /* NOCONTEXT */ |
|
2806 |
Scoord c_x, c_y; |
|
2807 |
||
2808 |
_SCOORD_ (x, c_x) |
|
2809 |
_SCOORD_ (y, c_y) |
|
2810 |
SETWIN(aGLXWindowId) |
|
1932 | 2811 |
#ifdef OPENGL |
2812 |
#else |
|
528 | 2813 |
rdr2s(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2814 |
#endif |
528 | 2815 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2816 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2817 |
"Modified: 22.3.1996 / 18:06:34 / cg" |
528 | 2818 |
! |
2819 |
||
2820 |
glxRdr:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2821 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2822 |
to a new 3D position, passing the relative distance in the vector v." |
528 | 2823 |
|
2824 |
%{ /* NOCONTEXT */ |
|
2825 |
float vec[3], *c_v; |
|
2826 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2827 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
528 | 2828 |
SETWIN(aGLXWindowId) |
1932 | 2829 |
#ifdef OPENGL |
2830 |
#else |
|
528 | 2831 |
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
|
2832 |
#endif |
528 | 2833 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2834 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2835 |
"Modified: 22.3.1996 / 18:06:07 / cg" |
528 | 2836 |
! |
2837 |
||
2838 |
glxRdrX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2839 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2840 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2841 |
|
2842 |
%{ /* NOCONTEXT */ |
|
2843 |
Coord c_x, c_y, c_z; |
|
2844 |
||
2845 |
_COORD_ (x, c_x) |
|
2846 |
_COORD_ (y, c_y) |
|
2847 |
_COORD_ (z, c_z) |
|
2848 |
SETWIN(aGLXWindowId) |
|
1932 | 2849 |
#ifdef OPENGL |
2850 |
#else |
|
528 | 2851 |
rdr(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2852 |
#endif |
528 | 2853 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2854 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2855 |
"Modified: 22.3.1996 / 18:06:44 / cg" |
528 | 2856 |
! |
2857 |
||
2858 |
glxRdriX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2859 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2860 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2861 |
|
2862 |
%{ /* NOCONTEXT */ |
|
2863 |
Icoord c_x, c_y, c_z; |
|
2864 |
||
2865 |
_ICOORD_ (x, c_x) |
|
2866 |
_ICOORD_ (y, c_y) |
|
2867 |
_ICOORD_ (z, c_z) |
|
2868 |
SETWIN(aGLXWindowId) |
|
1932 | 2869 |
#ifdef OPENGL |
2870 |
#else |
|
528 | 2871 |
rdri(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2872 |
#endif |
528 | 2873 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2874 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2875 |
"Modified: 22.3.1996 / 18:06:51 / cg" |
528 | 2876 |
! |
2877 |
||
2878 |
glxRdrsX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2879 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2880 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2881 |
|
2882 |
%{ /* NOCONTEXT */ |
|
2883 |
Scoord c_x, c_y, c_z; |
|
2884 |
||
2885 |
_SCOORD_ (x, c_x) |
|
2886 |
_SCOORD_ (y, c_y) |
|
2887 |
_SCOORD_ (z, c_z) |
|
2888 |
SETWIN(aGLXWindowId) |
|
1932 | 2889 |
#ifdef OPENGL |
2890 |
#else |
|
528 | 2891 |
rdrs(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2892 |
#endif |
528 | 2893 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2894 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2895 |
"Modified: 22.3.1996 / 18:06:55 / cg" |
528 | 2896 |
! |
2897 |
||
2898 |
glxSetlinestyle: index in: aGLXWindowId |
|
2899 |
"set the linestyle" |
|
2900 |
||
2901 |
%{ /* NOCONTEXT */ |
|
2902 |
SETWIN(aGLXWindowId) |
|
1932 | 2903 |
#ifdef OPENGL |
2904 |
#else |
|
528 | 2905 |
setlinestyle(_shortVal(index)); |
1932 | 2906 |
#endif |
2907 |
%} |
|
528 | 2908 |
! ! |
2909 |
||
294 | 2910 |
!GLXWorkstation methodsFor:'materials & lights'! |
2911 |
||
2912 |
glxLmbind:target index:index in:aGLXWindowId |
|
2913 |
"select a material, light or lighting model. |
|
2914 |
target must be a symbol from: #material, #backMaterial, |
|
2915 |
#light0-light7 or #lightModel." |
|
2916 |
||
2917 |
%{ /* NOCONTEXT */ |
|
2918 |
#ifdef GLX |
|
2919 |
short defType; |
|
2920 |
short i_index; |
|
2921 |
||
2922 |
if (target == @symbol(material)) |
|
2923 |
defType = MATERIAL; |
|
2924 |
else if (target == @symbol(backMaterial)) |
|
2925 |
defType = BACKMATERIAL; |
|
2926 |
else if (target == @symbol(light0)) |
|
2927 |
defType = LIGHT0; |
|
2928 |
else if (target == @symbol(light1)) |
|
2929 |
defType = LIGHT1; |
|
2930 |
else if (target == @symbol(light2)) |
|
2931 |
defType = LIGHT2; |
|
2932 |
else if (target == @symbol(light3)) |
|
2933 |
defType = LIGHT3; |
|
2934 |
else if (target == @symbol(light4)) |
|
2935 |
defType = LIGHT4; |
|
2936 |
else if (target == @symbol(light5)) |
|
2937 |
defType = LIGHT5; |
|
2938 |
else if (target == @symbol(light6)) |
|
2939 |
defType = LIGHT6; |
|
2940 |
else if (target == @symbol(light7)) |
|
2941 |
defType = LIGHT7; |
|
2942 |
else if (target == @symbol(lightModel)) |
|
2943 |
defType = LMODEL; |
|
2944 |
else { |
|
1932 | 2945 |
RETURN (nil); |
294 | 2946 |
} |
2947 |
||
2948 |
_INT_ (index, i_index); |
|
2949 |
SETWIN(aGLXWindowId) |
|
2950 |
lmbind(defType, i_index); |
|
1932 | 2951 |
#endif |
2952 |
%} |
|
294 | 2953 |
! |
2954 |
||
2955 |
glxLmdef:what index:index np:np props:props in:aGLXWindowId |
|
2956 |
"define a material, light source or lighting model; |
|
2957 |
what must be one of #material, #light or #lightModel. |
|
2958 |
props must be a FloatArray or a subclass of FloatArray" |
|
2959 |
||
2960 |
%{ /* NOCONTEXT */ |
|
2961 |
#ifdef GLX |
|
2962 |
short defType; |
|
2963 |
short i_index, i_np; |
|
2964 |
float *fp; |
|
2965 |
OBJ cls; |
|
2966 |
int ninstVars, nInstBytes; |
|
2967 |
||
2968 |
if (what == @symbol(material)) |
|
2969 |
defType = DEFMATERIAL; |
|
2970 |
else if (what == @symbol(light)) |
|
2971 |
defType = DEFLIGHT; |
|
2972 |
else if (what == @symbol(lightModel)) |
|
2973 |
defType = DEFLMODEL; |
|
2974 |
else { |
|
1932 | 2975 |
RETURN (nil); |
294 | 2976 |
} |
2977 |
||
2978 |
_INT_ (index, i_index); |
|
2979 |
_INT_ (np, i_np); |
|
2980 |
||
2981 |
if (! _isNonNilObject(props)) fp = NULL; |
|
2982 |
else { |
|
2983 |
cls = __qClass(props); |
|
350 | 2984 |
if (cls == @global(FloatArray)) |
294 | 2985 |
fp = _FloatArrayInstPtr(props)->f_element; |
2986 |
else { |
|
2987 |
if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) { |
|
2988 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
2989 |
fp = (float *) &(_InstPtr(props)->i_instvars[ninstVars]); |
|
2990 |
} else { |
|
1932 | 2991 |
RETURN (nil); |
294 | 2992 |
} |
2993 |
} |
|
2994 |
} |
|
2995 |
SETWIN(aGLXWindowId) |
|
2996 |
lmdef(defType, i_index, i_np, fp); |
|
1932 | 2997 |
#endif |
2998 |
%} |
|
294 | 2999 |
! |
3000 |
||
3001 |
glxTevbind:target index:index in:aGLXWindowId |
|
3002 |
"bind a texture environment; target must be 0 |
|
3003 |
or the symbol #env0." |
|
3004 |
||
3005 |
%{ /* NOCONTEXT */ |
|
3006 |
#ifdef GLX |
|
3007 |
long t; |
|
3008 |
||
3009 |
if (__isSmallInteger(target)) { |
|
3010 |
t = __intVal(target); |
|
3011 |
} else { |
|
3012 |
if (target == @symbol(env0)) { |
|
3013 |
t = TV_ENV0; |
|
3014 |
} else { |
|
1932 | 3015 |
RETURN (nil); |
294 | 3016 |
} |
3017 |
} |
|
3018 |
SETWIN(aGLXWindowId) |
|
3019 |
tevbind(t, __intVal(index)); |
|
1932 | 3020 |
#endif |
3021 |
%} |
|
294 | 3022 |
! |
3023 |
||
3024 |
glxTevdef:index np:np props:props in:aGLXWindowId |
|
3025 |
||
3026 |
%{ /* NOCONTEXT */ |
|
3027 |
#ifdef GLX |
|
3028 |
const float *fp; |
|
3029 |
float fbuff[30]; |
|
3030 |
||
3031 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3032 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
294 | 3033 |
tevdef(__intVal(index), __intVal(np), fp); |
1932 | 3034 |
#endif |
3035 |
%} |
|
294 | 3036 |
! |
3037 |
||
3038 |
glxTexDef2d:index nc:nc width:w height:h bits:image np:np props:props in:aGLXWindowId |
|
3039 |
"define a 2D texture. index is the 'name' of the texture; |
|
3040 |
nc is the number of components (1-4) per pixel; |
|
3041 |
w/h define the size of the texture; bits is a byteArray containing the |
|
3042 |
long-word aligned pixel data; np is the number of props found in |
|
3043 |
the floatArray props. Props must be delimited by a 0.0 entry." |
|
3044 |
||
3045 |
%{ /* NOCONTEXT */ |
|
3046 |
#ifdef GLX |
|
3047 |
unsigned char *cp; |
|
3048 |
const float *fp; |
|
3049 |
OBJ cls; |
|
3050 |
float fbuff[30]; |
|
3051 |
||
3052 |
if (__isByteArray(image)) { |
|
3053 |
cp = _ByteArrayInstPtr(image)->ba_element; |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3054 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
294 | 3055 |
|
3056 |
SETWIN(aGLXWindowId) |
|
3057 |
texdef2d(__intVal(index), __intVal(nc), __intVal(w), __intVal(h), |
|
3058 |
(const unsigned long *)cp, __intVal(np), fp); |
|
3059 |
} |
|
3060 |
#endif |
|
3061 |
%} |
|
3062 |
! |
|
3063 |
||
3064 |
glxTexDef3d:index nc:nc width:w height:h depth:d bits:image np:np props:props in:aGLXWindowId |
|
3065 |
"define a 3D texture. index is the 'name' of the texture; |
|
3066 |
nc is the number of components (1-4) per pixel; |
|
3067 |
w/h/d define the size of the texture; bits is a byteArray containing the |
|
3068 |
long-word aligned pixel data; np is the number of props found in |
|
3069 |
the floatArray props. Props must be delimited by a 0.0 entry." |
|
3070 |
||
3071 |
%{ /* NOCONTEXT */ |
|
3072 |
#ifdef GLX |
|
3073 |
unsigned char *cp; |
|
3074 |
const float *fp; |
|
3075 |
OBJ cls; |
|
3076 |
float fbuff[30]; |
|
3077 |
||
3078 |
if (__isByteArray(image)) { |
|
3079 |
cp = _ByteArrayInstPtr(image)->ba_element; |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3080 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
294 | 3081 |
|
3082 |
SETWIN(aGLXWindowId) |
|
3083 |
texdef3d(__intVal(index), __intVal(nc), __intVal(w), __intVal(h), |
|
3084 |
__intVal(d), |
|
3085 |
(const unsigned long *)cp, __intVal(np), fp); |
|
3086 |
} |
|
3087 |
#endif |
|
3088 |
%} |
|
3089 |
! |
|
3090 |
||
3091 |
glxTexbind:target index:index in:aGLXWindowId |
|
3092 |
"bind a texture; target must be an integer or one |
|
3093 |
of the symbols #texture0, #textureDetail or #textureIdle." |
|
3094 |
||
3095 |
%{ /* NOCONTEXT */ |
|
3096 |
#ifdef GLX |
|
3097 |
long t; |
|
3098 |
||
3099 |
if (__isSmallInteger(target)) { |
|
3100 |
t = __intVal(target); |
|
3101 |
} else { |
|
3102 |
if (target == @symbol(texture0)) { |
|
3103 |
t = TX_TEXTURE_0; |
|
3104 |
} else if (target == @symbol(textureDetail)) { |
|
3105 |
t = TX_TEXTURE_DETAIL; |
|
3106 |
} else if (target == @symbol(textureIdle)) { |
|
3107 |
t = TX_TEXTURE_IDLE; |
|
3108 |
} else { |
|
1932 | 3109 |
RETURN (nil); |
294 | 3110 |
} |
3111 |
} |
|
3112 |
SETWIN(aGLXWindowId) |
|
3113 |
texbind(t, __intVal(index)); |
|
1932 | 3114 |
#endif |
3115 |
%} |
|
294 | 3116 |
! ! |
3117 |
||
3118 |
!GLXWorkstation methodsFor:'matrix stack'! |
|
3119 |
||
3120 |
glxGetMatrix:arrayOf16Floats in:aGLXWindowId |
|
3121 |
"argument must be an array (a matrix) of 16 floats. The current matrix |
|
3122 |
will be stored into that." |
|
3123 |
||
3124 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3125 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3126 |
#else |
294 | 3127 |
Matrix matrix; |
3128 |
||
3129 |
SETWIN(aGLXWindowId) |
|
3130 |
getmatrix(matrix); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3131 |
if (! __glx_putFloatsFromInto(matrix, arrayOf16Floats, 16)) RETURN(false); |
1932 | 3132 |
#endif |
3133 |
%} |
|
294 | 3134 |
! |
3135 |
||
3136 |
glxLoadMatrix:arrayOf16Floats in:aGLXWindowId |
|
3137 |
"argument must be an array(a matrix) of 16 floats. The current matrix |
|
3138 |
will be loaded from that." |
|
3139 |
||
3140 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3141 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3142 |
#else |
294 | 3143 |
Matrix matrix; |
3144 |
Matrix *m; |
|
3145 |
||
2814 | 3146 |
if (! (m = __glx_getFloatsFromMatrixInto(arrayOf16Floats, matrix))) RETURN (false); |
294 | 3147 |
SETWIN(aGLXWindowId) |
3148 |
loadmatrix(*m); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3149 |
#endif |
294 | 3150 |
%} |
3151 |
! |
|
3152 |
||
3153 |
glxMultMatrix:arrayOf16Floats in:aGLXWindowId |
|
3154 |
"argument must be an array(a matrix) of 16 floats containing a |
|
3155 |
matrix to multiply into the current matrix." |
|
3156 |
||
3157 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3158 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3159 |
#else |
294 | 3160 |
Matrix matrix; |
3161 |
Matrix *m; |
|
3162 |
||
2814 | 3163 |
if (! (m = __glx_getFloatsFromMatrixInto(arrayOf16Floats, matrix))) RETURN (false); |
294 | 3164 |
SETWIN(aGLXWindowId) |
3165 |
multmatrix(*m); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3166 |
#endif |
294 | 3167 |
%} |
3168 |
! |
|
3169 |
||
3170 |
glxPopmatrixIn:aGLXWindowId |
|
3171 |
"pop transformation stack" |
|
3172 |
||
3173 |
%{ /* NOCONTEXT */ |
|
3174 |
SETWIN(aGLXWindowId) |
|
1932 | 3175 |
#ifdef OPENGL |
3176 |
#else |
|
294 | 3177 |
popmatrix(); |
1932 | 3178 |
#endif |
294 | 3179 |
%} |
3180 |
! |
|
3181 |
||
3182 |
glxPushmatrixIn:aGLXWindowId |
|
3183 |
"push down transformation stack" |
|
3184 |
||
3185 |
%{ /* NOCONTEXT */ |
|
3186 |
SETWIN(aGLXWindowId) |
|
1932 | 3187 |
#ifdef OPENGL |
3188 |
#else |
|
294 | 3189 |
pushmatrix(); |
1932 | 3190 |
#endif |
294 | 3191 |
%} |
3192 |
! ! |
|
3193 |
||
3194 |
!GLXWorkstation methodsFor:'misc'! |
|
3195 |
||
3196 |
glxGconfigIn:aGLXWindowId |
|
3197 |
"must be sent after RGBmode, doubleBuffer etc. to have these |
|
3198 |
changes really take effect. See GLX manual. |
|
3199 |
(Actually, it seems to be not allowed - I dont really know)" |
|
3200 |
||
3201 |
%{ /* NOCONTEXT */ |
|
3202 |
SETWIN(aGLXWindowId) |
|
1932 | 3203 |
#ifdef OPENGL |
3204 |
#else |
|
294 | 3205 |
gconfig(); |
1932 | 3206 |
#endif |
294 | 3207 |
%} |
3208 |
! |
|
3209 |
||
3210 |
glxMmode:aSymbol in:aGLXWindowId |
|
3211 |
"set matrix mode: #single, #viewing, #projection or #texture" |
|
3212 |
||
3213 |
%{ /* NOCONTEXT */ |
|
3214 |
#ifdef GLX |
|
3215 |
if (aSymbol == @symbol(single)) { |
|
3216 |
mmode(MSINGLE); |
|
3217 |
RETURN (true); |
|
3218 |
} |
|
3219 |
if (aSymbol == @symbol(viewing)) { |
|
3220 |
mmode(MVIEWING); |
|
3221 |
RETURN (true); |
|
3222 |
} |
|
3223 |
if (aSymbol == @symbol(projection)) { |
|
3224 |
mmode(MPROJECTION); |
|
3225 |
RETURN (true); |
|
3226 |
} |
|
3227 |
if (aSymbol == @symbol(texture)) { |
|
3228 |
mmode(MTEXTURE); |
|
3229 |
RETURN (true); |
|
3230 |
} |
|
3231 |
#endif |
|
3232 |
%} |
|
3233 |
. |
|
3234 |
^ false |
|
3235 |
! |
|
3236 |
||
3237 |
glxNmode:aSymbol in:aGLXWindowId |
|
3238 |
"set normalize mode: #auto, #normalize" |
|
3239 |
||
3240 |
%{ /* NOCONTEXT */ |
|
3241 |
#ifdef GLX |
|
3242 |
if (aSymbol == @symbol(auto)) { |
|
3243 |
nmode(NAUTO); |
|
3244 |
RETURN (true); |
|
3245 |
} |
|
3246 |
if (aSymbol == @symbol(normalize)) { |
|
3247 |
nmode(NNORMALIZE); |
|
3248 |
RETURN (true); |
|
3249 |
} |
|
3250 |
#endif |
|
3251 |
%} |
|
3252 |
. |
|
3253 |
^ false |
|
3254 |
! |
|
3255 |
||
3256 |
glxRGBmodeIn:aGLXWindowId |
|
3257 |
"set true color mode (no colormap)" |
|
3258 |
||
3259 |
%{ /* NOCONTEXT */ |
|
3260 |
#ifdef GLX |
|
3261 |
SETWIN(aGLXWindowId) |
|
3262 |
RGBmode(); |
|
3263 |
RETURN (true); |
|
3264 |
#endif |
|
3265 |
%} |
|
3266 |
. |
|
3267 |
^ false |
|
3268 |
! ! |
|
3269 |
||
3270 |
!GLXWorkstation methodsFor:'objects'! |
|
3271 |
||
3272 |
glxCallObject:obj in:aGLXWindowId |
|
3273 |
"perform the commands of an object (macro)." |
|
3274 |
||
2075 | 3275 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3276 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3277 |
#else |
294 | 3278 |
if (__isSmallInteger(obj)) { |
3279 |
SETWIN(aGLXWindowId) |
|
3280 |
callobj(_objectVal(obj)); |
|
3281 |
RETURN (true); |
|
3282 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3283 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3284 |
%}. |
294 | 3285 |
^ false |
3286 |
! |
|
3287 |
||
3288 |
glxCallobj: obj in: aGLXWindowId |
|
3289 |
"OBSOLETE; use glxCallObject:in: |
|
3290 |
This one will be removed soon." |
|
3291 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3292 |
self halt |
294 | 3293 |
! |
3294 |
||
3295 |
glxCloseObjectIn:aGLXWindowId |
|
3296 |
"end object defnition" |
|
3297 |
||
2075 | 3298 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3299 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3300 |
#else |
294 | 3301 |
SETWIN(aGLXWindowId) |
3302 |
closeobj(); |
|
3303 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3304 |
#endif |
294 | 3305 |
%} |
3306 |
! |
|
3307 |
||
3308 |
glxCloseobjIn:aGLXWindowId |
|
3309 |
"OBSOLETE: use glxCloseObjectIn: |
|
3310 |
This one will be removed." |
|
3311 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3312 |
self halt |
294 | 3313 |
! |
3314 |
||
3315 |
glxDeleteObject:obj in:aGLXWindowId |
|
3316 |
||
2075 | 3317 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3318 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3319 |
#else |
1882 | 3320 |
if (__isSmallInteger(obj)) { |
3321 |
SETWIN(aGLXWindowId) |
|
3322 |
delobj(_objectVal(obj)); |
|
3323 |
RETURN (true); |
|
3324 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3325 |
#endif |
294 | 3326 |
%} |
3327 |
! |
|
3328 |
||
3329 |
glxDelobj:obj in:aGLXWindowId |
|
3330 |
"OBSOLETE: use glxDeleteObject:in: |
|
3331 |
This one will be removed." |
|
3332 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3333 |
self halt |
294 | 3334 |
! |
3335 |
||
3336 |
glxGenObjectIn:aGLXWindowId |
|
3337 |
"return a new (free & unused) object id for use |
|
3338 |
with makeObj" |
|
3339 |
||
3340 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3341 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3342 |
#else |
294 | 3343 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3344 |
RETURN (__MKSMALLINT(genobj())); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3345 |
#endif |
294 | 3346 |
%} |
3347 |
! |
|
3348 |
||
3349 |
glxGenobjIn:aGLXWindowId |
|
3350 |
"OBSOLETE: use glxGenObject:in: |
|
3351 |
This one will be removed." |
|
3352 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3353 |
self halt |
294 | 3354 |
! |
3355 |
||
3356 |
glxGetopenobjIn:aGLXWindowId |
|
3357 |
"return the currently open objects id; -1 if none is open" |
|
3358 |
||
3359 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3360 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3361 |
#else |
294 | 3362 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3363 |
RETURN (__MKSMALLINT(getopenobj())); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3364 |
#endif |
294 | 3365 |
%} |
3366 |
! |
|
3367 |
||
3368 |
glxIsobj:obj in:aGLXWindowId |
|
3369 |
"return true, if obj is a valid object id" |
|
3370 |
||
3371 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3372 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3373 |
#else |
294 | 3374 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3375 |
RETURN (__MKBOOLEAN(isobj(_objectVal(obj)))); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3376 |
#endif |
294 | 3377 |
%} |
3378 |
! |
|
3379 |
||
3380 |
glxMakeObject:id in:aGLXWindowId |
|
3381 |
"start object definition - |
|
3382 |
another name conflict" |
|
3383 |
||
2075 | 3384 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3385 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3386 |
#else |
294 | 3387 |
if (__isSmallInteger(id)) { |
3388 |
SETWIN(aGLXWindowId) |
|
3389 |
makeobj(_objectVal(id)); |
|
3390 |
RETURN (true); |
|
3391 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3392 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3393 |
%}. |
294 | 3394 |
^ false |
3395 |
! |
|
3396 |
||
3397 |
glxMakeobj:obj in:aGLXWindowId |
|
3398 |
"OBSOLETE; use glxMakeObject:in: |
|
3399 |
This one will be removed soon." |
|
3400 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3401 |
self halt |
294 | 3402 |
! ! |
3403 |
||
3404 |
!GLXWorkstation methodsFor:'patches & surfaces'! |
|
3405 |
||
3406 |
glxBeginCurveIn:aGLXWindowId |
|
3407 |
"start a NURBS curve def - in real GL only" |
|
3408 |
||
3409 |
%{ /* NOCONTEXT */ |
|
1932 | 3410 |
SETWIN(aGLXWindowId) |
3411 |
#ifdef GLX |
|
294 | 3412 |
bgncurve(); |
1932 | 3413 |
#endif |
3414 |
%} |
|
294 | 3415 |
! |
3416 |
||
3417 |
glxBeginSurfaceIn:aGLXWindowId |
|
3418 |
"start a NURBS surface def - in real GL only" |
|
3419 |
||
3420 |
%{ /* NOCONTEXT */ |
|
1932 | 3421 |
SETWIN(aGLXWindowId) |
3422 |
#ifdef GLX |
|
294 | 3423 |
bgnsurface(); |
1932 | 3424 |
#endif |
3425 |
%} |
|
294 | 3426 |
! |
3427 |
||
3428 |
glxDefBasis:id mat:aMatrix in:aGLXWindowId |
|
528 | 3429 |
"define the basis matrix for a patch or curve" |
294 | 3430 |
|
3431 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3432 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3433 |
#else |
294 | 3434 |
Matrix matrix; |
3435 |
Matrix *m; |
|
3436 |
||
2814 | 3437 |
if (! (m = __glx_getFloatsFromMatrixInto(aMatrix, matrix))) RETURN (false); |
294 | 3438 |
if (__isSmallInteger(id)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3439 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3440 |
defbasis((short)(__intVal(id)), *m); |
294 | 3441 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3442 |
#endif |
1932 | 3443 |
%} |
528 | 3444 |
|
3445 |
"Modified: 19.3.1996 / 18:52:56 / cg" |
|
294 | 3446 |
! |
3447 |
||
3448 |
glxEndCurveIn:aGLXWindowId |
|
3449 |
"end a NURBS curve def - in real GL only" |
|
3450 |
||
3451 |
%{ /* NOCONTEXT */ |
|
1932 | 3452 |
SETWIN(aGLXWindowId) |
3453 |
#ifdef GLX |
|
294 | 3454 |
endcurve(); |
1932 | 3455 |
#endif |
3456 |
%} |
|
294 | 3457 |
! |
3458 |
||
3459 |
glxEndSurfaceIn:aGLXWindowId |
|
3460 |
"end a NURBS surface def - in real GL only" |
|
3461 |
||
3462 |
%{ /* NOCONTEXT */ |
|
1932 | 3463 |
SETWIN(aGLXWindowId) |
3464 |
#ifdef GLX |
|
294 | 3465 |
endsurface(); |
1932 | 3466 |
#endif |
3467 |
%} |
|
294 | 3468 |
! |
3469 |
||
3470 |
glxNurbsSurfaceUKnotCount: uKnotCount uKnot: uKnot |
|
3471 |
vKnotCount: vKnotCount vKnot: vKnot |
|
3472 |
uOffset: uOffset vOffset: vOffset |
|
3473 |
ctlArray: ctlArray |
|
3474 |
uOrder: uOrder vOrder: vOrder |
|
3475 |
type: type in: aGLXWindowId |
|
3476 |
||
3477 |
| ctlPoints i | |
|
3478 |
ctlPoints := DoubleArray new: ctlArray size * (ctlArray first size). |
|
3479 |
i := 1. |
|
3480 |
ctlArray do: [:point | |
|
3481 |
point do: [:coord | |
|
3482 |
ctlPoints at: i put: coord. |
|
3483 |
i := i + 1]]. |
|
3484 |
||
3485 |
%{ /* NOCONTEXT */ |
|
3486 |
#ifdef GLX |
|
3487 |
char *uKnotElements, *vKnotElements, *ctlElements; |
|
3488 |
OBJ cls; |
|
3489 |
int ninstVars, nInstBytes; |
|
3490 |
||
3491 |
SETWIN(aGLXWindowId) |
|
3492 |
cls = __qClass(ctlPoints); |
|
3493 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
3494 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
|
3495 |
||
3496 |
ctlElements = (char *)(_InstPtr(ctlPoints)) + nInstBytes; |
|
3497 |
uKnotElements = (char *)(_InstPtr(uKnot)) + nInstBytes; |
|
3498 |
vKnotElements = (char *)(_InstPtr(vKnot)) + nInstBytes; |
|
3499 |
||
3500 |
nurbssurface ( |
|
3501 |
__intVal(uKnotCount), (double *)uKnotElements, |
|
3502 |
__intVal(vKnotCount), (double *)vKnotElements, |
|
3503 |
__intVal(uOffset), __intVal(vOffset), |
|
3504 |
(double *)ctlElements, |
|
3505 |
__intVal(uOrder), __intVal(vOrder), __intVal(type)); |
|
3506 |
RETURN(true); |
|
3507 |
#endif |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3508 |
%}. |
294 | 3509 |
^ false |
3510 |
! |
|
3511 |
||
3512 |
glxPatchBasisU:u v:v in:aGLXWindowId |
|
528 | 3513 |
"set the two basis matrices for a patch" |
294 | 3514 |
|
3515 |
%{ /* NOCONTEXT */ |
|
3516 |
if (__bothSmallInteger(u, v)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3517 |
SETWIN(aGLXWindowId) |
1932 | 3518 |
#ifdef OPENGL |
3519 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3520 |
patchbasis((long)__intVal(u), (long)__intVal(v)); |
1932 | 3521 |
#endif |
294 | 3522 |
} |
1932 | 3523 |
%} |
528 | 3524 |
|
3525 |
"Modified: 19.3.1996 / 18:53:18 / cg" |
|
294 | 3526 |
! |
3527 |
||
3528 |
glxPatchCurvesU:u v:v in:aGLXWindowId |
|
528 | 3529 |
"set the number of curves to be drawn in each direction on a patch" |
294 | 3530 |
|
3531 |
%{ /* NOCONTEXT */ |
|
3532 |
if (__bothSmallInteger(u, v)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3533 |
SETWIN(aGLXWindowId) |
1932 | 3534 |
#ifdef OPENGL |
3535 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3536 |
patchcurves((long)__intVal(u), (long)__intVal(v)); |
1932 | 3537 |
#endif |
294 | 3538 |
} |
1932 | 3539 |
%} |
528 | 3540 |
|
3541 |
"Modified: 19.3.1996 / 18:53:34 / cg" |
|
294 | 3542 |
! |
3543 |
||
3544 |
glxPatchPrecisionU:u v:v in:aGLXWindowId |
|
3545 |
"set the patch precision" |
|
3546 |
||
3547 |
%{ /* NOCONTEXT */ |
|
3548 |
if (__bothSmallInteger(u, v)) { |
|
3549 |
SETWIN(aGLXWindowId) |
|
1932 | 3550 |
#ifdef OPENGL |
3551 |
#else |
|
294 | 3552 |
patchprecision((long)__intVal(u), (long)__intVal(v)); |
1932 | 3553 |
#endif |
294 | 3554 |
} |
1932 | 3555 |
%} |
294 | 3556 |
! |
3557 |
||
3558 |
glxPatchX:arrayOf16XFloats y:arrayOf16YFloats z:arrayOf16ZFloats in:aGLXWindowId |
|
528 | 3559 |
"Draws a bicubic patch. |
3560 |
arguments must be arrays of 16 floats containing the patch" |
|
294 | 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 |
294 | 3565 |
Matrix matrixX, matrixY, matrixZ; |
3566 |
Matrix *mX, *mY, *mZ; |
|
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); |
294 | 3574 |
SETWIN(aGLXWindowId) |
3575 |
patch(*mX, *mY, *mZ); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3576 |
#endif |
294 | 3577 |
%} |
528 | 3578 |
|
3579 |
"Modified: 19.3.1996 / 18:54:02 / cg" |
|
3580 |
! |
|
3581 |
||
3582 |
glxRpatchX:arrayOf16XFloats y:arrayOf16YFloats z:arrayOf16ZFloats w:arrayOf16WFloats in:aGLXWindowId |
|
3583 |
"Draws a rational bicubic patch. |
|
3584 |
arguments must be arrays of 16 floats containing the patch" |
|
3585 |
||
3586 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3587 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3588 |
#else |
529 | 3589 |
Matrix matrixX, matrixY, matrixZ, matrixW; |
3590 |
Matrix *mX, *mY, *mZ, *mW; |
|
528 | 3591 |
|
2814 | 3592 |
if (! (mX = __glx_getFloatsFromMatrixInto(arrayOf16XFloats, matrixX))) |
1932 | 3593 |
RETURN (nil); |
2814 | 3594 |
if (! (mY = __glx_getFloatsFromMatrixInto(arrayOf16YFloats, matrixY))) |
1932 | 3595 |
RETURN (nil); |
2814 | 3596 |
if (! (mZ = __glx_getFloatsFromMatrixInto(arrayOf16ZFloats, matrixZ))) |
1932 | 3597 |
RETURN (nil); |
2814 | 3598 |
if (! (mW = __glx_getFloatsFromMatrixInto(arrayOf16WFloats, matrixW))) |
1932 | 3599 |
RETURN (nil); |
529 | 3600 |
SETWIN(aGLXWindowId) |
3601 |
rpatch(*mX, *mY, *mZ, *mW); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3602 |
#endif |
528 | 3603 |
%} |
3604 |
||
3605 |
"Modified: 19.3.1996 / 18:54:02 / cg" |
|
3606 |
"Created: 19.3.1996 / 18:56:34 / cg" |
|
3607 |
! ! |
|
3608 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3609 |
!GLXWorkstation methodsFor:'pixel copy'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3610 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3611 |
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
|
3612 |
"copy a rectangular area in the view. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3613 |
For now, this is only supported with a true GL. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3614 |
readsource specifies which plane/buffer is affected by this operation." |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3615 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3616 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3617 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3618 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3619 |
rectcopy(_screencoordVal(x1), _screencoordVal(y1), |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3620 |
_screencoordVal(x2), _screencoordVal(y2), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3621 |
_screencoordVal(newx), _screencoordVal(newy)); |
1932 | 3622 |
#endif |
3623 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3624 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3625 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3626 |
!GLXWorkstation methodsFor:'pixel reading'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3627 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3628 |
glxReadpixelsTo:dest in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3629 |
"read pixels from the view. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3630 |
Dest must be an array and gets pixel values assigned, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3631 |
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
|
3632 |
For now, pixel-reading is only supported with a true GL. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3633 |
Caveat: the number of pixels is limited to 256. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3634 |
In double buffer mode, the backBuffer is read." |
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 |
|n| |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3637 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3638 |
n := dest size. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3639 |
n > 256 ifTrue:[^ 0]. |
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 |
%{ /* STACK:1024 */ |
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 |
Colorindex buffer[256]; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3644 |
int i, nRead; |
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 |
if (__isArray(dest)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3647 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3648 |
nRead = readpixels(__intVal(n), buffer); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3649 |
for (i=0; i<nRead;i++) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3650 |
__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
|
3651 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3652 |
RETURN (__MKSMALLINT(nRead)); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3653 |
} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3654 |
#endif |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3655 |
%}. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3656 |
^ 0 |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3657 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3658 |
"Modified: 22.3.1996 / 18:08:00 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3659 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3660 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3661 |
glxReadsource: src in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3662 |
"specify what is read with folowing readPixels requests. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3663 |
For now, pixel-reading is only supported with a true GL" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3664 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3665 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3666 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3667 |
OBJ s = src; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3668 |
int what; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3669 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3670 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3671 |
if (s == @symbol(auto)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3672 |
what = SRC_AUTO; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3673 |
} else if (s == @symbol(front)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3674 |
what = SRC_FRONT; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3675 |
} else if (s == @symbol(back)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3676 |
what = SRC_BACK; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3677 |
} else if (s == @symbol(zBuffer)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3678 |
what = SRC_ZBUFFER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3679 |
} else if (s == @symbol(frameGrabber)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3680 |
what = SRC_FRAMEGRABBER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3681 |
} else if (s == @symbol(over)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3682 |
what = SRC_OVER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3683 |
} else if (s == @symbol(under)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3684 |
what = SRC_UNDER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3685 |
} else if (s == @symbol(popUp)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3686 |
what = SRC_PUP; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3687 |
} else { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3688 |
what = _longVal(src); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3689 |
} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3690 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3691 |
readsource(what); |
1932 | 3692 |
#endif |
3693 |
%} |
|
538 | 3694 |
! |
3695 |
||
541 | 3696 |
glxRectreadX1:x1 y1:y1 x2:x2 y2:y2 h:viewHeight to:dest in:aGLXWindowId |
538 | 3697 |
"read pixels from a rectanglular area. |
3698 |
Dest must be an array and gets pixel values assigned, |
|
3699 |
reading n*m pixels. |
|
3700 |
For now, pixel-reading is only supported with a true GL. |
|
3701 |
Caveat: the number of pixels is limited to 256. |
|
3702 |
In double buffer mode, the backBuffer is read." |
|
3703 |
||
541 | 3704 |
|n idx sy1 sy2| |
3705 |
||
3706 |
"/ GLX's y coordinates go bottom to top ... |
|
3707 |
||
3708 |
sy1 := viewHeight - y1. |
|
3709 |
sy2 := viewHeight - y2. |
|
538 | 3710 |
|
3711 |
n := (x2 - x1 + 1) * (y2 - y1 + 1). |
|
3712 |
n > 256 ifTrue:[^ 0]. |
|
3713 |
dest size < n ifTrue:[^ 0]. |
|
3714 |
||
3715 |
%{ /* STACK:1024 */ |
|
3716 |
#ifdef GLX |
|
3717 |
Colorindex buffer[256]; |
|
3718 |
int i, nRead; |
|
3719 |
||
3720 |
if (__isArray(dest) |
|
3721 |
&& __isSmallInteger(x1) && __isSmallInteger(x2) |
|
541 | 3722 |
&& __isSmallInteger(sy1) && __isSmallInteger(sy2) |
538 | 3723 |
) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3724 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3725 |
nRead = rectread(__intVal(x1), __intVal(sy1), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3726 |
__intVal(x2), __intVal(sy2), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3727 |
buffer); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3728 |
for (i=0; i<nRead;i++) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3729 |
__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
|
3730 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3731 |
RETURN (__MKSMALLINT(nRead)); |
538 | 3732 |
} |
3733 |
#endif |
|
3734 |
%}. |
|
3735 |
"/ |
|
3736 |
"/ ok, this is not a GL - use XWorkstations pixel read method |
|
3737 |
"/ and convert |
|
3738 |
"/ |
|
3739 |
idx := 1. |
|
3740 |
y1 to:y2 do:[:y | |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3741 |
x1 to:x2 do:[:x | |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3742 |
|pix| |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3743 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3744 |
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
|
3745 |
dest at:idx put:pix |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3746 |
] |
538 | 3747 |
]. |
3748 |
^ n |
|
3749 |
||
3750 |
"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
|
3751 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3752 |
! |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3753 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3754 |
glxXColorToGLColor:pixel |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3755 |
"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
|
3756 |
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
|
3757 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3758 |
%{ /* NOCONTEXT */ |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3759 |
#ifdef VGL |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3760 |
if (__isSmallInteger(pixel)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3761 |
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
|
3762 |
} |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3763 |
#endif |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3764 |
%}. |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3765 |
^ pixel |
543
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3766 |
! |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3767 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3768 |
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
|
3769 |
"special for VGL" |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3770 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3771 |
%{ |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3772 |
#ifdef VGL |
1932 | 3773 |
if (__bothSmallInteger(x, y)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3774 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3775 |
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
|
3776 |
} |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3777 |
#endif |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3778 |
%}. |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3779 |
^ 0 |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3780 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3781 |
"Modified: 22.3.1996 / 18:08:00 / cg" |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3782 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3783 |
|
528 | 3784 |
!GLXWorkstation methodsFor:'points'! |
3785 |
||
3786 |
glxPnt2X: x y: y in: aGLXWindowId |
|
3787 |
"plot a point in x, y, 0." |
|
3788 |
||
3789 |
%{ /* NOCONTEXT */ |
|
3790 |
Coord c_x, c_y; |
|
3791 |
||
3792 |
_COORD_ (x, c_x) |
|
3793 |
_COORD_ (y, c_y) |
|
3794 |
SETWIN(aGLXWindowId) |
|
1932 | 3795 |
#ifdef OPENGL |
3796 |
#else |
|
528 | 3797 |
pnt2(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3798 |
#endif |
528 | 3799 |
%} |
3800 |
||
3801 |
"Modified: 19.3.1996 / 18:35:55 / cg" |
|
3802 |
! |
|
3803 |
||
3804 |
glxPnt2iX: x y: y in: aGLXWindowId |
|
3805 |
"plot a point in x, y, 0." |
|
3806 |
||
3807 |
%{ /* NOCONTEXT */ |
|
3808 |
Icoord c_x, c_y; |
|
3809 |
||
3810 |
_ICOORD_ (x, c_x) |
|
3811 |
_ICOORD_ (y, c_y) |
|
3812 |
SETWIN(aGLXWindowId) |
|
1932 | 3813 |
#ifdef OPENGL |
3814 |
#else |
|
528 | 3815 |
pnt2i(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3816 |
#endif |
528 | 3817 |
%} |
3818 |
||
3819 |
"Modified: 19.3.1996 / 18:35:59 / cg" |
|
3820 |
! |
|
3821 |
||
3822 |
glxPnt2sX: x y: y in: aGLXWindowId |
|
3823 |
"plot a point in x, y, 0." |
|
3824 |
||
3825 |
%{ /* NOCONTEXT */ |
|
3826 |
Scoord c_x, c_y; |
|
3827 |
||
3828 |
_SCOORD_ (x, c_x) |
|
3829 |
_SCOORD_ (y, c_y) |
|
3830 |
SETWIN(aGLXWindowId) |
|
1932 | 3831 |
#ifdef OPENGL |
3832 |
#else |
|
528 | 3833 |
pnt2s(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3834 |
#endif |
528 | 3835 |
%} |
3836 |
||
3837 |
"Modified: 19.3.1996 / 18:36:03 / cg" |
|
3838 |
! |
|
3839 |
||
3840 |
glxPntX: x y: y z: z in: aGLXWindowId |
|
3841 |
"plot a point in x, y, z." |
|
3842 |
||
3843 |
%{ /* NOCONTEXT */ |
|
3844 |
Coord c_x, c_y, c_z; |
|
3845 |
||
3846 |
_COORD_ (x, c_x) |
|
3847 |
_COORD_ (y, c_y) |
|
3848 |
_COORD_ (z, c_z) |
|
3849 |
SETWIN(aGLXWindowId) |
|
1932 | 3850 |
#ifdef OPENGL |
3851 |
#else |
|
528 | 3852 |
pnt(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3853 |
#endif |
528 | 3854 |
%} |
3855 |
||
3856 |
"Modified: 19.3.1996 / 18:36:08 / cg" |
|
3857 |
! |
|
3858 |
||
3859 |
glxPntiX: x y: y z: z in: aGLXWindowId |
|
3860 |
"plot a point in x, y, z." |
|
3861 |
||
3862 |
%{ /* NOCONTEXT */ |
|
3863 |
Icoord c_x, c_y, c_z; |
|
3864 |
||
3865 |
_ICOORD_ (x, c_x) |
|
3866 |
_ICOORD_ (y, c_y) |
|
3867 |
_ICOORD_ (z, c_z) |
|
3868 |
SETWIN(aGLXWindowId) |
|
1932 | 3869 |
#ifdef OPENGL |
3870 |
#else |
|
528 | 3871 |
pnti(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3872 |
#endif |
528 | 3873 |
%} |
3874 |
||
3875 |
"Modified: 19.3.1996 / 18:36:14 / cg" |
|
3876 |
! |
|
3877 |
||
3878 |
glxPntsX: x y: y z: z in: aGLXWindowId |
|
3879 |
"plot a point in x, y, z." |
|
3880 |
||
3881 |
%{ /* NOCONTEXT */ |
|
3882 |
Scoord c_x, c_y, c_z; |
|
3883 |
||
3884 |
_SCOORD_ (x, c_x) |
|
3885 |
_SCOORD_ (y, c_y) |
|
3886 |
_SCOORD_ (z, c_z) |
|
3887 |
SETWIN(aGLXWindowId) |
|
1932 | 3888 |
#ifdef OPENGL |
3889 |
#else |
|
528 | 3890 |
pnts(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3891 |
#endif |
528 | 3892 |
%} |
3893 |
||
3894 |
"Modified: 19.3.1996 / 18:36:17 / cg" |
|
3895 |
! |
|
3896 |
||
3897 |
glxPntsize: n in: aGLXWindowId |
|
3898 |
||
3899 |
%{ /* NOCONTEXT */ |
|
1932 | 3900 |
SETWIN(aGLXWindowId) |
3901 |
#ifdef GLX |
|
528 | 3902 |
pntsize(_shortVal(n)); |
1932 | 3903 |
#endif |
3904 |
%} |
|
528 | 3905 |
! |
3906 |
||
3907 |
glxPntsizef: n in: aGLXWindowId |
|
3908 |
||
3909 |
%{ /* NOCONTEXT */ |
|
1932 | 3910 |
SETWIN(aGLXWindowId) |
3911 |
#ifdef GLX |
|
528 | 3912 |
pntsizef(_floatVal(n)); |
1932 | 3913 |
#endif |
3914 |
%} |
|
528 | 3915 |
! ! |
3916 |
||
3917 |
!GLXWorkstation methodsFor:'polygons'! |
|
3918 |
||
3919 |
glxBackface: b in: aGLXWindowId |
|
3920 |
"enable/disable culling of backfacing polygons (suppress its drawing). |
|
3921 |
A polygon is backfacing if it's orientation in *screen* coords is clockwise" |
|
3922 |
||
3923 |
%{ /* NOCONTEXT */ |
|
3924 |
SETWIN(aGLXWindowId) |
|
1932 | 3925 |
#ifdef OPENGL |
3926 |
#else |
|
528 | 3927 |
backface(_booleanVal(b)); |
1932 | 3928 |
#endif |
528 | 3929 |
%} |
3930 |
||
3931 |
"Modified: 19.3.1996 / 18:26:50 / cg" |
|
3932 |
! |
|
3933 |
||
3934 |
glxConcave: b in: aGLXWindowId |
|
3935 |
"signal wether or not polygons are concave" |
|
3936 |
||
3937 |
%{ /* NOCONTEXT */ |
|
3938 |
SETWIN(aGLXWindowId) |
|
1932 | 3939 |
#ifdef OPENGL |
3940 |
#else |
|
528 | 3941 |
concave(_booleanVal(b)); |
1932 | 3942 |
#endif |
528 | 3943 |
%} |
3944 |
! |
|
3945 |
||
3946 |
glxFrontface: b in: aGLXWindowId |
|
3947 |
"enable/disable culling of frontfacing polygons (suppress its drawing). |
|
3948 |
A polygon is frontfacing if it's orientation in *screen* coords is |
|
3949 |
anti-clockwise" |
|
3950 |
||
3951 |
||
3952 |
%{ /* NOCONTEXT */ |
|
3953 |
SETWIN(aGLXWindowId) |
|
1932 | 3954 |
#ifdef OPENGL |
3955 |
#else |
|
528 | 3956 |
frontface(_booleanVal(b)); |
1932 | 3957 |
#endif |
3958 |
%} |
|
528 | 3959 |
! |
3960 |
||
3961 |
glxPdr2X: x y: y in: aGLXWindowId |
|
3962 |
"add another vertex to the polygon" |
|
3963 |
||
3964 |
%{ /* NOCONTEXT */ |
|
3965 |
Coord c_x, c_y; |
|
3966 |
||
3967 |
_COORD_ (x, c_x) |
|
3968 |
_COORD_ (y, c_y) |
|
3969 |
SETWIN(aGLXWindowId) |
|
1932 | 3970 |
#ifdef OPENGL |
3971 |
#else |
|
528 | 3972 |
pdr2(c_x, c_y); |
1932 | 3973 |
#endif |
3974 |
%} |
|
528 | 3975 |
! |
3976 |
||
3977 |
glxPdr2iX: x y: y in: aGLXWindowId |
|
3978 |
"add another vertex to the polygon" |
|
3979 |
||
3980 |
%{ /* NOCONTEXT */ |
|
3981 |
Icoord c_x, c_y; |
|
3982 |
||
3983 |
_ICOORD_ (x, c_x) |
|
3984 |
_ICOORD_ (y, c_y) |
|
3985 |
SETWIN(aGLXWindowId) |
|
1932 | 3986 |
#ifdef OPENGL |
3987 |
#else |
|
528 | 3988 |
pdr2i(c_x, c_y); |
1932 | 3989 |
#endif |
528 | 3990 |
%} |
3991 |
||
3992 |
"Modified: 19.3.1996 / 18:33:28 / cg" |
|
3993 |
! |
|
3994 |
||
3995 |
glxPdr2sX: x y: y in: aGLXWindowId |
|
3996 |
"add another vertex to the polygon" |
|
3997 |
||
3998 |
%{ /* NOCONTEXT */ |
|
3999 |
Scoord c_x, c_y; |
|
4000 |
||
4001 |
_SCOORD_ (x, c_x) |
|
4002 |
_SCOORD_ (y, c_y) |
|
4003 |
SETWIN(aGLXWindowId) |
|
1932 | 4004 |
#ifdef OPENGL |
4005 |
#else |
|
528 | 4006 |
pdr2s(c_x, c_y); |
1932 | 4007 |
#endif |
528 | 4008 |
%} |
4009 |
||
4010 |
"Modified: 19.3.1996 / 18:34:03 / cg" |
|
4011 |
! |
|
4012 |
||
4013 |
glxPdrX: x y: y z: z in: aGLXWindowId |
|
4014 |
"add another vertex to the polygon" |
|
4015 |
||
4016 |
%{ /* NOCONTEXT */ |
|
4017 |
Coord c_x, c_y, c_z; |
|
4018 |
||
4019 |
_COORD_ (x, c_x) |
|
4020 |
_COORD_ (y, c_y) |
|
4021 |
_COORD_ (z, c_z) |
|
4022 |
SETWIN(aGLXWindowId) |
|
1932 | 4023 |
#ifdef OPENGL |
4024 |
#else |
|
528 | 4025 |
pdr(c_x, c_y, c_z); |
1932 | 4026 |
#endif |
528 | 4027 |
%} |
4028 |
||
4029 |
"Modified: 19.3.1996 / 18:34:06 / cg" |
|
4030 |
! |
|
4031 |
||
4032 |
glxPdriX: x y: y z: z in: aGLXWindowId |
|
4033 |
"add another vertex to the polygon" |
|
4034 |
||
4035 |
%{ /* NOCONTEXT */ |
|
4036 |
Icoord c_x, c_y, c_z; |
|
4037 |
||
4038 |
_ICOORD_ (x, c_x) |
|
4039 |
_ICOORD_ (y, c_y) |
|
4040 |
_ICOORD_ (z, c_z) |
|
4041 |
SETWIN(aGLXWindowId) |
|
1932 | 4042 |
#ifdef OPENGL |
4043 |
#else |
|
528 | 4044 |
pdri(c_x, c_y, c_z); |
1932 | 4045 |
#endif |
528 | 4046 |
%} |
4047 |
||
4048 |
"Modified: 19.3.1996 / 18:34:11 / cg" |
|
4049 |
! |
|
4050 |
||
4051 |
glxPdrsX: x y: y z: z in: aGLXWindowId |
|
4052 |
"add another vertex to the polygon" |
|
4053 |
||
4054 |
%{ /* NOCONTEXT */ |
|
4055 |
Scoord c_x, c_y, c_z; |
|
4056 |
||
4057 |
_SCOORD_ (x, c_x) |
|
4058 |
_SCOORD_ (y, c_y) |
|
4059 |
_SCOORD_ (z, c_z) |
|
4060 |
SETWIN(aGLXWindowId) |
|
1932 | 4061 |
#ifdef OPENGL |
4062 |
#else |
|
528 | 4063 |
pdrs(c_x, c_y, c_z); |
1932 | 4064 |
#endif |
528 | 4065 |
%} |
4066 |
||
4067 |
"Modified: 19.3.1996 / 18:34:14 / cg" |
|
4068 |
! |
|
4069 |
||
4070 |
glxPmv2X: x y: y in: aGLXWindowId |
|
4071 |
"set the start position of a polygon" |
|
4072 |
||
4073 |
%{ /* NOCONTEXT */ |
|
4074 |
Coord c_x, c_y; |
|
4075 |
||
4076 |
_COORD_ (x, c_x) |
|
4077 |
_COORD_ (y, c_y) |
|
4078 |
SETWIN(aGLXWindowId) |
|
1932 | 4079 |
#ifdef OPENGL |
4080 |
#else |
|
528 | 4081 |
pmv2(c_x, c_y); |
1932 | 4082 |
#endif |
528 | 4083 |
%} |
4084 |
||
4085 |
"Modified: 19.3.1996 / 18:32:45 / cg" |
|
4086 |
! |
|
4087 |
||
4088 |
glxPmv2iX: x y: y in: aGLXWindowId |
|
4089 |
"set the start position of a polygon" |
|
4090 |
||
4091 |
%{ /* NOCONTEXT */ |
|
4092 |
Icoord c_x, c_y; |
|
4093 |
||
4094 |
_ICOORD_ (x, c_x) |
|
4095 |
_ICOORD_ (y, c_y) |
|
4096 |
SETWIN(aGLXWindowId) |
|
1932 | 4097 |
#ifdef OPENGL |
4098 |
#else |
|
528 | 4099 |
pmv2i(c_x, c_y); |
1932 | 4100 |
#endif |
528 | 4101 |
%} |
4102 |
||
4103 |
"Modified: 19.3.1996 / 18:32:42 / cg" |
|
4104 |
! |
|
4105 |
||
4106 |
glxPmv2sX: x y: y in: aGLXWindowId |
|
4107 |
"set the start position of a polygon" |
|
4108 |
||
4109 |
%{ /* NOCONTEXT */ |
|
4110 |
Scoord c_x, c_y; |
|
4111 |
||
4112 |
_SCOORD_ (x, c_x) |
|
4113 |
_SCOORD_ (y, c_y) |
|
4114 |
SETWIN(aGLXWindowId) |
|
1932 | 4115 |
#ifdef OPENGL |
4116 |
#else |
|
528 | 4117 |
pmv2s(c_x, c_y); |
1932 | 4118 |
#endif |
528 | 4119 |
%} |
4120 |
||
4121 |
"Modified: 19.3.1996 / 18:32:38 / cg" |
|
4122 |
! |
|
4123 |
||
4124 |
glxPmvX: x y: y z: z in: aGLXWindowId |
|
4125 |
"set the start position of a polygon" |
|
4126 |
||
4127 |
%{ /* NOCONTEXT */ |
|
4128 |
Coord c_x, c_y, c_z; |
|
4129 |
||
4130 |
_COORD_ (x, c_x) |
|
4131 |
_COORD_ (y, c_y) |
|
4132 |
_COORD_ (z, c_z) |
|
4133 |
SETWIN(aGLXWindowId) |
|
1932 | 4134 |
#ifdef OPENGL |
4135 |
#else |
|
528 | 4136 |
pmv(c_x, c_y, c_z); |
1932 | 4137 |
#endif |
528 | 4138 |
%} |
4139 |
||
4140 |
"Modified: 19.3.1996 / 18:31:52 / cg" |
|
4141 |
! |
|
4142 |
||
4143 |
glxPmviX: x y: y z: z in: aGLXWindowId |
|
4144 |
"set the start position of a polygon" |
|
4145 |
||
4146 |
%{ /* NOCONTEXT */ |
|
4147 |
Icoord c_x, c_y, c_z; |
|
4148 |
||
4149 |
_ICOORD_ (x, c_x) |
|
4150 |
_ICOORD_ (y, c_y) |
|
4151 |
_ICOORD_ (z, c_z) |
|
4152 |
SETWIN(aGLXWindowId) |
|
1932 | 4153 |
#ifdef OPENGL |
4154 |
#else |
|
528 | 4155 |
pmvi(c_x, c_y, c_z); |
1932 | 4156 |
#endif |
528 | 4157 |
%} |
4158 |
||
4159 |
"Modified: 19.3.1996 / 18:31:59 / cg" |
|
4160 |
! |
|
4161 |
||
4162 |
glxPmvsX: x y: y z: z in: aGLXWindowId |
|
4163 |
"set the start position of a polygon" |
|
4164 |
||
4165 |
%{ /* NOCONTEXT */ |
|
4166 |
Scoord c_x, c_y, c_z; |
|
4167 |
||
4168 |
_SCOORD_ (x, c_x) |
|
4169 |
_SCOORD_ (y, c_y) |
|
4170 |
_SCOORD_ (z, c_z) |
|
4171 |
SETWIN(aGLXWindowId) |
|
1932 | 4172 |
#ifdef OPENGL |
4173 |
#else |
|
528 | 4174 |
pmvs(c_x, c_y, c_z); |
1932 | 4175 |
#endif |
528 | 4176 |
%} |
4177 |
||
4178 |
"Modified: 19.3.1996 / 18:32:03 / cg" |
|
4179 |
! |
|
4180 |
||
4181 |
glxPolymode: mode in: aGLXWindowId |
|
4182 |
"Sets the polygon filling mode - only filled (1) or outlined (0) |
|
4183 |
are supported" |
|
4184 |
||
4185 |
%{ /* NOCONTEXT */ |
|
4186 |
SETWIN(aGLXWindowId) |
|
1932 | 4187 |
#ifdef OPENGL |
4188 |
#else |
|
528 | 4189 |
polymode(_longVal(mode)); |
1932 | 4190 |
#endif |
528 | 4191 |
%} |
4192 |
||
4193 |
"Modified: 19.3.1996 / 18:29:32 / cg" |
|
4194 |
! |
|
4195 |
||
4196 |
glxRpdr2X: x y: y in: aGLXWindowId |
|
4197 |
"add another relative vertex to the polygon" |
|
4198 |
||
4199 |
%{ /* NOCONTEXT */ |
|
4200 |
Coord c_x, c_y; |
|
4201 |
||
4202 |
_COORD_ (x, c_x) |
|
4203 |
_COORD_ (y, c_y) |
|
4204 |
SETWIN(aGLXWindowId) |
|
1932 | 4205 |
#ifdef OPENGL |
4206 |
#else |
|
528 | 4207 |
rpdr2(c_x, c_y); |
1932 | 4208 |
#endif |
528 | 4209 |
%} |
4210 |
||
4211 |
"Modified: 19.3.1996 / 18:34:31 / cg" |
|
4212 |
! |
|
4213 |
||
4214 |
glxRpdr2iX: x y: y in: aGLXWindowId |
|
4215 |
"add another relative vertex to the polygon" |
|
4216 |
||
4217 |
%{ /* NOCONTEXT */ |
|
4218 |
Icoord c_x, c_y; |
|
4219 |
||
4220 |
_ICOORD_ (x, c_x) |
|
4221 |
_ICOORD_ (y, c_y) |
|
4222 |
SETWIN(aGLXWindowId) |
|
1932 | 4223 |
#ifdef OPENGL |
4224 |
#else |
|
528 | 4225 |
rpdr2i(c_x, c_y); |
1932 | 4226 |
#endif |
528 | 4227 |
%} |
4228 |
||
4229 |
"Modified: 19.3.1996 / 18:34:36 / cg" |
|
4230 |
! |
|
4231 |
||
4232 |
glxRpdr2sX: x y: y in: aGLXWindowId |
|
4233 |
"add another relative vertex to the polygon" |
|
4234 |
||
4235 |
%{ /* NOCONTEXT */ |
|
4236 |
Scoord c_x, c_y; |
|
4237 |
||
4238 |
_SCOORD_ (x, c_x) |
|
4239 |
_SCOORD_ (y, c_y) |
|
4240 |
SETWIN(aGLXWindowId) |
|
1932 | 4241 |
#ifdef OPENGL |
4242 |
#else |
|
528 | 4243 |
rpdr2s(c_x, c_y); |
1932 | 4244 |
#endif |
528 | 4245 |
%} |
4246 |
||
4247 |
"Modified: 19.3.1996 / 18:34:40 / cg" |
|
4248 |
! |
|
4249 |
||
4250 |
glxRpdrX: x y: y z: z in: aGLXWindowId |
|
4251 |
"add another relative vertex to the polygon" |
|
4252 |
||
4253 |
%{ /* NOCONTEXT */ |
|
4254 |
Coord c_x, c_y, c_z; |
|
4255 |
||
4256 |
_COORD_ (x, c_x) |
|
4257 |
_COORD_ (y, c_y) |
|
4258 |
_COORD_ (z, c_z) |
|
4259 |
SETWIN(aGLXWindowId) |
|
1932 | 4260 |
#ifdef OPENGL |
4261 |
#else |
|
528 | 4262 |
rpdr(c_x, c_y, c_z); |
1932 | 4263 |
#endif |
528 | 4264 |
%} |
4265 |
||
4266 |
"Modified: 19.3.1996 / 18:34:48 / cg" |
|
4267 |
! |
|
4268 |
||
4269 |
glxRpdriX: x y: y z: z in: aGLXWindowId |
|
4270 |
"add another relative vertex to the polygon" |
|
4271 |
||
4272 |
%{ /* NOCONTEXT */ |
|
4273 |
Icoord c_x, c_y, c_z; |
|
4274 |
||
4275 |
_ICOORD_ (x, c_x) |
|
4276 |
_ICOORD_ (y, c_y) |
|
4277 |
_ICOORD_ (z, c_z) |
|
4278 |
SETWIN(aGLXWindowId) |
|
1932 | 4279 |
#ifdef OPENGL |
4280 |
#else |
|
528 | 4281 |
rpdri(c_x, c_y, c_z); |
1932 | 4282 |
#endif |
528 | 4283 |
%} |
4284 |
||
4285 |
"Modified: 19.3.1996 / 18:34:51 / cg" |
|
4286 |
! |
|
4287 |
||
4288 |
glxRpdrsX: x y: y z: z in: aGLXWindowId |
|
4289 |
"add another relative vertex to the polygon" |
|
4290 |
||
4291 |
%{ /* NOCONTEXT */ |
|
4292 |
Scoord c_x, c_y, c_z; |
|
4293 |
||
4294 |
_SCOORD_ (x, c_x) |
|
4295 |
_SCOORD_ (y, c_y) |
|
4296 |
_SCOORD_ (z, c_z) |
|
4297 |
SETWIN(aGLXWindowId) |
|
1932 | 4298 |
#ifdef OPENGL |
4299 |
#else |
|
528 | 4300 |
rpdrs(c_x, c_y, c_z); |
1932 | 4301 |
#endif |
528 | 4302 |
%} |
4303 |
||
4304 |
"Modified: 19.3.1996 / 18:34:55 / cg" |
|
4305 |
! |
|
4306 |
||
4307 |
glxRpmv2X: x y: y in: aGLXWindowId |
|
4308 |
"set the start position of a polygon" |
|
4309 |
||
4310 |
%{ /* NOCONTEXT */ |
|
4311 |
Coord c_x, c_y; |
|
4312 |
||
4313 |
_COORD_ (x, c_x) |
|
4314 |
_COORD_ (y, c_y) |
|
4315 |
SETWIN(aGLXWindowId) |
|
1932 | 4316 |
#ifdef OPENGL |
4317 |
#else |
|
528 | 4318 |
rpmv2(c_x, c_y); |
1932 | 4319 |
#endif |
528 | 4320 |
%} |
4321 |
||
4322 |
"Modified: 19.3.1996 / 18:37:15 / cg" |
|
4323 |
! |
|
4324 |
||
4325 |
glxRpmv2iX: x y: y in: aGLXWindowId |
|
4326 |
"set the start position of a polygon" |
|
4327 |
||
4328 |
%{ /* NOCONTEXT */ |
|
4329 |
Icoord c_x, c_y; |
|
4330 |
||
4331 |
_ICOORD_ (x, c_x) |
|
4332 |
_ICOORD_ (y, c_y) |
|
4333 |
SETWIN(aGLXWindowId) |
|
1932 | 4334 |
#ifdef OPENGL |
4335 |
#else |
|
528 | 4336 |
rpmv2i(c_x, c_y); |
1932 | 4337 |
#endif |
528 | 4338 |
%} |
4339 |
||
4340 |
"Modified: 19.3.1996 / 18:37:20 / cg" |
|
4341 |
! |
|
4342 |
||
4343 |
glxRpmv2sX: x y: y in: aGLXWindowId |
|
4344 |
"set the relative start position of a polygon" |
|
4345 |
||
4346 |
%{ /* NOCONTEXT */ |
|
4347 |
Scoord c_x, c_y; |
|
4348 |
||
4349 |
_SCOORD_ (x, c_x) |
|
4350 |
_SCOORD_ (y, c_y) |
|
4351 |
SETWIN(aGLXWindowId) |
|
1932 | 4352 |
#ifdef OPENGL |
4353 |
#else |
|
528 | 4354 |
rpmv2s(c_x, c_y); |
1932 | 4355 |
#endif |
528 | 4356 |
%} |
4357 |
||
4358 |
"Modified: 19.3.1996 / 18:38:06 / cg" |
|
4359 |
! |
|
4360 |
||
4361 |
glxRpmvX: x y: y z: z in: aGLXWindowId |
|
4362 |
"set the relative start position of a polygon" |
|
4363 |
||
4364 |
%{ /* NOCONTEXT */ |
|
4365 |
Coord c_x, c_y, c_z; |
|
4366 |
||
4367 |
_COORD_ (x, c_x) |
|
4368 |
_COORD_ (y, c_y) |
|
4369 |
_COORD_ (z, c_z) |
|
4370 |
SETWIN(aGLXWindowId) |
|
1932 | 4371 |
#ifdef OPENGL |
4372 |
#else |
|
528 | 4373 |
rpmv(c_x, c_y, c_z); |
1932 | 4374 |
#endif |
528 | 4375 |
%} |
4376 |
||
4377 |
"Modified: 19.3.1996 / 18:38:03 / cg" |
|
4378 |
! |
|
4379 |
||
4380 |
glxRpmviX: x y: y z: z in: aGLXWindowId |
|
4381 |
"set the relative start position of a polygon" |
|
4382 |
||
4383 |
%{ /* NOCONTEXT */ |
|
4384 |
Icoord c_x, c_y, c_z; |
|
4385 |
||
4386 |
_ICOORD_ (x, c_x) |
|
4387 |
_ICOORD_ (y, c_y) |
|
4388 |
_ICOORD_ (z, c_z) |
|
4389 |
SETWIN(aGLXWindowId) |
|
1932 | 4390 |
#ifdef OPENGL |
4391 |
#else |
|
528 | 4392 |
rpmvi(c_x, c_y, c_z); |
1932 | 4393 |
#endif |
528 | 4394 |
%} |
4395 |
||
4396 |
"Modified: 19.3.1996 / 18:37:53 / cg" |
|
4397 |
! |
|
4398 |
||
4399 |
glxRpmvsX: x y: y z: z in: aGLXWindowId |
|
4400 |
"set the relative start position of a polygon" |
|
4401 |
||
4402 |
%{ /* NOCONTEXT */ |
|
4403 |
Scoord c_x, c_y, c_z; |
|
4404 |
||
4405 |
_SCOORD_ (x, c_x) |
|
4406 |
_SCOORD_ (y, c_y) |
|
4407 |
_SCOORD_ (z, c_z) |
|
4408 |
SETWIN(aGLXWindowId) |
|
1932 | 4409 |
#ifdef OPENGL |
4410 |
#else |
|
528 | 4411 |
rpmvs(c_x, c_y, c_z); |
1932 | 4412 |
#endif |
528 | 4413 |
%} |
4414 |
||
4415 |
"Modified: 19.3.1996 / 18:37:58 / cg" |
|
294 | 4416 |
! ! |
4417 |
||
24 | 4418 |
!GLXWorkstation methodsFor:'queries'! |
4419 |
||
159 | 4420 |
glVersion |
4421 |
"return a string describing the GL version. |
|
4422 |
For informative use only; portable applications do not depend |
|
4423 |
on the returned string." |
|
4424 |
||
4425 |
%{ /* NOCONTEXT */ |
|
4426 |
#ifdef VGL |
|
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
4427 |
RETURN (__MKSTRING("vogl")); |
159 | 4428 |
#else |
1932 | 4429 |
# ifdef GLX |
159 | 4430 |
char buffer[128]; |
4431 |
||
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4432 |
if (_INST(glOK) == true) { |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4433 |
gversion(buffer); |
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
4434 |
RETURN (__MKSTRING(buffer)); |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4435 |
} |
1932 | 4436 |
RETURN (nil); |
4437 |
# else |
|
4438 |
RETURN (nil); |
|
4439 |
# endif |
|
159 | 4440 |
#endif |
4441 |
%} |
|
4442 |
||
4443 |
" |
|
4444 |
Display glVersion |
|
4445 |
" |
|
4446 |
! |
|
4447 |
||
528 | 4448 |
glxGetplanesIn: aGLXWindowId |
4449 |
"Returns the number if bit planes available on the device." |
|
4450 |
||
4451 |
%{ /* NOCONTEXT */ |
|
1932 | 4452 |
SETWIN(aGLXWindowId) |
4453 |
#ifdef OPENGL |
|
4454 |
#else |
|
528 | 4455 |
RETURN (__MKSMALLINT(getplanes())); |
4456 |
#endif |
|
1932 | 4457 |
%}. |
4458 |
^ 0 |
|
528 | 4459 |
|
4460 |
"Modified: 19.3.1996 / 18:50:44 / cg" |
|
4461 |
! |
|
4462 |
||
294 | 4463 |
hasStereoExtension |
4464 |
"return true, if this workstation supports stereo GL drawing. |
|
4465 |
Both the server must support it, and the feature must have been |
|
4466 |
enabled in the smalltalk system, for true to be returned." |
|
4467 |
||
4468 |
^ hasStereoExtension |
|
4469 |
||
4470 |
" |
|
4471 |
Display hasStereoExtension |
|
4472 |
" |
|
4473 |
! |
|
4474 |
||
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4475 |
isTrueGL |
1932 | 4476 |
"return true, if this is a true GL (as opposed to a simulated VOGL). |
4477 |
Returns false for all openGL systems." |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4478 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4479 |
%{ /* NOCONTEXT */ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4480 |
#ifdef VGL |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4481 |
RETURN ( false ); |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4482 |
#else |
1932 | 4483 |
# ifdef GLX |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4484 |
RETURN ( true ); |
1932 | 4485 |
# else |
4486 |
RETURN (false); |
|
4487 |
# endif |
|
4488 |
#endif |
|
4489 |
%} |
|
4490 |
! |
|
4491 |
||
4492 |
isOpenGL |
|
4493 |
"return true, if this is an openGL (as opposed to a GL)" |
|
4494 |
||
4495 |
%{ /* NOCONTEXT */ |
|
4496 |
#ifdef OPENGL |
|
4497 |
RETURN ( true ); |
|
4498 |
#else |
|
4499 |
RETURN ( false ); |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4500 |
#endif |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4501 |
%} |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4502 |
! |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4503 |
|
294 | 4504 |
maxZValue |
4505 |
"return the max. Z value (only valid if z-buffer is supported)" |
|
4506 |
%{ |
|
1932 | 4507 |
#ifndef OPENGL |
4508 |
# ifdef GD_ZMAX |
|
294 | 4509 |
long zMax; |
4510 |
||
4511 |
if (_INST(glOK) == true) { |
|
4512 |
zMax = getgdesc(GD_ZMAX); |
|
4513 |
||
4514 |
if ((zMax >= _MIN_INT) && (zMax <= _MAX_INT)) { |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4515 |
RETURN ( __MKSMALLINT(zMax) ); |
294 | 4516 |
} |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4517 |
RETURN ( __MKLARGEINT(zMax) ); |
294 | 4518 |
} |
1932 | 4519 |
# endif |
294 | 4520 |
#endif |
4521 |
%}. |
|
4522 |
^ nil |
|
4523 |
! |
|
4524 |
||
4525 |
supportsDoubleBuffer |
|
4526 |
"return true, if this gl workstation supports double buffering. |
|
157 | 4527 |
For portable applications, always combine this with a query |
4528 |
if the display supports GL drawing at all." |
|
24 | 4529 |
|
4530 |
%{ /* NOCONTEXT */ |
|
294 | 4531 |
|
1932 | 4532 |
#ifndef OPENGL |
4533 |
# ifdef VGL |
|
4534 |
RETURN (true); |
|
4535 |
# else |
|
4536 |
# ifdef GD_BITS_NORM_DBL_RED |
|
294 | 4537 |
if (getgdesc(GD_BITS_NORM_DBL_RED) != 0) { |
4538 |
RETURN ( _INST(glOK) ); |
|
4539 |
} |
|
1932 | 4540 |
# endif |
4541 |
# endif |
|
24 | 4542 |
#endif |
89 | 4543 |
%}. |
4544 |
^ false |
|
4545 |
||
4546 |
" |
|
294 | 4547 |
Display supportsDoubleBuffer |
4548 |
" |
|
4549 |
! |
|
4550 |
||
4551 |
supportsGLDrawing |
|
4552 |
"return true, if this device supports 3D GL drawing." |
|
4553 |
||
4554 |
^ glOK |
|
4555 |
||
4556 |
" |
|
4557 |
Display supportsGLDrawing |
|
89 | 4558 |
" |
64 | 4559 |
! |
4560 |
||
4561 |
supportsLight |
|
157 | 4562 |
"return true, if this gl workstation supports light sources |
4563 |
(i.e. if its a real GL). |
|
4564 |
For portable applications, always combine this with a query |
|
4565 |
if the display supports GL drawing at all." |
|
89 | 4566 |
|
4567 |
%{ /* NOCONTEXT */ |
|
64 | 4568 |
#ifdef GLX |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4569 |
RETURN ( _INST(glOK) ); |
64 | 4570 |
#endif |
89 | 4571 |
%}. |
4572 |
^ false |
|
4573 |
||
4574 |
" |
|
4575 |
Display supportsLight |
|
4576 |
" |
|
4577 |
! |
|
4578 |
||
294 | 4579 |
supportsRGB |
4580 |
"return true, if this gl workstation supports rgb |
|
4581 |
(in addition to indexed) colors. Actually, we return true |
|
4582 |
for a real GL engine, false for the simulator here. |
|
4583 |
For portable applications, always combine this with a query |
|
4584 |
if the display supports GL drawing at all." |
|
4585 |
||
4586 |
%{ /* NOCONTEXT */ |
|
4587 |
#ifdef GLX |
|
4588 |
RETURN ( _INST(glOK) ); |
|
4589 |
#endif |
|
4590 |
%}. |
|
4591 |
^ false |
|
4592 |
||
4593 |
" |
|
4594 |
Display supportsRGB |
|
4595 |
" |
|
4596 |
! |
|
4597 |
||
89 | 4598 |
supportsTextures |
4599 |
"return true, if this gl workstation supports texture mapping |
|
157 | 4600 |
(i.e. if its a real GL). |
4601 |
For portable applications, always combine this with a query |
|
4602 |
if the display supports GL drawing at all." |
|
89 | 4603 |
|
4604 |
%{ /* NOCONTEXT */ |
|
1932 | 4605 |
#ifndef OPENGL |
4606 |
# ifdef GD_TEXTURE |
|
89 | 4607 |
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
|
4608 |
RETURN ( _INST(glOK) ); |
89 | 4609 |
} |
1932 | 4610 |
# endif |
89 | 4611 |
#endif |
4612 |
%}. |
|
4613 |
^ false |
|
4614 |
||
4615 |
" |
|
4616 |
Display supportsTextures |
|
4617 |
" |
|
4618 |
! |
|
4619 |
||
4620 |
supportsZBuffer |
|
157 | 4621 |
"return true, if this gl workstation has z buffer support. |
4622 |
For portable applications, always combine this with a query |
|
4623 |
if the display supports GL drawing at all." |
|
4624 |
||
89 | 4625 |
%{ /* NOCONTEXT */ |
4626 |
||
1932 | 4627 |
#ifndef OPENGL |
4628 |
# ifdef GD_BITS_NORM_ZBUFFER |
|
89 | 4629 |
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
|
4630 |
RETURN ( _INST(glOK) ); |
89 | 4631 |
} |
1932 | 4632 |
# endif |
89 | 4633 |
#endif |
4634 |
%}. |
|
4635 |
^ false |
|
4636 |
||
4637 |
" |
|
4638 |
Display supportsZBuffer |
|
4639 |
" |
|
294 | 4640 |
! ! |
4641 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4642 |
!GLXWorkstation methodsFor:'rectangles'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4643 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4644 |
glxRectX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4645 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4646 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4647 |
SETWIN(aGLXWindowId) |
1932 | 4648 |
#ifdef OPENGL |
4649 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4650 |
rect(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
1932 | 4651 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4652 |
%} |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4655 |
glxRectfX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4656 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4657 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4658 |
SETWIN(aGLXWindowId) |
1932 | 4659 |
#ifdef OPENGL |
4660 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4661 |
rectf(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
1932 | 4662 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4663 |
%} |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4666 |
glxRectfiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4667 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4668 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4669 |
SETWIN(aGLXWindowId) |
1932 | 4670 |
#ifdef OPENGL |
4671 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4672 |
rectfi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
1932 | 4673 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4674 |
%} |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4677 |
glxRectfsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4678 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4679 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4680 |
SETWIN(aGLXWindowId) |
1932 | 4681 |
#ifdef OPENGL |
4682 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4683 |
rectfs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
1932 | 4684 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4685 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4686 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4687 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4688 |
glxRectiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4689 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4690 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4691 |
SETWIN(aGLXWindowId) |
1932 | 4692 |
#ifdef OPENGL |
4693 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4694 |
recti(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
1932 | 4695 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4696 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4697 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4698 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4699 |
glxRectsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4700 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4701 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4702 |
SETWIN(aGLXWindowId) |
1932 | 4703 |
#ifdef OPENGL |
4704 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4705 |
rects(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
1932 | 4706 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4707 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4708 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4709 |
|
528 | 4710 |
!GLXWorkstation methodsFor:'spheres'! |
294 | 4711 |
|
4712 |
glxSphDraw:arrayOf4Floats in:aGLXWindowId |
|
4713 |
"argument must be an array(a matrix) of 4 floats containing the |
|
4714 |
sphere - in real GL only" |
|
4715 |
||
4716 |
%{ /* NOCONTEXT */ |
|
4717 |
#ifdef GLX |
|
4718 |
float vec[4], *v; |
|
4719 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4720 |
if (! (v = __glx_getFloatsFromInto(arrayOf4Floats, vec, 4))) RETURN(false); |
294 | 4721 |
SETWIN(aGLXWindowId) |
4722 |
sphdraw(v); |
|
1932 | 4723 |
#endif |
4724 |
%} |
|
294 | 4725 |
! |
4726 |
||
4727 |
glxSphDrawX:x y:y z:z radius:r in:aGLXWindowId |
|
4728 |
"arguments must be convertable to floats - in real GL only" |
|
4729 |
||
4730 |
%{ /* NOCONTEXT */ |
|
4731 |
#ifdef GLX |
|
4732 |
float vec[4]; |
|
4733 |
||
4734 |
_FLOAT_(x, vec[0]) |
|
4735 |
_FLOAT_(y, vec[1]) |
|
4736 |
_FLOAT_(z, vec[2]) |
|
4737 |
_FLOAT_(r, vec[3]) |
|
4738 |
SETWIN(aGLXWindowId) |
|
4739 |
sphdraw(vec); |
|
1932 | 4740 |
#endif |
4741 |
%} |
|
294 | 4742 |
! |
4743 |
||
4744 |
glxSphfreeIn: aGLXWindowId |
|
4745 |
||
4746 |
%{ /* NOCONTEXT */ |
|
4747 |
#ifdef GLX |
|
4748 |
SETWIN(aGLXWindowId) |
|
4749 |
sphfree(); |
|
1932 | 4750 |
#endif |
4751 |
%} |
|
294 | 4752 |
! |
4753 |
||
4754 |
glxSphgnpolysIn: aGLXWindowId |
|
4755 |
||
4756 |
%{ /* NOCONTEXT */ |
|
4757 |
#ifdef GLX |
|
4758 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4759 |
RETURN (__MKSMALLINT(sphgnpolys())); |
294 | 4760 |
#endif |
4761 |
%} |
|
4762 |
! |
|
4763 |
||
4764 |
glxSphmode: attribute value: value in: aGLXWindowId |
|
4765 |
||
4766 |
%{ /* NOCONTEXT */ |
|
4767 |
#ifdef GLX |
|
4768 |
SETWIN(aGLXWindowId) |
|
4769 |
sphmode(__intVal(attribute), __intVal(value)); |
|
1932 | 4770 |
#endif |
4771 |
%} |
|
294 | 4772 |
! |
4773 |
||
4774 |
glxSphobj: objid in: aGLXWindowId |
|
4775 |
||
4776 |
%{ /* NOCONTEXT */ |
|
4777 |
#ifdef GLX |
|
4778 |
SETWIN(aGLXWindowId) |
|
4779 |
sphobj(_objectVal(objid)); |
|
1932 | 4780 |
#endif |
4781 |
%} |
|
294 | 4782 |
! |
4783 |
||
4784 |
glxSphrotmatrix: mat in: aGLXWindowId |
|
4785 |
||
4786 |
%{ /* NOCONTEXT */ |
|
4787 |
#ifdef GLX |
|
4788 |
Matrix matrix, *m; |
|
4789 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4790 |
if (! (m = __glx_getFloatsFromMatrixInto(mat, &matrix))) RETURN (false); |
294 | 4791 |
SETWIN(aGLXWindowId) |
4792 |
sphrotmatrix(*m); |
|
1932 | 4793 |
#endif |
4794 |
%} |
|
294 | 4795 |
! ! |
4796 |
||
4797 |
!GLXWorkstation methodsFor:'stereo extension'! |
|
4798 |
||
528 | 4799 |
glxLeftbuffer: bool in: aGLXWindowId |
4800 |
||
4801 |
%{ /* NOCONTEXT */ |
|
4802 |
#ifdef FULL_GLX |
|
4803 |
SETWIN(aGLXWindowId) |
|
4804 |
leftbuffer(_booleanVal(bool)); |
|
1932 | 4805 |
#endif |
4806 |
%} |
|
528 | 4807 |
! |
4808 |
||
4809 |
glxMonobufferIn: aGLXWindowId |
|
4810 |
||
4811 |
%{ /* NOCONTEXT */ |
|
4812 |
#ifdef FULL_GLX |
|
4813 |
SETWIN(aGLXWindowId) |
|
4814 |
monobuffer(); |
|
1932 | 4815 |
#endif |
4816 |
%} |
|
528 | 4817 |
! |
4818 |
||
4819 |
glxRightbuffer: bool in: aGLXWindowId |
|
4820 |
||
4821 |
%{ /* NOCONTEXT */ |
|
4822 |
#ifdef FULL_GLX |
|
4823 |
SETWIN(aGLXWindowId) |
|
4824 |
rightbuffer(_booleanVal(bool)); |
|
1932 | 4825 |
#endif |
4826 |
%} |
|
528 | 4827 |
! |
4828 |
||
294 | 4829 |
stereoExtensionBuffer:aBufferSymbol for:aWindowId |
4830 |
"set the current stereo buffer; the argument may be one of: |
|
4831 |
#left -> STEREO_BUFFER_LEFT |
|
4832 |
#right -> STEREO_BUFFER_RIGHT |
|
4833 |
" |
|
4834 |
||
4835 |
%{ /* NOCONTEXT */ |
|
4836 |
#if defined(XSGIStereo) && defined(GLX) |
|
4837 |
Status status; |
|
4838 |
int buffer; |
|
4839 |
Window win; |
|
4840 |
||
4841 |
if (ISCONNECTED |
|
4842 |
&& __isExternalAddress(aWindowId)) { |
|
4843 |
win = _WindowVal(aWindowId); |
|
4844 |
if (aBufferSymbol == @symbol(left)) { |
|
4845 |
buffer = STEREO_BUFFER_LEFT; |
|
4846 |
} else { |
|
4847 |
if (aBufferSymbol == @symbol(right)) { |
|
4848 |
buffer = STEREO_BUFFER_RIGHT; |
|
4849 |
} else { |
|
4850 |
goto bad; |
|
4851 |
} |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4852 |
} |
294 | 4853 |
status = XSGISetStereoBuffer(myDpy, win, buffer); |
4854 |
RETURN ( status ? true : false); |
|
4855 |
} |
|
4856 |
bad: ; |
|
4857 |
#endif |
|
4858 |
%}. |
|
4859 |
self primitiveFailed |
|
4860 |
||
4861 |
" |
|
4862 |
|t v| |
|
4863 |
||
4864 |
t := StandardSystemView new. |
|
4865 |
t extent:300@300. |
|
4866 |
v := GLXView origin:0.0@0.0 corner:1.0@1.0 in:t. |
|
4867 |
t openAndWait. |
|
4868 |
||
4869 |
v device stereoExtensionBuffer:#left for:(v id). |
|
4870 |
(Delay forSeconds:10) wait. |
|
4871 |
v device stereoExtensionBuffer:#right for:(v id). |
|
4872 |
" |
|
4873 |
! |
|
4874 |
||
4875 |
stereoExtensionMode:aModeSymbol height:h offset:o for:aWindowId |
|
4876 |
"set the current stereo mode; the argument may be one of: |
|
4877 |
nil/false #off -> turn it off |
|
4878 |
#bottom -> STEREO_BOTTOM |
|
4879 |
#top -> STEREO_TOP |
|
4880 |
" |
|
4881 |
||
4882 |
%{ /* NOCONTEXT */ |
|
4883 |
#if defined(XSGIStereo) && defined(GLX) |
|
4884 |
Status status; |
|
4885 |
int mode; |
|
4886 |
unsigned short us_h, us_o; |
|
4887 |
Window win; |
|
4888 |
||
4889 |
if (ISCONNECTED |
|
4890 |
&& __bothSmallInteger(h, o) |
|
4891 |
&& __isExternalAddress(aWindowId)) { |
|
4892 |
win = _WindowVal(aWindowId); |
|
4893 |
if ((aModeSymbol == nil) |
|
4894 |
|| (aModeSymbol == false) |
|
4895 |
|| (aModeSymbol == @symbol(off))) { |
|
4896 |
mode = STEREO_OFF; |
|
4897 |
} else { |
|
4898 |
if (aModeSymbol == @symbol(bottom)) { |
|
4899 |
mode = STEREO_BOTTOM; |
|
4900 |
} else { |
|
4901 |
if (aModeSymbol == @symbol(top)) { |
|
4902 |
mode = STEREO_TOP; |
|
4903 |
} else { |
|
4904 |
goto bad; |
|
4905 |
} |
|
4906 |
} |
|
4907 |
} |
|
4908 |
us_h = __intVal(h); |
|
4909 |
us_o = __intVal(o); |
|
4910 |
status = XSGISetStereoMode(myDpy, win, us_h, us_o, mode); |
|
4911 |
RETURN ( status ? true : false); |
|
4912 |
} |
|
4913 |
bad: ; |
|
4914 |
#endif |
|
4915 |
%}. |
|
4916 |
self primitiveFailed |
|
4917 |
||
4918 |
" |
|
4919 |
Display stereoExtensionMode:#top height:492 offset:532 for:(Display rootWindowId). |
|
4920 |
(Delay forSeconds:10) wait. |
|
4921 |
Display stereoExtensionMode:#off height:0 offset:0 for:(Display rootWindowId). |
|
4922 |
" |
|
4923 |
! |
|
4924 |
||
4925 |
stereoExtensionModeIn:aWindowId |
|
4926 |
"return the current stereo mode for some window" |
|
4927 |
||
4928 |
%{ /* NOCONTEXT */ |
|
4929 |
#if defined(XSGIStereo) && defined(GLX) |
|
4930 |
int mode; |
|
4931 |
Window win; |
|
4932 |
||
4933 |
if (ISCONNECTED && __isExternalAddress(aWindowId)) { |
|
4934 |
win = _WindowVal(aWindowId); |
|
4935 |
mode = XSGIQueryStereoMode(myDpy, win); |
|
4936 |
switch (mode) { |
|
4937 |
case STEREO_OFF: |
|
4938 |
RETURN ( @symbol(off) ); |
|
4939 |
case STEREO_BOTTOM: |
|
4940 |
RETURN ( @symbol(bottom) ); |
|
4941 |
case STEREO_TOP: |
|
4942 |
RETURN ( @symbol(top) ); |
|
4943 |
} |
|
4944 |
RETURN ( @symbol(unsupported) ); |
|
4945 |
} |
|
4946 |
#endif |
|
4947 |
%}. |
|
4948 |
self primitiveFailed |
|
4949 |
||
4950 |
" |
|
4951 |
|v| |
|
4952 |
||
4953 |
v := StandardSystemView new. |
|
4954 |
v extent:300@300. |
|
4955 |
v openAndWait. |
|
4956 |
v device stereoExtensionModeIn:(v id) |
|
4957 |
||
4958 |
Display stereoExtensionModeIn:Display rootWindowId |
|
4959 |
" |
|
4960 |
! |
|
4961 |
||
4962 |
stereoExtensionVersion |
|
4963 |
"return the stereo extensions version as an array consisting of |
|
4964 |
major and minor numbers." |
|
4965 |
||
4966 |
%{ /* NOCONTEXT */ |
|
4967 |
#if defined(XSGIStereo) && defined(GLX) |
|
4968 |
Status status; |
|
4969 |
Display *dpy = myDpy; |
|
4970 |
int major, minor; |
|
4971 |
||
4972 |
if (ISCONNECTED) { |
|
4973 |
status = XSGIStereoQueryVersion(myDpy, &major, &minor); |
|
4974 |
if (status == True) { |
|
4975 |
RETURN ( __ARRAY_WITH2(__MKSMALLINT(major), __MKSMALLINT(minor))); |
|
4976 |
} |
|
89 | 4977 |
} |
4978 |
#endif |
|
4979 |
%}. |
|
294 | 4980 |
self primitiveFailed |
185 | 4981 |
|
4982 |
" |
|
294 | 4983 |
Display stereoExtensionVersion |
185 | 4984 |
" |
24 | 4985 |
! ! |
4986 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4987 |
!GLXWorkstation methodsFor:'texture data transfer'! |
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 |
glxT2d: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4990 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4991 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4992 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4993 |
double vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4994 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4995 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4996 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4997 |
t2d(c_v); |
1932 | 4998 |
#endif |
4999 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5000 |
! |
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 |
glxT2f: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5003 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5004 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5005 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5006 |
float vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5007 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5008 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5009 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5010 |
t2f(c_v); |
1932 | 5011 |
#endif |
5012 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5013 |
! |
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 |
glxT2i: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5016 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5017 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5018 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5019 |
long vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5020 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5021 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5022 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5023 |
t2i(c_v); |
1932 | 5024 |
#endif |
5025 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5026 |
! |
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 |
glxT2s: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5029 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5030 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5031 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5032 |
short vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5033 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5034 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5035 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5036 |
t2s(c_v); |
1932 | 5037 |
#endif |
5038 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5039 |
! |
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 |
glxT3d:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5042 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5043 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5044 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5045 |
double vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5046 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5047 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5048 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5049 |
t3d(c_v); |
1932 | 5050 |
#endif |
5051 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5052 |
! |
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 |
glxT3f:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5055 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5056 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5057 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5058 |
float vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5059 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5060 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5061 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5062 |
t3f(c_v); |
1932 | 5063 |
#endif |
5064 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5065 |
! |
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 |
glxT3i:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5068 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5069 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5070 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5071 |
long vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5072 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5073 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5074 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5075 |
t3i(c_v); |
1932 | 5076 |
#endif |
5077 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5078 |
! |
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 |
glxT3s:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5081 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5082 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5083 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5084 |
short vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5085 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5086 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5087 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5088 |
t3s(c_v); |
1932 | 5089 |
#endif |
5090 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5091 |
! |
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 |
glxT4d: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5094 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5095 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5096 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5097 |
double vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5098 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5099 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5100 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5101 |
t4d(c_v); |
1932 | 5102 |
#endif |
5103 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5104 |
! |
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 |
glxT4f: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5107 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5108 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5109 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5110 |
float vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5111 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5112 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5113 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5114 |
t4f(c_v); |
1932 | 5115 |
#endif |
5116 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5117 |
! |
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 |
glxT4i: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5120 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5121 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5122 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5123 |
long vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5124 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5125 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5126 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5127 |
t4i(c_v); |
1932 | 5128 |
#endif |
5129 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5130 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5131 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5132 |
glxT4s: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5133 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5134 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5135 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5136 |
short vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5137 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5138 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5139 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5140 |
t4s(c_v); |
1932 | 5141 |
#endif |
5142 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5143 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5144 |
|
294 | 5145 |
!GLXWorkstation methodsFor:'transformations'! |
5146 |
||
5147 |
glxRotate:angle axis:axis in:aGLXWindowId |
|
5148 |
"rotate the current matrix around the axis given by the axis arg, |
|
5149 |
which must be one of the symbols: #x, #y or #z. |
|
5150 |
The angle is in degrees." |
|
5151 |
||
5152 |
%{ /* NOCONTEXT */ |
|
5153 |
||
5154 |
char c_axis; |
|
5155 |
||
5156 |
if (axis == @symbol(x)) |
|
5157 |
c_axis = 'x'; |
|
5158 |
else if (axis == @symbol(y)) |
|
5159 |
c_axis = 'y'; |
|
5160 |
else if (axis == @symbol(z)) |
|
5161 |
c_axis = 'z'; |
|
5162 |
else { |
|
5163 |
RETURN (false); |
|
5164 |
} |
|
5165 |
||
5166 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5167 |
RETURN ( __glx_doRotate(angle, c_axis) ); |
294 | 5168 |
%} |
5169 |
! |
|
5170 |
||
5171 |
glxRotate:arrayOf3Floats in:aGLXWindowId |
|
5172 |
"rotate current matrix, given a 3-element vector (or more). |
|
5173 |
The elements of the array are degrees." |
|
5174 |
||
5175 |
%{ /* NOCONTEXT */ |
|
5176 |
||
5177 |
float vec[3], *v; |
|
5178 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5179 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5180 |
|
5181 |
SETWIN(aGLXWindowId) |
|
1932 | 5182 |
#ifdef OPENGL |
5183 |
#else |
|
294 | 5184 |
rot(v[0], 'x'); |
5185 |
rot(v[1], 'y'); |
|
5186 |
rot(v[2], 'z'); |
|
1932 | 5187 |
#endif |
294 | 5188 |
%} |
5189 |
! |
|
5190 |
||
5191 |
glxRotateI:angle axis:axis in:aGLXWindowId |
|
5192 |
"rotate the current matrix around the axis given by the axis arg, |
|
5193 |
which must be one of the symbols: #x, #y or #z. |
|
5194 |
The angle is an integer specifying tenths of a degree." |
|
5195 |
||
5196 |
%{ /* NOCONTEXT */ |
|
5197 |
||
5198 |
char c_axis; |
|
5199 |
||
5200 |
if (axis == @symbol(x)) |
|
5201 |
c_axis = 'x'; |
|
5202 |
else if (axis == @symbol(y)) |
|
5203 |
c_axis = 'y'; |
|
5204 |
else if (axis == @symbol(z)) |
|
5205 |
c_axis = 'z'; |
|
5206 |
else { |
|
5207 |
RETURN (false); |
|
5208 |
} |
|
5209 |
||
5210 |
if (__isSmallInteger(angle)) { |
|
5211 |
SETWIN(aGLXWindowId) |
|
1932 | 5212 |
#ifdef OPENGL |
5213 |
#else |
|
294 | 5214 |
rotate(__intVal(angle), c_axis); |
1932 | 5215 |
#endif |
294 | 5216 |
} |
5217 |
%} |
|
5218 |
! |
|
5219 |
||
5220 |
glxRotateIX:angle in:aGLXWindowId |
|
5221 |
"rotate the current matrix on x axis. |
|
5222 |
The angle is an integer specifying tenths of a degree." |
|
5223 |
||
5224 |
%{ /* NOCONTEXT */ |
|
5225 |
||
5226 |
if (__isSmallInteger(angle)) { |
|
5227 |
SETWIN(aGLXWindowId) |
|
1932 | 5228 |
#ifdef OPENGL |
5229 |
#else |
|
294 | 5230 |
rotate(__intVal(angle), 'x'); |
1932 | 5231 |
#endif |
294 | 5232 |
} |
5233 |
%} |
|
5234 |
! |
|
5235 |
||
5236 |
glxRotateIX:xAngle y:yAngle z:zAngle in:aGLXWindowId |
|
5237 |
"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
|
5238 |
The values are smallIntegers specifying tenths of a degree." |
294 | 5239 |
|
5240 |
%{ /* NOCONTEXT */ |
|
5241 |
||
5242 |
if (__bothSmallInteger(xAngle, yAngle) |
|
5243 |
&& __isSmallInteger(zAngle)) { |
|
5244 |
SETWIN(aGLXWindowId) |
|
1932 | 5245 |
#ifdef OPENGL |
5246 |
#else |
|
294 | 5247 |
rotate(__intVal(xAngle), 'x'); |
5248 |
rotate(__intVal(yAngle), 'y'); |
|
5249 |
rotate(__intVal(zAngle), 'z'); |
|
1932 | 5250 |
#endif |
294 | 5251 |
} |
5252 |
%} |
|
5253 |
! |
|
5254 |
||
5255 |
glxRotateIY:angle in:aGLXWindowId |
|
5256 |
"rotate the current matrix on x axis. |
|
5257 |
The angle is an integer specifying tenths of a degree." |
|
5258 |
||
5259 |
%{ /* NOCONTEXT */ |
|
5260 |
||
5261 |
if (__isSmallInteger(angle)) { |
|
5262 |
SETWIN(aGLXWindowId) |
|
1932 | 5263 |
#ifdef OPENGL |
5264 |
#else |
|
294 | 5265 |
rotate(__intVal(angle), 'y'); |
1932 | 5266 |
#endif |
294 | 5267 |
} |
5268 |
%} |
|
5269 |
! |
|
5270 |
||
5271 |
glxRotateIZ:angle in:aGLXWindowId |
|
5272 |
"rotate the current matrix on x axis. |
|
5273 |
The angle is an integer specifying tenths of a degree." |
|
5274 |
||
5275 |
%{ /* NOCONTEXT */ |
|
5276 |
||
5277 |
if (__isSmallInteger(angle)) { |
|
5278 |
SETWIN(aGLXWindowId) |
|
1932 | 5279 |
#ifdef OPENGL |
5280 |
#else |
|
294 | 5281 |
rotate(__intVal(angle), 'z'); |
1932 | 5282 |
#endif |
294 | 5283 |
} |
5284 |
%} |
|
5285 |
! |
|
5286 |
||
5287 |
glxRotateX:angle in:aGLXWindowId |
|
5288 |
"rotate the current matrix on x axis. |
|
5289 |
The angle is in degrees." |
|
5290 |
||
5291 |
%{ /* NOCONTEXT */ |
|
5292 |
||
5293 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5294 |
RETURN (__glx_doRotate(angle, 'x')); |
294 | 5295 |
%} |
5296 |
! |
|
5297 |
||
5298 |
glxRotateX:xAngle y:yAngle z:zAngle in:aGLXWindowId |
|
5299 |
"rotate the current matrix on all axes, given individual x, y and z values. |
|
5300 |
The values are in degrees" |
|
5301 |
||
5302 |
%{ /* NOCONTEXT */ |
|
5303 |
||
5304 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5305 |
if ( __glx_doRotate(xAngle, 'x') == true) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5306 |
if ( __glx_doRotate(yAngle, 'y') == true) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5307 |
RETURN (__glx_doRotate(zAngle, 'z')); |
294 | 5308 |
} |
5309 |
} |
|
5310 |
%} |
|
5311 |
! |
|
5312 |
||
5313 |
glxRotateY:angle in:aGLXWindowId |
|
5314 |
"rotate the current matrix on y axis. |
|
5315 |
The angle is in degrees." |
|
5316 |
||
5317 |
%{ /* NOCONTEXT */ |
|
5318 |
||
5319 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5320 |
RETURN (__glx_doRotate(angle, 'y')); |
294 | 5321 |
%} |
5322 |
! |
|
5323 |
||
5324 |
glxRotateZ:angle in:aGLXWindowId |
|
5325 |
"rotate the current matrix on z axis. |
|
5326 |
The angle is in degrees." |
|
5327 |
||
5328 |
%{ /* NOCONTEXT */ |
|
5329 |
||
5330 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5331 |
RETURN (__glx_doRotate(angle, 'z')); |
294 | 5332 |
%} |
5333 |
! |
|
5334 |
||
5335 |
glxScale:arrayOf3Floats in:aGLXWindowId |
|
5336 |
"scale current matrix, given a 3-element vector" |
|
5337 |
||
5338 |
%{ /* NOCONTEXT */ |
|
5339 |
||
5340 |
float vec[3], *v; |
|
5341 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5342 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5343 |
|
5344 |
SETWIN(aGLXWindowId) |
|
1932 | 5345 |
#ifdef OPENGL |
5346 |
#else |
|
294 | 5347 |
scale(v[0], v[1], v[2]); |
1932 | 5348 |
#endif |
294 | 5349 |
%} |
5350 |
! |
|
5351 |
||
5352 |
glxScaleX:x in:aGLXWindowId |
|
5353 |
"scale in x direction" |
|
5354 |
||
5355 |
%{ /* NOCONTEXT */ |
|
5356 |
||
5357 |
float f_x; |
|
5358 |
||
5359 |
_FLOAT_ (x, f_x) |
|
5360 |
SETWIN(aGLXWindowId) |
|
1932 | 5361 |
#ifdef OPENGL |
5362 |
#else |
|
294 | 5363 |
scale(f_x, (float)0, (float)0); |
1932 | 5364 |
#endif |
294 | 5365 |
%} |
5366 |
! |
|
5367 |
||
5368 |
glxScaleX:x y:y z:z in:aGLXWindowId |
|
5369 |
"scale & mirror current matrix, given individual x, y and z values" |
|
5370 |
||
5371 |
%{ /* NOCONTEXT */ |
|
5372 |
||
5373 |
float f_x, f_y, f_z; |
|
5374 |
||
5375 |
_FLOAT_ (x, f_x) |
|
5376 |
_FLOAT_ (y, f_y) |
|
5377 |
_FLOAT_ (z, f_z) |
|
5378 |
SETWIN(aGLXWindowId) |
|
1932 | 5379 |
#ifdef OPENGL |
5380 |
#else |
|
294 | 5381 |
scale(f_x, f_y, f_z); |
1932 | 5382 |
#endif |
294 | 5383 |
%} |
5384 |
! |
|
5385 |
||
5386 |
glxScaleY:y in:aGLXWindowId |
|
5387 |
"scale in y direction" |
|
5388 |
||
5389 |
%{ /* NOCONTEXT */ |
|
5390 |
||
5391 |
float f_y; |
|
5392 |
||
5393 |
_FLOAT_ (y, f_y) |
|
5394 |
SETWIN(aGLXWindowId) |
|
1932 | 5395 |
#ifdef OPENGL |
5396 |
#else |
|
294 | 5397 |
scale((float)0, f_y, (float)0); |
1932 | 5398 |
#endif |
294 | 5399 |
%} |
5400 |
! |
|
5401 |
||
5402 |
glxScaleZ:z in:aGLXWindowId |
|
5403 |
"scale in z direction" |
|
5404 |
||
5405 |
%{ /* NOCONTEXT */ |
|
5406 |
||
5407 |
float f_z; |
|
5408 |
||
5409 |
_FLOAT_ (z, f_z) |
|
5410 |
SETWIN(aGLXWindowId) |
|
1932 | 5411 |
#ifdef OPENGL |
5412 |
#else |
|
294 | 5413 |
scale((float)0, (float)0, f_z); |
1932 | 5414 |
#endif |
294 | 5415 |
%} |
5416 |
! |
|
5417 |
||
5418 |
glxTranslate:arrayOf3Floats in:aGLXWindowId |
|
5419 |
"translate current matrix, given a 3-element vector" |
|
5420 |
||
5421 |
%{ /* NOCONTEXT */ |
|
5422 |
||
5423 |
float vec[3], *v; |
|
5424 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5425 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5426 |
|
5427 |
SETWIN(aGLXWindowId) |
|
1932 | 5428 |
#ifdef OPENGL |
5429 |
#else |
|
294 | 5430 |
translate((Coord)(v[0]), (Coord)(v[1]), (Coord)(v[2])); |
1932 | 5431 |
#endif |
294 | 5432 |
%} |
5433 |
! |
|
5434 |
||
5435 |
glxTranslateX:x in:aGLXWindowId |
|
5436 |
"translate current matrix on X axis" |
|
5437 |
||
5438 |
%{ /* NOCONTEXT */ |
|
5439 |
||
5440 |
Coord c_x; |
|
5441 |
||
5442 |
_COORD_ (x, c_x) |
|
5443 |
SETWIN(aGLXWindowId) |
|
1932 | 5444 |
#ifdef OPENGL |
5445 |
#else |
|
294 | 5446 |
translate(c_x, (Coord)0, (Coord)0); |
1932 | 5447 |
#endif |
294 | 5448 |
%} |
5449 |
! |
|
5450 |
||
5451 |
glxTranslateX:x y:y z:z in:aGLXWindowId |
|
5452 |
"translate current matrix, given individual x, y and z values" |
|
5453 |
||
5454 |
%{ /* NOCONTEXT */ |
|
5455 |
||
5456 |
Coord c_x, c_y, c_z; |
|
5457 |
||
5458 |
_COORD_ (x, c_x) |
|
5459 |
_COORD_ (y, c_y) |
|
5460 |
_COORD_ (z, c_z) |
|
5461 |
SETWIN(aGLXWindowId) |
|
1932 | 5462 |
#ifdef OPENGL |
5463 |
#else |
|
294 | 5464 |
translate(c_x, c_y, c_z); |
1932 | 5465 |
#endif |
294 | 5466 |
%} |
5467 |
! |
|
5468 |
||
5469 |
glxTranslateY:y in:aGLXWindowId |
|
5470 |
"translate current matrix on Y axis" |
|
5471 |
||
5472 |
%{ /* NOCONTEXT */ |
|
5473 |
||
5474 |
Coord c_y; |
|
5475 |
||
5476 |
_COORD_ (y, c_y) |
|
5477 |
SETWIN(aGLXWindowId) |
|
1932 | 5478 |
#ifdef OPENGL |
5479 |
#else |
|
294 | 5480 |
translate((Coord)0, c_y, (Coord)0); |
1932 | 5481 |
#endif |
294 | 5482 |
%} |
5483 |
! |
|
5484 |
||
5485 |
glxTranslateZ:z in:aGLXWindowId |
|
5486 |
"translate current matrix on Z axis" |
|
5487 |
||
5488 |
%{ /* NOCONTEXT */ |
|
5489 |
||
5490 |
Coord c_z; |
|
5491 |
||
5492 |
_COORD_ (z, c_z) |
|
5493 |
SETWIN(aGLXWindowId) |
|
1932 | 5494 |
#ifdef OPENGL |
5495 |
#else |
|
294 | 5496 |
translate((Coord)0, (Coord)0, c_z); |
1932 | 5497 |
#endif |
294 | 5498 |
%} |
5499 |
! ! |
|
5500 |
||
5501 |
!GLXWorkstation methodsFor:'unspecified rest'! |
|
5502 |
||
5503 |
glxAcbufOp:op value:value in:aGLXWindowId |
|
5504 |
||
5505 |
%{ /* NOCONTEXT */ |
|
1932 | 5506 |
SETWIN(aGLXWindowId) |
5507 |
#ifdef GLX |
|
294 | 5508 |
acbuf(__intVal(op), _floatVal(value)); |
1932 | 5509 |
#endif |
5510 |
%} |
|
294 | 5511 |
! |
5512 |
||
5513 |
glxAcsizePlanes: planes in: aGLXWindowId |
|
5514 |
||
5515 |
%{ /* NOCONTEXT */ |
|
1932 | 5516 |
SETWIN(aGLXWindowId) |
5517 |
#ifdef GLX |
|
294 | 5518 |
acsize(__intVal(planes)); |
1932 | 5519 |
#endif |
5520 |
%} |
|
294 | 5521 |
! |
5522 |
||
5523 |
glxAfunctionRef: ref func: func in: aGLXWindowId |
|
5524 |
||
5525 |
%{ /* NOCONTEXT */ |
|
1932 | 5526 |
SETWIN(aGLXWindowId) |
5527 |
#ifdef GLX |
|
294 | 5528 |
afunction(__intVal(ref), __intVal(func)); |
1932 | 5529 |
#endif |
5530 |
%} |
|
294 | 5531 |
! |
5532 |
||
5533 |
glxBbox2Xmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5534 |
||
5535 |
%{ /* NOCONTEXT */ |
|
5536 |
Screencoord c_xmin, c_ymin; |
|
5537 |
Coord c_x1, c_y1, c_x2, c_y2; |
|
5538 |
||
5539 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5540 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5541 |
_COORD_ (x1, c_x1) |
|
5542 |
_COORD_ (y1, c_y1) |
|
5543 |
_COORD_ (x2, c_x2) |
|
5544 |
_COORD_ (y2, c_y2) |
|
5545 |
SETWIN(aGLXWindowId) |
|
1932 | 5546 |
#ifdef GLX |
294 | 5547 |
bbox2(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5548 |
#endif |
5549 |
%} |
|
294 | 5550 |
! |
5551 |
||
5552 |
glxBbox2iXmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5553 |
||
5554 |
%{ /* NOCONTEXT */ |
|
5555 |
Screencoord c_xmin, c_ymin; |
|
5556 |
Icoord c_x1, c_y1, c_x2, c_y2; |
|
5557 |
||
5558 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5559 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5560 |
_ICOORD_ (x1, c_x1) |
|
5561 |
_ICOORD_ (y1, c_y1) |
|
5562 |
_ICOORD_ (x2, c_x2) |
|
5563 |
_ICOORD_ (y2, c_y2) |
|
5564 |
SETWIN(aGLXWindowId) |
|
1932 | 5565 |
#ifdef GLX |
294 | 5566 |
bbox2i(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5567 |
#endif |
5568 |
%} |
|
294 | 5569 |
! |
5570 |
||
5571 |
glxBbox2sXmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5572 |
||
5573 |
%{ /* NOCONTEXT */ |
|
5574 |
Screencoord c_xmin, c_ymin; |
|
5575 |
Scoord c_x1, c_y1, c_x2, c_y2; |
|
5576 |
||
5577 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5578 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5579 |
_SCOORD_ (x1, c_x1) |
|
5580 |
_SCOORD_ (y1, c_y1) |
|
5581 |
_SCOORD_ (x2, c_x2) |
|
5582 |
_SCOORD_ (y2, c_y2) |
|
5583 |
SETWIN(aGLXWindowId) |
|
1932 | 5584 |
#ifdef GLX |
294 | 5585 |
bbox2s(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5586 |
#endif |
5587 |
%} |
|
294 | 5588 |
! |
5589 |
||
5590 |
glxBeginTrimIn: aGLXWindowId |
|
5591 |
||
5592 |
%{ /* NOCONTEXT */ |
|
1932 | 5593 |
SETWIN(aGLXWindowId) |
5594 |
#ifdef GLX |
|
294 | 5595 |
bgntrim(); |
1932 | 5596 |
#endif |
5597 |
%} |
|
294 | 5598 |
! |
5599 |
||
5600 |
glxBlankscreen: b in: aGLXWindowId |
|
5601 |
||
5602 |
%{ /* NOCONTEXT */ |
|
1932 | 5603 |
SETWIN(aGLXWindowId) |
5604 |
#ifdef GLX |
|
294 | 5605 |
blankscreen(_booleanVal(b)); |
1932 | 5606 |
#endif |
5607 |
%} |
|
294 | 5608 |
! |
5609 |
||
5610 |
glxBlanktime: count in: aGLXWindowId |
|
5611 |
||
5612 |
%{ /* NOCONTEXT */ |
|
1932 | 5613 |
SETWIN(aGLXWindowId) |
5614 |
#ifdef GLX |
|
294 | 5615 |
blanktime(__intVal(count)); |
1932 | 5616 |
#endif |
5617 |
%} |
|
294 | 5618 |
! |
5619 |
||
5620 |
glxBlendcolorRed: red green: green blue: blue alpha: alpha in: aGLXWindowId |
|
5621 |
||
5622 |
%{ /* NOCONTEXT */ |
|
1932 | 5623 |
SETWIN(aGLXWindowId) |
294 | 5624 |
#ifdef FULL_GLX |
5625 |
blendcolor(_floatVal(red), _floatVal(green), _floatVal(blue), _floatVal(alpha)); |
|
1932 | 5626 |
#endif |
5627 |
%} |
|
294 | 5628 |
! |
5629 |
||
5630 |
glxBlendfunctionSfactr: sfactr dfactr: dfactr in: aGLXWindowId |
|
5631 |
||
5632 |
%{ /* NOCONTEXT */ |
|
1932 | 5633 |
SETWIN(aGLXWindowId) |
5634 |
#ifdef GLX |
|
294 | 5635 |
blendfunction(__intVal(sfactr), __intVal(dfactr)); |
1932 | 5636 |
#endif |
5637 |
%} |
|
294 | 5638 |
! |
5639 |
||
5640 |
glxBlinkRate: rate i: i red: red green: green blue: blue in: aGLXWindowId |
|
5641 |
||
5642 |
%{ /* NOCONTEXT */ |
|
1932 | 5643 |
SETWIN(aGLXWindowId) |
5644 |
#ifdef GLX |
|
294 | 5645 |
blink(_shortVal(rate), _colorindexVal(i), |
5646 |
_shortVal(red), _shortVal(green), _shortVal(blue)); |
|
1932 | 5647 |
#endif |
5648 |
%} |
|
294 | 5649 |
! |
5650 |
||
5651 |
glxBlkqreadData: data n: n in: aGLXWindowId |
|
5652 |
||
5653 |
%{ /* NOCONTEXT */ |
|
1932 | 5654 |
int rslt = -1; |
5655 |
||
5656 |
SETWIN(aGLXWindowId) |
|
5657 |
#ifdef GLX |
|
5658 |
rslt = blkqread((short *)_indexedArea(data), __intVal(n)); |
|
5659 |
#endif |
|
5660 |
RETURN (__MKSMALLINT(rslt)); |
|
5661 |
%} |
|
294 | 5662 |
! |
5663 |
||
5664 |
glxC3f: v in: aGLXWindowId |
|
5665 |
||
5666 |
%{ /* NOCONTEXT */ |
|
5667 |
float vec[3], *c_v; |
|
5668 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5669 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
294 | 5670 |
SETWIN(aGLXWindowId) |
1932 | 5671 |
#ifdef GLX |
294 | 5672 |
c3f(c_v); |
1932 | 5673 |
#endif |
5674 |
%} |
|
294 | 5675 |
! |
5676 |
||
5677 |
glxC3i: v in: aGLXWindowId |
|
5678 |
||
5679 |
%{ /* NOCONTEXT */ |
|
5680 |
long vec[3], *c_v; |
|
5681 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5682 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
294 | 5683 |
SETWIN(aGLXWindowId) |
1932 | 5684 |
#ifdef GLX |
294 | 5685 |
c3i(c_v); |
1932 | 5686 |
#endif |
5687 |
%} |
|
294 | 5688 |
! |
5689 |
||
5690 |
glxC3s: v in: aGLXWindowId |
|
5691 |
||
5692 |
%{ /* NOCONTEXT */ |
|
5693 |
short vec[3], *c_v; |
|
5694 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5695 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
294 | 5696 |
SETWIN(aGLXWindowId) |
1932 | 5697 |
#ifdef GLX |
294 | 5698 |
c3s(c_v); |
1932 | 5699 |
#endif |
5700 |
%} |
|
294 | 5701 |
! |
5702 |
||
5703 |
glxC4f: v in: aGLXWindowId |
|
5704 |
||
5705 |
%{ /* NOCONTEXT */ |
|
5706 |
float vec[4], *c_v; |
|
5707 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5708 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
294 | 5709 |
SETWIN(aGLXWindowId) |
1932 | 5710 |
#ifdef GLX |
294 | 5711 |
c4f(c_v); |
1932 | 5712 |
#endif |
5713 |
%} |
|
294 | 5714 |
! |
5715 |
||
5716 |
glxC4i: v in: aGLXWindowId |
|
5717 |
||
5718 |
%{ /* NOCONTEXT */ |
|
5719 |
long vec[4], *c_v; |
|
5720 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5721 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
294 | 5722 |
SETWIN(aGLXWindowId) |
1932 | 5723 |
#ifdef GLX |
294 | 5724 |
c4i(c_v); |
1932 | 5725 |
#endif |
5726 |
%} |
|
294 | 5727 |
! |
5728 |
||
5729 |
glxC4s: v in: aGLXWindowId |
|
5730 |
||
5731 |
%{ /* NOCONTEXT */ |
|
5732 |
short vec[4], *c_v; |
|
5733 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5734 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
294 | 5735 |
SETWIN(aGLXWindowId) |
1932 | 5736 |
#ifdef GLX |
294 | 5737 |
c4s(c_v); |
1932 | 5738 |
#endif |
5739 |
%} |
|
294 | 5740 |
! |
5741 |
||
5742 |
glxClearhitcodeIn: aGLXWindowId |
|
5743 |
||
5744 |
%{ /* NOCONTEXT */ |
|
1932 | 5745 |
SETWIN(aGLXWindowId) |
5746 |
#ifdef GLX |
|
294 | 5747 |
clearhitcode(); |
1932 | 5748 |
#endif |
5749 |
%} |
|
294 | 5750 |
! |
5751 |
||
5752 |
glxClipplaneIndex: index mode: mode params: params in: aGLXWindowId |
|
5753 |
||
5754 |
%{ /* NOCONTEXT */ |
|
5755 |
float vec[4], *v; |
|
5756 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5757 |
if (! (v = __glx_getFloatsFromInto(params, vec, 4))) RETURN(false); |
294 | 5758 |
SETWIN(aGLXWindowId) |
1932 | 5759 |
#ifdef GLX |
294 | 5760 |
clipplane(__intVal(index), __intVal(mode), v); |
1932 | 5761 |
#endif |
5762 |
%} |
|
294 | 5763 |
! |
5764 |
||
5765 |
glxCmodeIn: aGLXWindowId |
|
5766 |
||
5767 |
%{ /* NOCONTEXT */ |
|
1932 | 5768 |
SETWIN(aGLXWindowId) |
5769 |
#ifdef GLX |
|
294 | 5770 |
cmode(); |
1932 | 5771 |
#endif |
5772 |
%} |
|
294 | 5773 |
! |
5774 |
||
5775 |
glxColorfIndex: index in: aGLXWindowId |
|
5776 |
||
5777 |
^self glxColor: index in: aGLXWindowId |
|
5778 |
! |
|
5779 |
||
5780 |
glxCuroriginN: n xorigin: xorigin yorigin: yorigin in: aGLXWindowId |
|
5781 |
||
5782 |
%{ /* NOCONTEXT */ |
|
1932 | 5783 |
SETWIN(aGLXWindowId) |
5784 |
#ifdef GLX |
|
294 | 5785 |
curorigin(_shortVal(n), _shortVal(xorigin), _shortVal(yorigin)); |
1932 | 5786 |
#endif |
5787 |
%} |
|
294 | 5788 |
! |
5789 |
||
5790 |
glxCursoffIn: aGLXWindowId |
|
5791 |
||
5792 |
%{ /* NOCONTEXT */ |
|
1932 | 5793 |
SETWIN(aGLXWindowId) |
5794 |
#ifdef GLX |
|
294 | 5795 |
cursoff(); |
1932 | 5796 |
#endif |
5797 |
%} |
|
294 | 5798 |
! |
5799 |
||
5800 |
glxCursonIn: aGLXWindowId |
|
5801 |
||
5802 |
%{ /* NOCONTEXT */ |
|
1932 | 5803 |
SETWIN(aGLXWindowId) |
5804 |
#ifdef GLX |
|
294 | 5805 |
curson(); |
1932 | 5806 |
#endif |
5807 |
%} |
|
294 | 5808 |
! |
5809 |
||
5810 |
glxCurstype: type in: aGLXWindowId |
|
5811 |
||
5812 |
%{ /* NOCONTEXT */ |
|
1932 | 5813 |
SETWIN(aGLXWindowId) |
5814 |
#ifdef GLX |
|
294 | 5815 |
curstype(__intVal(type)); |
1932 | 5816 |
#endif |
5817 |
%} |
|
294 | 5818 |
! |
5819 |
||
5820 |
glxCyclemapDuration: duration map: map nxtmap: nxtmap in: aGLXWindowId |
|
5821 |
||
5822 |
%{ /* NOCONTEXT */ |
|
1932 | 5823 |
SETWIN(aGLXWindowId) |
5824 |
#ifdef GLX |
|
294 | 5825 |
cyclemap(_shortVal(duration), _shortVal(map), _shortVal(nxtmap)); |
1932 | 5826 |
#endif |
5827 |
%} |
|
294 | 5828 |
! |
5829 |
||
5830 |
glxDefpatternN: n size: size mask: mask in: aGLXWindowId |
|
5831 |
||
5832 |
%{ /* NOCONTEXT */ |
|
1932 | 5833 |
SETWIN(aGLXWindowId) |
5834 |
#ifdef GLX |
|
294 | 5835 |
defpattern(_shortVal(n), _shortVal(size), (unsigned short *)_indexedArea(mask)); |
1932 | 5836 |
#endif |
5837 |
%} |
|
294 | 5838 |
! |
5839 |
||
5840 |
glxDeltag: t in: aGLXWindowId |
|
5841 |
||
5842 |
%{ /* NOCONTEXT */ |
|
1932 | 5843 |
SETWIN(aGLXWindowId) |
5844 |
#ifdef GLX |
|
294 | 5845 |
deltag(_tagVal(t)); |
1932 | 5846 |
#endif |
5847 |
%} |
|
294 | 5848 |
! |
5849 |
||
5850 |
glxDepthcueMode: mode in: aGLXWindowId |
|
5851 |
||
5852 |
%{ /* NOCONTEXT */ |
|
1932 | 5853 |
SETWIN(aGLXWindowId) |
5854 |
#ifdef GLX |
|
294 | 5855 |
depthcue(_booleanVal(mode)); |
1932 | 5856 |
#endif |
5857 |
%} |
|
294 | 5858 |
! |
5859 |
||
5860 |
glxDitherMode: mode in: aGLXWindowId |
|
5861 |
||
5862 |
%{ /* NOCONTEXT */ |
|
1932 | 5863 |
SETWIN(aGLXWindowId) |
5864 |
#ifdef GLX |
|
294 | 5865 |
dither(_longVal(mode)); |
1932 | 5866 |
#endif |
5867 |
%} |
|
294 | 5868 |
! |
5869 |
||
5870 |
glxDopup: pup in: aGLXWindowId |
|
5871 |
||
5872 |
%{ /* NOCONTEXT */ |
|
1932 | 5873 |
SETWIN(aGLXWindowId) |
5874 |
#ifdef GLX |
|
294 | 5875 |
dopup(_longVal(pup)); |
1932 | 5876 |
#endif |
5877 |
%} |
|
294 | 5878 |
! |
5879 |
||
5880 |
glxDrawmode: mode in: aGLXWindowId |
|
5881 |
||
5882 |
%{ /* NOCONTEXT */ |
|
1932 | 5883 |
SETWIN(aGLXWindowId) |
5884 |
#ifdef GLX |
|
294 | 5885 |
drawmode(_longVal(mode)); |
1932 | 5886 |
#endif |
5887 |
%} |
|
294 | 5888 |
! |
5889 |
||
5890 |
glxEditobj: obj in: aGLXWindowId |
|
5891 |
||
5892 |
%{ /* NOCONTEXT */ |
|
1932 | 5893 |
SETWIN(aGLXWindowId) |
5894 |
#ifdef GLX |
|
294 | 5895 |
editobj(_objectVal(obj)); |
1932 | 5896 |
#endif |
5897 |
%} |
|
294 | 5898 |
! |
5899 |
||
5900 |
glxEndTrimIn: aGLXWindowId |
|
5901 |
||
5902 |
%{ /* NOCONTEXT */ |
|
1932 | 5903 |
SETWIN(aGLXWindowId) |
5904 |
#ifdef GLX |
|
294 | 5905 |
endtrim(); |
1932 | 5906 |
#endif |
5907 |
%} |
|
294 | 5908 |
! |
5909 |
||
5910 |
glxEndfullscrnIn: aGLXWindowId |
|
5911 |
||
5912 |
%{ /* NOCONTEXT */ |
|
1932 | 5913 |
SETWIN(aGLXWindowId) |
5914 |
#ifdef GLX |
|
294 | 5915 |
endfullscrn(); |
1932 | 5916 |
#endif |
5917 |
%} |
|
294 | 5918 |
! |
5919 |
||
5920 |
glxEndpupmodeIn: aGLXWindowId |
|
5921 |
||
5922 |
%{ /* NOCONTEXT */ |
|
1932 | 5923 |
SETWIN(aGLXWindowId) |
5924 |
#ifdef GLX |
|
294 | 5925 |
endpupmode(); |
1932 | 5926 |
#endif |
5927 |
%} |
|
294 | 5928 |
! |
5929 |
||
5930 |
glxFinishIn: aGLXWindowId |
|
5931 |
||
5932 |
%{ /* NOCONTEXT */ |
|
1932 | 5933 |
SETWIN(aGLXWindowId) |
5934 |
#ifdef GLX |
|
294 | 5935 |
finish(); |
1932 | 5936 |
#endif |
5937 |
%} |
|
294 | 5938 |
! |
5939 |
||
5940 |
glxFont: fntnum in: aGLXWindowId |
|
5941 |
||
5942 |
%{ /* NOCONTEXT */ |
|
5943 |
SETWIN(aGLXWindowId) |
|
1932 | 5944 |
#ifdef GLX |
294 | 5945 |
font(_shortVal(fntnum)); |
1932 | 5946 |
#endif |
294 | 5947 |
%} |
5948 |
! |
|
5949 |
||
5950 |
glxForegroundIn: aGLXWindowId |
|
5951 |
||
5952 |
%{ /* NOCONTEXT */ |
|
5953 |
SETWIN(aGLXWindowId) |
|
1932 | 5954 |
#ifdef OPENGL |
5955 |
#else |
|
294 | 5956 |
foreground(); |
1932 | 5957 |
#endif |
294 | 5958 |
%} |
5959 |
! |
|
5960 |
||
5961 |
glxFreepup: pup in: aGLXWindowId |
|
5962 |
||
5963 |
%{ /* NOCONTEXT */ |
|
1932 | 5964 |
SETWIN(aGLXWindowId) |
5965 |
#ifdef GLX |
|
294 | 5966 |
freepup(_longVal(pup)); |
1932 | 5967 |
#endif |
5968 |
%} |
|
294 | 5969 |
! |
5970 |
||
5971 |
glxFudgeXfudge: xfudge yfudge: yfudge in: aGLXWindowId |
|
5972 |
||
5973 |
%{ /* NOCONTEXT */ |
|
1932 | 5974 |
SETWIN(aGLXWindowId) |
5975 |
#ifdef GLX |
|
294 | 5976 |
fudge(_longVal(xfudge), _longVal(yfudge)); |
1932 | 5977 |
#endif |
5978 |
%} |
|
294 | 5979 |
! |
5980 |
||
5981 |
glxFullscrnIn: aGLXWindowId |
|
5982 |
||
5983 |
%{ /* NOCONTEXT */ |
|
1932 | 5984 |
SETWIN(aGLXWindowId) |
5985 |
#ifdef GLX |
|
294 | 5986 |
fullscrn(); |
1932 | 5987 |
#endif |
5988 |
%} |
|
294 | 5989 |
! |
5990 |
||
5991 |
glxGbeginIn: aGLXWindowId |
|
5992 |
||
5993 |
%{ /* NOCONTEXT */ |
|
1932 | 5994 |
SETWIN(aGLXWindowId) |
5995 |
#ifdef GLX |
|
294 | 5996 |
gbegin(); |
1932 | 5997 |
#endif |
5998 |
%} |
|
294 | 5999 |
! |
6000 |
||
6001 |
glxGentagIn: aGLXWindowId |
|
6002 |
||
6003 |
%{ /* NOCONTEXT */ |
|
1932 | 6004 |
int rslt = -1; |
6005 |
||
6006 |
#ifdef GLX |
|
6007 |
SETWIN(aGLXWindowId) |
|
6008 |
rslt = gentag(); |
|
6009 |
#endif |
|
6010 |
RETURN (__MKSMALLINT(rslt)); |
|
6011 |
%} |
|
294 | 6012 |
! |
6013 |
||
6014 |
glxGetbackfaceIn: aGLXWindowId |
|
6015 |
||
6016 |
%{ /* NOCONTEXT */ |
|
1932 | 6017 |
int rslt = -1; |
6018 |
||
6019 |
#ifdef GLX |
|
6020 |
SETWIN(aGLXWindowId) |
|
6021 |
rslt = getbackface(); |
|
6022 |
#endif |
|
6023 |
RETURN (__MKSMALLINT(rslt)); |
|
6024 |
%} |
|
294 | 6025 |
! |
6026 |
||
6027 |
glxGetbufferIn: aGLXWindowId |
|
6028 |
||
6029 |
%{ /* NOCONTEXT */ |
|
1932 | 6030 |
int rslt = -1; |
6031 |
||
6032 |
#ifdef GLX |
|
6033 |
SETWIN(aGLXWindowId) |
|
6034 |
rslt = getbuffer(); |
|
6035 |
#endif |
|
6036 |
RETURN (__MKSMALLINT(rslt)); |
|
6037 |
%} |
|
294 | 6038 |
! |
6039 |
||
6040 |
glxGetbutton: num in: aGLXWindowId |
|
6041 |
||
6042 |
%{ /* NOCONTEXT */ |
|
1932 | 6043 |
int rslt = -1; |
6044 |
||
6045 |
SETWIN(aGLXWindowId) |
|
6046 |
#ifdef OPENGL |
|
6047 |
#else |
|
6048 |
rslt = getbutton(_deviceVal(num)); |
|
6049 |
#endif |
|
6050 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6051 |
%} |
6052 |
! |
|
6053 |
||
6054 |
glxGetcmmodeIn: aGLXWindowId |
|
6055 |
||
6056 |
%{ /* NOCONTEXT */ |
|
1932 | 6057 |
int rslt = 0; |
6058 |
||
6059 |
SETWIN(aGLXWindowId) |
|
6060 |
#ifdef GLX |
|
6061 |
rslt = getcmmode(); |
|
6062 |
#endif |
|
6063 |
RETURN (__MKBOOLEAN(rslt)); |
|
6064 |
%} |
|
294 | 6065 |
! |
6066 |
||
6067 |
glxGetcolorIn: aGLXWindowId |
|
6068 |
"return the current drawing color" |
|
6069 |
||
6070 |
%{ /* NOCONTEXT */ |
|
1932 | 6071 |
int rslt = -1; |
6072 |
||
6073 |
SETWIN(aGLXWindowId) |
|
6074 |
#ifdef OPENGL |
|
6075 |
#else |
|
6076 |
rslt = getcolor(); |
|
6077 |
#endif |
|
6078 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6079 |
%} |
6080 |
! |
|
6081 |
||
6082 |
glxGetdcmIn: aGLXWindowId |
|
6083 |
||
6084 |
%{ /* NOCONTEXT */ |
|
6085 |
#ifdef GLX |
|
6086 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6087 |
RETURN (__MKBOOLEAN(getdcm())); |
294 | 6088 |
#endif |
6089 |
%} |
|
6090 |
. |
|
6091 |
^ false |
|
6092 |
! |
|
6093 |
||
6094 |
glxGetdescenderIn: aGLXWindowId |
|
6095 |
||
6096 |
%{ /* NOCONTEXT */ |
|
6097 |
#ifdef GLX |
|
6098 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6099 |
RETURN (__MKSMALLINT(getdescender())); |
294 | 6100 |
#endif |
6101 |
%} |
|
6102 |
. |
|
6103 |
^ false |
|
6104 |
! |
|
6105 |
||
6106 |
glxGetdisplaymodeIn: aGLXWindowId |
|
6107 |
||
6108 |
%{ /* NOCONTEXT */ |
|
6109 |
#ifdef GLX |
|
6110 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6111 |
RETURN (__MKSMALLINT(getdisplaymode())); |
294 | 6112 |
#endif |
6113 |
%} |
|
6114 |
. |
|
6115 |
^ false |
|
6116 |
! |
|
6117 |
||
6118 |
glxGetdrawmodeIn: aGLXWindowId |
|
6119 |
||
6120 |
%{ /* NOCONTEXT */ |
|
6121 |
#ifdef GLX |
|
6122 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6123 |
RETURN (__MKSMALLINT(getdrawmode())); |
294 | 6124 |
#endif |
6125 |
%} |
|
6126 |
. |
|
6127 |
^ false |
|
6128 |
! |
|
6129 |
||
6130 |
glxGetfontIn: aGLXWindowId |
|
6131 |
||
6132 |
%{ /* NOCONTEXT */ |
|
6133 |
#ifdef GLX |
|
6134 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6135 |
RETURN (__MKSMALLINT(getfont())); |
294 | 6136 |
#endif |
6137 |
%} |
|
6138 |
. |
|
6139 |
^ false |
|
6140 |
! |
|
6141 |
||
6142 |
glxGetgconfigBuffer: buffer in: aGLXWindowId |
|
6143 |
||
6144 |
%{ /* NOCONTEXT */ |
|
6145 |
#ifdef FULL_GLX |
|
6146 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6147 |
RETURN (__MKSMALLINT(getgconfig(_longVal(buffer)))); |
294 | 6148 |
#endif |
6149 |
%} |
|
6150 |
. |
|
6151 |
^ false |
|
6152 |
! |
|
6153 |
||
6154 |
glxGetgdescInquiry: inquiry in: aGLXWindowId |
|
6155 |
||
6156 |
%{ /* NOCONTEXT */ |
|
1932 | 6157 |
int rslt = 0; |
6158 |
||
6159 |
SETWIN(aGLXWindowId) |
|
6160 |
#ifdef OPENGL |
|
6161 |
#else |
|
6162 |
rslt = getgdesc(_longVal(inquiry)); |
|
6163 |
#endif |
|
6164 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6165 |
%} |
6166 |
! |
|
6167 |
||
6168 |
glxGetheightIn: aGLXWindowId |
|
6169 |
||
6170 |
%{ /* NOCONTEXT */ |
|
1932 | 6171 |
int rslt = 0; |
6172 |
||
6173 |
SETWIN(aGLXWindowId) |
|
6174 |
#ifdef OPENGL |
|
6175 |
#else |
|
6176 |
rslt = getheight(); |
|
6177 |
#endif |
|
6178 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6179 |
%} |
6180 |
! |
|
6181 |
||
6182 |
glxGethitcodeIn: aGLXWindowId |
|
6183 |
||
6184 |
%{ /* NOCONTEXT */ |
|
6185 |
#ifdef GLX |
|
6186 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6187 |
RETURN (__MKSMALLINT(gethitcode())); |
294 | 6188 |
#endif |
6189 |
%} |
|
6190 |
. |
|
6191 |
^ false |
|
6192 |
! |
|
6193 |
||
6194 |
glxGetlsbackupIn: aGLXWindowId |
|
6195 |
||
6196 |
%{ /* NOCONTEXT */ |
|
6197 |
#ifdef GLX |
|
6198 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6199 |
RETURN (__MKBOOLEAN(getlsbackup())); |
294 | 6200 |
#endif |
6201 |
%} |
|
6202 |
. |
|
6203 |
^ false |
|
6204 |
! |
|
6205 |
||
6206 |
glxGetlsrepeatIn: aGLXWindowId |
|
6207 |
||
6208 |
%{ /* NOCONTEXT */ |
|
6209 |
#ifdef GLX |
|
6210 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6211 |
RETURN (__MKSMALLINT(getlsrepeat())); |
294 | 6212 |
#endif |
6213 |
%} |
|
6214 |
. |
|
6215 |
^ false |
|
6216 |
! |
|
6217 |
||
6218 |
glxGetlstyleIn: aGLXWindowId |
|
6219 |
||
6220 |
%{ /* NOCONTEXT */ |
|
6221 |
#ifdef GLX |
|
6222 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6223 |
RETURN (__MKSMALLINT(getlstyle())); |
294 | 6224 |
#endif |
6225 |
%} |
|
6226 |
. |
|
6227 |
^ false |
|
6228 |
! |
|
6229 |
||
6230 |
glxGetlwidthIn: aGLXWindowId |
|
6231 |
||
6232 |
%{ /* NOCONTEXT */ |
|
6233 |
#ifdef GLX |
|
6234 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6235 |
RETURN (__MKSMALLINT(getlwidth())); |
294 | 6236 |
#endif |
6237 |
%} |
|
6238 |
. |
|
6239 |
^ false |
|
6240 |
! |
|
6241 |
||
6242 |
glxGetmapIn: aGLXWindowId |
|
6243 |
||
6244 |
%{ /* NOCONTEXT */ |
|
6245 |
#ifdef GLX |
|
6246 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6247 |
RETURN (__MKSMALLINT(getmap())); |
294 | 6248 |
#endif |
6249 |
%} |
|
6250 |
. |
|
6251 |
^ false |
|
6252 |
! |
|
6253 |
||
6254 |
glxGetmmodeIn: aGLXWindowId |
|
6255 |
||
6256 |
%{ /* NOCONTEXT */ |
|
6257 |
#ifdef GLX |
|
6258 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6259 |
RETURN (__MKSMALLINT(getmmode())); |
294 | 6260 |
#endif |
6261 |
%} |
|
6262 |
. |
|
6263 |
^ false |
|
6264 |
! |
|
6265 |
||
6266 |
glxGetmonitorIn: aGLXWindowId |
|
6267 |
||
6268 |
%{ /* NOCONTEXT */ |
|
6269 |
#ifdef GLX |
|
6270 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6271 |
RETURN (__MKSMALLINT(getmonitor())); |
294 | 6272 |
#endif |
6273 |
%} |
|
6274 |
. |
|
6275 |
^ false |
|
6276 |
! |
|
6277 |
||
6278 |
glxGetmultisampleIn: aGLXWindowId |
|
6279 |
||
6280 |
%{ /* NOCONTEXT */ |
|
6281 |
#ifdef FULL_GLX |
|
6282 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6283 |
RETURN (__MKBOOLEAN(getmultisample())); |
294 | 6284 |
#endif |
6285 |
%} |
|
6286 |
. |
|
6287 |
^ false |
|
6288 |
! |
|
6289 |
||
6290 |
glxGetothermonitorIn: aGLXWindowId |
|
6291 |
||
6292 |
%{ /* NOCONTEXT */ |
|
6293 |
#ifdef GLX |
|
6294 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6295 |
RETURN (__MKSMALLINT(getothermonitor())); |
294 | 6296 |
#endif |
6297 |
%} |
|
6298 |
. |
|
6299 |
^ false |
|
6300 |
! |
|
6301 |
||
6302 |
glxGetpatternIn: aGLXWindowId |
|
6303 |
||
6304 |
%{ /* NOCONTEXT */ |
|
6305 |
#ifdef GLX |
|
6306 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6307 |
RETURN (__MKSMALLINT(getpattern())); |
294 | 6308 |
#endif |
6309 |
%} |
|
6310 |
. |
|
6311 |
^ false |
|
6312 |
! |
|
6313 |
||
6314 |
glxGetresetlsIn: aGLXWindowId |
|
6315 |
||
6316 |
%{ /* NOCONTEXT */ |
|
6317 |
#ifdef GLX |
|
6318 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6319 |
RETURN (__MKBOOLEAN(getresetls())); |
294 | 6320 |
#endif |
6321 |
%} |
|
6322 |
. |
|
6323 |
^ false |
|
6324 |
! |
|
6325 |
||
6326 |
glxGetshadeIn: aGLXWindowId |
|
6327 |
||
6328 |
%{ /* NOCONTEXT */ |
|
6329 |
#ifdef GLX |
|
6330 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6331 |
RETURN (__MKSMALLINT(getshade())); |
294 | 6332 |
#endif |
6333 |
%} |
|
6334 |
. |
|
6335 |
^ false |
|
6336 |
! |
|
6337 |
||
6338 |
glxGetsmIn: aGLXWindowId |
|
6339 |
||
6340 |
%{ /* NOCONTEXT */ |
|
6341 |
#ifdef GLX |
|
6342 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6343 |
RETURN (__MKSMALLINT(getsm())); |
294 | 6344 |
#endif |
6345 |
%} |
|
6346 |
. |
|
6347 |
^ false |
|
6348 |
! |
|
6349 |
||
6350 |
glxGetvaluator: dev in: aGLXWindowId |
|
6351 |
||
6352 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
6353 |
#ifndef OPENGL |
294 | 6354 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6355 |
RETURN (__MKSMALLINT(getvaluator(_deviceVal(dev)))); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
6356 |
#endif |
294 | 6357 |
%} |
6358 |
. |
|
6359 |
^ false |
|
6360 |
! |
|
6361 |
||
6362 |
glxGetvideo: reg in: aGLXWindowId |
|
6363 |
||
6364 |
%{ /* NOCONTEXT */ |
|
6365 |
#ifdef GLX |
|
6366 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6367 |
RETURN (__MKSMALLINT(getvideo(_longVal(reg)))); |
294 | 6368 |
#endif |
6369 |
%} |
|
6370 |
. |
|
6371 |
^ false |
|
6372 |
! |
|
6373 |
||
6374 |
glxGetwritemaskIn: aGLXWindowId |
|
6375 |
||
6376 |
%{ /* NOCONTEXT */ |
|
6377 |
#ifdef GLX |
|
6378 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6379 |
RETURN (__MKSMALLINT(getwritemask())); |
294 | 6380 |
#endif |
6381 |
%} |
|
6382 |
. |
|
6383 |
^ false |
|
6384 |
! |
|
6385 |
||
6386 |
glxGetwscrnIn: aGLXWindowId |
|
6387 |
||
6388 |
%{ /* NOCONTEXT */ |
|
6389 |
#ifdef GLX |
|
6390 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6391 |
RETURN (__MKSMALLINT(getwscrn())); |
294 | 6392 |
#endif |
6393 |
%} |
|
6394 |
. |
|
6395 |
^ false |
|
6396 |
! |
|
6397 |
||
6398 |
glxGetzbufferIn: aGLXWindowId |
|
6399 |
||
6400 |
%{ /* NOCONTEXT */ |
|
6401 |
#ifdef GLX |
|
6402 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6403 |
RETURN (__MKBOOLEAN(getzbuffer())); |
294 | 6404 |
#endif |
6405 |
%} |
|
6406 |
. |
|
6407 |
^ false |
|
6408 |
! |
|
6409 |
||
6410 |
glxGexitIn: aGLXWindowId |
|
6411 |
||
6412 |
%{ /* NOCONTEXT */ |
|
1932 | 6413 |
SETWIN(aGLXWindowId) |
6414 |
#ifdef OPENGL |
|
6415 |
#else |
|
294 | 6416 |
gexit(); |
1932 | 6417 |
#endif |
6418 |
%} |
|
294 | 6419 |
! |
6420 |
||
6421 |
glxGflushIn: aGLXWindowId |
|
6422 |
||
6423 |
%{ /* NOCONTEXT */ |
|
6424 |
#ifdef GLX |
|
6425 |
SETWIN(aGLXWindowId) |
|
6426 |
gflush(); |
|
1932 | 6427 |
#endif |
6428 |
%} |
|
294 | 6429 |
! |
6430 |
||
6431 |
glxGinitIn: aGLXWindowId |
|
6432 |
||
6433 |
%{ /* NOCONTEXT */ |
|
1932 | 6434 |
SETWIN(aGLXWindowId) |
6435 |
#ifdef OPENGL |
|
6436 |
#else |
|
294 | 6437 |
ginit(); |
1932 | 6438 |
#endif |
6439 |
%} |
|
294 | 6440 |
! |
6441 |
||
6442 |
glxGlcompatMode: mode value: value in: aGLXWindowId |
|
6443 |
||
6444 |
%{ /* NOCONTEXT */ |
|
6445 |
#ifdef GLX |
|
6446 |
SETWIN(aGLXWindowId) |
|
6447 |
glcompat(_longVal(mode), _longVal(value)); |
|
1932 | 6448 |
#endif |
6449 |
%} |
|
294 | 6450 |
! |
6451 |
||
6452 |
glxGresetIn: aGLXWindowId |
|
6453 |
||
6454 |
%{ /* NOCONTEXT */ |
|
6455 |
#ifdef GLX |
|
6456 |
SETWIN(aGLXWindowId) |
|
6457 |
greset(); |
|
1932 | 6458 |
#endif |
6459 |
%} |
|
294 | 6460 |
! |
6461 |
||
6462 |
glxGsyncIn: aGLXWindowId |
|
6463 |
||
6464 |
%{ /* NOCONTEXT */ |
|
6465 |
#ifdef GLX |
|
6466 |
SETWIN(aGLXWindowId) |
|
6467 |
gsync(); |
|
1932 | 6468 |
#endif |
6469 |
%} |
|
294 | 6470 |
! |
6471 |
||
6472 |
glxIconsizeX: x y: y in: aGLXWindowId |
|
6473 |
||
6474 |
%{ /* NOCONTEXT */ |
|
6475 |
#ifdef GLX |
|
6476 |
SETWIN(aGLXWindowId) |
|
6477 |
iconsize(_longVal(x), _longVal(y)); |
|
1932 | 6478 |
#endif |
6479 |
%} |
|
294 | 6480 |
! |
6481 |
||
6482 |
glxImakebackgroundIn: aGLXWindowId |
|
6483 |
||
6484 |
%{ /* NOCONTEXT */ |
|
6485 |
#ifdef GLX |
|
6486 |
SETWIN(aGLXWindowId) |
|
6487 |
imakebackground(); |
|
1932 | 6488 |
#endif |
6489 |
%} |
|
294 | 6490 |
! |
6491 |
||
6492 |
glxInitnamesIn: aGLXWindowId |
|
6493 |
||
6494 |
%{ /* NOCONTEXT */ |
|
6495 |
#ifdef GLX |
|
6496 |
SETWIN(aGLXWindowId) |
|
6497 |
initnames(); |
|
1932 | 6498 |
#endif |
6499 |
%} |
|
294 | 6500 |
! |
6501 |
||
6502 |
glxIsqueued: dev in: aGLXWindowId |
|
6503 |
||
6504 |
%{ /* NOCONTEXT */ |
|
6505 |
#ifdef GLX |
|
6506 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6507 |
RETURN (__MKBOOLEAN(isqueued(_deviceVal(dev)))); |
294 | 6508 |
#endif |
6509 |
%} |
|
6510 |
. |
|
6511 |
^ false |
|
6512 |
! |
|
6513 |
||
6514 |
glxIstag: t in: aGLXWindowId |
|
6515 |
||
6516 |
%{ /* NOCONTEXT */ |
|
6517 |
#ifdef GLX |
|
6518 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6519 |
RETURN (__MKBOOLEAN(istag(_tagVal(t)))); |
294 | 6520 |
#endif |
6521 |
%} |
|
6522 |
. |
|
6523 |
^ false |
|
6524 |
! |
|
6525 |
||
6526 |
glxKeepaspectX: x y: y in: aGLXWindowId |
|
6527 |
||
6528 |
%{ /* NOCONTEXT */ |
|
6529 |
#ifdef GLX |
|
6530 |
SETWIN(aGLXWindowId) |
|
6531 |
keepaspect(_longVal(x), _longVal(y)); |
|
6532 |
RETURN (true); |
|
6533 |
#endif |
|
6534 |
%} |
|
6535 |
. |
|
6536 |
^ false |
|
6537 |
! |
|
6538 |
||
6539 |
glxLinesmoothMode: mode in: aGLXWindowId |
|
6540 |
||
6541 |
%{ /* NOCONTEXT */ |
|
6542 |
#ifdef GLX |
|
6543 |
SETWIN(aGLXWindowId) |
|
6544 |
linesmooth((ulong)__intVal(mode)); |
|
6545 |
RETURN (true); |
|
6546 |
#endif |
|
6547 |
%} |
|
6548 |
. |
|
6549 |
^ false |
|
6550 |
! |
|
6551 |
||
6552 |
glxLmcolorMode: mode in: aGLXWindowId |
|
6553 |
||
6554 |
%{ /* NOCONTEXT */ |
|
6555 |
#ifdef GLX |
|
6556 |
SETWIN(aGLXWindowId) |
|
6557 |
lmcolor(_longVal(mode)); |
|
6558 |
RETURN (true); |
|
6559 |
#endif |
|
6560 |
%} |
|
6561 |
. |
|
6562 |
^ false |
|
6563 |
! |
|
6564 |
||
6565 |
glxLoadname: name in: aGLXWindowId |
|
6566 |
||
6567 |
%{ /* NOCONTEXT */ |
|
6568 |
#ifdef GLX |
|
6569 |
SETWIN(aGLXWindowId) |
|
6570 |
loadname(_shortVal(name)); |
|
6571 |
RETURN (true); |
|
6572 |
#endif |
|
6573 |
%} |
|
6574 |
. |
|
6575 |
^ false |
|
6576 |
! |
|
6577 |
||
6578 |
glxLogicop: opcode in: aGLXWindowId |
|
6579 |
||
6580 |
%{ /* NOCONTEXT */ |
|
6581 |
#ifdef GLX |
|
6582 |
SETWIN(aGLXWindowId) |
|
6583 |
logicop(_longVal(opcode)); |
|
6584 |
RETURN (true); |
|
6585 |
#endif |
|
6586 |
%} |
|
6587 |
. |
|
6588 |
^ false |
|
6589 |
! |
|
6590 |
||
6591 |
glxLsbackup: b in: aGLXWindowId |
|
6592 |
||
6593 |
%{ /* NOCONTEXT */ |
|
6594 |
#ifdef GLX |
|
6595 |
SETWIN(aGLXWindowId) |
|
6596 |
lsbackup(_booleanVal(b)); |
|
6597 |
RETURN (true); |
|
6598 |
#endif |
|
6599 |
%} |
|
6600 |
. |
|
6601 |
^ false |
|
6602 |
! |
|
6603 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6604 |
glxLsetdepthNear:znear far:zfar in: aGLXWindowId |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6605 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6606 |
%{ /* NOCONTEXT */ |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6607 |
#ifdef GLX |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6608 |
SETWIN(aGLXWindowId) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6609 |
lsetdepth(_longVal(znear), _longVal(zfar)); |
294 | 6610 |
RETURN (true); |
6611 |
#endif |
|
6612 |
%} |
|
6613 |
. |
|
6614 |
^ false |
|
6615 |
! |
|
6616 |
||
6617 |
glxLshaderangeLowin: lowin hiwin: hiwin znear: znear zfar: zfar in: aGLXWindowId |
|
6618 |
||
6619 |
%{ /* NOCONTEXT */ |
|
6620 |
#ifdef GLX |
|
6621 |
SETWIN(aGLXWindowId) |
|
6622 |
lshaderange(_colorindexVal(lowin), _colorindexVal(hiwin), |
|
6623 |
_longVal(znear), _longVal(zfar)); |
|
6624 |
RETURN (true); |
|
6625 |
#endif |
|
6626 |
%} |
|
6627 |
. |
|
6628 |
^ false |
|
6629 |
! |
|
6630 |
||
6631 |
glxLsrepeatFactor: factor in: aGLXWindowId |
|
6632 |
||
6633 |
%{ /* NOCONTEXT */ |
|
6634 |
#ifdef GLX |
|
6635 |
SETWIN(aGLXWindowId) |
|
6636 |
lsrepeat(_longVal(factor)); |
|
6637 |
RETURN (true); |
|
6638 |
#endif |
|
6639 |
%} |
|
6640 |
. |
|
6641 |
^ false |
|
6642 |
! |
|
6643 |
||
6644 |
glxMaketag: t in: aGLXWindowId |
|
6645 |
||
6646 |
%{ /* NOCONTEXT */ |
|
6647 |
#ifdef GLX |
|
6648 |
SETWIN(aGLXWindowId) |
|
6649 |
maketag(_tagVal(t)); |
|
6650 |
RETURN (true); |
|
6651 |
#endif |
|
6652 |
%} |
|
6653 |
. |
|
6654 |
^ false |
|
6655 |
! |
|
6656 |
||
6657 |
glxMaxsizeX: x y: y in: aGLXWindowId |
|
6658 |
||
6659 |
%{ /* NOCONTEXT */ |
|
6660 |
#ifdef GLX |
|
6661 |
SETWIN(aGLXWindowId) |
|
6662 |
maxsize(_longVal(x), _longVal(y)); |
|
6663 |
RETURN (true); |
|
6664 |
#endif |
|
6665 |
%} |
|
6666 |
. |
|
6667 |
^ false |
|
6668 |
! |
|
6669 |
||
6670 |
glxMinsizeX: x y: y in: aGLXWindowId |
|
6671 |
||
6672 |
%{ /* NOCONTEXT */ |
|
6673 |
#ifdef GLX |
|
6674 |
SETWIN(aGLXWindowId) |
|
6675 |
minsize(_longVal(x), _longVal(y)); |
|
6676 |
RETURN (true); |
|
6677 |
#endif |
|
6678 |
%} |
|
6679 |
. |
|
6680 |
^ false |
|
6681 |
! |
|
6682 |
||
6683 |
glxMsalphaMode: mode in: aGLXWindowId |
|
6684 |
||
6685 |
%{ /* NOCONTEXT */ |
|
6686 |
#ifdef FULL_GLX |
|
6687 |
SETWIN(aGLXWindowId) |
|
6688 |
msalpha(_longVal(mode)); |
|
6689 |
RETURN (true); |
|
6690 |
#endif |
|
6691 |
%} |
|
6692 |
. |
|
6693 |
^ false |
|
6694 |
! |
|
6695 |
||
6696 |
glxMsmask: mask inverse: inverse in: aGLXWindowId |
|
6697 |
||
6698 |
%{ /* NOCONTEXT */ |
|
6699 |
#ifdef FULL_GLX |
|
6700 |
SETWIN(aGLXWindowId) |
|
6701 |
msmask(_floatVal(mask), _booleanVal(inverse)); |
|
6702 |
RETURN (true); |
|
6703 |
#endif |
|
6704 |
%} |
|
6705 |
. |
|
6706 |
^ false |
|
6707 |
! |
|
6708 |
||
6709 |
glxMspattern: pattern in: aGLXWindowId |
|
6710 |
||
6711 |
%{ /* NOCONTEXT */ |
|
6712 |
#ifdef FULL_GLX |
|
6713 |
SETWIN(aGLXWindowId) |
|
6714 |
mspattern(_longVal(pattern)); |
|
6715 |
RETURN (true); |
|
6716 |
#endif |
|
6717 |
%} |
|
6718 |
. |
|
6719 |
^ false |
|
6720 |
! |
|
6721 |
||
6722 |
glxMssizeSamples: samples zsize: zsize ssize: ssize in: aGLXWindowId |
|
6723 |
||
6724 |
%{ /* NOCONTEXT */ |
|
6725 |
#ifdef FULL_GLX |
|
6726 |
SETWIN(aGLXWindowId) |
|
6727 |
mssize(_longVal(samples), _longVal(zsize), _longVal(ssize)); |
|
6728 |
RETURN (true); |
|
6729 |
#endif |
|
6730 |
%} |
|
6731 |
. |
|
6732 |
^ false |
|
6733 |
! |
|
6734 |
||
6735 |
glxMswapbuffers: fbuf in: aGLXWindowId |
|
6736 |
||
6737 |
%{ /* NOCONTEXT */ |
|
6738 |
#ifdef GLX |
|
6739 |
SETWIN(aGLXWindowId) |
|
6740 |
mswapbuffers(_longVal(fbuf)); |
|
6741 |
RETURN (true); |
|
6742 |
#endif |
|
6743 |
%} |
|
6744 |
. |
|
6745 |
^ false |
|
6746 |
! |
|
6747 |
||
6748 |
glxMultimapIn: aGLXWindowId |
|
6749 |
||
6750 |
%{ /* NOCONTEXT */ |
|
6751 |
#ifdef GLX |
|
6752 |
SETWIN(aGLXWindowId) |
|
6753 |
multimap(); |
|
6754 |
RETURN (true); |
|
6755 |
#endif |
|
6756 |
%} |
|
6757 |
. |
|
6758 |
^ false |
|
6759 |
! |
|
6760 |
||
6761 |
glxMultisample: bool in: aGLXWindowId |
|
6762 |
||
6763 |
%{ /* NOCONTEXT */ |
|
6764 |
#ifdef FULL_GLX |
|
6765 |
SETWIN(aGLXWindowId) |
|
6766 |
multisample(_booleanVal(bool)); |
|
6767 |
RETURN (true); |
|
6768 |
#endif |
|
6769 |
%} |
|
6770 |
. |
|
6771 |
^ false |
|
6772 |
! |
|
6773 |
||
6774 |
glxNewpupIn: aGLXWindowId |
|
6775 |
||
6776 |
%{ /* NOCONTEXT */ |
|
6777 |
#ifdef GLX |
|
6778 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6779 |
RETURN (__MKSMALLINT(newpup())); |
294 | 6780 |
#endif |
6781 |
%} |
|
6782 |
. |
|
6783 |
^ false |
|
6784 |
! |
|
6785 |
||
6786 |
glxNewtag: newtg oldtg: oldtg offst: offst in: aGLXWindowId |
|
6787 |
||
6788 |
%{ /* NOCONTEXT */ |
|
6789 |
#ifdef GLX |
|
6790 |
SETWIN(aGLXWindowId) |
|
6791 |
newtag(_tagVal(newtg), _tagVal(oldtg), _offsetVal(offst)); |
|
6792 |
RETURN (true); |
|
6793 |
#endif |
|
6794 |
%} |
|
6795 |
. |
|
6796 |
^ false |
|
6797 |
! |
|
6798 |
||
6799 |
glxNoborderIn: aGLXWindowId |
|
6800 |
||
6801 |
%{ /* NOCONTEXT */ |
|
6802 |
#ifdef GLX |
|
6803 |
SETWIN(aGLXWindowId) |
|
6804 |
noborder(); |
|
6805 |
RETURN (true); |
|
6806 |
#endif |
|
6807 |
%} |
|
6808 |
. |
|
6809 |
^ false |
|
6810 |
! |
|
6811 |
||
6812 |
glxNoise: v delta: delta in: aGLXWindowId |
|
6813 |
||
6814 |
%{ /* NOCONTEXT */ |
|
6815 |
#ifdef GLX |
|
6816 |
SETWIN(aGLXWindowId) |
|
6817 |
noise(_deviceVal(v), _shortVal(delta)); |
|
6818 |
RETURN (true); |
|
6819 |
#endif |
|
6820 |
%} |
|
6821 |
. |
|
6822 |
^ false |
|
6823 |
! |
|
6824 |
||
6825 |
glxNoportIn: aGLXWindowId |
|
6826 |
||
6827 |
%{ /* NOCONTEXT */ |
|
6828 |
#ifdef GLX |
|
6829 |
SETWIN(aGLXWindowId) |
|
6830 |
noport(); |
|
6831 |
RETURN (true); |
|
6832 |
#endif |
|
6833 |
%} |
|
6834 |
. |
|
6835 |
^ false |
|
6836 |
! |
|
6837 |
||
6838 |
glxNurbscurveKnotCount: knotCount knotList: knotList |
|
6839 |
offset: offset ctlArray: ctlArray |
|
6840 |
order: order type: type in: aGLXWindowId |
|
6841 |
||
6842 |
| ctlPoints i | |
|
6843 |
ctlPoints := DoubleArray new: ctlArray size * (ctlArray first size). |
|
6844 |
i := 1. |
|
6845 |
ctlArray do: [:point | |
|
6846 |
point do: [:coord | |
|
6847 |
ctlPoints at: i put: coord. |
|
6848 |
i := i + 1]]. |
|
6849 |
||
6850 |
%{ /* NOCONTEXT */ |
|
6851 |
#ifdef GLX |
|
6852 |
char *knotElements, *ctlElements; |
|
6853 |
OBJ cls; |
|
6854 |
int ninstVars, nInstBytes; |
|
6855 |
||
6856 |
SETWIN(aGLXWindowId) |
|
6857 |
cls = __qClass(ctlPoints); |
|
6858 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
6859 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
|
6860 |
||
6861 |
ctlElements = (char *)(_InstPtr(ctlPoints)) + nInstBytes; |
|
6862 |
knotElements = (char *)(_InstPtr(knotList)) + nInstBytes; |
|
6863 |
||
6864 |
nurbscurve ( |
|
6865 |
_longVal(knotCount), (double *)knotElements, |
|
6866 |
_longVal(offset), (double *)ctlElements, |
|
6867 |
_longVal(order), _longVal(type)); |
|
6868 |
RETURN(true); |
|
6869 |
#endif |
|
6870 |
%} |
|
6871 |
. |
|
6872 |
^ false |
|
6873 |
! |
|
6874 |
||
6875 |
glxObjdeleteTag1: tag1 tag2: tag2 in: aGLXWindowId |
|
6876 |
||
6877 |
%{ /* NOCONTEXT */ |
|
6878 |
#ifdef GLX |
|
6879 |
SETWIN(aGLXWindowId) |
|
6880 |
objdelete(_tagVal(tag1), _tagVal(tag2)); |
|
6881 |
RETURN (true); |
|
6882 |
#endif |
|
6883 |
%} |
|
6884 |
. |
|
6885 |
^ false |
|
6886 |
! |
|
6887 |
||
6888 |
glxObjinsert: t in: aGLXWindowId |
|
6889 |
||
6890 |
%{ /* NOCONTEXT */ |
|
6891 |
#ifdef GLX |
|
6892 |
SETWIN(aGLXWindowId) |
|
6893 |
objinsert(_tagVal(t)); |
|
6894 |
RETURN (true); |
|
6895 |
#endif |
|
6896 |
%} |
|
6897 |
. |
|
6898 |
^ false |
|
6899 |
! |
|
6900 |
||
6901 |
glxObjreplace: t in: aGLXWindowId |
|
6902 |
||
6903 |
%{ /* NOCONTEXT */ |
|
6904 |
#ifdef GLX |
|
6905 |
SETWIN(aGLXWindowId) |
|
6906 |
objreplace(_tagVal(t)); |
|
6907 |
RETURN (true); |
|
6908 |
#endif |
|
6909 |
%} |
|
6910 |
. |
|
6911 |
^ false |
|
6912 |
! |
|
6913 |
||
6914 |
glxOnemapIn: aGLXWindowId |
|
6915 |
||
6916 |
%{ /* NOCONTEXT */ |
|
6917 |
#ifdef GLX |
|
6918 |
SETWIN(aGLXWindowId) |
|
6919 |
onemap(); |
|
6920 |
RETURN (true); |
|
6921 |
#endif |
|
6922 |
%} |
|
6923 |
. |
|
6924 |
^ false |
|
6925 |
! |
|
6926 |
||
6927 |
glxPagecolor: pcolor in: aGLXWindowId |
|
6928 |
||
6929 |
%{ /* NOCONTEXT */ |
|
6930 |
#ifdef GLX |
|
6931 |
SETWIN(aGLXWindowId) |
|
6932 |
pagecolor(_colorindexVal(pcolor)); |
|
6933 |
RETURN (true); |
|
6934 |
#endif |
|
6935 |
%} |
|
6936 |
. |
|
6937 |
^ false |
|
6938 |
! |
|
6939 |
||
6940 |
glxPassthroughToken: token in: aGLXWindowId |
|
6941 |
||
6942 |
%{ /* NOCONTEXT */ |
|
6943 |
#ifdef GLX |
|
6944 |
SETWIN(aGLXWindowId) |
|
6945 |
passthrough(_shortVal(token)); |
|
6946 |
RETURN (true); |
|
6947 |
#endif |
|
6948 |
%} |
|
6949 |
. |
|
6950 |
^ false |
|
6951 |
! |
|
6952 |
||
6953 |
glxPclosIn: aGLXWindowId |
|
6954 |
||
6955 |
%{ /* NOCONTEXT */ |
|
6956 |
#ifdef GLX |
|
6957 |
SETWIN(aGLXWindowId) |
|
6958 |
pclos(); |
|
6959 |
RETURN (true); |
|
6960 |
#endif |
|
6961 |
%} |
|
6962 |
. |
|
6963 |
^ false |
|
6964 |
! |
|
6965 |
||
6966 |
glxPicksizeX: x y: y in: aGLXWindowId |
|
6967 |
||
6968 |
%{ /* NOCONTEXT */ |
|
6969 |
#ifdef GLX |
|
6970 |
SETWIN(aGLXWindowId) |
|
6971 |
picksize(_shortVal(x), _shortVal(y)); |
|
6972 |
RETURN (true); |
|
6973 |
#endif |
|
6974 |
%} |
|
6975 |
. |
|
6976 |
^ false |
|
6977 |
! |
|
6978 |
||
6979 |
glxPixmode: mode value: value in: aGLXWindowId |
|
6980 |
||
6981 |
%{ /* NOCONTEXT */ |
|
6982 |
#ifdef GLX |
|
6983 |
SETWIN(aGLXWindowId) |
|
6984 |
pixmode(_longVal(mode), _longVal(value)); |
|
6985 |
RETURN (true); |
|
6986 |
#endif |
|
6987 |
%} |
|
6988 |
. |
|
6989 |
^ false |
|
6990 |
! |
|
6991 |
||
6992 |
glxPntsmoothMode: mode in: aGLXWindowId |
|
6993 |
||
6994 |
%{ /* NOCONTEXT */ |
|
6995 |
#ifdef GLX |
|
6996 |
SETWIN(aGLXWindowId) |
|
6997 |
pntsmooth((ulong)__intVal(mode)); |
|
6998 |
RETURN (true); |
|
6999 |
#endif |
|
7000 |
%} |
|
7001 |
. |
|
7002 |
^ false |
|
7003 |
! |
|
7004 |
||
7005 |
glxPolysmoothMode: mode in: aGLXWindowId |
|
7006 |
||
7007 |
%{ /* NOCONTEXT */ |
|
7008 |
#ifdef GLX |
|
7009 |
SETWIN(aGLXWindowId) |
|
7010 |
polysmooth(_longVal(mode)); |
|
7011 |
RETURN (true); |
|
7012 |
#endif |
|
7013 |
%} |
|
7014 |
. |
|
7015 |
^ false |
|
7016 |
! |
|
7017 |
||
7018 |
glxPopnameIn: aGLXWindowId |
|
7019 |
||
7020 |
%{ /* NOCONTEXT */ |
|
7021 |
#ifdef GLX |
|
7022 |
SETWIN(aGLXWindowId) |
|
7023 |
popname(); |
|
7024 |
RETURN (true); |
|
7025 |
#endif |
|
7026 |
%} |
|
7027 |
. |
|
7028 |
^ false |
|
7029 |
! |
|
7030 |
||
7031 |
glxPrefpositionX1: x1 x2: x2 y1: y1 y2: y2 in: aGLXWindowId |
|
7032 |
||
7033 |
%{ /* NOCONTEXT */ |
|
7034 |
SETWIN(aGLXWindowId) |
|
1932 | 7035 |
#ifdef OPENGL |
7036 |
#else |
|
294 | 7037 |
prefposition(_longVal(x1), _longVal(x2), _longVal(y1), _longVal(y2)); |
1932 | 7038 |
#endif |
294 | 7039 |
RETURN (true); |
7040 |
%} |
|
7041 |
! |
|
7042 |
||
7043 |
glxPrefsizeX: x y: y in: aGLXWindowId |
|
7044 |
||
7045 |
%{ /* NOCONTEXT */ |
|
7046 |
SETWIN(aGLXWindowId) |
|
1932 | 7047 |
#ifdef OPENGL |
7048 |
#else |
|
294 | 7049 |
prefsize(_longVal(x), _longVal(y)); |
1932 | 7050 |
#endif |
294 | 7051 |
RETURN (true); |
7052 |
%} |
|
7053 |
! |
|
7054 |
||
7055 |
glxPupmodeIn: aGLXWindowId |
|
7056 |
||
7057 |
%{ /* NOCONTEXT */ |
|
7058 |
#ifdef GLX |
|
7059 |
SETWIN(aGLXWindowId) |
|
7060 |
pupmode(); |
|
7061 |
RETURN (true); |
|
7062 |
#endif |
|
7063 |
%} |
|
7064 |
. |
|
7065 |
^ false |
|
7066 |
! |
|
7067 |
||
7068 |
glxPushname: name In: aGLXWindowId |
|
7069 |
||
7070 |
%{ /* NOCONTEXT */ |
|
7071 |
#ifdef GLX |
|
7072 |
SETWIN(aGLXWindowId) |
|
7073 |
pushname(_shortVal(name)); |
|
7074 |
RETURN (true); |
|
7075 |
#endif |
|
7076 |
%} |
|
7077 |
. |
|
7078 |
^ false |
|
7079 |
! |
|
7080 |
||
7081 |
glxQdevice: dev in: aGLXWindowId |
|
7082 |
||
7083 |
%{ /* NOCONTEXT */ |
|
1932 | 7084 |
SETWIN(aGLXWindowId) |
7085 |
#ifdef OPENGL |
|
7086 |
#else |
|
294 | 7087 |
qdevice(_deviceVal(dev)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7088 |
#endif |
294 | 7089 |
%} |
7090 |
! |
|
7091 |
||
7092 |
glxQenterDev: dev val: val in: aGLXWindowId |
|
7093 |
||
7094 |
%{ /* NOCONTEXT */ |
|
7095 |
SETWIN(aGLXWindowId) |
|
1932 | 7096 |
#ifdef OPENGL |
7097 |
#else |
|
294 | 7098 |
qenter(_deviceVal(dev), _shortVal(val)); |
1932 | 7099 |
#endif |
294 | 7100 |
%} |
7101 |
! |
|
7102 |
||
7103 |
glxQgetfdIn: aGLXWindowId |
|
7104 |
||
7105 |
%{ /* NOCONTEXT */ |
|
7106 |
#ifdef GLX |
|
7107 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7108 |
RETURN (__MKSMALLINT(qgetfd())); |
294 | 7109 |
#endif |
7110 |
%} |
|
7111 |
. |
|
7112 |
^ false |
|
7113 |
! |
|
7114 |
||
7115 |
glxQreadIn: aGLXWindowId |
|
7116 |
||
7117 |
| dev data | |
|
7118 |
%{ |
|
7119 |
short c_data; |
|
7120 |
||
7121 |
SETWIN(aGLXWindowId) |
|
1932 | 7122 |
#ifdef OPENGL |
7123 |
#else |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7124 |
dev = __MKSMALLINT(qread(&c_data)); |
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7125 |
data = __MKSMALLINT(c_data); |
1932 | 7126 |
#endif |
294 | 7127 |
%} |
7128 |
. |
|
7129 |
^ Array with: dev with: data |
|
7130 |
! |
|
7131 |
||
7132 |
glxQresetIn: aGLXWindowId |
|
7133 |
||
7134 |
%{ /* NOCONTEXT */ |
|
7135 |
SETWIN(aGLXWindowId) |
|
1932 | 7136 |
#ifdef OPENGL |
7137 |
#else |
|
294 | 7138 |
qreset(); |
1932 | 7139 |
#endif |
294 | 7140 |
RETURN (true); |
7141 |
%} |
|
7142 |
! |
|
7143 |
||
7144 |
glxQtestIn: aGLXWindowId |
|
7145 |
||
7146 |
%{ /* NOCONTEXT */ |
|
1932 | 7147 |
int rslt = 0; |
7148 |
||
7149 |
SETWIN(aGLXWindowId) |
|
7150 |
#ifdef OPENGL |
|
7151 |
#else |
|
7152 |
rslt = qtest(); |
|
7153 |
#endif |
|
7154 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 7155 |
%} |
7156 |
! |
|
7157 |
||
7158 |
glxRGBcursorIndex: index red: red green: green blue: blue |
|
7159 |
redm: redm greenm: greenm bluem: bluem in: aGLXWindowId |
|
7160 |
||
7161 |
%{ /* NOCONTEXT */ |
|
7162 |
#ifdef GLX |
|
7163 |
SETWIN(aGLXWindowId) |
|
7164 |
RGBcursor(_shortVal(index), |
|
7165 |
_shortVal(red), _shortVal(green), _shortVal(blue), |
|
7166 |
_shortVal(redm), _shortVal(greenm), _shortVal(bluem)); |
|
7167 |
RETURN (true); |
|
7168 |
#endif |
|
7169 |
%} |
|
7170 |
. |
|
7171 |
^ false |
|
7172 |
! |
|
7173 |
||
7174 |
glxRGBwritemaskRed: red green: green blue: blue in: aGLXWindowId |
|
7175 |
||
7176 |
%{ /* NOCONTEXT */ |
|
7177 |
#ifdef GLX |
|
7178 |
SETWIN(aGLXWindowId) |
|
7179 |
RGBwritemask(_shortVal(red), _shortVal(green), _shortVal(blue)); |
|
7180 |
RETURN (true); |
|
7181 |
#endif |
|
7182 |
%} |
|
7183 |
. |
|
7184 |
^ false |
|
7185 |
! |
|
7186 |
||
7187 |
glxRectzoomX: xfactor y: yfactor in: aGLXWindowId |
|
7188 |
||
7189 |
%{ /* NOCONTEXT */ |
|
7190 |
#ifdef GLX |
|
7191 |
SETWIN(aGLXWindowId) |
|
7192 |
rectzoom(_floatVal(xfactor), _floatVal(yfactor)); |
|
7193 |
RETURN (true); |
|
7194 |
#endif |
|
7195 |
%} |
|
7196 |
. |
|
7197 |
^ false |
|
7198 |
! |
|
7199 |
||
7200 |
glxResetls: b in: aGLXWindowId |
|
7201 |
||
7202 |
%{ /* NOCONTEXT */ |
|
7203 |
#ifdef GLX |
|
7204 |
SETWIN(aGLXWindowId) |
|
7205 |
resetls(_booleanVal(b)); |
|
7206 |
RETURN (true); |
|
7207 |
#endif |
|
7208 |
%} |
|
7209 |
. |
|
7210 |
^ false |
|
7211 |
! |
|
7212 |
||
7213 |
glxRingbellIn: aGLXWindowId |
|
7214 |
||
7215 |
%{ /* NOCONTEXT */ |
|
7216 |
#ifdef GLX |
|
7217 |
SETWIN(aGLXWindowId) |
|
7218 |
ringbell(); |
|
7219 |
RETURN (true); |
|
7220 |
#endif |
|
7221 |
%} |
|
7222 |
. |
|
7223 |
^ false |
|
7224 |
! |
|
7225 |
||
7226 |
glxSboxX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7227 |
||
7228 |
%{ /* NOCONTEXT */ |
|
7229 |
#ifdef GLX |
|
7230 |
SETWIN(aGLXWindowId) |
|
7231 |
sbox(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
7232 |
RETURN (true); |
|
7233 |
#endif |
|
7234 |
%} |
|
7235 |
. |
|
7236 |
^ false |
|
7237 |
! |
|
7238 |
||
7239 |
glxSboxfX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7240 |
||
7241 |
%{ /* NOCONTEXT */ |
|
7242 |
#ifdef GLX |
|
7243 |
SETWIN(aGLXWindowId) |
|
7244 |
sboxf(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
7245 |
RETURN (true); |
|
7246 |
#endif |
|
7247 |
%} |
|
7248 |
. |
|
7249 |
^ false |
|
7250 |
! |
|
7251 |
||
7252 |
glxSboxfiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7253 |
||
7254 |
%{ /* NOCONTEXT */ |
|
7255 |
#ifdef GLX |
|
7256 |
SETWIN(aGLXWindowId) |
|
7257 |
sboxfi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
7258 |
RETURN (true); |
|
7259 |
#endif |
|
7260 |
%} |
|
7261 |
. |
|
7262 |
^ false |
|
7263 |
! |
|
7264 |
||
7265 |
glxSboxfsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7266 |
||
7267 |
%{ /* NOCONTEXT */ |
|
7268 |
#ifdef GLX |
|
7269 |
SETWIN(aGLXWindowId) |
|
7270 |
sboxfs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
7271 |
RETURN (true); |
|
7272 |
#endif |
|
7273 |
%} |
|
7274 |
. |
|
7275 |
^ false |
|
7276 |
! |
|
7277 |
||
7278 |
glxSboxiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7279 |
||
7280 |
%{ /* NOCONTEXT */ |
|
7281 |
#ifdef GLX |
|
7282 |
SETWIN(aGLXWindowId) |
|
7283 |
sboxi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
7284 |
RETURN (true); |
|
7285 |
#endif |
|
7286 |
%} |
|
7287 |
. |
|
7288 |
^ false |
|
7289 |
! |
|
7290 |
||
7291 |
glxSboxsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7292 |
||
7293 |
%{ /* NOCONTEXT */ |
|
7294 |
#ifdef GLX |
|
7295 |
SETWIN(aGLXWindowId) |
|
7296 |
sboxs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
7297 |
RETURN (true); |
|
7298 |
#endif |
|
7299 |
%} |
|
7300 |
. |
|
7301 |
^ false |
|
7302 |
! |
|
7303 |
||
7304 |
glxSclearSval: sval in: aGLXWindowId |
|
7305 |
||
7306 |
%{ /* NOCONTEXT */ |
|
7307 |
#ifdef GLX |
|
7308 |
SETWIN(aGLXWindowId) |
|
7309 |
sclear((ulong)__intVal(sval)); |
|
7310 |
RETURN (true); |
|
7311 |
#endif |
|
7312 |
%} |
|
7313 |
. |
|
7314 |
^ false |
|
7315 |
! |
|
7316 |
||
7317 |
glxScrbox: arg in: aGLXWindowId |
|
7318 |
||
7319 |
%{ /* NOCONTEXT */ |
|
7320 |
#ifdef GLX |
|
7321 |
SETWIN(aGLXWindowId) |
|
7322 |
scrbox(_longVal(arg)); |
|
7323 |
RETURN (true); |
|
7324 |
#endif |
|
7325 |
%} |
|
7326 |
. |
|
7327 |
^ false |
|
7328 |
! |
|
7329 |
||
7330 |
glxScreenspaceIn: aGLXWindowId |
|
7331 |
||
7332 |
%{ /* NOCONTEXT */ |
|
7333 |
#ifdef GLX |
|
7334 |
SETWIN(aGLXWindowId) |
|
7335 |
screenspace(); |
|
7336 |
RETURN (true); |
|
7337 |
#endif |
|
7338 |
%} |
|
7339 |
. |
|
7340 |
^ false |
|
7341 |
! |
|
7342 |
||
7343 |
glxScrmaskLeft: left right: right bottom: bottom top: top in: aGLXWindowId |
|
7344 |
||
7345 |
%{ /* NOCONTEXT */ |
|
7346 |
#ifdef GLX |
|
7347 |
SETWIN(aGLXWindowId) |
|
7348 |
scrmask(_screencoordVal(left), _screencoordVal(right), |
|
7349 |
_screencoordVal(bottom), _screencoordVal(top)); |
|
7350 |
RETURN (true); |
|
7351 |
#endif |
|
7352 |
%} |
|
7353 |
. |
|
7354 |
^ false |
|
7355 |
! |
|
7356 |
||
7357 |
glxScrnattach: gsnr in: aGLXWindowId |
|
7358 |
||
7359 |
%{ /* NOCONTEXT */ |
|
7360 |
#ifdef GLX |
|
7361 |
SETWIN(aGLXWindowId) |
|
7362 |
scrnattach(_longVal(gsnr)); |
|
7363 |
RETURN (true); |
|
7364 |
#endif |
|
7365 |
%} |
|
7366 |
. |
|
7367 |
^ false |
|
7368 |
! |
|
7369 |
||
7370 |
glxScrnselect: gsnr in: aGLXWindowId |
|
7371 |
||
7372 |
%{ /* NOCONTEXT */ |
|
7373 |
#ifdef GLX |
|
7374 |
SETWIN(aGLXWindowId) |
|
7375 |
scrnselect(_longVal(gsnr)); |
|
7376 |
RETURN (true); |
|
7377 |
#endif |
|
7378 |
%} |
|
7379 |
. |
|
7380 |
^ false |
|
7381 |
! |
|
7382 |
||
7383 |
glxSetcursorIndex: index color: color wtn: wtn in: aGLXWindowId |
|
7384 |
||
7385 |
%{ /* NOCONTEXT */ |
|
7386 |
#ifdef GLX |
|
7387 |
SETWIN(aGLXWindowId) |
|
7388 |
setcursor(_shortVal(index), _colorindexVal(color), _colorindexVal(wtn)); |
|
7389 |
RETURN (true); |
|
7390 |
#endif |
|
7391 |
%} |
|
7392 |
. |
|
7393 |
^ false |
|
7394 |
! |
|
7395 |
||
7396 |
glxSetdblightsMask: mask in: aGLXWindowId |
|
7397 |
||
7398 |
%{ /* NOCONTEXT */ |
|
7399 |
#ifdef GLX |
|
7400 |
SETWIN(aGLXWindowId) |
|
7401 |
setdblights((ulong)__intVal(mask)); |
|
7402 |
RETURN (true); |
|
7403 |
#endif |
|
7404 |
%} |
|
7405 |
. |
|
7406 |
^ false |
|
7407 |
! |
|
7408 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7409 |
glxSetdepthNear:znear far:zfar in: aGLXWindowId |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7410 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7411 |
%{ /* NOCONTEXT */ |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7412 |
#ifdef GLX |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7413 |
SETWIN(aGLXWindowId) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7414 |
setdepth(_screencoordVal(znear), _screencoordVal(zfar)); |
294 | 7415 |
RETURN (true); |
7416 |
#endif |
|
7417 |
%} |
|
7418 |
. |
|
7419 |
^ false |
|
7420 |
! |
|
7421 |
||
7422 |
glxSetmap: mapnum in: aGLXWindowId |
|
7423 |
||
7424 |
%{ /* NOCONTEXT */ |
|
7425 |
#ifdef GLX |
|
7426 |
SETWIN(aGLXWindowId) |
|
7427 |
setmap(_shortVal(mapnum)); |
|
7428 |
RETURN (true); |
|
7429 |
#endif |
|
7430 |
%} |
|
7431 |
. |
|
7432 |
^ false |
|
7433 |
! |
|
7434 |
||
7435 |
glxSetmonitor: mtype in: aGLXWindowId |
|
7436 |
||
7437 |
%{ /* NOCONTEXT */ |
|
7438 |
#ifdef GLX |
|
7439 |
SETWIN(aGLXWindowId) |
|
7440 |
setmonitor(_shortVal(mtype)); |
|
7441 |
RETURN (true); |
|
7442 |
#endif |
|
7443 |
%} |
|
7444 |
. |
|
7445 |
^ false |
|
7446 |
! |
|
7447 |
||
7448 |
glxSetnurbsproperty: property value: value in: aGLXWindowId |
|
7449 |
||
7450 |
%{ /* NOCONTEXT */ |
|
7451 |
#ifdef GLX |
|
7452 |
SETWIN(aGLXWindowId) |
|
7453 |
setnurbsproperty(_longVal(property), _floatVal(value)); |
|
7454 |
RETURN (true); |
|
7455 |
#endif |
|
7456 |
%} |
|
7457 |
. |
|
7458 |
^ false |
|
7459 |
! |
|
7460 |
||
7461 |
glxSetpattern: index in: aGLXWindowId |
|
7462 |
||
7463 |
%{ /* NOCONTEXT */ |
|
7464 |
#ifdef GLX |
|
7465 |
SETWIN(aGLXWindowId) |
|
7466 |
setpattern(_shortVal(index)); |
|
7467 |
RETURN (true); |
|
7468 |
#endif |
|
7469 |
%} |
|
7470 |
. |
|
7471 |
^ false |
|
7472 |
! |
|
7473 |
||
7474 |
glxSetpup: pup entry: entry mode: mode in: aGLXWindowId |
|
7475 |
||
7476 |
%{ /* NOCONTEXT */ |
|
7477 |
#ifdef GLX |
|
7478 |
SETWIN(aGLXWindowId) |
|
7479 |
setpup(_longVal(pup), _longVal(entry), (ulong)__intVal(mode)); |
|
7480 |
RETURN (true); |
|
7481 |
#endif |
|
7482 |
%} |
|
7483 |
. |
|
7484 |
^ false |
|
7485 |
! |
|
7486 |
||
7487 |
glxSetvaluator: v init: init vmin: vmin vmax: vmax in: aGLXWindowId |
|
7488 |
||
7489 |
%{ /* NOCONTEXT */ |
|
7490 |
#ifdef GLX |
|
7491 |
SETWIN(aGLXWindowId) |
|
7492 |
setvaluator(_deviceVal(v), _shortVal(init), _shortVal(vmin), _shortVal(vmax)); |
|
7493 |
RETURN (true); |
|
7494 |
#endif |
|
7495 |
%} |
|
7496 |
. |
|
7497 |
^ false |
|
7498 |
! |
|
7499 |
||
7500 |
glxSetvideo: reg value: value in: aGLXWindowId |
|
7501 |
||
7502 |
%{ /* NOCONTEXT */ |
|
7503 |
#ifdef GLX |
|
7504 |
SETWIN(aGLXWindowId) |
|
7505 |
setvideo(_longVal(reg), _longVal(value)); |
|
7506 |
RETURN (true); |
|
7507 |
#endif |
|
7508 |
%} |
|
7509 |
. |
|
7510 |
^ false |
|
7511 |
! |
|
7512 |
||
7513 |
glxShademodel: model in: aGLXWindowId |
|
7514 |
||
7515 |
%{ /* NOCONTEXT */ |
|
7516 |
#ifdef GLX |
|
7517 |
SETWIN(aGLXWindowId) |
|
7518 |
shademodel(_longVal(model)); |
|
7519 |
RETURN (true); |
|
7520 |
#endif |
|
7521 |
%} |
|
7522 |
. |
|
7523 |
^ false |
|
7524 |
! |
|
7525 |
||
7526 |
glxShaderangeLowin: lowin hiwin: hiwin z1: z1 z2: z2 in: aGLXWindowId |
|
7527 |
||
7528 |
%{ /* NOCONTEXT */ |
|
7529 |
#ifdef GLX |
|
7530 |
SETWIN(aGLXWindowId) |
|
7531 |
shaderange(_colorindexVal(lowin), _colorindexVal(hiwin), |
|
7532 |
_screencoordVal(z1), _screencoordVal(z2)); |
|
7533 |
RETURN (true); |
|
7534 |
#endif |
|
7535 |
%} |
|
7536 |
. |
|
7537 |
^ false |
|
7538 |
! |
|
7539 |
||
7540 |
glxSmoothline: mode in: aGLXWindowId |
|
7541 |
||
7542 |
%{ /* NOCONTEXT */ |
|
7543 |
#ifdef GLX |
|
7544 |
SETWIN(aGLXWindowId) |
|
7545 |
smoothline(_longVal(mode)); |
|
7546 |
RETURN (true); |
|
7547 |
#endif |
|
7548 |
%} |
|
7549 |
. |
|
7550 |
^ false |
|
7551 |
! |
|
7552 |
||
7553 |
glxStencilEnable: enable ref: ref func: func mask: mask fail: fail |
|
7554 |
pass: pass zpass: zpass in: aGLXWindowId |
|
7555 |
||
7556 |
%{ /* NOCONTEXT */ |
|
7557 |
#ifdef GLX |
|
7558 |
SETWIN(aGLXWindowId) |
|
7559 |
stencil(_longVal(enable), (ulong)__intVal(ref), _longVal(func), |
|
7560 |
(ulong)__intVal(mask), _longVal(fail), _longVal(pass), _longVal(zpass)); |
|
7561 |
RETURN (true); |
|
7562 |
#endif |
|
7563 |
%} |
|
7564 |
. |
|
7565 |
^ false |
|
7566 |
! |
|
7567 |
||
7568 |
glxStensize: planes in: aGLXWindowId |
|
7569 |
||
7570 |
%{ /* NOCONTEXT */ |
|
7571 |
#ifdef GLX |
|
7572 |
SETWIN(aGLXWindowId) |
|
7573 |
stensize(_longVal(planes)); |
|
7574 |
RETURN (true); |
|
7575 |
#endif |
|
7576 |
%} |
|
7577 |
. |
|
7578 |
^ false |
|
7579 |
! |
|
7580 |
||
7581 |
glxStepunitX: x y: y in: aGLXWindowId |
|
7582 |
||
7583 |
%{ /* NOCONTEXT */ |
|
7584 |
#ifdef GLX |
|
7585 |
SETWIN(aGLXWindowId) |
|
7586 |
stepunit(_longVal(x), _longVal(y)); |
|
7587 |
RETURN (true); |
|
7588 |
#endif |
|
7589 |
%} |
|
7590 |
. |
|
7591 |
^ false |
|
7592 |
! |
|
7593 |
||
7594 |
glxSubpixel: b in: aGLXWindowId |
|
7595 |
||
7596 |
%{ /* NOCONTEXT */ |
|
7597 |
#ifdef GLX |
|
7598 |
SETWIN(aGLXWindowId) |
|
7599 |
subpixel(_booleanVal(b)); |
|
7600 |
RETURN (true); |
|
7601 |
#endif |
|
7602 |
%} |
|
7603 |
. |
|
7604 |
^ false |
|
7605 |
! |
|
7606 |
||
7607 |
glxSwapinterval: i in: aGLXWindowId |
|
7608 |
||
7609 |
%{ /* NOCONTEXT */ |
|
7610 |
#ifdef GLX |
|
7611 |
SETWIN(aGLXWindowId) |
|
7612 |
swapinterval(_shortVal(i)); |
|
7613 |
RETURN (true); |
|
7614 |
#endif |
|
7615 |
%} |
|
7616 |
. |
|
7617 |
^ false |
|
7618 |
! |
|
7619 |
||
7620 |
glxSwaptmeshIn: aGLXWindowId |
|
7621 |
||
7622 |
%{ /* NOCONTEXT */ |
|
7623 |
#ifdef GLX |
|
7624 |
SETWIN(aGLXWindowId) |
|
7625 |
swaptmesh(); |
|
7626 |
RETURN (true); |
|
7627 |
#endif |
|
7628 |
%} |
|
7629 |
. |
|
7630 |
^ false |
|
7631 |
! |
|
7632 |
||
7633 |
glxSwinopen: parent in: aGLXWindowId |
|
7634 |
||
7635 |
%{ /* NOCONTEXT */ |
|
7636 |
#ifdef GLX |
|
7637 |
SETWIN(aGLXWindowId) |
|
7638 |
swinopen(_longVal(parent)); |
|
7639 |
RETURN (true); |
|
7640 |
#endif |
|
7641 |
%} |
|
7642 |
. |
|
7643 |
^ false |
|
7644 |
! |
|
7645 |
||
7646 |
glxSwritemask: mask in: aGLXWindowId |
|
7647 |
||
7648 |
%{ /* NOCONTEXT */ |
|
7649 |
#ifdef GLX |
|
7650 |
SETWIN(aGLXWindowId) |
|
7651 |
swritemask((ulong)__intVal(mask)); |
|
7652 |
RETURN (true); |
|
7653 |
#endif |
|
7654 |
%} |
|
7655 |
. |
|
7656 |
^ false |
|
7657 |
! |
|
7658 |
||
7659 |
glxTextinitIn: aGLXWindowId |
|
7660 |
||
7661 |
%{ /* NOCONTEXT */ |
|
7662 |
#ifdef GLX |
|
7663 |
SETWIN(aGLXWindowId) |
|
7664 |
textinit(); |
|
7665 |
RETURN (true); |
|
7666 |
#endif |
|
7667 |
%} |
|
7668 |
. |
|
7669 |
^ false |
|
7670 |
! |
|
7671 |
||
7672 |
glxTextportLeft: left right: right bottom: bottom top: top in: aGLXWindowId |
|
7673 |
||
7674 |
%{ /* NOCONTEXT */ |
|
7675 |
#ifdef GLX |
|
7676 |
SETWIN(aGLXWindowId) |
|
7677 |
textport(_screencoordVal(left), _screencoordVal(right), |
|
7678 |
_screencoordVal(bottom), _screencoordVal(top)); |
|
7679 |
RETURN (true); |
|
7680 |
#endif |
|
7681 |
%} |
|
7682 |
. |
|
7683 |
^ false |
|
7684 |
! |
|
7685 |
||
7686 |
glxTieB: b v1: v1 v2: v2 in: aGLXWindowId |
|
7687 |
||
7688 |
%{ /* NOCONTEXT */ |
|
7689 |
#ifdef GLX |
|
7690 |
SETWIN(aGLXWindowId) |
|
7691 |
tie(_deviceVal(b), _deviceVal(v1), _deviceVal(v2)); |
|
7692 |
RETURN (true); |
|
7693 |
#endif |
|
7694 |
%} |
|
7695 |
. |
|
7696 |
^ false |
|
7697 |
! |
|
7698 |
||
7699 |
glxTlutbind: target index: index in: aGLXWindowId |
|
7700 |
||
7701 |
%{ /* NOCONTEXT */ |
|
7702 |
#ifdef FULL_GLX |
|
7703 |
SETWIN(aGLXWindowId) |
|
7704 |
tlutbind(_longVal(target), _longVal(index)); |
|
7705 |
RETURN (true); |
|
7706 |
#endif |
|
7707 |
%} |
|
7708 |
. |
|
7709 |
^ false |
|
7710 |
! |
|
7711 |
||
7712 |
glxTpoffIn: aGLXWindowId |
|
7713 |
||
7714 |
%{ /* NOCONTEXT */ |
|
7715 |
#ifdef GLX |
|
7716 |
SETWIN(aGLXWindowId) |
|
7717 |
tpoff(); |
|
7718 |
RETURN (true); |
|
7719 |
#endif |
|
7720 |
%} |
|
7721 |
. |
|
7722 |
^ false |
|
7723 |
! |
|
7724 |
||
7725 |
glxTponIn: aGLXWindowId |
|
7726 |
||
7727 |
%{ /* NOCONTEXT */ |
|
7728 |
#ifdef GLX |
|
7729 |
SETWIN(aGLXWindowId) |
|
7730 |
tpon(); |
|
7731 |
RETURN (true); |
|
7732 |
#endif |
|
7733 |
%} |
|
7734 |
. |
|
7735 |
^ false |
|
7736 |
! |
|
7737 |
||
7738 |
glxUnqdevice: dev in: aGLXWindowId |
|
7739 |
||
7740 |
%{ /* NOCONTEXT */ |
|
1932 | 7741 |
SETWIN(aGLXWindowId) |
7742 |
#ifdef OPENGL |
|
7743 |
#else |
|
294 | 7744 |
unqdevice(_deviceVal(dev)); |
1932 | 7745 |
#endif |
7746 |
%} |
|
294 | 7747 |
! |
7748 |
||
7749 |
glxWmpack: pack in: aGLXWindowId |
|
7750 |
||
7751 |
%{ /* NOCONTEXT */ |
|
7752 |
#ifdef GLX |
|
7753 |
SETWIN(aGLXWindowId) |
|
7754 |
wmpack((ulong)__intVal(pack)); |
|
7755 |
RETURN (true); |
|
7756 |
#endif |
|
7757 |
%} |
|
7758 |
. |
|
7759 |
^ false |
|
7760 |
! |
|
7761 |
||
7762 |
glxWritemask: wtm in: aGLXWindowId |
|
7763 |
||
7764 |
%{ /* NOCONTEXT */ |
|
7765 |
#ifdef GLX |
|
7766 |
SETWIN(aGLXWindowId) |
|
7767 |
writemask(_colorindexVal(wtm)); |
|
7768 |
RETURN (true); |
|
7769 |
#endif |
|
7770 |
%} |
|
7771 |
. |
|
7772 |
^ false |
|
7773 |
! |
|
7774 |
||
7775 |
glxXfpt2X: x y: y in: aGLXWindowId |
|
7776 |
||
7777 |
%{ /* NOCONTEXT */ |
|
7778 |
#ifdef GLX |
|
7779 |
Coord c_x, c_y; |
|
7780 |
||
7781 |
_COORD_ (x, c_x) |
|
7782 |
_COORD_ (y, c_y) |
|
7783 |
SETWIN(aGLXWindowId) |
|
7784 |
xfpt2(c_x, c_y); |
|
7785 |
RETURN (true); |
|
7786 |
#endif |
|
7787 |
%} |
|
7788 |
. |
|
7789 |
^ false |
|
7790 |
! |
|
7791 |
||
7792 |
glxXfpt2iX: x y: y in: aGLXWindowId |
|
7793 |
||
7794 |
%{ /* NOCONTEXT */ |
|
7795 |
#ifdef GLX |
|
7796 |
Icoord c_x, c_y; |
|
7797 |
||
7798 |
_ICOORD_ (x, c_x) |
|
7799 |
_ICOORD_ (y, c_y) |
|
7800 |
SETWIN(aGLXWindowId) |
|
7801 |
xfpt2i(c_x, c_y); |
|
7802 |
RETURN (true); |
|
7803 |
#endif |
|
7804 |
%} |
|
7805 |
. |
|
7806 |
^ false |
|
7807 |
! |
|
7808 |
||
7809 |
glxXfpt2sX: x y: y in: aGLXWindowId |
|
7810 |
||
7811 |
%{ /* NOCONTEXT */ |
|
7812 |
#ifdef GLX |
|
7813 |
Scoord c_x, c_y; |
|
7814 |
||
7815 |
_SCOORD_ (x, c_x) |
|
7816 |
_SCOORD_ (y, c_y) |
|
7817 |
SETWIN(aGLXWindowId) |
|
7818 |
xfpt2s(c_x, c_y); |
|
7819 |
RETURN (true); |
|
7820 |
#endif |
|
7821 |
%} |
|
7822 |
. |
|
7823 |
^ false |
|
7824 |
! |
|
7825 |
||
7826 |
glxXfpt4X: x y: y z: z w: w in: aGLXWindowId |
|
7827 |
||
7828 |
%{ /* NOCONTEXT */ |
|
7829 |
#ifdef GLX |
|
7830 |
Coord c_x, c_y, c_z, c_w; |
|
7831 |
||
7832 |
_COORD_ (x, c_x) |
|
7833 |
_COORD_ (y, c_y) |
|
7834 |
_COORD_ (z, c_z) |
|
7835 |
_COORD_ (w, c_w) |
|
7836 |
SETWIN(aGLXWindowId) |
|
7837 |
xfpt4(c_x, c_y, c_z, c_w); |
|
7838 |
RETURN (true); |
|
7839 |
#endif |
|
7840 |
%} |
|
7841 |
. |
|
7842 |
^ false |
|
7843 |
! |
|
7844 |
||
7845 |
glxXfpt4iX: x y: y z: z w: w in: aGLXWindowId |
|
7846 |
||
7847 |
%{ /* NOCONTEXT */ |
|
7848 |
#ifdef GLX |
|
7849 |
Icoord c_x, c_y, c_z, c_w; |
|
7850 |
||
7851 |
_ICOORD_ (x, c_x) |
|
7852 |
_ICOORD_ (y, c_y) |
|
7853 |
_ICOORD_ (z, c_z) |
|
7854 |
_ICOORD_ (w, c_w) |
|
7855 |
SETWIN(aGLXWindowId) |
|
7856 |
xfpt4i(c_x, c_y, c_z, c_w); |
|
7857 |
RETURN (true); |
|
7858 |
#endif |
|
7859 |
%} |
|
7860 |
. |
|
7861 |
^ false |
|
7862 |
! |
|
7863 |
||
7864 |
glxXfpt4sX: x y: y z: z w: w in: aGLXWindowId |
|
7865 |
||
7866 |
%{ /* NOCONTEXT */ |
|
7867 |
#ifdef GLX |
|
7868 |
Scoord c_x, c_y, c_z, c_w; |
|
7869 |
||
7870 |
_SCOORD_ (x, c_x) |
|
7871 |
_SCOORD_ (y, c_y) |
|
7872 |
_SCOORD_ (z, c_z) |
|
7873 |
_SCOORD_ (w, c_w) |
|
7874 |
SETWIN(aGLXWindowId) |
|
7875 |
xfpt4s(c_x, c_y, c_z, c_w); |
|
7876 |
RETURN (true); |
|
7877 |
#endif |
|
7878 |
%} |
|
7879 |
. |
|
7880 |
^ false |
|
7881 |
! |
|
7882 |
||
7883 |
glxXfptX: x y: y z: z in: aGLXWindowId |
|
7884 |
||
7885 |
%{ /* NOCONTEXT */ |
|
7886 |
#ifdef GLX |
|
7887 |
Coord c_x, c_y, c_z; |
|
7888 |
||
7889 |
_COORD_ (x, c_x) |
|
7890 |
_COORD_ (y, c_y) |
|
7891 |
_COORD_ (z, c_z) |
|
7892 |
SETWIN(aGLXWindowId) |
|
7893 |
xfpt(c_x, c_y, c_z); |
|
7894 |
RETURN (true); |
|
7895 |
#endif |
|
7896 |
%} |
|
7897 |
. |
|
7898 |
^ false |
|
7899 |
! |
|
7900 |
||
7901 |
glxXfptiX: x y: y z: z in: aGLXWindowId |
|
7902 |
||
7903 |
%{ /* NOCONTEXT */ |
|
7904 |
#ifdef GLX |
|
7905 |
Icoord c_x, c_y, c_z; |
|
7906 |
||
7907 |
_ICOORD_ (x, c_x) |
|
7908 |
_ICOORD_ (y, c_y) |
|
7909 |
_ICOORD_ (z, c_z) |
|
7910 |
SETWIN(aGLXWindowId) |
|
7911 |
xfpti(c_x, c_y, c_z); |
|
7912 |
RETURN (true); |
|
7913 |
#endif |
|
7914 |
%} |
|
7915 |
. |
|
7916 |
^ false |
|
7917 |
! |
|
7918 |
||
7919 |
glxXfptsX: x y: y z: z in: aGLXWindowId |
|
7920 |
||
7921 |
%{ /* NOCONTEXT */ |
|
7922 |
#ifdef GLX |
|
7923 |
Scoord c_x, c_y, c_z; |
|
7924 |
||
7925 |
_SCOORD_ (x, c_x) |
|
7926 |
_SCOORD_ (y, c_y) |
|
7927 |
_SCOORD_ (z, c_z) |
|
7928 |
SETWIN(aGLXWindowId) |
|
7929 |
xfpts(c_x, c_y, c_z); |
|
7930 |
RETURN (true); |
|
7931 |
#endif |
|
7932 |
%} |
|
7933 |
. |
|
7934 |
^ false |
|
7935 |
! ! |
|
7936 |
||
7937 |
!GLXWorkstation methodsFor:'vertex data transfer'! |
|
7938 |
||
7939 |
glxN3f:arrayOf3Floats in:aGLXWindowId |
|
7940 |
"argument must be an array of 3 floats containing the |
|
7941 |
current vertex normal - in real GL only" |
|
7942 |
||
7943 |
%{ /* NOCONTEXT */ |
|
7944 |
#ifdef GLX |
|
7945 |
float vec[3], *v; |
|
7946 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7947 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 7948 |
SETWIN(aGLXWindowId) |
7949 |
n3f(v); |
|
7950 |
RETURN (true); |
|
7951 |
#endif |
|
7952 |
%} |
|
7953 |
. |
|
7954 |
^ false |
|
7955 |
! |
|
7956 |
||
7957 |
glxV2d:v in:aGLXWindowId |
|
7958 |
"pass a vertex; v must be a vector with 2 doubles; z is taken as 0" |
|
7959 |
||
7960 |
%{ /* NOCONTEXT */ |
|
7961 |
double vec[2], *c_v; |
|
7962 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7963 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 2))) RETURN(false); |
294 | 7964 |
SETWIN(aGLXWindowId) |
1932 | 7965 |
#ifdef OPENGL |
7966 |
#else |
|
294 | 7967 |
v2d(c_v); |
1932 | 7968 |
#endif |
294 | 7969 |
RETURN (true); |
7970 |
%} |
|
7971 |
! |
|
7972 |
||
7973 |
glxV2f:v in:aGLXWindowId |
|
7974 |
"pass a vertex; v must be a vector with 2 floats; z is taken as 0" |
|
7975 |
||
7976 |
%{ /* NOCONTEXT */ |
|
7977 |
float vec[2], *c_v; |
|
7978 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7979 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
294 | 7980 |
SETWIN(aGLXWindowId) |
1932 | 7981 |
#ifdef OPENGL |
7982 |
#else |
|
294 | 7983 |
v2f(c_v); |
1932 | 7984 |
#endif |
294 | 7985 |
RETURN (true); |
7986 |
%} |
|
7987 |
! |
|
7988 |
||
7989 |
glxV2fX:x y:y in:aGLXWindowId |
|
7990 |
"pass a vertex from individual x and y values; z is taken as 0.0" |
|
7991 |
||
7992 |
%{ /* NOCONTEXT */ |
|
7993 |
float vec[2]; |
|
7994 |
||
7995 |
_FLOAT_(x, vec[0]) |
|
7996 |
_FLOAT_(y, vec[1]) |
|
7997 |
SETWIN(aGLXWindowId) |
|
1932 | 7998 |
#ifdef OPENGL |
7999 |
#else |
|
294 | 8000 |
v2f(vec); |
1932 | 8001 |
#endif |
294 | 8002 |
RETURN (true); |
8003 |
%} |
|
8004 |
! |
|
8005 |
||
8006 |
glxV2i:v in:aGLXWindowId |
|
8007 |
"pass a vertex; v must be a vector with 2 longs; z is taken as 0" |
|
8008 |
||
8009 |
%{ /* NOCONTEXT */ |
|
8010 |
long vec[2], *c_v; |
|
8011 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8012 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 2))) RETURN(false); |
294 | 8013 |
SETWIN(aGLXWindowId) |
1932 | 8014 |
#ifdef OPENGL |
8015 |
#else |
|
294 | 8016 |
v2i(c_v); |
1932 | 8017 |
#endif |
294 | 8018 |
RETURN (true); |
8019 |
%} |
|
8020 |
! |
|
8021 |
||
8022 |
glxV2s:v in:aGLXWindowId |
|
8023 |
"pass a vertex; v must be a vector with 2 shorts; z is taken as 0" |
|
8024 |
||
8025 |
%{ /* NOCONTEXT */ |
|
8026 |
short vec[2], *c_v; |
|
8027 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8028 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 2))) RETURN(false); |
294 | 8029 |
SETWIN(aGLXWindowId) |
1932 | 8030 |
#ifdef OPENGL |
8031 |
#else |
|
294 | 8032 |
v2s(c_v); |
1932 | 8033 |
#endif |
294 | 8034 |
RETURN (true); |
8035 |
%} |
|
8036 |
! |
|
8037 |
||
8038 |
glxV3d:v in:aGLXWindowId |
|
8039 |
"pass a vertex; v must be a 3-element double-vector" |
|
8040 |
||
8041 |
%{ /* NOCONTEXT */ |
|
8042 |
double vec[3], *c_v; |
|
8043 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8044 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 3))) RETURN(false); |
294 | 8045 |
SETWIN(aGLXWindowId) |
1932 | 8046 |
#ifdef OPENGL |
8047 |
#else |
|
294 | 8048 |
v3d(c_v); |
1932 | 8049 |
#endif |
294 | 8050 |
RETURN (true); |
8051 |
%} |
|
8052 |
. |
|
8053 |
^ false |
|
8054 |
! |
|
8055 |
||
8056 |
glxV3f:v in:aGLXWindowId |
|
8057 |
"pass a vertex; v must be a 3-element float-vector" |
|
8058 |
||
8059 |
%{ /* NOCONTEXT */ |
|
8060 |
float vec[3], *c_v; |
|
8061 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8062 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
294 | 8063 |
SETWIN(aGLXWindowId) |
1932 | 8064 |
#ifdef OPENGL |
8065 |
#else |
|
294 | 8066 |
v3f(c_v); |
1932 | 8067 |
#endif |
294 | 8068 |
RETURN (true); |
8069 |
%} |
|
8070 |
! |
|
8071 |
||
8072 |
glxV3fX:x y:y z:z in: aGLXWindowId |
|
8073 |
"pass a vector from individual x, y and z (float) values" |
|
8074 |
||
8075 |
%{ /* NOCONTEXT */ |
|
8076 |
float vec[3]; |
|
8077 |
||
8078 |
_FLOAT_(x, vec[0]) |
|
8079 |
_FLOAT_(y, vec[1]) |
|
8080 |
_FLOAT_(z, vec[2]) |
|
8081 |
SETWIN(aGLXWindowId) |
|
1932 | 8082 |
#ifdef OPENGL |
8083 |
#else |
|
294 | 8084 |
v3f(vec); |
1932 | 8085 |
#endif |
294 | 8086 |
RETURN (true); |
8087 |
%} |
|
8088 |
! |
|
8089 |
||
8090 |
glxV3i:v in:aGLXWindowId |
|
8091 |
"pass a vertex; v must be a vector with 3 longs" |
|
8092 |
||
8093 |
%{ /* NOCONTEXT */ |
|
8094 |
long vec[3], *c_v; |
|
8095 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8096 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
294 | 8097 |
SETWIN(aGLXWindowId) |
1932 | 8098 |
#ifdef OPENGL |
8099 |
#else |
|
294 | 8100 |
v3i(c_v); |
1932 | 8101 |
#endif |
294 | 8102 |
RETURN (true); |
8103 |
%} |
|
8104 |
! |
|
8105 |
||
8106 |
glxV3s:v in:aGLXWindowId |
|
8107 |
"pass a vertex; v must be a vector with 3 shorts" |
|
8108 |
||
8109 |
%{ /* NOCONTEXT */ |
|
8110 |
short vec[3], *c_v; |
|
8111 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8112 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
294 | 8113 |
SETWIN(aGLXWindowId) |
1932 | 8114 |
#ifdef OPENGL |
8115 |
#else |
|
294 | 8116 |
v3s(c_v); |
1932 | 8117 |
#endif |
294 | 8118 |
RETURN (true); |
8119 |
%} |
|
8120 |
! |
|
8121 |
||
8122 |
glxV4d:v in:aGLXWindowId |
|
8123 |
"pass a vertex; v must be a 4-element double-vector, |
|
8124 |
containing x, y, z and w" |
|
8125 |
||
8126 |
%{ /* NOCONTEXT */ |
|
8127 |
double vec[4], *c_v; |
|
8128 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8129 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 4))) RETURN(false); |
294 | 8130 |
SETWIN(aGLXWindowId) |
1932 | 8131 |
#ifdef OPENGL |
8132 |
#else |
|
294 | 8133 |
v4d(c_v); |
1932 | 8134 |
#endif |
294 | 8135 |
RETURN (true); |
8136 |
%} |
|
8137 |
! |
|
8138 |
||
8139 |
glxV4f:v in:aGLXWindowId |
|
8140 |
"pass a vertex; v must be a 4-element float-vector, |
|
8141 |
containing x, y, z and w" |
|
8142 |
||
8143 |
%{ /* NOCONTEXT */ |
|
8144 |
float vec[4], *c_v; |
|
8145 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8146 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
294 | 8147 |
SETWIN(aGLXWindowId) |
1932 | 8148 |
#ifdef OPENGL |
8149 |
#else |
|
294 | 8150 |
v4f(c_v); |
1932 | 8151 |
#endif |
294 | 8152 |
RETURN (true); |
8153 |
%} |
|
8154 |
! |
|
8155 |
||
8156 |
glxV4i:v in:aGLXWindowId |
|
8157 |
"pass a vertex; v must be a 4-element int-vector, |
|
8158 |
containing x, y, z and w" |
|
8159 |
||
8160 |
%{ /* NOCONTEXT */ |
|
8161 |
long vec[4], *c_v; |
|
8162 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8163 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
294 | 8164 |
SETWIN(aGLXWindowId) |
1932 | 8165 |
#ifdef OPENGL |
8166 |
#else |
|
294 | 8167 |
v4i(c_v); |
1932 | 8168 |
#endif |
294 | 8169 |
RETURN (true); |
8170 |
%} |
|
8171 |
! |
|
8172 |
||
8173 |
glxV4s:v in:aGLXWindowId |
|
8174 |
"pass a vertex; v must be a 4-element short-vector, |
|
8175 |
containing x, y, z and w" |
|
8176 |
||
8177 |
%{ /* NOCONTEXT */ |
|
8178 |
short vec[4], *c_v; |
|
8179 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8180 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
294 | 8181 |
SETWIN(aGLXWindowId) |
1932 | 8182 |
#ifdef OPENGL |
8183 |
#else |
|
294 | 8184 |
v4s(c_v); |
1932 | 8185 |
#endif |
294 | 8186 |
RETURN (true); |
8187 |
%} |
|
8188 |
! |
|
8189 |
||
8190 |
glxVOriginIn:aGLXWindowId |
|
8191 |
"pass a 0.0/0.0/0.0 vector. |
|
8192 |
This is the same as v3f:#(0.0 0.0 0.0), but, since its so |
|
8193 |
common, this somewhat faster method has been provided" |
|
8194 |
||
8195 |
%{ /* NOCONTEXT */ |
|
8196 |
static float vec[3] = {0.0, 0.0, 0.0}; |
|
8197 |
||
8198 |
SETWIN(aGLXWindowId) |
|
1932 | 8199 |
#ifdef OPENGL |
8200 |
#else |
|
294 | 8201 |
v3f(vec); |
1932 | 8202 |
#endif |
294 | 8203 |
RETURN (true); |
8204 |
%} |
|
8205 |
! |
|
8206 |
||
8207 |
glxVUnitXIn:aGLXWindowId |
|
8208 |
"pass a 1.0/0.0/0.0 vector. |
|
8209 |
This is the same as v3f:#(1.0 0.0 0.0), but, since its so |
|
8210 |
common, this somewhat faster method has been provided" |
|
8211 |
||
8212 |
%{ /* NOCONTEXT */ |
|
8213 |
static float vec[3] = {1.0, 0.0, 0.0}; |
|
8214 |
||
8215 |
SETWIN(aGLXWindowId) |
|
1932 | 8216 |
#ifdef OPENGL |
8217 |
#else |
|
294 | 8218 |
v3f(vec); |
1932 | 8219 |
#endif |
294 | 8220 |
RETURN (true); |
8221 |
%} |
|
8222 |
! |
|
8223 |
||
8224 |
glxVUnitYIn:aGLXWindowId |
|
8225 |
"pass a 0.0/1.0/0.0 vector. |
|
8226 |
This is the same as v3f:#(0.0 1.0 0.0), but, since its so |
|
8227 |
common, this somewhat faster method has been provided" |
|
8228 |
||
8229 |
%{ /* NOCONTEXT */ |
|
8230 |
static float vec[3] = {0.0, 1.0, 0.0}; |
|
8231 |
||
8232 |
SETWIN(aGLXWindowId) |
|
1932 | 8233 |
#ifdef OPENGL |
8234 |
#else |
|
294 | 8235 |
v3f(vec); |
1932 | 8236 |
#endif |
294 | 8237 |
RETURN (true); |
8238 |
%} |
|
8239 |
! |
|
8240 |
||
8241 |
glxVUnitZIn:aGLXWindowId |
|
8242 |
"pass a 0.0/0.0/1.0 vector. |
|
8243 |
This is the same as v3f:#(0.0 0.0 1.0), but, since its so |
|
8244 |
common, this somewhat faster method has been provided" |
|
8245 |
||
8246 |
%{ /* NOCONTEXT */ |
|
8247 |
static float vec[3] = {0.0, 0.0, 1.0}; |
|
8248 |
||
8249 |
SETWIN(aGLXWindowId) |
|
1932 | 8250 |
#ifdef OPENGL |
8251 |
#else |
|
294 | 8252 |
v3f(vec); |
1932 | 8253 |
#endif |
294 | 8254 |
RETURN (true); |
8255 |
%} |
|
8256 |
! ! |
|
8257 |
||
8258 |
!GLXWorkstation methodsFor:'video and planes'! |
|
8259 |
||
8260 |
glxOverlayPlanes: planes in: aGLXWindowId |
|
8261 |
||
8262 |
%{ /* NOCONTEXT */ |
|
8263 |
#ifdef GLX |
|
8264 |
SETWIN(aGLXWindowId) |
|
8265 |
overlay(_longVal(planes)); |
|
8266 |
RETURN (true); |
|
8267 |
#endif |
|
8268 |
%} |
|
8269 |
. |
|
8270 |
^ false |
|
8271 |
! |
|
8272 |
||
8273 |
glxStereobufferIn: aGLXWindowId |
|
8274 |
||
8275 |
%{ /* NOCONTEXT */ |
|
8276 |
#ifdef FULL_GLX |
|
8277 |
SETWIN(aGLXWindowId) |
|
8278 |
stereobuffer(); |
|
8279 |
RETURN (true); |
|
8280 |
#endif |
|
8281 |
%} |
|
8282 |
. |
|
8283 |
^ false |
|
8284 |
! |
|
8285 |
||
8286 |
glxUnderlay: planes in: aGLXWindowId |
|
8287 |
||
8288 |
%{ /* NOCONTEXT */ |
|
8289 |
#ifdef GLX |
|
8290 |
SETWIN(aGLXWindowId) |
|
8291 |
underlay(_longVal(planes)); |
|
8292 |
RETURN (true); |
|
8293 |
#endif |
|
8294 |
%} |
|
8295 |
. |
|
8296 |
^ false |
|
8297 |
! |
|
8298 |
||
8299 |
glxVideocmd:cmd in:aGLXWindowId |
|
8300 |
||
8301 |
%{ /* NOCONTEXT */ |
|
8302 |
#ifdef GLX |
|
8303 |
SETWIN(aGLXWindowId) |
|
8304 |
videocmd(_longVal(cmd)); |
|
8305 |
RETURN (true); |
|
8306 |
#endif |
|
8307 |
%} |
|
8308 |
. |
|
8309 |
^ false |
|
8310 |
! ! |
|
8311 |
||
8312 |
!GLXWorkstation methodsFor:'viewing'! |
|
8313 |
||
8314 |
glxLookatVx:vx vy:vy vz:vz px:px py:py pz:pz twist:twist in:aGLXWindowId |
|
8315 |
"define viewing transformation" |
|
8316 |
||
8317 |
%{ /* NOCONTEXT */ |
|
8318 |
||
8319 |
Coord f_vx, f_vy, f_vz, f_px, f_py, f_pz; |
|
8320 |
Angle a_twist; |
|
8321 |
||
8322 |
_COORD_ (vx, f_vx) |
|
8323 |
_COORD_ (vy, f_vy) |
|
8324 |
_COORD_ (vz, f_vz) |
|
8325 |
_COORD_ (px, f_px) |
|
8326 |
_COORD_ (py, f_py) |
|
8327 |
_COORD_ (pz, f_pz) |
|
8328 |
_ANGLE_ (twist, a_twist) |
|
8329 |
SETWIN(aGLXWindowId) |
|
1932 | 8330 |
#ifdef OPENGL |
8331 |
#else |
|
294 | 8332 |
lookat(f_vx, f_vy, f_vz, f_px, f_py, f_pz, a_twist); |
1932 | 8333 |
#endif |
294 | 8334 |
%} |
8335 |
! |
|
8336 |
||
8337 |
glxOrtho2Left: left right: right bottom: bottom top: top in: aGLXWindowId |
|
8338 |
"define 2D orthogonal projection" |
|
8339 |
||
8340 |
%{ /* NOCONTEXT */ |
|
8341 |
float f_left, f_right, f_top, f_bottom; |
|
8342 |
||
8343 |
SETWIN(aGLXWindowId) |
|
8344 |
_FLOAT_(left, f_left) |
|
8345 |
_FLOAT_(right, f_right) |
|
8346 |
_FLOAT_(bottom, f_bottom) |
|
8347 |
_FLOAT_(top, f_top) |
|
1932 | 8348 |
#ifdef OPENGL |
8349 |
#else |
|
294 | 8350 |
ortho2(f_left, f_right, f_bottom, f_top); |
1932 | 8351 |
#endif |
8352 |
%} |
|
294 | 8353 |
! |
8354 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8355 |
glxOrthoLeft: left right: right bottom: bottom top: top near: znear far: zfar in: aGLXWindowId |
294 | 8356 |
"define orthogonal projection" |
8357 |
||
8358 |
%{ /* NOCONTEXT */ |
|
8359 |
float f_left, f_right, f_bottom, f_top, |
|
8360 |
f_near, f_far; |
|
8361 |
||
8362 |
_FLOAT_(left, f_left) |
|
8363 |
_FLOAT_(right, f_right) |
|
8364 |
_FLOAT_(bottom, f_bottom) |
|
8365 |
_FLOAT_(top, f_top) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8366 |
_FLOAT_(znear, f_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8367 |
_FLOAT_(zfar, f_far) |
294 | 8368 |
SETWIN(aGLXWindowId) |
1932 | 8369 |
#ifdef OPENGL |
8370 |
#else |
|
294 | 8371 |
ortho(f_left, f_right, f_bottom, f_top, f_near, f_far); |
1932 | 8372 |
#endif |
294 | 8373 |
%} |
8374 |
! |
|
8375 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8376 |
glxPerspectiveFovy:fovy aspect:aspect near:znear far:zfar in:aGLXWindowId |
294 | 8377 |
"define perspective projection" |
8378 |
||
8379 |
%{ /* NOCONTEXT */ |
|
8380 |
||
8381 |
Angle a_fovy; |
|
8382 |
Coord c_near, c_far; |
|
8383 |
float f_aspect; |
|
8384 |
||
8385 |
_ANGLE_ (fovy, a_fovy) |
|
8386 |
_FLOAT_ (aspect, f_aspect) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8387 |
_COORD_ (znear, c_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8388 |
_COORD_ (zfar, c_far) |
294 | 8389 |
|
8390 |
SETWIN(aGLXWindowId) |
|
1932 | 8391 |
#ifdef OPENGL |
8392 |
#else |
|
294 | 8393 |
perspective(a_fovy, f_aspect, c_near, c_far); |
1932 | 8394 |
#endif |
294 | 8395 |
%} |
8396 |
! |
|
8397 |
||
8398 |
glxPolarviewDist: dist azim: azim inc: inc twist: twist in: aGLXWindowId |
|
8399 |
||
8400 |
%{ /* NOCONTEXT */ |
|
8401 |
Coord c_dist; |
|
8402 |
Angle a_azim, a_inc, a_twist; |
|
8403 |
||
8404 |
_COORD_(dist, c_dist) |
|
8405 |
_ANGLE_(azim, a_azim) |
|
8406 |
_ANGLE_(inc, a_inc) |
|
8407 |
_ANGLE_(twist, a_twist) |
|
8408 |
SETWIN(aGLXWindowId) |
|
1932 | 8409 |
#ifdef OPENGL |
8410 |
#else |
|
294 | 8411 |
polarview(c_dist, a_azim, a_inc, a_twist); |
1932 | 8412 |
#endif |
294 | 8413 |
%} |
8414 |
! |
|
8415 |
||
528 | 8416 |
glxPopviewportIn: aGLXWindowId |
8417 |
"pops the top viewport off the viewport stack" |
|
8418 |
||
8419 |
%{ /* NOCONTEXT */ |
|
8420 |
SETWIN(aGLXWindowId) |
|
1932 | 8421 |
#ifdef OPENGL |
8422 |
#else |
|
528 | 8423 |
popviewport(); |
1932 | 8424 |
#endif |
528 | 8425 |
%} |
8426 |
||
8427 |
"Modified: 19.3.1996 / 18:58:24 / cg" |
|
8428 |
! |
|
8429 |
||
8430 |
glxPushviewportIn: aGLXWindowId |
|
8431 |
"pushes the current viewport on the viewport stack" |
|
8432 |
||
8433 |
%{ /* NOCONTEXT */ |
|
8434 |
SETWIN(aGLXWindowId) |
|
1932 | 8435 |
#ifdef OPENGL |
8436 |
#else |
|
528 | 8437 |
pushviewport(); |
1932 | 8438 |
#endif |
528 | 8439 |
%} |
8440 |
||
8441 |
"Modified: 19.3.1996 / 18:58:02 / cg" |
|
8442 |
! |
|
8443 |
||
294 | 8444 |
glxReshapeViewPortIn: aGLXWindowId |
8445 |
||
8446 |
%{ /* NOCONTEXT */ |
|
8447 |
SETWIN(aGLXWindowId) |
|
1932 | 8448 |
#ifdef OPENGL |
8449 |
#else |
|
294 | 8450 |
reshapeviewport(); |
1932 | 8451 |
#endif |
8452 |
%} |
|
294 | 8453 |
! |
8454 |
||
8455 |
glxViewportLeft:left right:right bottom:bottom top:top in:aGLXWindowId |
|
8456 |
||
8457 |
%{ /* NOCONTEXT */ |
|
8458 |
SETWIN(aGLXWindowId) |
|
1932 | 8459 |
#ifdef OPENGL |
8460 |
#else |
|
294 | 8461 |
viewport(_screencoordVal(left), _screencoordVal(right), |
8462 |
_screencoordVal(bottom), _screencoordVal(top)); |
|
1932 | 8463 |
#endif |
294 | 8464 |
%} |
8465 |
! |
|
8466 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8467 |
glxWindowLeft: left right: right bottom: bottom top: top near: znear far: zfar in: aGLXWindowId |
294 | 8468 |
"this one was added independently by JEFF - kept for his programs ..." |
8469 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8470 |
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
|
8471 |
! |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8472 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8473 |
glxWindowLeft:left right:right top:top bottom:bottom near:znear far:zfar in:aGLXWindowId |
294 | 8474 |
"define perspective viewing pyramid" |
8475 |
||
8476 |
%{ /* NOCONTEXT */ |
|
8477 |
Coord c_left, c_right, c_top, c_bot, c_near, c_far; |
|
8478 |
||
8479 |
_COORD_ (left, c_left) |
|
8480 |
_COORD_ (right, c_right) |
|
8481 |
_COORD_ (top, c_top) |
|
8482 |
_COORD_ (bottom, c_bot) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8483 |
_COORD_ (znear, c_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8484 |
_COORD_ (zfar, c_far) |
294 | 8485 |
SETWIN(aGLXWindowId) |
1932 | 8486 |
#ifdef OPENGL |
8487 |
#else |
|
294 | 8488 |
window(c_left, c_right, c_bot, c_top, c_near, c_far); |
1932 | 8489 |
#endif |
294 | 8490 |
%} |
8491 |
! ! |
|
8492 |
||
8493 |
!GLXWorkstation methodsFor:'window control'! |
|
8494 |
||
2045 | 8495 |
glxResizedView:aGLXWindowId width:width height:height |
2048 | 8496 |
"pass down resize info to the GL - this adjusts the viewport. |
8497 |
This only works with VGL or openGL" |
|
8498 |
||
8499 |
%{ /* NOCONTEXT */ |
|
2074 | 8500 |
SETWIN(aGLXWindowId) |
8501 |
#ifdef VGL |
|
2045 | 8502 |
X11_resized(__intVal(width), __intVal(height)); |
8503 |
RETURN (true); |
|
8504 |
#endif |
|
8505 |
%} |
|
8506 |
. |
|
8507 |
^ false |
|
8508 |
! |
|
8509 |
||
294 | 8510 |
glxWinclose:gwid in:aGLXWindowId |
8511 |
||
8512 |
%{ /* NOCONTEXT */ |
|
8513 |
#ifdef GLX |
|
8514 |
SETWIN(aGLXWindowId) |
|
8515 |
winclose(_longVal(gwid)); |
|
8516 |
RETURN (true); |
|
8517 |
#endif |
|
8518 |
%} |
|
8519 |
. |
|
8520 |
^ false |
|
8521 |
! |
|
8522 |
||
8523 |
glxWinconstraintsIn: aGLXWindowId |
|
8524 |
||
8525 |
%{ /* NOCONTEXT */ |
|
8526 |
#ifdef GLX |
|
8527 |
SETWIN(aGLXWindowId) |
|
8528 |
winconstraints(); |
|
8529 |
RETURN (true); |
|
8530 |
#endif |
|
8531 |
%} |
|
8532 |
. |
|
8533 |
^ false |
|
8534 |
! |
|
8535 |
||
8536 |
glxWindepth: gwid in: aGLXWindowId |
|
8537 |
||
8538 |
%{ /* NOCONTEXT */ |
|
8539 |
#ifdef GLX |
|
8540 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
8541 |
RETURN (__MKSMALLINT(windepth(_longVal(gwid)))); |
294 | 8542 |
#endif |
8543 |
%} |
|
8544 |
. |
|
8545 |
^ false |
|
8546 |
! |
|
8547 |
||
8548 |
glxWingetIn: aGLXWindowId |
|
8549 |
||
8550 |
%{ /* NOCONTEXT */ |
|
8551 |
#ifdef GLX |
|
8552 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
8553 |
RETURN (__MKSMALLINT(winget())); |
294 | 8554 |
#endif |
8555 |
%} |
|
8556 |
. |
|
8557 |
^ false |
|
8558 |
! |
|
8559 |
||
8560 |
glxWinmoveX: x y: y in: aGLXWindowId |
|
8561 |
||
8562 |
%{ /* NOCONTEXT */ |
|
8563 |
#ifdef GLX |
|
8564 |
SETWIN(aGLXWindowId) |
|
8565 |
winmove(_longVal(x), _longVal(y)); |
|
8566 |
RETURN (true); |
|
8567 |
#endif |
|
8568 |
%} |
|
8569 |
. |
|
8570 |
^ false |
|
8571 |
! |
|
8572 |
||
8573 |
glxWinpopIn: aGLXWindowId |
|
8574 |
||
8575 |
%{ /* NOCONTEXT */ |
|
8576 |
#ifdef GLX |
|
8577 |
SETWIN(aGLXWindowId) |
|
8578 |
winpop(); |
|
8579 |
RETURN (true); |
|
8580 |
#endif |
|
8581 |
%} |
|
8582 |
. |
|
8583 |
^ false |
|
8584 |
! |
|
8585 |
||
8586 |
glxWinpositionX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
8587 |
||
8588 |
%{ /* NOCONTEXT */ |
|
8589 |
#ifdef GLX |
|
8590 |
SETWIN(aGLXWindowId) |
|
8591 |
winposition(_longVal(x1), _longVal(y1), _longVal(x2), _longVal(y2)); |
|
8592 |
RETURN (true); |
|
8593 |
#endif |
|
8594 |
%} |
|
8595 |
. |
|
8596 |
^ false |
|
8597 |
! |
|
8598 |
||
8599 |
glxWinpushIn: aGLXWindowId |
|
8600 |
||
8601 |
%{ /* NOCONTEXT */ |
|
8602 |
#ifdef GLX |
|
8603 |
SETWIN(aGLXWindowId) |
|
8604 |
winpush(); |
|
8605 |
RETURN (true); |
|
8606 |
#endif |
|
8607 |
%} |
|
8608 |
. |
|
8609 |
^ false |
|
8610 |
! |
|
8611 |
||
8612 |
glxWinset: gwid in: aGLXWindowId |
|
8613 |
||
8614 |
%{ /* NOCONTEXT */ |
|
8615 |
#ifdef GLX |
|
8616 |
SETWIN(aGLXWindowId) |
|
8617 |
winset(_longVal(gwid)); |
|
8618 |
RETURN (true); |
|
8619 |
#endif |
|
8620 |
%} |
|
8621 |
. |
|
8622 |
^ false |
|
8623 |
! ! |
|
8624 |
||
0 | 8625 |
!GLXWorkstation methodsFor:'window creation'! |
8626 |
||
12 | 8627 |
createGLXWindowFor:aView left:xpos top:ypos width:wwidth height:wheight type:glxType |
157 | 8628 |
|ext wsuperView wsuperViewId windowId| |
0 | 8629 |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
8630 |
glOK ifFalse:[^ nil]. |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
8631 |
|
793 | 8632 |
wsuperView := aView superView view. |
0 | 8633 |
wsuperView notNil ifTrue:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8634 |
wsuperViewId := wsuperView id |
0 | 8635 |
]. |
8636 |
||
524 | 8637 |
%{ /* CALLSSTACK: 20000 */ |
0 | 8638 |
Display *dpy = myDpy; |
185 | 8639 |
int screen = __intVal(_INST(screen)); |
0 | 8640 |
Window newWindow, parentWindow; |
12 | 8641 |
int t; |
0 | 8642 |
|
97 | 8643 |
if (__isSmallInteger(xpos) && __isSmallInteger(ypos) |
8644 |
&& __isSmallInteger(wwidth) && __isSmallInteger(wheight)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8645 |
if (__isExternalAddress(wsuperViewId)) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8646 |
parentWindow = _WindowVal(wsuperViewId); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8647 |
} else { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8648 |
parentWindow = RootWindow(dpy, screen); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8649 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8650 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8651 |
if (glxType == @symbol(colorIndexSingleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8652 |
t = GLXcolorIndexSingleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8653 |
else if (glxType == @symbol(colorIndexDoubleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8654 |
t = GLXcolorIndexDoubleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8655 |
else if (glxType == @symbol(rgbSingleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8656 |
t = GLXrgbSingleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8657 |
else if (glxType == @symbol(rgbDoubleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8658 |
t = GLXrgbDoubleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8659 |
else { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8660 |
RETURN ( nil ); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8661 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8662 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8663 |
ENTERGLX; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8664 |
newWindow = __GLXCreateWindow(dpy, parentWindow, |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8665 |
__intVal(xpos), __intVal(ypos), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8666 |
__intVal(wwidth), __intVal(wheight), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8667 |
0, t); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8668 |
LEAVEGLX; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8669 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8670 |
if (! newWindow) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8671 |
RETURN ( nil ); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8672 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8673 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8674 |
windowId = __MKOBJ(newWindow); |
0 | 8675 |
} |
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
8676 |
%}. |
0 | 8677 |
windowId notNil ifTrue:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8678 |
self addKnownView:aView withId:windowId. |
0 | 8679 |
]. |
8680 |
^ windowId |
|
20 | 8681 |
! |
8682 |
||
8683 |
unlinkGLXView:aGLXWindowId |
|
8684 |
"remove X/GLX link" |
|
524 | 8685 |
|
8686 |
%{ /* CALLSSTACK: 20000 */ |
|
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
8687 |
if (__isExternalAddress(aGLXWindowId)) { |
134 | 8688 |
ENTERGLX; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8689 |
__GLXUnlinkWindow(myDpy, _WindowVal(aGLXWindowId)); |
134 | 8690 |
LEAVEGLX; |
8691 |
} |
|
20 | 8692 |
%} |
0 | 8693 |
! ! |
8694 |
||
294 | 8695 |
!GLXWorkstation methodsFor:'zbuffer'! |
8696 |
||
8697 |
glxZbsize: planes in: aGLXWindowId |
|
127 | 8698 |
|
8699 |
%{ /* NOCONTEXT */ |
|
8700 |
#ifdef FULL_GLX |
|
8701 |
SETWIN(aGLXWindowId) |
|
294 | 8702 |
zbsize(_longVal(planes)); |
8703 |
RETURN (true); |
|
8704 |
#endif |
|
8705 |
%} |
|
8706 |
. |
|
8707 |
^ false |
|
8708 |
! |
|
64 | 8709 |
|
8710 |
glxZbuffer:aBoolean in:aGLXWindowId |
|
8711 |
"enable/disable z-buffer operation" |
|
8712 |
||
8713 |
%{ /* NOCONTEXT */ |
|
8714 |
#ifdef GLX |
|
8715 |
SETWIN(aGLXWindowId) |
|
8716 |
zbuffer(aBoolean == false ? FALSE : TRUE); |
|
8717 |
RETURN (true); |
|
8718 |
#endif |
|
8719 |
%} |
|
8720 |
. |
|
8721 |
^ false |
|
294 | 8722 |
! |
64 | 8723 |
|
8724 |
glxZdraw: b in: aGLXWindowId |
|
8725 |
"enable/disable drawing into the z-buffer" |
|
8726 |
||
8727 |
%{ /* NOCONTEXT */ |
|
8728 |
#ifdef GLX |
|
8729 |
SETWIN(aGLXWindowId) |
|
8730 |
zdraw(_booleanVal(b)); |
|
8731 |
RETURN (true); |
|
8732 |
#endif |
|
8733 |
%} |
|
8734 |
. |
|
8735 |
^ false |
|
294 | 8736 |
! |
64 | 8737 |
|
8738 |
glxZfunction: func in: aGLXWindowId |
|
8739 |
"set the z-buffer comparison function. |
|
8740 |
func may be either the numeric value or a symbol (preferred)" |
|
8741 |
||
8742 |
%{ /* NOCONTEXT */ |
|
8743 |
#ifdef GLX |
|
8744 |
long f; |
|
8745 |
||
8746 |
SETWIN(aGLXWindowId) |
|
8747 |
if (func == @symbol(NEVER)) |
|
77 | 8748 |
f = ZF_NEVER; |
64 | 8749 |
else if (func == @symbol(LESS)) |
77 | 8750 |
f = ZF_LESS; |
64 | 8751 |
else if (func == @symbol(EQUAL)) |
77 | 8752 |
f = ZF_EQUAL; |
64 | 8753 |
else if (func == @symbol(LEQUAL)) |
77 | 8754 |
f = ZF_LEQUAL; |
64 | 8755 |
else if (func == @symbol(GREATER)) |
77 | 8756 |
f = ZF_GREATER; |
64 | 8757 |
else if (func == @symbol(NOTEQUAL)) |
77 | 8758 |
f = ZF_NOTEQUAL; |
64 | 8759 |
else if (func == @symbol(GEQUAL)) |
77 | 8760 |
f = ZF_GEQUAL; |
64 | 8761 |
else if (func == @symbol(ALWAYS)) |
77 | 8762 |
f = ZF_ALWAYS; |
64 | 8763 |
else |
77 | 8764 |
f = _longVal(func); |
64 | 8765 |
zfunction(f); |
8766 |
RETURN (true); |
|
8767 |
#endif |
|
8768 |
%} |
|
8769 |
. |
|
8770 |
^ false |
|
294 | 8771 |
! |
64 | 8772 |
|
8773 |
glxZsource: src in: aGLXWindowId |
|
8774 |
||
8775 |
%{ /* NOCONTEXT */ |
|
8776 |
#ifdef GLX |
|
8777 |
SETWIN(aGLXWindowId) |
|
8778 |
zsource(_longVal(src)); |
|
8779 |
RETURN (true); |
|
8780 |
#endif |
|
8781 |
%} |
|
8782 |
. |
|
8783 |
^ false |
|
294 | 8784 |
! |
64 | 8785 |
|
8786 |
glxZwritemask: mask in: aGLXWindowId |
|
8787 |
||
8788 |
%{ /* NOCONTEXT */ |
|
8789 |
#ifdef GLX |
|
8790 |
SETWIN(aGLXWindowId) |
|
185 | 8791 |
zwritemask((ulong)__intVal(mask)); |
64 | 8792 |
RETURN (true); |
8793 |
#endif |
|
8794 |
%} |
|
8795 |
. |
|
8796 |
^ false |
|
8797 |
! ! |
|
8798 |
||
294 | 8799 |
!GLXWorkstation class methodsFor:'documentation'! |
8800 |
||
8801 |
version |
|
2814 | 8802 |
^ '$Header: /cvs/stx/stx/libview/GLXWorkstation.st,v 1.76 1999-07-30 18:12:20 cg Exp $' |
89 | 8803 |
! ! |