author | Claus Gittinger <cg@exept.de> |
Fri, 12 Feb 1999 15:58:50 +0100 | |
changeset 2449 | 5fdfb68d0bcc |
parent 2422 | 6bffcb4c8360 |
child 2768 | 57079243282f |
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 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
69 |
|
1899 | 70 |
#ifdef __VMS__ |
71 |
# include "vms_Xnames.h" |
|
72 |
#endif |
|
24 | 73 |
|
168 | 74 |
#include <stdio.h> |
75 |
||
1932 | 76 |
#ifndef OPENGL |
77 |
# ifdef MESA |
|
78 |
# define OPENGL |
|
79 |
# endif |
|
80 |
#endif |
|
81 |
||
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
82 |
#ifdef OPENGL /* SGI or others OPENGL library */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
83 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
84 |
# include "GL/gl.h" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
85 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
86 |
# ifdef MESA /* GNU MESA openGL simulation */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
87 |
# include "GL/xmesa.h" |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
88 |
# define OPENGLCONTEXT XMesaContext |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
89 |
# define GLXMAKECURRENT(dpy, draw, con) XMesaMakeCurrent(con) |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
90 |
# else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
91 |
/* 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
|
92 |
# define OPENGLCONTEXT GLXContext |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
93 |
# 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
|
94 |
# endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
95 |
|
24 | 96 |
#else |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
97 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
98 |
# ifdef GLX /* SGI's GL library */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
99 |
# include <gl/glws.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
100 |
# include <gl/sphere.h> |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
101 |
# else /* VOGL GL simulation */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
102 |
# undef memset |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
103 |
# include <vogl.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
104 |
# undef move |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
105 |
# include <X11/Xlib.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
106 |
# endif |
24 | 107 |
#endif |
0 | 108 |
|
185 | 109 |
/* |
110 |
* XSGIStereo extension - if available |
|
111 |
*/ |
|
112 |
#ifdef XSGIStereo |
|
113 |
# include <X11/extensions/SGIStereo.h> |
|
114 |
#endif |
|
115 |
||
35 | 116 |
#ifndef NULL |
58 | 117 |
# define NULL (char *)0 /* sigh */ |
35 | 118 |
#endif |
119 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
120 |
|
0 | 121 |
typedef enum { |
122 |
GLXcolorIndexSingleBuffer, |
|
123 |
GLXcolorIndexDoubleBuffer, |
|
124 |
GLXrgbSingleBuffer, |
|
125 |
GLXrgbDoubleBuffer |
|
126 |
} GLXWindowType; |
|
127 |
||
333 | 128 |
# define ENTERGLX __BEGIN_PROTECT_REGISTERS__ |
129 |
# define LEAVEGLX __END_PROTECT_REGISTERS__ |
|
134 | 130 |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
131 |
/* |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
132 |
* 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
|
133 |
*/ |
0 | 134 |
#undef String |
969 | 135 |
#ifdef __DEF_String |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
136 |
# define String __DEF_String |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
137 |
#endif |
969 | 138 |
#undef Object |
139 |
#ifdef __DEF_Object |
|
140 |
# define Object __DEF_Object |
|
141 |
#endif |
|
0 | 142 |
|
143 |
/* |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
144 |
* mhmh - openGL has its separate gl-context, |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
145 |
* which is distinct (?) from the windowID. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
146 |
* We dont want to add another instvar to View - do we ? |
0 | 147 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
148 |
#if defined(OPENGL) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
149 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
150 |
# ifndef MAX_OPENGL_VIEWS |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
151 |
# define MAX_OPENGL_VIEWS 50 |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
152 |
# endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
153 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
154 |
struct windowIDToGLContextMapping { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
155 |
Window win; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
156 |
OPENGLCONTEXT con; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
157 |
}; |
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 |
static struct windowIDToGLContextMapping windowIDToGLContextMapping[MAX_OPENGL_VIEWS]; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
160 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
161 |
static OPENGLCONTEXT |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
162 |
__glxWindowIdToGLContext(xId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
163 |
Window xId; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
164 |
{ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
165 |
int i; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
166 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
167 |
for (i=0; i<MAX_OPENGL_VIEWS; i++) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
168 |
if (windowIDToGLContextMapping[i].win == xId) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
169 |
return windowIDToGLContextMapping[i].con; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
170 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
171 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
172 |
return (OPENGLCONTEXT) 0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
173 |
} |
0 | 174 |
|
157 | 175 |
/* |
176 |
* set the GLXWindow for followup drawing |
|
177 |
*/ |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
178 |
#define SETWIN(aGLXWindowId) \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
179 |
{ \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
180 |
OPENGLCONTEXT context; \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
181 |
\ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
182 |
if (_INST(activeWindow) != aGLXWindowId) { \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
183 |
if (! ISCONNECTED ) { \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
184 |
RETURN (false); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
185 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
186 |
if (! __isExternalAddress(aGLXWindowId)) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
187 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
188 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
189 |
context = (OPENGLCONTEXT) __glxWindowIdToGLContext(_WindowVal(aGLXWindowId)); \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
190 |
if (! context) { \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
191 |
RETURN (false); \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
192 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
193 |
GLXMAKECURRENT(myDpy, _WindowVal(aGLXWindowId), context ); \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
194 |
_INST(activeWindow) = aGLXWindowId; \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
195 |
__STORE(self, aGLXWindowId); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
196 |
} else { \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
197 |
if (aGLXWindowId == nil) { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
198 |
RETURN (false); \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
199 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
200 |
} \ |
12 | 201 |
} |
202 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
203 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
204 |
#else /* old GL */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
205 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
206 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
207 |
* set the GLXWindow for followup drawing |
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 |
#define SETWIN(aGLXWindowId) \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
210 |
{ \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
211 |
if (_INST(activeWindow) != aGLXWindowId) { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
212 |
if (! ISCONNECTED ) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
213 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
214 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
215 |
if (! __isExternalAddress(aGLXWindowId)) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
216 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
217 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
218 |
if (GLXwinset(myDpy, _WindowVal(aGLXWindowId)) < 0) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
219 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
220 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
221 |
_INST(activeWindow) = aGLXWindowId; \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
222 |
__STORE(self, aGLXWindowId); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
223 |
} else { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
224 |
if (aGLXWindowId == nil) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
225 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
226 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
227 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
228 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
229 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
230 |
#endif /* old GL */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
231 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
232 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
233 |
* some defines - tired of typing ... |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
234 |
* 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
|
235 |
* put/pack them into corresponding c variables. |
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 |
#ifdef OPENGL |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
239 |
# define Boolean int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
240 |
# define TRUE 1 |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
241 |
# define FALSE 0 |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
242 |
# define Coord float |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
243 |
# define Icoord int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
244 |
# define Scoord int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
245 |
# define Colorindex int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
246 |
# define Linestyle int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
247 |
# define Offset int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
248 |
# define Angle int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
249 |
# define Screencoord int |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
250 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
251 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
252 |
#define myDpy (Display *)(__MKCP(_INST(displayId))) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
253 |
#define ISCONNECTED (_INST(displayId) != nil) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
254 |
#define _WindowVal(o) (Window)(__MKCP(o)) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
255 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
256 |
#define __MKBOOLEAN(b) ((b==FALSE) ? false : true) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
257 |
#define _booleanVal(b) ((b==false) ? (Boolean)FALSE : (Boolean)TRUE) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
258 |
#define _coordVal(c) ((__isFloat(c)) ? (Coord)(_floatVal(c)) : (Coord)(__intVal(c))) |
185 | 259 |
#define _icoordVal(c) ((Icoord)(__intVal(c))) |
260 |
#define _scoordVal(c) ((Scoord)(__intVal(c))) |
|
261 |
#define _screencoordVal(c) ((Screencoord)(__intVal(c))) |
|
262 |
#define _colorindexVal(c) ((Colorindex)(__intVal(c))) |
|
263 |
#define _linestyleVal(l) ((Linestyle)(__intVal(l))) |
|
264 |
#define _shortVal(l) ((short)(__intVal(l))) |
|
265 |
#define _longVal(l) ((long)(__intVal(l))) |
|
266 |
#define _deviceVal(l) ((Device)(__intVal(l))) |
|
267 |
#define _tagVal(l) ((Tag)(__intVal(l))) |
|
969 | 268 |
#define _objectVal(l) ((GLX_Object)(__intVal(l))) |
185 | 269 |
#define _offsetVal(l) ((Offset)(__intVal(l))) |
270 |
#define _rgbVal(l) ((RGBvalue)(__intVal(l))) |
|
271 |
#define _angleVal(c) ((Angle)(__intVal(c))) |
|
157 | 272 |
|
29 | 273 |
/* |
274 |
* 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
|
275 |
* ST-object must be true or false. Return from method if invalid. |
29 | 276 |
*/ |
277 |
#define _BOOLEAN_(arg, dst) \ |
|
30 | 278 |
if (arg==true) \ |
77 | 279 |
dst = (Boolean)TRUE; \ |
30 | 280 |
else if (arg==false) \ |
77 | 281 |
dst = (Boolean)FALSE; \ |
29 | 282 |
else { RETURN(false); } |
283 |
||
284 |
/* |
|
285 |
* check for and fetch a coord from ST-arg into C-dst |
|
157 | 286 |
* ST-object must be Float, SmallInteger or Fraction. |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
287 |
* Return from method if invalid. |
29 | 288 |
*/ |
0 | 289 |
#define _COORD_(arg, dst) \ |
97 | 290 |
if (__isFloat(arg)) \ |
77 | 291 |
dst = (Coord)(_floatVal(arg)); \ |
97 | 292 |
else if (__isSmallInteger(arg)) \ |
185 | 293 |
dst = (Coord)(__intVal(arg)); \ |
97 | 294 |
else if (__isFraction(arg) \ |
295 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_numerator) \ |
|
296 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_denominator)) { \ |
|
77 | 297 |
float n, d; \ |
298 |
\ |
|
185 | 299 |
n = (float)(__intVal(_FractionInstPtr(arg)->f_numerator)); \ |
300 |
d = (float)(__intVal(_FractionInstPtr(arg)->f_denominator)); \ |
|
77 | 301 |
dst = (Coord)(n / d); \ |
29 | 302 |
} else { RETURN(false); } |
303 |
||
304 |
/* |
|
305 |
* 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
|
306 |
* ST-object must be SmallInteger. Return from method if invalid. |
29 | 307 |
*/ |
308 |
#define _ICOORD_(arg, dst) \ |
|
97 | 309 |
if (__isSmallInteger(arg)) \ |
185 | 310 |
dst = (Icoord)(__intVal(arg)); \ |
29 | 311 |
else { RETURN(false); } |
312 |
||
313 |
/* |
|
157 | 314 |
* 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
|
315 |
* ST-object must be SmallInteger. Return from method if invalid. |
29 | 316 |
*/ |
317 |
#define _SCOORD_(arg, dst) \ |
|
97 | 318 |
if (__isSmallInteger(arg)) \ |
185 | 319 |
dst = (Scoord)(__intVal(arg)); \ |
29 | 320 |
else { RETURN(false); } |
321 |
||
322 |
#define _SCREENCOORD_(arg, dst) \ |
|
97 | 323 |
if (__isSmallInteger(arg)) \ |
185 | 324 |
dst = (Screencoord)(__intVal(arg)); \ |
29 | 325 |
else { RETURN(false); } |
326 |
||
327 |
#define _COLORINDEX_(arg, dst) \ |
|
97 | 328 |
if (__isSmallInteger(arg)) \ |
185 | 329 |
dst = (Colorindex)(__intVal(arg)); \ |
29 | 330 |
else { RETURN(false); } |
331 |
||
332 |
#define _ANGLE_(arg, dst) \ |
|
97 | 333 |
if (__isSmallInteger(arg)) \ |
185 | 334 |
dst = (Angle)(__intVal(arg)); \ |
29 | 335 |
else { RETURN(false); } |
0 | 336 |
|
337 |
#define _FLOAT_(arg, dst) \ |
|
97 | 338 |
if (__isFloat(arg)) \ |
77 | 339 |
dst = (float)(_floatVal(arg)); \ |
97 | 340 |
else if (__isSmallInteger(arg)) \ |
185 | 341 |
dst = (float)(__intVal(arg)); \ |
97 | 342 |
else if (__isFraction(arg) \ |
343 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_numerator) \ |
|
344 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_denominator)) { \ |
|
77 | 345 |
float n, d; \ |
346 |
\ |
|
185 | 347 |
n = (float)(__intVal(_FractionInstPtr(arg)->f_numerator)); \ |
348 |
d = (float)(__intVal(_FractionInstPtr(arg)->f_denominator)); \ |
|
77 | 349 |
dst = (float)(n / d); \ |
29 | 350 |
} else { RETURN(false); } |
0 | 351 |
|
352 |
#define _INT_(arg, dst) \ |
|
97 | 353 |
if (__isSmallInteger(arg)) \ |
185 | 354 |
dst = (int)(__intVal(arg)); \ |
29 | 355 |
else { RETURN(false); } |
356 |
||
30 | 357 |
#define _indexedArea(object) \ |
358 |
(((char *) (_InstPtr(object))) \ |
|
77 | 359 |
+ OHDR_SIZE \ |
185 | 360 |
+ (__intVal(_ClassInstPtr(__qClass(object))->c_ninstvars)) * sizeof(OBJ)) |
77 | 361 |
%} |
362 |
! ! |
|
363 |
||
168 | 364 |
!GLXWorkstation primitiveVariables! |
365 |
%{ |
|
366 |
/* |
|
367 |
* remembered info from private error handler |
|
368 |
*/ |
|
369 |
static char lastErrorMsg[80] = ""; |
|
370 |
static unsigned lastRequestCode = 0; |
|
371 |
static unsigned lastMinorCode = 0; |
|
372 |
static unsigned lastResource = 0; |
|
373 |
||
374 |
%} |
|
375 |
! ! |
|
376 |
||
89 | 377 |
!GLXWorkstation primitiveFunctions! |
77 | 378 |
%{ |
151 | 379 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
380 |
#ifdef DYNAMICALLY_LOADABLE |
168 | 381 |
/* |
382 |
* catch X-errors and forward as errorInterrupt:#DisplayError, |
|
383 |
* (which itself invokes my handler and optionally raises an exceptionSignal) |
|
384 |
* the implementation below is somewhat wrong: it will |
|
385 |
* report all errors for Display, even though there could be |
|
386 |
* more than one display connection. (being fixed, new errorInterrupt mechanism |
|
387 |
* allows passing an additional argument, which is the displayID ...) |
|
388 |
* |
|
389 |
* this dublicates the functionality as found in XWorkstation; |
|
390 |
* the reason is to allow dynamic loading systems to load this module |
|
391 |
* before XWorkstation (which was not possible otherwise, due to unresolved |
|
392 |
* external references while loading this one) |
|
393 |
*/ |
|
394 |
static |
|
395 |
__XErrorHandler__(dpy, event) |
|
396 |
Display *dpy; |
|
397 |
XErrorEvent *event; |
|
398 |
{ |
|
399 |
XGetErrorText(dpy, event->error_code, lastErrorMsg, 80); |
|
400 |
if (lastErrorMsg[0] == '\0') { |
|
185 | 401 |
sprintf(lastErrorMsg, "code: %d", event->error_code); |
168 | 402 |
} |
403 |
lastRequestCode = event->request_code; |
|
404 |
lastMinorCode = event->minor_code; |
|
405 |
lastResource = event->resourceid; |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
406 |
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
|
407 |
/* |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
408 |
* 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
|
409 |
* 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
|
410 |
* in non bottom-up window order. |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
411 |
*/ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
412 |
return 0; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
413 |
} |
168 | 414 |
|
218
10072d9beba5
can now turn off Xlib error messages from the errorHandler
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
415 |
if (@global(ErrorPrinting) == true) { |
1932 | 416 |
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
|
417 |
event->request_code, event->request_code, |
9ff0660f447f
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
218
diff
changeset
|
418 |
event->minor_code, event->minor_code, event->resourceid); |
1932 | 419 |
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
|
420 |
} |
168 | 421 |
|
207
9124817bbb03
use new c-pointer wrapper macros (based on externalAddress)
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
422 |
__errorInterruptWithIDAndParameter__(@symbol(DisplayError), __MKOBJ(dpy)); |
168 | 423 |
return 0; |
424 |
} |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
425 |
#else |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
426 |
extern __XErrorHandler__(); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
427 |
#endif |
168 | 428 |
|
151 | 429 |
/* |
430 |
* begin moved from GLXsupport.c |
|
431 |
*/ |
|
432 |
||
433 |
/* |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
434 |
* This provides a helper function "GLXCreateWindow", which does |
151 | 435 |
* 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
|
436 |
* to take place within. See the definition of GLXCreateWindow for a |
151 | 437 |
* description of how to call it. |
438 |
* |
|
439 |
* claus: I really had no time to look into all this, |
|
440 |
* this file has been just copied from a 4Dgifts demo .. |
|
441 |
* (will need more than a day to show more ...) |
|
442 |
*/ |
|
1932 | 443 |
#if !defined(OPENGL) |
151 | 444 |
|
1899 | 445 |
# include <X11/Xlib.h> |
446 |
# include <X11/Xutil.h> |
|
447 |
# ifndef VGL |
|
448 |
# include <gl/glws.h> |
|
449 |
# endif |
|
450 |
# include <signal.h> |
|
451 |
# include <setjmp.h> |
|
452 |
# include "stcIntern.h" |
|
151 | 453 |
|
454 |
/* |
|
455 |
* glxhelper.h: |
|
456 |
* |
|
457 |
* List of drawing modes supported by GLXCreateWindow (in glxhelper.c). |
|
458 |
* More than this are possible with mixed model, but this is just an |
|
459 |
* example. You can either expand this list (and the corresponding code in |
|
460 |
* GLXCreateWindow) or call the mixed model calls yourself, using |
|
461 |
* GLXCreateWindow as an example. |
|
462 |
*/ |
|
463 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
464 |
static char * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
465 |
typeToName[] = { |
151 | 466 |
"color index single buffer", |
467 |
"color index double buffer", |
|
468 |
"rgb single buffer", |
|
469 |
"rgb double buffer", |
|
470 |
}; |
|
471 |
||
1932 | 472 |
#endif /* GLX || VGL */ |
473 |
||
474 |
#if defined(GLX) && !defined(VGL) |
|
151 | 475 |
/* |
476 |
* Dorky little helper function used to build up a GLXconfig array. |
|
477 |
*/ |
|
478 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
479 |
static void |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
480 |
set_entry (GLXconfig* ptr, int b, int m, int a) |
151 | 481 |
{ |
482 |
ptr->buffer = b; |
|
483 |
ptr->mode = m; |
|
484 |
ptr->arg = a; |
|
485 |
} |
|
1932 | 486 |
#endif /* GLX & not VGL */ |
151 | 487 |
|
488 |
static JMP_BUF errorReturn; |
|
489 |
||
490 |
static void |
|
491 |
glAbort() { |
|
492 |
longjmp(errorReturn, 1); |
|
493 |
} |
|
494 |
||
495 |
/* |
|
496 |
* GLXCreateWindow(dpy, parent, x, y, w, h, boderWidth, type) |
|
497 |
* |
|
498 |
* Return value is the X window id of the newly created window. |
|
499 |
* |
|
500 |
* Arguments are: |
|
501 |
* dpy The X "Display*" returned by XOpenDisplay |
|
502 |
* parent The parent of the newly created window, |
|
503 |
* a typical value for this is |
|
504 |
* RootWindow(dpy, DefaultScreen(dpy)) |
|
505 |
* x,y The location of the window to be created, |
|
506 |
* y coordinate is measured from the top down. |
|
507 |
* w,h size of the new window |
|
508 |
* borderWidth the X border size for this window, should probably |
|
509 |
* be zero. |
|
510 |
* type the GLXWindowType (see glxhelper.h) desribing the |
|
511 |
* typer of GL drawing to be done in this window |
|
512 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
513 |
Window |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
514 |
__GLXCreateWindow(dpy, parent, x, y, w, h, borderWidth, type) |
151 | 515 |
Display* dpy; |
516 |
Window parent; |
|
517 |
GLXWindowType type; |
|
518 |
{ |
|
1932 | 519 |
#if !defined(OPENGL) |
520 |
# ifndef VGL |
|
151 | 521 |
GLXconfig params[50]; |
522 |
GLXconfig* next; |
|
523 |
GLXconfig* retconfig; |
|
524 |
Colormap cmap = DefaultColormap(dpy, DefaultScreen(dpy)); |
|
1932 | 525 |
# endif |
526 |
#endif |
|
527 |
Visual visual; |
|
151 | 528 |
XVisualInfo *vis; |
529 |
XVisualInfo template; |
|
530 |
XColor white; |
|
531 |
XSetWindowAttributes cwa; |
|
532 |
XWindowAttributes pwa; |
|
533 |
int scr, i, nret; |
|
534 |
Window win; |
|
1932 | 535 |
#ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
536 |
struct sigaction oldSig, newSig; |
1932 | 537 |
#else |
151 | 538 |
void *oldSig; |
1932 | 539 |
#endif |
540 |
||
541 |
#if !defined(OPENGL) |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
542 |
__catchExit(1); |
1932 | 543 |
#endif |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
544 |
|
151 | 545 |
if (setjmp(errorReturn)) { |
546 |
printf("hard error in GL - return\n"); |
|
1932 | 547 |
#ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
548 |
sigaction(SIGSEGV, &oldSig, 0); |
1932 | 549 |
#else |
151 | 550 |
signal(SIGSEGV, oldSig); |
1932 | 551 |
#endif |
552 |
#if !defined(OPENGL) |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
553 |
__catchExit(0); |
1932 | 554 |
#endif |
151 | 555 |
return 0; |
556 |
} |
|
557 |
__CONT__ |
|
558 |
||
1932 | 559 |
if (w <= 0) { |
560 |
printf("GL: bad width: %d\n", w); |
|
561 |
w = 1; |
|
562 |
} |
|
563 |
if (h <= 0) { |
|
564 |
printf("GL: bad height: %d\n", h); |
|
565 |
h = 1; |
|
566 |
} |
|
567 |
||
568 |
#if !defined(OPENGL) |
|
1899 | 569 |
# ifdef VGL |
151 | 570 |
/* |
571 |
* I know what VGL supports; its somewhat unclean to hard code it here |
|
572 |
*/ |
|
573 |
switch (type) { |
|
574 |
case GLXcolorIndexSingleBuffer: |
|
575 |
case GLXcolorIndexDoubleBuffer: |
|
576 |
break; |
|
577 |
||
578 |
case GLXrgbSingleBuffer: |
|
579 |
case GLXrgbDoubleBuffer: |
|
580 |
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
|
581 |
__catchExit(0); |
151 | 582 |
return 0; |
583 |
} |
|
584 |
||
585 |
scr = DefaultScreen(dpy); |
|
586 |
visual.visualid = CopyFromParent; |
|
587 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
588 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
589 |
borderWidth, DisplayPlanes(dpy, scr), |
|
590 |
InputOutput, &visual, |
|
591 |
CWBorderPixel, &cwa); |
|
592 |
||
593 |
/* |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
594 |
* on some, seg-violations occur in the GL, if too many |
151 | 595 |
* views are created ... just to make certain, we catch those |
596 |
* in GL too. |
|
597 |
*/ |
|
1899 | 598 |
# ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
599 |
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
|
600 |
newSig = oldSig; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
601 |
newSig.sa_handler = glAbort; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
602 |
sigaction(SIGSEGV, &newSig, (struct sigaction *)0); |
1899 | 603 |
# else |
151 | 604 |
oldSig = signal(SIGSEGV, glAbort); |
1899 | 605 |
# endif |
151 | 606 |
i = GLXlink(dpy, win); |
1899 | 607 |
# ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
608 |
sigaction(SIGSEGV, &oldSig, (struct sigaction *)0); |
1899 | 609 |
# else |
151 | 610 |
signal(SIGSEGV, oldSig); |
1899 | 611 |
# endif |
151 | 612 |
|
613 |
if (i < 0) { |
|
614 |
printf("GLXlink returned %d\n", i); |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
615 |
__catchExit(0); |
151 | 616 |
return 0; |
617 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
618 |
|
1899 | 619 |
# else /* not VGL */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
620 |
|
151 | 621 |
/* |
622 |
* This builds an array in "params" that describes for GLXgetconfig(3G) |
|
623 |
* the type of GL drawing that will be done. |
|
624 |
*/ |
|
625 |
next = params; |
|
626 |
switch (type) { |
|
627 |
case GLXcolorIndexSingleBuffer: |
|
628 |
set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE); |
|
629 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE); |
|
630 |
break; |
|
631 |
case GLXcolorIndexDoubleBuffer: |
|
632 |
set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE); |
|
633 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE); |
|
634 |
break; |
|
635 |
case GLXrgbSingleBuffer: |
|
636 |
set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE); |
|
637 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE); |
|
638 |
break; |
|
639 |
case GLXrgbDoubleBuffer: |
|
640 |
set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE); |
|
641 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE); |
|
642 |
break; |
|
643 |
} |
|
644 |
set_entry(next, 0, 0, 0); /* The input to GLXgetconfig is null terminated */ |
|
645 |
||
646 |
/* |
|
647 |
* Get configuration data for a window based on above parameters |
|
648 |
* First we have to find out which screen the parent window is on, |
|
649 |
* then we can call GXLgetconfig() |
|
650 |
*/ |
|
651 |
XGetWindowAttributes(dpy, parent, &pwa); |
|
652 |
retconfig = GLXgetconfig(dpy, XScreenNumberOfScreen(pwa.screen), params); |
|
653 |
if (retconfig == 0) { |
|
654 |
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
|
655 |
__catchExit(0); |
151 | 656 |
return 0; |
657 |
} |
|
658 |
||
659 |
/* |
|
660 |
* Scan through config info, pulling info needed to create a window |
|
661 |
* that supports the rendering mode. |
|
662 |
*/ |
|
663 |
for (next = retconfig; next->buffer; next++) { |
|
664 |
unsigned long buffer = next->buffer; |
|
665 |
unsigned long mode = next->mode; |
|
666 |
unsigned long value = next->arg; |
|
667 |
switch (mode) { |
|
668 |
case GLX_COLORMAP: |
|
669 |
if (buffer == GLX_NORMAL) { |
|
670 |
cmap = value; |
|
671 |
} |
|
672 |
break; |
|
673 |
case GLX_VISUAL: |
|
674 |
if (buffer == GLX_NORMAL) { |
|
675 |
template.visualid = value; |
|
676 |
template.screen = DefaultScreen(dpy); |
|
677 |
vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask, |
|
678 |
&template, &nret); |
|
679 |
} |
|
680 |
break; |
|
681 |
} |
|
682 |
} |
|
683 |
||
684 |
/* |
|
685 |
* Create the window |
|
686 |
*/ |
|
687 |
cwa.colormap = cmap; |
|
688 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
689 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
690 |
borderWidth, vis->depth, InputOutput, vis->visual, |
|
691 |
CWColormap|CWBorderPixel, &cwa); |
|
692 |
||
693 |
/* |
|
694 |
* Rescan configuration info and find window slot that getconfig |
|
695 |
* provided. Fill it in with the window we just created. |
|
696 |
*/ |
|
697 |
for (next = retconfig; next->buffer; next++) { |
|
698 |
if ((next->buffer == GLX_NORMAL) && (next->mode == GLX_WINDOW)) { |
|
699 |
next->arg = win; |
|
700 |
break; |
|
701 |
} |
|
702 |
} |
|
703 |
||
704 |
/* |
|
705 |
* Now "retconfig" contains all the information the GL needs to |
|
706 |
* configure the window and its own internal state. |
|
707 |
*/ |
|
708 |
/* |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
709 |
* on iris, seg-violations occur in the GL, if too many |
151 | 710 |
* views are created ... |
711 |
*/ |
|
1899 | 712 |
# ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
713 |
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
|
714 |
newSig = oldSig; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
715 |
newSig.sa_handler = glAbort; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
716 |
sigaction(SIGSEGV, &newSig, (struct sigaction *)0); |
1899 | 717 |
# else |
151 | 718 |
oldSig = signal(SIGSEGV, glAbort); |
1899 | 719 |
# endif |
151 | 720 |
i = GLXlink(dpy, retconfig); |
1899 | 721 |
# ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
722 |
sigaction(SIGSEGV, &oldSig, (struct sigaction *)0); |
1899 | 723 |
# else |
151 | 724 |
signal(SIGSEGV, oldSig); |
1899 | 725 |
# endif |
151 | 726 |
|
727 |
if (i < 0) { |
|
728 |
printf("GLXlink returned %d\n", i); |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
729 |
__catchExit(0); |
151 | 730 |
return 0; |
731 |
} |
|
732 |
||
733 |
/* |
|
734 |
* The GL sets its own X error handlers, which exits - this is not what we want |
|
735 |
*/ |
|
736 |
XSetErrorHandler(__XErrorHandler__); |
|
1899 | 737 |
# endif /* not VGL */ |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
738 |
__catchExit(0); |
1932 | 739 |
|
740 |
#else /* OPENGL | MESA */ |
|
741 |
||
742 |
scr = DefaultScreen(dpy); |
|
743 |
visual.visualid = CopyFromParent; |
|
744 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
745 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
746 |
borderWidth, DisplayPlanes(dpy, scr), |
|
747 |
InputOutput, &visual, |
|
748 |
CWBorderPixel, &cwa); |
|
749 |
||
750 |
vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask, &visual, &nret); |
|
751 |
printf("vis is %x\n", vis); |
|
752 |
#endif /* GLX || VGL */ |
|
753 |
||
151 | 754 |
return win; |
755 |
} |
|
756 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
757 |
__GLXUnlinkWindow(dpy, win) |
151 | 758 |
Display* dpy; |
759 |
Window win; |
|
760 |
{ |
|
761 |
/* |
|
762 |
* only needed for VGL - GLX does it automatically |
|
763 |
*/ |
|
1932 | 764 |
#ifdef VGL |
151 | 765 |
GLXunlink(dpy, win); |
1932 | 766 |
#endif |
151 | 767 |
} |
768 |
||
29 | 769 |
/* |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
770 |
* helper for rotation - calls rot() |
29 | 771 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
772 |
OBJ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
773 |
__glx_doRotate(angle, axis) |
29 | 774 |
OBJ angle; |
775 |
char axis; |
|
776 |
{ |
|
777 |
float f_angle; |
|
778 |
||
35 | 779 |
if (__isFloat(angle)) { |
77 | 780 |
f_angle = (float)(_floatVal(angle)); |
1932 | 781 |
if (f_angle != 0.0) { |
782 |
#ifdef OPENGL |
|
783 |
#else |
|
77 | 784 |
rot(f_angle, axis); |
1932 | 785 |
#endif |
786 |
} |
|
77 | 787 |
return (true); |
29 | 788 |
} |
35 | 789 |
if (__isFraction(angle) |
97 | 790 |
&& __isSmallInteger(_FractionInstPtr(angle)->f_numerator) |
791 |
&& __isSmallInteger(_FractionInstPtr(angle)->f_denominator)) { |
|
77 | 792 |
float n, d; |
793 |
||
185 | 794 |
n = (float)(__intVal(_FractionInstPtr(angle)->f_numerator)); |
795 |
d = (float)(__intVal(_FractionInstPtr(angle)->f_denominator)); |
|
77 | 796 |
f_angle = n / d; |
1932 | 797 |
if (f_angle != 0.0) { |
798 |
#ifdef OPENGL |
|
799 |
#else |
|
77 | 800 |
rot(f_angle, axis); |
1932 | 801 |
#endif |
802 |
} |
|
77 | 803 |
return (true); |
29 | 804 |
} |
97 | 805 |
if (__isSmallInteger(angle)) { |
185 | 806 |
f_angle = (float)(__intVal(angle)); |
1932 | 807 |
if (f_angle != 0.0) { |
808 |
#ifdef OPENGL |
|
809 |
#else |
|
77 | 810 |
rot(f_angle, axis); |
1932 | 811 |
#endif |
812 |
} |
|
77 | 813 |
return (true); |
29 | 814 |
} |
815 |
return false; |
|
816 |
} |
|
0 | 817 |
|
24 | 818 |
/* |
29 | 819 |
* fetch integers from an st-array (elements must be smallIntegers) |
820 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
821 |
long * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
822 |
__glx_getLongsFromInto(obj, vec, count) |
29 | 823 |
OBJ obj; |
824 |
long *vec; |
|
825 |
{ |
|
826 |
OBJ cls, o; |
|
827 |
int nByte, i, ninstVars, nInstBytes; |
|
828 |
char *pElem; |
|
829 |
||
830 |
if (! _isNonNilObject(obj)) return (long *)NULL; |
|
134 | 831 |
cls = __qClass(obj); |
185 | 832 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 833 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 834 |
nByte = __qSize(obj) - nInstBytes; |
29 | 835 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
836 |
if (nByte < (count * sizeof(OBJ))) return (long *)NULL; |
|
837 |
for (i=0; i<count; i++) { |
|
77 | 838 |
o = *(OBJ *)pElem; |
97 | 839 |
if (! __isSmallInteger(o)) return (long *)NULL; |
185 | 840 |
vec[i] = (long)__intVal(o); |
77 | 841 |
pElem += sizeof(OBJ); |
29 | 842 |
} |
843 |
return vec; |
|
844 |
} |
|
845 |
||
846 |
/* |
|
847 |
* fetch shorts from an st-array (elements must be smallIntegers) |
|
848 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
849 |
short * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
850 |
__glx_getShortsFromInto(obj, vec, count) |
29 | 851 |
OBJ obj; |
852 |
short *vec; |
|
853 |
{ |
|
854 |
OBJ cls, o; |
|
855 |
int nByte, i, ninstVars, nInstBytes; |
|
856 |
char *pElem; |
|
857 |
||
858 |
if (! _isNonNilObject(obj)) return (short *)NULL; |
|
134 | 859 |
cls = __qClass(obj); |
185 | 860 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 861 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 862 |
nByte = __qSize(obj) - nInstBytes; |
29 | 863 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
864 |
if (nByte < (count * sizeof(OBJ))) return (short *)NULL; |
|
865 |
for (i=0; i<count; i++) { |
|
77 | 866 |
o = *(OBJ *)pElem; |
97 | 867 |
if (! __isSmallInteger(o)) return (short *)NULL; |
185 | 868 |
vec[i] = (short)__intVal(o); |
77 | 869 |
pElem += sizeof(OBJ); |
29 | 870 |
} |
871 |
return vec; |
|
872 |
} |
|
873 |
||
874 |
/* |
|
875 |
* fetch floats from an st-object into a c-float array |
|
876 |
* which may be a floatArray, doubleArray or array-of-something, |
|
877 |
* where something may be a float, fraction or smallInteger, |
|
24 | 878 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
879 |
float * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
880 |
__glx_getFloatsFromInto(obj, vec, count) |
12 | 881 |
OBJ obj; |
882 |
float *vec; |
|
883 |
{ |
|
884 |
OBJ cls; |
|
885 |
int nByte; |
|
886 |
OBJ o; |
|
887 |
int i, ninstVars, nInstBytes; |
|
888 |
char *pElem; |
|
889 |
||
890 |
if (! _isNonNilObject(obj)) return (float *)0; |
|
891 |
||
134 | 892 |
cls = __qClass(obj); |
185 | 893 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
12 | 894 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 895 |
nByte = __qSize(obj) - nInstBytes; |
12 | 896 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
897 |
||
185 | 898 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
12 | 899 |
case FLOATARRAY: |
77 | 900 |
/* |
901 |
* best speed for float array |
|
902 |
* - the data is already as we want it |
|
903 |
*/ |
|
904 |
if (nByte < (count * sizeof(float))) return (float *)0; |
|
905 |
return (float *)pElem; |
|
12 | 906 |
|
907 |
case DOUBLEARRAY: |
|
77 | 908 |
/* |
909 |
* for double array, have to copy-and-cast |
|
910 |
*/ |
|
911 |
if (nByte < (count * sizeof(double))) return (float *)0; |
|
912 |
for (i=0; i<count; i++) { |
|
913 |
vec[i] = *((double *)pElem); |
|
914 |
pElem += sizeof(double); |
|
915 |
} |
|
916 |
return vec; |
|
12 | 917 |
|
918 |
case POINTERARRAY: |
|
77 | 919 |
/* |
920 |
* for other array, have to fetch, check and store |
|
921 |
* the elements can be floats, smallintegers or fractions |
|
922 |
*/ |
|
923 |
if (nByte < (count * sizeof(OBJ))) return (float *)0; |
|
924 |
/* get elements one-by-one */ |
|
925 |
for (i=0; i<count; i++) { |
|
926 |
o = *(OBJ *)pElem; |
|
927 |
if (__isFloat(o)) { |
|
928 |
vec[i] = _floatVal(o); |
|
97 | 929 |
} else if (__isSmallInteger(o)) { |
185 | 930 |
vec[i] = (float)(__intVal(o)); |
77 | 931 |
} else if (__isFraction(o) |
97 | 932 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
933 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
77 | 934 |
float n, d; |
935 |
||
185 | 936 |
n = (float)(__intVal(_FractionInstPtr(o)->f_numerator)); |
937 |
d = (float)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
77 | 938 |
vec[i] = n / d; |
939 |
} else |
|
940 |
return 0; |
|
941 |
pElem += sizeof(OBJ); |
|
942 |
} |
|
943 |
return vec; |
|
12 | 944 |
} |
945 |
return (float *)0; |
|
946 |
} |
|
947 |
||
29 | 948 |
/* |
949 |
* fetch doubles from an st-object into a c-double array |
|
950 |
* which may be a floatArray, doubleArray or array-of-something, |
|
951 |
* where something may be a float, fraction or smallInteger, |
|
952 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
953 |
double * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
954 |
__glx_getDoublesFromInto(obj, vec, count) |
29 | 955 |
OBJ obj; |
956 |
double *vec; |
|
957 |
{ |
|
958 |
OBJ cls, o; |
|
959 |
int nByte, i, ninstVars, nInstBytes; |
|
960 |
char *pElem; |
|
961 |
||
962 |
if (! _isNonNilObject(obj)) return (double *)0; |
|
134 | 963 |
cls = __qClass(obj); |
185 | 964 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 965 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 966 |
nByte = __qSize(obj) - nInstBytes; |
29 | 967 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
968 |
||
185 | 969 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
29 | 970 |
case DOUBLEARRAY: |
77 | 971 |
/* best speed for double array - the data is already as we want it */ |
972 |
if (nByte < (count * sizeof(double))) return (double *)0; |
|
973 |
return (double *)pElem; |
|
29 | 974 |
|
975 |
case FLOATARRAY: |
|
77 | 976 |
if (nByte < (count * sizeof(float))) return (double *)0; |
977 |
for (i=0; i<count; i++) { |
|
978 |
vec[i] = *((float *)pElem); |
|
979 |
pElem += sizeof(float); |
|
980 |
} |
|
981 |
return vec; |
|
29 | 982 |
|
983 |
case POINTERARRAY: |
|
77 | 984 |
if (nByte < (count * sizeof(OBJ))) return (double *)0; |
985 |
/* get elements one-by-one */ |
|
986 |
for (i=0; i<count; i++) { |
|
987 |
o = *(OBJ *)pElem; |
|
988 |
if (__isFloat(o)) |
|
989 |
vec[i] = _floatVal(o); |
|
97 | 990 |
else if (__isSmallInteger(o)) |
185 | 991 |
vec[i] = (double)(__intVal(o)); |
77 | 992 |
else if (__isFraction(o) |
97 | 993 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
994 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
77 | 995 |
double n, d; |
996 |
||
185 | 997 |
n = (double)(__intVal(_FractionInstPtr(o)->f_numerator)); |
998 |
d = (double)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
77 | 999 |
vec[i] = n / d; |
1000 |
||
1001 |
} else |
|
1002 |
return 0; |
|
1003 |
pElem += sizeof(OBJ); |
|
1004 |
} |
|
1005 |
return vec; |
|
29 | 1006 |
} |
1007 |
return (double *)0; |
|
1008 |
} |
|
1009 |
||
1010 |
/* |
|
1011 |
* move from a c-float array into an st-object, |
|
1012 |
* the st-object MUST be either a float- or double array |
|
1013 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1014 |
__glx_putFloatsFromInto(vec, obj, count) |
12 | 1015 |
OBJ obj; |
1016 |
float *vec; |
|
1017 |
{ |
|
1018 |
OBJ cls; |
|
1019 |
int nByte; |
|
1020 |
OBJ o; |
|
1021 |
int i, ninstVars, nInstBytes; |
|
1022 |
char *pElem; |
|
1023 |
||
1024 |
if (! _isNonNilObject(obj)) return 0; |
|
1025 |
||
134 | 1026 |
cls = __qClass(obj); |
185 | 1027 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
12 | 1028 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1029 |
nByte = __qSize(obj) - nInstBytes; |
12 | 1030 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1031 |
||
185 | 1032 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
12 | 1033 |
case FLOATARRAY: |
77 | 1034 |
if (nByte < (count * sizeof(float))) return 0; |
1035 |
for (i=0; i<count; i++) { |
|
1036 |
*(float *)pElem = vec[i]; |
|
1037 |
pElem += sizeof(float); |
|
1038 |
} |
|
1039 |
return 1; |
|
12 | 1040 |
|
1041 |
case DOUBLEARRAY: |
|
77 | 1042 |
if (nByte < (count * sizeof(float))) return 0; |
1043 |
for (i=0; i<count; i++) { |
|
1044 |
*(double *)pElem = vec[i]; |
|
1045 |
pElem += sizeof(double); |
|
1046 |
} |
|
1047 |
return 1; |
|
12 | 1048 |
} |
1049 |
/* not implemented for others */ |
|
1050 |
||
1051 |
return 0; |
|
1052 |
} |
|
1053 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1054 |
#ifndef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1055 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1056 |
Matrix * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1057 |
__glx_getFloatsFromMatrixInto(obj, mp) |
12 | 1058 |
OBJ obj; |
1059 |
Matrix *mp; |
|
1060 |
{ |
|
1061 |
OBJ cls; |
|
1062 |
int nByte; |
|
1063 |
OBJ o; |
|
29 | 1064 |
int ninstVars, nInstBytes; |
1065 |
char *pElem; |
|
1066 |
int x = 0; |
|
1067 |
int i,j; |
|
12 | 1068 |
|
1069 |
if (! _isNonNilObject(obj)) return (Matrix *)0; |
|
1070 |
||
134 | 1071 |
cls = __qClass(obj); |
185 | 1072 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 1073 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1074 |
nByte = __qSize(obj) - nInstBytes; |
29 | 1075 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1076 |
||
185 | 1077 |
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
|
1078 |
case FLOATARRAY: |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1079 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1080 |
* very easy for FLOATARRAY objects - no copying needed |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1081 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1082 |
if (nByte < (16 * sizeof(float))) return (Matrix *)0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1083 |
return (Matrix *) _FloatArrayInstPtr(obj)->f_element; |
12 | 1084 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1085 |
case DOUBLEARRAY: |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1086 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1087 |
* for DOUBLEARRAY objects copy and cast |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1088 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1089 |
if (nByte < (16 * sizeof(double))) return (Matrix *)0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1090 |
for (i=0; i<4; i++) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1091 |
for (j=0; j<4; j++) { |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1092 |
(*mp)[i][j] = _DoubleArrayInstPtr(obj)->d_element[x]; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1093 |
x++; |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1094 |
} |
77 | 1095 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1096 |
return mp; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1097 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1098 |
case POINTERARRAY: |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1099 |
if (nByte < (16 * sizeof(OBJ))) return (Matrix *)0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1100 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1101 |
* get elements one-by-one |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1102 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1103 |
for (i=0; i<4; i++) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1104 |
for (j=0; j<4; j++) { |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1105 |
o = _ArrayInstPtr(obj)->a_element[x]; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1106 |
if (__isFloat(o)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1107 |
(*mp)[i][j] = _floatVal(o); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1108 |
} else if (__isSmallInteger(o)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1109 |
(*mp)[i][j] = (double)__intVal(o); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1110 |
} else if (__isFraction(o) |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1111 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1112 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1113 |
double n, d; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1114 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1115 |
n = (double)(__intVal(_FractionInstPtr(o)->f_numerator)); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1116 |
d = (double)(__intVal(_FractionInstPtr(o)->f_denominator)); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1117 |
(*mp)[i][j] = n / d; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1118 |
} else |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1119 |
return (Matrix *)0; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1120 |
x++; |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1121 |
} |
77 | 1122 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1123 |
return mp; |
12 | 1124 |
} |
1125 |
return (Matrix *)0; |
|
1126 |
} |
|
1127 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1128 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1129 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1130 |
float* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1131 |
__glx_getFloatsFromFloatArrayInto(obj, fp) |
46 | 1132 |
OBJ obj; |
1133 |
float *fp; |
|
1134 |
{ |
|
1135 |
OBJ cls; |
|
1136 |
int ninstVars; |
|
1137 |
||
1138 |
if (! _isNonNilObject(obj)) return (float *)0; |
|
134 | 1139 |
cls = __qClass(obj); |
350 | 1140 |
if (cls == @global(FloatArray)) |
77 | 1141 |
return _FloatArrayInstPtr(obj)->f_element; |
46 | 1142 |
|
185 | 1143 |
if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) { |
1144 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
77 | 1145 |
return (float *) &(_InstPtr(obj)->i_instvars[ninstVars]); |
46 | 1146 |
} |
1147 |
||
1148 |
/* |
|
1149 |
* need more here (i.e. convert from array-of-floats) |
|
1150 |
*/ |
|
1151 |
return (float *)0; |
|
1152 |
} |
|
1153 |
||
1154 |
%} |
|
1155 |
! ! |
|
0 | 1156 |
|
294 | 1157 |
!GLXWorkstation class methodsFor:'documentation'! |
1158 |
||
1159 |
copyright |
|
1160 |
" |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1161 |
COPYRIGHT (c) 1993 by Claus Gittinger |
294 | 1162 |
All Rights Reserved |
1163 |
||
1164 |
This software is furnished under a license and may be used |
|
1165 |
only in accordance with the terms of that license and with the |
|
1166 |
inclusion of the above copyright notice. This software may not |
|
1167 |
be provided or otherwise made available to, or used by, any |
|
1168 |
other person. No title to or ownership of the software is |
|
1169 |
hereby transferred. |
|
1170 |
" |
|
1171 |
! |
|
1172 |
||
1173 |
documentation |
|
1174 |
" |
|
1175 |
this class was originally written as a demo on how an interface to |
|
1176 |
a c graphics library could be implemented. In the mean time, it has become |
|
1177 |
quite complete ... |
|
1178 |
||
1179 |
It provides an interface to either a real GL (on SGI workstations) |
|
1180 |
or a simulated VGL (i.e. GL-light; low nicotine). |
|
1181 |
The GL simulation is derived from the PD vogl library, with slight |
|
1182 |
modifictions to support multiple GL views. |
|
1183 |
||
1184 |
Most of the hard work was done by Jeff (thanks indeed) ... |
|
1185 |
||
1186 |
||
1187 |
Some notes: |
|
1188 |
||
1189 |
I do not really know what most of these functions do - for more |
|
1190 |
detail, see the GL man pages (on SGI) or the doc provided with VGL. |
|
1191 |
||
1192 |
The interface offered here provides a very very low level (i.e one-to-one) |
|
1193 |
interface to GL functions. More high-level stuff is required, to make |
|
1194 |
3D drawing be more object-oriented. |
|
1195 |
(see a bit of this in 'clients/IRIS-specials') |
|
1196 |
||
1197 |
Some functions are duplicated, Jeff and I developed those in parallel - |
|
1198 |
for now, both will remain - finally they will be merged and duplicates removed ... |
|
1199 |
(examples are makeobj and makeObject). |
|
1200 |
||
1201 |
Also, in a hurry to implement all those methods, many do no or only |
|
1202 |
limited argument checking - make certain, that you pass the correct |
|
1203 |
arguments. |
|
1204 |
||
1205 |
There might be some confusion in the v3[sifd] functions: basically they |
|
1206 |
all do the same, and could be mapped onto one st-method (such as vertex3). |
|
1207 |
However, the C-functions expect different argument types - I dont know if |
|
1208 |
one or another of these functions suffers from any performance penalties. |
|
1209 |
Therefore, I leave the direct 1-to-1 mapping; GL experts might know more |
|
1210 |
about this (I use v3f in all of my code). |
|
1211 |
||
1212 |
written june 93 by claus |
|
1213 |
VGL stuff dec 93 |
|
1214 |
many many additions jan 94 by Jeff McAffer <jeff@is.s.u-tokyo.ac.jp> |
|
1215 |
||
1216 |
Since this is a demo (consider it a free add-on goody) there is |
|
1217 |
*** NO WARRANTY ** for this. |
|
1218 |
||
1219 |
Notice: this should be rewritten to use the openGL library functions |
|
1220 |
(actually, to not loose the VGL interface, another OpenGLWorkstation |
|
1221 |
class should be written) |
|
614 | 1222 |
|
1223 |
[author:] |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1224 |
Claus Gittinger |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1225 |
Jeff McAffer |
294 | 1226 |
" |
1227 |
! ! |
|
1228 |
||
168 | 1229 |
!GLXWorkstation class methodsFor:'error handling'! |
1230 |
||
294 | 1231 |
errorStringOfLastError |
1232 |
%{ |
|
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1233 |
RETURN ( __MKSTRING(lastErrorMsg) ); |
168 | 1234 |
%} |
1235 |
! |
|
1236 |
||
528 | 1237 |
forceGL:aBoolean |
1238 |
ForceGL := aBoolean. |
|
1239 |
AllScreens notNil ifTrue:[ |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1240 |
AllScreens do:[:screen | screen initializeScreenProperties] |
528 | 1241 |
]. |
1242 |
! |
|
1243 |
||
168 | 1244 |
minorCodeOfLastError |
1245 |
%{ /* NOCONTEXT */ |
|
1246 |
||
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
1247 |
RETURN ( __MKSMALLINT(lastMinorCode) ); |
168 | 1248 |
%} |
1249 |
! |
|
1250 |
||
294 | 1251 |
requestCodeOfLastError |
1252 |
%{ /* NOCONTEXT */ |
|
1253 |
||
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
1254 |
RETURN ( __MKSMALLINT(lastRequestCode) ); |
294 | 1255 |
%} |
1256 |
! |
|
1257 |
||
168 | 1258 |
resourceIdOfLastError |
1259 |
%{ /* NOCONTEXT */ |
|
1260 |
||
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
1261 |
RETURN ( __MKSMALLINT(lastResource) ); |
168 | 1262 |
%} |
294 | 1263 |
! ! |
1264 |
||
1265 |
!GLXWorkstation methodsFor:'arcs and circles'! |
|
1266 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1267 |
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
|
1268 |
"draw an arc at a given location. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1269 |
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
|
1270 |
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
|
1271 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1272 |
%{ /* NOCONTEXT */ |
294 | 1273 |
Coord c_x, c_y, c_radius; |
1274 |
Angle a_startang, a_endang; |
|
1275 |
||
1276 |
_COORD_(x, c_x) |
|
1277 |
_COORD_(y, c_y) |
|
1278 |
_COORD_(radius, c_radius) |
|
1279 |
_ANGLE_(startang, a_startang) |
|
1280 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1281 |
|
294 | 1282 |
SETWIN(aGLXWindowId) |
1932 | 1283 |
#ifdef OPENGL |
1284 |
#else |
|
294 | 1285 |
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
|
1286 |
#endif |
294 | 1287 |
%} |
528 | 1288 |
|
1289 |
"Modified: 19.3.1996 / 18:43:52 / cg" |
|
294 | 1290 |
! |
1291 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1292 |
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
|
1293 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1294 |
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
|
1295 |
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
|
1296 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1297 |
%{ /* NOCONTEXT */ |
294 | 1298 |
Coord c_x, c_y, c_radius; |
1299 |
Angle a_startang, a_endang; |
|
1300 |
||
1301 |
_COORD_(x, c_x) |
|
1302 |
_COORD_(y, c_y) |
|
1303 |
_COORD_(radius, c_radius) |
|
1304 |
_ANGLE_(startang, a_startang) |
|
1305 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1306 |
|
294 | 1307 |
SETWIN(aGLXWindowId) |
1932 | 1308 |
#ifdef OPENGL |
1309 |
#else |
|
294 | 1310 |
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
|
1311 |
#endif |
294 | 1312 |
%} |
1313 |
! |
|
1314 |
||
1315 |
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
|
1316 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1317 |
All arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1318 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1319 |
%{ /* NOCONTEXT */ |
294 | 1320 |
Icoord c_x, c_y, c_radius; |
1321 |
Angle a_startang, a_endang; |
|
1322 |
||
1323 |
_ICOORD_(x, c_x) |
|
1324 |
_ICOORD_(y, c_y) |
|
1325 |
_ICOORD_(radius, c_radius) |
|
1326 |
_ANGLE_(startang, a_startang); |
|
1327 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1328 |
|
294 | 1329 |
SETWIN(aGLXWindowId) |
1932 | 1330 |
#ifdef OPENGL |
1331 |
#else |
|
294 | 1332 |
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
|
1333 |
#endif |
294 | 1334 |
%} |
1335 |
! |
|
1336 |
||
1337 |
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
|
1338 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1339 |
All arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1340 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1341 |
%{ /* NOCONTEXT */ |
294 | 1342 |
Scoord c_x, c_y, c_radius; |
1343 |
Angle a_startang, a_endang; |
|
1344 |
||
1345 |
_SCOORD_(x, c_x) |
|
1346 |
_SCOORD_(y, c_y) |
|
1347 |
_SCOORD_(radius, c_radius) |
|
1348 |
_ANGLE_(startang, a_startang) |
|
1349 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1350 |
|
294 | 1351 |
SETWIN(aGLXWindowId) |
1932 | 1352 |
#ifdef OPENGL |
1353 |
#else |
|
294 | 1354 |
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
|
1355 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1356 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1357 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1358 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1359 |
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
|
1360 |
"draw an (unfilled) arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1361 |
All arguments must be smallIntegers." |
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 |
%{ /* NOCONTEXT */ |
294 | 1364 |
Icoord c_x, c_y, c_radius; |
1365 |
Angle a_startang, a_endang; |
|
1366 |
||
1367 |
_ICOORD_(x, c_x) |
|
1368 |
_ICOORD_(y, c_y) |
|
1369 |
_ICOORD_(radius, c_radius) |
|
1370 |
_ANGLE_(startang, a_startang) |
|
1371 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1372 |
|
294 | 1373 |
SETWIN(aGLXWindowId) |
1932 | 1374 |
#ifdef OPENGL |
1375 |
#else |
|
294 | 1376 |
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
|
1377 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1378 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1379 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1380 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1381 |
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
|
1382 |
"draw an (unfilled) arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1383 |
All arguments must be (16bit) smallIntegers." |
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 |
%{ /* NOCONTEXT */ |
1932 | 1386 |
Scoord c_x, c_y, c_radius; |
1387 |
Angle a_startang, a_endang; |
|
1388 |
||
1389 |
_SCOORD_(x, c_x) |
|
1390 |
_SCOORD_(y, c_y) |
|
1391 |
_SCOORD_(radius, c_radius) |
|
1392 |
_ANGLE_(startang, a_startang) |
|
1393 |
_ANGLE_(endang, a_endang) |
|
1394 |
||
1395 |
SETWIN(aGLXWindowId) |
|
1396 |
#ifdef OPENGL |
|
1397 |
#else |
|
1398 |
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
|
1399 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1400 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1401 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1402 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1403 |
glxCircX:x y:y radius: radius in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1404 |
"draw a circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1405 |
x/y/radius may be floats, fractions or smallIntegers." |
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 |
%{ /* NOCONTEXT */ |
1932 | 1408 |
Coord c_x, c_y, c_radius; |
1409 |
||
1410 |
_COORD_ (x, c_x) |
|
1411 |
_COORD_ (y, c_y) |
|
1412 |
_COORD_ (radius, c_radius) |
|
1413 |
||
1414 |
SETWIN(aGLXWindowId) |
|
1415 |
#ifdef OPENGL |
|
1416 |
#else |
|
1417 |
circ(c_x, c_y, c_radius); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1418 |
#endif |
294 | 1419 |
%} |
1420 |
! |
|
1421 |
||
1422 |
glxCircfX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1423 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1424 |
x/y/radius may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1425 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1426 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1427 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1428 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1429 |
Coord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1430 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1431 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1432 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1433 |
_COORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1434 |
|
1932 | 1435 |
#ifdef OPENGL |
1436 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1437 |
circf(c_x, c_y, c_radius); |
1932 | 1438 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1439 |
} |
294 | 1440 |
%} |
1441 |
! |
|
1442 |
||
1443 |
glxCircfiX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1444 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1445 |
x/y/radius must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1446 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1447 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1448 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1449 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1450 |
Icoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1451 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1452 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1453 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1454 |
_ICOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1455 |
|
1932 | 1456 |
#ifdef OPENGL |
1457 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1458 |
circfi(c_x, c_y, c_radius); |
1932 | 1459 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1460 |
} |
294 | 1461 |
%} |
1462 |
! |
|
1463 |
||
1464 |
glxCircfsX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1465 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1466 |
x/y/radius must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1467 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1468 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1469 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1470 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1471 |
Scoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1472 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1473 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1474 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1475 |
_SCOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1476 |
|
1932 | 1477 |
#ifdef OPENGL |
1478 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1479 |
circfs(c_x, c_y, c_radius); |
1932 | 1480 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1481 |
} |
294 | 1482 |
%} |
1483 |
! |
|
1484 |
||
1485 |
glxCirciX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1486 |
"draw a circle (unfilled). |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1487 |
x/y/radius must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1488 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1489 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1490 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1491 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1492 |
Icoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1493 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1494 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1495 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1496 |
_ICOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1497 |
|
1932 | 1498 |
#ifdef OPENGL |
1499 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1500 |
circi(c_x, c_y, c_radius); |
1932 | 1501 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1502 |
} |
294 | 1503 |
%} |
1504 |
! |
|
1505 |
||
1506 |
glxCircsX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1507 |
"draw a circle (unfilled) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1508 |
x/y/radius must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1509 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1510 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1511 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1512 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1513 |
Scoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1514 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1515 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1516 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1517 |
_SCOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1518 |
|
1932 | 1519 |
#ifdef OPENGL |
1520 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1521 |
circs(c_x, c_y, c_radius); |
1932 | 1522 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1523 |
} |
294 | 1524 |
%} |
1525 |
! ! |
|
1526 |
||
528 | 1527 |
!GLXWorkstation methodsFor:'attribute stack'! |
1528 |
||
1529 |
glxPopattributesIn: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1530 |
"pop (and forget) the top entry on the attribute stack" |
528 | 1531 |
|
1532 |
%{ /* NOCONTEXT */ |
|
1533 |
SETWIN(aGLXWindowId) |
|
1932 | 1534 |
#ifndef OPENGL |
528 | 1535 |
popattributes(); |
1932 | 1536 |
#endif |
528 | 1537 |
%} |
1538 |
||
1539 |
"Modified: 19.3.1996 / 18:42:53 / cg" |
|
1540 |
! |
|
1541 |
||
1542 |
glxPushattributesIn: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1543 |
"save the current attributes on the attribute stack" |
528 | 1544 |
|
1545 |
%{ /* NOCONTEXT */ |
|
1546 |
SETWIN(aGLXWindowId) |
|
1932 | 1547 |
#ifndef OPENGL |
528 | 1548 |
pushattributes(); |
1932 | 1549 |
#endif |
528 | 1550 |
%} |
1551 |
||
1552 |
"Modified: 19.3.1996 / 18:43:04 / cg" |
|
1553 |
! ! |
|
1554 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1555 |
!GLXWorkstation methodsFor:'character position'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1556 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1557 |
glxCmov2X: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1558 |
"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
|
1559 |
The arguments may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1560 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1561 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1562 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1563 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1564 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1565 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1566 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1567 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1568 |
|
1932 | 1569 |
#ifdef OPENGL |
1570 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1571 |
cmov2(c_x, c_y); |
1932 | 1572 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1573 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1574 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1575 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1576 |
"Modified: 22.3.1996 / 18:17:38 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1577 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1578 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1579 |
glxCmov2iX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1580 |
"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
|
1581 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1582 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1583 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1584 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1585 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1586 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1587 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1588 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1589 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1590 |
|
1932 | 1591 |
#ifdef OPENGL |
1592 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1593 |
cmov2i(c_x, c_y); |
1932 | 1594 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1595 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1596 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1597 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1598 |
"Modified: 22.3.1996 / 18:17:43 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1599 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1600 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1601 |
glxCmov2sX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1602 |
"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
|
1603 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1604 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1605 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1606 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1607 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1608 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1609 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1610 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1611 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1612 |
|
1932 | 1613 |
#ifdef OPENGL |
1614 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1615 |
cmov2s(c_x, c_y); |
1932 | 1616 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1617 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1618 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1619 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1620 |
"Modified: 22.3.1996 / 18:17:47 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1621 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1622 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1623 |
glxCmovX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1624 |
"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
|
1625 |
The arguments may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1626 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1627 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1628 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1629 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1630 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1631 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1632 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1633 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1634 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1635 |
|
1932 | 1636 |
#ifdef OPENGL |
1637 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1638 |
cmov(c_x, c_y, c_z); |
1932 | 1639 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1640 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1641 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1642 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1643 |
"Modified: 22.3.1996 / 18:17:22 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1644 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1645 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1646 |
glxCmoviX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1647 |
"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
|
1648 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1649 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1650 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1651 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1652 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1653 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1654 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1655 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1656 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1657 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1658 |
|
1932 | 1659 |
#ifdef OPENGL |
1660 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1661 |
cmovi(c_x, c_y, c_z); |
1932 | 1662 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1663 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1664 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1665 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1666 |
"Modified: 22.3.1996 / 18:17:55 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1667 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1668 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1669 |
glxCmovsX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1670 |
"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
|
1671 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1672 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1673 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1674 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1675 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1676 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1677 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1678 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1679 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1680 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1681 |
|
1932 | 1682 |
#ifdef OPENGL |
1683 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1684 |
cmovs(c_x, c_y, c_z); |
1932 | 1685 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1686 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1687 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1688 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1689 |
"Modified: 22.3.1996 / 18:17:59 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1690 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1691 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1692 |
glxGetcposIn: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1693 |
"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
|
1694 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1695 |
| x y | |
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 |
short s_x, s_y; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1698 |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1699 |
SETWIN(aGLXWindowId) |
1932 | 1700 |
#ifdef OPENGL |
1701 |
#else |
|
1702 |
# ifdef GLX |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1703 |
getcpos(&s_x, &s_y); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1704 |
x = __MKSMALLINT(s_x); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1705 |
y = __MKSMALLINT(s_y); |
1932 | 1706 |
# endif |
1707 |
#endif |
|
1708 |
%}. |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1709 |
^x @ y |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1710 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1711 |
|
294 | 1712 |
!GLXWorkstation methodsFor:'clearing'! |
1713 |
||
1714 |
glxClearIn:aGLXWindowId |
|
1715 |
"clear to current color" |
|
1716 |
||
1717 |
%{ /* NOCONTEXT */ |
|
1718 |
SETWIN(aGLXWindowId) |
|
1932 | 1719 |
#ifdef OPENGL |
1720 |
#else |
|
294 | 1721 |
clear(); |
1932 | 1722 |
#endif |
294 | 1723 |
%} |
1724 |
! |
|
1725 |
||
1726 |
glxCzclearCval:cval zval:zval in:aGLXWindowId |
|
1727 |
"clear to a color (cval) and clear z buffer to zval simultaniously" |
|
1728 |
||
1729 |
%{ /* NOCONTEXT */ |
|
1932 | 1730 |
SETWIN(aGLXWindowId) |
1731 |
#ifdef OPENGL |
|
1732 |
#else |
|
1733 |
# ifdef GLX |
|
294 | 1734 |
czclear((ulong)__intVal(cval), __intVal(zval)); |
1932 | 1735 |
# endif |
1736 |
#endif |
|
1737 |
%} |
|
294 | 1738 |
! |
1739 |
||
1740 |
glxZClearIn:aGLXWindowId |
|
1741 |
"clear z buffer" |
|
1742 |
||
1743 |
%{ /* NOCONTEXT */ |
|
1932 | 1744 |
SETWIN(aGLXWindowId) |
1745 |
#ifdef OPENGL |
|
1746 |
#else |
|
1747 |
# ifdef GLX |
|
294 | 1748 |
zclear(); |
1932 | 1749 |
# endif |
1750 |
#endif |
|
1751 |
%} |
|
294 | 1752 |
! ! |
1753 |
||
1754 |
!GLXWorkstation methodsFor:'color'! |
|
1755 |
||
1756 |
glxColor:index in:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1757 |
"set the drawing color; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1758 |
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
|
1759 |
otherwise, better results are expected with float values." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1760 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1761 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1762 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1763 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1764 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1765 |
#else |
294 | 1766 |
if (__isSmallInteger(index)) { |
1767 |
color((Colorindex)(__intVal(index))); |
|
1932 | 1768 |
RETURN (self); |
294 | 1769 |
} |
1770 |
if (__isFloat(index)) { |
|
1771 |
colorf((float)(_floatVal(index))); |
|
1932 | 1772 |
RETURN (self); |
294 | 1773 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1774 |
#endif |
1932 | 1775 |
%} |
294 | 1776 |
! |
1777 |
||
1778 |
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
|
1779 |
"set the drawing color, including alpha value. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1780 |
The args must be integer values within 0..255" |
294 | 1781 |
|
1782 |
%{ /* NOCONTEXT */ |
|
1783 |
short s_r, s_g, s_b, s_a; |
|
1784 |
||
1785 |
_INT_(r, s_r); |
|
1786 |
_INT_(g, s_g); |
|
1787 |
_INT_(b, s_b); |
|
1788 |
_INT_(a, s_a); |
|
1789 |
SETWIN(aGLXWindowId) |
|
1932 | 1790 |
#ifdef GLX |
294 | 1791 |
cpack((((((s_a<<8) | s_b) << 8) | s_g) << 8) | s_r); |
1932 | 1792 |
#endif |
1793 |
%} |
|
294 | 1794 |
! |
1795 |
||
1796 |
glxColorRed:r green:g blue:b in:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1797 |
"set the drawing color. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1798 |
The args must be integer values in 0..255" |
294 | 1799 |
|
1800 |
%{ /* NOCONTEXT */ |
|
1801 |
short s_r, s_g, s_b; |
|
1802 |
||
1803 |
_INT_(r, s_r); |
|
1804 |
_INT_(g, s_g); |
|
1805 |
_INT_(b, s_b); |
|
1806 |
SETWIN(aGLXWindowId) |
|
1932 | 1807 |
#ifdef GLX |
294 | 1808 |
RGBcolor(s_r, s_g, s_b); |
1932 | 1809 |
#endif |
1810 |
%} |
|
294 | 1811 |
! |
1812 |
||
528 | 1813 |
glxLrgbrangeRmin: rmin gmin: gmin bmin: bmin rmax: rmax gmax: gmax bmax: bmax |
1814 |
znear: znear zfar: zfar in: aGLXWindowId |
|
1815 |
||
1816 |
%{ /* NOCONTEXT */ |
|
1932 | 1817 |
SETWIN(aGLXWindowId) |
1818 |
#ifdef GLX |
|
528 | 1819 |
lRGBrange(_shortVal(rmin), _shortVal(gmin), _shortVal(bmin), |
1820 |
_shortVal(rmax), _shortVal(gmax), _shortVal(bmax), |
|
1821 |
_longVal(znear), _longVal(zfar)); |
|
1932 | 1822 |
#endif |
1823 |
%} |
|
528 | 1824 |
! |
1825 |
||
1826 |
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
|
1827 |
"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
|
1828 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1829 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1830 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1831 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1832 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1833 |
#else |
528 | 1834 |
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
|
1835 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1836 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1837 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1838 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1839 |
glxTextcolor:tcolor in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1840 |
"change the color used for text drawing" |
294 | 1841 |
|
1842 |
%{ /* NOCONTEXT */ |
|
1932 | 1843 |
SETWIN(aGLXWindowId) |
1844 |
#ifdef GLX |
|
294 | 1845 |
textcolor(_colorindexVal(tcolor)); |
1932 | 1846 |
#endif |
1847 |
%} |
|
294 | 1848 |
! ! |
1849 |
||
528 | 1850 |
!GLXWorkstation methodsFor:'curves'! |
1851 |
||
1852 |
glxCurvebasis: basid in: aGLXWindowId |
|
1853 |
"sets the basis type of curves" |
|
1854 |
||
1855 |
%{ /* NOCONTEXT */ |
|
1856 |
SETWIN(aGLXWindowId) |
|
1932 | 1857 |
#ifdef GLX |
528 | 1858 |
curvebasis(_shortVal(basid)); |
1932 | 1859 |
#endif |
528 | 1860 |
%} |
1861 |
||
1862 |
"Modified: 19.3.1996 / 18:47:09 / cg" |
|
1863 |
! |
|
1864 |
||
1865 |
glxCurveit: iterationcount in: aGLXWindowId |
|
1866 |
"Iterates the top matrix on the stack as a forward difference |
|
1867 |
matrix, drawing as it goes along." |
|
1868 |
||
1869 |
%{ /* NOCONTEXT */ |
|
1870 |
SETWIN(aGLXWindowId) |
|
1932 | 1871 |
#ifdef GLX |
528 | 1872 |
curveit(_shortVal(iterationcount)); |
1932 | 1873 |
#endif |
528 | 1874 |
%} |
1875 |
||
1876 |
"Modified: 19.3.1996 / 18:48:57 / cg" |
|
1877 |
! |
|
1878 |
||
1879 |
glxCurveprecision: nsegments in: aGLXWindowId |
|
1880 |
"sets the number of line segments that make up a curve segment" |
|
1881 |
||
1882 |
%{ /* NOCONTEXT */ |
|
1883 |
SETWIN(aGLXWindowId) |
|
1932 | 1884 |
#ifdef GLX |
528 | 1885 |
curveprecision(_shortVal(nsegments)); |
1932 | 1886 |
#endif |
528 | 1887 |
%} |
1888 |
||
1889 |
"Modified: 19.3.1996 / 18:47:43 / cg" |
|
1890 |
! ! |
|
1891 |
||
294 | 1892 |
!GLXWorkstation methodsFor:'double buffering'! |
1893 |
||
1894 |
glxBackBufferIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1895 |
"switch to back buffer drawing - turning frontbuffer drawing off" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1896 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1897 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1898 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1899 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1900 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1901 |
# ifdef GLX |
294 | 1902 |
frontbuffer(FALSE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1903 |
# endif |
294 | 1904 |
backbuffer(TRUE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1905 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1906 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1907 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1908 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1909 |
glxBackbuffer:b in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1910 |
"turn backBuffer drawing on/off. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1911 |
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
|
1912 |
... enabling the backbuffer automatically disables frontbuffer drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1913 |
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
|
1914 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1915 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1916 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1917 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1918 |
#else |
294 | 1919 |
backbuffer(_booleanVal(b)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1920 |
#endif |
294 | 1921 |
%} |
528 | 1922 |
|
1923 |
"Modified: 19.3.1996 / 18:45:05 / cg" |
|
294 | 1924 |
! |
1925 |
||
1926 |
glxDoubleBufferIn:aGLXWindowId |
|
1927 |
"set double buffer mode" |
|
1928 |
||
1929 |
%{ /* NOCONTEXT */ |
|
1930 |
SETWIN(aGLXWindowId) |
|
1932 | 1931 |
#ifdef OPENGL |
1932 |
#else |
|
294 | 1933 |
doublebuffer(); |
1932 | 1934 |
#endif |
294 | 1935 |
%} |
1936 |
! |
|
1937 |
||
1938 |
glxFrontBufferIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1939 |
"switch to front buffer drawing - turning backbuffer drawing off" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1940 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1941 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1942 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1943 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1944 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1945 |
# ifdef GLX |
294 | 1946 |
backbuffer(FALSE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1947 |
# endif |
294 | 1948 |
frontbuffer(TRUE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1949 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1950 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1951 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1952 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1953 |
glxFrontbuffer:b in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1954 |
"turn on/off frontbuffer drawing. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1955 |
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
|
1956 |
... enabling the backbuffer automatically disables frontbuffer drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1957 |
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
|
1958 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1959 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1960 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1961 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1962 |
#else |
294 | 1963 |
frontbuffer(_booleanVal(b)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1964 |
#endif |
294 | 1965 |
%} |
528 | 1966 |
|
1967 |
"Modified: 19.3.1996 / 18:45:31 / cg" |
|
294 | 1968 |
! |
1969 |
||
1970 |
glxSingleBufferIn: aGLXWindowId |
|
1971 |
"set single buffer mode" |
|
1972 |
||
1973 |
%{ /* NOCONTEXT */ |
|
1974 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1975 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1976 |
#else |
294 | 1977 |
singlebuffer(); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1978 |
#endif |
294 | 1979 |
%} |
1980 |
! |
|
1981 |
||
1982 |
glxSwapBuffersIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1983 |
"swap the back and front buffers. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1984 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1985 |
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
|
1986 |
displayed and swap them for every frame." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1987 |
|
1903 | 1988 |
%{ /* UNLIMITEDSTACK */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1989 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1990 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1991 |
#else |
294 | 1992 |
swapbuffers(); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1993 |
#endif |
294 | 1994 |
%} |
528 | 1995 |
|
1996 |
"Modified: 19.3.1996 / 18:45:47 / cg" |
|
294 | 1997 |
! ! |
1998 |
||
1999 |
!GLXWorkstation methodsFor:'flat drawing'! |
|
2000 |
||
2001 |
glxBeginClosedLineIn:aGLXWindowId |
|
2002 |
"start a closed line" |
|
2003 |
||
2004 |
%{ /* NOCONTEXT */ |
|
1932 | 2005 |
#ifdef OPENGL |
2006 |
#else |
|
294 | 2007 |
SETWIN(aGLXWindowId) |
2008 |
bgnclosedline(); |
|
1932 | 2009 |
#endif |
294 | 2010 |
%} |
2011 |
! |
|
2012 |
||
2013 |
glxBeginLineIn:aGLXWindowId |
|
2014 |
"start a line group" |
|
2015 |
||
2075 | 2016 |
%{ /* NOCONTEXT STACK:32000 */ |
1932 | 2017 |
#ifdef OPENGL |
2018 |
#else |
|
294 | 2019 |
SETWIN(aGLXWindowId) |
2020 |
bgnline(); |
|
1932 | 2021 |
#endif |
294 | 2022 |
%} |
2023 |
! |
|
2024 |
||
2025 |
glxBeginPointIn:aGLXWindowId |
|
2026 |
"start a point-group" |
|
2027 |
||
2028 |
%{ /* NOCONTEXT */ |
|
1932 | 2029 |
#ifdef OPENGL |
2030 |
#else |
|
294 | 2031 |
SETWIN(aGLXWindowId) |
2032 |
bgnpoint(); |
|
1932 | 2033 |
#endif |
294 | 2034 |
%} |
2035 |
! |
|
2036 |
||
2037 |
glxBeginPolygonIn:aGLXWindowId |
|
2038 |
"start a polygon" |
|
2039 |
||
2040 |
%{ /* NOCONTEXT */ |
|
1932 | 2041 |
#ifdef OPENGL |
2042 |
#else |
|
294 | 2043 |
SETWIN(aGLXWindowId) |
2044 |
bgnpolygon(); |
|
1932 | 2045 |
#endif |
294 | 2046 |
%} |
2047 |
! |
|
2048 |
||
2049 |
glxBeginQuadrilateralStripIn:aGLXWindowId |
|
2050 |
"start a quadrilateral strip" |
|
2051 |
||
2052 |
%{ /* NOCONTEXT */ |
|
1932 | 2053 |
#ifdef OPENGL |
2054 |
#else |
|
294 | 2055 |
SETWIN(aGLXWindowId) |
2056 |
bgnqstrip(); |
|
1932 | 2057 |
#endif |
294 | 2058 |
%} |
2059 |
! |
|
2060 |
||
2061 |
glxBeginTriangleMeshIn:aGLXWindowId |
|
2062 |
"start a triangle mesh" |
|
2063 |
||
2064 |
%{ /* NOCONTEXT */ |
|
1932 | 2065 |
#ifdef OPENGL |
2066 |
#else |
|
294 | 2067 |
SETWIN(aGLXWindowId) |
2068 |
bgntmesh(); |
|
1932 | 2069 |
#endif |
294 | 2070 |
%} |
2071 |
! |
|
2072 |
||
2073 |
glxEndClosedLineIn:aGLXWindowId |
|
2074 |
"end a closed line" |
|
2075 |
||
2076 |
%{ /* NOCONTEXT */ |
|
1932 | 2077 |
#ifdef OPENGL |
2078 |
#else |
|
294 | 2079 |
SETWIN(aGLXWindowId) |
2080 |
endclosedline(); |
|
1932 | 2081 |
#endif |
294 | 2082 |
%} |
2083 |
! |
|
2084 |
||
2085 |
glxEndLineIn:aGLXWindowId |
|
2086 |
"end a line group" |
|
2087 |
||
2075 | 2088 |
%{ /* NOCONTEXT STACK:32000 */ |
1932 | 2089 |
#ifdef OPENGL |
2090 |
#else |
|
294 | 2091 |
SETWIN(aGLXWindowId) |
2092 |
endline(); |
|
1932 | 2093 |
#endif |
294 | 2094 |
%} |
2095 |
! |
|
2096 |
||
2097 |
glxEndPointIn:aGLXWindowId |
|
2098 |
"end a point group" |
|
2099 |
||
2100 |
%{ /* NOCONTEXT */ |
|
1932 | 2101 |
#ifdef OPENGL |
2102 |
#else |
|
294 | 2103 |
SETWIN(aGLXWindowId) |
2104 |
endpoint(); |
|
1932 | 2105 |
#endif |
294 | 2106 |
%} |
2107 |
! |
|
2108 |
||
2109 |
glxEndPolygonIn:aGLXWindowId |
|
2110 |
"end a polygon" |
|
2111 |
||
2112 |
%{ /* NOCONTEXT */ |
|
1932 | 2113 |
#ifdef OPENGL |
2114 |
#else |
|
294 | 2115 |
SETWIN(aGLXWindowId) |
2116 |
endpolygon(); |
|
1932 | 2117 |
#endif |
294 | 2118 |
%} |
2119 |
! |
|
2120 |
||
2121 |
glxEndQuadrilateralStripIn:aGLXWindowId |
|
2122 |
"end a quadrilateral strip" |
|
2123 |
||
2124 |
%{ /* NOCONTEXT */ |
|
1932 | 2125 |
#ifdef OPENGL |
2126 |
#else |
|
294 | 2127 |
SETWIN(aGLXWindowId) |
2128 |
endqstrip(); |
|
1932 | 2129 |
#endif |
294 | 2130 |
%} |
2131 |
! |
|
2132 |
||
2133 |
glxEndTriangleMeshIn:aGLXWindowId |
|
2134 |
"end a triangle mesh" |
|
2135 |
||
2136 |
%{ /* NOCONTEXT */ |
|
1932 | 2137 |
#ifdef OPENGL |
2138 |
#else |
|
294 | 2139 |
SETWIN(aGLXWindowId) |
2140 |
endtmesh(); |
|
1932 | 2141 |
#endif |
168 | 2142 |
%} |
2143 |
! ! |
|
2144 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2145 |
!GLXWorkstation methodsFor:'graphics position'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2146 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2147 |
glxMove2:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2148 |
"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
|
2149 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2150 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2151 |
float vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2152 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2153 |
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
|
2154 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2155 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2156 |
#else |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2157 |
move2((Coord)(c_v[0]), (Coord)(c_v[1])); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2158 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2159 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2160 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2161 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2162 |
"Modified: 22.3.1996 / 18:15:23 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2163 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2164 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2165 |
glxMove2X: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2166 |
"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
|
2167 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2168 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2169 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2170 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2171 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2172 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2173 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2174 |
SETWIN(aGLXWindowId) |
1932 | 2175 |
#ifdef OPENGL |
2176 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2177 |
move2(c_x, c_y); |
1932 | 2178 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2179 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2180 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2181 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2182 |
"Modified: 22.3.1996 / 18:15:02 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2183 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2184 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2185 |
glxMove2iX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2186 |
"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
|
2187 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2188 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2189 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2190 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2191 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2192 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2193 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2194 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2195 |
SETWIN(aGLXWindowId) |
1932 | 2196 |
#ifdef OPENGL |
2197 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2198 |
move2i(c_x, c_y); |
1932 | 2199 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2200 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2201 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2202 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2203 |
"Modified: 22.3.1996 / 18:15:08 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2204 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2205 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2206 |
glxMove2sX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2207 |
"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
|
2208 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2209 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2210 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2211 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2212 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2213 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2214 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2215 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2216 |
SETWIN(aGLXWindowId) |
1932 | 2217 |
#ifdef OPENGL |
2218 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2219 |
move2s(c_x, c_y); |
1932 | 2220 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2221 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2222 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2223 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2224 |
"Modified: 22.3.1996 / 18:15:13 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2225 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2226 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2227 |
glxMove:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2228 |
"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
|
2229 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2230 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2231 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2232 |
float vec[3], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2233 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2234 |
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
|
2235 |
SETWIN(aGLXWindowId) |
1932 | 2236 |
#ifdef OPENGL |
2237 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2238 |
move((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
1932 | 2239 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2240 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2241 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2242 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2243 |
"Modified: 22.3.1996 / 18:14:29 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2244 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2245 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2246 |
glxMoveX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2247 |
"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
|
2248 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2249 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2250 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2251 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2252 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2253 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2254 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2255 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2256 |
SETWIN(aGLXWindowId) |
1932 | 2257 |
#ifdef OPENGL |
2258 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2259 |
move(c_x, c_y, c_z); |
1932 | 2260 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2261 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2262 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2263 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2264 |
"Modified: 22.3.1996 / 18:14:38 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2265 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2266 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2267 |
glxMoveiX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2268 |
"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
|
2269 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2270 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2271 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2272 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2273 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2274 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2275 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2276 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2277 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2278 |
SETWIN(aGLXWindowId) |
1932 | 2279 |
#ifdef OPENGL |
2280 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2281 |
movei(c_x, c_y, c_z); |
1932 | 2282 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2283 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2284 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2285 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2286 |
"Modified: 22.3.1996 / 18:14:44 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2287 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2288 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2289 |
glxMovesX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2290 |
"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
|
2291 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2292 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2293 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2294 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2295 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2296 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2297 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2298 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2299 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2300 |
SETWIN(aGLXWindowId) |
1932 | 2301 |
#ifdef OPENGL |
2302 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2303 |
moves(c_x, c_y, c_z); |
1932 | 2304 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2305 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2306 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2307 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2308 |
"Modified: 22.3.1996 / 18:14:48 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2309 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2310 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2311 |
glxRmv2:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2312 |
"change the graphics position to a 2D point, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2313 |
the relative distance is passed in vector v" |
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 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2316 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2317 |
float vec[2], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2318 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2319 |
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
|
2320 |
SETWIN(aGLXWindowId) |
1932 | 2321 |
#ifdef OPENGL |
2322 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2323 |
rmv2((Coord)(c_v[0]), (Coord)(c_v[1])); |
1932 | 2324 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2325 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2326 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2327 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2328 |
"Modified: 22.3.1996 / 18:15:57 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2329 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2330 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2331 |
glxRmv2X: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2332 |
"change the graphics position to a 2D point, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2333 |
the relative distance is passed in x/y" |
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 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2336 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2337 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2338 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2339 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2340 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2341 |
SETWIN(aGLXWindowId) |
1932 | 2342 |
#ifdef OPENGL |
2343 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2344 |
rmv2(c_x, c_y); |
1932 | 2345 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2346 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2347 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2348 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2349 |
"Modified: 22.3.1996 / 18:16:42 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2350 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2351 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2352 |
glxRmv2iX: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2353 |
"change the graphics position to a 2D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2354 |
the relative distance is passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2355 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2356 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2357 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2358 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2359 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2360 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2361 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2362 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2363 |
SETWIN(aGLXWindowId) |
1932 | 2364 |
#ifdef OPENGL |
2365 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2366 |
rmv2i(c_x, c_y); |
1932 | 2367 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2368 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2369 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2370 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2371 |
"Modified: 22.3.1996 / 18:16:39 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2372 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2373 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2374 |
glxRmv2sX: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2375 |
"change the graphics position to a 2D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2376 |
the relative distance is passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2377 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2378 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2379 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2380 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2381 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2382 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2383 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2384 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2385 |
SETWIN(aGLXWindowId) |
1932 | 2386 |
#ifdef OPENGL |
2387 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2388 |
rmv2s(c_x, c_y); |
1932 | 2389 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2390 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2391 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2392 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2393 |
"Modified: 22.3.1996 / 18:16:33 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2394 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2395 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2396 |
glxRmv:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2397 |
"change the graphics position to a 3D point, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2398 |
the relative distance is passed in vector v" |
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 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2401 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2402 |
float vec[3], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2403 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2404 |
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
|
2405 |
SETWIN(aGLXWindowId) |
1932 | 2406 |
#ifdef OPENGL |
2407 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2408 |
rmv((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
1932 | 2409 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2410 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2411 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2412 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2413 |
"Modified: 22.3.1996 / 18:16:08 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2414 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2415 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2416 |
glxRmvX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2417 |
"change the graphics position to a 3D point, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2418 |
the relative distance is passed in x/y/z" |
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 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2421 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2422 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2423 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2424 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2425 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2426 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2427 |
SETWIN(aGLXWindowId) |
1932 | 2428 |
#ifdef OPENGL |
2429 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2430 |
rmv(c_x, c_y, c_z); |
1932 | 2431 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2432 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2433 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2434 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2435 |
"Modified: 22.3.1996 / 18:16:16 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2436 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2437 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2438 |
glxRmviX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2439 |
"change the graphics position to a 3D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2440 |
the relative distance is passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2441 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2442 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2443 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2444 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2445 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2446 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2447 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2448 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2449 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2450 |
SETWIN(aGLXWindowId) |
1932 | 2451 |
#ifdef OPENGL |
2452 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2453 |
rmvi(c_x, c_y, c_z); |
1932 | 2454 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2455 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2456 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2457 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2458 |
"Modified: 22.3.1996 / 18:16:21 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2459 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2460 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2461 |
glxRmvsX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2462 |
"change the graphics position to a 3D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2463 |
the relative distance is passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2464 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2465 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2466 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2467 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2468 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2469 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2470 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2471 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2472 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2473 |
SETWIN(aGLXWindowId) |
1932 | 2474 |
#ifdef OPENGL |
2475 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2476 |
rmvs(c_x, c_y, c_z); |
1932 | 2477 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2478 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2479 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2480 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2481 |
"Modified: 22.3.1996 / 18:16:25 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2482 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2483 |
|
168 | 2484 |
!GLXWorkstation methodsFor:'initialization'! |
2485 |
||
2486 |
initializeFor:aDisplayName |
|
169 | 2487 |
(super initializeFor:aDisplayName) isNil ifTrue:[^ nil]. |
168 | 2488 |
%{ |
2489 |
if (_INST(displayId) != nil) { |
|
185 | 2490 |
XSetErrorHandler(__XErrorHandler__); |
2491 |
} |
|
2492 |
%} |
|
2493 |
! |
|
2494 |
||
2495 |
initializeScreenProperties |
|
2496 |
super initializeScreenProperties. |
|
2497 |
||
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2498 |
"/ 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
|
2499 |
"/ 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
|
2500 |
"/ 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
|
2501 |
"/ 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
|
2502 |
"/ 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
|
2503 |
"/ 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
|
2504 |
"/ 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
|
2505 |
"/ have no documentation). |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2506 |
"/ 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
|
2507 |
"/ 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
|
2508 |
"/ 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
|
2509 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2510 |
(self isTrueGL and:[ForceGL ~~ true]) ifTrue:[ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2511 |
glOK := (displayName = ':0') or:[displayName = ':0.0']. |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2512 |
] ifFalse:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2513 |
glOK := true. |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2514 |
]. |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2515 |
|
185 | 2516 |
%{ |
2517 |
Display *dpy = myDpy; |
|
2518 |
int dummy; |
|
2519 |
||
2520 |
if (ISCONNECTED) { |
|
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2521 |
_INST(hasStereoExtension) = false; |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2522 |
|
1932 | 2523 |
#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
|
2524 |
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
|
2525 |
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
|
2526 |
_INST(hasStereoExtension) = true; |
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2527 |
} |
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2528 |
#endif |
168 | 2529 |
} |
2530 |
%} |
|
2531 |
! ! |
|
2532 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2533 |
!GLXWorkstation methodsFor:'lines'! |
528 | 2534 |
|
2535 |
glxDeflinestyleN: n ls: ls in: aGLXWindowId |
|
2536 |
"define a line style" |
|
2537 |
||
2538 |
%{ /* NOCONTEXT */ |
|
1932 | 2539 |
SETWIN(aGLXWindowId) |
2540 |
#ifdef OPENGL |
|
2541 |
#else |
|
528 | 2542 |
deflinestyle(_shortVal(n), _linestyleVal(ls)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2543 |
#endif |
528 | 2544 |
%} |
2545 |
! |
|
2546 |
||
2547 |
glxDraw2:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2548 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2549 |
to a new 2D position, passed in vector v." |
528 | 2550 |
|
2551 |
%{ /* NOCONTEXT */ |
|
2552 |
float vec[2], *c_v; |
|
2553 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2554 |
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
|
2555 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2556 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2557 |
#else |
528 | 2558 |
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
|
2559 |
#endif |
528 | 2560 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2561 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2562 |
"Modified: 22.3.1996 / 18:03:29 / cg" |
528 | 2563 |
! |
2564 |
||
2565 |
glxDraw2X: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2566 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2567 |
to a new 2D position, passed in x/y." |
528 | 2568 |
|
2569 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2570 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2571 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2572 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2573 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2574 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2575 |
SETWIN(aGLXWindowId) |
1932 | 2576 |
#ifdef OPENGL |
2577 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2578 |
draw2(c_x, c_y); |
1932 | 2579 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2580 |
} |
528 | 2581 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2582 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2583 |
"Modified: 22.3.1996 / 18:03:50 / cg" |
528 | 2584 |
! |
2585 |
||
2586 |
glxDraw2iX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2587 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2588 |
to a new 2D position, passed in x/y." |
528 | 2589 |
|
2590 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2591 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2592 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2593 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2594 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2595 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2596 |
SETWIN(aGLXWindowId) |
1932 | 2597 |
#ifdef OPENGL |
2598 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2599 |
draw2i(c_x, c_y); |
1932 | 2600 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2601 |
} |
528 | 2602 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2603 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2604 |
"Modified: 22.3.1996 / 18:04:07 / cg" |
528 | 2605 |
! |
2606 |
||
2607 |
glxDraw2sX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2608 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2609 |
to a new 2D position, passed in x/y." |
528 | 2610 |
|
2611 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2612 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2613 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2614 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2615 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2616 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2617 |
SETWIN(aGLXWindowId) |
1932 | 2618 |
#ifdef OPENGL |
2619 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2620 |
draw2s(c_x, c_y); |
1932 | 2621 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2622 |
} |
528 | 2623 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2624 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2625 |
"Modified: 22.3.1996 / 18:04:19 / cg" |
528 | 2626 |
! |
2627 |
||
2628 |
glxDraw:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2629 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2630 |
to a new 3D position, passed in vector v." |
528 | 2631 |
|
2632 |
%{ /* NOCONTEXT */ |
|
2633 |
float vec[3], *c_v; |
|
2634 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2635 |
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
|
2636 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2637 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2638 |
#else |
528 | 2639 |
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
|
2640 |
#endif |
528 | 2641 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2642 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2643 |
"Modified: 22.3.1996 / 18:04:34 / cg" |
528 | 2644 |
! |
2645 |
||
2646 |
glxDrawX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2647 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2648 |
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
|
2649 |
The arguments may be floats, fractions or smallIntegers" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2650 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2651 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2652 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2653 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2654 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2655 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2656 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2657 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2658 |
SETWIN(aGLXWindowId) |
1932 | 2659 |
#ifdef OPENGL |
2660 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2661 |
draw(c_x, c_y, c_z); |
1932 | 2662 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2663 |
} |
528 | 2664 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2665 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2666 |
"Modified: 22.3.1996 / 18:04:46 / cg" |
528 | 2667 |
! |
2668 |
||
2669 |
glxDrawiX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2670 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2671 |
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
|
2672 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2673 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2674 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2675 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2676 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2677 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2678 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2679 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2680 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2681 |
SETWIN(aGLXWindowId) |
1932 | 2682 |
#ifdef OPENGL |
2683 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2684 |
drawi(c_x, c_y, c_z); |
1932 | 2685 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2686 |
} |
528 | 2687 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2688 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2689 |
"Modified: 22.3.1996 / 18:04:54 / cg" |
528 | 2690 |
! |
2691 |
||
2692 |
glxDrawsX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2693 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2694 |
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
|
2695 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2696 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2697 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2698 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2699 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2700 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2701 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2702 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2703 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2704 |
SETWIN(aGLXWindowId) |
1932 | 2705 |
#ifdef OPENGL |
2706 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2707 |
draws(c_x, c_y, c_z); |
1932 | 2708 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2709 |
} |
528 | 2710 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2711 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2712 |
"Modified: 22.3.1996 / 18:05:01 / cg" |
528 | 2713 |
! |
2714 |
||
2715 |
glxLinewidth: n in: aGLXWindowId |
|
2716 |
"set the linewidth" |
|
2717 |
||
2718 |
%{ /* NOCONTEXT */ |
|
2719 |
SETWIN(aGLXWindowId) |
|
1932 | 2720 |
#ifdef OPENGL |
2721 |
#else |
|
528 | 2722 |
linewidth(_shortVal(n)); |
1932 | 2723 |
#endif |
528 | 2724 |
%} |
2725 |
! |
|
2726 |
||
2727 |
glxLinewidthf: n in: aGLXWindowId |
|
2728 |
"set the linewidth" |
|
2729 |
||
2730 |
%{ /* NOCONTEXT */ |
|
2731 |
SETWIN(aGLXWindowId) |
|
1932 | 2732 |
#ifdef OPENGL |
2733 |
#else |
|
528 | 2734 |
linewidthf(_floatVal(n)); |
1932 | 2735 |
#endif |
528 | 2736 |
RETURN (true); |
2737 |
%} |
|
2738 |
! |
|
2739 |
||
2740 |
glxRdr2:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2741 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2742 |
to a new 2D position, passing the relative distance in the vector v." |
528 | 2743 |
|
2744 |
%{ /* NOCONTEXT */ |
|
2745 |
float vec[2], *c_v; |
|
2746 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2747 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
528 | 2748 |
SETWIN(aGLXWindowId) |
1932 | 2749 |
#ifdef OPENGL |
2750 |
#else |
|
528 | 2751 |
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
|
2752 |
#endif |
528 | 2753 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2754 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2755 |
"Modified: 22.3.1996 / 18:05:54 / cg" |
528 | 2756 |
! |
2757 |
||
2758 |
glxRdr2X: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2759 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2760 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2761 |
|
2762 |
%{ /* NOCONTEXT */ |
|
2763 |
Coord c_x, c_y; |
|
2764 |
||
2765 |
_COORD_ (x, c_x) |
|
2766 |
_COORD_ (y, c_y) |
|
2767 |
SETWIN(aGLXWindowId) |
|
1932 | 2768 |
#ifdef OPENGL |
2769 |
#else |
|
528 | 2770 |
rdr2(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2771 |
#endif |
528 | 2772 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2773 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2774 |
"Modified: 22.3.1996 / 18:06:20 / cg" |
528 | 2775 |
! |
2776 |
||
2777 |
glxRdr2iX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2778 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2779 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2780 |
|
2781 |
%{ /* NOCONTEXT */ |
|
2782 |
Icoord c_x, c_y; |
|
2783 |
||
2784 |
_ICOORD_ (x, c_x) |
|
2785 |
_ICOORD_ (y, c_y) |
|
2786 |
SETWIN(aGLXWindowId) |
|
1932 | 2787 |
#ifdef OPENGL |
2788 |
#else |
|
528 | 2789 |
rdr2i(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2790 |
#endif |
528 | 2791 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2792 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2793 |
"Modified: 22.3.1996 / 18:06:28 / cg" |
528 | 2794 |
! |
2795 |
||
2796 |
glxRdr2sX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2797 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2798 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2799 |
|
2800 |
%{ /* NOCONTEXT */ |
|
2801 |
Scoord c_x, c_y; |
|
2802 |
||
2803 |
_SCOORD_ (x, c_x) |
|
2804 |
_SCOORD_ (y, c_y) |
|
2805 |
SETWIN(aGLXWindowId) |
|
1932 | 2806 |
#ifdef OPENGL |
2807 |
#else |
|
528 | 2808 |
rdr2s(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2809 |
#endif |
528 | 2810 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2811 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2812 |
"Modified: 22.3.1996 / 18:06:34 / cg" |
528 | 2813 |
! |
2814 |
||
2815 |
glxRdr:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2816 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2817 |
to a new 3D position, passing the relative distance in the vector v." |
528 | 2818 |
|
2819 |
%{ /* NOCONTEXT */ |
|
2820 |
float vec[3], *c_v; |
|
2821 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2822 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
528 | 2823 |
SETWIN(aGLXWindowId) |
1932 | 2824 |
#ifdef OPENGL |
2825 |
#else |
|
528 | 2826 |
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
|
2827 |
#endif |
528 | 2828 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2829 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2830 |
"Modified: 22.3.1996 / 18:06:07 / cg" |
528 | 2831 |
! |
2832 |
||
2833 |
glxRdrX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2834 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2835 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2836 |
|
2837 |
%{ /* NOCONTEXT */ |
|
2838 |
Coord c_x, c_y, c_z; |
|
2839 |
||
2840 |
_COORD_ (x, c_x) |
|
2841 |
_COORD_ (y, c_y) |
|
2842 |
_COORD_ (z, c_z) |
|
2843 |
SETWIN(aGLXWindowId) |
|
1932 | 2844 |
#ifdef OPENGL |
2845 |
#else |
|
528 | 2846 |
rdr(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2847 |
#endif |
528 | 2848 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2849 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2850 |
"Modified: 22.3.1996 / 18:06:44 / cg" |
528 | 2851 |
! |
2852 |
||
2853 |
glxRdriX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2854 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2855 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2856 |
|
2857 |
%{ /* NOCONTEXT */ |
|
2858 |
Icoord c_x, c_y, c_z; |
|
2859 |
||
2860 |
_ICOORD_ (x, c_x) |
|
2861 |
_ICOORD_ (y, c_y) |
|
2862 |
_ICOORD_ (z, c_z) |
|
2863 |
SETWIN(aGLXWindowId) |
|
1932 | 2864 |
#ifdef OPENGL |
2865 |
#else |
|
528 | 2866 |
rdri(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2867 |
#endif |
528 | 2868 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2869 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2870 |
"Modified: 22.3.1996 / 18:06:51 / cg" |
528 | 2871 |
! |
2872 |
||
2873 |
glxRdrsX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2874 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2875 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2876 |
|
2877 |
%{ /* NOCONTEXT */ |
|
2878 |
Scoord c_x, c_y, c_z; |
|
2879 |
||
2880 |
_SCOORD_ (x, c_x) |
|
2881 |
_SCOORD_ (y, c_y) |
|
2882 |
_SCOORD_ (z, c_z) |
|
2883 |
SETWIN(aGLXWindowId) |
|
1932 | 2884 |
#ifdef OPENGL |
2885 |
#else |
|
528 | 2886 |
rdrs(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2887 |
#endif |
528 | 2888 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2889 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2890 |
"Modified: 22.3.1996 / 18:06:55 / cg" |
528 | 2891 |
! |
2892 |
||
2893 |
glxSetlinestyle: index in: aGLXWindowId |
|
2894 |
"set the linestyle" |
|
2895 |
||
2896 |
%{ /* NOCONTEXT */ |
|
2897 |
SETWIN(aGLXWindowId) |
|
1932 | 2898 |
#ifdef OPENGL |
2899 |
#else |
|
528 | 2900 |
setlinestyle(_shortVal(index)); |
1932 | 2901 |
#endif |
2902 |
%} |
|
528 | 2903 |
! ! |
2904 |
||
294 | 2905 |
!GLXWorkstation methodsFor:'materials & lights'! |
2906 |
||
2907 |
glxLmbind:target index:index in:aGLXWindowId |
|
2908 |
"select a material, light or lighting model. |
|
2909 |
target must be a symbol from: #material, #backMaterial, |
|
2910 |
#light0-light7 or #lightModel." |
|
2911 |
||
2912 |
%{ /* NOCONTEXT */ |
|
2913 |
#ifdef GLX |
|
2914 |
short defType; |
|
2915 |
short i_index; |
|
2916 |
||
2917 |
if (target == @symbol(material)) |
|
2918 |
defType = MATERIAL; |
|
2919 |
else if (target == @symbol(backMaterial)) |
|
2920 |
defType = BACKMATERIAL; |
|
2921 |
else if (target == @symbol(light0)) |
|
2922 |
defType = LIGHT0; |
|
2923 |
else if (target == @symbol(light1)) |
|
2924 |
defType = LIGHT1; |
|
2925 |
else if (target == @symbol(light2)) |
|
2926 |
defType = LIGHT2; |
|
2927 |
else if (target == @symbol(light3)) |
|
2928 |
defType = LIGHT3; |
|
2929 |
else if (target == @symbol(light4)) |
|
2930 |
defType = LIGHT4; |
|
2931 |
else if (target == @symbol(light5)) |
|
2932 |
defType = LIGHT5; |
|
2933 |
else if (target == @symbol(light6)) |
|
2934 |
defType = LIGHT6; |
|
2935 |
else if (target == @symbol(light7)) |
|
2936 |
defType = LIGHT7; |
|
2937 |
else if (target == @symbol(lightModel)) |
|
2938 |
defType = LMODEL; |
|
2939 |
else { |
|
1932 | 2940 |
RETURN (nil); |
294 | 2941 |
} |
2942 |
||
2943 |
_INT_ (index, i_index); |
|
2944 |
SETWIN(aGLXWindowId) |
|
2945 |
lmbind(defType, i_index); |
|
1932 | 2946 |
#endif |
2947 |
%} |
|
294 | 2948 |
! |
2949 |
||
2950 |
glxLmdef:what index:index np:np props:props in:aGLXWindowId |
|
2951 |
"define a material, light source or lighting model; |
|
2952 |
what must be one of #material, #light or #lightModel. |
|
2953 |
props must be a FloatArray or a subclass of FloatArray" |
|
2954 |
||
2955 |
%{ /* NOCONTEXT */ |
|
2956 |
#ifdef GLX |
|
2957 |
short defType; |
|
2958 |
short i_index, i_np; |
|
2959 |
float *fp; |
|
2960 |
OBJ cls; |
|
2961 |
int ninstVars, nInstBytes; |
|
2962 |
||
2963 |
if (what == @symbol(material)) |
|
2964 |
defType = DEFMATERIAL; |
|
2965 |
else if (what == @symbol(light)) |
|
2966 |
defType = DEFLIGHT; |
|
2967 |
else if (what == @symbol(lightModel)) |
|
2968 |
defType = DEFLMODEL; |
|
2969 |
else { |
|
1932 | 2970 |
RETURN (nil); |
294 | 2971 |
} |
2972 |
||
2973 |
_INT_ (index, i_index); |
|
2974 |
_INT_ (np, i_np); |
|
2975 |
||
2976 |
if (! _isNonNilObject(props)) fp = NULL; |
|
2977 |
else { |
|
2978 |
cls = __qClass(props); |
|
350 | 2979 |
if (cls == @global(FloatArray)) |
294 | 2980 |
fp = _FloatArrayInstPtr(props)->f_element; |
2981 |
else { |
|
2982 |
if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) { |
|
2983 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
2984 |
fp = (float *) &(_InstPtr(props)->i_instvars[ninstVars]); |
|
2985 |
} else { |
|
1932 | 2986 |
RETURN (nil); |
294 | 2987 |
} |
2988 |
} |
|
2989 |
} |
|
2990 |
SETWIN(aGLXWindowId) |
|
2991 |
lmdef(defType, i_index, i_np, fp); |
|
1932 | 2992 |
#endif |
2993 |
%} |
|
294 | 2994 |
! |
2995 |
||
2996 |
glxTevbind:target index:index in:aGLXWindowId |
|
2997 |
"bind a texture environment; target must be 0 |
|
2998 |
or the symbol #env0." |
|
2999 |
||
3000 |
%{ /* NOCONTEXT */ |
|
3001 |
#ifdef GLX |
|
3002 |
long t; |
|
3003 |
||
3004 |
if (__isSmallInteger(target)) { |
|
3005 |
t = __intVal(target); |
|
3006 |
} else { |
|
3007 |
if (target == @symbol(env0)) { |
|
3008 |
t = TV_ENV0; |
|
3009 |
} else { |
|
1932 | 3010 |
RETURN (nil); |
294 | 3011 |
} |
3012 |
} |
|
3013 |
SETWIN(aGLXWindowId) |
|
3014 |
tevbind(t, __intVal(index)); |
|
1932 | 3015 |
#endif |
3016 |
%} |
|
294 | 3017 |
! |
3018 |
||
3019 |
glxTevdef:index np:np props:props in:aGLXWindowId |
|
3020 |
||
3021 |
%{ /* NOCONTEXT */ |
|
3022 |
#ifdef GLX |
|
3023 |
const float *fp; |
|
3024 |
float fbuff[30]; |
|
3025 |
||
3026 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3027 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
294 | 3028 |
tevdef(__intVal(index), __intVal(np), fp); |
1932 | 3029 |
#endif |
3030 |
%} |
|
294 | 3031 |
! |
3032 |
||
3033 |
glxTexDef2d:index nc:nc width:w height:h bits:image np:np props:props in:aGLXWindowId |
|
3034 |
"define a 2D texture. index is the 'name' of the texture; |
|
3035 |
nc is the number of components (1-4) per pixel; |
|
3036 |
w/h define the size of the texture; bits is a byteArray containing the |
|
3037 |
long-word aligned pixel data; np is the number of props found in |
|
3038 |
the floatArray props. Props must be delimited by a 0.0 entry." |
|
3039 |
||
3040 |
%{ /* NOCONTEXT */ |
|
3041 |
#ifdef GLX |
|
3042 |
unsigned char *cp; |
|
3043 |
const float *fp; |
|
3044 |
OBJ cls; |
|
3045 |
float fbuff[30]; |
|
3046 |
||
3047 |
if (__isByteArray(image)) { |
|
3048 |
cp = _ByteArrayInstPtr(image)->ba_element; |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3049 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
294 | 3050 |
|
3051 |
SETWIN(aGLXWindowId) |
|
3052 |
texdef2d(__intVal(index), __intVal(nc), __intVal(w), __intVal(h), |
|
3053 |
(const unsigned long *)cp, __intVal(np), fp); |
|
3054 |
} |
|
3055 |
#endif |
|
3056 |
%} |
|
3057 |
! |
|
3058 |
||
3059 |
glxTexDef3d:index nc:nc width:w height:h depth:d bits:image np:np props:props in:aGLXWindowId |
|
3060 |
"define a 3D texture. index is the 'name' of the texture; |
|
3061 |
nc is the number of components (1-4) per pixel; |
|
3062 |
w/h/d define the size of the texture; bits is a byteArray containing the |
|
3063 |
long-word aligned pixel data; np is the number of props found in |
|
3064 |
the floatArray props. Props must be delimited by a 0.0 entry." |
|
3065 |
||
3066 |
%{ /* NOCONTEXT */ |
|
3067 |
#ifdef GLX |
|
3068 |
unsigned char *cp; |
|
3069 |
const float *fp; |
|
3070 |
OBJ cls; |
|
3071 |
float fbuff[30]; |
|
3072 |
||
3073 |
if (__isByteArray(image)) { |
|
3074 |
cp = _ByteArrayInstPtr(image)->ba_element; |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3075 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
294 | 3076 |
|
3077 |
SETWIN(aGLXWindowId) |
|
3078 |
texdef3d(__intVal(index), __intVal(nc), __intVal(w), __intVal(h), |
|
3079 |
__intVal(d), |
|
3080 |
(const unsigned long *)cp, __intVal(np), fp); |
|
3081 |
} |
|
3082 |
#endif |
|
3083 |
%} |
|
3084 |
! |
|
3085 |
||
3086 |
glxTexbind:target index:index in:aGLXWindowId |
|
3087 |
"bind a texture; target must be an integer or one |
|
3088 |
of the symbols #texture0, #textureDetail or #textureIdle." |
|
3089 |
||
3090 |
%{ /* NOCONTEXT */ |
|
3091 |
#ifdef GLX |
|
3092 |
long t; |
|
3093 |
||
3094 |
if (__isSmallInteger(target)) { |
|
3095 |
t = __intVal(target); |
|
3096 |
} else { |
|
3097 |
if (target == @symbol(texture0)) { |
|
3098 |
t = TX_TEXTURE_0; |
|
3099 |
} else if (target == @symbol(textureDetail)) { |
|
3100 |
t = TX_TEXTURE_DETAIL; |
|
3101 |
} else if (target == @symbol(textureIdle)) { |
|
3102 |
t = TX_TEXTURE_IDLE; |
|
3103 |
} else { |
|
1932 | 3104 |
RETURN (nil); |
294 | 3105 |
} |
3106 |
} |
|
3107 |
SETWIN(aGLXWindowId) |
|
3108 |
texbind(t, __intVal(index)); |
|
1932 | 3109 |
#endif |
3110 |
%} |
|
294 | 3111 |
! ! |
3112 |
||
3113 |
!GLXWorkstation methodsFor:'matrix stack'! |
|
3114 |
||
3115 |
glxGetMatrix:arrayOf16Floats in:aGLXWindowId |
|
3116 |
"argument must be an array (a matrix) of 16 floats. The current matrix |
|
3117 |
will be stored into that." |
|
3118 |
||
3119 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3120 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3121 |
#else |
294 | 3122 |
Matrix matrix; |
3123 |
||
3124 |
SETWIN(aGLXWindowId) |
|
3125 |
getmatrix(matrix); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3126 |
if (! __glx_putFloatsFromInto(matrix, arrayOf16Floats, 16)) RETURN(false); |
1932 | 3127 |
#endif |
3128 |
%} |
|
294 | 3129 |
! |
3130 |
||
3131 |
glxLoadMatrix:arrayOf16Floats in:aGLXWindowId |
|
3132 |
"argument must be an array(a matrix) of 16 floats. The current matrix |
|
3133 |
will be loaded from that." |
|
3134 |
||
3135 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3136 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3137 |
#else |
294 | 3138 |
Matrix matrix; |
3139 |
Matrix *m; |
|
3140 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3141 |
if (! (m = __glx_getFloatsFromMatrixInto(arrayOf16Floats, &matrix))) RETURN (false); |
294 | 3142 |
SETWIN(aGLXWindowId) |
3143 |
loadmatrix(*m); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3144 |
#endif |
294 | 3145 |
%} |
3146 |
! |
|
3147 |
||
3148 |
glxMultMatrix:arrayOf16Floats in:aGLXWindowId |
|
3149 |
"argument must be an array(a matrix) of 16 floats containing a |
|
3150 |
matrix to multiply into the current matrix." |
|
3151 |
||
3152 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3153 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3154 |
#else |
294 | 3155 |
Matrix matrix; |
3156 |
Matrix *m; |
|
3157 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3158 |
if (! (m = __glx_getFloatsFromMatrixInto(arrayOf16Floats, &matrix))) RETURN (false); |
294 | 3159 |
SETWIN(aGLXWindowId) |
3160 |
multmatrix(*m); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3161 |
#endif |
294 | 3162 |
%} |
3163 |
! |
|
3164 |
||
3165 |
glxPopmatrixIn:aGLXWindowId |
|
3166 |
"pop transformation stack" |
|
3167 |
||
3168 |
%{ /* NOCONTEXT */ |
|
3169 |
SETWIN(aGLXWindowId) |
|
1932 | 3170 |
#ifdef OPENGL |
3171 |
#else |
|
294 | 3172 |
popmatrix(); |
1932 | 3173 |
#endif |
294 | 3174 |
%} |
3175 |
! |
|
3176 |
||
3177 |
glxPushmatrixIn:aGLXWindowId |
|
3178 |
"push down transformation stack" |
|
3179 |
||
3180 |
%{ /* NOCONTEXT */ |
|
3181 |
SETWIN(aGLXWindowId) |
|
1932 | 3182 |
#ifdef OPENGL |
3183 |
#else |
|
294 | 3184 |
pushmatrix(); |
1932 | 3185 |
#endif |
294 | 3186 |
%} |
3187 |
! ! |
|
3188 |
||
3189 |
!GLXWorkstation methodsFor:'misc'! |
|
3190 |
||
3191 |
glxGconfigIn:aGLXWindowId |
|
3192 |
"must be sent after RGBmode, doubleBuffer etc. to have these |
|
3193 |
changes really take effect. See GLX manual. |
|
3194 |
(Actually, it seems to be not allowed - I dont really know)" |
|
3195 |
||
3196 |
%{ /* NOCONTEXT */ |
|
3197 |
SETWIN(aGLXWindowId) |
|
1932 | 3198 |
#ifdef OPENGL |
3199 |
#else |
|
294 | 3200 |
gconfig(); |
1932 | 3201 |
#endif |
294 | 3202 |
%} |
3203 |
! |
|
3204 |
||
3205 |
glxMmode:aSymbol in:aGLXWindowId |
|
3206 |
"set matrix mode: #single, #viewing, #projection or #texture" |
|
3207 |
||
3208 |
%{ /* NOCONTEXT */ |
|
3209 |
#ifdef GLX |
|
3210 |
if (aSymbol == @symbol(single)) { |
|
3211 |
mmode(MSINGLE); |
|
3212 |
RETURN (true); |
|
3213 |
} |
|
3214 |
if (aSymbol == @symbol(viewing)) { |
|
3215 |
mmode(MVIEWING); |
|
3216 |
RETURN (true); |
|
3217 |
} |
|
3218 |
if (aSymbol == @symbol(projection)) { |
|
3219 |
mmode(MPROJECTION); |
|
3220 |
RETURN (true); |
|
3221 |
} |
|
3222 |
if (aSymbol == @symbol(texture)) { |
|
3223 |
mmode(MTEXTURE); |
|
3224 |
RETURN (true); |
|
3225 |
} |
|
3226 |
#endif |
|
3227 |
%} |
|
3228 |
. |
|
3229 |
^ false |
|
3230 |
! |
|
3231 |
||
3232 |
glxNmode:aSymbol in:aGLXWindowId |
|
3233 |
"set normalize mode: #auto, #normalize" |
|
3234 |
||
3235 |
%{ /* NOCONTEXT */ |
|
3236 |
#ifdef GLX |
|
3237 |
if (aSymbol == @symbol(auto)) { |
|
3238 |
nmode(NAUTO); |
|
3239 |
RETURN (true); |
|
3240 |
} |
|
3241 |
if (aSymbol == @symbol(normalize)) { |
|
3242 |
nmode(NNORMALIZE); |
|
3243 |
RETURN (true); |
|
3244 |
} |
|
3245 |
#endif |
|
3246 |
%} |
|
3247 |
. |
|
3248 |
^ false |
|
3249 |
! |
|
3250 |
||
3251 |
glxRGBmodeIn:aGLXWindowId |
|
3252 |
"set true color mode (no colormap)" |
|
3253 |
||
3254 |
%{ /* NOCONTEXT */ |
|
3255 |
#ifdef GLX |
|
3256 |
SETWIN(aGLXWindowId) |
|
3257 |
RGBmode(); |
|
3258 |
RETURN (true); |
|
3259 |
#endif |
|
3260 |
%} |
|
3261 |
. |
|
3262 |
^ false |
|
3263 |
! ! |
|
3264 |
||
3265 |
!GLXWorkstation methodsFor:'objects'! |
|
3266 |
||
3267 |
glxCallObject:obj in:aGLXWindowId |
|
3268 |
"perform the commands of an object (macro)." |
|
3269 |
||
2075 | 3270 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3271 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3272 |
#else |
294 | 3273 |
if (__isSmallInteger(obj)) { |
3274 |
SETWIN(aGLXWindowId) |
|
3275 |
callobj(_objectVal(obj)); |
|
3276 |
RETURN (true); |
|
3277 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3278 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3279 |
%}. |
294 | 3280 |
^ false |
3281 |
! |
|
3282 |
||
3283 |
glxCallobj: obj in: aGLXWindowId |
|
3284 |
"OBSOLETE; use glxCallObject:in: |
|
3285 |
This one will be removed soon." |
|
3286 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3287 |
self halt |
294 | 3288 |
! |
3289 |
||
3290 |
glxCloseObjectIn:aGLXWindowId |
|
3291 |
"end object defnition" |
|
3292 |
||
2075 | 3293 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3294 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3295 |
#else |
294 | 3296 |
SETWIN(aGLXWindowId) |
3297 |
closeobj(); |
|
3298 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3299 |
#endif |
294 | 3300 |
%} |
3301 |
! |
|
3302 |
||
3303 |
glxCloseobjIn:aGLXWindowId |
|
3304 |
"OBSOLETE: use glxCloseObjectIn: |
|
3305 |
This one will be removed." |
|
3306 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3307 |
self halt |
294 | 3308 |
! |
3309 |
||
3310 |
glxDeleteObject:obj in:aGLXWindowId |
|
3311 |
||
2075 | 3312 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3313 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3314 |
#else |
1882 | 3315 |
if (__isSmallInteger(obj)) { |
3316 |
SETWIN(aGLXWindowId) |
|
3317 |
delobj(_objectVal(obj)); |
|
3318 |
RETURN (true); |
|
3319 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3320 |
#endif |
294 | 3321 |
%} |
3322 |
! |
|
3323 |
||
3324 |
glxDelobj:obj in:aGLXWindowId |
|
3325 |
"OBSOLETE: use glxDeleteObject:in: |
|
3326 |
This one will be removed." |
|
3327 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3328 |
self halt |
294 | 3329 |
! |
3330 |
||
3331 |
glxGenObjectIn:aGLXWindowId |
|
3332 |
"return a new (free & unused) object id for use |
|
3333 |
with makeObj" |
|
3334 |
||
3335 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3336 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3337 |
#else |
294 | 3338 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3339 |
RETURN (__MKSMALLINT(genobj())); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3340 |
#endif |
294 | 3341 |
%} |
3342 |
! |
|
3343 |
||
3344 |
glxGenobjIn:aGLXWindowId |
|
3345 |
"OBSOLETE: use glxGenObject:in: |
|
3346 |
This one will be removed." |
|
3347 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3348 |
self halt |
294 | 3349 |
! |
3350 |
||
3351 |
glxGetopenobjIn:aGLXWindowId |
|
3352 |
"return the currently open objects id; -1 if none is open" |
|
3353 |
||
3354 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3355 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3356 |
#else |
294 | 3357 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3358 |
RETURN (__MKSMALLINT(getopenobj())); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3359 |
#endif |
294 | 3360 |
%} |
3361 |
! |
|
3362 |
||
3363 |
glxIsobj:obj in:aGLXWindowId |
|
3364 |
"return true, if obj is a valid object id" |
|
3365 |
||
3366 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3367 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3368 |
#else |
294 | 3369 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3370 |
RETURN (__MKBOOLEAN(isobj(_objectVal(obj)))); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3371 |
#endif |
294 | 3372 |
%} |
3373 |
! |
|
3374 |
||
3375 |
glxMakeObject:id in:aGLXWindowId |
|
3376 |
"start object definition - |
|
3377 |
another name conflict" |
|
3378 |
||
2075 | 3379 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3380 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3381 |
#else |
294 | 3382 |
if (__isSmallInteger(id)) { |
3383 |
SETWIN(aGLXWindowId) |
|
3384 |
makeobj(_objectVal(id)); |
|
3385 |
RETURN (true); |
|
3386 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3387 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3388 |
%}. |
294 | 3389 |
^ false |
3390 |
! |
|
3391 |
||
3392 |
glxMakeobj:obj in:aGLXWindowId |
|
3393 |
"OBSOLETE; use glxMakeObject:in: |
|
3394 |
This one will be removed soon." |
|
3395 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3396 |
self halt |
294 | 3397 |
! ! |
3398 |
||
3399 |
!GLXWorkstation methodsFor:'patches & surfaces'! |
|
3400 |
||
3401 |
glxBeginCurveIn:aGLXWindowId |
|
3402 |
"start a NURBS curve def - in real GL only" |
|
3403 |
||
3404 |
%{ /* NOCONTEXT */ |
|
1932 | 3405 |
SETWIN(aGLXWindowId) |
3406 |
#ifdef GLX |
|
294 | 3407 |
bgncurve(); |
1932 | 3408 |
#endif |
3409 |
%} |
|
294 | 3410 |
! |
3411 |
||
3412 |
glxBeginSurfaceIn:aGLXWindowId |
|
3413 |
"start a NURBS surface def - in real GL only" |
|
3414 |
||
3415 |
%{ /* NOCONTEXT */ |
|
1932 | 3416 |
SETWIN(aGLXWindowId) |
3417 |
#ifdef GLX |
|
294 | 3418 |
bgnsurface(); |
1932 | 3419 |
#endif |
3420 |
%} |
|
294 | 3421 |
! |
3422 |
||
3423 |
glxDefBasis:id mat:aMatrix in:aGLXWindowId |
|
528 | 3424 |
"define the basis matrix for a patch or curve" |
294 | 3425 |
|
3426 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3427 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3428 |
#else |
294 | 3429 |
Matrix matrix; |
3430 |
Matrix *m; |
|
3431 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3432 |
if (! (m = __glx_getFloatsFromMatrixInto(aMatrix, &matrix))) RETURN (false); |
294 | 3433 |
if (__isSmallInteger(id)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3434 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3435 |
defbasis((short)(__intVal(id)), *m); |
294 | 3436 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3437 |
#endif |
1932 | 3438 |
%} |
528 | 3439 |
|
3440 |
"Modified: 19.3.1996 / 18:52:56 / cg" |
|
294 | 3441 |
! |
3442 |
||
3443 |
glxEndCurveIn:aGLXWindowId |
|
3444 |
"end a NURBS curve def - in real GL only" |
|
3445 |
||
3446 |
%{ /* NOCONTEXT */ |
|
1932 | 3447 |
SETWIN(aGLXWindowId) |
3448 |
#ifdef GLX |
|
294 | 3449 |
endcurve(); |
1932 | 3450 |
#endif |
3451 |
%} |
|
294 | 3452 |
! |
3453 |
||
3454 |
glxEndSurfaceIn:aGLXWindowId |
|
3455 |
"end a NURBS surface def - in real GL only" |
|
3456 |
||
3457 |
%{ /* NOCONTEXT */ |
|
1932 | 3458 |
SETWIN(aGLXWindowId) |
3459 |
#ifdef GLX |
|
294 | 3460 |
endsurface(); |
1932 | 3461 |
#endif |
3462 |
%} |
|
294 | 3463 |
! |
3464 |
||
3465 |
glxNurbsSurfaceUKnotCount: uKnotCount uKnot: uKnot |
|
3466 |
vKnotCount: vKnotCount vKnot: vKnot |
|
3467 |
uOffset: uOffset vOffset: vOffset |
|
3468 |
ctlArray: ctlArray |
|
3469 |
uOrder: uOrder vOrder: vOrder |
|
3470 |
type: type in: aGLXWindowId |
|
3471 |
||
3472 |
| ctlPoints i | |
|
3473 |
ctlPoints := DoubleArray new: ctlArray size * (ctlArray first size). |
|
3474 |
i := 1. |
|
3475 |
ctlArray do: [:point | |
|
3476 |
point do: [:coord | |
|
3477 |
ctlPoints at: i put: coord. |
|
3478 |
i := i + 1]]. |
|
3479 |
||
3480 |
%{ /* NOCONTEXT */ |
|
3481 |
#ifdef GLX |
|
3482 |
char *uKnotElements, *vKnotElements, *ctlElements; |
|
3483 |
OBJ cls; |
|
3484 |
int ninstVars, nInstBytes; |
|
3485 |
||
3486 |
SETWIN(aGLXWindowId) |
|
3487 |
cls = __qClass(ctlPoints); |
|
3488 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
3489 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
|
3490 |
||
3491 |
ctlElements = (char *)(_InstPtr(ctlPoints)) + nInstBytes; |
|
3492 |
uKnotElements = (char *)(_InstPtr(uKnot)) + nInstBytes; |
|
3493 |
vKnotElements = (char *)(_InstPtr(vKnot)) + nInstBytes; |
|
3494 |
||
3495 |
nurbssurface ( |
|
3496 |
__intVal(uKnotCount), (double *)uKnotElements, |
|
3497 |
__intVal(vKnotCount), (double *)vKnotElements, |
|
3498 |
__intVal(uOffset), __intVal(vOffset), |
|
3499 |
(double *)ctlElements, |
|
3500 |
__intVal(uOrder), __intVal(vOrder), __intVal(type)); |
|
3501 |
RETURN(true); |
|
3502 |
#endif |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3503 |
%}. |
294 | 3504 |
^ false |
3505 |
! |
|
3506 |
||
3507 |
glxPatchBasisU:u v:v in:aGLXWindowId |
|
528 | 3508 |
"set the two basis matrices for a patch" |
294 | 3509 |
|
3510 |
%{ /* NOCONTEXT */ |
|
3511 |
if (__bothSmallInteger(u, v)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3512 |
SETWIN(aGLXWindowId) |
1932 | 3513 |
#ifdef OPENGL |
3514 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3515 |
patchbasis((long)__intVal(u), (long)__intVal(v)); |
1932 | 3516 |
#endif |
294 | 3517 |
} |
1932 | 3518 |
%} |
528 | 3519 |
|
3520 |
"Modified: 19.3.1996 / 18:53:18 / cg" |
|
294 | 3521 |
! |
3522 |
||
3523 |
glxPatchCurvesU:u v:v in:aGLXWindowId |
|
528 | 3524 |
"set the number of curves to be drawn in each direction on a patch" |
294 | 3525 |
|
3526 |
%{ /* NOCONTEXT */ |
|
3527 |
if (__bothSmallInteger(u, v)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3528 |
SETWIN(aGLXWindowId) |
1932 | 3529 |
#ifdef OPENGL |
3530 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3531 |
patchcurves((long)__intVal(u), (long)__intVal(v)); |
1932 | 3532 |
#endif |
294 | 3533 |
} |
1932 | 3534 |
%} |
528 | 3535 |
|
3536 |
"Modified: 19.3.1996 / 18:53:34 / cg" |
|
294 | 3537 |
! |
3538 |
||
3539 |
glxPatchPrecisionU:u v:v in:aGLXWindowId |
|
3540 |
"set the patch precision" |
|
3541 |
||
3542 |
%{ /* NOCONTEXT */ |
|
3543 |
if (__bothSmallInteger(u, v)) { |
|
3544 |
SETWIN(aGLXWindowId) |
|
1932 | 3545 |
#ifdef OPENGL |
3546 |
#else |
|
294 | 3547 |
patchprecision((long)__intVal(u), (long)__intVal(v)); |
1932 | 3548 |
#endif |
294 | 3549 |
} |
1932 | 3550 |
%} |
294 | 3551 |
! |
3552 |
||
3553 |
glxPatchX:arrayOf16XFloats y:arrayOf16YFloats z:arrayOf16ZFloats in:aGLXWindowId |
|
528 | 3554 |
"Draws a bicubic patch. |
3555 |
arguments must be arrays of 16 floats containing the patch" |
|
294 | 3556 |
|
3557 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3558 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3559 |
#else |
294 | 3560 |
Matrix matrixX, matrixY, matrixZ; |
3561 |
Matrix *mX, *mY, *mZ; |
|
3562 |
||
1932 | 3563 |
if (! (mX = __glx_getFloatsFromMatrixInto(arrayOf16XFloats, &matrixX))) |
3564 |
RETURN (nil); |
|
3565 |
if (! (mY = __glx_getFloatsFromMatrixInto(arrayOf16YFloats, &matrixY))) |
|
3566 |
RETURN (nil); |
|
3567 |
if (! (mZ = __glx_getFloatsFromMatrixInto(arrayOf16ZFloats, &matrixZ))) |
|
3568 |
RETURN (nil); |
|
294 | 3569 |
SETWIN(aGLXWindowId) |
3570 |
patch(*mX, *mY, *mZ); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3571 |
#endif |
294 | 3572 |
%} |
528 | 3573 |
|
3574 |
"Modified: 19.3.1996 / 18:54:02 / cg" |
|
3575 |
! |
|
3576 |
||
3577 |
glxRpatchX:arrayOf16XFloats y:arrayOf16YFloats z:arrayOf16ZFloats w:arrayOf16WFloats in:aGLXWindowId |
|
3578 |
"Draws a rational bicubic patch. |
|
3579 |
arguments must be arrays of 16 floats containing the patch" |
|
3580 |
||
3581 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3582 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3583 |
#else |
529 | 3584 |
Matrix matrixX, matrixY, matrixZ, matrixW; |
3585 |
Matrix *mX, *mY, *mZ, *mW; |
|
528 | 3586 |
|
1932 | 3587 |
if (! (mX = __glx_getFloatsFromMatrixInto(arrayOf16XFloats, &matrixX))) |
3588 |
RETURN (nil); |
|
3589 |
if (! (mY = __glx_getFloatsFromMatrixInto(arrayOf16YFloats, &matrixY))) |
|
3590 |
RETURN (nil); |
|
3591 |
if (! (mZ = __glx_getFloatsFromMatrixInto(arrayOf16ZFloats, &matrixZ))) |
|
3592 |
RETURN (nil); |
|
3593 |
if (! (mW = __glx_getFloatsFromMatrixInto(arrayOf16WFloats, &matrixW))) |
|
3594 |
RETURN (nil); |
|
529 | 3595 |
SETWIN(aGLXWindowId) |
3596 |
rpatch(*mX, *mY, *mZ, *mW); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3597 |
#endif |
528 | 3598 |
%} |
3599 |
||
3600 |
"Modified: 19.3.1996 / 18:54:02 / cg" |
|
3601 |
"Created: 19.3.1996 / 18:56:34 / cg" |
|
3602 |
! ! |
|
3603 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3604 |
!GLXWorkstation methodsFor:'pixel copy'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3605 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3606 |
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
|
3607 |
"copy a rectangular area in the view. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3608 |
For now, this is only supported with a true GL. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3609 |
readsource specifies which plane/buffer is affected by this operation." |
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 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3612 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3613 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3614 |
rectcopy(_screencoordVal(x1), _screencoordVal(y1), |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3615 |
_screencoordVal(x2), _screencoordVal(y2), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3616 |
_screencoordVal(newx), _screencoordVal(newy)); |
1932 | 3617 |
#endif |
3618 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3619 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3620 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3621 |
!GLXWorkstation methodsFor:'pixel reading'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3622 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3623 |
glxReadpixelsTo:dest in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3624 |
"read pixels from the view. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3625 |
Dest must be an array and gets pixel values assigned, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3626 |
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
|
3627 |
For now, pixel-reading is only supported with a true GL. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3628 |
Caveat: the number of pixels is limited to 256. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3629 |
In double buffer mode, the backBuffer is read." |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3630 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3631 |
|n| |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3632 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3633 |
n := dest size. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3634 |
n > 256 ifTrue:[^ 0]. |
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 |
%{ /* STACK:1024 */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3637 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3638 |
Colorindex buffer[256]; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3639 |
int i, nRead; |
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 |
if (__isArray(dest)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3642 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3643 |
nRead = readpixels(__intVal(n), buffer); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3644 |
for (i=0; i<nRead;i++) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3645 |
__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
|
3646 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3647 |
RETURN (__MKSMALLINT(nRead)); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3648 |
} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3649 |
#endif |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3650 |
%}. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3651 |
^ 0 |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3652 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3653 |
"Modified: 22.3.1996 / 18:08:00 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3654 |
! |
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 |
glxReadsource: src in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3657 |
"specify what is read with folowing readPixels requests. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3658 |
For now, pixel-reading is only supported with a true GL" |
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 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3661 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3662 |
OBJ s = src; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3663 |
int what; |
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 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3666 |
if (s == @symbol(auto)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3667 |
what = SRC_AUTO; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3668 |
} else if (s == @symbol(front)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3669 |
what = SRC_FRONT; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3670 |
} else if (s == @symbol(back)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3671 |
what = SRC_BACK; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3672 |
} else if (s == @symbol(zBuffer)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3673 |
what = SRC_ZBUFFER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3674 |
} else if (s == @symbol(frameGrabber)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3675 |
what = SRC_FRAMEGRABBER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3676 |
} else if (s == @symbol(over)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3677 |
what = SRC_OVER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3678 |
} else if (s == @symbol(under)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3679 |
what = SRC_UNDER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3680 |
} else if (s == @symbol(popUp)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3681 |
what = SRC_PUP; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3682 |
} else { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3683 |
what = _longVal(src); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3684 |
} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3685 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3686 |
readsource(what); |
1932 | 3687 |
#endif |
3688 |
%} |
|
538 | 3689 |
! |
3690 |
||
541 | 3691 |
glxRectreadX1:x1 y1:y1 x2:x2 y2:y2 h:viewHeight to:dest in:aGLXWindowId |
538 | 3692 |
"read pixels from a rectanglular area. |
3693 |
Dest must be an array and gets pixel values assigned, |
|
3694 |
reading n*m pixels. |
|
3695 |
For now, pixel-reading is only supported with a true GL. |
|
3696 |
Caveat: the number of pixels is limited to 256. |
|
3697 |
In double buffer mode, the backBuffer is read." |
|
3698 |
||
541 | 3699 |
|n idx sy1 sy2| |
3700 |
||
3701 |
"/ GLX's y coordinates go bottom to top ... |
|
3702 |
||
3703 |
sy1 := viewHeight - y1. |
|
3704 |
sy2 := viewHeight - y2. |
|
538 | 3705 |
|
3706 |
n := (x2 - x1 + 1) * (y2 - y1 + 1). |
|
3707 |
n > 256 ifTrue:[^ 0]. |
|
3708 |
dest size < n ifTrue:[^ 0]. |
|
3709 |
||
3710 |
%{ /* STACK:1024 */ |
|
3711 |
#ifdef GLX |
|
3712 |
Colorindex buffer[256]; |
|
3713 |
int i, nRead; |
|
3714 |
||
3715 |
if (__isArray(dest) |
|
3716 |
&& __isSmallInteger(x1) && __isSmallInteger(x2) |
|
541 | 3717 |
&& __isSmallInteger(sy1) && __isSmallInteger(sy2) |
538 | 3718 |
) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3719 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3720 |
nRead = rectread(__intVal(x1), __intVal(sy1), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3721 |
__intVal(x2), __intVal(sy2), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3722 |
buffer); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3723 |
for (i=0; i<nRead;i++) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3724 |
__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
|
3725 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3726 |
RETURN (__MKSMALLINT(nRead)); |
538 | 3727 |
} |
3728 |
#endif |
|
3729 |
%}. |
|
3730 |
"/ |
|
3731 |
"/ ok, this is not a GL - use XWorkstations pixel read method |
|
3732 |
"/ and convert |
|
3733 |
"/ |
|
3734 |
idx := 1. |
|
3735 |
y1 to:y2 do:[:y | |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3736 |
x1 to:x2 do:[:x | |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3737 |
|pix| |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3738 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3739 |
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
|
3740 |
dest at:idx put:pix |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3741 |
] |
538 | 3742 |
]. |
3743 |
^ n |
|
3744 |
||
3745 |
"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
|
3746 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3747 |
! |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3748 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3749 |
glxXColorToGLColor:pixel |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3750 |
"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
|
3751 |
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
|
3752 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3753 |
%{ /* NOCONTEXT */ |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3754 |
#ifdef VGL |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3755 |
if (__isSmallInteger(pixel)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3756 |
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
|
3757 |
} |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3758 |
#endif |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3759 |
%}. |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3760 |
^ pixel |
543
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3761 |
! |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3762 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3763 |
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
|
3764 |
"special for VGL" |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3765 |
|
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 |
#ifdef VGL |
1932 | 3768 |
if (__bothSmallInteger(x, y)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3769 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3770 |
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
|
3771 |
} |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3772 |
#endif |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3773 |
%}. |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3774 |
^ 0 |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3775 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3776 |
"Modified: 22.3.1996 / 18:08:00 / cg" |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3777 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3778 |
|
528 | 3779 |
!GLXWorkstation methodsFor:'points'! |
3780 |
||
3781 |
glxPnt2X: x y: y in: aGLXWindowId |
|
3782 |
"plot a point in x, y, 0." |
|
3783 |
||
3784 |
%{ /* NOCONTEXT */ |
|
3785 |
Coord c_x, c_y; |
|
3786 |
||
3787 |
_COORD_ (x, c_x) |
|
3788 |
_COORD_ (y, c_y) |
|
3789 |
SETWIN(aGLXWindowId) |
|
1932 | 3790 |
#ifdef OPENGL |
3791 |
#else |
|
528 | 3792 |
pnt2(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3793 |
#endif |
528 | 3794 |
%} |
3795 |
||
3796 |
"Modified: 19.3.1996 / 18:35:55 / cg" |
|
3797 |
! |
|
3798 |
||
3799 |
glxPnt2iX: x y: y in: aGLXWindowId |
|
3800 |
"plot a point in x, y, 0." |
|
3801 |
||
3802 |
%{ /* NOCONTEXT */ |
|
3803 |
Icoord c_x, c_y; |
|
3804 |
||
3805 |
_ICOORD_ (x, c_x) |
|
3806 |
_ICOORD_ (y, c_y) |
|
3807 |
SETWIN(aGLXWindowId) |
|
1932 | 3808 |
#ifdef OPENGL |
3809 |
#else |
|
528 | 3810 |
pnt2i(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3811 |
#endif |
528 | 3812 |
%} |
3813 |
||
3814 |
"Modified: 19.3.1996 / 18:35:59 / cg" |
|
3815 |
! |
|
3816 |
||
3817 |
glxPnt2sX: x y: y in: aGLXWindowId |
|
3818 |
"plot a point in x, y, 0." |
|
3819 |
||
3820 |
%{ /* NOCONTEXT */ |
|
3821 |
Scoord c_x, c_y; |
|
3822 |
||
3823 |
_SCOORD_ (x, c_x) |
|
3824 |
_SCOORD_ (y, c_y) |
|
3825 |
SETWIN(aGLXWindowId) |
|
1932 | 3826 |
#ifdef OPENGL |
3827 |
#else |
|
528 | 3828 |
pnt2s(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3829 |
#endif |
528 | 3830 |
%} |
3831 |
||
3832 |
"Modified: 19.3.1996 / 18:36:03 / cg" |
|
3833 |
! |
|
3834 |
||
3835 |
glxPntX: x y: y z: z in: aGLXWindowId |
|
3836 |
"plot a point in x, y, z." |
|
3837 |
||
3838 |
%{ /* NOCONTEXT */ |
|
3839 |
Coord c_x, c_y, c_z; |
|
3840 |
||
3841 |
_COORD_ (x, c_x) |
|
3842 |
_COORD_ (y, c_y) |
|
3843 |
_COORD_ (z, c_z) |
|
3844 |
SETWIN(aGLXWindowId) |
|
1932 | 3845 |
#ifdef OPENGL |
3846 |
#else |
|
528 | 3847 |
pnt(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3848 |
#endif |
528 | 3849 |
%} |
3850 |
||
3851 |
"Modified: 19.3.1996 / 18:36:08 / cg" |
|
3852 |
! |
|
3853 |
||
3854 |
glxPntiX: x y: y z: z in: aGLXWindowId |
|
3855 |
"plot a point in x, y, z." |
|
3856 |
||
3857 |
%{ /* NOCONTEXT */ |
|
3858 |
Icoord c_x, c_y, c_z; |
|
3859 |
||
3860 |
_ICOORD_ (x, c_x) |
|
3861 |
_ICOORD_ (y, c_y) |
|
3862 |
_ICOORD_ (z, c_z) |
|
3863 |
SETWIN(aGLXWindowId) |
|
1932 | 3864 |
#ifdef OPENGL |
3865 |
#else |
|
528 | 3866 |
pnti(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3867 |
#endif |
528 | 3868 |
%} |
3869 |
||
3870 |
"Modified: 19.3.1996 / 18:36:14 / cg" |
|
3871 |
! |
|
3872 |
||
3873 |
glxPntsX: x y: y z: z in: aGLXWindowId |
|
3874 |
"plot a point in x, y, z." |
|
3875 |
||
3876 |
%{ /* NOCONTEXT */ |
|
3877 |
Scoord c_x, c_y, c_z; |
|
3878 |
||
3879 |
_SCOORD_ (x, c_x) |
|
3880 |
_SCOORD_ (y, c_y) |
|
3881 |
_SCOORD_ (z, c_z) |
|
3882 |
SETWIN(aGLXWindowId) |
|
1932 | 3883 |
#ifdef OPENGL |
3884 |
#else |
|
528 | 3885 |
pnts(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3886 |
#endif |
528 | 3887 |
%} |
3888 |
||
3889 |
"Modified: 19.3.1996 / 18:36:17 / cg" |
|
3890 |
! |
|
3891 |
||
3892 |
glxPntsize: n in: aGLXWindowId |
|
3893 |
||
3894 |
%{ /* NOCONTEXT */ |
|
1932 | 3895 |
SETWIN(aGLXWindowId) |
3896 |
#ifdef GLX |
|
528 | 3897 |
pntsize(_shortVal(n)); |
1932 | 3898 |
#endif |
3899 |
%} |
|
528 | 3900 |
! |
3901 |
||
3902 |
glxPntsizef: n in: aGLXWindowId |
|
3903 |
||
3904 |
%{ /* NOCONTEXT */ |
|
1932 | 3905 |
SETWIN(aGLXWindowId) |
3906 |
#ifdef GLX |
|
528 | 3907 |
pntsizef(_floatVal(n)); |
1932 | 3908 |
#endif |
3909 |
%} |
|
528 | 3910 |
! ! |
3911 |
||
3912 |
!GLXWorkstation methodsFor:'polygons'! |
|
3913 |
||
3914 |
glxBackface: b in: aGLXWindowId |
|
3915 |
"enable/disable culling of backfacing polygons (suppress its drawing). |
|
3916 |
A polygon is backfacing if it's orientation in *screen* coords is clockwise" |
|
3917 |
||
3918 |
%{ /* NOCONTEXT */ |
|
3919 |
SETWIN(aGLXWindowId) |
|
1932 | 3920 |
#ifdef OPENGL |
3921 |
#else |
|
528 | 3922 |
backface(_booleanVal(b)); |
1932 | 3923 |
#endif |
528 | 3924 |
%} |
3925 |
||
3926 |
"Modified: 19.3.1996 / 18:26:50 / cg" |
|
3927 |
! |
|
3928 |
||
3929 |
glxConcave: b in: aGLXWindowId |
|
3930 |
"signal wether or not polygons are concave" |
|
3931 |
||
3932 |
%{ /* NOCONTEXT */ |
|
3933 |
SETWIN(aGLXWindowId) |
|
1932 | 3934 |
#ifdef OPENGL |
3935 |
#else |
|
528 | 3936 |
concave(_booleanVal(b)); |
1932 | 3937 |
#endif |
528 | 3938 |
%} |
3939 |
! |
|
3940 |
||
3941 |
glxFrontface: b in: aGLXWindowId |
|
3942 |
"enable/disable culling of frontfacing polygons (suppress its drawing). |
|
3943 |
A polygon is frontfacing if it's orientation in *screen* coords is |
|
3944 |
anti-clockwise" |
|
3945 |
||
3946 |
||
3947 |
%{ /* NOCONTEXT */ |
|
3948 |
SETWIN(aGLXWindowId) |
|
1932 | 3949 |
#ifdef OPENGL |
3950 |
#else |
|
528 | 3951 |
frontface(_booleanVal(b)); |
1932 | 3952 |
#endif |
3953 |
%} |
|
528 | 3954 |
! |
3955 |
||
3956 |
glxPdr2X: x y: y in: aGLXWindowId |
|
3957 |
"add another vertex to the polygon" |
|
3958 |
||
3959 |
%{ /* NOCONTEXT */ |
|
3960 |
Coord c_x, c_y; |
|
3961 |
||
3962 |
_COORD_ (x, c_x) |
|
3963 |
_COORD_ (y, c_y) |
|
3964 |
SETWIN(aGLXWindowId) |
|
1932 | 3965 |
#ifdef OPENGL |
3966 |
#else |
|
528 | 3967 |
pdr2(c_x, c_y); |
1932 | 3968 |
#endif |
3969 |
%} |
|
528 | 3970 |
! |
3971 |
||
3972 |
glxPdr2iX: x y: y in: aGLXWindowId |
|
3973 |
"add another vertex to the polygon" |
|
3974 |
||
3975 |
%{ /* NOCONTEXT */ |
|
3976 |
Icoord c_x, c_y; |
|
3977 |
||
3978 |
_ICOORD_ (x, c_x) |
|
3979 |
_ICOORD_ (y, c_y) |
|
3980 |
SETWIN(aGLXWindowId) |
|
1932 | 3981 |
#ifdef OPENGL |
3982 |
#else |
|
528 | 3983 |
pdr2i(c_x, c_y); |
1932 | 3984 |
#endif |
528 | 3985 |
%} |
3986 |
||
3987 |
"Modified: 19.3.1996 / 18:33:28 / cg" |
|
3988 |
! |
|
3989 |
||
3990 |
glxPdr2sX: x y: y in: aGLXWindowId |
|
3991 |
"add another vertex to the polygon" |
|
3992 |
||
3993 |
%{ /* NOCONTEXT */ |
|
3994 |
Scoord c_x, c_y; |
|
3995 |
||
3996 |
_SCOORD_ (x, c_x) |
|
3997 |
_SCOORD_ (y, c_y) |
|
3998 |
SETWIN(aGLXWindowId) |
|
1932 | 3999 |
#ifdef OPENGL |
4000 |
#else |
|
528 | 4001 |
pdr2s(c_x, c_y); |
1932 | 4002 |
#endif |
528 | 4003 |
%} |
4004 |
||
4005 |
"Modified: 19.3.1996 / 18:34:03 / cg" |
|
4006 |
! |
|
4007 |
||
4008 |
glxPdrX: x y: y z: z in: aGLXWindowId |
|
4009 |
"add another vertex to the polygon" |
|
4010 |
||
4011 |
%{ /* NOCONTEXT */ |
|
4012 |
Coord c_x, c_y, c_z; |
|
4013 |
||
4014 |
_COORD_ (x, c_x) |
|
4015 |
_COORD_ (y, c_y) |
|
4016 |
_COORD_ (z, c_z) |
|
4017 |
SETWIN(aGLXWindowId) |
|
1932 | 4018 |
#ifdef OPENGL |
4019 |
#else |
|
528 | 4020 |
pdr(c_x, c_y, c_z); |
1932 | 4021 |
#endif |
528 | 4022 |
%} |
4023 |
||
4024 |
"Modified: 19.3.1996 / 18:34:06 / cg" |
|
4025 |
! |
|
4026 |
||
4027 |
glxPdriX: x y: y z: z in: aGLXWindowId |
|
4028 |
"add another vertex to the polygon" |
|
4029 |
||
4030 |
%{ /* NOCONTEXT */ |
|
4031 |
Icoord c_x, c_y, c_z; |
|
4032 |
||
4033 |
_ICOORD_ (x, c_x) |
|
4034 |
_ICOORD_ (y, c_y) |
|
4035 |
_ICOORD_ (z, c_z) |
|
4036 |
SETWIN(aGLXWindowId) |
|
1932 | 4037 |
#ifdef OPENGL |
4038 |
#else |
|
528 | 4039 |
pdri(c_x, c_y, c_z); |
1932 | 4040 |
#endif |
528 | 4041 |
%} |
4042 |
||
4043 |
"Modified: 19.3.1996 / 18:34:11 / cg" |
|
4044 |
! |
|
4045 |
||
4046 |
glxPdrsX: x y: y z: z in: aGLXWindowId |
|
4047 |
"add another vertex to the polygon" |
|
4048 |
||
4049 |
%{ /* NOCONTEXT */ |
|
4050 |
Scoord c_x, c_y, c_z; |
|
4051 |
||
4052 |
_SCOORD_ (x, c_x) |
|
4053 |
_SCOORD_ (y, c_y) |
|
4054 |
_SCOORD_ (z, c_z) |
|
4055 |
SETWIN(aGLXWindowId) |
|
1932 | 4056 |
#ifdef OPENGL |
4057 |
#else |
|
528 | 4058 |
pdrs(c_x, c_y, c_z); |
1932 | 4059 |
#endif |
528 | 4060 |
%} |
4061 |
||
4062 |
"Modified: 19.3.1996 / 18:34:14 / cg" |
|
4063 |
! |
|
4064 |
||
4065 |
glxPmv2X: x y: y in: aGLXWindowId |
|
4066 |
"set the start position of a polygon" |
|
4067 |
||
4068 |
%{ /* NOCONTEXT */ |
|
4069 |
Coord c_x, c_y; |
|
4070 |
||
4071 |
_COORD_ (x, c_x) |
|
4072 |
_COORD_ (y, c_y) |
|
4073 |
SETWIN(aGLXWindowId) |
|
1932 | 4074 |
#ifdef OPENGL |
4075 |
#else |
|
528 | 4076 |
pmv2(c_x, c_y); |
1932 | 4077 |
#endif |
528 | 4078 |
%} |
4079 |
||
4080 |
"Modified: 19.3.1996 / 18:32:45 / cg" |
|
4081 |
! |
|
4082 |
||
4083 |
glxPmv2iX: x y: y in: aGLXWindowId |
|
4084 |
"set the start position of a polygon" |
|
4085 |
||
4086 |
%{ /* NOCONTEXT */ |
|
4087 |
Icoord c_x, c_y; |
|
4088 |
||
4089 |
_ICOORD_ (x, c_x) |
|
4090 |
_ICOORD_ (y, c_y) |
|
4091 |
SETWIN(aGLXWindowId) |
|
1932 | 4092 |
#ifdef OPENGL |
4093 |
#else |
|
528 | 4094 |
pmv2i(c_x, c_y); |
1932 | 4095 |
#endif |
528 | 4096 |
%} |
4097 |
||
4098 |
"Modified: 19.3.1996 / 18:32:42 / cg" |
|
4099 |
! |
|
4100 |
||
4101 |
glxPmv2sX: x y: y in: aGLXWindowId |
|
4102 |
"set the start position of a polygon" |
|
4103 |
||
4104 |
%{ /* NOCONTEXT */ |
|
4105 |
Scoord c_x, c_y; |
|
4106 |
||
4107 |
_SCOORD_ (x, c_x) |
|
4108 |
_SCOORD_ (y, c_y) |
|
4109 |
SETWIN(aGLXWindowId) |
|
1932 | 4110 |
#ifdef OPENGL |
4111 |
#else |
|
528 | 4112 |
pmv2s(c_x, c_y); |
1932 | 4113 |
#endif |
528 | 4114 |
%} |
4115 |
||
4116 |
"Modified: 19.3.1996 / 18:32:38 / cg" |
|
4117 |
! |
|
4118 |
||
4119 |
glxPmvX: x y: y z: z in: aGLXWindowId |
|
4120 |
"set the start position of a polygon" |
|
4121 |
||
4122 |
%{ /* NOCONTEXT */ |
|
4123 |
Coord c_x, c_y, c_z; |
|
4124 |
||
4125 |
_COORD_ (x, c_x) |
|
4126 |
_COORD_ (y, c_y) |
|
4127 |
_COORD_ (z, c_z) |
|
4128 |
SETWIN(aGLXWindowId) |
|
1932 | 4129 |
#ifdef OPENGL |
4130 |
#else |
|
528 | 4131 |
pmv(c_x, c_y, c_z); |
1932 | 4132 |
#endif |
528 | 4133 |
%} |
4134 |
||
4135 |
"Modified: 19.3.1996 / 18:31:52 / cg" |
|
4136 |
! |
|
4137 |
||
4138 |
glxPmviX: x y: y z: z in: aGLXWindowId |
|
4139 |
"set the start position of a polygon" |
|
4140 |
||
4141 |
%{ /* NOCONTEXT */ |
|
4142 |
Icoord c_x, c_y, c_z; |
|
4143 |
||
4144 |
_ICOORD_ (x, c_x) |
|
4145 |
_ICOORD_ (y, c_y) |
|
4146 |
_ICOORD_ (z, c_z) |
|
4147 |
SETWIN(aGLXWindowId) |
|
1932 | 4148 |
#ifdef OPENGL |
4149 |
#else |
|
528 | 4150 |
pmvi(c_x, c_y, c_z); |
1932 | 4151 |
#endif |
528 | 4152 |
%} |
4153 |
||
4154 |
"Modified: 19.3.1996 / 18:31:59 / cg" |
|
4155 |
! |
|
4156 |
||
4157 |
glxPmvsX: x y: y z: z in: aGLXWindowId |
|
4158 |
"set the start position of a polygon" |
|
4159 |
||
4160 |
%{ /* NOCONTEXT */ |
|
4161 |
Scoord c_x, c_y, c_z; |
|
4162 |
||
4163 |
_SCOORD_ (x, c_x) |
|
4164 |
_SCOORD_ (y, c_y) |
|
4165 |
_SCOORD_ (z, c_z) |
|
4166 |
SETWIN(aGLXWindowId) |
|
1932 | 4167 |
#ifdef OPENGL |
4168 |
#else |
|
528 | 4169 |
pmvs(c_x, c_y, c_z); |
1932 | 4170 |
#endif |
528 | 4171 |
%} |
4172 |
||
4173 |
"Modified: 19.3.1996 / 18:32:03 / cg" |
|
4174 |
! |
|
4175 |
||
4176 |
glxPolymode: mode in: aGLXWindowId |
|
4177 |
"Sets the polygon filling mode - only filled (1) or outlined (0) |
|
4178 |
are supported" |
|
4179 |
||
4180 |
%{ /* NOCONTEXT */ |
|
4181 |
SETWIN(aGLXWindowId) |
|
1932 | 4182 |
#ifdef OPENGL |
4183 |
#else |
|
528 | 4184 |
polymode(_longVal(mode)); |
1932 | 4185 |
#endif |
528 | 4186 |
%} |
4187 |
||
4188 |
"Modified: 19.3.1996 / 18:29:32 / cg" |
|
4189 |
! |
|
4190 |
||
4191 |
glxRpdr2X: x y: y in: aGLXWindowId |
|
4192 |
"add another relative vertex to the polygon" |
|
4193 |
||
4194 |
%{ /* NOCONTEXT */ |
|
4195 |
Coord c_x, c_y; |
|
4196 |
||
4197 |
_COORD_ (x, c_x) |
|
4198 |
_COORD_ (y, c_y) |
|
4199 |
SETWIN(aGLXWindowId) |
|
1932 | 4200 |
#ifdef OPENGL |
4201 |
#else |
|
528 | 4202 |
rpdr2(c_x, c_y); |
1932 | 4203 |
#endif |
528 | 4204 |
%} |
4205 |
||
4206 |
"Modified: 19.3.1996 / 18:34:31 / cg" |
|
4207 |
! |
|
4208 |
||
4209 |
glxRpdr2iX: x y: y in: aGLXWindowId |
|
4210 |
"add another relative vertex to the polygon" |
|
4211 |
||
4212 |
%{ /* NOCONTEXT */ |
|
4213 |
Icoord c_x, c_y; |
|
4214 |
||
4215 |
_ICOORD_ (x, c_x) |
|
4216 |
_ICOORD_ (y, c_y) |
|
4217 |
SETWIN(aGLXWindowId) |
|
1932 | 4218 |
#ifdef OPENGL |
4219 |
#else |
|
528 | 4220 |
rpdr2i(c_x, c_y); |
1932 | 4221 |
#endif |
528 | 4222 |
%} |
4223 |
||
4224 |
"Modified: 19.3.1996 / 18:34:36 / cg" |
|
4225 |
! |
|
4226 |
||
4227 |
glxRpdr2sX: x y: y in: aGLXWindowId |
|
4228 |
"add another relative vertex to the polygon" |
|
4229 |
||
4230 |
%{ /* NOCONTEXT */ |
|
4231 |
Scoord c_x, c_y; |
|
4232 |
||
4233 |
_SCOORD_ (x, c_x) |
|
4234 |
_SCOORD_ (y, c_y) |
|
4235 |
SETWIN(aGLXWindowId) |
|
1932 | 4236 |
#ifdef OPENGL |
4237 |
#else |
|
528 | 4238 |
rpdr2s(c_x, c_y); |
1932 | 4239 |
#endif |
528 | 4240 |
%} |
4241 |
||
4242 |
"Modified: 19.3.1996 / 18:34:40 / cg" |
|
4243 |
! |
|
4244 |
||
4245 |
glxRpdrX: x y: y z: z in: aGLXWindowId |
|
4246 |
"add another relative vertex to the polygon" |
|
4247 |
||
4248 |
%{ /* NOCONTEXT */ |
|
4249 |
Coord c_x, c_y, c_z; |
|
4250 |
||
4251 |
_COORD_ (x, c_x) |
|
4252 |
_COORD_ (y, c_y) |
|
4253 |
_COORD_ (z, c_z) |
|
4254 |
SETWIN(aGLXWindowId) |
|
1932 | 4255 |
#ifdef OPENGL |
4256 |
#else |
|
528 | 4257 |
rpdr(c_x, c_y, c_z); |
1932 | 4258 |
#endif |
528 | 4259 |
%} |
4260 |
||
4261 |
"Modified: 19.3.1996 / 18:34:48 / cg" |
|
4262 |
! |
|
4263 |
||
4264 |
glxRpdriX: x y: y z: z in: aGLXWindowId |
|
4265 |
"add another relative vertex to the polygon" |
|
4266 |
||
4267 |
%{ /* NOCONTEXT */ |
|
4268 |
Icoord c_x, c_y, c_z; |
|
4269 |
||
4270 |
_ICOORD_ (x, c_x) |
|
4271 |
_ICOORD_ (y, c_y) |
|
4272 |
_ICOORD_ (z, c_z) |
|
4273 |
SETWIN(aGLXWindowId) |
|
1932 | 4274 |
#ifdef OPENGL |
4275 |
#else |
|
528 | 4276 |
rpdri(c_x, c_y, c_z); |
1932 | 4277 |
#endif |
528 | 4278 |
%} |
4279 |
||
4280 |
"Modified: 19.3.1996 / 18:34:51 / cg" |
|
4281 |
! |
|
4282 |
||
4283 |
glxRpdrsX: x y: y z: z in: aGLXWindowId |
|
4284 |
"add another relative vertex to the polygon" |
|
4285 |
||
4286 |
%{ /* NOCONTEXT */ |
|
4287 |
Scoord c_x, c_y, c_z; |
|
4288 |
||
4289 |
_SCOORD_ (x, c_x) |
|
4290 |
_SCOORD_ (y, c_y) |
|
4291 |
_SCOORD_ (z, c_z) |
|
4292 |
SETWIN(aGLXWindowId) |
|
1932 | 4293 |
#ifdef OPENGL |
4294 |
#else |
|
528 | 4295 |
rpdrs(c_x, c_y, c_z); |
1932 | 4296 |
#endif |
528 | 4297 |
%} |
4298 |
||
4299 |
"Modified: 19.3.1996 / 18:34:55 / cg" |
|
4300 |
! |
|
4301 |
||
4302 |
glxRpmv2X: x y: y in: aGLXWindowId |
|
4303 |
"set the start position of a polygon" |
|
4304 |
||
4305 |
%{ /* NOCONTEXT */ |
|
4306 |
Coord c_x, c_y; |
|
4307 |
||
4308 |
_COORD_ (x, c_x) |
|
4309 |
_COORD_ (y, c_y) |
|
4310 |
SETWIN(aGLXWindowId) |
|
1932 | 4311 |
#ifdef OPENGL |
4312 |
#else |
|
528 | 4313 |
rpmv2(c_x, c_y); |
1932 | 4314 |
#endif |
528 | 4315 |
%} |
4316 |
||
4317 |
"Modified: 19.3.1996 / 18:37:15 / cg" |
|
4318 |
! |
|
4319 |
||
4320 |
glxRpmv2iX: x y: y in: aGLXWindowId |
|
4321 |
"set the start position of a polygon" |
|
4322 |
||
4323 |
%{ /* NOCONTEXT */ |
|
4324 |
Icoord c_x, c_y; |
|
4325 |
||
4326 |
_ICOORD_ (x, c_x) |
|
4327 |
_ICOORD_ (y, c_y) |
|
4328 |
SETWIN(aGLXWindowId) |
|
1932 | 4329 |
#ifdef OPENGL |
4330 |
#else |
|
528 | 4331 |
rpmv2i(c_x, c_y); |
1932 | 4332 |
#endif |
528 | 4333 |
%} |
4334 |
||
4335 |
"Modified: 19.3.1996 / 18:37:20 / cg" |
|
4336 |
! |
|
4337 |
||
4338 |
glxRpmv2sX: x y: y in: aGLXWindowId |
|
4339 |
"set the relative start position of a polygon" |
|
4340 |
||
4341 |
%{ /* NOCONTEXT */ |
|
4342 |
Scoord c_x, c_y; |
|
4343 |
||
4344 |
_SCOORD_ (x, c_x) |
|
4345 |
_SCOORD_ (y, c_y) |
|
4346 |
SETWIN(aGLXWindowId) |
|
1932 | 4347 |
#ifdef OPENGL |
4348 |
#else |
|
528 | 4349 |
rpmv2s(c_x, c_y); |
1932 | 4350 |
#endif |
528 | 4351 |
%} |
4352 |
||
4353 |
"Modified: 19.3.1996 / 18:38:06 / cg" |
|
4354 |
! |
|
4355 |
||
4356 |
glxRpmvX: x y: y z: z in: aGLXWindowId |
|
4357 |
"set the relative start position of a polygon" |
|
4358 |
||
4359 |
%{ /* NOCONTEXT */ |
|
4360 |
Coord c_x, c_y, c_z; |
|
4361 |
||
4362 |
_COORD_ (x, c_x) |
|
4363 |
_COORD_ (y, c_y) |
|
4364 |
_COORD_ (z, c_z) |
|
4365 |
SETWIN(aGLXWindowId) |
|
1932 | 4366 |
#ifdef OPENGL |
4367 |
#else |
|
528 | 4368 |
rpmv(c_x, c_y, c_z); |
1932 | 4369 |
#endif |
528 | 4370 |
%} |
4371 |
||
4372 |
"Modified: 19.3.1996 / 18:38:03 / cg" |
|
4373 |
! |
|
4374 |
||
4375 |
glxRpmviX: x y: y z: z in: aGLXWindowId |
|
4376 |
"set the relative start position of a polygon" |
|
4377 |
||
4378 |
%{ /* NOCONTEXT */ |
|
4379 |
Icoord c_x, c_y, c_z; |
|
4380 |
||
4381 |
_ICOORD_ (x, c_x) |
|
4382 |
_ICOORD_ (y, c_y) |
|
4383 |
_ICOORD_ (z, c_z) |
|
4384 |
SETWIN(aGLXWindowId) |
|
1932 | 4385 |
#ifdef OPENGL |
4386 |
#else |
|
528 | 4387 |
rpmvi(c_x, c_y, c_z); |
1932 | 4388 |
#endif |
528 | 4389 |
%} |
4390 |
||
4391 |
"Modified: 19.3.1996 / 18:37:53 / cg" |
|
4392 |
! |
|
4393 |
||
4394 |
glxRpmvsX: x y: y z: z in: aGLXWindowId |
|
4395 |
"set the relative start position of a polygon" |
|
4396 |
||
4397 |
%{ /* NOCONTEXT */ |
|
4398 |
Scoord c_x, c_y, c_z; |
|
4399 |
||
4400 |
_SCOORD_ (x, c_x) |
|
4401 |
_SCOORD_ (y, c_y) |
|
4402 |
_SCOORD_ (z, c_z) |
|
4403 |
SETWIN(aGLXWindowId) |
|
1932 | 4404 |
#ifdef OPENGL |
4405 |
#else |
|
528 | 4406 |
rpmvs(c_x, c_y, c_z); |
1932 | 4407 |
#endif |
528 | 4408 |
%} |
4409 |
||
4410 |
"Modified: 19.3.1996 / 18:37:58 / cg" |
|
294 | 4411 |
! ! |
4412 |
||
24 | 4413 |
!GLXWorkstation methodsFor:'queries'! |
4414 |
||
159 | 4415 |
glVersion |
4416 |
"return a string describing the GL version. |
|
4417 |
For informative use only; portable applications do not depend |
|
4418 |
on the returned string." |
|
4419 |
||
4420 |
%{ /* NOCONTEXT */ |
|
4421 |
#ifdef VGL |
|
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
4422 |
RETURN (__MKSTRING("vogl")); |
159 | 4423 |
#else |
1932 | 4424 |
# ifdef GLX |
159 | 4425 |
char buffer[128]; |
4426 |
||
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4427 |
if (_INST(glOK) == true) { |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4428 |
gversion(buffer); |
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
4429 |
RETURN (__MKSTRING(buffer)); |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4430 |
} |
1932 | 4431 |
RETURN (nil); |
4432 |
# else |
|
4433 |
RETURN (nil); |
|
4434 |
# endif |
|
159 | 4435 |
#endif |
4436 |
%} |
|
4437 |
||
4438 |
" |
|
4439 |
Display glVersion |
|
4440 |
" |
|
4441 |
! |
|
4442 |
||
528 | 4443 |
glxGetplanesIn: aGLXWindowId |
4444 |
"Returns the number if bit planes available on the device." |
|
4445 |
||
4446 |
%{ /* NOCONTEXT */ |
|
1932 | 4447 |
SETWIN(aGLXWindowId) |
4448 |
#ifdef OPENGL |
|
4449 |
#else |
|
528 | 4450 |
RETURN (__MKSMALLINT(getplanes())); |
4451 |
#endif |
|
1932 | 4452 |
%}. |
4453 |
^ 0 |
|
528 | 4454 |
|
4455 |
"Modified: 19.3.1996 / 18:50:44 / cg" |
|
4456 |
! |
|
4457 |
||
294 | 4458 |
hasStereoExtension |
4459 |
"return true, if this workstation supports stereo GL drawing. |
|
4460 |
Both the server must support it, and the feature must have been |
|
4461 |
enabled in the smalltalk system, for true to be returned." |
|
4462 |
||
4463 |
^ hasStereoExtension |
|
4464 |
||
4465 |
" |
|
4466 |
Display hasStereoExtension |
|
4467 |
" |
|
4468 |
! |
|
4469 |
||
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4470 |
isTrueGL |
1932 | 4471 |
"return true, if this is a true GL (as opposed to a simulated VOGL). |
4472 |
Returns false for all openGL systems." |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4473 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4474 |
%{ /* NOCONTEXT */ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4475 |
#ifdef VGL |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4476 |
RETURN ( false ); |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4477 |
#else |
1932 | 4478 |
# ifdef GLX |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4479 |
RETURN ( true ); |
1932 | 4480 |
# else |
4481 |
RETURN (false); |
|
4482 |
# endif |
|
4483 |
#endif |
|
4484 |
%} |
|
4485 |
! |
|
4486 |
||
4487 |
isOpenGL |
|
4488 |
"return true, if this is an openGL (as opposed to a GL)" |
|
4489 |
||
4490 |
%{ /* NOCONTEXT */ |
|
4491 |
#ifdef OPENGL |
|
4492 |
RETURN ( true ); |
|
4493 |
#else |
|
4494 |
RETURN ( false ); |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4495 |
#endif |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4496 |
%} |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4497 |
! |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4498 |
|
294 | 4499 |
maxZValue |
4500 |
"return the max. Z value (only valid if z-buffer is supported)" |
|
4501 |
%{ |
|
1932 | 4502 |
#ifndef OPENGL |
4503 |
# ifdef GD_ZMAX |
|
294 | 4504 |
long zMax; |
4505 |
||
4506 |
if (_INST(glOK) == true) { |
|
4507 |
zMax = getgdesc(GD_ZMAX); |
|
4508 |
||
4509 |
if ((zMax >= _MIN_INT) && (zMax <= _MAX_INT)) { |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4510 |
RETURN ( __MKSMALLINT(zMax) ); |
294 | 4511 |
} |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4512 |
RETURN ( __MKLARGEINT(zMax) ); |
294 | 4513 |
} |
1932 | 4514 |
# endif |
294 | 4515 |
#endif |
4516 |
%}. |
|
4517 |
^ nil |
|
4518 |
! |
|
4519 |
||
4520 |
supportsDoubleBuffer |
|
4521 |
"return true, if this gl workstation supports double buffering. |
|
157 | 4522 |
For portable applications, always combine this with a query |
4523 |
if the display supports GL drawing at all." |
|
24 | 4524 |
|
4525 |
%{ /* NOCONTEXT */ |
|
294 | 4526 |
|
1932 | 4527 |
#ifndef OPENGL |
4528 |
# ifdef VGL |
|
4529 |
RETURN (true); |
|
4530 |
# else |
|
4531 |
# ifdef GD_BITS_NORM_DBL_RED |
|
294 | 4532 |
if (getgdesc(GD_BITS_NORM_DBL_RED) != 0) { |
4533 |
RETURN ( _INST(glOK) ); |
|
4534 |
} |
|
1932 | 4535 |
# endif |
4536 |
# endif |
|
24 | 4537 |
#endif |
89 | 4538 |
%}. |
4539 |
^ false |
|
4540 |
||
4541 |
" |
|
294 | 4542 |
Display supportsDoubleBuffer |
4543 |
" |
|
4544 |
! |
|
4545 |
||
4546 |
supportsGLDrawing |
|
4547 |
"return true, if this device supports 3D GL drawing." |
|
4548 |
||
4549 |
^ glOK |
|
4550 |
||
4551 |
" |
|
4552 |
Display supportsGLDrawing |
|
89 | 4553 |
" |
64 | 4554 |
! |
4555 |
||
4556 |
supportsLight |
|
157 | 4557 |
"return true, if this gl workstation supports light sources |
4558 |
(i.e. if its a real GL). |
|
4559 |
For portable applications, always combine this with a query |
|
4560 |
if the display supports GL drawing at all." |
|
89 | 4561 |
|
4562 |
%{ /* NOCONTEXT */ |
|
64 | 4563 |
#ifdef GLX |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4564 |
RETURN ( _INST(glOK) ); |
64 | 4565 |
#endif |
89 | 4566 |
%}. |
4567 |
^ false |
|
4568 |
||
4569 |
" |
|
4570 |
Display supportsLight |
|
4571 |
" |
|
4572 |
! |
|
4573 |
||
294 | 4574 |
supportsRGB |
4575 |
"return true, if this gl workstation supports rgb |
|
4576 |
(in addition to indexed) colors. Actually, we return true |
|
4577 |
for a real GL engine, false for the simulator here. |
|
4578 |
For portable applications, always combine this with a query |
|
4579 |
if the display supports GL drawing at all." |
|
4580 |
||
4581 |
%{ /* NOCONTEXT */ |
|
4582 |
#ifdef GLX |
|
4583 |
RETURN ( _INST(glOK) ); |
|
4584 |
#endif |
|
4585 |
%}. |
|
4586 |
^ false |
|
4587 |
||
4588 |
" |
|
4589 |
Display supportsRGB |
|
4590 |
" |
|
4591 |
! |
|
4592 |
||
89 | 4593 |
supportsTextures |
4594 |
"return true, if this gl workstation supports texture mapping |
|
157 | 4595 |
(i.e. if its a real GL). |
4596 |
For portable applications, always combine this with a query |
|
4597 |
if the display supports GL drawing at all." |
|
89 | 4598 |
|
4599 |
%{ /* NOCONTEXT */ |
|
1932 | 4600 |
#ifndef OPENGL |
4601 |
# ifdef GD_TEXTURE |
|
89 | 4602 |
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
|
4603 |
RETURN ( _INST(glOK) ); |
89 | 4604 |
} |
1932 | 4605 |
# endif |
89 | 4606 |
#endif |
4607 |
%}. |
|
4608 |
^ false |
|
4609 |
||
4610 |
" |
|
4611 |
Display supportsTextures |
|
4612 |
" |
|
4613 |
! |
|
4614 |
||
4615 |
supportsZBuffer |
|
157 | 4616 |
"return true, if this gl workstation has z buffer support. |
4617 |
For portable applications, always combine this with a query |
|
4618 |
if the display supports GL drawing at all." |
|
4619 |
||
89 | 4620 |
%{ /* NOCONTEXT */ |
4621 |
||
1932 | 4622 |
#ifndef OPENGL |
4623 |
# ifdef GD_BITS_NORM_ZBUFFER |
|
89 | 4624 |
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
|
4625 |
RETURN ( _INST(glOK) ); |
89 | 4626 |
} |
1932 | 4627 |
# endif |
89 | 4628 |
#endif |
4629 |
%}. |
|
4630 |
^ false |
|
4631 |
||
4632 |
" |
|
4633 |
Display supportsZBuffer |
|
4634 |
" |
|
294 | 4635 |
! ! |
4636 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4637 |
!GLXWorkstation methodsFor:'rectangles'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4638 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4639 |
glxRectX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4640 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4641 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4642 |
SETWIN(aGLXWindowId) |
1932 | 4643 |
#ifdef OPENGL |
4644 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4645 |
rect(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
1932 | 4646 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4647 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4648 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4649 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4650 |
glxRectfX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4651 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4652 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4653 |
SETWIN(aGLXWindowId) |
1932 | 4654 |
#ifdef OPENGL |
4655 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4656 |
rectf(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
1932 | 4657 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4658 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4659 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4660 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4661 |
glxRectfiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4662 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4663 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4664 |
SETWIN(aGLXWindowId) |
1932 | 4665 |
#ifdef OPENGL |
4666 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4667 |
rectfi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
1932 | 4668 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4669 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4670 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4671 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4672 |
glxRectfsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4673 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4674 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4675 |
SETWIN(aGLXWindowId) |
1932 | 4676 |
#ifdef OPENGL |
4677 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4678 |
rectfs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
1932 | 4679 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4680 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4681 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4682 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4683 |
glxRectiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4684 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4685 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4686 |
SETWIN(aGLXWindowId) |
1932 | 4687 |
#ifdef OPENGL |
4688 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4689 |
recti(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
1932 | 4690 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4691 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4692 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4693 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4694 |
glxRectsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4695 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4696 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4697 |
SETWIN(aGLXWindowId) |
1932 | 4698 |
#ifdef OPENGL |
4699 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4700 |
rects(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
1932 | 4701 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4702 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4703 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4704 |
|
528 | 4705 |
!GLXWorkstation methodsFor:'spheres'! |
294 | 4706 |
|
4707 |
glxSphDraw:arrayOf4Floats in:aGLXWindowId |
|
4708 |
"argument must be an array(a matrix) of 4 floats containing the |
|
4709 |
sphere - in real GL only" |
|
4710 |
||
4711 |
%{ /* NOCONTEXT */ |
|
4712 |
#ifdef GLX |
|
4713 |
float vec[4], *v; |
|
4714 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4715 |
if (! (v = __glx_getFloatsFromInto(arrayOf4Floats, vec, 4))) RETURN(false); |
294 | 4716 |
SETWIN(aGLXWindowId) |
4717 |
sphdraw(v); |
|
1932 | 4718 |
#endif |
4719 |
%} |
|
294 | 4720 |
! |
4721 |
||
4722 |
glxSphDrawX:x y:y z:z radius:r in:aGLXWindowId |
|
4723 |
"arguments must be convertable to floats - in real GL only" |
|
4724 |
||
4725 |
%{ /* NOCONTEXT */ |
|
4726 |
#ifdef GLX |
|
4727 |
float vec[4]; |
|
4728 |
||
4729 |
_FLOAT_(x, vec[0]) |
|
4730 |
_FLOAT_(y, vec[1]) |
|
4731 |
_FLOAT_(z, vec[2]) |
|
4732 |
_FLOAT_(r, vec[3]) |
|
4733 |
SETWIN(aGLXWindowId) |
|
4734 |
sphdraw(vec); |
|
1932 | 4735 |
#endif |
4736 |
%} |
|
294 | 4737 |
! |
4738 |
||
4739 |
glxSphfreeIn: aGLXWindowId |
|
4740 |
||
4741 |
%{ /* NOCONTEXT */ |
|
4742 |
#ifdef GLX |
|
4743 |
SETWIN(aGLXWindowId) |
|
4744 |
sphfree(); |
|
1932 | 4745 |
#endif |
4746 |
%} |
|
294 | 4747 |
! |
4748 |
||
4749 |
glxSphgnpolysIn: aGLXWindowId |
|
4750 |
||
4751 |
%{ /* NOCONTEXT */ |
|
4752 |
#ifdef GLX |
|
4753 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4754 |
RETURN (__MKSMALLINT(sphgnpolys())); |
294 | 4755 |
#endif |
4756 |
%} |
|
4757 |
! |
|
4758 |
||
4759 |
glxSphmode: attribute value: value in: aGLXWindowId |
|
4760 |
||
4761 |
%{ /* NOCONTEXT */ |
|
4762 |
#ifdef GLX |
|
4763 |
SETWIN(aGLXWindowId) |
|
4764 |
sphmode(__intVal(attribute), __intVal(value)); |
|
1932 | 4765 |
#endif |
4766 |
%} |
|
294 | 4767 |
! |
4768 |
||
4769 |
glxSphobj: objid in: aGLXWindowId |
|
4770 |
||
4771 |
%{ /* NOCONTEXT */ |
|
4772 |
#ifdef GLX |
|
4773 |
SETWIN(aGLXWindowId) |
|
4774 |
sphobj(_objectVal(objid)); |
|
1932 | 4775 |
#endif |
4776 |
%} |
|
294 | 4777 |
! |
4778 |
||
4779 |
glxSphrotmatrix: mat in: aGLXWindowId |
|
4780 |
||
4781 |
%{ /* NOCONTEXT */ |
|
4782 |
#ifdef GLX |
|
4783 |
Matrix matrix, *m; |
|
4784 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4785 |
if (! (m = __glx_getFloatsFromMatrixInto(mat, &matrix))) RETURN (false); |
294 | 4786 |
SETWIN(aGLXWindowId) |
4787 |
sphrotmatrix(*m); |
|
1932 | 4788 |
#endif |
4789 |
%} |
|
294 | 4790 |
! ! |
4791 |
||
4792 |
!GLXWorkstation methodsFor:'stereo extension'! |
|
4793 |
||
528 | 4794 |
glxLeftbuffer: bool in: aGLXWindowId |
4795 |
||
4796 |
%{ /* NOCONTEXT */ |
|
4797 |
#ifdef FULL_GLX |
|
4798 |
SETWIN(aGLXWindowId) |
|
4799 |
leftbuffer(_booleanVal(bool)); |
|
1932 | 4800 |
#endif |
4801 |
%} |
|
528 | 4802 |
! |
4803 |
||
4804 |
glxMonobufferIn: aGLXWindowId |
|
4805 |
||
4806 |
%{ /* NOCONTEXT */ |
|
4807 |
#ifdef FULL_GLX |
|
4808 |
SETWIN(aGLXWindowId) |
|
4809 |
monobuffer(); |
|
1932 | 4810 |
#endif |
4811 |
%} |
|
528 | 4812 |
! |
4813 |
||
4814 |
glxRightbuffer: bool in: aGLXWindowId |
|
4815 |
||
4816 |
%{ /* NOCONTEXT */ |
|
4817 |
#ifdef FULL_GLX |
|
4818 |
SETWIN(aGLXWindowId) |
|
4819 |
rightbuffer(_booleanVal(bool)); |
|
1932 | 4820 |
#endif |
4821 |
%} |
|
528 | 4822 |
! |
4823 |
||
294 | 4824 |
stereoExtensionBuffer:aBufferSymbol for:aWindowId |
4825 |
"set the current stereo buffer; the argument may be one of: |
|
4826 |
#left -> STEREO_BUFFER_LEFT |
|
4827 |
#right -> STEREO_BUFFER_RIGHT |
|
4828 |
" |
|
4829 |
||
4830 |
%{ /* NOCONTEXT */ |
|
4831 |
#if defined(XSGIStereo) && defined(GLX) |
|
4832 |
Status status; |
|
4833 |
int buffer; |
|
4834 |
Window win; |
|
4835 |
||
4836 |
if (ISCONNECTED |
|
4837 |
&& __isExternalAddress(aWindowId)) { |
|
4838 |
win = _WindowVal(aWindowId); |
|
4839 |
if (aBufferSymbol == @symbol(left)) { |
|
4840 |
buffer = STEREO_BUFFER_LEFT; |
|
4841 |
} else { |
|
4842 |
if (aBufferSymbol == @symbol(right)) { |
|
4843 |
buffer = STEREO_BUFFER_RIGHT; |
|
4844 |
} else { |
|
4845 |
goto bad; |
|
4846 |
} |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4847 |
} |
294 | 4848 |
status = XSGISetStereoBuffer(myDpy, win, buffer); |
4849 |
RETURN ( status ? true : false); |
|
4850 |
} |
|
4851 |
bad: ; |
|
4852 |
#endif |
|
4853 |
%}. |
|
4854 |
self primitiveFailed |
|
4855 |
||
4856 |
" |
|
4857 |
|t v| |
|
4858 |
||
4859 |
t := StandardSystemView new. |
|
4860 |
t extent:300@300. |
|
4861 |
v := GLXView origin:0.0@0.0 corner:1.0@1.0 in:t. |
|
4862 |
t openAndWait. |
|
4863 |
||
4864 |
v device stereoExtensionBuffer:#left for:(v id). |
|
4865 |
(Delay forSeconds:10) wait. |
|
4866 |
v device stereoExtensionBuffer:#right for:(v id). |
|
4867 |
" |
|
4868 |
! |
|
4869 |
||
4870 |
stereoExtensionMode:aModeSymbol height:h offset:o for:aWindowId |
|
4871 |
"set the current stereo mode; the argument may be one of: |
|
4872 |
nil/false #off -> turn it off |
|
4873 |
#bottom -> STEREO_BOTTOM |
|
4874 |
#top -> STEREO_TOP |
|
4875 |
" |
|
4876 |
||
4877 |
%{ /* NOCONTEXT */ |
|
4878 |
#if defined(XSGIStereo) && defined(GLX) |
|
4879 |
Status status; |
|
4880 |
int mode; |
|
4881 |
unsigned short us_h, us_o; |
|
4882 |
Window win; |
|
4883 |
||
4884 |
if (ISCONNECTED |
|
4885 |
&& __bothSmallInteger(h, o) |
|
4886 |
&& __isExternalAddress(aWindowId)) { |
|
4887 |
win = _WindowVal(aWindowId); |
|
4888 |
if ((aModeSymbol == nil) |
|
4889 |
|| (aModeSymbol == false) |
|
4890 |
|| (aModeSymbol == @symbol(off))) { |
|
4891 |
mode = STEREO_OFF; |
|
4892 |
} else { |
|
4893 |
if (aModeSymbol == @symbol(bottom)) { |
|
4894 |
mode = STEREO_BOTTOM; |
|
4895 |
} else { |
|
4896 |
if (aModeSymbol == @symbol(top)) { |
|
4897 |
mode = STEREO_TOP; |
|
4898 |
} else { |
|
4899 |
goto bad; |
|
4900 |
} |
|
4901 |
} |
|
4902 |
} |
|
4903 |
us_h = __intVal(h); |
|
4904 |
us_o = __intVal(o); |
|
4905 |
status = XSGISetStereoMode(myDpy, win, us_h, us_o, mode); |
|
4906 |
RETURN ( status ? true : false); |
|
4907 |
} |
|
4908 |
bad: ; |
|
4909 |
#endif |
|
4910 |
%}. |
|
4911 |
self primitiveFailed |
|
4912 |
||
4913 |
" |
|
4914 |
Display stereoExtensionMode:#top height:492 offset:532 for:(Display rootWindowId). |
|
4915 |
(Delay forSeconds:10) wait. |
|
4916 |
Display stereoExtensionMode:#off height:0 offset:0 for:(Display rootWindowId). |
|
4917 |
" |
|
4918 |
! |
|
4919 |
||
4920 |
stereoExtensionModeIn:aWindowId |
|
4921 |
"return the current stereo mode for some window" |
|
4922 |
||
4923 |
%{ /* NOCONTEXT */ |
|
4924 |
#if defined(XSGIStereo) && defined(GLX) |
|
4925 |
int mode; |
|
4926 |
Window win; |
|
4927 |
||
4928 |
if (ISCONNECTED && __isExternalAddress(aWindowId)) { |
|
4929 |
win = _WindowVal(aWindowId); |
|
4930 |
mode = XSGIQueryStereoMode(myDpy, win); |
|
4931 |
switch (mode) { |
|
4932 |
case STEREO_OFF: |
|
4933 |
RETURN ( @symbol(off) ); |
|
4934 |
case STEREO_BOTTOM: |
|
4935 |
RETURN ( @symbol(bottom) ); |
|
4936 |
case STEREO_TOP: |
|
4937 |
RETURN ( @symbol(top) ); |
|
4938 |
} |
|
4939 |
RETURN ( @symbol(unsupported) ); |
|
4940 |
} |
|
4941 |
#endif |
|
4942 |
%}. |
|
4943 |
self primitiveFailed |
|
4944 |
||
4945 |
" |
|
4946 |
|v| |
|
4947 |
||
4948 |
v := StandardSystemView new. |
|
4949 |
v extent:300@300. |
|
4950 |
v openAndWait. |
|
4951 |
v device stereoExtensionModeIn:(v id) |
|
4952 |
||
4953 |
Display stereoExtensionModeIn:Display rootWindowId |
|
4954 |
" |
|
4955 |
! |
|
4956 |
||
4957 |
stereoExtensionVersion |
|
4958 |
"return the stereo extensions version as an array consisting of |
|
4959 |
major and minor numbers." |
|
4960 |
||
4961 |
%{ /* NOCONTEXT */ |
|
4962 |
#if defined(XSGIStereo) && defined(GLX) |
|
4963 |
Status status; |
|
4964 |
Display *dpy = myDpy; |
|
4965 |
int major, minor; |
|
4966 |
||
4967 |
if (ISCONNECTED) { |
|
4968 |
status = XSGIStereoQueryVersion(myDpy, &major, &minor); |
|
4969 |
if (status == True) { |
|
4970 |
RETURN ( __ARRAY_WITH2(__MKSMALLINT(major), __MKSMALLINT(minor))); |
|
4971 |
} |
|
89 | 4972 |
} |
4973 |
#endif |
|
4974 |
%}. |
|
294 | 4975 |
self primitiveFailed |
185 | 4976 |
|
4977 |
" |
|
294 | 4978 |
Display stereoExtensionVersion |
185 | 4979 |
" |
24 | 4980 |
! ! |
4981 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4982 |
!GLXWorkstation methodsFor:'texture data transfer'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4983 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4984 |
glxT2d: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4985 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4986 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4987 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4988 |
double vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4989 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4990 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4991 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4992 |
t2d(c_v); |
1932 | 4993 |
#endif |
4994 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4995 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4996 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4997 |
glxT2f: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4998 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4999 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5000 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5001 |
float vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5002 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5003 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5004 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5005 |
t2f(c_v); |
1932 | 5006 |
#endif |
5007 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5008 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5009 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5010 |
glxT2i: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5011 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5012 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5013 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5014 |
long vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5015 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5016 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5017 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5018 |
t2i(c_v); |
1932 | 5019 |
#endif |
5020 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5021 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5022 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5023 |
glxT2s: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5024 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5025 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5026 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5027 |
short vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5028 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5029 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5030 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5031 |
t2s(c_v); |
1932 | 5032 |
#endif |
5033 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5034 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5035 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5036 |
glxT3d:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5037 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5038 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5039 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5040 |
double vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5041 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5042 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5043 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5044 |
t3d(c_v); |
1932 | 5045 |
#endif |
5046 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5047 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5048 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5049 |
glxT3f:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5050 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5051 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5052 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5053 |
float vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5054 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5055 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5056 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5057 |
t3f(c_v); |
1932 | 5058 |
#endif |
5059 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5060 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5061 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5062 |
glxT3i:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5063 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5064 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5065 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5066 |
long vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5067 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5068 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5069 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5070 |
t3i(c_v); |
1932 | 5071 |
#endif |
5072 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5073 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5074 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5075 |
glxT3s:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5076 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5077 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5078 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5079 |
short vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5080 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5081 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5082 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5083 |
t3s(c_v); |
1932 | 5084 |
#endif |
5085 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5086 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5087 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5088 |
glxT4d: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5089 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5090 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5091 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5092 |
double vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5093 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5094 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5095 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5096 |
t4d(c_v); |
1932 | 5097 |
#endif |
5098 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5099 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5100 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5101 |
glxT4f: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5102 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5103 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5104 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5105 |
float vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5106 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5107 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5108 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5109 |
t4f(c_v); |
1932 | 5110 |
#endif |
5111 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5112 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5113 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5114 |
glxT4i: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5115 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5116 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5117 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5118 |
long vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5119 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5120 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5121 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5122 |
t4i(c_v); |
1932 | 5123 |
#endif |
5124 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5125 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5126 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5127 |
glxT4s: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5128 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5129 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5130 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5131 |
short vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5132 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5133 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5134 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5135 |
t4s(c_v); |
1932 | 5136 |
#endif |
5137 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5138 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5139 |
|
294 | 5140 |
!GLXWorkstation methodsFor:'transformations'! |
5141 |
||
5142 |
glxRotate:angle axis:axis in:aGLXWindowId |
|
5143 |
"rotate the current matrix around the axis given by the axis arg, |
|
5144 |
which must be one of the symbols: #x, #y or #z. |
|
5145 |
The angle is in degrees." |
|
5146 |
||
5147 |
%{ /* NOCONTEXT */ |
|
5148 |
||
5149 |
char c_axis; |
|
5150 |
||
5151 |
if (axis == @symbol(x)) |
|
5152 |
c_axis = 'x'; |
|
5153 |
else if (axis == @symbol(y)) |
|
5154 |
c_axis = 'y'; |
|
5155 |
else if (axis == @symbol(z)) |
|
5156 |
c_axis = 'z'; |
|
5157 |
else { |
|
5158 |
RETURN (false); |
|
5159 |
} |
|
5160 |
||
5161 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5162 |
RETURN ( __glx_doRotate(angle, c_axis) ); |
294 | 5163 |
%} |
5164 |
! |
|
5165 |
||
5166 |
glxRotate:arrayOf3Floats in:aGLXWindowId |
|
5167 |
"rotate current matrix, given a 3-element vector (or more). |
|
5168 |
The elements of the array are degrees." |
|
5169 |
||
5170 |
%{ /* NOCONTEXT */ |
|
5171 |
||
5172 |
float vec[3], *v; |
|
5173 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5174 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5175 |
|
5176 |
SETWIN(aGLXWindowId) |
|
1932 | 5177 |
#ifdef OPENGL |
5178 |
#else |
|
294 | 5179 |
rot(v[0], 'x'); |
5180 |
rot(v[1], 'y'); |
|
5181 |
rot(v[2], 'z'); |
|
1932 | 5182 |
#endif |
294 | 5183 |
%} |
5184 |
! |
|
5185 |
||
5186 |
glxRotateI:angle axis:axis in:aGLXWindowId |
|
5187 |
"rotate the current matrix around the axis given by the axis arg, |
|
5188 |
which must be one of the symbols: #x, #y or #z. |
|
5189 |
The angle is an integer specifying tenths of a degree." |
|
5190 |
||
5191 |
%{ /* NOCONTEXT */ |
|
5192 |
||
5193 |
char c_axis; |
|
5194 |
||
5195 |
if (axis == @symbol(x)) |
|
5196 |
c_axis = 'x'; |
|
5197 |
else if (axis == @symbol(y)) |
|
5198 |
c_axis = 'y'; |
|
5199 |
else if (axis == @symbol(z)) |
|
5200 |
c_axis = 'z'; |
|
5201 |
else { |
|
5202 |
RETURN (false); |
|
5203 |
} |
|
5204 |
||
5205 |
if (__isSmallInteger(angle)) { |
|
5206 |
SETWIN(aGLXWindowId) |
|
1932 | 5207 |
#ifdef OPENGL |
5208 |
#else |
|
294 | 5209 |
rotate(__intVal(angle), c_axis); |
1932 | 5210 |
#endif |
294 | 5211 |
} |
5212 |
%} |
|
5213 |
! |
|
5214 |
||
5215 |
glxRotateIX:angle in:aGLXWindowId |
|
5216 |
"rotate the current matrix on x axis. |
|
5217 |
The angle is an integer specifying tenths of a degree." |
|
5218 |
||
5219 |
%{ /* NOCONTEXT */ |
|
5220 |
||
5221 |
if (__isSmallInteger(angle)) { |
|
5222 |
SETWIN(aGLXWindowId) |
|
1932 | 5223 |
#ifdef OPENGL |
5224 |
#else |
|
294 | 5225 |
rotate(__intVal(angle), 'x'); |
1932 | 5226 |
#endif |
294 | 5227 |
} |
5228 |
%} |
|
5229 |
! |
|
5230 |
||
5231 |
glxRotateIX:xAngle y:yAngle z:zAngle in:aGLXWindowId |
|
5232 |
"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
|
5233 |
The values are smallIntegers specifying tenths of a degree." |
294 | 5234 |
|
5235 |
%{ /* NOCONTEXT */ |
|
5236 |
||
5237 |
if (__bothSmallInteger(xAngle, yAngle) |
|
5238 |
&& __isSmallInteger(zAngle)) { |
|
5239 |
SETWIN(aGLXWindowId) |
|
1932 | 5240 |
#ifdef OPENGL |
5241 |
#else |
|
294 | 5242 |
rotate(__intVal(xAngle), 'x'); |
5243 |
rotate(__intVal(yAngle), 'y'); |
|
5244 |
rotate(__intVal(zAngle), 'z'); |
|
1932 | 5245 |
#endif |
294 | 5246 |
} |
5247 |
%} |
|
5248 |
! |
|
5249 |
||
5250 |
glxRotateIY:angle in:aGLXWindowId |
|
5251 |
"rotate the current matrix on x axis. |
|
5252 |
The angle is an integer specifying tenths of a degree." |
|
5253 |
||
5254 |
%{ /* NOCONTEXT */ |
|
5255 |
||
5256 |
if (__isSmallInteger(angle)) { |
|
5257 |
SETWIN(aGLXWindowId) |
|
1932 | 5258 |
#ifdef OPENGL |
5259 |
#else |
|
294 | 5260 |
rotate(__intVal(angle), 'y'); |
1932 | 5261 |
#endif |
294 | 5262 |
} |
5263 |
%} |
|
5264 |
! |
|
5265 |
||
5266 |
glxRotateIZ:angle in:aGLXWindowId |
|
5267 |
"rotate the current matrix on x axis. |
|
5268 |
The angle is an integer specifying tenths of a degree." |
|
5269 |
||
5270 |
%{ /* NOCONTEXT */ |
|
5271 |
||
5272 |
if (__isSmallInteger(angle)) { |
|
5273 |
SETWIN(aGLXWindowId) |
|
1932 | 5274 |
#ifdef OPENGL |
5275 |
#else |
|
294 | 5276 |
rotate(__intVal(angle), 'z'); |
1932 | 5277 |
#endif |
294 | 5278 |
} |
5279 |
%} |
|
5280 |
! |
|
5281 |
||
5282 |
glxRotateX:angle in:aGLXWindowId |
|
5283 |
"rotate the current matrix on x axis. |
|
5284 |
The angle is in degrees." |
|
5285 |
||
5286 |
%{ /* NOCONTEXT */ |
|
5287 |
||
5288 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5289 |
RETURN (__glx_doRotate(angle, 'x')); |
294 | 5290 |
%} |
5291 |
! |
|
5292 |
||
5293 |
glxRotateX:xAngle y:yAngle z:zAngle in:aGLXWindowId |
|
5294 |
"rotate the current matrix on all axes, given individual x, y and z values. |
|
5295 |
The values are in degrees" |
|
5296 |
||
5297 |
%{ /* NOCONTEXT */ |
|
5298 |
||
5299 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5300 |
if ( __glx_doRotate(xAngle, 'x') == true) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5301 |
if ( __glx_doRotate(yAngle, 'y') == true) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5302 |
RETURN (__glx_doRotate(zAngle, 'z')); |
294 | 5303 |
} |
5304 |
} |
|
5305 |
%} |
|
5306 |
! |
|
5307 |
||
5308 |
glxRotateY:angle in:aGLXWindowId |
|
5309 |
"rotate the current matrix on y axis. |
|
5310 |
The angle is in degrees." |
|
5311 |
||
5312 |
%{ /* NOCONTEXT */ |
|
5313 |
||
5314 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5315 |
RETURN (__glx_doRotate(angle, 'y')); |
294 | 5316 |
%} |
5317 |
! |
|
5318 |
||
5319 |
glxRotateZ:angle in:aGLXWindowId |
|
5320 |
"rotate the current matrix on z axis. |
|
5321 |
The angle is in degrees." |
|
5322 |
||
5323 |
%{ /* NOCONTEXT */ |
|
5324 |
||
5325 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5326 |
RETURN (__glx_doRotate(angle, 'z')); |
294 | 5327 |
%} |
5328 |
! |
|
5329 |
||
5330 |
glxScale:arrayOf3Floats in:aGLXWindowId |
|
5331 |
"scale current matrix, given a 3-element vector" |
|
5332 |
||
5333 |
%{ /* NOCONTEXT */ |
|
5334 |
||
5335 |
float vec[3], *v; |
|
5336 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5337 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5338 |
|
5339 |
SETWIN(aGLXWindowId) |
|
1932 | 5340 |
#ifdef OPENGL |
5341 |
#else |
|
294 | 5342 |
scale(v[0], v[1], v[2]); |
1932 | 5343 |
#endif |
294 | 5344 |
%} |
5345 |
! |
|
5346 |
||
5347 |
glxScaleX:x in:aGLXWindowId |
|
5348 |
"scale in x direction" |
|
5349 |
||
5350 |
%{ /* NOCONTEXT */ |
|
5351 |
||
5352 |
float f_x; |
|
5353 |
||
5354 |
_FLOAT_ (x, f_x) |
|
5355 |
SETWIN(aGLXWindowId) |
|
1932 | 5356 |
#ifdef OPENGL |
5357 |
#else |
|
294 | 5358 |
scale(f_x, (float)0, (float)0); |
1932 | 5359 |
#endif |
294 | 5360 |
%} |
5361 |
! |
|
5362 |
||
5363 |
glxScaleX:x y:y z:z in:aGLXWindowId |
|
5364 |
"scale & mirror current matrix, given individual x, y and z values" |
|
5365 |
||
5366 |
%{ /* NOCONTEXT */ |
|
5367 |
||
5368 |
float f_x, f_y, f_z; |
|
5369 |
||
5370 |
_FLOAT_ (x, f_x) |
|
5371 |
_FLOAT_ (y, f_y) |
|
5372 |
_FLOAT_ (z, f_z) |
|
5373 |
SETWIN(aGLXWindowId) |
|
1932 | 5374 |
#ifdef OPENGL |
5375 |
#else |
|
294 | 5376 |
scale(f_x, f_y, f_z); |
1932 | 5377 |
#endif |
294 | 5378 |
%} |
5379 |
! |
|
5380 |
||
5381 |
glxScaleY:y in:aGLXWindowId |
|
5382 |
"scale in y direction" |
|
5383 |
||
5384 |
%{ /* NOCONTEXT */ |
|
5385 |
||
5386 |
float f_y; |
|
5387 |
||
5388 |
_FLOAT_ (y, f_y) |
|
5389 |
SETWIN(aGLXWindowId) |
|
1932 | 5390 |
#ifdef OPENGL |
5391 |
#else |
|
294 | 5392 |
scale((float)0, f_y, (float)0); |
1932 | 5393 |
#endif |
294 | 5394 |
%} |
5395 |
! |
|
5396 |
||
5397 |
glxScaleZ:z in:aGLXWindowId |
|
5398 |
"scale in z direction" |
|
5399 |
||
5400 |
%{ /* NOCONTEXT */ |
|
5401 |
||
5402 |
float f_z; |
|
5403 |
||
5404 |
_FLOAT_ (z, f_z) |
|
5405 |
SETWIN(aGLXWindowId) |
|
1932 | 5406 |
#ifdef OPENGL |
5407 |
#else |
|
294 | 5408 |
scale((float)0, (float)0, f_z); |
1932 | 5409 |
#endif |
294 | 5410 |
%} |
5411 |
! |
|
5412 |
||
5413 |
glxTranslate:arrayOf3Floats in:aGLXWindowId |
|
5414 |
"translate current matrix, given a 3-element vector" |
|
5415 |
||
5416 |
%{ /* NOCONTEXT */ |
|
5417 |
||
5418 |
float vec[3], *v; |
|
5419 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5420 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5421 |
|
5422 |
SETWIN(aGLXWindowId) |
|
1932 | 5423 |
#ifdef OPENGL |
5424 |
#else |
|
294 | 5425 |
translate((Coord)(v[0]), (Coord)(v[1]), (Coord)(v[2])); |
1932 | 5426 |
#endif |
294 | 5427 |
%} |
5428 |
! |
|
5429 |
||
5430 |
glxTranslateX:x in:aGLXWindowId |
|
5431 |
"translate current matrix on X axis" |
|
5432 |
||
5433 |
%{ /* NOCONTEXT */ |
|
5434 |
||
5435 |
Coord c_x; |
|
5436 |
||
5437 |
_COORD_ (x, c_x) |
|
5438 |
SETWIN(aGLXWindowId) |
|
1932 | 5439 |
#ifdef OPENGL |
5440 |
#else |
|
294 | 5441 |
translate(c_x, (Coord)0, (Coord)0); |
1932 | 5442 |
#endif |
294 | 5443 |
%} |
5444 |
! |
|
5445 |
||
5446 |
glxTranslateX:x y:y z:z in:aGLXWindowId |
|
5447 |
"translate current matrix, given individual x, y and z values" |
|
5448 |
||
5449 |
%{ /* NOCONTEXT */ |
|
5450 |
||
5451 |
Coord c_x, c_y, c_z; |
|
5452 |
||
5453 |
_COORD_ (x, c_x) |
|
5454 |
_COORD_ (y, c_y) |
|
5455 |
_COORD_ (z, c_z) |
|
5456 |
SETWIN(aGLXWindowId) |
|
1932 | 5457 |
#ifdef OPENGL |
5458 |
#else |
|
294 | 5459 |
translate(c_x, c_y, c_z); |
1932 | 5460 |
#endif |
294 | 5461 |
%} |
5462 |
! |
|
5463 |
||
5464 |
glxTranslateY:y in:aGLXWindowId |
|
5465 |
"translate current matrix on Y axis" |
|
5466 |
||
5467 |
%{ /* NOCONTEXT */ |
|
5468 |
||
5469 |
Coord c_y; |
|
5470 |
||
5471 |
_COORD_ (y, c_y) |
|
5472 |
SETWIN(aGLXWindowId) |
|
1932 | 5473 |
#ifdef OPENGL |
5474 |
#else |
|
294 | 5475 |
translate((Coord)0, c_y, (Coord)0); |
1932 | 5476 |
#endif |
294 | 5477 |
%} |
5478 |
! |
|
5479 |
||
5480 |
glxTranslateZ:z in:aGLXWindowId |
|
5481 |
"translate current matrix on Z axis" |
|
5482 |
||
5483 |
%{ /* NOCONTEXT */ |
|
5484 |
||
5485 |
Coord c_z; |
|
5486 |
||
5487 |
_COORD_ (z, c_z) |
|
5488 |
SETWIN(aGLXWindowId) |
|
1932 | 5489 |
#ifdef OPENGL |
5490 |
#else |
|
294 | 5491 |
translate((Coord)0, (Coord)0, c_z); |
1932 | 5492 |
#endif |
294 | 5493 |
%} |
5494 |
! ! |
|
5495 |
||
5496 |
!GLXWorkstation methodsFor:'unspecified rest'! |
|
5497 |
||
5498 |
glxAcbufOp:op value:value in:aGLXWindowId |
|
5499 |
||
5500 |
%{ /* NOCONTEXT */ |
|
1932 | 5501 |
SETWIN(aGLXWindowId) |
5502 |
#ifdef GLX |
|
294 | 5503 |
acbuf(__intVal(op), _floatVal(value)); |
1932 | 5504 |
#endif |
5505 |
%} |
|
294 | 5506 |
! |
5507 |
||
5508 |
glxAcsizePlanes: planes in: aGLXWindowId |
|
5509 |
||
5510 |
%{ /* NOCONTEXT */ |
|
1932 | 5511 |
SETWIN(aGLXWindowId) |
5512 |
#ifdef GLX |
|
294 | 5513 |
acsize(__intVal(planes)); |
1932 | 5514 |
#endif |
5515 |
%} |
|
294 | 5516 |
! |
5517 |
||
5518 |
glxAfunctionRef: ref func: func in: aGLXWindowId |
|
5519 |
||
5520 |
%{ /* NOCONTEXT */ |
|
1932 | 5521 |
SETWIN(aGLXWindowId) |
5522 |
#ifdef GLX |
|
294 | 5523 |
afunction(__intVal(ref), __intVal(func)); |
1932 | 5524 |
#endif |
5525 |
%} |
|
294 | 5526 |
! |
5527 |
||
5528 |
glxBbox2Xmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5529 |
||
5530 |
%{ /* NOCONTEXT */ |
|
5531 |
Screencoord c_xmin, c_ymin; |
|
5532 |
Coord c_x1, c_y1, c_x2, c_y2; |
|
5533 |
||
5534 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5535 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5536 |
_COORD_ (x1, c_x1) |
|
5537 |
_COORD_ (y1, c_y1) |
|
5538 |
_COORD_ (x2, c_x2) |
|
5539 |
_COORD_ (y2, c_y2) |
|
5540 |
SETWIN(aGLXWindowId) |
|
1932 | 5541 |
#ifdef GLX |
294 | 5542 |
bbox2(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5543 |
#endif |
5544 |
%} |
|
294 | 5545 |
! |
5546 |
||
5547 |
glxBbox2iXmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5548 |
||
5549 |
%{ /* NOCONTEXT */ |
|
5550 |
Screencoord c_xmin, c_ymin; |
|
5551 |
Icoord c_x1, c_y1, c_x2, c_y2; |
|
5552 |
||
5553 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5554 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5555 |
_ICOORD_ (x1, c_x1) |
|
5556 |
_ICOORD_ (y1, c_y1) |
|
5557 |
_ICOORD_ (x2, c_x2) |
|
5558 |
_ICOORD_ (y2, c_y2) |
|
5559 |
SETWIN(aGLXWindowId) |
|
1932 | 5560 |
#ifdef GLX |
294 | 5561 |
bbox2i(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5562 |
#endif |
5563 |
%} |
|
294 | 5564 |
! |
5565 |
||
5566 |
glxBbox2sXmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5567 |
||
5568 |
%{ /* NOCONTEXT */ |
|
5569 |
Screencoord c_xmin, c_ymin; |
|
5570 |
Scoord c_x1, c_y1, c_x2, c_y2; |
|
5571 |
||
5572 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5573 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5574 |
_SCOORD_ (x1, c_x1) |
|
5575 |
_SCOORD_ (y1, c_y1) |
|
5576 |
_SCOORD_ (x2, c_x2) |
|
5577 |
_SCOORD_ (y2, c_y2) |
|
5578 |
SETWIN(aGLXWindowId) |
|
1932 | 5579 |
#ifdef GLX |
294 | 5580 |
bbox2s(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5581 |
#endif |
5582 |
%} |
|
294 | 5583 |
! |
5584 |
||
5585 |
glxBeginTrimIn: aGLXWindowId |
|
5586 |
||
5587 |
%{ /* NOCONTEXT */ |
|
1932 | 5588 |
SETWIN(aGLXWindowId) |
5589 |
#ifdef GLX |
|
294 | 5590 |
bgntrim(); |
1932 | 5591 |
#endif |
5592 |
%} |
|
294 | 5593 |
! |
5594 |
||
5595 |
glxBlankscreen: b in: aGLXWindowId |
|
5596 |
||
5597 |
%{ /* NOCONTEXT */ |
|
1932 | 5598 |
SETWIN(aGLXWindowId) |
5599 |
#ifdef GLX |
|
294 | 5600 |
blankscreen(_booleanVal(b)); |
1932 | 5601 |
#endif |
5602 |
%} |
|
294 | 5603 |
! |
5604 |
||
5605 |
glxBlanktime: count in: aGLXWindowId |
|
5606 |
||
5607 |
%{ /* NOCONTEXT */ |
|
1932 | 5608 |
SETWIN(aGLXWindowId) |
5609 |
#ifdef GLX |
|
294 | 5610 |
blanktime(__intVal(count)); |
1932 | 5611 |
#endif |
5612 |
%} |
|
294 | 5613 |
! |
5614 |
||
5615 |
glxBlendcolorRed: red green: green blue: blue alpha: alpha in: aGLXWindowId |
|
5616 |
||
5617 |
%{ /* NOCONTEXT */ |
|
1932 | 5618 |
SETWIN(aGLXWindowId) |
294 | 5619 |
#ifdef FULL_GLX |
5620 |
blendcolor(_floatVal(red), _floatVal(green), _floatVal(blue), _floatVal(alpha)); |
|
1932 | 5621 |
#endif |
5622 |
%} |
|
294 | 5623 |
! |
5624 |
||
5625 |
glxBlendfunctionSfactr: sfactr dfactr: dfactr in: aGLXWindowId |
|
5626 |
||
5627 |
%{ /* NOCONTEXT */ |
|
1932 | 5628 |
SETWIN(aGLXWindowId) |
5629 |
#ifdef GLX |
|
294 | 5630 |
blendfunction(__intVal(sfactr), __intVal(dfactr)); |
1932 | 5631 |
#endif |
5632 |
%} |
|
294 | 5633 |
! |
5634 |
||
5635 |
glxBlinkRate: rate i: i red: red green: green blue: blue in: aGLXWindowId |
|
5636 |
||
5637 |
%{ /* NOCONTEXT */ |
|
1932 | 5638 |
SETWIN(aGLXWindowId) |
5639 |
#ifdef GLX |
|
294 | 5640 |
blink(_shortVal(rate), _colorindexVal(i), |
5641 |
_shortVal(red), _shortVal(green), _shortVal(blue)); |
|
1932 | 5642 |
#endif |
5643 |
%} |
|
294 | 5644 |
! |
5645 |
||
5646 |
glxBlkqreadData: data n: n in: aGLXWindowId |
|
5647 |
||
5648 |
%{ /* NOCONTEXT */ |
|
1932 | 5649 |
int rslt = -1; |
5650 |
||
5651 |
SETWIN(aGLXWindowId) |
|
5652 |
#ifdef GLX |
|
5653 |
rslt = blkqread((short *)_indexedArea(data), __intVal(n)); |
|
5654 |
#endif |
|
5655 |
RETURN (__MKSMALLINT(rslt)); |
|
5656 |
%} |
|
294 | 5657 |
! |
5658 |
||
5659 |
glxC3f: v in: aGLXWindowId |
|
5660 |
||
5661 |
%{ /* NOCONTEXT */ |
|
5662 |
float vec[3], *c_v; |
|
5663 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5664 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
294 | 5665 |
SETWIN(aGLXWindowId) |
1932 | 5666 |
#ifdef GLX |
294 | 5667 |
c3f(c_v); |
1932 | 5668 |
#endif |
5669 |
%} |
|
294 | 5670 |
! |
5671 |
||
5672 |
glxC3i: v in: aGLXWindowId |
|
5673 |
||
5674 |
%{ /* NOCONTEXT */ |
|
5675 |
long vec[3], *c_v; |
|
5676 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5677 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
294 | 5678 |
SETWIN(aGLXWindowId) |
1932 | 5679 |
#ifdef GLX |
294 | 5680 |
c3i(c_v); |
1932 | 5681 |
#endif |
5682 |
%} |
|
294 | 5683 |
! |
5684 |
||
5685 |
glxC3s: v in: aGLXWindowId |
|
5686 |
||
5687 |
%{ /* NOCONTEXT */ |
|
5688 |
short vec[3], *c_v; |
|
5689 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5690 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
294 | 5691 |
SETWIN(aGLXWindowId) |
1932 | 5692 |
#ifdef GLX |
294 | 5693 |
c3s(c_v); |
1932 | 5694 |
#endif |
5695 |
%} |
|
294 | 5696 |
! |
5697 |
||
5698 |
glxC4f: v in: aGLXWindowId |
|
5699 |
||
5700 |
%{ /* NOCONTEXT */ |
|
5701 |
float vec[4], *c_v; |
|
5702 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5703 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
294 | 5704 |
SETWIN(aGLXWindowId) |
1932 | 5705 |
#ifdef GLX |
294 | 5706 |
c4f(c_v); |
1932 | 5707 |
#endif |
5708 |
%} |
|
294 | 5709 |
! |
5710 |
||
5711 |
glxC4i: v in: aGLXWindowId |
|
5712 |
||
5713 |
%{ /* NOCONTEXT */ |
|
5714 |
long vec[4], *c_v; |
|
5715 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5716 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
294 | 5717 |
SETWIN(aGLXWindowId) |
1932 | 5718 |
#ifdef GLX |
294 | 5719 |
c4i(c_v); |
1932 | 5720 |
#endif |
5721 |
%} |
|
294 | 5722 |
! |
5723 |
||
5724 |
glxC4s: v in: aGLXWindowId |
|
5725 |
||
5726 |
%{ /* NOCONTEXT */ |
|
5727 |
short vec[4], *c_v; |
|
5728 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5729 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
294 | 5730 |
SETWIN(aGLXWindowId) |
1932 | 5731 |
#ifdef GLX |
294 | 5732 |
c4s(c_v); |
1932 | 5733 |
#endif |
5734 |
%} |
|
294 | 5735 |
! |
5736 |
||
5737 |
glxClearhitcodeIn: aGLXWindowId |
|
5738 |
||
5739 |
%{ /* NOCONTEXT */ |
|
1932 | 5740 |
SETWIN(aGLXWindowId) |
5741 |
#ifdef GLX |
|
294 | 5742 |
clearhitcode(); |
1932 | 5743 |
#endif |
5744 |
%} |
|
294 | 5745 |
! |
5746 |
||
5747 |
glxClipplaneIndex: index mode: mode params: params in: aGLXWindowId |
|
5748 |
||
5749 |
%{ /* NOCONTEXT */ |
|
5750 |
float vec[4], *v; |
|
5751 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5752 |
if (! (v = __glx_getFloatsFromInto(params, vec, 4))) RETURN(false); |
294 | 5753 |
SETWIN(aGLXWindowId) |
1932 | 5754 |
#ifdef GLX |
294 | 5755 |
clipplane(__intVal(index), __intVal(mode), v); |
1932 | 5756 |
#endif |
5757 |
%} |
|
294 | 5758 |
! |
5759 |
||
5760 |
glxCmodeIn: aGLXWindowId |
|
5761 |
||
5762 |
%{ /* NOCONTEXT */ |
|
1932 | 5763 |
SETWIN(aGLXWindowId) |
5764 |
#ifdef GLX |
|
294 | 5765 |
cmode(); |
1932 | 5766 |
#endif |
5767 |
%} |
|
294 | 5768 |
! |
5769 |
||
5770 |
glxColorfIndex: index in: aGLXWindowId |
|
5771 |
||
5772 |
^self glxColor: index in: aGLXWindowId |
|
5773 |
! |
|
5774 |
||
5775 |
glxCuroriginN: n xorigin: xorigin yorigin: yorigin in: aGLXWindowId |
|
5776 |
||
5777 |
%{ /* NOCONTEXT */ |
|
1932 | 5778 |
SETWIN(aGLXWindowId) |
5779 |
#ifdef GLX |
|
294 | 5780 |
curorigin(_shortVal(n), _shortVal(xorigin), _shortVal(yorigin)); |
1932 | 5781 |
#endif |
5782 |
%} |
|
294 | 5783 |
! |
5784 |
||
5785 |
glxCursoffIn: aGLXWindowId |
|
5786 |
||
5787 |
%{ /* NOCONTEXT */ |
|
1932 | 5788 |
SETWIN(aGLXWindowId) |
5789 |
#ifdef GLX |
|
294 | 5790 |
cursoff(); |
1932 | 5791 |
#endif |
5792 |
%} |
|
294 | 5793 |
! |
5794 |
||
5795 |
glxCursonIn: aGLXWindowId |
|
5796 |
||
5797 |
%{ /* NOCONTEXT */ |
|
1932 | 5798 |
SETWIN(aGLXWindowId) |
5799 |
#ifdef GLX |
|
294 | 5800 |
curson(); |
1932 | 5801 |
#endif |
5802 |
%} |
|
294 | 5803 |
! |
5804 |
||
5805 |
glxCurstype: type in: aGLXWindowId |
|
5806 |
||
5807 |
%{ /* NOCONTEXT */ |
|
1932 | 5808 |
SETWIN(aGLXWindowId) |
5809 |
#ifdef GLX |
|
294 | 5810 |
curstype(__intVal(type)); |
1932 | 5811 |
#endif |
5812 |
%} |
|
294 | 5813 |
! |
5814 |
||
5815 |
glxCyclemapDuration: duration map: map nxtmap: nxtmap in: aGLXWindowId |
|
5816 |
||
5817 |
%{ /* NOCONTEXT */ |
|
1932 | 5818 |
SETWIN(aGLXWindowId) |
5819 |
#ifdef GLX |
|
294 | 5820 |
cyclemap(_shortVal(duration), _shortVal(map), _shortVal(nxtmap)); |
1932 | 5821 |
#endif |
5822 |
%} |
|
294 | 5823 |
! |
5824 |
||
5825 |
glxDefpatternN: n size: size mask: mask in: aGLXWindowId |
|
5826 |
||
5827 |
%{ /* NOCONTEXT */ |
|
1932 | 5828 |
SETWIN(aGLXWindowId) |
5829 |
#ifdef GLX |
|
294 | 5830 |
defpattern(_shortVal(n), _shortVal(size), (unsigned short *)_indexedArea(mask)); |
1932 | 5831 |
#endif |
5832 |
%} |
|
294 | 5833 |
! |
5834 |
||
5835 |
glxDeltag: t in: aGLXWindowId |
|
5836 |
||
5837 |
%{ /* NOCONTEXT */ |
|
1932 | 5838 |
SETWIN(aGLXWindowId) |
5839 |
#ifdef GLX |
|
294 | 5840 |
deltag(_tagVal(t)); |
1932 | 5841 |
#endif |
5842 |
%} |
|
294 | 5843 |
! |
5844 |
||
5845 |
glxDepthcueMode: mode in: aGLXWindowId |
|
5846 |
||
5847 |
%{ /* NOCONTEXT */ |
|
1932 | 5848 |
SETWIN(aGLXWindowId) |
5849 |
#ifdef GLX |
|
294 | 5850 |
depthcue(_booleanVal(mode)); |
1932 | 5851 |
#endif |
5852 |
%} |
|
294 | 5853 |
! |
5854 |
||
5855 |
glxDitherMode: mode in: aGLXWindowId |
|
5856 |
||
5857 |
%{ /* NOCONTEXT */ |
|
1932 | 5858 |
SETWIN(aGLXWindowId) |
5859 |
#ifdef GLX |
|
294 | 5860 |
dither(_longVal(mode)); |
1932 | 5861 |
#endif |
5862 |
%} |
|
294 | 5863 |
! |
5864 |
||
5865 |
glxDopup: pup in: aGLXWindowId |
|
5866 |
||
5867 |
%{ /* NOCONTEXT */ |
|
1932 | 5868 |
SETWIN(aGLXWindowId) |
5869 |
#ifdef GLX |
|
294 | 5870 |
dopup(_longVal(pup)); |
1932 | 5871 |
#endif |
5872 |
%} |
|
294 | 5873 |
! |
5874 |
||
5875 |
glxDrawmode: mode in: aGLXWindowId |
|
5876 |
||
5877 |
%{ /* NOCONTEXT */ |
|
1932 | 5878 |
SETWIN(aGLXWindowId) |
5879 |
#ifdef GLX |
|
294 | 5880 |
drawmode(_longVal(mode)); |
1932 | 5881 |
#endif |
5882 |
%} |
|
294 | 5883 |
! |
5884 |
||
5885 |
glxEditobj: obj in: aGLXWindowId |
|
5886 |
||
5887 |
%{ /* NOCONTEXT */ |
|
1932 | 5888 |
SETWIN(aGLXWindowId) |
5889 |
#ifdef GLX |
|
294 | 5890 |
editobj(_objectVal(obj)); |
1932 | 5891 |
#endif |
5892 |
%} |
|
294 | 5893 |
! |
5894 |
||
5895 |
glxEndTrimIn: aGLXWindowId |
|
5896 |
||
5897 |
%{ /* NOCONTEXT */ |
|
1932 | 5898 |
SETWIN(aGLXWindowId) |
5899 |
#ifdef GLX |
|
294 | 5900 |
endtrim(); |
1932 | 5901 |
#endif |
5902 |
%} |
|
294 | 5903 |
! |
5904 |
||
5905 |
glxEndfullscrnIn: aGLXWindowId |
|
5906 |
||
5907 |
%{ /* NOCONTEXT */ |
|
1932 | 5908 |
SETWIN(aGLXWindowId) |
5909 |
#ifdef GLX |
|
294 | 5910 |
endfullscrn(); |
1932 | 5911 |
#endif |
5912 |
%} |
|
294 | 5913 |
! |
5914 |
||
5915 |
glxEndpupmodeIn: aGLXWindowId |
|
5916 |
||
5917 |
%{ /* NOCONTEXT */ |
|
1932 | 5918 |
SETWIN(aGLXWindowId) |
5919 |
#ifdef GLX |
|
294 | 5920 |
endpupmode(); |
1932 | 5921 |
#endif |
5922 |
%} |
|
294 | 5923 |
! |
5924 |
||
5925 |
glxFinishIn: aGLXWindowId |
|
5926 |
||
5927 |
%{ /* NOCONTEXT */ |
|
1932 | 5928 |
SETWIN(aGLXWindowId) |
5929 |
#ifdef GLX |
|
294 | 5930 |
finish(); |
1932 | 5931 |
#endif |
5932 |
%} |
|
294 | 5933 |
! |
5934 |
||
5935 |
glxFont: fntnum in: aGLXWindowId |
|
5936 |
||
5937 |
%{ /* NOCONTEXT */ |
|
5938 |
SETWIN(aGLXWindowId) |
|
1932 | 5939 |
#ifdef GLX |
294 | 5940 |
font(_shortVal(fntnum)); |
1932 | 5941 |
#endif |
294 | 5942 |
%} |
5943 |
! |
|
5944 |
||
5945 |
glxForegroundIn: aGLXWindowId |
|
5946 |
||
5947 |
%{ /* NOCONTEXT */ |
|
5948 |
SETWIN(aGLXWindowId) |
|
1932 | 5949 |
#ifdef OPENGL |
5950 |
#else |
|
294 | 5951 |
foreground(); |
1932 | 5952 |
#endif |
294 | 5953 |
%} |
5954 |
! |
|
5955 |
||
5956 |
glxFreepup: pup in: aGLXWindowId |
|
5957 |
||
5958 |
%{ /* NOCONTEXT */ |
|
1932 | 5959 |
SETWIN(aGLXWindowId) |
5960 |
#ifdef GLX |
|
294 | 5961 |
freepup(_longVal(pup)); |
1932 | 5962 |
#endif |
5963 |
%} |
|
294 | 5964 |
! |
5965 |
||
5966 |
glxFudgeXfudge: xfudge yfudge: yfudge in: aGLXWindowId |
|
5967 |
||
5968 |
%{ /* NOCONTEXT */ |
|
1932 | 5969 |
SETWIN(aGLXWindowId) |
5970 |
#ifdef GLX |
|
294 | 5971 |
fudge(_longVal(xfudge), _longVal(yfudge)); |
1932 | 5972 |
#endif |
5973 |
%} |
|
294 | 5974 |
! |
5975 |
||
5976 |
glxFullscrnIn: aGLXWindowId |
|
5977 |
||
5978 |
%{ /* NOCONTEXT */ |
|
1932 | 5979 |
SETWIN(aGLXWindowId) |
5980 |
#ifdef GLX |
|
294 | 5981 |
fullscrn(); |
1932 | 5982 |
#endif |
5983 |
%} |
|
294 | 5984 |
! |
5985 |
||
5986 |
glxGbeginIn: aGLXWindowId |
|
5987 |
||
5988 |
%{ /* NOCONTEXT */ |
|
1932 | 5989 |
SETWIN(aGLXWindowId) |
5990 |
#ifdef GLX |
|
294 | 5991 |
gbegin(); |
1932 | 5992 |
#endif |
5993 |
%} |
|
294 | 5994 |
! |
5995 |
||
5996 |
glxGentagIn: aGLXWindowId |
|
5997 |
||
5998 |
%{ /* NOCONTEXT */ |
|
1932 | 5999 |
int rslt = -1; |
6000 |
||
6001 |
#ifdef GLX |
|
6002 |
SETWIN(aGLXWindowId) |
|
6003 |
rslt = gentag(); |
|
6004 |
#endif |
|
6005 |
RETURN (__MKSMALLINT(rslt)); |
|
6006 |
%} |
|
294 | 6007 |
! |
6008 |
||
6009 |
glxGetbackfaceIn: aGLXWindowId |
|
6010 |
||
6011 |
%{ /* NOCONTEXT */ |
|
1932 | 6012 |
int rslt = -1; |
6013 |
||
6014 |
#ifdef GLX |
|
6015 |
SETWIN(aGLXWindowId) |
|
6016 |
rslt = getbackface(); |
|
6017 |
#endif |
|
6018 |
RETURN (__MKSMALLINT(rslt)); |
|
6019 |
%} |
|
294 | 6020 |
! |
6021 |
||
6022 |
glxGetbufferIn: aGLXWindowId |
|
6023 |
||
6024 |
%{ /* NOCONTEXT */ |
|
1932 | 6025 |
int rslt = -1; |
6026 |
||
6027 |
#ifdef GLX |
|
6028 |
SETWIN(aGLXWindowId) |
|
6029 |
rslt = getbuffer(); |
|
6030 |
#endif |
|
6031 |
RETURN (__MKSMALLINT(rslt)); |
|
6032 |
%} |
|
294 | 6033 |
! |
6034 |
||
6035 |
glxGetbutton: num in: aGLXWindowId |
|
6036 |
||
6037 |
%{ /* NOCONTEXT */ |
|
1932 | 6038 |
int rslt = -1; |
6039 |
||
6040 |
SETWIN(aGLXWindowId) |
|
6041 |
#ifdef OPENGL |
|
6042 |
#else |
|
6043 |
rslt = getbutton(_deviceVal(num)); |
|
6044 |
#endif |
|
6045 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6046 |
%} |
6047 |
! |
|
6048 |
||
6049 |
glxGetcmmodeIn: aGLXWindowId |
|
6050 |
||
6051 |
%{ /* NOCONTEXT */ |
|
1932 | 6052 |
int rslt = 0; |
6053 |
||
6054 |
SETWIN(aGLXWindowId) |
|
6055 |
#ifdef GLX |
|
6056 |
rslt = getcmmode(); |
|
6057 |
#endif |
|
6058 |
RETURN (__MKBOOLEAN(rslt)); |
|
6059 |
%} |
|
294 | 6060 |
! |
6061 |
||
6062 |
glxGetcolorIn: aGLXWindowId |
|
6063 |
"return the current drawing color" |
|
6064 |
||
6065 |
%{ /* NOCONTEXT */ |
|
1932 | 6066 |
int rslt = -1; |
6067 |
||
6068 |
SETWIN(aGLXWindowId) |
|
6069 |
#ifdef OPENGL |
|
6070 |
#else |
|
6071 |
rslt = getcolor(); |
|
6072 |
#endif |
|
6073 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6074 |
%} |
6075 |
! |
|
6076 |
||
6077 |
glxGetdcmIn: aGLXWindowId |
|
6078 |
||
6079 |
%{ /* NOCONTEXT */ |
|
6080 |
#ifdef GLX |
|
6081 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6082 |
RETURN (__MKBOOLEAN(getdcm())); |
294 | 6083 |
#endif |
6084 |
%} |
|
6085 |
. |
|
6086 |
^ false |
|
6087 |
! |
|
6088 |
||
6089 |
glxGetdescenderIn: aGLXWindowId |
|
6090 |
||
6091 |
%{ /* NOCONTEXT */ |
|
6092 |
#ifdef GLX |
|
6093 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6094 |
RETURN (__MKSMALLINT(getdescender())); |
294 | 6095 |
#endif |
6096 |
%} |
|
6097 |
. |
|
6098 |
^ false |
|
6099 |
! |
|
6100 |
||
6101 |
glxGetdisplaymodeIn: aGLXWindowId |
|
6102 |
||
6103 |
%{ /* NOCONTEXT */ |
|
6104 |
#ifdef GLX |
|
6105 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6106 |
RETURN (__MKSMALLINT(getdisplaymode())); |
294 | 6107 |
#endif |
6108 |
%} |
|
6109 |
. |
|
6110 |
^ false |
|
6111 |
! |
|
6112 |
||
6113 |
glxGetdrawmodeIn: aGLXWindowId |
|
6114 |
||
6115 |
%{ /* NOCONTEXT */ |
|
6116 |
#ifdef GLX |
|
6117 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6118 |
RETURN (__MKSMALLINT(getdrawmode())); |
294 | 6119 |
#endif |
6120 |
%} |
|
6121 |
. |
|
6122 |
^ false |
|
6123 |
! |
|
6124 |
||
6125 |
glxGetfontIn: aGLXWindowId |
|
6126 |
||
6127 |
%{ /* NOCONTEXT */ |
|
6128 |
#ifdef GLX |
|
6129 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6130 |
RETURN (__MKSMALLINT(getfont())); |
294 | 6131 |
#endif |
6132 |
%} |
|
6133 |
. |
|
6134 |
^ false |
|
6135 |
! |
|
6136 |
||
6137 |
glxGetgconfigBuffer: buffer in: aGLXWindowId |
|
6138 |
||
6139 |
%{ /* NOCONTEXT */ |
|
6140 |
#ifdef FULL_GLX |
|
6141 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6142 |
RETURN (__MKSMALLINT(getgconfig(_longVal(buffer)))); |
294 | 6143 |
#endif |
6144 |
%} |
|
6145 |
. |
|
6146 |
^ false |
|
6147 |
! |
|
6148 |
||
6149 |
glxGetgdescInquiry: inquiry in: aGLXWindowId |
|
6150 |
||
6151 |
%{ /* NOCONTEXT */ |
|
1932 | 6152 |
int rslt = 0; |
6153 |
||
6154 |
SETWIN(aGLXWindowId) |
|
6155 |
#ifdef OPENGL |
|
6156 |
#else |
|
6157 |
rslt = getgdesc(_longVal(inquiry)); |
|
6158 |
#endif |
|
6159 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6160 |
%} |
6161 |
! |
|
6162 |
||
6163 |
glxGetheightIn: aGLXWindowId |
|
6164 |
||
6165 |
%{ /* NOCONTEXT */ |
|
1932 | 6166 |
int rslt = 0; |
6167 |
||
6168 |
SETWIN(aGLXWindowId) |
|
6169 |
#ifdef OPENGL |
|
6170 |
#else |
|
6171 |
rslt = getheight(); |
|
6172 |
#endif |
|
6173 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6174 |
%} |
6175 |
! |
|
6176 |
||
6177 |
glxGethitcodeIn: aGLXWindowId |
|
6178 |
||
6179 |
%{ /* NOCONTEXT */ |
|
6180 |
#ifdef GLX |
|
6181 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6182 |
RETURN (__MKSMALLINT(gethitcode())); |
294 | 6183 |
#endif |
6184 |
%} |
|
6185 |
. |
|
6186 |
^ false |
|
6187 |
! |
|
6188 |
||
6189 |
glxGetlsbackupIn: aGLXWindowId |
|
6190 |
||
6191 |
%{ /* NOCONTEXT */ |
|
6192 |
#ifdef GLX |
|
6193 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6194 |
RETURN (__MKBOOLEAN(getlsbackup())); |
294 | 6195 |
#endif |
6196 |
%} |
|
6197 |
. |
|
6198 |
^ false |
|
6199 |
! |
|
6200 |
||
6201 |
glxGetlsrepeatIn: aGLXWindowId |
|
6202 |
||
6203 |
%{ /* NOCONTEXT */ |
|
6204 |
#ifdef GLX |
|
6205 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6206 |
RETURN (__MKSMALLINT(getlsrepeat())); |
294 | 6207 |
#endif |
6208 |
%} |
|
6209 |
. |
|
6210 |
^ false |
|
6211 |
! |
|
6212 |
||
6213 |
glxGetlstyleIn: aGLXWindowId |
|
6214 |
||
6215 |
%{ /* NOCONTEXT */ |
|
6216 |
#ifdef GLX |
|
6217 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6218 |
RETURN (__MKSMALLINT(getlstyle())); |
294 | 6219 |
#endif |
6220 |
%} |
|
6221 |
. |
|
6222 |
^ false |
|
6223 |
! |
|
6224 |
||
6225 |
glxGetlwidthIn: aGLXWindowId |
|
6226 |
||
6227 |
%{ /* NOCONTEXT */ |
|
6228 |
#ifdef GLX |
|
6229 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6230 |
RETURN (__MKSMALLINT(getlwidth())); |
294 | 6231 |
#endif |
6232 |
%} |
|
6233 |
. |
|
6234 |
^ false |
|
6235 |
! |
|
6236 |
||
6237 |
glxGetmapIn: aGLXWindowId |
|
6238 |
||
6239 |
%{ /* NOCONTEXT */ |
|
6240 |
#ifdef GLX |
|
6241 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6242 |
RETURN (__MKSMALLINT(getmap())); |
294 | 6243 |
#endif |
6244 |
%} |
|
6245 |
. |
|
6246 |
^ false |
|
6247 |
! |
|
6248 |
||
6249 |
glxGetmmodeIn: aGLXWindowId |
|
6250 |
||
6251 |
%{ /* NOCONTEXT */ |
|
6252 |
#ifdef GLX |
|
6253 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6254 |
RETURN (__MKSMALLINT(getmmode())); |
294 | 6255 |
#endif |
6256 |
%} |
|
6257 |
. |
|
6258 |
^ false |
|
6259 |
! |
|
6260 |
||
6261 |
glxGetmonitorIn: aGLXWindowId |
|
6262 |
||
6263 |
%{ /* NOCONTEXT */ |
|
6264 |
#ifdef GLX |
|
6265 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6266 |
RETURN (__MKSMALLINT(getmonitor())); |
294 | 6267 |
#endif |
6268 |
%} |
|
6269 |
. |
|
6270 |
^ false |
|
6271 |
! |
|
6272 |
||
6273 |
glxGetmultisampleIn: aGLXWindowId |
|
6274 |
||
6275 |
%{ /* NOCONTEXT */ |
|
6276 |
#ifdef FULL_GLX |
|
6277 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6278 |
RETURN (__MKBOOLEAN(getmultisample())); |
294 | 6279 |
#endif |
6280 |
%} |
|
6281 |
. |
|
6282 |
^ false |
|
6283 |
! |
|
6284 |
||
6285 |
glxGetothermonitorIn: aGLXWindowId |
|
6286 |
||
6287 |
%{ /* NOCONTEXT */ |
|
6288 |
#ifdef GLX |
|
6289 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6290 |
RETURN (__MKSMALLINT(getothermonitor())); |
294 | 6291 |
#endif |
6292 |
%} |
|
6293 |
. |
|
6294 |
^ false |
|
6295 |
! |
|
6296 |
||
6297 |
glxGetpatternIn: aGLXWindowId |
|
6298 |
||
6299 |
%{ /* NOCONTEXT */ |
|
6300 |
#ifdef GLX |
|
6301 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6302 |
RETURN (__MKSMALLINT(getpattern())); |
294 | 6303 |
#endif |
6304 |
%} |
|
6305 |
. |
|
6306 |
^ false |
|
6307 |
! |
|
6308 |
||
6309 |
glxGetresetlsIn: aGLXWindowId |
|
6310 |
||
6311 |
%{ /* NOCONTEXT */ |
|
6312 |
#ifdef GLX |
|
6313 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6314 |
RETURN (__MKBOOLEAN(getresetls())); |
294 | 6315 |
#endif |
6316 |
%} |
|
6317 |
. |
|
6318 |
^ false |
|
6319 |
! |
|
6320 |
||
6321 |
glxGetshadeIn: aGLXWindowId |
|
6322 |
||
6323 |
%{ /* NOCONTEXT */ |
|
6324 |
#ifdef GLX |
|
6325 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6326 |
RETURN (__MKSMALLINT(getshade())); |
294 | 6327 |
#endif |
6328 |
%} |
|
6329 |
. |
|
6330 |
^ false |
|
6331 |
! |
|
6332 |
||
6333 |
glxGetsmIn: aGLXWindowId |
|
6334 |
||
6335 |
%{ /* NOCONTEXT */ |
|
6336 |
#ifdef GLX |
|
6337 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6338 |
RETURN (__MKSMALLINT(getsm())); |
294 | 6339 |
#endif |
6340 |
%} |
|
6341 |
. |
|
6342 |
^ false |
|
6343 |
! |
|
6344 |
||
6345 |
glxGetvaluator: dev in: aGLXWindowId |
|
6346 |
||
6347 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
6348 |
#ifndef OPENGL |
294 | 6349 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6350 |
RETURN (__MKSMALLINT(getvaluator(_deviceVal(dev)))); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
6351 |
#endif |
294 | 6352 |
%} |
6353 |
. |
|
6354 |
^ false |
|
6355 |
! |
|
6356 |
||
6357 |
glxGetvideo: reg in: aGLXWindowId |
|
6358 |
||
6359 |
%{ /* NOCONTEXT */ |
|
6360 |
#ifdef GLX |
|
6361 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6362 |
RETURN (__MKSMALLINT(getvideo(_longVal(reg)))); |
294 | 6363 |
#endif |
6364 |
%} |
|
6365 |
. |
|
6366 |
^ false |
|
6367 |
! |
|
6368 |
||
6369 |
glxGetwritemaskIn: aGLXWindowId |
|
6370 |
||
6371 |
%{ /* NOCONTEXT */ |
|
6372 |
#ifdef GLX |
|
6373 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6374 |
RETURN (__MKSMALLINT(getwritemask())); |
294 | 6375 |
#endif |
6376 |
%} |
|
6377 |
. |
|
6378 |
^ false |
|
6379 |
! |
|
6380 |
||
6381 |
glxGetwscrnIn: aGLXWindowId |
|
6382 |
||
6383 |
%{ /* NOCONTEXT */ |
|
6384 |
#ifdef GLX |
|
6385 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6386 |
RETURN (__MKSMALLINT(getwscrn())); |
294 | 6387 |
#endif |
6388 |
%} |
|
6389 |
. |
|
6390 |
^ false |
|
6391 |
! |
|
6392 |
||
6393 |
glxGetzbufferIn: aGLXWindowId |
|
6394 |
||
6395 |
%{ /* NOCONTEXT */ |
|
6396 |
#ifdef GLX |
|
6397 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6398 |
RETURN (__MKBOOLEAN(getzbuffer())); |
294 | 6399 |
#endif |
6400 |
%} |
|
6401 |
. |
|
6402 |
^ false |
|
6403 |
! |
|
6404 |
||
6405 |
glxGexitIn: aGLXWindowId |
|
6406 |
||
6407 |
%{ /* NOCONTEXT */ |
|
1932 | 6408 |
SETWIN(aGLXWindowId) |
6409 |
#ifdef OPENGL |
|
6410 |
#else |
|
294 | 6411 |
gexit(); |
1932 | 6412 |
#endif |
6413 |
%} |
|
294 | 6414 |
! |
6415 |
||
6416 |
glxGflushIn: aGLXWindowId |
|
6417 |
||
6418 |
%{ /* NOCONTEXT */ |
|
6419 |
#ifdef GLX |
|
6420 |
SETWIN(aGLXWindowId) |
|
6421 |
gflush(); |
|
1932 | 6422 |
#endif |
6423 |
%} |
|
294 | 6424 |
! |
6425 |
||
6426 |
glxGinitIn: aGLXWindowId |
|
6427 |
||
6428 |
%{ /* NOCONTEXT */ |
|
1932 | 6429 |
SETWIN(aGLXWindowId) |
6430 |
#ifdef OPENGL |
|
6431 |
#else |
|
294 | 6432 |
ginit(); |
1932 | 6433 |
#endif |
6434 |
%} |
|
294 | 6435 |
! |
6436 |
||
6437 |
glxGlcompatMode: mode value: value in: aGLXWindowId |
|
6438 |
||
6439 |
%{ /* NOCONTEXT */ |
|
6440 |
#ifdef GLX |
|
6441 |
SETWIN(aGLXWindowId) |
|
6442 |
glcompat(_longVal(mode), _longVal(value)); |
|
1932 | 6443 |
#endif |
6444 |
%} |
|
294 | 6445 |
! |
6446 |
||
6447 |
glxGresetIn: aGLXWindowId |
|
6448 |
||
6449 |
%{ /* NOCONTEXT */ |
|
6450 |
#ifdef GLX |
|
6451 |
SETWIN(aGLXWindowId) |
|
6452 |
greset(); |
|
1932 | 6453 |
#endif |
6454 |
%} |
|
294 | 6455 |
! |
6456 |
||
6457 |
glxGsyncIn: aGLXWindowId |
|
6458 |
||
6459 |
%{ /* NOCONTEXT */ |
|
6460 |
#ifdef GLX |
|
6461 |
SETWIN(aGLXWindowId) |
|
6462 |
gsync(); |
|
1932 | 6463 |
#endif |
6464 |
%} |
|
294 | 6465 |
! |
6466 |
||
6467 |
glxIconsizeX: x y: y in: aGLXWindowId |
|
6468 |
||
6469 |
%{ /* NOCONTEXT */ |
|
6470 |
#ifdef GLX |
|
6471 |
SETWIN(aGLXWindowId) |
|
6472 |
iconsize(_longVal(x), _longVal(y)); |
|
1932 | 6473 |
#endif |
6474 |
%} |
|
294 | 6475 |
! |
6476 |
||
6477 |
glxImakebackgroundIn: aGLXWindowId |
|
6478 |
||
6479 |
%{ /* NOCONTEXT */ |
|
6480 |
#ifdef GLX |
|
6481 |
SETWIN(aGLXWindowId) |
|
6482 |
imakebackground(); |
|
1932 | 6483 |
#endif |
6484 |
%} |
|
294 | 6485 |
! |
6486 |
||
6487 |
glxInitnamesIn: aGLXWindowId |
|
6488 |
||
6489 |
%{ /* NOCONTEXT */ |
|
6490 |
#ifdef GLX |
|
6491 |
SETWIN(aGLXWindowId) |
|
6492 |
initnames(); |
|
1932 | 6493 |
#endif |
6494 |
%} |
|
294 | 6495 |
! |
6496 |
||
6497 |
glxIsqueued: dev in: aGLXWindowId |
|
6498 |
||
6499 |
%{ /* NOCONTEXT */ |
|
6500 |
#ifdef GLX |
|
6501 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6502 |
RETURN (__MKBOOLEAN(isqueued(_deviceVal(dev)))); |
294 | 6503 |
#endif |
6504 |
%} |
|
6505 |
. |
|
6506 |
^ false |
|
6507 |
! |
|
6508 |
||
6509 |
glxIstag: t in: aGLXWindowId |
|
6510 |
||
6511 |
%{ /* NOCONTEXT */ |
|
6512 |
#ifdef GLX |
|
6513 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6514 |
RETURN (__MKBOOLEAN(istag(_tagVal(t)))); |
294 | 6515 |
#endif |
6516 |
%} |
|
6517 |
. |
|
6518 |
^ false |
|
6519 |
! |
|
6520 |
||
6521 |
glxKeepaspectX: x y: y in: aGLXWindowId |
|
6522 |
||
6523 |
%{ /* NOCONTEXT */ |
|
6524 |
#ifdef GLX |
|
6525 |
SETWIN(aGLXWindowId) |
|
6526 |
keepaspect(_longVal(x), _longVal(y)); |
|
6527 |
RETURN (true); |
|
6528 |
#endif |
|
6529 |
%} |
|
6530 |
. |
|
6531 |
^ false |
|
6532 |
! |
|
6533 |
||
6534 |
glxLinesmoothMode: mode in: aGLXWindowId |
|
6535 |
||
6536 |
%{ /* NOCONTEXT */ |
|
6537 |
#ifdef GLX |
|
6538 |
SETWIN(aGLXWindowId) |
|
6539 |
linesmooth((ulong)__intVal(mode)); |
|
6540 |
RETURN (true); |
|
6541 |
#endif |
|
6542 |
%} |
|
6543 |
. |
|
6544 |
^ false |
|
6545 |
! |
|
6546 |
||
6547 |
glxLmcolorMode: mode in: aGLXWindowId |
|
6548 |
||
6549 |
%{ /* NOCONTEXT */ |
|
6550 |
#ifdef GLX |
|
6551 |
SETWIN(aGLXWindowId) |
|
6552 |
lmcolor(_longVal(mode)); |
|
6553 |
RETURN (true); |
|
6554 |
#endif |
|
6555 |
%} |
|
6556 |
. |
|
6557 |
^ false |
|
6558 |
! |
|
6559 |
||
6560 |
glxLoadname: name in: aGLXWindowId |
|
6561 |
||
6562 |
%{ /* NOCONTEXT */ |
|
6563 |
#ifdef GLX |
|
6564 |
SETWIN(aGLXWindowId) |
|
6565 |
loadname(_shortVal(name)); |
|
6566 |
RETURN (true); |
|
6567 |
#endif |
|
6568 |
%} |
|
6569 |
. |
|
6570 |
^ false |
|
6571 |
! |
|
6572 |
||
6573 |
glxLogicop: opcode in: aGLXWindowId |
|
6574 |
||
6575 |
%{ /* NOCONTEXT */ |
|
6576 |
#ifdef GLX |
|
6577 |
SETWIN(aGLXWindowId) |
|
6578 |
logicop(_longVal(opcode)); |
|
6579 |
RETURN (true); |
|
6580 |
#endif |
|
6581 |
%} |
|
6582 |
. |
|
6583 |
^ false |
|
6584 |
! |
|
6585 |
||
6586 |
glxLsbackup: b in: aGLXWindowId |
|
6587 |
||
6588 |
%{ /* NOCONTEXT */ |
|
6589 |
#ifdef GLX |
|
6590 |
SETWIN(aGLXWindowId) |
|
6591 |
lsbackup(_booleanVal(b)); |
|
6592 |
RETURN (true); |
|
6593 |
#endif |
|
6594 |
%} |
|
6595 |
. |
|
6596 |
^ false |
|
6597 |
! |
|
6598 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6599 |
glxLsetdepthNear:znear far:zfar in: aGLXWindowId |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6600 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6601 |
%{ /* NOCONTEXT */ |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6602 |
#ifdef GLX |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6603 |
SETWIN(aGLXWindowId) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6604 |
lsetdepth(_longVal(znear), _longVal(zfar)); |
294 | 6605 |
RETURN (true); |
6606 |
#endif |
|
6607 |
%} |
|
6608 |
. |
|
6609 |
^ false |
|
6610 |
! |
|
6611 |
||
6612 |
glxLshaderangeLowin: lowin hiwin: hiwin znear: znear zfar: zfar in: aGLXWindowId |
|
6613 |
||
6614 |
%{ /* NOCONTEXT */ |
|
6615 |
#ifdef GLX |
|
6616 |
SETWIN(aGLXWindowId) |
|
6617 |
lshaderange(_colorindexVal(lowin), _colorindexVal(hiwin), |
|
6618 |
_longVal(znear), _longVal(zfar)); |
|
6619 |
RETURN (true); |
|
6620 |
#endif |
|
6621 |
%} |
|
6622 |
. |
|
6623 |
^ false |
|
6624 |
! |
|
6625 |
||
6626 |
glxLsrepeatFactor: factor in: aGLXWindowId |
|
6627 |
||
6628 |
%{ /* NOCONTEXT */ |
|
6629 |
#ifdef GLX |
|
6630 |
SETWIN(aGLXWindowId) |
|
6631 |
lsrepeat(_longVal(factor)); |
|
6632 |
RETURN (true); |
|
6633 |
#endif |
|
6634 |
%} |
|
6635 |
. |
|
6636 |
^ false |
|
6637 |
! |
|
6638 |
||
6639 |
glxMaketag: t in: aGLXWindowId |
|
6640 |
||
6641 |
%{ /* NOCONTEXT */ |
|
6642 |
#ifdef GLX |
|
6643 |
SETWIN(aGLXWindowId) |
|
6644 |
maketag(_tagVal(t)); |
|
6645 |
RETURN (true); |
|
6646 |
#endif |
|
6647 |
%} |
|
6648 |
. |
|
6649 |
^ false |
|
6650 |
! |
|
6651 |
||
6652 |
glxMaxsizeX: x y: y in: aGLXWindowId |
|
6653 |
||
6654 |
%{ /* NOCONTEXT */ |
|
6655 |
#ifdef GLX |
|
6656 |
SETWIN(aGLXWindowId) |
|
6657 |
maxsize(_longVal(x), _longVal(y)); |
|
6658 |
RETURN (true); |
|
6659 |
#endif |
|
6660 |
%} |
|
6661 |
. |
|
6662 |
^ false |
|
6663 |
! |
|
6664 |
||
6665 |
glxMinsizeX: x y: y in: aGLXWindowId |
|
6666 |
||
6667 |
%{ /* NOCONTEXT */ |
|
6668 |
#ifdef GLX |
|
6669 |
SETWIN(aGLXWindowId) |
|
6670 |
minsize(_longVal(x), _longVal(y)); |
|
6671 |
RETURN (true); |
|
6672 |
#endif |
|
6673 |
%} |
|
6674 |
. |
|
6675 |
^ false |
|
6676 |
! |
|
6677 |
||
6678 |
glxMsalphaMode: mode in: aGLXWindowId |
|
6679 |
||
6680 |
%{ /* NOCONTEXT */ |
|
6681 |
#ifdef FULL_GLX |
|
6682 |
SETWIN(aGLXWindowId) |
|
6683 |
msalpha(_longVal(mode)); |
|
6684 |
RETURN (true); |
|
6685 |
#endif |
|
6686 |
%} |
|
6687 |
. |
|
6688 |
^ false |
|
6689 |
! |
|
6690 |
||
6691 |
glxMsmask: mask inverse: inverse in: aGLXWindowId |
|
6692 |
||
6693 |
%{ /* NOCONTEXT */ |
|
6694 |
#ifdef FULL_GLX |
|
6695 |
SETWIN(aGLXWindowId) |
|
6696 |
msmask(_floatVal(mask), _booleanVal(inverse)); |
|
6697 |
RETURN (true); |
|
6698 |
#endif |
|
6699 |
%} |
|
6700 |
. |
|
6701 |
^ false |
|
6702 |
! |
|
6703 |
||
6704 |
glxMspattern: pattern in: aGLXWindowId |
|
6705 |
||
6706 |
%{ /* NOCONTEXT */ |
|
6707 |
#ifdef FULL_GLX |
|
6708 |
SETWIN(aGLXWindowId) |
|
6709 |
mspattern(_longVal(pattern)); |
|
6710 |
RETURN (true); |
|
6711 |
#endif |
|
6712 |
%} |
|
6713 |
. |
|
6714 |
^ false |
|
6715 |
! |
|
6716 |
||
6717 |
glxMssizeSamples: samples zsize: zsize ssize: ssize in: aGLXWindowId |
|
6718 |
||
6719 |
%{ /* NOCONTEXT */ |
|
6720 |
#ifdef FULL_GLX |
|
6721 |
SETWIN(aGLXWindowId) |
|
6722 |
mssize(_longVal(samples), _longVal(zsize), _longVal(ssize)); |
|
6723 |
RETURN (true); |
|
6724 |
#endif |
|
6725 |
%} |
|
6726 |
. |
|
6727 |
^ false |
|
6728 |
! |
|
6729 |
||
6730 |
glxMswapbuffers: fbuf in: aGLXWindowId |
|
6731 |
||
6732 |
%{ /* NOCONTEXT */ |
|
6733 |
#ifdef GLX |
|
6734 |
SETWIN(aGLXWindowId) |
|
6735 |
mswapbuffers(_longVal(fbuf)); |
|
6736 |
RETURN (true); |
|
6737 |
#endif |
|
6738 |
%} |
|
6739 |
. |
|
6740 |
^ false |
|
6741 |
! |
|
6742 |
||
6743 |
glxMultimapIn: aGLXWindowId |
|
6744 |
||
6745 |
%{ /* NOCONTEXT */ |
|
6746 |
#ifdef GLX |
|
6747 |
SETWIN(aGLXWindowId) |
|
6748 |
multimap(); |
|
6749 |
RETURN (true); |
|
6750 |
#endif |
|
6751 |
%} |
|
6752 |
. |
|
6753 |
^ false |
|
6754 |
! |
|
6755 |
||
6756 |
glxMultisample: bool in: aGLXWindowId |
|
6757 |
||
6758 |
%{ /* NOCONTEXT */ |
|
6759 |
#ifdef FULL_GLX |
|
6760 |
SETWIN(aGLXWindowId) |
|
6761 |
multisample(_booleanVal(bool)); |
|
6762 |
RETURN (true); |
|
6763 |
#endif |
|
6764 |
%} |
|
6765 |
. |
|
6766 |
^ false |
|
6767 |
! |
|
6768 |
||
6769 |
glxNewpupIn: aGLXWindowId |
|
6770 |
||
6771 |
%{ /* NOCONTEXT */ |
|
6772 |
#ifdef GLX |
|
6773 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6774 |
RETURN (__MKSMALLINT(newpup())); |
294 | 6775 |
#endif |
6776 |
%} |
|
6777 |
. |
|
6778 |
^ false |
|
6779 |
! |
|
6780 |
||
6781 |
glxNewtag: newtg oldtg: oldtg offst: offst in: aGLXWindowId |
|
6782 |
||
6783 |
%{ /* NOCONTEXT */ |
|
6784 |
#ifdef GLX |
|
6785 |
SETWIN(aGLXWindowId) |
|
6786 |
newtag(_tagVal(newtg), _tagVal(oldtg), _offsetVal(offst)); |
|
6787 |
RETURN (true); |
|
6788 |
#endif |
|
6789 |
%} |
|
6790 |
. |
|
6791 |
^ false |
|
6792 |
! |
|
6793 |
||
6794 |
glxNoborderIn: aGLXWindowId |
|
6795 |
||
6796 |
%{ /* NOCONTEXT */ |
|
6797 |
#ifdef GLX |
|
6798 |
SETWIN(aGLXWindowId) |
|
6799 |
noborder(); |
|
6800 |
RETURN (true); |
|
6801 |
#endif |
|
6802 |
%} |
|
6803 |
. |
|
6804 |
^ false |
|
6805 |
! |
|
6806 |
||
6807 |
glxNoise: v delta: delta in: aGLXWindowId |
|
6808 |
||
6809 |
%{ /* NOCONTEXT */ |
|
6810 |
#ifdef GLX |
|
6811 |
SETWIN(aGLXWindowId) |
|
6812 |
noise(_deviceVal(v), _shortVal(delta)); |
|
6813 |
RETURN (true); |
|
6814 |
#endif |
|
6815 |
%} |
|
6816 |
. |
|
6817 |
^ false |
|
6818 |
! |
|
6819 |
||
6820 |
glxNoportIn: aGLXWindowId |
|
6821 |
||
6822 |
%{ /* NOCONTEXT */ |
|
6823 |
#ifdef GLX |
|
6824 |
SETWIN(aGLXWindowId) |
|
6825 |
noport(); |
|
6826 |
RETURN (true); |
|
6827 |
#endif |
|
6828 |
%} |
|
6829 |
. |
|
6830 |
^ false |
|
6831 |
! |
|
6832 |
||
6833 |
glxNurbscurveKnotCount: knotCount knotList: knotList |
|
6834 |
offset: offset ctlArray: ctlArray |
|
6835 |
order: order type: type in: aGLXWindowId |
|
6836 |
||
6837 |
| ctlPoints i | |
|
6838 |
ctlPoints := DoubleArray new: ctlArray size * (ctlArray first size). |
|
6839 |
i := 1. |
|
6840 |
ctlArray do: [:point | |
|
6841 |
point do: [:coord | |
|
6842 |
ctlPoints at: i put: coord. |
|
6843 |
i := i + 1]]. |
|
6844 |
||
6845 |
%{ /* NOCONTEXT */ |
|
6846 |
#ifdef GLX |
|
6847 |
char *knotElements, *ctlElements; |
|
6848 |
OBJ cls; |
|
6849 |
int ninstVars, nInstBytes; |
|
6850 |
||
6851 |
SETWIN(aGLXWindowId) |
|
6852 |
cls = __qClass(ctlPoints); |
|
6853 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
6854 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
|
6855 |
||
6856 |
ctlElements = (char *)(_InstPtr(ctlPoints)) + nInstBytes; |
|
6857 |
knotElements = (char *)(_InstPtr(knotList)) + nInstBytes; |
|
6858 |
||
6859 |
nurbscurve ( |
|
6860 |
_longVal(knotCount), (double *)knotElements, |
|
6861 |
_longVal(offset), (double *)ctlElements, |
|
6862 |
_longVal(order), _longVal(type)); |
|
6863 |
RETURN(true); |
|
6864 |
#endif |
|
6865 |
%} |
|
6866 |
. |
|
6867 |
^ false |
|
6868 |
! |
|
6869 |
||
6870 |
glxObjdeleteTag1: tag1 tag2: tag2 in: aGLXWindowId |
|
6871 |
||
6872 |
%{ /* NOCONTEXT */ |
|
6873 |
#ifdef GLX |
|
6874 |
SETWIN(aGLXWindowId) |
|
6875 |
objdelete(_tagVal(tag1), _tagVal(tag2)); |
|
6876 |
RETURN (true); |
|
6877 |
#endif |
|
6878 |
%} |
|
6879 |
. |
|
6880 |
^ false |
|
6881 |
! |
|
6882 |
||
6883 |
glxObjinsert: t in: aGLXWindowId |
|
6884 |
||
6885 |
%{ /* NOCONTEXT */ |
|
6886 |
#ifdef GLX |
|
6887 |
SETWIN(aGLXWindowId) |
|
6888 |
objinsert(_tagVal(t)); |
|
6889 |
RETURN (true); |
|
6890 |
#endif |
|
6891 |
%} |
|
6892 |
. |
|
6893 |
^ false |
|
6894 |
! |
|
6895 |
||
6896 |
glxObjreplace: t in: aGLXWindowId |
|
6897 |
||
6898 |
%{ /* NOCONTEXT */ |
|
6899 |
#ifdef GLX |
|
6900 |
SETWIN(aGLXWindowId) |
|
6901 |
objreplace(_tagVal(t)); |
|
6902 |
RETURN (true); |
|
6903 |
#endif |
|
6904 |
%} |
|
6905 |
. |
|
6906 |
^ false |
|
6907 |
! |
|
6908 |
||
6909 |
glxOnemapIn: aGLXWindowId |
|
6910 |
||
6911 |
%{ /* NOCONTEXT */ |
|
6912 |
#ifdef GLX |
|
6913 |
SETWIN(aGLXWindowId) |
|
6914 |
onemap(); |
|
6915 |
RETURN (true); |
|
6916 |
#endif |
|
6917 |
%} |
|
6918 |
. |
|
6919 |
^ false |
|
6920 |
! |
|
6921 |
||
6922 |
glxPagecolor: pcolor in: aGLXWindowId |
|
6923 |
||
6924 |
%{ /* NOCONTEXT */ |
|
6925 |
#ifdef GLX |
|
6926 |
SETWIN(aGLXWindowId) |
|
6927 |
pagecolor(_colorindexVal(pcolor)); |
|
6928 |
RETURN (true); |
|
6929 |
#endif |
|
6930 |
%} |
|
6931 |
. |
|
6932 |
^ false |
|
6933 |
! |
|
6934 |
||
6935 |
glxPassthroughToken: token in: aGLXWindowId |
|
6936 |
||
6937 |
%{ /* NOCONTEXT */ |
|
6938 |
#ifdef GLX |
|
6939 |
SETWIN(aGLXWindowId) |
|
6940 |
passthrough(_shortVal(token)); |
|
6941 |
RETURN (true); |
|
6942 |
#endif |
|
6943 |
%} |
|
6944 |
. |
|
6945 |
^ false |
|
6946 |
! |
|
6947 |
||
6948 |
glxPclosIn: aGLXWindowId |
|
6949 |
||
6950 |
%{ /* NOCONTEXT */ |
|
6951 |
#ifdef GLX |
|
6952 |
SETWIN(aGLXWindowId) |
|
6953 |
pclos(); |
|
6954 |
RETURN (true); |
|
6955 |
#endif |
|
6956 |
%} |
|
6957 |
. |
|
6958 |
^ false |
|
6959 |
! |
|
6960 |
||
6961 |
glxPicksizeX: x y: y in: aGLXWindowId |
|
6962 |
||
6963 |
%{ /* NOCONTEXT */ |
|
6964 |
#ifdef GLX |
|
6965 |
SETWIN(aGLXWindowId) |
|
6966 |
picksize(_shortVal(x), _shortVal(y)); |
|
6967 |
RETURN (true); |
|
6968 |
#endif |
|
6969 |
%} |
|
6970 |
. |
|
6971 |
^ false |
|
6972 |
! |
|
6973 |
||
6974 |
glxPixmode: mode value: value in: aGLXWindowId |
|
6975 |
||
6976 |
%{ /* NOCONTEXT */ |
|
6977 |
#ifdef GLX |
|
6978 |
SETWIN(aGLXWindowId) |
|
6979 |
pixmode(_longVal(mode), _longVal(value)); |
|
6980 |
RETURN (true); |
|
6981 |
#endif |
|
6982 |
%} |
|
6983 |
. |
|
6984 |
^ false |
|
6985 |
! |
|
6986 |
||
6987 |
glxPntsmoothMode: mode in: aGLXWindowId |
|
6988 |
||
6989 |
%{ /* NOCONTEXT */ |
|
6990 |
#ifdef GLX |
|
6991 |
SETWIN(aGLXWindowId) |
|
6992 |
pntsmooth((ulong)__intVal(mode)); |
|
6993 |
RETURN (true); |
|
6994 |
#endif |
|
6995 |
%} |
|
6996 |
. |
|
6997 |
^ false |
|
6998 |
! |
|
6999 |
||
7000 |
glxPolysmoothMode: mode in: aGLXWindowId |
|
7001 |
||
7002 |
%{ /* NOCONTEXT */ |
|
7003 |
#ifdef GLX |
|
7004 |
SETWIN(aGLXWindowId) |
|
7005 |
polysmooth(_longVal(mode)); |
|
7006 |
RETURN (true); |
|
7007 |
#endif |
|
7008 |
%} |
|
7009 |
. |
|
7010 |
^ false |
|
7011 |
! |
|
7012 |
||
7013 |
glxPopnameIn: aGLXWindowId |
|
7014 |
||
7015 |
%{ /* NOCONTEXT */ |
|
7016 |
#ifdef GLX |
|
7017 |
SETWIN(aGLXWindowId) |
|
7018 |
popname(); |
|
7019 |
RETURN (true); |
|
7020 |
#endif |
|
7021 |
%} |
|
7022 |
. |
|
7023 |
^ false |
|
7024 |
! |
|
7025 |
||
7026 |
glxPrefpositionX1: x1 x2: x2 y1: y1 y2: y2 in: aGLXWindowId |
|
7027 |
||
7028 |
%{ /* NOCONTEXT */ |
|
7029 |
SETWIN(aGLXWindowId) |
|
1932 | 7030 |
#ifdef OPENGL |
7031 |
#else |
|
294 | 7032 |
prefposition(_longVal(x1), _longVal(x2), _longVal(y1), _longVal(y2)); |
1932 | 7033 |
#endif |
294 | 7034 |
RETURN (true); |
7035 |
%} |
|
7036 |
! |
|
7037 |
||
7038 |
glxPrefsizeX: x y: y in: aGLXWindowId |
|
7039 |
||
7040 |
%{ /* NOCONTEXT */ |
|
7041 |
SETWIN(aGLXWindowId) |
|
1932 | 7042 |
#ifdef OPENGL |
7043 |
#else |
|
294 | 7044 |
prefsize(_longVal(x), _longVal(y)); |
1932 | 7045 |
#endif |
294 | 7046 |
RETURN (true); |
7047 |
%} |
|
7048 |
! |
|
7049 |
||
7050 |
glxPupmodeIn: aGLXWindowId |
|
7051 |
||
7052 |
%{ /* NOCONTEXT */ |
|
7053 |
#ifdef GLX |
|
7054 |
SETWIN(aGLXWindowId) |
|
7055 |
pupmode(); |
|
7056 |
RETURN (true); |
|
7057 |
#endif |
|
7058 |
%} |
|
7059 |
. |
|
7060 |
^ false |
|
7061 |
! |
|
7062 |
||
7063 |
glxPushname: name In: aGLXWindowId |
|
7064 |
||
7065 |
%{ /* NOCONTEXT */ |
|
7066 |
#ifdef GLX |
|
7067 |
SETWIN(aGLXWindowId) |
|
7068 |
pushname(_shortVal(name)); |
|
7069 |
RETURN (true); |
|
7070 |
#endif |
|
7071 |
%} |
|
7072 |
. |
|
7073 |
^ false |
|
7074 |
! |
|
7075 |
||
7076 |
glxQdevice: dev in: aGLXWindowId |
|
7077 |
||
7078 |
%{ /* NOCONTEXT */ |
|
1932 | 7079 |
SETWIN(aGLXWindowId) |
7080 |
#ifdef OPENGL |
|
7081 |
#else |
|
294 | 7082 |
qdevice(_deviceVal(dev)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7083 |
#endif |
294 | 7084 |
%} |
7085 |
! |
|
7086 |
||
7087 |
glxQenterDev: dev val: val in: aGLXWindowId |
|
7088 |
||
7089 |
%{ /* NOCONTEXT */ |
|
7090 |
SETWIN(aGLXWindowId) |
|
1932 | 7091 |
#ifdef OPENGL |
7092 |
#else |
|
294 | 7093 |
qenter(_deviceVal(dev), _shortVal(val)); |
1932 | 7094 |
#endif |
294 | 7095 |
%} |
7096 |
! |
|
7097 |
||
7098 |
glxQgetfdIn: aGLXWindowId |
|
7099 |
||
7100 |
%{ /* NOCONTEXT */ |
|
7101 |
#ifdef GLX |
|
7102 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7103 |
RETURN (__MKSMALLINT(qgetfd())); |
294 | 7104 |
#endif |
7105 |
%} |
|
7106 |
. |
|
7107 |
^ false |
|
7108 |
! |
|
7109 |
||
7110 |
glxQreadIn: aGLXWindowId |
|
7111 |
||
7112 |
| dev data | |
|
7113 |
%{ |
|
7114 |
short c_data; |
|
7115 |
||
7116 |
SETWIN(aGLXWindowId) |
|
1932 | 7117 |
#ifdef OPENGL |
7118 |
#else |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7119 |
dev = __MKSMALLINT(qread(&c_data)); |
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7120 |
data = __MKSMALLINT(c_data); |
1932 | 7121 |
#endif |
294 | 7122 |
%} |
7123 |
. |
|
7124 |
^ Array with: dev with: data |
|
7125 |
! |
|
7126 |
||
7127 |
glxQresetIn: aGLXWindowId |
|
7128 |
||
7129 |
%{ /* NOCONTEXT */ |
|
7130 |
SETWIN(aGLXWindowId) |
|
1932 | 7131 |
#ifdef OPENGL |
7132 |
#else |
|
294 | 7133 |
qreset(); |
1932 | 7134 |
#endif |
294 | 7135 |
RETURN (true); |
7136 |
%} |
|
7137 |
! |
|
7138 |
||
7139 |
glxQtestIn: aGLXWindowId |
|
7140 |
||
7141 |
%{ /* NOCONTEXT */ |
|
1932 | 7142 |
int rslt = 0; |
7143 |
||
7144 |
SETWIN(aGLXWindowId) |
|
7145 |
#ifdef OPENGL |
|
7146 |
#else |
|
7147 |
rslt = qtest(); |
|
7148 |
#endif |
|
7149 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 7150 |
%} |
7151 |
! |
|
7152 |
||
7153 |
glxRGBcursorIndex: index red: red green: green blue: blue |
|
7154 |
redm: redm greenm: greenm bluem: bluem in: aGLXWindowId |
|
7155 |
||
7156 |
%{ /* NOCONTEXT */ |
|
7157 |
#ifdef GLX |
|
7158 |
SETWIN(aGLXWindowId) |
|
7159 |
RGBcursor(_shortVal(index), |
|
7160 |
_shortVal(red), _shortVal(green), _shortVal(blue), |
|
7161 |
_shortVal(redm), _shortVal(greenm), _shortVal(bluem)); |
|
7162 |
RETURN (true); |
|
7163 |
#endif |
|
7164 |
%} |
|
7165 |
. |
|
7166 |
^ false |
|
7167 |
! |
|
7168 |
||
7169 |
glxRGBwritemaskRed: red green: green blue: blue in: aGLXWindowId |
|
7170 |
||
7171 |
%{ /* NOCONTEXT */ |
|
7172 |
#ifdef GLX |
|
7173 |
SETWIN(aGLXWindowId) |
|
7174 |
RGBwritemask(_shortVal(red), _shortVal(green), _shortVal(blue)); |
|
7175 |
RETURN (true); |
|
7176 |
#endif |
|
7177 |
%} |
|
7178 |
. |
|
7179 |
^ false |
|
7180 |
! |
|
7181 |
||
7182 |
glxRectzoomX: xfactor y: yfactor in: aGLXWindowId |
|
7183 |
||
7184 |
%{ /* NOCONTEXT */ |
|
7185 |
#ifdef GLX |
|
7186 |
SETWIN(aGLXWindowId) |
|
7187 |
rectzoom(_floatVal(xfactor), _floatVal(yfactor)); |
|
7188 |
RETURN (true); |
|
7189 |
#endif |
|
7190 |
%} |
|
7191 |
. |
|
7192 |
^ false |
|
7193 |
! |
|
7194 |
||
7195 |
glxResetls: b in: aGLXWindowId |
|
7196 |
||
7197 |
%{ /* NOCONTEXT */ |
|
7198 |
#ifdef GLX |
|
7199 |
SETWIN(aGLXWindowId) |
|
7200 |
resetls(_booleanVal(b)); |
|
7201 |
RETURN (true); |
|
7202 |
#endif |
|
7203 |
%} |
|
7204 |
. |
|
7205 |
^ false |
|
7206 |
! |
|
7207 |
||
7208 |
glxRingbellIn: aGLXWindowId |
|
7209 |
||
7210 |
%{ /* NOCONTEXT */ |
|
7211 |
#ifdef GLX |
|
7212 |
SETWIN(aGLXWindowId) |
|
7213 |
ringbell(); |
|
7214 |
RETURN (true); |
|
7215 |
#endif |
|
7216 |
%} |
|
7217 |
. |
|
7218 |
^ false |
|
7219 |
! |
|
7220 |
||
7221 |
glxSboxX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7222 |
||
7223 |
%{ /* NOCONTEXT */ |
|
7224 |
#ifdef GLX |
|
7225 |
SETWIN(aGLXWindowId) |
|
7226 |
sbox(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
7227 |
RETURN (true); |
|
7228 |
#endif |
|
7229 |
%} |
|
7230 |
. |
|
7231 |
^ false |
|
7232 |
! |
|
7233 |
||
7234 |
glxSboxfX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7235 |
||
7236 |
%{ /* NOCONTEXT */ |
|
7237 |
#ifdef GLX |
|
7238 |
SETWIN(aGLXWindowId) |
|
7239 |
sboxf(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
7240 |
RETURN (true); |
|
7241 |
#endif |
|
7242 |
%} |
|
7243 |
. |
|
7244 |
^ false |
|
7245 |
! |
|
7246 |
||
7247 |
glxSboxfiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7248 |
||
7249 |
%{ /* NOCONTEXT */ |
|
7250 |
#ifdef GLX |
|
7251 |
SETWIN(aGLXWindowId) |
|
7252 |
sboxfi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
7253 |
RETURN (true); |
|
7254 |
#endif |
|
7255 |
%} |
|
7256 |
. |
|
7257 |
^ false |
|
7258 |
! |
|
7259 |
||
7260 |
glxSboxfsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7261 |
||
7262 |
%{ /* NOCONTEXT */ |
|
7263 |
#ifdef GLX |
|
7264 |
SETWIN(aGLXWindowId) |
|
7265 |
sboxfs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
7266 |
RETURN (true); |
|
7267 |
#endif |
|
7268 |
%} |
|
7269 |
. |
|
7270 |
^ false |
|
7271 |
! |
|
7272 |
||
7273 |
glxSboxiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7274 |
||
7275 |
%{ /* NOCONTEXT */ |
|
7276 |
#ifdef GLX |
|
7277 |
SETWIN(aGLXWindowId) |
|
7278 |
sboxi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
7279 |
RETURN (true); |
|
7280 |
#endif |
|
7281 |
%} |
|
7282 |
. |
|
7283 |
^ false |
|
7284 |
! |
|
7285 |
||
7286 |
glxSboxsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7287 |
||
7288 |
%{ /* NOCONTEXT */ |
|
7289 |
#ifdef GLX |
|
7290 |
SETWIN(aGLXWindowId) |
|
7291 |
sboxs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
7292 |
RETURN (true); |
|
7293 |
#endif |
|
7294 |
%} |
|
7295 |
. |
|
7296 |
^ false |
|
7297 |
! |
|
7298 |
||
7299 |
glxSclearSval: sval in: aGLXWindowId |
|
7300 |
||
7301 |
%{ /* NOCONTEXT */ |
|
7302 |
#ifdef GLX |
|
7303 |
SETWIN(aGLXWindowId) |
|
7304 |
sclear((ulong)__intVal(sval)); |
|
7305 |
RETURN (true); |
|
7306 |
#endif |
|
7307 |
%} |
|
7308 |
. |
|
7309 |
^ false |
|
7310 |
! |
|
7311 |
||
7312 |
glxScrbox: arg in: aGLXWindowId |
|
7313 |
||
7314 |
%{ /* NOCONTEXT */ |
|
7315 |
#ifdef GLX |
|
7316 |
SETWIN(aGLXWindowId) |
|
7317 |
scrbox(_longVal(arg)); |
|
7318 |
RETURN (true); |
|
7319 |
#endif |
|
7320 |
%} |
|
7321 |
. |
|
7322 |
^ false |
|
7323 |
! |
|
7324 |
||
7325 |
glxScreenspaceIn: aGLXWindowId |
|
7326 |
||
7327 |
%{ /* NOCONTEXT */ |
|
7328 |
#ifdef GLX |
|
7329 |
SETWIN(aGLXWindowId) |
|
7330 |
screenspace(); |
|
7331 |
RETURN (true); |
|
7332 |
#endif |
|
7333 |
%} |
|
7334 |
. |
|
7335 |
^ false |
|
7336 |
! |
|
7337 |
||
7338 |
glxScrmaskLeft: left right: right bottom: bottom top: top in: aGLXWindowId |
|
7339 |
||
7340 |
%{ /* NOCONTEXT */ |
|
7341 |
#ifdef GLX |
|
7342 |
SETWIN(aGLXWindowId) |
|
7343 |
scrmask(_screencoordVal(left), _screencoordVal(right), |
|
7344 |
_screencoordVal(bottom), _screencoordVal(top)); |
|
7345 |
RETURN (true); |
|
7346 |
#endif |
|
7347 |
%} |
|
7348 |
. |
|
7349 |
^ false |
|
7350 |
! |
|
7351 |
||
7352 |
glxScrnattach: gsnr in: aGLXWindowId |
|
7353 |
||
7354 |
%{ /* NOCONTEXT */ |
|
7355 |
#ifdef GLX |
|
7356 |
SETWIN(aGLXWindowId) |
|
7357 |
scrnattach(_longVal(gsnr)); |
|
7358 |
RETURN (true); |
|
7359 |
#endif |
|
7360 |
%} |
|
7361 |
. |
|
7362 |
^ false |
|
7363 |
! |
|
7364 |
||
7365 |
glxScrnselect: gsnr in: aGLXWindowId |
|
7366 |
||
7367 |
%{ /* NOCONTEXT */ |
|
7368 |
#ifdef GLX |
|
7369 |
SETWIN(aGLXWindowId) |
|
7370 |
scrnselect(_longVal(gsnr)); |
|
7371 |
RETURN (true); |
|
7372 |
#endif |
|
7373 |
%} |
|
7374 |
. |
|
7375 |
^ false |
|
7376 |
! |
|
7377 |
||
7378 |
glxSetcursorIndex: index color: color wtn: wtn in: aGLXWindowId |
|
7379 |
||
7380 |
%{ /* NOCONTEXT */ |
|
7381 |
#ifdef GLX |
|
7382 |
SETWIN(aGLXWindowId) |
|
7383 |
setcursor(_shortVal(index), _colorindexVal(color), _colorindexVal(wtn)); |
|
7384 |
RETURN (true); |
|
7385 |
#endif |
|
7386 |
%} |
|
7387 |
. |
|
7388 |
^ false |
|
7389 |
! |
|
7390 |
||
7391 |
glxSetdblightsMask: mask in: aGLXWindowId |
|
7392 |
||
7393 |
%{ /* NOCONTEXT */ |
|
7394 |
#ifdef GLX |
|
7395 |
SETWIN(aGLXWindowId) |
|
7396 |
setdblights((ulong)__intVal(mask)); |
|
7397 |
RETURN (true); |
|
7398 |
#endif |
|
7399 |
%} |
|
7400 |
. |
|
7401 |
^ false |
|
7402 |
! |
|
7403 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7404 |
glxSetdepthNear:znear far:zfar in: aGLXWindowId |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7405 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7406 |
%{ /* NOCONTEXT */ |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7407 |
#ifdef GLX |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7408 |
SETWIN(aGLXWindowId) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7409 |
setdepth(_screencoordVal(znear), _screencoordVal(zfar)); |
294 | 7410 |
RETURN (true); |
7411 |
#endif |
|
7412 |
%} |
|
7413 |
. |
|
7414 |
^ false |
|
7415 |
! |
|
7416 |
||
7417 |
glxSetmap: mapnum in: aGLXWindowId |
|
7418 |
||
7419 |
%{ /* NOCONTEXT */ |
|
7420 |
#ifdef GLX |
|
7421 |
SETWIN(aGLXWindowId) |
|
7422 |
setmap(_shortVal(mapnum)); |
|
7423 |
RETURN (true); |
|
7424 |
#endif |
|
7425 |
%} |
|
7426 |
. |
|
7427 |
^ false |
|
7428 |
! |
|
7429 |
||
7430 |
glxSetmonitor: mtype in: aGLXWindowId |
|
7431 |
||
7432 |
%{ /* NOCONTEXT */ |
|
7433 |
#ifdef GLX |
|
7434 |
SETWIN(aGLXWindowId) |
|
7435 |
setmonitor(_shortVal(mtype)); |
|
7436 |
RETURN (true); |
|
7437 |
#endif |
|
7438 |
%} |
|
7439 |
. |
|
7440 |
^ false |
|
7441 |
! |
|
7442 |
||
7443 |
glxSetnurbsproperty: property value: value in: aGLXWindowId |
|
7444 |
||
7445 |
%{ /* NOCONTEXT */ |
|
7446 |
#ifdef GLX |
|
7447 |
SETWIN(aGLXWindowId) |
|
7448 |
setnurbsproperty(_longVal(property), _floatVal(value)); |
|
7449 |
RETURN (true); |
|
7450 |
#endif |
|
7451 |
%} |
|
7452 |
. |
|
7453 |
^ false |
|
7454 |
! |
|
7455 |
||
7456 |
glxSetpattern: index in: aGLXWindowId |
|
7457 |
||
7458 |
%{ /* NOCONTEXT */ |
|
7459 |
#ifdef GLX |
|
7460 |
SETWIN(aGLXWindowId) |
|
7461 |
setpattern(_shortVal(index)); |
|
7462 |
RETURN (true); |
|
7463 |
#endif |
|
7464 |
%} |
|
7465 |
. |
|
7466 |
^ false |
|
7467 |
! |
|
7468 |
||
7469 |
glxSetpup: pup entry: entry mode: mode in: aGLXWindowId |
|
7470 |
||
7471 |
%{ /* NOCONTEXT */ |
|
7472 |
#ifdef GLX |
|
7473 |
SETWIN(aGLXWindowId) |
|
7474 |
setpup(_longVal(pup), _longVal(entry), (ulong)__intVal(mode)); |
|
7475 |
RETURN (true); |
|
7476 |
#endif |
|
7477 |
%} |
|
7478 |
. |
|
7479 |
^ false |
|
7480 |
! |
|
7481 |
||
7482 |
glxSetvaluator: v init: init vmin: vmin vmax: vmax in: aGLXWindowId |
|
7483 |
||
7484 |
%{ /* NOCONTEXT */ |
|
7485 |
#ifdef GLX |
|
7486 |
SETWIN(aGLXWindowId) |
|
7487 |
setvaluator(_deviceVal(v), _shortVal(init), _shortVal(vmin), _shortVal(vmax)); |
|
7488 |
RETURN (true); |
|
7489 |
#endif |
|
7490 |
%} |
|
7491 |
. |
|
7492 |
^ false |
|
7493 |
! |
|
7494 |
||
7495 |
glxSetvideo: reg value: value in: aGLXWindowId |
|
7496 |
||
7497 |
%{ /* NOCONTEXT */ |
|
7498 |
#ifdef GLX |
|
7499 |
SETWIN(aGLXWindowId) |
|
7500 |
setvideo(_longVal(reg), _longVal(value)); |
|
7501 |
RETURN (true); |
|
7502 |
#endif |
|
7503 |
%} |
|
7504 |
. |
|
7505 |
^ false |
|
7506 |
! |
|
7507 |
||
7508 |
glxShademodel: model in: aGLXWindowId |
|
7509 |
||
7510 |
%{ /* NOCONTEXT */ |
|
7511 |
#ifdef GLX |
|
7512 |
SETWIN(aGLXWindowId) |
|
7513 |
shademodel(_longVal(model)); |
|
7514 |
RETURN (true); |
|
7515 |
#endif |
|
7516 |
%} |
|
7517 |
. |
|
7518 |
^ false |
|
7519 |
! |
|
7520 |
||
7521 |
glxShaderangeLowin: lowin hiwin: hiwin z1: z1 z2: z2 in: aGLXWindowId |
|
7522 |
||
7523 |
%{ /* NOCONTEXT */ |
|
7524 |
#ifdef GLX |
|
7525 |
SETWIN(aGLXWindowId) |
|
7526 |
shaderange(_colorindexVal(lowin), _colorindexVal(hiwin), |
|
7527 |
_screencoordVal(z1), _screencoordVal(z2)); |
|
7528 |
RETURN (true); |
|
7529 |
#endif |
|
7530 |
%} |
|
7531 |
. |
|
7532 |
^ false |
|
7533 |
! |
|
7534 |
||
7535 |
glxSmoothline: mode in: aGLXWindowId |
|
7536 |
||
7537 |
%{ /* NOCONTEXT */ |
|
7538 |
#ifdef GLX |
|
7539 |
SETWIN(aGLXWindowId) |
|
7540 |
smoothline(_longVal(mode)); |
|
7541 |
RETURN (true); |
|
7542 |
#endif |
|
7543 |
%} |
|
7544 |
. |
|
7545 |
^ false |
|
7546 |
! |
|
7547 |
||
7548 |
glxStencilEnable: enable ref: ref func: func mask: mask fail: fail |
|
7549 |
pass: pass zpass: zpass in: aGLXWindowId |
|
7550 |
||
7551 |
%{ /* NOCONTEXT */ |
|
7552 |
#ifdef GLX |
|
7553 |
SETWIN(aGLXWindowId) |
|
7554 |
stencil(_longVal(enable), (ulong)__intVal(ref), _longVal(func), |
|
7555 |
(ulong)__intVal(mask), _longVal(fail), _longVal(pass), _longVal(zpass)); |
|
7556 |
RETURN (true); |
|
7557 |
#endif |
|
7558 |
%} |
|
7559 |
. |
|
7560 |
^ false |
|
7561 |
! |
|
7562 |
||
7563 |
glxStensize: planes in: aGLXWindowId |
|
7564 |
||
7565 |
%{ /* NOCONTEXT */ |
|
7566 |
#ifdef GLX |
|
7567 |
SETWIN(aGLXWindowId) |
|
7568 |
stensize(_longVal(planes)); |
|
7569 |
RETURN (true); |
|
7570 |
#endif |
|
7571 |
%} |
|
7572 |
. |
|
7573 |
^ false |
|
7574 |
! |
|
7575 |
||
7576 |
glxStepunitX: x y: y in: aGLXWindowId |
|
7577 |
||
7578 |
%{ /* NOCONTEXT */ |
|
7579 |
#ifdef GLX |
|
7580 |
SETWIN(aGLXWindowId) |
|
7581 |
stepunit(_longVal(x), _longVal(y)); |
|
7582 |
RETURN (true); |
|
7583 |
#endif |
|
7584 |
%} |
|
7585 |
. |
|
7586 |
^ false |
|
7587 |
! |
|
7588 |
||
7589 |
glxSubpixel: b in: aGLXWindowId |
|
7590 |
||
7591 |
%{ /* NOCONTEXT */ |
|
7592 |
#ifdef GLX |
|
7593 |
SETWIN(aGLXWindowId) |
|
7594 |
subpixel(_booleanVal(b)); |
|
7595 |
RETURN (true); |
|
7596 |
#endif |
|
7597 |
%} |
|
7598 |
. |
|
7599 |
^ false |
|
7600 |
! |
|
7601 |
||
7602 |
glxSwapinterval: i in: aGLXWindowId |
|
7603 |
||
7604 |
%{ /* NOCONTEXT */ |
|
7605 |
#ifdef GLX |
|
7606 |
SETWIN(aGLXWindowId) |
|
7607 |
swapinterval(_shortVal(i)); |
|
7608 |
RETURN (true); |
|
7609 |
#endif |
|
7610 |
%} |
|
7611 |
. |
|
7612 |
^ false |
|
7613 |
! |
|
7614 |
||
7615 |
glxSwaptmeshIn: aGLXWindowId |
|
7616 |
||
7617 |
%{ /* NOCONTEXT */ |
|
7618 |
#ifdef GLX |
|
7619 |
SETWIN(aGLXWindowId) |
|
7620 |
swaptmesh(); |
|
7621 |
RETURN (true); |
|
7622 |
#endif |
|
7623 |
%} |
|
7624 |
. |
|
7625 |
^ false |
|
7626 |
! |
|
7627 |
||
7628 |
glxSwinopen: parent in: aGLXWindowId |
|
7629 |
||
7630 |
%{ /* NOCONTEXT */ |
|
7631 |
#ifdef GLX |
|
7632 |
SETWIN(aGLXWindowId) |
|
7633 |
swinopen(_longVal(parent)); |
|
7634 |
RETURN (true); |
|
7635 |
#endif |
|
7636 |
%} |
|
7637 |
. |
|
7638 |
^ false |
|
7639 |
! |
|
7640 |
||
7641 |
glxSwritemask: mask in: aGLXWindowId |
|
7642 |
||
7643 |
%{ /* NOCONTEXT */ |
|
7644 |
#ifdef GLX |
|
7645 |
SETWIN(aGLXWindowId) |
|
7646 |
swritemask((ulong)__intVal(mask)); |
|
7647 |
RETURN (true); |
|
7648 |
#endif |
|
7649 |
%} |
|
7650 |
. |
|
7651 |
^ false |
|
7652 |
! |
|
7653 |
||
7654 |
glxTextinitIn: aGLXWindowId |
|
7655 |
||
7656 |
%{ /* NOCONTEXT */ |
|
7657 |
#ifdef GLX |
|
7658 |
SETWIN(aGLXWindowId) |
|
7659 |
textinit(); |
|
7660 |
RETURN (true); |
|
7661 |
#endif |
|
7662 |
%} |
|
7663 |
. |
|
7664 |
^ false |
|
7665 |
! |
|
7666 |
||
7667 |
glxTextportLeft: left right: right bottom: bottom top: top in: aGLXWindowId |
|
7668 |
||
7669 |
%{ /* NOCONTEXT */ |
|
7670 |
#ifdef GLX |
|
7671 |
SETWIN(aGLXWindowId) |
|
7672 |
textport(_screencoordVal(left), _screencoordVal(right), |
|
7673 |
_screencoordVal(bottom), _screencoordVal(top)); |
|
7674 |
RETURN (true); |
|
7675 |
#endif |
|
7676 |
%} |
|
7677 |
. |
|
7678 |
^ false |
|
7679 |
! |
|
7680 |
||
7681 |
glxTieB: b v1: v1 v2: v2 in: aGLXWindowId |
|
7682 |
||
7683 |
%{ /* NOCONTEXT */ |
|
7684 |
#ifdef GLX |
|
7685 |
SETWIN(aGLXWindowId) |
|
7686 |
tie(_deviceVal(b), _deviceVal(v1), _deviceVal(v2)); |
|
7687 |
RETURN (true); |
|
7688 |
#endif |
|
7689 |
%} |
|
7690 |
. |
|
7691 |
^ false |
|
7692 |
! |
|
7693 |
||
7694 |
glxTlutbind: target index: index in: aGLXWindowId |
|
7695 |
||
7696 |
%{ /* NOCONTEXT */ |
|
7697 |
#ifdef FULL_GLX |
|
7698 |
SETWIN(aGLXWindowId) |
|
7699 |
tlutbind(_longVal(target), _longVal(index)); |
|
7700 |
RETURN (true); |
|
7701 |
#endif |
|
7702 |
%} |
|
7703 |
. |
|
7704 |
^ false |
|
7705 |
! |
|
7706 |
||
7707 |
glxTpoffIn: aGLXWindowId |
|
7708 |
||
7709 |
%{ /* NOCONTEXT */ |
|
7710 |
#ifdef GLX |
|
7711 |
SETWIN(aGLXWindowId) |
|
7712 |
tpoff(); |
|
7713 |
RETURN (true); |
|
7714 |
#endif |
|
7715 |
%} |
|
7716 |
. |
|
7717 |
^ false |
|
7718 |
! |
|
7719 |
||
7720 |
glxTponIn: aGLXWindowId |
|
7721 |
||
7722 |
%{ /* NOCONTEXT */ |
|
7723 |
#ifdef GLX |
|
7724 |
SETWIN(aGLXWindowId) |
|
7725 |
tpon(); |
|
7726 |
RETURN (true); |
|
7727 |
#endif |
|
7728 |
%} |
|
7729 |
. |
|
7730 |
^ false |
|
7731 |
! |
|
7732 |
||
7733 |
glxUnqdevice: dev in: aGLXWindowId |
|
7734 |
||
7735 |
%{ /* NOCONTEXT */ |
|
1932 | 7736 |
SETWIN(aGLXWindowId) |
7737 |
#ifdef OPENGL |
|
7738 |
#else |
|
294 | 7739 |
unqdevice(_deviceVal(dev)); |
1932 | 7740 |
#endif |
7741 |
%} |
|
294 | 7742 |
! |
7743 |
||
7744 |
glxWmpack: pack in: aGLXWindowId |
|
7745 |
||
7746 |
%{ /* NOCONTEXT */ |
|
7747 |
#ifdef GLX |
|
7748 |
SETWIN(aGLXWindowId) |
|
7749 |
wmpack((ulong)__intVal(pack)); |
|
7750 |
RETURN (true); |
|
7751 |
#endif |
|
7752 |
%} |
|
7753 |
. |
|
7754 |
^ false |
|
7755 |
! |
|
7756 |
||
7757 |
glxWritemask: wtm in: aGLXWindowId |
|
7758 |
||
7759 |
%{ /* NOCONTEXT */ |
|
7760 |
#ifdef GLX |
|
7761 |
SETWIN(aGLXWindowId) |
|
7762 |
writemask(_colorindexVal(wtm)); |
|
7763 |
RETURN (true); |
|
7764 |
#endif |
|
7765 |
%} |
|
7766 |
. |
|
7767 |
^ false |
|
7768 |
! |
|
7769 |
||
7770 |
glxXfpt2X: x y: y in: aGLXWindowId |
|
7771 |
||
7772 |
%{ /* NOCONTEXT */ |
|
7773 |
#ifdef GLX |
|
7774 |
Coord c_x, c_y; |
|
7775 |
||
7776 |
_COORD_ (x, c_x) |
|
7777 |
_COORD_ (y, c_y) |
|
7778 |
SETWIN(aGLXWindowId) |
|
7779 |
xfpt2(c_x, c_y); |
|
7780 |
RETURN (true); |
|
7781 |
#endif |
|
7782 |
%} |
|
7783 |
. |
|
7784 |
^ false |
|
7785 |
! |
|
7786 |
||
7787 |
glxXfpt2iX: x y: y in: aGLXWindowId |
|
7788 |
||
7789 |
%{ /* NOCONTEXT */ |
|
7790 |
#ifdef GLX |
|
7791 |
Icoord c_x, c_y; |
|
7792 |
||
7793 |
_ICOORD_ (x, c_x) |
|
7794 |
_ICOORD_ (y, c_y) |
|
7795 |
SETWIN(aGLXWindowId) |
|
7796 |
xfpt2i(c_x, c_y); |
|
7797 |
RETURN (true); |
|
7798 |
#endif |
|
7799 |
%} |
|
7800 |
. |
|
7801 |
^ false |
|
7802 |
! |
|
7803 |
||
7804 |
glxXfpt2sX: x y: y in: aGLXWindowId |
|
7805 |
||
7806 |
%{ /* NOCONTEXT */ |
|
7807 |
#ifdef GLX |
|
7808 |
Scoord c_x, c_y; |
|
7809 |
||
7810 |
_SCOORD_ (x, c_x) |
|
7811 |
_SCOORD_ (y, c_y) |
|
7812 |
SETWIN(aGLXWindowId) |
|
7813 |
xfpt2s(c_x, c_y); |
|
7814 |
RETURN (true); |
|
7815 |
#endif |
|
7816 |
%} |
|
7817 |
. |
|
7818 |
^ false |
|
7819 |
! |
|
7820 |
||
7821 |
glxXfpt4X: x y: y z: z w: w in: aGLXWindowId |
|
7822 |
||
7823 |
%{ /* NOCONTEXT */ |
|
7824 |
#ifdef GLX |
|
7825 |
Coord c_x, c_y, c_z, c_w; |
|
7826 |
||
7827 |
_COORD_ (x, c_x) |
|
7828 |
_COORD_ (y, c_y) |
|
7829 |
_COORD_ (z, c_z) |
|
7830 |
_COORD_ (w, c_w) |
|
7831 |
SETWIN(aGLXWindowId) |
|
7832 |
xfpt4(c_x, c_y, c_z, c_w); |
|
7833 |
RETURN (true); |
|
7834 |
#endif |
|
7835 |
%} |
|
7836 |
. |
|
7837 |
^ false |
|
7838 |
! |
|
7839 |
||
7840 |
glxXfpt4iX: x y: y z: z w: w in: aGLXWindowId |
|
7841 |
||
7842 |
%{ /* NOCONTEXT */ |
|
7843 |
#ifdef GLX |
|
7844 |
Icoord c_x, c_y, c_z, c_w; |
|
7845 |
||
7846 |
_ICOORD_ (x, c_x) |
|
7847 |
_ICOORD_ (y, c_y) |
|
7848 |
_ICOORD_ (z, c_z) |
|
7849 |
_ICOORD_ (w, c_w) |
|
7850 |
SETWIN(aGLXWindowId) |
|
7851 |
xfpt4i(c_x, c_y, c_z, c_w); |
|
7852 |
RETURN (true); |
|
7853 |
#endif |
|
7854 |
%} |
|
7855 |
. |
|
7856 |
^ false |
|
7857 |
! |
|
7858 |
||
7859 |
glxXfpt4sX: x y: y z: z w: w in: aGLXWindowId |
|
7860 |
||
7861 |
%{ /* NOCONTEXT */ |
|
7862 |
#ifdef GLX |
|
7863 |
Scoord c_x, c_y, c_z, c_w; |
|
7864 |
||
7865 |
_SCOORD_ (x, c_x) |
|
7866 |
_SCOORD_ (y, c_y) |
|
7867 |
_SCOORD_ (z, c_z) |
|
7868 |
_SCOORD_ (w, c_w) |
|
7869 |
SETWIN(aGLXWindowId) |
|
7870 |
xfpt4s(c_x, c_y, c_z, c_w); |
|
7871 |
RETURN (true); |
|
7872 |
#endif |
|
7873 |
%} |
|
7874 |
. |
|
7875 |
^ false |
|
7876 |
! |
|
7877 |
||
7878 |
glxXfptX: x y: y z: z in: aGLXWindowId |
|
7879 |
||
7880 |
%{ /* NOCONTEXT */ |
|
7881 |
#ifdef GLX |
|
7882 |
Coord c_x, c_y, c_z; |
|
7883 |
||
7884 |
_COORD_ (x, c_x) |
|
7885 |
_COORD_ (y, c_y) |
|
7886 |
_COORD_ (z, c_z) |
|
7887 |
SETWIN(aGLXWindowId) |
|
7888 |
xfpt(c_x, c_y, c_z); |
|
7889 |
RETURN (true); |
|
7890 |
#endif |
|
7891 |
%} |
|
7892 |
. |
|
7893 |
^ false |
|
7894 |
! |
|
7895 |
||
7896 |
glxXfptiX: x y: y z: z in: aGLXWindowId |
|
7897 |
||
7898 |
%{ /* NOCONTEXT */ |
|
7899 |
#ifdef GLX |
|
7900 |
Icoord c_x, c_y, c_z; |
|
7901 |
||
7902 |
_ICOORD_ (x, c_x) |
|
7903 |
_ICOORD_ (y, c_y) |
|
7904 |
_ICOORD_ (z, c_z) |
|
7905 |
SETWIN(aGLXWindowId) |
|
7906 |
xfpti(c_x, c_y, c_z); |
|
7907 |
RETURN (true); |
|
7908 |
#endif |
|
7909 |
%} |
|
7910 |
. |
|
7911 |
^ false |
|
7912 |
! |
|
7913 |
||
7914 |
glxXfptsX: x y: y z: z in: aGLXWindowId |
|
7915 |
||
7916 |
%{ /* NOCONTEXT */ |
|
7917 |
#ifdef GLX |
|
7918 |
Scoord c_x, c_y, c_z; |
|
7919 |
||
7920 |
_SCOORD_ (x, c_x) |
|
7921 |
_SCOORD_ (y, c_y) |
|
7922 |
_SCOORD_ (z, c_z) |
|
7923 |
SETWIN(aGLXWindowId) |
|
7924 |
xfpts(c_x, c_y, c_z); |
|
7925 |
RETURN (true); |
|
7926 |
#endif |
|
7927 |
%} |
|
7928 |
. |
|
7929 |
^ false |
|
7930 |
! ! |
|
7931 |
||
7932 |
!GLXWorkstation methodsFor:'vertex data transfer'! |
|
7933 |
||
7934 |
glxN3f:arrayOf3Floats in:aGLXWindowId |
|
7935 |
"argument must be an array of 3 floats containing the |
|
7936 |
current vertex normal - in real GL only" |
|
7937 |
||
7938 |
%{ /* NOCONTEXT */ |
|
7939 |
#ifdef GLX |
|
7940 |
float vec[3], *v; |
|
7941 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7942 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 7943 |
SETWIN(aGLXWindowId) |
7944 |
n3f(v); |
|
7945 |
RETURN (true); |
|
7946 |
#endif |
|
7947 |
%} |
|
7948 |
. |
|
7949 |
^ false |
|
7950 |
! |
|
7951 |
||
7952 |
glxV2d:v in:aGLXWindowId |
|
7953 |
"pass a vertex; v must be a vector with 2 doubles; z is taken as 0" |
|
7954 |
||
7955 |
%{ /* NOCONTEXT */ |
|
7956 |
double vec[2], *c_v; |
|
7957 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7958 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 2))) RETURN(false); |
294 | 7959 |
SETWIN(aGLXWindowId) |
1932 | 7960 |
#ifdef OPENGL |
7961 |
#else |
|
294 | 7962 |
v2d(c_v); |
1932 | 7963 |
#endif |
294 | 7964 |
RETURN (true); |
7965 |
%} |
|
7966 |
! |
|
7967 |
||
7968 |
glxV2f:v in:aGLXWindowId |
|
7969 |
"pass a vertex; v must be a vector with 2 floats; z is taken as 0" |
|
7970 |
||
7971 |
%{ /* NOCONTEXT */ |
|
7972 |
float vec[2], *c_v; |
|
7973 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7974 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
294 | 7975 |
SETWIN(aGLXWindowId) |
1932 | 7976 |
#ifdef OPENGL |
7977 |
#else |
|
294 | 7978 |
v2f(c_v); |
1932 | 7979 |
#endif |
294 | 7980 |
RETURN (true); |
7981 |
%} |
|
7982 |
! |
|
7983 |
||
7984 |
glxV2fX:x y:y in:aGLXWindowId |
|
7985 |
"pass a vertex from individual x and y values; z is taken as 0.0" |
|
7986 |
||
7987 |
%{ /* NOCONTEXT */ |
|
7988 |
float vec[2]; |
|
7989 |
||
7990 |
_FLOAT_(x, vec[0]) |
|
7991 |
_FLOAT_(y, vec[1]) |
|
7992 |
SETWIN(aGLXWindowId) |
|
1932 | 7993 |
#ifdef OPENGL |
7994 |
#else |
|
294 | 7995 |
v2f(vec); |
1932 | 7996 |
#endif |
294 | 7997 |
RETURN (true); |
7998 |
%} |
|
7999 |
! |
|
8000 |
||
8001 |
glxV2i:v in:aGLXWindowId |
|
8002 |
"pass a vertex; v must be a vector with 2 longs; z is taken as 0" |
|
8003 |
||
8004 |
%{ /* NOCONTEXT */ |
|
8005 |
long vec[2], *c_v; |
|
8006 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8007 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 2))) RETURN(false); |
294 | 8008 |
SETWIN(aGLXWindowId) |
1932 | 8009 |
#ifdef OPENGL |
8010 |
#else |
|
294 | 8011 |
v2i(c_v); |
1932 | 8012 |
#endif |
294 | 8013 |
RETURN (true); |
8014 |
%} |
|
8015 |
! |
|
8016 |
||
8017 |
glxV2s:v in:aGLXWindowId |
|
8018 |
"pass a vertex; v must be a vector with 2 shorts; z is taken as 0" |
|
8019 |
||
8020 |
%{ /* NOCONTEXT */ |
|
8021 |
short vec[2], *c_v; |
|
8022 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8023 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 2))) RETURN(false); |
294 | 8024 |
SETWIN(aGLXWindowId) |
1932 | 8025 |
#ifdef OPENGL |
8026 |
#else |
|
294 | 8027 |
v2s(c_v); |
1932 | 8028 |
#endif |
294 | 8029 |
RETURN (true); |
8030 |
%} |
|
8031 |
! |
|
8032 |
||
8033 |
glxV3d:v in:aGLXWindowId |
|
8034 |
"pass a vertex; v must be a 3-element double-vector" |
|
8035 |
||
8036 |
%{ /* NOCONTEXT */ |
|
8037 |
double vec[3], *c_v; |
|
8038 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8039 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 3))) RETURN(false); |
294 | 8040 |
SETWIN(aGLXWindowId) |
1932 | 8041 |
#ifdef OPENGL |
8042 |
#else |
|
294 | 8043 |
v3d(c_v); |
1932 | 8044 |
#endif |
294 | 8045 |
RETURN (true); |
8046 |
%} |
|
8047 |
. |
|
8048 |
^ false |
|
8049 |
! |
|
8050 |
||
8051 |
glxV3f:v in:aGLXWindowId |
|
8052 |
"pass a vertex; v must be a 3-element float-vector" |
|
8053 |
||
8054 |
%{ /* NOCONTEXT */ |
|
8055 |
float vec[3], *c_v; |
|
8056 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8057 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
294 | 8058 |
SETWIN(aGLXWindowId) |
1932 | 8059 |
#ifdef OPENGL |
8060 |
#else |
|
294 | 8061 |
v3f(c_v); |
1932 | 8062 |
#endif |
294 | 8063 |
RETURN (true); |
8064 |
%} |
|
8065 |
! |
|
8066 |
||
8067 |
glxV3fX:x y:y z:z in: aGLXWindowId |
|
8068 |
"pass a vector from individual x, y and z (float) values" |
|
8069 |
||
8070 |
%{ /* NOCONTEXT */ |
|
8071 |
float vec[3]; |
|
8072 |
||
8073 |
_FLOAT_(x, vec[0]) |
|
8074 |
_FLOAT_(y, vec[1]) |
|
8075 |
_FLOAT_(z, vec[2]) |
|
8076 |
SETWIN(aGLXWindowId) |
|
1932 | 8077 |
#ifdef OPENGL |
8078 |
#else |
|
294 | 8079 |
v3f(vec); |
1932 | 8080 |
#endif |
294 | 8081 |
RETURN (true); |
8082 |
%} |
|
8083 |
! |
|
8084 |
||
8085 |
glxV3i:v in:aGLXWindowId |
|
8086 |
"pass a vertex; v must be a vector with 3 longs" |
|
8087 |
||
8088 |
%{ /* NOCONTEXT */ |
|
8089 |
long vec[3], *c_v; |
|
8090 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8091 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
294 | 8092 |
SETWIN(aGLXWindowId) |
1932 | 8093 |
#ifdef OPENGL |
8094 |
#else |
|
294 | 8095 |
v3i(c_v); |
1932 | 8096 |
#endif |
294 | 8097 |
RETURN (true); |
8098 |
%} |
|
8099 |
! |
|
8100 |
||
8101 |
glxV3s:v in:aGLXWindowId |
|
8102 |
"pass a vertex; v must be a vector with 3 shorts" |
|
8103 |
||
8104 |
%{ /* NOCONTEXT */ |
|
8105 |
short vec[3], *c_v; |
|
8106 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8107 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
294 | 8108 |
SETWIN(aGLXWindowId) |
1932 | 8109 |
#ifdef OPENGL |
8110 |
#else |
|
294 | 8111 |
v3s(c_v); |
1932 | 8112 |
#endif |
294 | 8113 |
RETURN (true); |
8114 |
%} |
|
8115 |
! |
|
8116 |
||
8117 |
glxV4d:v in:aGLXWindowId |
|
8118 |
"pass a vertex; v must be a 4-element double-vector, |
|
8119 |
containing x, y, z and w" |
|
8120 |
||
8121 |
%{ /* NOCONTEXT */ |
|
8122 |
double vec[4], *c_v; |
|
8123 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8124 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 4))) RETURN(false); |
294 | 8125 |
SETWIN(aGLXWindowId) |
1932 | 8126 |
#ifdef OPENGL |
8127 |
#else |
|
294 | 8128 |
v4d(c_v); |
1932 | 8129 |
#endif |
294 | 8130 |
RETURN (true); |
8131 |
%} |
|
8132 |
! |
|
8133 |
||
8134 |
glxV4f:v in:aGLXWindowId |
|
8135 |
"pass a vertex; v must be a 4-element float-vector, |
|
8136 |
containing x, y, z and w" |
|
8137 |
||
8138 |
%{ /* NOCONTEXT */ |
|
8139 |
float vec[4], *c_v; |
|
8140 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8141 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
294 | 8142 |
SETWIN(aGLXWindowId) |
1932 | 8143 |
#ifdef OPENGL |
8144 |
#else |
|
294 | 8145 |
v4f(c_v); |
1932 | 8146 |
#endif |
294 | 8147 |
RETURN (true); |
8148 |
%} |
|
8149 |
! |
|
8150 |
||
8151 |
glxV4i:v in:aGLXWindowId |
|
8152 |
"pass a vertex; v must be a 4-element int-vector, |
|
8153 |
containing x, y, z and w" |
|
8154 |
||
8155 |
%{ /* NOCONTEXT */ |
|
8156 |
long vec[4], *c_v; |
|
8157 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8158 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
294 | 8159 |
SETWIN(aGLXWindowId) |
1932 | 8160 |
#ifdef OPENGL |
8161 |
#else |
|
294 | 8162 |
v4i(c_v); |
1932 | 8163 |
#endif |
294 | 8164 |
RETURN (true); |
8165 |
%} |
|
8166 |
! |
|
8167 |
||
8168 |
glxV4s:v in:aGLXWindowId |
|
8169 |
"pass a vertex; v must be a 4-element short-vector, |
|
8170 |
containing x, y, z and w" |
|
8171 |
||
8172 |
%{ /* NOCONTEXT */ |
|
8173 |
short vec[4], *c_v; |
|
8174 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8175 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
294 | 8176 |
SETWIN(aGLXWindowId) |
1932 | 8177 |
#ifdef OPENGL |
8178 |
#else |
|
294 | 8179 |
v4s(c_v); |
1932 | 8180 |
#endif |
294 | 8181 |
RETURN (true); |
8182 |
%} |
|
8183 |
! |
|
8184 |
||
8185 |
glxVOriginIn:aGLXWindowId |
|
8186 |
"pass a 0.0/0.0/0.0 vector. |
|
8187 |
This is the same as v3f:#(0.0 0.0 0.0), but, since its so |
|
8188 |
common, this somewhat faster method has been provided" |
|
8189 |
||
8190 |
%{ /* NOCONTEXT */ |
|
8191 |
static float vec[3] = {0.0, 0.0, 0.0}; |
|
8192 |
||
8193 |
SETWIN(aGLXWindowId) |
|
1932 | 8194 |
#ifdef OPENGL |
8195 |
#else |
|
294 | 8196 |
v3f(vec); |
1932 | 8197 |
#endif |
294 | 8198 |
RETURN (true); |
8199 |
%} |
|
8200 |
! |
|
8201 |
||
8202 |
glxVUnitXIn:aGLXWindowId |
|
8203 |
"pass a 1.0/0.0/0.0 vector. |
|
8204 |
This is the same as v3f:#(1.0 0.0 0.0), but, since its so |
|
8205 |
common, this somewhat faster method has been provided" |
|
8206 |
||
8207 |
%{ /* NOCONTEXT */ |
|
8208 |
static float vec[3] = {1.0, 0.0, 0.0}; |
|
8209 |
||
8210 |
SETWIN(aGLXWindowId) |
|
1932 | 8211 |
#ifdef OPENGL |
8212 |
#else |
|
294 | 8213 |
v3f(vec); |
1932 | 8214 |
#endif |
294 | 8215 |
RETURN (true); |
8216 |
%} |
|
8217 |
! |
|
8218 |
||
8219 |
glxVUnitYIn:aGLXWindowId |
|
8220 |
"pass a 0.0/1.0/0.0 vector. |
|
8221 |
This is the same as v3f:#(0.0 1.0 0.0), but, since its so |
|
8222 |
common, this somewhat faster method has been provided" |
|
8223 |
||
8224 |
%{ /* NOCONTEXT */ |
|
8225 |
static float vec[3] = {0.0, 1.0, 0.0}; |
|
8226 |
||
8227 |
SETWIN(aGLXWindowId) |
|
1932 | 8228 |
#ifdef OPENGL |
8229 |
#else |
|
294 | 8230 |
v3f(vec); |
1932 | 8231 |
#endif |
294 | 8232 |
RETURN (true); |
8233 |
%} |
|
8234 |
! |
|
8235 |
||
8236 |
glxVUnitZIn:aGLXWindowId |
|
8237 |
"pass a 0.0/0.0/1.0 vector. |
|
8238 |
This is the same as v3f:#(0.0 0.0 1.0), but, since its so |
|
8239 |
common, this somewhat faster method has been provided" |
|
8240 |
||
8241 |
%{ /* NOCONTEXT */ |
|
8242 |
static float vec[3] = {0.0, 0.0, 1.0}; |
|
8243 |
||
8244 |
SETWIN(aGLXWindowId) |
|
1932 | 8245 |
#ifdef OPENGL |
8246 |
#else |
|
294 | 8247 |
v3f(vec); |
1932 | 8248 |
#endif |
294 | 8249 |
RETURN (true); |
8250 |
%} |
|
8251 |
! ! |
|
8252 |
||
8253 |
!GLXWorkstation methodsFor:'video and planes'! |
|
8254 |
||
8255 |
glxOverlayPlanes: planes in: aGLXWindowId |
|
8256 |
||
8257 |
%{ /* NOCONTEXT */ |
|
8258 |
#ifdef GLX |
|
8259 |
SETWIN(aGLXWindowId) |
|
8260 |
overlay(_longVal(planes)); |
|
8261 |
RETURN (true); |
|
8262 |
#endif |
|
8263 |
%} |
|
8264 |
. |
|
8265 |
^ false |
|
8266 |
! |
|
8267 |
||
8268 |
glxStereobufferIn: aGLXWindowId |
|
8269 |
||
8270 |
%{ /* NOCONTEXT */ |
|
8271 |
#ifdef FULL_GLX |
|
8272 |
SETWIN(aGLXWindowId) |
|
8273 |
stereobuffer(); |
|
8274 |
RETURN (true); |
|
8275 |
#endif |
|
8276 |
%} |
|
8277 |
. |
|
8278 |
^ false |
|
8279 |
! |
|
8280 |
||
8281 |
glxUnderlay: planes in: aGLXWindowId |
|
8282 |
||
8283 |
%{ /* NOCONTEXT */ |
|
8284 |
#ifdef GLX |
|
8285 |
SETWIN(aGLXWindowId) |
|
8286 |
underlay(_longVal(planes)); |
|
8287 |
RETURN (true); |
|
8288 |
#endif |
|
8289 |
%} |
|
8290 |
. |
|
8291 |
^ false |
|
8292 |
! |
|
8293 |
||
8294 |
glxVideocmd:cmd in:aGLXWindowId |
|
8295 |
||
8296 |
%{ /* NOCONTEXT */ |
|
8297 |
#ifdef GLX |
|
8298 |
SETWIN(aGLXWindowId) |
|
8299 |
videocmd(_longVal(cmd)); |
|
8300 |
RETURN (true); |
|
8301 |
#endif |
|
8302 |
%} |
|
8303 |
. |
|
8304 |
^ false |
|
8305 |
! ! |
|
8306 |
||
8307 |
!GLXWorkstation methodsFor:'viewing'! |
|
8308 |
||
8309 |
glxLookatVx:vx vy:vy vz:vz px:px py:py pz:pz twist:twist in:aGLXWindowId |
|
8310 |
"define viewing transformation" |
|
8311 |
||
8312 |
%{ /* NOCONTEXT */ |
|
8313 |
||
8314 |
Coord f_vx, f_vy, f_vz, f_px, f_py, f_pz; |
|
8315 |
Angle a_twist; |
|
8316 |
||
8317 |
_COORD_ (vx, f_vx) |
|
8318 |
_COORD_ (vy, f_vy) |
|
8319 |
_COORD_ (vz, f_vz) |
|
8320 |
_COORD_ (px, f_px) |
|
8321 |
_COORD_ (py, f_py) |
|
8322 |
_COORD_ (pz, f_pz) |
|
8323 |
_ANGLE_ (twist, a_twist) |
|
8324 |
SETWIN(aGLXWindowId) |
|
1932 | 8325 |
#ifdef OPENGL |
8326 |
#else |
|
294 | 8327 |
lookat(f_vx, f_vy, f_vz, f_px, f_py, f_pz, a_twist); |
1932 | 8328 |
#endif |
294 | 8329 |
%} |
8330 |
! |
|
8331 |
||
8332 |
glxOrtho2Left: left right: right bottom: bottom top: top in: aGLXWindowId |
|
8333 |
"define 2D orthogonal projection" |
|
8334 |
||
8335 |
%{ /* NOCONTEXT */ |
|
8336 |
float f_left, f_right, f_top, f_bottom; |
|
8337 |
||
8338 |
SETWIN(aGLXWindowId) |
|
8339 |
_FLOAT_(left, f_left) |
|
8340 |
_FLOAT_(right, f_right) |
|
8341 |
_FLOAT_(bottom, f_bottom) |
|
8342 |
_FLOAT_(top, f_top) |
|
1932 | 8343 |
#ifdef OPENGL |
8344 |
#else |
|
294 | 8345 |
ortho2(f_left, f_right, f_bottom, f_top); |
1932 | 8346 |
#endif |
8347 |
%} |
|
294 | 8348 |
! |
8349 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8350 |
glxOrthoLeft: left right: right bottom: bottom top: top near: znear far: zfar in: aGLXWindowId |
294 | 8351 |
"define orthogonal projection" |
8352 |
||
8353 |
%{ /* NOCONTEXT */ |
|
8354 |
float f_left, f_right, f_bottom, f_top, |
|
8355 |
f_near, f_far; |
|
8356 |
||
8357 |
_FLOAT_(left, f_left) |
|
8358 |
_FLOAT_(right, f_right) |
|
8359 |
_FLOAT_(bottom, f_bottom) |
|
8360 |
_FLOAT_(top, f_top) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8361 |
_FLOAT_(znear, f_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8362 |
_FLOAT_(zfar, f_far) |
294 | 8363 |
SETWIN(aGLXWindowId) |
1932 | 8364 |
#ifdef OPENGL |
8365 |
#else |
|
294 | 8366 |
ortho(f_left, f_right, f_bottom, f_top, f_near, f_far); |
1932 | 8367 |
#endif |
294 | 8368 |
%} |
8369 |
! |
|
8370 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8371 |
glxPerspectiveFovy:fovy aspect:aspect near:znear far:zfar in:aGLXWindowId |
294 | 8372 |
"define perspective projection" |
8373 |
||
8374 |
%{ /* NOCONTEXT */ |
|
8375 |
||
8376 |
Angle a_fovy; |
|
8377 |
Coord c_near, c_far; |
|
8378 |
float f_aspect; |
|
8379 |
||
8380 |
_ANGLE_ (fovy, a_fovy) |
|
8381 |
_FLOAT_ (aspect, f_aspect) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8382 |
_COORD_ (znear, c_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8383 |
_COORD_ (zfar, c_far) |
294 | 8384 |
|
8385 |
SETWIN(aGLXWindowId) |
|
1932 | 8386 |
#ifdef OPENGL |
8387 |
#else |
|
294 | 8388 |
perspective(a_fovy, f_aspect, c_near, c_far); |
1932 | 8389 |
#endif |
294 | 8390 |
%} |
8391 |
! |
|
8392 |
||
8393 |
glxPolarviewDist: dist azim: azim inc: inc twist: twist in: aGLXWindowId |
|
8394 |
||
8395 |
%{ /* NOCONTEXT */ |
|
8396 |
Coord c_dist; |
|
8397 |
Angle a_azim, a_inc, a_twist; |
|
8398 |
||
8399 |
_COORD_(dist, c_dist) |
|
8400 |
_ANGLE_(azim, a_azim) |
|
8401 |
_ANGLE_(inc, a_inc) |
|
8402 |
_ANGLE_(twist, a_twist) |
|
8403 |
SETWIN(aGLXWindowId) |
|
1932 | 8404 |
#ifdef OPENGL |
8405 |
#else |
|
294 | 8406 |
polarview(c_dist, a_azim, a_inc, a_twist); |
1932 | 8407 |
#endif |
294 | 8408 |
%} |
8409 |
! |
|
8410 |
||
528 | 8411 |
glxPopviewportIn: aGLXWindowId |
8412 |
"pops the top viewport off the viewport stack" |
|
8413 |
||
8414 |
%{ /* NOCONTEXT */ |
|
8415 |
SETWIN(aGLXWindowId) |
|
1932 | 8416 |
#ifdef OPENGL |
8417 |
#else |
|
528 | 8418 |
popviewport(); |
1932 | 8419 |
#endif |
528 | 8420 |
%} |
8421 |
||
8422 |
"Modified: 19.3.1996 / 18:58:24 / cg" |
|
8423 |
! |
|
8424 |
||
8425 |
glxPushviewportIn: aGLXWindowId |
|
8426 |
"pushes the current viewport on the viewport stack" |
|
8427 |
||
8428 |
%{ /* NOCONTEXT */ |
|
8429 |
SETWIN(aGLXWindowId) |
|
1932 | 8430 |
#ifdef OPENGL |
8431 |
#else |
|
528 | 8432 |
pushviewport(); |
1932 | 8433 |
#endif |
528 | 8434 |
%} |
8435 |
||
8436 |
"Modified: 19.3.1996 / 18:58:02 / cg" |
|
8437 |
! |
|
8438 |
||
294 | 8439 |
glxReshapeViewPortIn: aGLXWindowId |
8440 |
||
8441 |
%{ /* NOCONTEXT */ |
|
8442 |
SETWIN(aGLXWindowId) |
|
1932 | 8443 |
#ifdef OPENGL |
8444 |
#else |
|
294 | 8445 |
reshapeviewport(); |
1932 | 8446 |
#endif |
8447 |
%} |
|
294 | 8448 |
! |
8449 |
||
8450 |
glxViewportLeft:left right:right bottom:bottom top:top in:aGLXWindowId |
|
8451 |
||
8452 |
%{ /* NOCONTEXT */ |
|
8453 |
SETWIN(aGLXWindowId) |
|
1932 | 8454 |
#ifdef OPENGL |
8455 |
#else |
|
294 | 8456 |
viewport(_screencoordVal(left), _screencoordVal(right), |
8457 |
_screencoordVal(bottom), _screencoordVal(top)); |
|
1932 | 8458 |
#endif |
294 | 8459 |
%} |
8460 |
! |
|
8461 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8462 |
glxWindowLeft: left right: right bottom: bottom top: top near: znear far: zfar in: aGLXWindowId |
294 | 8463 |
"this one was added independently by JEFF - kept for his programs ..." |
8464 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8465 |
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
|
8466 |
! |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8467 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8468 |
glxWindowLeft:left right:right top:top bottom:bottom near:znear far:zfar in:aGLXWindowId |
294 | 8469 |
"define perspective viewing pyramid" |
8470 |
||
8471 |
%{ /* NOCONTEXT */ |
|
8472 |
Coord c_left, c_right, c_top, c_bot, c_near, c_far; |
|
8473 |
||
8474 |
_COORD_ (left, c_left) |
|
8475 |
_COORD_ (right, c_right) |
|
8476 |
_COORD_ (top, c_top) |
|
8477 |
_COORD_ (bottom, c_bot) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8478 |
_COORD_ (znear, c_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8479 |
_COORD_ (zfar, c_far) |
294 | 8480 |
SETWIN(aGLXWindowId) |
1932 | 8481 |
#ifdef OPENGL |
8482 |
#else |
|
294 | 8483 |
window(c_left, c_right, c_bot, c_top, c_near, c_far); |
1932 | 8484 |
#endif |
294 | 8485 |
%} |
8486 |
! ! |
|
8487 |
||
8488 |
!GLXWorkstation methodsFor:'window control'! |
|
8489 |
||
2045 | 8490 |
glxResizedView:aGLXWindowId width:width height:height |
2048 | 8491 |
"pass down resize info to the GL - this adjusts the viewport. |
8492 |
This only works with VGL or openGL" |
|
8493 |
||
8494 |
%{ /* NOCONTEXT */ |
|
2074 | 8495 |
SETWIN(aGLXWindowId) |
8496 |
#ifdef VGL |
|
2045 | 8497 |
X11_resized(__intVal(width), __intVal(height)); |
8498 |
RETURN (true); |
|
8499 |
#endif |
|
8500 |
%} |
|
8501 |
. |
|
8502 |
^ false |
|
8503 |
! |
|
8504 |
||
294 | 8505 |
glxWinclose:gwid in:aGLXWindowId |
8506 |
||
8507 |
%{ /* NOCONTEXT */ |
|
8508 |
#ifdef GLX |
|
8509 |
SETWIN(aGLXWindowId) |
|
8510 |
winclose(_longVal(gwid)); |
|
8511 |
RETURN (true); |
|
8512 |
#endif |
|
8513 |
%} |
|
8514 |
. |
|
8515 |
^ false |
|
8516 |
! |
|
8517 |
||
8518 |
glxWinconstraintsIn: aGLXWindowId |
|
8519 |
||
8520 |
%{ /* NOCONTEXT */ |
|
8521 |
#ifdef GLX |
|
8522 |
SETWIN(aGLXWindowId) |
|
8523 |
winconstraints(); |
|
8524 |
RETURN (true); |
|
8525 |
#endif |
|
8526 |
%} |
|
8527 |
. |
|
8528 |
^ false |
|
8529 |
! |
|
8530 |
||
8531 |
glxWindepth: gwid in: aGLXWindowId |
|
8532 |
||
8533 |
%{ /* NOCONTEXT */ |
|
8534 |
#ifdef GLX |
|
8535 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
8536 |
RETURN (__MKSMALLINT(windepth(_longVal(gwid)))); |
294 | 8537 |
#endif |
8538 |
%} |
|
8539 |
. |
|
8540 |
^ false |
|
8541 |
! |
|
8542 |
||
8543 |
glxWingetIn: aGLXWindowId |
|
8544 |
||
8545 |
%{ /* NOCONTEXT */ |
|
8546 |
#ifdef GLX |
|
8547 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
8548 |
RETURN (__MKSMALLINT(winget())); |
294 | 8549 |
#endif |
8550 |
%} |
|
8551 |
. |
|
8552 |
^ false |
|
8553 |
! |
|
8554 |
||
8555 |
glxWinmoveX: x y: y in: aGLXWindowId |
|
8556 |
||
8557 |
%{ /* NOCONTEXT */ |
|
8558 |
#ifdef GLX |
|
8559 |
SETWIN(aGLXWindowId) |
|
8560 |
winmove(_longVal(x), _longVal(y)); |
|
8561 |
RETURN (true); |
|
8562 |
#endif |
|
8563 |
%} |
|
8564 |
. |
|
8565 |
^ false |
|
8566 |
! |
|
8567 |
||
8568 |
glxWinpopIn: aGLXWindowId |
|
8569 |
||
8570 |
%{ /* NOCONTEXT */ |
|
8571 |
#ifdef GLX |
|
8572 |
SETWIN(aGLXWindowId) |
|
8573 |
winpop(); |
|
8574 |
RETURN (true); |
|
8575 |
#endif |
|
8576 |
%} |
|
8577 |
. |
|
8578 |
^ false |
|
8579 |
! |
|
8580 |
||
8581 |
glxWinpositionX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
8582 |
||
8583 |
%{ /* NOCONTEXT */ |
|
8584 |
#ifdef GLX |
|
8585 |
SETWIN(aGLXWindowId) |
|
8586 |
winposition(_longVal(x1), _longVal(y1), _longVal(x2), _longVal(y2)); |
|
8587 |
RETURN (true); |
|
8588 |
#endif |
|
8589 |
%} |
|
8590 |
. |
|
8591 |
^ false |
|
8592 |
! |
|
8593 |
||
8594 |
glxWinpushIn: aGLXWindowId |
|
8595 |
||
8596 |
%{ /* NOCONTEXT */ |
|
8597 |
#ifdef GLX |
|
8598 |
SETWIN(aGLXWindowId) |
|
8599 |
winpush(); |
|
8600 |
RETURN (true); |
|
8601 |
#endif |
|
8602 |
%} |
|
8603 |
. |
|
8604 |
^ false |
|
8605 |
! |
|
8606 |
||
8607 |
glxWinset: gwid in: aGLXWindowId |
|
8608 |
||
8609 |
%{ /* NOCONTEXT */ |
|
8610 |
#ifdef GLX |
|
8611 |
SETWIN(aGLXWindowId) |
|
8612 |
winset(_longVal(gwid)); |
|
8613 |
RETURN (true); |
|
8614 |
#endif |
|
8615 |
%} |
|
8616 |
. |
|
8617 |
^ false |
|
8618 |
! ! |
|
8619 |
||
0 | 8620 |
!GLXWorkstation methodsFor:'window creation'! |
8621 |
||
12 | 8622 |
createGLXWindowFor:aView left:xpos top:ypos width:wwidth height:wheight type:glxType |
157 | 8623 |
|ext wsuperView wsuperViewId windowId| |
0 | 8624 |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
8625 |
glOK ifFalse:[^ nil]. |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
8626 |
|
793 | 8627 |
wsuperView := aView superView view. |
0 | 8628 |
wsuperView notNil ifTrue:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8629 |
wsuperViewId := wsuperView id |
0 | 8630 |
]. |
8631 |
||
524 | 8632 |
%{ /* CALLSSTACK: 20000 */ |
0 | 8633 |
Display *dpy = myDpy; |
185 | 8634 |
int screen = __intVal(_INST(screen)); |
0 | 8635 |
Window newWindow, parentWindow; |
12 | 8636 |
int t; |
0 | 8637 |
|
97 | 8638 |
if (__isSmallInteger(xpos) && __isSmallInteger(ypos) |
8639 |
&& __isSmallInteger(wwidth) && __isSmallInteger(wheight)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8640 |
if (__isExternalAddress(wsuperViewId)) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8641 |
parentWindow = _WindowVal(wsuperViewId); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8642 |
} else { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8643 |
parentWindow = RootWindow(dpy, screen); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8644 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8645 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8646 |
if (glxType == @symbol(colorIndexSingleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8647 |
t = GLXcolorIndexSingleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8648 |
else if (glxType == @symbol(colorIndexDoubleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8649 |
t = GLXcolorIndexDoubleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8650 |
else if (glxType == @symbol(rgbSingleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8651 |
t = GLXrgbSingleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8652 |
else if (glxType == @symbol(rgbDoubleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8653 |
t = GLXrgbDoubleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8654 |
else { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8655 |
RETURN ( nil ); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8656 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8657 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8658 |
ENTERGLX; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8659 |
newWindow = __GLXCreateWindow(dpy, parentWindow, |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8660 |
__intVal(xpos), __intVal(ypos), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8661 |
__intVal(wwidth), __intVal(wheight), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8662 |
0, t); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8663 |
LEAVEGLX; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8664 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8665 |
if (! newWindow) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8666 |
RETURN ( nil ); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8667 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8668 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8669 |
windowId = __MKOBJ(newWindow); |
0 | 8670 |
} |
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
8671 |
%}. |
0 | 8672 |
windowId notNil ifTrue:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8673 |
self addKnownView:aView withId:windowId. |
0 | 8674 |
]. |
8675 |
^ windowId |
|
20 | 8676 |
! |
8677 |
||
8678 |
unlinkGLXView:aGLXWindowId |
|
8679 |
"remove X/GLX link" |
|
524 | 8680 |
|
8681 |
%{ /* CALLSSTACK: 20000 */ |
|
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
8682 |
if (__isExternalAddress(aGLXWindowId)) { |
134 | 8683 |
ENTERGLX; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8684 |
__GLXUnlinkWindow(myDpy, _WindowVal(aGLXWindowId)); |
134 | 8685 |
LEAVEGLX; |
8686 |
} |
|
20 | 8687 |
%} |
0 | 8688 |
! ! |
8689 |
||
294 | 8690 |
!GLXWorkstation methodsFor:'zbuffer'! |
8691 |
||
8692 |
glxZbsize: planes in: aGLXWindowId |
|
127 | 8693 |
|
8694 |
%{ /* NOCONTEXT */ |
|
8695 |
#ifdef FULL_GLX |
|
8696 |
SETWIN(aGLXWindowId) |
|
294 | 8697 |
zbsize(_longVal(planes)); |
8698 |
RETURN (true); |
|
8699 |
#endif |
|
8700 |
%} |
|
8701 |
. |
|
8702 |
^ false |
|
8703 |
! |
|
64 | 8704 |
|
8705 |
glxZbuffer:aBoolean in:aGLXWindowId |
|
8706 |
"enable/disable z-buffer operation" |
|
8707 |
||
8708 |
%{ /* NOCONTEXT */ |
|
8709 |
#ifdef GLX |
|
8710 |
SETWIN(aGLXWindowId) |
|
8711 |
zbuffer(aBoolean == false ? FALSE : TRUE); |
|
8712 |
RETURN (true); |
|
8713 |
#endif |
|
8714 |
%} |
|
8715 |
. |
|
8716 |
^ false |
|
294 | 8717 |
! |
64 | 8718 |
|
8719 |
glxZdraw: b in: aGLXWindowId |
|
8720 |
"enable/disable drawing into the z-buffer" |
|
8721 |
||
8722 |
%{ /* NOCONTEXT */ |
|
8723 |
#ifdef GLX |
|
8724 |
SETWIN(aGLXWindowId) |
|
8725 |
zdraw(_booleanVal(b)); |
|
8726 |
RETURN (true); |
|
8727 |
#endif |
|
8728 |
%} |
|
8729 |
. |
|
8730 |
^ false |
|
294 | 8731 |
! |
64 | 8732 |
|
8733 |
glxZfunction: func in: aGLXWindowId |
|
8734 |
"set the z-buffer comparison function. |
|
8735 |
func may be either the numeric value or a symbol (preferred)" |
|
8736 |
||
8737 |
%{ /* NOCONTEXT */ |
|
8738 |
#ifdef GLX |
|
8739 |
long f; |
|
8740 |
||
8741 |
SETWIN(aGLXWindowId) |
|
8742 |
if (func == @symbol(NEVER)) |
|
77 | 8743 |
f = ZF_NEVER; |
64 | 8744 |
else if (func == @symbol(LESS)) |
77 | 8745 |
f = ZF_LESS; |
64 | 8746 |
else if (func == @symbol(EQUAL)) |
77 | 8747 |
f = ZF_EQUAL; |
64 | 8748 |
else if (func == @symbol(LEQUAL)) |
77 | 8749 |
f = ZF_LEQUAL; |
64 | 8750 |
else if (func == @symbol(GREATER)) |
77 | 8751 |
f = ZF_GREATER; |
64 | 8752 |
else if (func == @symbol(NOTEQUAL)) |
77 | 8753 |
f = ZF_NOTEQUAL; |
64 | 8754 |
else if (func == @symbol(GEQUAL)) |
77 | 8755 |
f = ZF_GEQUAL; |
64 | 8756 |
else if (func == @symbol(ALWAYS)) |
77 | 8757 |
f = ZF_ALWAYS; |
64 | 8758 |
else |
77 | 8759 |
f = _longVal(func); |
64 | 8760 |
zfunction(f); |
8761 |
RETURN (true); |
|
8762 |
#endif |
|
8763 |
%} |
|
8764 |
. |
|
8765 |
^ false |
|
294 | 8766 |
! |
64 | 8767 |
|
8768 |
glxZsource: src in: aGLXWindowId |
|
8769 |
||
8770 |
%{ /* NOCONTEXT */ |
|
8771 |
#ifdef GLX |
|
8772 |
SETWIN(aGLXWindowId) |
|
8773 |
zsource(_longVal(src)); |
|
8774 |
RETURN (true); |
|
8775 |
#endif |
|
8776 |
%} |
|
8777 |
. |
|
8778 |
^ false |
|
294 | 8779 |
! |
64 | 8780 |
|
8781 |
glxZwritemask: mask in: aGLXWindowId |
|
8782 |
||
8783 |
%{ /* NOCONTEXT */ |
|
8784 |
#ifdef GLX |
|
8785 |
SETWIN(aGLXWindowId) |
|
185 | 8786 |
zwritemask((ulong)__intVal(mask)); |
64 | 8787 |
RETURN (true); |
8788 |
#endif |
|
8789 |
%} |
|
8790 |
. |
|
8791 |
^ false |
|
8792 |
! ! |
|
8793 |
||
294 | 8794 |
!GLXWorkstation class methodsFor:'documentation'! |
8795 |
||
8796 |
version |
|
2449
5fdfb68d0bcc
renamed __new() to __STX___new()
Claus Gittinger <cg@exept.de>
parents:
2422
diff
changeset
|
8797 |
^ '$Header: /cvs/stx/stx/libview/GLXWorkstation.st,v 1.74 1999-02-12 14:58:48 cg Exp $' |
89 | 8798 |
! ! |