author | Claus Gittinger <cg@exept.de> |
Wed, 20 Aug 1997 23:43:10 +0200 | |
changeset 1882 | f1d549a7ed4c |
parent 1752 | f603d5e1cfe8 |
child 1899 | de1eb2a3318e |
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) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
27 |
* or its simulation (compile with -DOPENGL -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 |
||
47 |
/* #define FULL_GLX */ |
|
48 |
||
49 |
/* |
|
554
34cc776bcc0f
compilable with String/Object definition
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
50 |
* 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
|
51 |
* ... and xlib defines True and False |
554
34cc776bcc0f
compilable with String/Object definition
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
52 |
* It might be a better idea, to completely separate GLX stuff from ST/X |
0 | 53 |
*/ |
554
34cc776bcc0f
compilable with String/Object definition
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
54 |
# ifdef String |
34cc776bcc0f
compilable with String/Object definition
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
55 |
# undef String |
34cc776bcc0f
compilable with String/Object definition
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
56 |
# endif |
913 | 57 |
# define String GLX_String |
58 |
||
554
34cc776bcc0f
compilable with String/Object definition
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
59 |
# ifdef Object |
34cc776bcc0f
compilable with String/Object definition
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
60 |
# undef Object |
34cc776bcc0f
compilable with String/Object definition
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
61 |
# endif |
913 | 62 |
# define Object GLX_Object |
63 |
||
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
64 |
# undef True |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
65 |
# undef False |
24 | 66 |
|
168 | 67 |
#include <stdio.h> |
68 |
||
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
69 |
#ifdef OPENGL /* SGI or others OPENGL library */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
70 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
71 |
# include "GL/gl.h" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
72 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
73 |
# ifdef MESA /* GNU MESA openGL simulation */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
74 |
# include "GL/xmesa.h" |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
75 |
# define OPENGLCONTEXT XMesaContext |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
76 |
# define GLXMAKECURRENT(dpy, draw, con) XMesaMakeCurrent(con) |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
77 |
# else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
78 |
/* 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
|
79 |
# define OPENGLCONTEXT GLXContext |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
80 |
# 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
|
81 |
# endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
82 |
|
24 | 83 |
#else |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
84 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
85 |
# ifdef GLX /* SGI's GL library */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
86 |
# include <gl/glws.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
87 |
# include <gl/sphere.h> |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
88 |
# else /* VOGL GL simulation */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
89 |
# undef memset |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
90 |
# include <vogl.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
91 |
# undef move |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
92 |
# include <X11/Xlib.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
93 |
# endif |
24 | 94 |
#endif |
0 | 95 |
|
185 | 96 |
/* |
97 |
* XSGIStereo extension - if available |
|
98 |
*/ |
|
99 |
#ifdef XSGIStereo |
|
100 |
# include <X11/extensions/SGIStereo.h> |
|
101 |
#endif |
|
102 |
||
35 | 103 |
#ifndef NULL |
58 | 104 |
# define NULL (char *)0 /* sigh */ |
35 | 105 |
#endif |
106 |
||
0 | 107 |
typedef enum { |
108 |
GLXcolorIndexSingleBuffer, |
|
109 |
GLXcolorIndexDoubleBuffer, |
|
110 |
GLXrgbSingleBuffer, |
|
111 |
GLXrgbDoubleBuffer |
|
112 |
} GLXWindowType; |
|
113 |
||
333 | 114 |
# define ENTERGLX __BEGIN_PROTECT_REGISTERS__ |
115 |
# define LEAVEGLX __END_PROTECT_REGISTERS__ |
|
134 | 116 |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
117 |
/* |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
118 |
* 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
|
119 |
*/ |
0 | 120 |
#undef String |
969 | 121 |
#ifdef __DEF_String |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
122 |
# define String __DEF_String |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
123 |
#endif |
969 | 124 |
#undef Object |
125 |
#ifdef __DEF_Object |
|
126 |
# define Object __DEF_Object |
|
127 |
#endif |
|
0 | 128 |
|
129 |
/* |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
130 |
* mhmh - openGL has its separate gl-context, |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
131 |
* which is distinct (?) from the windowID. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
132 |
* We dont want to add another instvar to View - do we ? |
0 | 133 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
134 |
#if defined(OPENGL) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
135 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
136 |
# ifndef MAX_OPENGL_VIEWS |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
137 |
# define MAX_OPENGL_VIEWS 50 |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
138 |
# endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
139 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
140 |
struct windowIDToGLContextMapping { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
141 |
Window win; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
142 |
OPENGLCONTEXT con; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
143 |
}; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
144 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
145 |
static struct windowIDToGLContextMapping windowIDToGLContextMapping[MAX_OPENGL_VIEWS]; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
146 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
147 |
static OPENGLCONTEXT |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
148 |
__glxWindowIdToGLContext(xId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
149 |
Window xId; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
150 |
{ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
151 |
int i; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
152 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
153 |
for (i=0; i<MAX_OPENGL_VIEWS; i++) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
154 |
if (windowIDToGLContextMapping[i].win == xId) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
155 |
return windowIDToGLContextMapping[i].con; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
156 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
157 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
158 |
return (OPENGLCONTEXT) 0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
159 |
} |
0 | 160 |
|
157 | 161 |
/* |
162 |
* set the GLXWindow for followup drawing |
|
163 |
*/ |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
164 |
#define SETWIN(aGLXWindowId) \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
165 |
{ \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
166 |
OPENGLCONTEXT context; \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
167 |
\ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
168 |
if (_INST(activeWindow) != aGLXWindowId) { \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
169 |
if (! ISCONNECTED ) { \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
170 |
RETURN (false); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
171 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
172 |
if (! __isExternalAddress(aGLXWindowId)) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
173 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
174 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
175 |
context = (OPENGLCONTEXT) __glxWindowIdToGLContext(_WindowVal(aGLXWindowId)); \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
176 |
if (! context) { \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
177 |
RETURN (false); \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
178 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
179 |
GLXMAKECURRENT(myDpy, _WindowVal(aGLXWindowId), context ); \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
180 |
_INST(activeWindow) = aGLXWindowId; \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
181 |
__STORE(self, aGLXWindowId); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
182 |
} else { \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
183 |
if (aGLXWindowId == nil) { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
184 |
RETURN (false); \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
185 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
186 |
} \ |
12 | 187 |
} |
188 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
189 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
190 |
#else /* old GL */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
191 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
192 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
193 |
* set the GLXWindow for followup drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
194 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
195 |
#define SETWIN(aGLXWindowId) \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
196 |
{ \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
197 |
if (_INST(activeWindow) != aGLXWindowId) { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
198 |
if (! ISCONNECTED ) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
199 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
200 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
201 |
if (! __isExternalAddress(aGLXWindowId)) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
202 |
RETURN (false); \ |
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 |
if (GLXwinset(myDpy, _WindowVal(aGLXWindowId)) < 0) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
205 |
RETURN (false); \ |
553
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 |
_INST(activeWindow) = aGLXWindowId; \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
208 |
__STORE(self, aGLXWindowId); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
209 |
} else { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
210 |
if (aGLXWindowId == nil) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
211 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
212 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
213 |
} \ |
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 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
216 |
#endif /* old GL */ |
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 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
219 |
* some defines - tired of typing ... |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
220 |
* 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
|
221 |
* put/pack them into corresponding c variables. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
222 |
* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
223 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
224 |
#ifdef OPENGL |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
225 |
# define Boolean int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
226 |
# define TRUE 1 |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
227 |
# define FALSE 0 |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
228 |
# define Coord float |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
229 |
# define Icoord int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
230 |
# define Scoord int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
231 |
# define Colorindex int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
232 |
# define Linestyle int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
233 |
# define Offset int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
234 |
# define Angle int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
235 |
# define Screencoord int |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
236 |
#endif |
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 |
#define myDpy (Display *)(__MKCP(_INST(displayId))) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
239 |
#define ISCONNECTED (_INST(displayId) != nil) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
240 |
#define _WindowVal(o) (Window)(__MKCP(o)) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
241 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
242 |
#define __MKBOOLEAN(b) ((b==FALSE) ? false : true) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
243 |
#define _booleanVal(b) ((b==false) ? (Boolean)FALSE : (Boolean)TRUE) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
244 |
#define _coordVal(c) ((__isFloat(c)) ? (Coord)(_floatVal(c)) : (Coord)(__intVal(c))) |
185 | 245 |
#define _icoordVal(c) ((Icoord)(__intVal(c))) |
246 |
#define _scoordVal(c) ((Scoord)(__intVal(c))) |
|
247 |
#define _screencoordVal(c) ((Screencoord)(__intVal(c))) |
|
248 |
#define _colorindexVal(c) ((Colorindex)(__intVal(c))) |
|
249 |
#define _linestyleVal(l) ((Linestyle)(__intVal(l))) |
|
250 |
#define _shortVal(l) ((short)(__intVal(l))) |
|
251 |
#define _longVal(l) ((long)(__intVal(l))) |
|
252 |
#define _deviceVal(l) ((Device)(__intVal(l))) |
|
253 |
#define _tagVal(l) ((Tag)(__intVal(l))) |
|
969 | 254 |
#define _objectVal(l) ((GLX_Object)(__intVal(l))) |
185 | 255 |
#define _offsetVal(l) ((Offset)(__intVal(l))) |
256 |
#define _rgbVal(l) ((RGBvalue)(__intVal(l))) |
|
257 |
#define _angleVal(c) ((Angle)(__intVal(c))) |
|
157 | 258 |
|
29 | 259 |
/* |
260 |
* 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
|
261 |
* ST-object must be true or false. Return from method if invalid. |
29 | 262 |
*/ |
263 |
#define _BOOLEAN_(arg, dst) \ |
|
30 | 264 |
if (arg==true) \ |
77 | 265 |
dst = (Boolean)TRUE; \ |
30 | 266 |
else if (arg==false) \ |
77 | 267 |
dst = (Boolean)FALSE; \ |
29 | 268 |
else { RETURN(false); } |
269 |
||
270 |
/* |
|
271 |
* check for and fetch a coord from ST-arg into C-dst |
|
157 | 272 |
* ST-object must be Float, SmallInteger or Fraction. |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
273 |
* Return from method if invalid. |
29 | 274 |
*/ |
0 | 275 |
#define _COORD_(arg, dst) \ |
97 | 276 |
if (__isFloat(arg)) \ |
77 | 277 |
dst = (Coord)(_floatVal(arg)); \ |
97 | 278 |
else if (__isSmallInteger(arg)) \ |
185 | 279 |
dst = (Coord)(__intVal(arg)); \ |
97 | 280 |
else if (__isFraction(arg) \ |
281 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_numerator) \ |
|
282 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_denominator)) { \ |
|
77 | 283 |
float n, d; \ |
284 |
\ |
|
185 | 285 |
n = (float)(__intVal(_FractionInstPtr(arg)->f_numerator)); \ |
286 |
d = (float)(__intVal(_FractionInstPtr(arg)->f_denominator)); \ |
|
77 | 287 |
dst = (Coord)(n / d); \ |
29 | 288 |
} else { RETURN(false); } |
289 |
||
290 |
/* |
|
291 |
* 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
|
292 |
* ST-object must be SmallInteger. Return from method if invalid. |
29 | 293 |
*/ |
294 |
#define _ICOORD_(arg, dst) \ |
|
97 | 295 |
if (__isSmallInteger(arg)) \ |
185 | 296 |
dst = (Icoord)(__intVal(arg)); \ |
29 | 297 |
else { RETURN(false); } |
298 |
||
299 |
/* |
|
157 | 300 |
* 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
|
301 |
* ST-object must be SmallInteger. Return from method if invalid. |
29 | 302 |
*/ |
303 |
#define _SCOORD_(arg, dst) \ |
|
97 | 304 |
if (__isSmallInteger(arg)) \ |
185 | 305 |
dst = (Scoord)(__intVal(arg)); \ |
29 | 306 |
else { RETURN(false); } |
307 |
||
308 |
#define _SCREENCOORD_(arg, dst) \ |
|
97 | 309 |
if (__isSmallInteger(arg)) \ |
185 | 310 |
dst = (Screencoord)(__intVal(arg)); \ |
29 | 311 |
else { RETURN(false); } |
312 |
||
313 |
#define _COLORINDEX_(arg, dst) \ |
|
97 | 314 |
if (__isSmallInteger(arg)) \ |
185 | 315 |
dst = (Colorindex)(__intVal(arg)); \ |
29 | 316 |
else { RETURN(false); } |
317 |
||
318 |
#define _ANGLE_(arg, dst) \ |
|
97 | 319 |
if (__isSmallInteger(arg)) \ |
185 | 320 |
dst = (Angle)(__intVal(arg)); \ |
29 | 321 |
else { RETURN(false); } |
0 | 322 |
|
323 |
#define _FLOAT_(arg, dst) \ |
|
97 | 324 |
if (__isFloat(arg)) \ |
77 | 325 |
dst = (float)(_floatVal(arg)); \ |
97 | 326 |
else if (__isSmallInteger(arg)) \ |
185 | 327 |
dst = (float)(__intVal(arg)); \ |
97 | 328 |
else if (__isFraction(arg) \ |
329 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_numerator) \ |
|
330 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_denominator)) { \ |
|
77 | 331 |
float n, d; \ |
332 |
\ |
|
185 | 333 |
n = (float)(__intVal(_FractionInstPtr(arg)->f_numerator)); \ |
334 |
d = (float)(__intVal(_FractionInstPtr(arg)->f_denominator)); \ |
|
77 | 335 |
dst = (float)(n / d); \ |
29 | 336 |
} else { RETURN(false); } |
0 | 337 |
|
338 |
#define _INT_(arg, dst) \ |
|
97 | 339 |
if (__isSmallInteger(arg)) \ |
185 | 340 |
dst = (int)(__intVal(arg)); \ |
29 | 341 |
else { RETURN(false); } |
342 |
||
30 | 343 |
#define _indexedArea(object) \ |
344 |
(((char *) (_InstPtr(object))) \ |
|
77 | 345 |
+ OHDR_SIZE \ |
185 | 346 |
+ (__intVal(_ClassInstPtr(__qClass(object))->c_ninstvars)) * sizeof(OBJ)) |
77 | 347 |
%} |
348 |
! ! |
|
349 |
||
168 | 350 |
!GLXWorkstation primitiveVariables! |
351 |
%{ |
|
352 |
/* |
|
353 |
* remembered info from private error handler |
|
354 |
*/ |
|
355 |
static char lastErrorMsg[80] = ""; |
|
356 |
static unsigned lastRequestCode = 0; |
|
357 |
static unsigned lastMinorCode = 0; |
|
358 |
static unsigned lastResource = 0; |
|
359 |
||
360 |
%} |
|
361 |
! ! |
|
362 |
||
89 | 363 |
!GLXWorkstation primitiveFunctions! |
77 | 364 |
%{ |
151 | 365 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
366 |
#ifdef DYNAMICALLY_LOADABLE |
168 | 367 |
/* |
368 |
* catch X-errors and forward as errorInterrupt:#DisplayError, |
|
369 |
* (which itself invokes my handler and optionally raises an exceptionSignal) |
|
370 |
* the implementation below is somewhat wrong: it will |
|
371 |
* report all errors for Display, even though there could be |
|
372 |
* more than one display connection. (being fixed, new errorInterrupt mechanism |
|
373 |
* allows passing an additional argument, which is the displayID ...) |
|
374 |
* |
|
375 |
* this dublicates the functionality as found in XWorkstation; |
|
376 |
* the reason is to allow dynamic loading systems to load this module |
|
377 |
* before XWorkstation (which was not possible otherwise, due to unresolved |
|
378 |
* external references while loading this one) |
|
379 |
*/ |
|
380 |
static |
|
381 |
__XErrorHandler__(dpy, event) |
|
382 |
Display *dpy; |
|
383 |
XErrorEvent *event; |
|
384 |
{ |
|
385 |
XGetErrorText(dpy, event->error_code, lastErrorMsg, 80); |
|
386 |
if (lastErrorMsg[0] == '\0') { |
|
185 | 387 |
sprintf(lastErrorMsg, "code: %d", event->error_code); |
168 | 388 |
} |
389 |
lastRequestCode = event->request_code; |
|
390 |
lastMinorCode = event->minor_code; |
|
391 |
lastResource = event->resourceid; |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
392 |
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
|
393 |
/* |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
394 |
* 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
|
395 |
* 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
|
396 |
* in non bottom-up window order. |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
397 |
*/ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
398 |
return 0; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
399 |
} |
168 | 400 |
|
218
10072d9beba5
can now turn off Xlib error messages from the errorHandler
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
401 |
if (@global(ErrorPrinting) == true) { |
1752 | 402 |
fprintf(stderr, "XWORKSTAT: 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
|
403 |
event->request_code, event->request_code, |
9ff0660f447f
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
218
diff
changeset
|
404 |
event->minor_code, event->minor_code, event->resourceid); |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
405 |
fprintf(stderr, "XWORKSTAT: 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
|
406 |
} |
168 | 407 |
|
207
9124817bbb03
use new c-pointer wrapper macros (based on externalAddress)
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
408 |
__errorInterruptWithIDAndParameter__(@symbol(DisplayError), __MKOBJ(dpy)); |
168 | 409 |
return 0; |
410 |
} |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
411 |
#else |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
412 |
extern __XErrorHandler__(); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
413 |
#endif |
168 | 414 |
|
151 | 415 |
/* |
416 |
* begin moved from GLXsupport.c |
|
417 |
*/ |
|
418 |
||
419 |
/* |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
420 |
* This provides a helper function "GLXCreateWindow", which does |
151 | 421 |
* 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
|
422 |
* to take place within. See the definition of GLXCreateWindow for a |
151 | 423 |
* description of how to call it. |
424 |
* |
|
425 |
* claus: I really had no time to look into all this, |
|
426 |
* this file has been just copied from a 4Dgifts demo .. |
|
427 |
* (will need more than a day to show more ...) |
|
428 |
*/ |
|
429 |
#if defined(GLX) || defined(VGL) |
|
430 |
||
431 |
#include <X11/Xlib.h> |
|
432 |
#include <X11/Xutil.h> |
|
433 |
#ifndef VGL |
|
434 |
# include <gl/glws.h> |
|
435 |
#endif |
|
436 |
#include <signal.h> |
|
437 |
#include <setjmp.h> |
|
438 |
#include "stcIntern.h" |
|
439 |
||
440 |
/* |
|
441 |
* glxhelper.h: |
|
442 |
* |
|
443 |
* List of drawing modes supported by GLXCreateWindow (in glxhelper.c). |
|
444 |
* More than this are possible with mixed model, but this is just an |
|
445 |
* example. You can either expand this list (and the corresponding code in |
|
446 |
* GLXCreateWindow) or call the mixed model calls yourself, using |
|
447 |
* GLXCreateWindow as an example. |
|
448 |
*/ |
|
449 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
450 |
static char * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
451 |
typeToName[] = { |
151 | 452 |
"color index single buffer", |
453 |
"color index double buffer", |
|
454 |
"rgb single buffer", |
|
455 |
"rgb double buffer", |
|
456 |
}; |
|
457 |
||
458 |
#ifndef VGL |
|
459 |
/* |
|
460 |
* Dorky little helper function used to build up a GLXconfig array. |
|
461 |
*/ |
|
462 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
463 |
static void |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
464 |
set_entry (GLXconfig* ptr, int b, int m, int a) |
151 | 465 |
{ |
466 |
ptr->buffer = b; |
|
467 |
ptr->mode = m; |
|
468 |
ptr->arg = a; |
|
469 |
} |
|
470 |
#endif /* VGL */ |
|
471 |
||
472 |
static JMP_BUF errorReturn; |
|
473 |
||
474 |
static void |
|
475 |
glAbort() { |
|
476 |
longjmp(errorReturn, 1); |
|
477 |
} |
|
478 |
||
479 |
/* |
|
480 |
* GLXCreateWindow(dpy, parent, x, y, w, h, boderWidth, type) |
|
481 |
* |
|
482 |
* Return value is the X window id of the newly created window. |
|
483 |
* |
|
484 |
* Arguments are: |
|
485 |
* dpy The X "Display*" returned by XOpenDisplay |
|
486 |
* parent The parent of the newly created window, |
|
487 |
* a typical value for this is |
|
488 |
* RootWindow(dpy, DefaultScreen(dpy)) |
|
489 |
* x,y The location of the window to be created, |
|
490 |
* y coordinate is measured from the top down. |
|
491 |
* w,h size of the new window |
|
492 |
* borderWidth the X border size for this window, should probably |
|
493 |
* be zero. |
|
494 |
* type the GLXWindowType (see glxhelper.h) desribing the |
|
495 |
* typer of GL drawing to be done in this window |
|
496 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
497 |
Window |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
498 |
__GLXCreateWindow(dpy, parent, x, y, w, h, borderWidth, type) |
151 | 499 |
Display* dpy; |
500 |
Window parent; |
|
501 |
GLXWindowType type; |
|
502 |
{ |
|
503 |
#ifdef VGL |
|
504 |
Visual visual; |
|
505 |
#else |
|
506 |
GLXconfig params[50]; |
|
507 |
GLXconfig* next; |
|
508 |
GLXconfig* retconfig; |
|
509 |
Colormap cmap = DefaultColormap(dpy, DefaultScreen(dpy)); |
|
510 |
XVisualInfo *vis; |
|
511 |
#endif |
|
512 |
XVisualInfo template; |
|
513 |
XColor white; |
|
514 |
XSetWindowAttributes cwa; |
|
515 |
XWindowAttributes pwa; |
|
516 |
int scr, i, nret; |
|
517 |
Window win; |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
518 |
#ifdef HAS_SIGACTION |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
519 |
struct sigaction oldSig, newSig; |
151 | 520 |
#else |
521 |
void *oldSig; |
|
522 |
#endif |
|
523 |
||
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
524 |
__catchExit(1); |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
525 |
|
151 | 526 |
if (setjmp(errorReturn)) { |
527 |
printf("hard error in GL - return\n"); |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
528 |
#ifdef HAS_SIGACTION |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
529 |
sigaction(SIGSEGV, &oldSig, 0); |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
530 |
#else |
151 | 531 |
signal(SIGSEGV, oldSig); |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
532 |
#endif |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
533 |
__catchExit(0); |
151 | 534 |
return 0; |
535 |
} |
|
536 |
__CONT__ |
|
537 |
||
538 |
#ifdef VGL |
|
539 |
/* |
|
540 |
* I know what VGL supports; its somewhat unclean to hard code it here |
|
541 |
*/ |
|
542 |
switch (type) { |
|
543 |
case GLXcolorIndexSingleBuffer: |
|
544 |
case GLXcolorIndexDoubleBuffer: |
|
545 |
break; |
|
546 |
||
547 |
case GLXrgbSingleBuffer: |
|
548 |
case GLXrgbDoubleBuffer: |
|
549 |
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
|
550 |
__catchExit(0); |
151 | 551 |
return 0; |
552 |
} |
|
553 |
||
554 |
scr = DefaultScreen(dpy); |
|
555 |
visual.visualid = CopyFromParent; |
|
556 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
557 |
if (w <= 0) { |
|
558 |
printf("VGL: bad width: %d\n", w); |
|
559 |
w = 1; |
|
560 |
} |
|
561 |
if (h <= 0) { |
|
562 |
printf("VGL: bad height: %d\n", h); |
|
563 |
h = 1; |
|
564 |
} |
|
565 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
566 |
borderWidth, DisplayPlanes(dpy, scr), |
|
567 |
InputOutput, &visual, |
|
568 |
CWBorderPixel, &cwa); |
|
569 |
||
570 |
/* |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
571 |
* on some, seg-violations occur in the GL, if too many |
151 | 572 |
* views are created ... just to make certain, we catch those |
573 |
* in GL too. |
|
574 |
*/ |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
575 |
# ifdef HAS_SIGACTION |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
576 |
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
|
577 |
newSig = oldSig; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
578 |
newSig.sa_handler = glAbort; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
579 |
sigaction(SIGSEGV, &newSig, (struct sigaction *)0); |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
580 |
# else |
151 | 581 |
oldSig = signal(SIGSEGV, glAbort); |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
582 |
# endif |
151 | 583 |
i = GLXlink(dpy, win); |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
584 |
# ifdef HAS_SIGACTION |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
585 |
sigaction(SIGSEGV, &oldSig, (struct sigaction *)0); |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
586 |
# else |
151 | 587 |
signal(SIGSEGV, oldSig); |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
588 |
# endif |
151 | 589 |
|
590 |
if (i < 0) { |
|
591 |
printf("GLXlink returned %d\n", i); |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
592 |
__catchExit(0); |
151 | 593 |
return 0; |
594 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
595 |
|
151 | 596 |
#else /* not VGL */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
597 |
|
151 | 598 |
/* |
599 |
* This builds an array in "params" that describes for GLXgetconfig(3G) |
|
600 |
* the type of GL drawing that will be done. |
|
601 |
*/ |
|
602 |
next = params; |
|
603 |
switch (type) { |
|
604 |
case GLXcolorIndexSingleBuffer: |
|
605 |
set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE); |
|
606 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE); |
|
607 |
break; |
|
608 |
case GLXcolorIndexDoubleBuffer: |
|
609 |
set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE); |
|
610 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE); |
|
611 |
break; |
|
612 |
case GLXrgbSingleBuffer: |
|
613 |
set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE); |
|
614 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE); |
|
615 |
break; |
|
616 |
case GLXrgbDoubleBuffer: |
|
617 |
set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE); |
|
618 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE); |
|
619 |
break; |
|
620 |
} |
|
621 |
set_entry(next, 0, 0, 0); /* The input to GLXgetconfig is null terminated */ |
|
622 |
||
623 |
/* |
|
624 |
* Get configuration data for a window based on above parameters |
|
625 |
* First we have to find out which screen the parent window is on, |
|
626 |
* then we can call GXLgetconfig() |
|
627 |
*/ |
|
628 |
XGetWindowAttributes(dpy, parent, &pwa); |
|
629 |
retconfig = GLXgetconfig(dpy, XScreenNumberOfScreen(pwa.screen), params); |
|
630 |
if (retconfig == 0) { |
|
631 |
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
|
632 |
__catchExit(0); |
151 | 633 |
return 0; |
634 |
} |
|
635 |
||
636 |
/* |
|
637 |
* Scan through config info, pulling info needed to create a window |
|
638 |
* that supports the rendering mode. |
|
639 |
*/ |
|
640 |
for (next = retconfig; next->buffer; next++) { |
|
641 |
unsigned long buffer = next->buffer; |
|
642 |
unsigned long mode = next->mode; |
|
643 |
unsigned long value = next->arg; |
|
644 |
switch (mode) { |
|
645 |
case GLX_COLORMAP: |
|
646 |
if (buffer == GLX_NORMAL) { |
|
647 |
cmap = value; |
|
648 |
} |
|
649 |
break; |
|
650 |
case GLX_VISUAL: |
|
651 |
if (buffer == GLX_NORMAL) { |
|
652 |
template.visualid = value; |
|
653 |
template.screen = DefaultScreen(dpy); |
|
654 |
vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask, |
|
655 |
&template, &nret); |
|
656 |
} |
|
657 |
break; |
|
658 |
} |
|
659 |
} |
|
660 |
||
661 |
/* |
|
662 |
* Create the window |
|
663 |
*/ |
|
664 |
cwa.colormap = cmap; |
|
665 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
666 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
667 |
borderWidth, vis->depth, InputOutput, vis->visual, |
|
668 |
CWColormap|CWBorderPixel, &cwa); |
|
669 |
||
670 |
/* |
|
671 |
* Rescan configuration info and find window slot that getconfig |
|
672 |
* provided. Fill it in with the window we just created. |
|
673 |
*/ |
|
674 |
for (next = retconfig; next->buffer; next++) { |
|
675 |
if ((next->buffer == GLX_NORMAL) && (next->mode == GLX_WINDOW)) { |
|
676 |
next->arg = win; |
|
677 |
break; |
|
678 |
} |
|
679 |
} |
|
680 |
||
681 |
/* |
|
682 |
* Now "retconfig" contains all the information the GL needs to |
|
683 |
* configure the window and its own internal state. |
|
684 |
*/ |
|
685 |
/* |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
686 |
* on iris, seg-violations occur in the GL, if too many |
151 | 687 |
* views are created ... |
688 |
*/ |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
689 |
# ifdef HAS_SIGACTION |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
690 |
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
|
691 |
newSig = oldSig; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
692 |
newSig.sa_handler = glAbort; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
693 |
sigaction(SIGSEGV, &newSig, (struct sigaction *)0); |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
694 |
# else |
151 | 695 |
oldSig = signal(SIGSEGV, glAbort); |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
696 |
# endif |
151 | 697 |
i = GLXlink(dpy, retconfig); |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
698 |
# ifdef HAS_SIGACTION |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
699 |
sigaction(SIGSEGV, &oldSig, (struct sigaction *)0); |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
700 |
# else |
151 | 701 |
signal(SIGSEGV, oldSig); |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
702 |
# endif |
151 | 703 |
|
704 |
if (i < 0) { |
|
705 |
printf("GLXlink returned %d\n", i); |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
706 |
__catchExit(0); |
151 | 707 |
return 0; |
708 |
} |
|
709 |
||
710 |
/* |
|
711 |
* The GL sets its own X error handlers, which exits - this is not what we want |
|
712 |
*/ |
|
713 |
XSetErrorHandler(__XErrorHandler__); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
714 |
#endif /* not VGL */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
715 |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
716 |
__catchExit(0); |
151 | 717 |
return win; |
718 |
} |
|
719 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
720 |
__GLXUnlinkWindow(dpy, win) |
151 | 721 |
Display* dpy; |
722 |
Window win; |
|
723 |
{ |
|
724 |
/* |
|
725 |
* only needed for VGL - GLX does it automatically |
|
726 |
*/ |
|
727 |
#ifdef VGL |
|
728 |
GLXunlink(dpy, win); |
|
729 |
#endif |
|
730 |
} |
|
731 |
||
732 |
#endif /* GLX or VGL */ |
|
733 |
||
734 |
/* |
|
735 |
* end moved from GLXsupport.c |
|
736 |
*/ |
|
737 |
||
29 | 738 |
/* |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
739 |
* helper for rotation - calls rot() |
29 | 740 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
741 |
OBJ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
742 |
__glx_doRotate(angle, axis) |
29 | 743 |
OBJ angle; |
744 |
char axis; |
|
745 |
{ |
|
746 |
float f_angle; |
|
747 |
||
35 | 748 |
if (__isFloat(angle)) { |
77 | 749 |
f_angle = (float)(_floatVal(angle)); |
750 |
if (f_angle != 0.0) |
|
751 |
rot(f_angle, axis); |
|
752 |
return (true); |
|
29 | 753 |
} |
35 | 754 |
if (__isFraction(angle) |
97 | 755 |
&& __isSmallInteger(_FractionInstPtr(angle)->f_numerator) |
756 |
&& __isSmallInteger(_FractionInstPtr(angle)->f_denominator)) { |
|
77 | 757 |
float n, d; |
758 |
||
185 | 759 |
n = (float)(__intVal(_FractionInstPtr(angle)->f_numerator)); |
760 |
d = (float)(__intVal(_FractionInstPtr(angle)->f_denominator)); |
|
77 | 761 |
f_angle = n / d; |
762 |
if (f_angle != 0.0) |
|
763 |
rot(f_angle, axis); |
|
764 |
return (true); |
|
29 | 765 |
} |
97 | 766 |
if (__isSmallInteger(angle)) { |
185 | 767 |
f_angle = (float)(__intVal(angle)); |
77 | 768 |
if (f_angle != 0.0) |
769 |
rot(f_angle, axis); |
|
770 |
return (true); |
|
29 | 771 |
} |
772 |
return false; |
|
773 |
} |
|
0 | 774 |
|
24 | 775 |
/* |
29 | 776 |
* fetch integers from an st-array (elements must be smallIntegers) |
777 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
778 |
long * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
779 |
__glx_getLongsFromInto(obj, vec, count) |
29 | 780 |
OBJ obj; |
781 |
long *vec; |
|
782 |
{ |
|
783 |
OBJ cls, o; |
|
784 |
int nByte, i, ninstVars, nInstBytes; |
|
785 |
char *pElem; |
|
786 |
||
787 |
if (! _isNonNilObject(obj)) return (long *)NULL; |
|
134 | 788 |
cls = __qClass(obj); |
185 | 789 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 790 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 791 |
nByte = __qSize(obj) - nInstBytes; |
29 | 792 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
793 |
if (nByte < (count * sizeof(OBJ))) return (long *)NULL; |
|
794 |
for (i=0; i<count; i++) { |
|
77 | 795 |
o = *(OBJ *)pElem; |
97 | 796 |
if (! __isSmallInteger(o)) return (long *)NULL; |
185 | 797 |
vec[i] = (long)__intVal(o); |
77 | 798 |
pElem += sizeof(OBJ); |
29 | 799 |
} |
800 |
return vec; |
|
801 |
} |
|
802 |
||
803 |
/* |
|
804 |
* fetch shorts from an st-array (elements must be smallIntegers) |
|
805 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
806 |
short * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
807 |
__glx_getShortsFromInto(obj, vec, count) |
29 | 808 |
OBJ obj; |
809 |
short *vec; |
|
810 |
{ |
|
811 |
OBJ cls, o; |
|
812 |
int nByte, i, ninstVars, nInstBytes; |
|
813 |
char *pElem; |
|
814 |
||
815 |
if (! _isNonNilObject(obj)) return (short *)NULL; |
|
134 | 816 |
cls = __qClass(obj); |
185 | 817 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 818 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 819 |
nByte = __qSize(obj) - nInstBytes; |
29 | 820 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
821 |
if (nByte < (count * sizeof(OBJ))) return (short *)NULL; |
|
822 |
for (i=0; i<count; i++) { |
|
77 | 823 |
o = *(OBJ *)pElem; |
97 | 824 |
if (! __isSmallInteger(o)) return (short *)NULL; |
185 | 825 |
vec[i] = (short)__intVal(o); |
77 | 826 |
pElem += sizeof(OBJ); |
29 | 827 |
} |
828 |
return vec; |
|
829 |
} |
|
830 |
||
831 |
/* |
|
832 |
* fetch floats from an st-object into a c-float array |
|
833 |
* which may be a floatArray, doubleArray or array-of-something, |
|
834 |
* where something may be a float, fraction or smallInteger, |
|
24 | 835 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
836 |
float * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
837 |
__glx_getFloatsFromInto(obj, vec, count) |
12 | 838 |
OBJ obj; |
839 |
float *vec; |
|
840 |
{ |
|
841 |
OBJ cls; |
|
842 |
int nByte; |
|
843 |
OBJ o; |
|
844 |
int i, ninstVars, nInstBytes; |
|
845 |
char *pElem; |
|
846 |
||
847 |
if (! _isNonNilObject(obj)) return (float *)0; |
|
848 |
||
134 | 849 |
cls = __qClass(obj); |
185 | 850 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
12 | 851 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 852 |
nByte = __qSize(obj) - nInstBytes; |
12 | 853 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
854 |
||
185 | 855 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
12 | 856 |
case FLOATARRAY: |
77 | 857 |
/* |
858 |
* best speed for float array |
|
859 |
* - the data is already as we want it |
|
860 |
*/ |
|
861 |
if (nByte < (count * sizeof(float))) return (float *)0; |
|
862 |
return (float *)pElem; |
|
12 | 863 |
|
864 |
case DOUBLEARRAY: |
|
77 | 865 |
/* |
866 |
* for double array, have to copy-and-cast |
|
867 |
*/ |
|
868 |
if (nByte < (count * sizeof(double))) return (float *)0; |
|
869 |
for (i=0; i<count; i++) { |
|
870 |
vec[i] = *((double *)pElem); |
|
871 |
pElem += sizeof(double); |
|
872 |
} |
|
873 |
return vec; |
|
12 | 874 |
|
875 |
case POINTERARRAY: |
|
77 | 876 |
/* |
877 |
* for other array, have to fetch, check and store |
|
878 |
* the elements can be floats, smallintegers or fractions |
|
879 |
*/ |
|
880 |
if (nByte < (count * sizeof(OBJ))) return (float *)0; |
|
881 |
/* get elements one-by-one */ |
|
882 |
for (i=0; i<count; i++) { |
|
883 |
o = *(OBJ *)pElem; |
|
884 |
if (__isFloat(o)) { |
|
885 |
vec[i] = _floatVal(o); |
|
97 | 886 |
} else if (__isSmallInteger(o)) { |
185 | 887 |
vec[i] = (float)(__intVal(o)); |
77 | 888 |
} else if (__isFraction(o) |
97 | 889 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
890 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
77 | 891 |
float n, d; |
892 |
||
185 | 893 |
n = (float)(__intVal(_FractionInstPtr(o)->f_numerator)); |
894 |
d = (float)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
77 | 895 |
vec[i] = n / d; |
896 |
} else |
|
897 |
return 0; |
|
898 |
pElem += sizeof(OBJ); |
|
899 |
} |
|
900 |
return vec; |
|
12 | 901 |
} |
902 |
return (float *)0; |
|
903 |
} |
|
904 |
||
29 | 905 |
/* |
906 |
* fetch doubles from an st-object into a c-double array |
|
907 |
* which may be a floatArray, doubleArray or array-of-something, |
|
908 |
* where something may be a float, fraction or smallInteger, |
|
909 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
910 |
double * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
911 |
__glx_getDoublesFromInto(obj, vec, count) |
29 | 912 |
OBJ obj; |
913 |
double *vec; |
|
914 |
{ |
|
915 |
OBJ cls, o; |
|
916 |
int nByte, i, ninstVars, nInstBytes; |
|
917 |
char *pElem; |
|
918 |
||
919 |
if (! _isNonNilObject(obj)) return (double *)0; |
|
134 | 920 |
cls = __qClass(obj); |
185 | 921 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 922 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 923 |
nByte = __qSize(obj) - nInstBytes; |
29 | 924 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
925 |
||
185 | 926 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
29 | 927 |
case DOUBLEARRAY: |
77 | 928 |
/* best speed for double array - the data is already as we want it */ |
929 |
if (nByte < (count * sizeof(double))) return (double *)0; |
|
930 |
return (double *)pElem; |
|
29 | 931 |
|
932 |
case FLOATARRAY: |
|
77 | 933 |
if (nByte < (count * sizeof(float))) return (double *)0; |
934 |
for (i=0; i<count; i++) { |
|
935 |
vec[i] = *((float *)pElem); |
|
936 |
pElem += sizeof(float); |
|
937 |
} |
|
938 |
return vec; |
|
29 | 939 |
|
940 |
case POINTERARRAY: |
|
77 | 941 |
if (nByte < (count * sizeof(OBJ))) return (double *)0; |
942 |
/* get elements one-by-one */ |
|
943 |
for (i=0; i<count; i++) { |
|
944 |
o = *(OBJ *)pElem; |
|
945 |
if (__isFloat(o)) |
|
946 |
vec[i] = _floatVal(o); |
|
97 | 947 |
else if (__isSmallInteger(o)) |
185 | 948 |
vec[i] = (double)(__intVal(o)); |
77 | 949 |
else if (__isFraction(o) |
97 | 950 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
951 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
77 | 952 |
double n, d; |
953 |
||
185 | 954 |
n = (double)(__intVal(_FractionInstPtr(o)->f_numerator)); |
955 |
d = (double)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
77 | 956 |
vec[i] = n / d; |
957 |
||
958 |
} else |
|
959 |
return 0; |
|
960 |
pElem += sizeof(OBJ); |
|
961 |
} |
|
962 |
return vec; |
|
29 | 963 |
} |
964 |
return (double *)0; |
|
965 |
} |
|
966 |
||
967 |
/* |
|
968 |
* move from a c-float array into an st-object, |
|
969 |
* the st-object MUST be either a float- or double array |
|
970 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
971 |
__glx_putFloatsFromInto(vec, obj, count) |
12 | 972 |
OBJ obj; |
973 |
float *vec; |
|
974 |
{ |
|
975 |
OBJ cls; |
|
976 |
int nByte; |
|
977 |
OBJ o; |
|
978 |
int i, ninstVars, nInstBytes; |
|
979 |
char *pElem; |
|
980 |
||
981 |
if (! _isNonNilObject(obj)) return 0; |
|
982 |
||
134 | 983 |
cls = __qClass(obj); |
185 | 984 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
12 | 985 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 986 |
nByte = __qSize(obj) - nInstBytes; |
12 | 987 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
988 |
||
185 | 989 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
12 | 990 |
case FLOATARRAY: |
77 | 991 |
if (nByte < (count * sizeof(float))) return 0; |
992 |
for (i=0; i<count; i++) { |
|
993 |
*(float *)pElem = vec[i]; |
|
994 |
pElem += sizeof(float); |
|
995 |
} |
|
996 |
return 1; |
|
12 | 997 |
|
998 |
case DOUBLEARRAY: |
|
77 | 999 |
if (nByte < (count * sizeof(float))) return 0; |
1000 |
for (i=0; i<count; i++) { |
|
1001 |
*(double *)pElem = vec[i]; |
|
1002 |
pElem += sizeof(double); |
|
1003 |
} |
|
1004 |
return 1; |
|
12 | 1005 |
} |
1006 |
/* not implemented for others */ |
|
1007 |
||
1008 |
return 0; |
|
1009 |
} |
|
1010 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1011 |
#ifndef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1012 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1013 |
Matrix * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1014 |
__glx_getFloatsFromMatrixInto(obj, mp) |
12 | 1015 |
OBJ obj; |
1016 |
Matrix *mp; |
|
1017 |
{ |
|
1018 |
OBJ cls; |
|
1019 |
int nByte; |
|
1020 |
OBJ o; |
|
29 | 1021 |
int ninstVars, nInstBytes; |
1022 |
char *pElem; |
|
1023 |
int x = 0; |
|
1024 |
int i,j; |
|
12 | 1025 |
|
1026 |
if (! _isNonNilObject(obj)) return (Matrix *)0; |
|
1027 |
||
134 | 1028 |
cls = __qClass(obj); |
185 | 1029 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 1030 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1031 |
nByte = __qSize(obj) - nInstBytes; |
29 | 1032 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1033 |
||
185 | 1034 |
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
|
1035 |
case FLOATARRAY: |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1036 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1037 |
* very easy for FLOATARRAY objects - no copying needed |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1038 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1039 |
if (nByte < (16 * sizeof(float))) return (Matrix *)0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1040 |
return (Matrix *) _FloatArrayInstPtr(obj)->f_element; |
12 | 1041 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1042 |
case DOUBLEARRAY: |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1043 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1044 |
* for DOUBLEARRAY objects copy and cast |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1045 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1046 |
if (nByte < (16 * sizeof(double))) return (Matrix *)0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1047 |
for (i=0; i<4; i++) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1048 |
for (j=0; j<4; j++) { |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1049 |
(*mp)[i][j] = _DoubleArrayInstPtr(obj)->d_element[x]; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1050 |
x++; |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1051 |
} |
77 | 1052 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1053 |
return mp; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1054 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1055 |
case POINTERARRAY: |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1056 |
if (nByte < (16 * sizeof(OBJ))) return (Matrix *)0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1057 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1058 |
* get elements one-by-one |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1059 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1060 |
for (i=0; i<4; i++) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1061 |
for (j=0; j<4; j++) { |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1062 |
o = _ArrayInstPtr(obj)->a_element[x]; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1063 |
if (__isFloat(o)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1064 |
(*mp)[i][j] = _floatVal(o); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1065 |
} else if (__isSmallInteger(o)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1066 |
(*mp)[i][j] = (double)__intVal(o); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1067 |
} else if (__isFraction(o) |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1068 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1069 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1070 |
double n, d; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1071 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1072 |
n = (double)(__intVal(_FractionInstPtr(o)->f_numerator)); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1073 |
d = (double)(__intVal(_FractionInstPtr(o)->f_denominator)); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1074 |
(*mp)[i][j] = n / d; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1075 |
} else |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1076 |
return (Matrix *)0; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1077 |
x++; |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1078 |
} |
77 | 1079 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1080 |
return mp; |
12 | 1081 |
} |
1082 |
return (Matrix *)0; |
|
1083 |
} |
|
1084 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1085 |
#endif |
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 |
float* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1088 |
__glx_getFloatsFromFloatArrayInto(obj, fp) |
46 | 1089 |
OBJ obj; |
1090 |
float *fp; |
|
1091 |
{ |
|
1092 |
OBJ cls; |
|
1093 |
int ninstVars; |
|
1094 |
||
1095 |
if (! _isNonNilObject(obj)) return (float *)0; |
|
134 | 1096 |
cls = __qClass(obj); |
350 | 1097 |
if (cls == @global(FloatArray)) |
77 | 1098 |
return _FloatArrayInstPtr(obj)->f_element; |
46 | 1099 |
|
185 | 1100 |
if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) { |
1101 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
77 | 1102 |
return (float *) &(_InstPtr(obj)->i_instvars[ninstVars]); |
46 | 1103 |
} |
1104 |
||
1105 |
/* |
|
1106 |
* need more here (i.e. convert from array-of-floats) |
|
1107 |
*/ |
|
1108 |
return (float *)0; |
|
1109 |
} |
|
1110 |
||
1111 |
%} |
|
1112 |
! ! |
|
0 | 1113 |
|
294 | 1114 |
!GLXWorkstation class methodsFor:'documentation'! |
1115 |
||
1116 |
copyright |
|
1117 |
" |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1118 |
COPYRIGHT (c) 1993 by Claus Gittinger |
294 | 1119 |
All Rights Reserved |
1120 |
||
1121 |
This software is furnished under a license and may be used |
|
1122 |
only in accordance with the terms of that license and with the |
|
1123 |
inclusion of the above copyright notice. This software may not |
|
1124 |
be provided or otherwise made available to, or used by, any |
|
1125 |
other person. No title to or ownership of the software is |
|
1126 |
hereby transferred. |
|
1127 |
" |
|
1128 |
! |
|
1129 |
||
1130 |
documentation |
|
1131 |
" |
|
1132 |
this class was originally written as a demo on how an interface to |
|
1133 |
a c graphics library could be implemented. In the mean time, it has become |
|
1134 |
quite complete ... |
|
1135 |
||
1136 |
It provides an interface to either a real GL (on SGI workstations) |
|
1137 |
or a simulated VGL (i.e. GL-light; low nicotine). |
|
1138 |
The GL simulation is derived from the PD vogl library, with slight |
|
1139 |
modifictions to support multiple GL views. |
|
1140 |
||
1141 |
Most of the hard work was done by Jeff (thanks indeed) ... |
|
1142 |
||
1143 |
||
1144 |
Some notes: |
|
1145 |
||
1146 |
I do not really know what most of these functions do - for more |
|
1147 |
detail, see the GL man pages (on SGI) or the doc provided with VGL. |
|
1148 |
||
1149 |
The interface offered here provides a very very low level (i.e one-to-one) |
|
1150 |
interface to GL functions. More high-level stuff is required, to make |
|
1151 |
3D drawing be more object-oriented. |
|
1152 |
(see a bit of this in 'clients/IRIS-specials') |
|
1153 |
||
1154 |
Some functions are duplicated, Jeff and I developed those in parallel - |
|
1155 |
for now, both will remain - finally they will be merged and duplicates removed ... |
|
1156 |
(examples are makeobj and makeObject). |
|
1157 |
||
1158 |
Also, in a hurry to implement all those methods, many do no or only |
|
1159 |
limited argument checking - make certain, that you pass the correct |
|
1160 |
arguments. |
|
1161 |
||
1162 |
There might be some confusion in the v3[sifd] functions: basically they |
|
1163 |
all do the same, and could be mapped onto one st-method (such as vertex3). |
|
1164 |
However, the C-functions expect different argument types - I dont know if |
|
1165 |
one or another of these functions suffers from any performance penalties. |
|
1166 |
Therefore, I leave the direct 1-to-1 mapping; GL experts might know more |
|
1167 |
about this (I use v3f in all of my code). |
|
1168 |
||
1169 |
written june 93 by claus |
|
1170 |
VGL stuff dec 93 |
|
1171 |
many many additions jan 94 by Jeff McAffer <jeff@is.s.u-tokyo.ac.jp> |
|
1172 |
||
1173 |
Since this is a demo (consider it a free add-on goody) there is |
|
1174 |
*** NO WARRANTY ** for this. |
|
1175 |
||
1176 |
Notice: this should be rewritten to use the openGL library functions |
|
1177 |
(actually, to not loose the VGL interface, another OpenGLWorkstation |
|
1178 |
class should be written) |
|
614 | 1179 |
|
1180 |
[author:] |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1181 |
Claus Gittinger |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1182 |
Jeff McAffer |
294 | 1183 |
" |
1184 |
! ! |
|
1185 |
||
168 | 1186 |
!GLXWorkstation class methodsFor:'error handling'! |
1187 |
||
294 | 1188 |
errorStringOfLastError |
1189 |
%{ |
|
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1190 |
RETURN ( __MKSTRING(lastErrorMsg) ); |
168 | 1191 |
%} |
1192 |
! |
|
1193 |
||
528 | 1194 |
forceGL:aBoolean |
1195 |
ForceGL := aBoolean. |
|
1196 |
AllScreens notNil ifTrue:[ |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1197 |
AllScreens do:[:screen | screen initializeScreenProperties] |
528 | 1198 |
]. |
1199 |
! |
|
1200 |
||
168 | 1201 |
minorCodeOfLastError |
1202 |
%{ /* NOCONTEXT */ |
|
1203 |
||
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
1204 |
RETURN ( __MKSMALLINT(lastMinorCode) ); |
168 | 1205 |
%} |
1206 |
! |
|
1207 |
||
294 | 1208 |
requestCodeOfLastError |
1209 |
%{ /* NOCONTEXT */ |
|
1210 |
||
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
1211 |
RETURN ( __MKSMALLINT(lastRequestCode) ); |
294 | 1212 |
%} |
1213 |
! |
|
1214 |
||
168 | 1215 |
resourceIdOfLastError |
1216 |
%{ /* NOCONTEXT */ |
|
1217 |
||
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
1218 |
RETURN ( __MKSMALLINT(lastResource) ); |
168 | 1219 |
%} |
294 | 1220 |
! ! |
1221 |
||
1222 |
!GLXWorkstation methodsFor:'arcs and circles'! |
|
1223 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1224 |
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
|
1225 |
"draw an arc at a given location. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1226 |
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
|
1227 |
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
|
1228 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1229 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1230 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1231 |
#else |
294 | 1232 |
Coord c_x, c_y, c_radius; |
1233 |
Angle a_startang, a_endang; |
|
1234 |
||
1235 |
_COORD_(x, c_x) |
|
1236 |
_COORD_(y, c_y) |
|
1237 |
_COORD_(radius, c_radius) |
|
1238 |
_ANGLE_(startang, a_startang) |
|
1239 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1240 |
|
294 | 1241 |
SETWIN(aGLXWindowId) |
1242 |
arc(c_x, c_y, c_radius, a_startang, a_endang); |
|
1243 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1244 |
#endif |
294 | 1245 |
%} |
528 | 1246 |
|
1247 |
"Modified: 19.3.1996 / 18:43:52 / cg" |
|
294 | 1248 |
! |
1249 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1250 |
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
|
1251 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1252 |
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
|
1253 |
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
|
1254 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1255 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1256 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1257 |
#else |
294 | 1258 |
Coord c_x, c_y, c_radius; |
1259 |
Angle a_startang, a_endang; |
|
1260 |
||
1261 |
_COORD_(x, c_x) |
|
1262 |
_COORD_(y, c_y) |
|
1263 |
_COORD_(radius, c_radius) |
|
1264 |
_ANGLE_(startang, a_startang) |
|
1265 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1266 |
|
294 | 1267 |
SETWIN(aGLXWindowId) |
1268 |
arcf(c_x, c_y, c_radius, a_startang, a_endang); |
|
1269 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1270 |
#endif |
294 | 1271 |
%} |
1272 |
! |
|
1273 |
||
1274 |
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
|
1275 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1276 |
All arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1277 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1278 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1279 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1280 |
#else |
294 | 1281 |
Icoord c_x, c_y, c_radius; |
1282 |
Angle a_startang, a_endang; |
|
1283 |
||
1284 |
_ICOORD_(x, c_x) |
|
1285 |
_ICOORD_(y, c_y) |
|
1286 |
_ICOORD_(radius, c_radius) |
|
1287 |
_ANGLE_(startang, a_startang); |
|
1288 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1289 |
|
294 | 1290 |
SETWIN(aGLXWindowId) |
1291 |
arcfi(c_x, c_y, c_radius, a_startang, a_endang); |
|
1292 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1293 |
#endif |
294 | 1294 |
%} |
1295 |
! |
|
1296 |
||
1297 |
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
|
1298 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1299 |
All arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1300 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1301 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1302 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1303 |
#else |
294 | 1304 |
Scoord c_x, c_y, c_radius; |
1305 |
Angle a_startang, a_endang; |
|
1306 |
||
1307 |
_SCOORD_(x, c_x) |
|
1308 |
_SCOORD_(y, c_y) |
|
1309 |
_SCOORD_(radius, c_radius) |
|
1310 |
_ANGLE_(startang, a_startang) |
|
1311 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1312 |
|
294 | 1313 |
SETWIN(aGLXWindowId) |
1314 |
arcfs(c_x, c_y, c_radius, a_startang, a_endang); |
|
1315 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1316 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1317 |
%} |
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 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1320 |
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
|
1321 |
"draw an (unfilled) arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1322 |
All arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1323 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1324 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1325 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1326 |
#else |
294 | 1327 |
Icoord c_x, c_y, c_radius; |
1328 |
Angle a_startang, a_endang; |
|
1329 |
||
1330 |
_ICOORD_(x, c_x) |
|
1331 |
_ICOORD_(y, c_y) |
|
1332 |
_ICOORD_(radius, c_radius) |
|
1333 |
_ANGLE_(startang, a_startang) |
|
1334 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1335 |
|
294 | 1336 |
SETWIN(aGLXWindowId) |
1337 |
arci(c_x, c_y, c_radius, a_startang, a_endang); |
|
1338 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1339 |
#endif |
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 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1342 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1343 |
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
|
1344 |
"draw an (unfilled) arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1345 |
All arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1346 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1347 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1348 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1349 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1350 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1351 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1352 |
Scoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1353 |
Angle a_startang, a_endang; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1354 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1355 |
_SCOORD_(x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1356 |
_SCOORD_(y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1357 |
_SCOORD_(radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1358 |
_ANGLE_(startang, a_startang) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1359 |
_ANGLE_(endang, a_endang) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1360 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1361 |
arcs(c_x, c_y, c_radius, a_startang, a_endang); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1362 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1363 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1364 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1365 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1366 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1367 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1368 |
glxCircX:x y:y radius: radius in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1369 |
"draw a circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1370 |
x/y/radius may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1371 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1372 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1373 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1374 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1375 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1376 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1377 |
Coord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1378 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1379 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1380 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1381 |
_COORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1382 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1383 |
circ(c_x, c_y, c_radius); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1384 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1385 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1386 |
#endif |
294 | 1387 |
%} |
1388 |
! |
|
1389 |
||
1390 |
glxCircfX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1391 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1392 |
x/y/radius may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1393 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1394 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1395 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1396 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1397 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1398 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1399 |
Coord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1400 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1401 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1402 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1403 |
_COORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1404 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1405 |
circf(c_x, c_y, c_radius); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1406 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1407 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1408 |
#endif |
294 | 1409 |
%} |
1410 |
! |
|
1411 |
||
1412 |
glxCircfiX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1413 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1414 |
x/y/radius must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1415 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1416 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1417 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1418 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1419 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1420 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1421 |
Icoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1422 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1423 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1424 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1425 |
_ICOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1426 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1427 |
circfi(c_x, c_y, c_radius); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1428 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1429 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1430 |
#endif |
294 | 1431 |
%} |
1432 |
! |
|
1433 |
||
1434 |
glxCircfsX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1435 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1436 |
x/y/radius must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1437 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1438 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1439 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1440 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1441 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1442 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1443 |
Scoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1444 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1445 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1446 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1447 |
_SCOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1448 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1449 |
circfs(c_x, c_y, c_radius); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1450 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1451 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1452 |
#endif |
294 | 1453 |
%} |
1454 |
! |
|
1455 |
||
1456 |
glxCirciX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1457 |
"draw a circle (unfilled). |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1458 |
x/y/radius must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1459 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1460 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1461 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1462 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1463 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1464 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1465 |
Icoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1466 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1467 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1468 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1469 |
_ICOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1470 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1471 |
circi(c_x, c_y, c_radius); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1472 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1473 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1474 |
#endif |
294 | 1475 |
%} |
1476 |
! |
|
1477 |
||
1478 |
glxCircsX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1479 |
"draw a circle (unfilled) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1480 |
x/y/radius must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1481 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1482 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1483 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1484 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1485 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1486 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1487 |
Scoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1488 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1489 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1490 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1491 |
_SCOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1492 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1493 |
circs(c_x, c_y, c_radius); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1494 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1495 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1496 |
#endif |
294 | 1497 |
%} |
1498 |
! ! |
|
1499 |
||
528 | 1500 |
!GLXWorkstation methodsFor:'attribute stack'! |
1501 |
||
1502 |
glxPopattributesIn: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1503 |
"pop (and forget) the top entry on the attribute stack" |
528 | 1504 |
|
1505 |
%{ /* NOCONTEXT */ |
|
1506 |
SETWIN(aGLXWindowId) |
|
1507 |
popattributes(); |
|
1508 |
%} |
|
1509 |
||
1510 |
"Modified: 19.3.1996 / 18:42:53 / cg" |
|
1511 |
! |
|
1512 |
||
1513 |
glxPushattributesIn: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1514 |
"save the current attributes on the attribute stack" |
528 | 1515 |
|
1516 |
%{ /* NOCONTEXT */ |
|
1517 |
SETWIN(aGLXWindowId) |
|
1518 |
pushattributes(); |
|
1519 |
%} |
|
1520 |
||
1521 |
"Modified: 19.3.1996 / 18:43:04 / cg" |
|
1522 |
! ! |
|
1523 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1524 |
!GLXWorkstation methodsFor:'character position'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1525 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1526 |
glxCmov2X: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1527 |
"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
|
1528 |
The arguments may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1529 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1530 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1531 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1532 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1533 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1534 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1535 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1536 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1537 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1538 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1539 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1540 |
cmov2(c_x, c_y); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1541 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1542 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1543 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1544 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1545 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1546 |
"Modified: 22.3.1996 / 18:17:38 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1547 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1548 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1549 |
glxCmov2iX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1550 |
"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
|
1551 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1552 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1553 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1554 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1555 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1556 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1557 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1558 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1559 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1560 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1561 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1562 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1563 |
cmov2i(c_x, c_y); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1564 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1565 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1566 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1567 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1568 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1569 |
"Modified: 22.3.1996 / 18:17:43 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1570 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1571 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1572 |
glxCmov2sX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1573 |
"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
|
1574 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1575 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1576 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1577 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1578 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1579 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1580 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1581 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1582 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1583 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1584 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1585 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1586 |
cmov2s(c_x, c_y); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1587 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1588 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1589 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1590 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1591 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1592 |
"Modified: 22.3.1996 / 18:17:47 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1593 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1594 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1595 |
glxCmovX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1596 |
"change the character position to a 3D point, as passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1597 |
The arguments may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1598 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1599 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1600 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1601 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1602 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1603 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1604 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1605 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1606 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1607 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1608 |
_COORD_ (z, c_z) |
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 |
cmov(c_x, c_y, c_z); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1611 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1612 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1613 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1614 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1615 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1616 |
"Modified: 22.3.1996 / 18:17:22 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1617 |
! |
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 |
glxCmoviX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1620 |
"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
|
1621 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1622 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1623 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1624 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1625 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1626 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1627 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1628 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1629 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1630 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1631 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1632 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1633 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1634 |
cmovi(c_x, c_y, c_z); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1635 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1636 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1637 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1638 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1639 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1640 |
"Modified: 22.3.1996 / 18:17:55 / cg" |
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 |
glxCmovsX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1644 |
"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
|
1645 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1646 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1647 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1648 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1649 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1650 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1651 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1652 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1653 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1654 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1655 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1656 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1657 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1658 |
cmovs(c_x, c_y, c_z); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1659 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1660 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1661 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1662 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1663 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1664 |
"Modified: 22.3.1996 / 18:17:59 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1665 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1666 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1667 |
glxGetcposIn: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1668 |
"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
|
1669 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1670 |
| x y | |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1671 |
%{ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1672 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1673 |
short s_x, s_y; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1674 |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1675 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1676 |
getcpos(&s_x, &s_y); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1677 |
x = __MKSMALLINT(s_x); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1678 |
y = __MKSMALLINT(s_y); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1679 |
#endif |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1680 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1681 |
. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1682 |
^x @ y |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1683 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1684 |
|
294 | 1685 |
!GLXWorkstation methodsFor:'clearing'! |
1686 |
||
1687 |
glxClearIn:aGLXWindowId |
|
1688 |
"clear to current color" |
|
1689 |
||
1690 |
%{ /* NOCONTEXT */ |
|
1691 |
SETWIN(aGLXWindowId) |
|
1692 |
clear(); |
|
1693 |
%} |
|
1694 |
! |
|
1695 |
||
1696 |
glxCzclearCval:cval zval:zval in:aGLXWindowId |
|
1697 |
"clear to a color (cval) and clear z buffer to zval simultaniously" |
|
1698 |
||
1699 |
%{ /* NOCONTEXT */ |
|
1700 |
#ifdef GLX |
|
1701 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1702 |
|
294 | 1703 |
czclear((ulong)__intVal(cval), __intVal(zval)); |
1704 |
RETURN (true); |
|
1705 |
#endif |
|
1706 |
%} |
|
1707 |
. |
|
1708 |
^ false |
|
1709 |
! |
|
1710 |
||
1711 |
glxZClearIn:aGLXWindowId |
|
1712 |
"clear z buffer" |
|
1713 |
||
1714 |
%{ /* NOCONTEXT */ |
|
1715 |
#ifdef GLX |
|
1716 |
SETWIN(aGLXWindowId) |
|
1717 |
zclear(); |
|
1718 |
RETURN (true); |
|
1719 |
#endif |
|
1720 |
%} |
|
1721 |
. |
|
1722 |
^ false |
|
1723 |
! ! |
|
1724 |
||
1725 |
!GLXWorkstation methodsFor:'color'! |
|
1726 |
||
1727 |
glxColor:index in:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1728 |
"set the drawing color; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1729 |
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
|
1730 |
otherwise, better results are expected with float values." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1731 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1732 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1733 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1734 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1735 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1736 |
#else |
294 | 1737 |
if (__isSmallInteger(index)) { |
1738 |
color((Colorindex)(__intVal(index))); |
|
1739 |
RETURN (true); |
|
1740 |
} |
|
1741 |
if (__isFloat(index)) { |
|
1742 |
colorf((float)(_floatVal(index))); |
|
1743 |
RETURN (true); |
|
1744 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1745 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1746 |
%}. |
294 | 1747 |
^ false |
1748 |
! |
|
1749 |
||
1750 |
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
|
1751 |
"set the drawing color, including alpha value. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1752 |
The args must be integer values within 0..255" |
294 | 1753 |
|
1754 |
%{ /* NOCONTEXT */ |
|
1755 |
||
1756 |
#ifdef GLX |
|
1757 |
short s_r, s_g, s_b, s_a; |
|
1758 |
||
1759 |
_INT_(r, s_r); |
|
1760 |
_INT_(g, s_g); |
|
1761 |
_INT_(b, s_b); |
|
1762 |
_INT_(a, s_a); |
|
1763 |
SETWIN(aGLXWindowId) |
|
1764 |
cpack((((((s_a<<8) | s_b) << 8) | s_g) << 8) | s_r); |
|
1765 |
RETURN (true); |
|
1766 |
#endif |
|
1767 |
%} |
|
1768 |
. |
|
1769 |
^ false |
|
1770 |
! |
|
1771 |
||
1772 |
glxColorRed:r green:g blue:b in:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1773 |
"set the drawing color. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1774 |
The args must be integer values in 0..255" |
294 | 1775 |
|
1776 |
%{ /* NOCONTEXT */ |
|
1777 |
||
1778 |
#ifdef GLX |
|
1779 |
short s_r, s_g, s_b; |
|
1780 |
||
1781 |
_INT_(r, s_r); |
|
1782 |
_INT_(g, s_g); |
|
1783 |
_INT_(b, s_b); |
|
1784 |
SETWIN(aGLXWindowId) |
|
1785 |
RGBcolor(s_r, s_g, s_b); |
|
1786 |
RETURN (true); |
|
1787 |
#endif |
|
1788 |
%} |
|
1789 |
. |
|
1790 |
^ false |
|
1791 |
! |
|
1792 |
||
528 | 1793 |
glxLrgbrangeRmin: rmin gmin: gmin bmin: bmin rmax: rmax gmax: gmax bmax: bmax |
1794 |
znear: znear zfar: zfar in: aGLXWindowId |
|
1795 |
||
1796 |
%{ /* NOCONTEXT */ |
|
1797 |
#ifdef GLX |
|
1798 |
SETWIN(aGLXWindowId) |
|
1799 |
lRGBrange(_shortVal(rmin), _shortVal(gmin), _shortVal(bmin), |
|
1800 |
_shortVal(rmax), _shortVal(gmax), _shortVal(bmax), |
|
1801 |
_longVal(znear), _longVal(zfar)); |
|
1802 |
RETURN (true); |
|
1803 |
#endif |
|
1804 |
%} |
|
1805 |
. |
|
1806 |
^ false |
|
1807 |
! |
|
1808 |
||
1809 |
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
|
1810 |
"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
|
1811 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1812 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1813 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1814 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1815 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1816 |
#else |
528 | 1817 |
mapcolor(_colorindexVal(i), _shortVal(red), _shortVal(green), _shortVal(blue)); |
1818 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1819 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1820 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1821 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1822 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1823 |
glxTextcolor:tcolor in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1824 |
"change the color used for text drawing" |
294 | 1825 |
|
1826 |
%{ /* NOCONTEXT */ |
|
1827 |
#ifdef GLX |
|
1828 |
SETWIN(aGLXWindowId) |
|
1829 |
textcolor(_colorindexVal(tcolor)); |
|
1830 |
RETURN (true); |
|
1831 |
#endif |
|
1832 |
%} |
|
1833 |
. |
|
1834 |
^ false |
|
1835 |
! ! |
|
1836 |
||
528 | 1837 |
!GLXWorkstation methodsFor:'curves'! |
1838 |
||
1839 |
glxCurvebasis: basid in: aGLXWindowId |
|
1840 |
"sets the basis type of curves" |
|
1841 |
||
1842 |
%{ /* NOCONTEXT */ |
|
1843 |
SETWIN(aGLXWindowId) |
|
1844 |
curvebasis(_shortVal(basid)); |
|
1845 |
RETURN (true); |
|
1846 |
%} |
|
1847 |
||
1848 |
"Modified: 19.3.1996 / 18:47:09 / cg" |
|
1849 |
! |
|
1850 |
||
1851 |
glxCurveit: iterationcount in: aGLXWindowId |
|
1852 |
"Iterates the top matrix on the stack as a forward difference |
|
1853 |
matrix, drawing as it goes along." |
|
1854 |
||
1855 |
%{ /* NOCONTEXT */ |
|
1856 |
SETWIN(aGLXWindowId) |
|
1857 |
curveit(_shortVal(iterationcount)); |
|
1858 |
RETURN (true); |
|
1859 |
%} |
|
1860 |
||
1861 |
"Modified: 19.3.1996 / 18:48:57 / cg" |
|
1862 |
! |
|
1863 |
||
1864 |
glxCurveprecision: nsegments in: aGLXWindowId |
|
1865 |
"sets the number of line segments that make up a curve segment" |
|
1866 |
||
1867 |
%{ /* NOCONTEXT */ |
|
1868 |
SETWIN(aGLXWindowId) |
|
1869 |
curveprecision(_shortVal(nsegments)); |
|
1870 |
RETURN (true); |
|
1871 |
%} |
|
1872 |
||
1873 |
"Modified: 19.3.1996 / 18:47:43 / cg" |
|
1874 |
! ! |
|
1875 |
||
294 | 1876 |
!GLXWorkstation methodsFor:'double buffering'! |
1877 |
||
1878 |
glxBackBufferIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1879 |
"switch to back buffer drawing - turning frontbuffer drawing off" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1880 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1881 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1882 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1883 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1884 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1885 |
# ifdef GLX |
294 | 1886 |
frontbuffer(FALSE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1887 |
# endif |
294 | 1888 |
backbuffer(TRUE); |
1889 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1890 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1891 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1892 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1893 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1894 |
glxBackbuffer:b in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1895 |
"turn backBuffer drawing on/off. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1896 |
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
|
1897 |
... enabling the backbuffer automatically disables frontbuffer drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1898 |
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
|
1899 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1900 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1901 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1902 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1903 |
#else |
294 | 1904 |
backbuffer(_booleanVal(b)); |
1905 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1906 |
#endif |
294 | 1907 |
%} |
528 | 1908 |
|
1909 |
"Modified: 19.3.1996 / 18:45:05 / cg" |
|
294 | 1910 |
! |
1911 |
||
1912 |
glxDoubleBufferIn:aGLXWindowId |
|
1913 |
"set double buffer mode" |
|
1914 |
||
1915 |
%{ /* NOCONTEXT */ |
|
1916 |
SETWIN(aGLXWindowId) |
|
1917 |
doublebuffer(); |
|
1918 |
RETURN (true); |
|
1919 |
%} |
|
1920 |
! |
|
1921 |
||
1922 |
glxFrontBufferIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1923 |
"switch to front buffer drawing - turning backbuffer drawing off" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1924 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1925 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1926 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1927 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1928 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1929 |
# ifdef GLX |
294 | 1930 |
backbuffer(FALSE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1931 |
# endif |
294 | 1932 |
frontbuffer(TRUE); |
1933 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1934 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1935 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1936 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1937 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1938 |
glxFrontbuffer:b in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1939 |
"turn on/off frontbuffer drawing. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1940 |
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
|
1941 |
... enabling the backbuffer automatically disables frontbuffer drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1942 |
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
|
1943 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1944 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1945 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1946 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1947 |
#else |
294 | 1948 |
frontbuffer(_booleanVal(b)); |
1949 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1950 |
#endif |
294 | 1951 |
%} |
528 | 1952 |
|
1953 |
"Modified: 19.3.1996 / 18:45:31 / cg" |
|
294 | 1954 |
! |
1955 |
||
1956 |
glxSingleBufferIn: aGLXWindowId |
|
1957 |
"set single buffer mode" |
|
1958 |
||
1959 |
%{ /* NOCONTEXT */ |
|
1960 |
SETWIN(aGLXWindowId) |
|
553
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 |
singlebuffer(); |
1964 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1965 |
#endif |
294 | 1966 |
%} |
1967 |
! |
|
1968 |
||
1969 |
glxSwapBuffersIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1970 |
"swap the back and front buffers. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1971 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1972 |
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
|
1973 |
displayed and swap them for every frame." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1974 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1975 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1976 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1977 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1978 |
#else |
294 | 1979 |
swapbuffers(); |
1980 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1981 |
#endif |
294 | 1982 |
%} |
528 | 1983 |
|
1984 |
"Modified: 19.3.1996 / 18:45:47 / cg" |
|
294 | 1985 |
! ! |
1986 |
||
1987 |
!GLXWorkstation methodsFor:'flat drawing'! |
|
1988 |
||
1989 |
glxBeginClosedLineIn:aGLXWindowId |
|
1990 |
"start a closed line" |
|
1991 |
||
1992 |
%{ /* NOCONTEXT */ |
|
1993 |
SETWIN(aGLXWindowId) |
|
1994 |
bgnclosedline(); |
|
1995 |
RETURN (true); |
|
1996 |
%} |
|
1997 |
! |
|
1998 |
||
1999 |
glxBeginLineIn:aGLXWindowId |
|
2000 |
"start a line group" |
|
2001 |
||
2002 |
%{ /* NOCONTEXT */ |
|
2003 |
SETWIN(aGLXWindowId) |
|
2004 |
bgnline(); |
|
2005 |
%} |
|
2006 |
! |
|
2007 |
||
2008 |
glxBeginPointIn:aGLXWindowId |
|
2009 |
"start a point-group" |
|
2010 |
||
2011 |
%{ /* NOCONTEXT */ |
|
2012 |
SETWIN(aGLXWindowId) |
|
2013 |
bgnpoint(); |
|
2014 |
RETURN (true); |
|
2015 |
%} |
|
2016 |
! |
|
2017 |
||
2018 |
glxBeginPolygonIn:aGLXWindowId |
|
2019 |
"start a polygon" |
|
2020 |
||
2021 |
%{ /* NOCONTEXT */ |
|
2022 |
SETWIN(aGLXWindowId) |
|
2023 |
bgnpolygon(); |
|
2024 |
RETURN (true); |
|
2025 |
%} |
|
2026 |
! |
|
2027 |
||
2028 |
glxBeginQuadrilateralStripIn:aGLXWindowId |
|
2029 |
"start a quadrilateral strip" |
|
2030 |
||
2031 |
%{ /* NOCONTEXT */ |
|
2032 |
SETWIN(aGLXWindowId) |
|
2033 |
bgnqstrip(); |
|
2034 |
RETURN (true); |
|
2035 |
%} |
|
2036 |
! |
|
2037 |
||
2038 |
glxBeginTriangleMeshIn:aGLXWindowId |
|
2039 |
"start a triangle mesh" |
|
2040 |
||
2041 |
%{ /* NOCONTEXT */ |
|
2042 |
SETWIN(aGLXWindowId) |
|
2043 |
bgntmesh(); |
|
2044 |
RETURN (true); |
|
2045 |
%} |
|
2046 |
! |
|
2047 |
||
2048 |
glxEndClosedLineIn:aGLXWindowId |
|
2049 |
"end a closed line" |
|
2050 |
||
2051 |
%{ /* NOCONTEXT */ |
|
2052 |
SETWIN(aGLXWindowId) |
|
2053 |
endclosedline(); |
|
2054 |
RETURN (true); |
|
2055 |
%} |
|
2056 |
! |
|
2057 |
||
2058 |
glxEndLineIn:aGLXWindowId |
|
2059 |
"end a line group" |
|
2060 |
||
2061 |
%{ /* NOCONTEXT */ |
|
2062 |
SETWIN(aGLXWindowId) |
|
2063 |
endline(); |
|
2064 |
RETURN (true); |
|
2065 |
%} |
|
2066 |
! |
|
2067 |
||
2068 |
glxEndPointIn:aGLXWindowId |
|
2069 |
"end a point group" |
|
2070 |
||
2071 |
%{ /* NOCONTEXT */ |
|
2072 |
SETWIN(aGLXWindowId) |
|
2073 |
endpoint(); |
|
2074 |
RETURN (true); |
|
2075 |
%} |
|
2076 |
! |
|
2077 |
||
2078 |
glxEndPolygonIn:aGLXWindowId |
|
2079 |
"end a polygon" |
|
2080 |
||
2081 |
%{ /* NOCONTEXT */ |
|
2082 |
SETWIN(aGLXWindowId) |
|
2083 |
endpolygon(); |
|
2084 |
RETURN (true); |
|
2085 |
%} |
|
2086 |
! |
|
2087 |
||
2088 |
glxEndQuadrilateralStripIn:aGLXWindowId |
|
2089 |
"end a quadrilateral strip" |
|
2090 |
||
2091 |
%{ /* NOCONTEXT */ |
|
2092 |
SETWIN(aGLXWindowId) |
|
2093 |
endqstrip(); |
|
2094 |
RETURN (true); |
|
2095 |
%} |
|
2096 |
! |
|
2097 |
||
2098 |
glxEndTriangleMeshIn:aGLXWindowId |
|
2099 |
"end a triangle mesh" |
|
2100 |
||
2101 |
%{ /* NOCONTEXT */ |
|
2102 |
SETWIN(aGLXWindowId) |
|
2103 |
endtmesh(); |
|
2104 |
RETURN (true); |
|
168 | 2105 |
%} |
2106 |
! ! |
|
2107 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2108 |
!GLXWorkstation methodsFor:'graphics position'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2109 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2110 |
glxMove2:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2111 |
"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
|
2112 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2113 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2114 |
float vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2115 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2116 |
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
|
2117 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2118 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2119 |
#else |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2120 |
move2((Coord)(c_v[0]), (Coord)(c_v[1])); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2121 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2122 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2123 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2124 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2125 |
"Modified: 22.3.1996 / 18:15:23 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2126 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2127 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2128 |
glxMove2X: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2129 |
"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
|
2130 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2131 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2132 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2133 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2134 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2135 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2136 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2137 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2138 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2139 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2140 |
move2(c_x, c_y); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2141 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2142 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2143 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2144 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2145 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2146 |
"Modified: 22.3.1996 / 18:15:02 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2147 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2148 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2149 |
glxMove2iX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2150 |
"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
|
2151 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2152 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2153 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2154 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2155 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2156 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2157 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2158 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2159 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2160 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2161 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2162 |
move2i(c_x, c_y); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2163 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2164 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2165 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2166 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2167 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2168 |
"Modified: 22.3.1996 / 18:15:08 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2169 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2170 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2171 |
glxMove2sX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2172 |
"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
|
2173 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2174 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2175 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2176 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2177 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2178 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2179 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2180 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2181 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2182 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2183 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2184 |
move2s(c_x, c_y); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2185 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2186 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2187 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2188 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2189 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2190 |
"Modified: 22.3.1996 / 18:15:13 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2191 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2192 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2193 |
glxMove:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2194 |
"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
|
2195 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2196 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2197 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2198 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2199 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2200 |
float vec[3], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2201 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2202 |
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
|
2203 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2204 |
move((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2205 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2206 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2207 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2208 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2209 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2210 |
"Modified: 22.3.1996 / 18:14:29 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2211 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2212 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2213 |
glxMoveX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2214 |
"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
|
2215 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2216 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2217 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2218 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2219 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2220 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2221 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2222 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2223 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2224 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2225 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2226 |
move(c_x, c_y, c_z); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2227 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2228 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2229 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2230 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2231 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2232 |
"Modified: 22.3.1996 / 18:14:38 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2233 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2234 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2235 |
glxMoveiX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2236 |
"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
|
2237 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2238 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2239 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2240 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2241 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2242 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2243 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2244 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2245 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2246 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2247 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2248 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2249 |
movei(c_x, c_y, c_z); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2250 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2251 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2252 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2253 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2254 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2255 |
"Modified: 22.3.1996 / 18:14:44 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2256 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2257 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2258 |
glxMovesX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2259 |
"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
|
2260 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2261 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2262 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2263 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2264 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2265 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2266 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2267 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2268 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2269 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2270 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2271 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2272 |
moves(c_x, c_y, c_z); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2273 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2274 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2275 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2276 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2277 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2278 |
"Modified: 22.3.1996 / 18:14:48 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2279 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2280 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2281 |
glxRmv2:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2282 |
"change the graphics position to a 2D point, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2283 |
the relative distance is passed in vector v" |
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 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2286 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2287 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2288 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2289 |
float vec[2], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2290 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2291 |
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
|
2292 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2293 |
rmv2((Coord)(c_v[0]), (Coord)(c_v[1])); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2294 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2295 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2296 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2297 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2298 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2299 |
"Modified: 22.3.1996 / 18:15:57 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2300 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2301 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2302 |
glxRmv2X: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2303 |
"change the graphics position to a 2D point, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2304 |
the relative distance is passed in x/y" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2305 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2306 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2307 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2308 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2309 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2310 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2311 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2312 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2313 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2314 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2315 |
rmv2(c_x, c_y); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2316 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2317 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2318 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2319 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2320 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2321 |
"Modified: 22.3.1996 / 18:16:42 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2322 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2323 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2324 |
glxRmv2iX: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2325 |
"change the graphics position to a 2D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2326 |
the relative distance is passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2327 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2328 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2329 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2330 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2331 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2332 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2333 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2334 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2335 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2336 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2337 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2338 |
rmv2i(c_x, c_y); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2339 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2340 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2341 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2342 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2343 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2344 |
"Modified: 22.3.1996 / 18:16:39 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2345 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2346 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2347 |
glxRmv2sX: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2348 |
"change the graphics position to a 2D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2349 |
the relative distance is passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2350 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2351 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2352 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2353 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2354 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2355 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2356 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2357 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2358 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2359 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2360 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2361 |
rmv2s(c_x, c_y); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2362 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2363 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2364 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2365 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2366 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2367 |
"Modified: 22.3.1996 / 18:16:33 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2368 |
! |
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 |
glxRmv:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2371 |
"change the graphics position to a 3D point, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2372 |
the relative distance is passed in vector v" |
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 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2375 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2376 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2377 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2378 |
float vec[3], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2379 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2380 |
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
|
2381 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2382 |
rmv((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2383 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2384 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2385 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2386 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2387 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2388 |
"Modified: 22.3.1996 / 18:16:08 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2389 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2390 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2391 |
glxRmvX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2392 |
"change the graphics position to a 3D point, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2393 |
the relative distance is passed in x/y/z" |
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 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2396 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2397 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2398 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2399 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2400 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2401 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2402 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2403 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2404 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2405 |
rmv(c_x, c_y, c_z); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2406 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2407 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2408 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2409 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2410 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2411 |
"Modified: 22.3.1996 / 18:16:16 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2414 |
glxRmviX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2415 |
"change the graphics position to a 3D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2416 |
the relative distance is passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2417 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2418 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2419 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2420 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2421 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2422 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2423 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2424 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2425 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2426 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2427 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2428 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2429 |
rmvi(c_x, c_y, c_z); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2430 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2431 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2432 |
#endif |
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:21 / 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 |
glxRmvsX: 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 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2445 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2446 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2447 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2448 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2449 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2450 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2451 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2452 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2453 |
rmvs(c_x, c_y, c_z); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2454 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2455 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2456 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2457 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2458 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2459 |
"Modified: 22.3.1996 / 18:16:25 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2460 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2461 |
|
168 | 2462 |
!GLXWorkstation methodsFor:'initialization'! |
2463 |
||
2464 |
initializeFor:aDisplayName |
|
169 | 2465 |
(super initializeFor:aDisplayName) isNil ifTrue:[^ nil]. |
168 | 2466 |
%{ |
2467 |
if (_INST(displayId) != nil) { |
|
185 | 2468 |
XSetErrorHandler(__XErrorHandler__); |
2469 |
} |
|
2470 |
%} |
|
2471 |
! |
|
2472 |
||
2473 |
initializeScreenProperties |
|
2474 |
super initializeScreenProperties. |
|
2475 |
||
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2476 |
"/ 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
|
2477 |
"/ 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
|
2478 |
"/ 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
|
2479 |
"/ 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
|
2480 |
"/ 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
|
2481 |
"/ 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
|
2482 |
"/ 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
|
2483 |
"/ have no documentation). |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2484 |
"/ 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
|
2485 |
"/ 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
|
2486 |
"/ 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
|
2487 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2488 |
(self isTrueGL and:[ForceGL ~~ true]) ifTrue:[ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2489 |
glOK := (displayName = ':0') or:[displayName = ':0.0']. |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2490 |
] ifFalse:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2491 |
glOK := true. |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2492 |
]. |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2493 |
|
185 | 2494 |
%{ |
2495 |
Display *dpy = myDpy; |
|
2496 |
int dummy; |
|
2497 |
||
2498 |
if (ISCONNECTED) { |
|
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2499 |
_INST(hasStereoExtension) = false; |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2500 |
|
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2501 |
#if defined(XSGIStereo) && !defined(VGL) |
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2502 |
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
|
2503 |
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
|
2504 |
_INST(hasStereoExtension) = true; |
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2505 |
} |
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2506 |
#endif |
168 | 2507 |
} |
2508 |
%} |
|
2509 |
! ! |
|
2510 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2511 |
!GLXWorkstation methodsFor:'lines'! |
528 | 2512 |
|
2513 |
glxDeflinestyleN: n ls: ls in: aGLXWindowId |
|
2514 |
"define a line style" |
|
2515 |
||
2516 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2517 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2518 |
#else |
528 | 2519 |
SETWIN(aGLXWindowId) |
2520 |
deflinestyle(_shortVal(n), _linestyleVal(ls)); |
|
2521 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2522 |
#endif |
528 | 2523 |
%} |
2524 |
! |
|
2525 |
||
2526 |
glxDraw2:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2527 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2528 |
to a new 2D position, passed in vector v." |
528 | 2529 |
|
2530 |
%{ /* NOCONTEXT */ |
|
2531 |
float vec[2], *c_v; |
|
2532 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2533 |
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
|
2534 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2535 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2536 |
#else |
528 | 2537 |
draw2((Coord)(c_v[0]), (Coord)(c_v[1])); |
2538 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2539 |
#endif |
528 | 2540 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2541 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2542 |
"Modified: 22.3.1996 / 18:03:29 / cg" |
528 | 2543 |
! |
2544 |
||
2545 |
glxDraw2X: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2546 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2547 |
to a new 2D position, passed in x/y." |
528 | 2548 |
|
2549 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2550 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2551 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2552 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2553 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2554 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2555 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2556 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2557 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2558 |
draw2(c_x, c_y); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2559 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2560 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2561 |
#endif |
528 | 2562 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2563 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2564 |
"Modified: 22.3.1996 / 18:03:50 / cg" |
528 | 2565 |
! |
2566 |
||
2567 |
glxDraw2iX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2568 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2569 |
to a new 2D position, passed in x/y." |
528 | 2570 |
|
2571 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2572 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2573 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2574 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2575 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2576 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2577 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2578 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2579 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2580 |
draw2i(c_x, c_y); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2581 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2582 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2583 |
#endif |
528 | 2584 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2585 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2586 |
"Modified: 22.3.1996 / 18:04:07 / cg" |
528 | 2587 |
! |
2588 |
||
2589 |
glxDraw2sX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2590 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2591 |
to a new 2D position, passed in x/y." |
528 | 2592 |
|
2593 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2594 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2595 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2596 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2597 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2598 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2599 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2600 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2601 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2602 |
draw2s(c_x, c_y); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2603 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2604 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2605 |
#endif |
528 | 2606 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2607 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2608 |
"Modified: 22.3.1996 / 18:04:19 / cg" |
528 | 2609 |
! |
2610 |
||
2611 |
glxDraw:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2612 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2613 |
to a new 3D position, passed in vector v." |
528 | 2614 |
|
2615 |
%{ /* NOCONTEXT */ |
|
2616 |
float vec[3], *c_v; |
|
2617 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2618 |
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
|
2619 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2620 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2621 |
#else |
528 | 2622 |
draw((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
2623 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2624 |
#endif |
528 | 2625 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2626 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2627 |
"Modified: 22.3.1996 / 18:04:34 / cg" |
528 | 2628 |
! |
2629 |
||
2630 |
glxDrawX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2631 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2632 |
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
|
2633 |
The arguments may be floats, fractions or smallIntegers" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2634 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2635 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2636 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2637 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2638 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2639 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2640 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2641 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2642 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2643 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2644 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2645 |
draw(c_x, c_y, c_z); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2646 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2647 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2648 |
#endif |
528 | 2649 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2650 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2651 |
"Modified: 22.3.1996 / 18:04:46 / cg" |
528 | 2652 |
! |
2653 |
||
2654 |
glxDrawiX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2655 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2656 |
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
|
2657 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2658 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2659 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2660 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2661 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2662 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2663 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2664 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2665 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2666 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2667 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2668 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2669 |
drawi(c_x, c_y, c_z); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2670 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2671 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2672 |
#endif |
528 | 2673 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2674 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2675 |
"Modified: 22.3.1996 / 18:04:54 / cg" |
528 | 2676 |
! |
2677 |
||
2678 |
glxDrawsX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2679 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2680 |
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
|
2681 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2682 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2683 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2684 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2685 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2686 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2687 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2688 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2689 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2690 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2691 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2692 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2693 |
draws(c_x, c_y, c_z); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2694 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2695 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2696 |
#endif |
528 | 2697 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2698 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2699 |
"Modified: 22.3.1996 / 18:05:01 / cg" |
528 | 2700 |
! |
2701 |
||
2702 |
glxLinewidth: n in: aGLXWindowId |
|
2703 |
"set the linewidth" |
|
2704 |
||
2705 |
%{ /* NOCONTEXT */ |
|
2706 |
SETWIN(aGLXWindowId) |
|
2707 |
linewidth(_shortVal(n)); |
|
2708 |
RETURN (true); |
|
2709 |
%} |
|
2710 |
! |
|
2711 |
||
2712 |
glxLinewidthf: n in: aGLXWindowId |
|
2713 |
"set the linewidth" |
|
2714 |
||
2715 |
%{ /* NOCONTEXT */ |
|
2716 |
SETWIN(aGLXWindowId) |
|
2717 |
linewidthf(_floatVal(n)); |
|
2718 |
RETURN (true); |
|
2719 |
%} |
|
2720 |
! |
|
2721 |
||
2722 |
glxRdr2:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2723 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2724 |
to a new 2D position, passing the relative distance in the vector v." |
528 | 2725 |
|
2726 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2727 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2728 |
#else |
528 | 2729 |
float vec[2], *c_v; |
2730 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2731 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
528 | 2732 |
SETWIN(aGLXWindowId) |
2733 |
rdr2((Coord)(c_v[0]), (Coord)(c_v[1])); |
|
2734 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2735 |
#endif |
528 | 2736 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2737 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2738 |
"Modified: 22.3.1996 / 18:05:54 / cg" |
528 | 2739 |
! |
2740 |
||
2741 |
glxRdr2X: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2742 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2743 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2744 |
|
2745 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2746 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2747 |
#else |
528 | 2748 |
Coord c_x, c_y; |
2749 |
||
2750 |
_COORD_ (x, c_x) |
|
2751 |
_COORD_ (y, c_y) |
|
2752 |
SETWIN(aGLXWindowId) |
|
2753 |
rdr2(c_x, c_y); |
|
2754 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2755 |
#endif |
528 | 2756 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2757 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2758 |
"Modified: 22.3.1996 / 18:06:20 / cg" |
528 | 2759 |
! |
2760 |
||
2761 |
glxRdr2iX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2762 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2763 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2764 |
|
2765 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2766 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2767 |
#else |
528 | 2768 |
Icoord c_x, c_y; |
2769 |
||
2770 |
_ICOORD_ (x, c_x) |
|
2771 |
_ICOORD_ (y, c_y) |
|
2772 |
SETWIN(aGLXWindowId) |
|
2773 |
rdr2i(c_x, c_y); |
|
2774 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2775 |
#endif |
528 | 2776 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2777 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2778 |
"Modified: 22.3.1996 / 18:06:28 / cg" |
528 | 2779 |
! |
2780 |
||
2781 |
glxRdr2sX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2782 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2783 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2784 |
|
2785 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2786 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2787 |
#else |
528 | 2788 |
Scoord c_x, c_y; |
2789 |
||
2790 |
_SCOORD_ (x, c_x) |
|
2791 |
_SCOORD_ (y, c_y) |
|
2792 |
SETWIN(aGLXWindowId) |
|
2793 |
rdr2s(c_x, c_y); |
|
2794 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2795 |
#endif |
528 | 2796 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2797 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2798 |
"Modified: 22.3.1996 / 18:06:34 / cg" |
528 | 2799 |
! |
2800 |
||
2801 |
glxRdr:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2802 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2803 |
to a new 3D position, passing the relative distance in the vector v." |
528 | 2804 |
|
2805 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2806 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2807 |
#else |
528 | 2808 |
float vec[3], *c_v; |
2809 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2810 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
528 | 2811 |
SETWIN(aGLXWindowId) |
2812 |
rdr((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
|
2813 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2814 |
#endif |
528 | 2815 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2816 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2817 |
"Modified: 22.3.1996 / 18:06:07 / cg" |
528 | 2818 |
! |
2819 |
||
2820 |
glxRdrX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2821 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2822 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2823 |
|
2824 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2825 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2826 |
#else |
528 | 2827 |
Coord c_x, c_y, c_z; |
2828 |
||
2829 |
_COORD_ (x, c_x) |
|
2830 |
_COORD_ (y, c_y) |
|
2831 |
_COORD_ (z, c_z) |
|
2832 |
SETWIN(aGLXWindowId) |
|
2833 |
rdr(c_x, c_y, c_z); |
|
2834 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2835 |
#endif |
528 | 2836 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2837 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2838 |
"Modified: 22.3.1996 / 18:06:44 / cg" |
528 | 2839 |
! |
2840 |
||
2841 |
glxRdriX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2842 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2843 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2844 |
|
2845 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2846 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2847 |
#else |
528 | 2848 |
Icoord c_x, c_y, c_z; |
2849 |
||
2850 |
_ICOORD_ (x, c_x) |
|
2851 |
_ICOORD_ (y, c_y) |
|
2852 |
_ICOORD_ (z, c_z) |
|
2853 |
SETWIN(aGLXWindowId) |
|
2854 |
rdri(c_x, c_y, c_z); |
|
2855 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2856 |
#endif |
528 | 2857 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2858 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2859 |
"Modified: 22.3.1996 / 18:06:51 / cg" |
528 | 2860 |
! |
2861 |
||
2862 |
glxRdrsX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2863 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2864 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2865 |
|
2866 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2867 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2868 |
#else |
528 | 2869 |
Scoord c_x, c_y, c_z; |
2870 |
||
2871 |
_SCOORD_ (x, c_x) |
|
2872 |
_SCOORD_ (y, c_y) |
|
2873 |
_SCOORD_ (z, c_z) |
|
2874 |
SETWIN(aGLXWindowId) |
|
2875 |
rdrs(c_x, c_y, c_z); |
|
2876 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2877 |
#endif |
528 | 2878 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2879 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2880 |
"Modified: 22.3.1996 / 18:06:55 / cg" |
528 | 2881 |
! |
2882 |
||
2883 |
glxSetlinestyle: index in: aGLXWindowId |
|
2884 |
"set the linestyle" |
|
2885 |
||
2886 |
%{ /* NOCONTEXT */ |
|
2887 |
SETWIN(aGLXWindowId) |
|
2888 |
setlinestyle(_shortVal(index)); |
|
2889 |
RETURN (true); |
|
2890 |
%} |
|
2891 |
. |
|
2892 |
^ false |
|
2893 |
! ! |
|
2894 |
||
294 | 2895 |
!GLXWorkstation methodsFor:'materials & lights'! |
2896 |
||
2897 |
glxLmbind:target index:index in:aGLXWindowId |
|
2898 |
"select a material, light or lighting model. |
|
2899 |
target must be a symbol from: #material, #backMaterial, |
|
2900 |
#light0-light7 or #lightModel." |
|
2901 |
||
2902 |
%{ /* NOCONTEXT */ |
|
2903 |
#ifdef GLX |
|
2904 |
short defType; |
|
2905 |
short i_index; |
|
2906 |
||
2907 |
if (target == @symbol(material)) |
|
2908 |
defType = MATERIAL; |
|
2909 |
else if (target == @symbol(backMaterial)) |
|
2910 |
defType = BACKMATERIAL; |
|
2911 |
else if (target == @symbol(light0)) |
|
2912 |
defType = LIGHT0; |
|
2913 |
else if (target == @symbol(light1)) |
|
2914 |
defType = LIGHT1; |
|
2915 |
else if (target == @symbol(light2)) |
|
2916 |
defType = LIGHT2; |
|
2917 |
else if (target == @symbol(light3)) |
|
2918 |
defType = LIGHT3; |
|
2919 |
else if (target == @symbol(light4)) |
|
2920 |
defType = LIGHT4; |
|
2921 |
else if (target == @symbol(light5)) |
|
2922 |
defType = LIGHT5; |
|
2923 |
else if (target == @symbol(light6)) |
|
2924 |
defType = LIGHT6; |
|
2925 |
else if (target == @symbol(light7)) |
|
2926 |
defType = LIGHT7; |
|
2927 |
else if (target == @symbol(lightModel)) |
|
2928 |
defType = LMODEL; |
|
2929 |
else { |
|
2930 |
RETURN (false); |
|
2931 |
} |
|
2932 |
||
2933 |
_INT_ (index, i_index); |
|
2934 |
SETWIN(aGLXWindowId) |
|
2935 |
lmbind(defType, i_index); |
|
2936 |
RETURN (true); |
|
2937 |
#endif |
|
2938 |
%} |
|
2939 |
. |
|
2940 |
^ false |
|
2941 |
! |
|
2942 |
||
2943 |
glxLmdef:what index:index np:np props:props in:aGLXWindowId |
|
2944 |
"define a material, light source or lighting model; |
|
2945 |
what must be one of #material, #light or #lightModel. |
|
2946 |
props must be a FloatArray or a subclass of FloatArray" |
|
2947 |
||
2948 |
%{ /* NOCONTEXT */ |
|
2949 |
#ifdef GLX |
|
2950 |
short defType; |
|
2951 |
short i_index, i_np; |
|
2952 |
float *fp; |
|
2953 |
OBJ cls; |
|
2954 |
int ninstVars, nInstBytes; |
|
2955 |
||
2956 |
if (what == @symbol(material)) |
|
2957 |
defType = DEFMATERIAL; |
|
2958 |
else if (what == @symbol(light)) |
|
2959 |
defType = DEFLIGHT; |
|
2960 |
else if (what == @symbol(lightModel)) |
|
2961 |
defType = DEFLMODEL; |
|
2962 |
else { |
|
2963 |
RETURN (false); |
|
2964 |
} |
|
2965 |
||
2966 |
_INT_ (index, i_index); |
|
2967 |
_INT_ (np, i_np); |
|
2968 |
||
2969 |
if (! _isNonNilObject(props)) fp = NULL; |
|
2970 |
else { |
|
2971 |
cls = __qClass(props); |
|
350 | 2972 |
if (cls == @global(FloatArray)) |
294 | 2973 |
fp = _FloatArrayInstPtr(props)->f_element; |
2974 |
else { |
|
2975 |
if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) { |
|
2976 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
2977 |
fp = (float *) &(_InstPtr(props)->i_instvars[ninstVars]); |
|
2978 |
} else { |
|
2979 |
RETURN (false); |
|
2980 |
} |
|
2981 |
} |
|
2982 |
} |
|
2983 |
SETWIN(aGLXWindowId) |
|
2984 |
lmdef(defType, i_index, i_np, fp); |
|
2985 |
RETURN (true); |
|
2986 |
#endif |
|
2987 |
%} |
|
2988 |
. |
|
2989 |
^ false |
|
2990 |
! |
|
2991 |
||
2992 |
glxTevbind:target index:index in:aGLXWindowId |
|
2993 |
"bind a texture environment; target must be 0 |
|
2994 |
or the symbol #env0." |
|
2995 |
||
2996 |
%{ /* NOCONTEXT */ |
|
2997 |
#ifdef GLX |
|
2998 |
long t; |
|
2999 |
||
3000 |
if (__isSmallInteger(target)) { |
|
3001 |
t = __intVal(target); |
|
3002 |
} else { |
|
3003 |
if (target == @symbol(env0)) { |
|
3004 |
t = TV_ENV0; |
|
3005 |
} else { |
|
3006 |
RETURN (false); |
|
3007 |
} |
|
3008 |
} |
|
3009 |
SETWIN(aGLXWindowId) |
|
3010 |
tevbind(t, __intVal(index)); |
|
3011 |
RETURN (true); |
|
3012 |
#endif |
|
3013 |
%} |
|
3014 |
. |
|
3015 |
^ false |
|
3016 |
! |
|
3017 |
||
3018 |
glxTevdef:index np:np props:props in:aGLXWindowId |
|
3019 |
||
3020 |
%{ /* NOCONTEXT */ |
|
3021 |
#ifdef GLX |
|
3022 |
const float *fp; |
|
3023 |
float fbuff[30]; |
|
3024 |
||
3025 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3026 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
294 | 3027 |
tevdef(__intVal(index), __intVal(np), fp); |
3028 |
RETURN (true); |
|
3029 |
#endif |
|
3030 |
%} |
|
3031 |
. |
|
3032 |
^ false |
|
3033 |
! |
|
3034 |
||
3035 |
glxTexDef2d:index nc:nc width:w height:h bits:image np:np props:props in:aGLXWindowId |
|
3036 |
"define a 2D texture. index is the 'name' of the texture; |
|
3037 |
nc is the number of components (1-4) per pixel; |
|
3038 |
w/h define the size of the texture; bits is a byteArray containing the |
|
3039 |
long-word aligned pixel data; np is the number of props found in |
|
3040 |
the floatArray props. Props must be delimited by a 0.0 entry." |
|
3041 |
||
3042 |
%{ /* NOCONTEXT */ |
|
3043 |
#ifdef GLX |
|
3044 |
unsigned char *cp; |
|
3045 |
const float *fp; |
|
3046 |
OBJ cls; |
|
3047 |
float fbuff[30]; |
|
3048 |
||
3049 |
if (__isByteArray(image)) { |
|
3050 |
cp = _ByteArrayInstPtr(image)->ba_element; |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3051 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
294 | 3052 |
|
3053 |
SETWIN(aGLXWindowId) |
|
3054 |
texdef2d(__intVal(index), __intVal(nc), __intVal(w), __intVal(h), |
|
3055 |
(const unsigned long *)cp, __intVal(np), fp); |
|
3056 |
RETURN (true); |
|
3057 |
} |
|
3058 |
#endif |
|
3059 |
%} |
|
3060 |
. |
|
3061 |
^ false |
|
3062 |
! |
|
3063 |
||
3064 |
glxTexDef3d:index nc:nc width:w height:h depth:d bits:image np:np props:props in:aGLXWindowId |
|
3065 |
"define a 3D texture. index is the 'name' of the texture; |
|
3066 |
nc is the number of components (1-4) per pixel; |
|
3067 |
w/h/d define the size of the texture; bits is a byteArray containing the |
|
3068 |
long-word aligned pixel data; np is the number of props found in |
|
3069 |
the floatArray props. Props must be delimited by a 0.0 entry." |
|
3070 |
||
3071 |
%{ /* NOCONTEXT */ |
|
3072 |
#ifdef GLX |
|
3073 |
unsigned char *cp; |
|
3074 |
const float *fp; |
|
3075 |
OBJ cls; |
|
3076 |
float fbuff[30]; |
|
3077 |
||
3078 |
if (__isByteArray(image)) { |
|
3079 |
cp = _ByteArrayInstPtr(image)->ba_element; |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3080 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
294 | 3081 |
|
3082 |
SETWIN(aGLXWindowId) |
|
3083 |
texdef3d(__intVal(index), __intVal(nc), __intVal(w), __intVal(h), |
|
3084 |
__intVal(d), |
|
3085 |
(const unsigned long *)cp, __intVal(np), fp); |
|
3086 |
RETURN (true); |
|
3087 |
} |
|
3088 |
#endif |
|
3089 |
%} |
|
3090 |
. |
|
3091 |
^ false |
|
3092 |
! |
|
3093 |
||
3094 |
glxTexbind:target index:index in:aGLXWindowId |
|
3095 |
"bind a texture; target must be an integer or one |
|
3096 |
of the symbols #texture0, #textureDetail or #textureIdle." |
|
3097 |
||
3098 |
%{ /* NOCONTEXT */ |
|
3099 |
#ifdef GLX |
|
3100 |
long t; |
|
3101 |
||
3102 |
if (__isSmallInteger(target)) { |
|
3103 |
t = __intVal(target); |
|
3104 |
} else { |
|
3105 |
if (target == @symbol(texture0)) { |
|
3106 |
t = TX_TEXTURE_0; |
|
3107 |
} else if (target == @symbol(textureDetail)) { |
|
3108 |
t = TX_TEXTURE_DETAIL; |
|
3109 |
} else if (target == @symbol(textureIdle)) { |
|
3110 |
t = TX_TEXTURE_IDLE; |
|
3111 |
} else { |
|
3112 |
RETURN (false); |
|
3113 |
} |
|
3114 |
} |
|
3115 |
SETWIN(aGLXWindowId) |
|
3116 |
texbind(t, __intVal(index)); |
|
3117 |
RETURN (true); |
|
3118 |
#endif |
|
3119 |
%} |
|
3120 |
. |
|
3121 |
^ false |
|
3122 |
! ! |
|
3123 |
||
3124 |
!GLXWorkstation methodsFor:'matrix stack'! |
|
3125 |
||
3126 |
glxGetMatrix:arrayOf16Floats in:aGLXWindowId |
|
3127 |
"argument must be an array (a matrix) of 16 floats. The current matrix |
|
3128 |
will be stored into that." |
|
3129 |
||
3130 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3131 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3132 |
#else |
294 | 3133 |
Matrix matrix; |
3134 |
||
3135 |
SETWIN(aGLXWindowId) |
|
3136 |
getmatrix(matrix); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3137 |
if (! __glx_putFloatsFromInto(matrix, arrayOf16Floats, 16)) RETURN(false); |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3138 |
RETURN (true); |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3139 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3140 |
%}. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3141 |
^ false |
294 | 3142 |
! |
3143 |
||
3144 |
glxLoadMatrix:arrayOf16Floats in:aGLXWindowId |
|
3145 |
"argument must be an array(a matrix) of 16 floats. The current matrix |
|
3146 |
will be loaded from that." |
|
3147 |
||
3148 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3149 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3150 |
#else |
294 | 3151 |
Matrix matrix; |
3152 |
Matrix *m; |
|
3153 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3154 |
if (! (m = __glx_getFloatsFromMatrixInto(arrayOf16Floats, &matrix))) RETURN (false); |
294 | 3155 |
SETWIN(aGLXWindowId) |
3156 |
loadmatrix(*m); |
|
3157 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3158 |
#endif |
294 | 3159 |
%} |
3160 |
! |
|
3161 |
||
3162 |
glxMultMatrix:arrayOf16Floats in:aGLXWindowId |
|
3163 |
"argument must be an array(a matrix) of 16 floats containing a |
|
3164 |
matrix to multiply into the current matrix." |
|
3165 |
||
3166 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3167 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3168 |
#else |
294 | 3169 |
Matrix matrix; |
3170 |
Matrix *m; |
|
3171 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3172 |
if (! (m = __glx_getFloatsFromMatrixInto(arrayOf16Floats, &matrix))) RETURN (false); |
294 | 3173 |
SETWIN(aGLXWindowId) |
3174 |
multmatrix(*m); |
|
3175 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3176 |
#endif |
294 | 3177 |
%} |
3178 |
! |
|
3179 |
||
3180 |
glxPopmatrixIn:aGLXWindowId |
|
3181 |
"pop transformation stack" |
|
3182 |
||
3183 |
%{ /* NOCONTEXT */ |
|
3184 |
SETWIN(aGLXWindowId) |
|
3185 |
popmatrix(); |
|
3186 |
%} |
|
3187 |
! |
|
3188 |
||
3189 |
glxPushmatrixIn:aGLXWindowId |
|
3190 |
"push down transformation stack" |
|
3191 |
||
3192 |
%{ /* NOCONTEXT */ |
|
3193 |
SETWIN(aGLXWindowId) |
|
3194 |
pushmatrix(); |
|
3195 |
%} |
|
3196 |
! ! |
|
3197 |
||
3198 |
!GLXWorkstation methodsFor:'misc'! |
|
3199 |
||
3200 |
glxGconfigIn:aGLXWindowId |
|
3201 |
"must be sent after RGBmode, doubleBuffer etc. to have these |
|
3202 |
changes really take effect. See GLX manual. |
|
3203 |
(Actually, it seems to be not allowed - I dont really know)" |
|
3204 |
||
3205 |
%{ /* NOCONTEXT */ |
|
3206 |
SETWIN(aGLXWindowId) |
|
3207 |
gconfig(); |
|
3208 |
RETURN (true); |
|
3209 |
%} |
|
3210 |
! |
|
3211 |
||
3212 |
glxMmode:aSymbol in:aGLXWindowId |
|
3213 |
"set matrix mode: #single, #viewing, #projection or #texture" |
|
3214 |
||
3215 |
%{ /* NOCONTEXT */ |
|
3216 |
#ifdef GLX |
|
3217 |
if (aSymbol == @symbol(single)) { |
|
3218 |
mmode(MSINGLE); |
|
3219 |
RETURN (true); |
|
3220 |
} |
|
3221 |
if (aSymbol == @symbol(viewing)) { |
|
3222 |
mmode(MVIEWING); |
|
3223 |
RETURN (true); |
|
3224 |
} |
|
3225 |
if (aSymbol == @symbol(projection)) { |
|
3226 |
mmode(MPROJECTION); |
|
3227 |
RETURN (true); |
|
3228 |
} |
|
3229 |
if (aSymbol == @symbol(texture)) { |
|
3230 |
mmode(MTEXTURE); |
|
3231 |
RETURN (true); |
|
3232 |
} |
|
3233 |
#endif |
|
3234 |
%} |
|
3235 |
. |
|
3236 |
^ false |
|
3237 |
! |
|
3238 |
||
3239 |
glxNmode:aSymbol in:aGLXWindowId |
|
3240 |
"set normalize mode: #auto, #normalize" |
|
3241 |
||
3242 |
%{ /* NOCONTEXT */ |
|
3243 |
#ifdef GLX |
|
3244 |
if (aSymbol == @symbol(auto)) { |
|
3245 |
nmode(NAUTO); |
|
3246 |
RETURN (true); |
|
3247 |
} |
|
3248 |
if (aSymbol == @symbol(normalize)) { |
|
3249 |
nmode(NNORMALIZE); |
|
3250 |
RETURN (true); |
|
3251 |
} |
|
3252 |
#endif |
|
3253 |
%} |
|
3254 |
. |
|
3255 |
^ false |
|
3256 |
! |
|
3257 |
||
3258 |
glxRGBmodeIn:aGLXWindowId |
|
3259 |
"set true color mode (no colormap)" |
|
3260 |
||
3261 |
%{ /* NOCONTEXT */ |
|
3262 |
#ifdef GLX |
|
3263 |
SETWIN(aGLXWindowId) |
|
3264 |
RGBmode(); |
|
3265 |
RETURN (true); |
|
3266 |
#endif |
|
3267 |
%} |
|
3268 |
. |
|
3269 |
^ false |
|
3270 |
! ! |
|
3271 |
||
3272 |
!GLXWorkstation methodsFor:'objects'! |
|
3273 |
||
3274 |
glxCallObject:obj in:aGLXWindowId |
|
3275 |
"perform the commands of an object (macro)." |
|
3276 |
||
3277 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3278 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3279 |
#else |
294 | 3280 |
if (__isSmallInteger(obj)) { |
3281 |
SETWIN(aGLXWindowId) |
|
3282 |
callobj(_objectVal(obj)); |
|
3283 |
RETURN (true); |
|
3284 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3285 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3286 |
%}. |
294 | 3287 |
^ false |
3288 |
! |
|
3289 |
||
3290 |
glxCallobj: obj in: aGLXWindowId |
|
3291 |
"OBSOLETE; use glxCallObject:in: |
|
3292 |
This one will be removed soon." |
|
3293 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3294 |
self halt |
294 | 3295 |
! |
3296 |
||
3297 |
glxCloseObjectIn:aGLXWindowId |
|
3298 |
"end object defnition" |
|
3299 |
||
3300 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3301 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3302 |
#else |
294 | 3303 |
SETWIN(aGLXWindowId) |
3304 |
closeobj(); |
|
3305 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3306 |
#endif |
294 | 3307 |
%} |
3308 |
! |
|
3309 |
||
3310 |
glxCloseobjIn:aGLXWindowId |
|
3311 |
"OBSOLETE: use glxCloseObjectIn: |
|
3312 |
This one will be removed." |
|
3313 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3314 |
self halt |
294 | 3315 |
! |
3316 |
||
3317 |
glxDeleteObject:obj in:aGLXWindowId |
|
3318 |
||
3319 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3320 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3321 |
#else |
1882 | 3322 |
if (__isSmallInteger(obj)) { |
3323 |
SETWIN(aGLXWindowId) |
|
3324 |
delobj(_objectVal(obj)); |
|
3325 |
RETURN (true); |
|
3326 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3327 |
#endif |
294 | 3328 |
%} |
3329 |
! |
|
3330 |
||
3331 |
glxDelobj:obj in:aGLXWindowId |
|
3332 |
"OBSOLETE: use glxDeleteObject:in: |
|
3333 |
This one will be removed." |
|
3334 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3335 |
self halt |
294 | 3336 |
! |
3337 |
||
3338 |
glxGenObjectIn:aGLXWindowId |
|
3339 |
"return a new (free & unused) object id for use |
|
3340 |
with makeObj" |
|
3341 |
||
3342 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3343 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3344 |
#else |
294 | 3345 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3346 |
RETURN (__MKSMALLINT(genobj())); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3347 |
#endif |
294 | 3348 |
%} |
3349 |
! |
|
3350 |
||
3351 |
glxGenobjIn:aGLXWindowId |
|
3352 |
"OBSOLETE: use glxGenObject:in: |
|
3353 |
This one will be removed." |
|
3354 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3355 |
self halt |
294 | 3356 |
! |
3357 |
||
3358 |
glxGetopenobjIn:aGLXWindowId |
|
3359 |
"return the currently open objects id; -1 if none is open" |
|
3360 |
||
3361 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3362 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3363 |
#else |
294 | 3364 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3365 |
RETURN (__MKSMALLINT(getopenobj())); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3366 |
#endif |
294 | 3367 |
%} |
3368 |
! |
|
3369 |
||
3370 |
glxIsobj:obj in:aGLXWindowId |
|
3371 |
"return true, if obj is a valid object id" |
|
3372 |
||
3373 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3374 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3375 |
#else |
294 | 3376 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3377 |
RETURN (__MKBOOLEAN(isobj(_objectVal(obj)))); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3378 |
#endif |
294 | 3379 |
%} |
3380 |
! |
|
3381 |
||
3382 |
glxMakeObject:id in:aGLXWindowId |
|
3383 |
"start object definition - |
|
3384 |
another name conflict" |
|
3385 |
||
3386 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3387 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3388 |
#else |
294 | 3389 |
if (__isSmallInteger(id)) { |
3390 |
SETWIN(aGLXWindowId) |
|
3391 |
makeobj(_objectVal(id)); |
|
3392 |
RETURN (true); |
|
3393 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3394 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3395 |
%}. |
294 | 3396 |
^ false |
3397 |
! |
|
3398 |
||
3399 |
glxMakeobj:obj in:aGLXWindowId |
|
3400 |
"OBSOLETE; use glxMakeObject:in: |
|
3401 |
This one will be removed soon." |
|
3402 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3403 |
self halt |
294 | 3404 |
! ! |
3405 |
||
3406 |
!GLXWorkstation methodsFor:'patches & surfaces'! |
|
3407 |
||
3408 |
glxBeginCurveIn:aGLXWindowId |
|
3409 |
"start a NURBS curve def - in real GL only" |
|
3410 |
||
3411 |
%{ /* NOCONTEXT */ |
|
3412 |
#ifdef GLX |
|
3413 |
SETWIN(aGLXWindowId) |
|
3414 |
bgncurve(); |
|
3415 |
RETURN (true); |
|
3416 |
#endif |
|
3417 |
%} |
|
3418 |
. |
|
3419 |
^ false |
|
3420 |
! |
|
3421 |
||
3422 |
glxBeginSurfaceIn:aGLXWindowId |
|
3423 |
"start a NURBS surface def - in real GL only" |
|
3424 |
||
3425 |
%{ /* NOCONTEXT */ |
|
3426 |
#ifdef GLX |
|
3427 |
SETWIN(aGLXWindowId) |
|
3428 |
bgnsurface(); |
|
3429 |
RETURN (true); |
|
3430 |
#endif |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3431 |
%}. |
294 | 3432 |
^ false |
3433 |
! |
|
3434 |
||
3435 |
glxDefBasis:id mat:aMatrix in:aGLXWindowId |
|
528 | 3436 |
"define the basis matrix for a patch or curve" |
294 | 3437 |
|
3438 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3439 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3440 |
#else |
294 | 3441 |
Matrix matrix; |
3442 |
Matrix *m; |
|
3443 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3444 |
if (! (m = __glx_getFloatsFromMatrixInto(aMatrix, &matrix))) RETURN (false); |
294 | 3445 |
if (__isSmallInteger(id)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3446 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3447 |
defbasis((short)(__intVal(id)), *m); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3448 |
RETURN (true); |
294 | 3449 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3450 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3451 |
%}. |
294 | 3452 |
^ false |
528 | 3453 |
|
3454 |
"Modified: 19.3.1996 / 18:52:56 / cg" |
|
294 | 3455 |
! |
3456 |
||
3457 |
glxEndCurveIn:aGLXWindowId |
|
3458 |
"end a NURBS curve def - in real GL only" |
|
3459 |
||
3460 |
%{ /* NOCONTEXT */ |
|
3461 |
#ifdef GLX |
|
3462 |
SETWIN(aGLXWindowId) |
|
3463 |
endcurve(); |
|
3464 |
RETURN (true); |
|
3465 |
#endif |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3466 |
%}. |
294 | 3467 |
^ false |
3468 |
! |
|
3469 |
||
3470 |
glxEndSurfaceIn:aGLXWindowId |
|
3471 |
"end a NURBS surface def - in real GL only" |
|
3472 |
||
3473 |
%{ /* NOCONTEXT */ |
|
3474 |
#ifdef GLX |
|
3475 |
SETWIN(aGLXWindowId) |
|
3476 |
endsurface(); |
|
3477 |
RETURN (true); |
|
3478 |
#endif |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3479 |
%}. |
294 | 3480 |
^ false |
3481 |
! |
|
3482 |
||
3483 |
glxNurbsSurfaceUKnotCount: uKnotCount uKnot: uKnot |
|
3484 |
vKnotCount: vKnotCount vKnot: vKnot |
|
3485 |
uOffset: uOffset vOffset: vOffset |
|
3486 |
ctlArray: ctlArray |
|
3487 |
uOrder: uOrder vOrder: vOrder |
|
3488 |
type: type in: aGLXWindowId |
|
3489 |
||
3490 |
| ctlPoints i | |
|
3491 |
ctlPoints := DoubleArray new: ctlArray size * (ctlArray first size). |
|
3492 |
i := 1. |
|
3493 |
ctlArray do: [:point | |
|
3494 |
point do: [:coord | |
|
3495 |
ctlPoints at: i put: coord. |
|
3496 |
i := i + 1]]. |
|
3497 |
||
3498 |
%{ /* NOCONTEXT */ |
|
3499 |
#ifdef GLX |
|
3500 |
char *uKnotElements, *vKnotElements, *ctlElements; |
|
3501 |
OBJ cls; |
|
3502 |
int ninstVars, nInstBytes; |
|
3503 |
||
3504 |
SETWIN(aGLXWindowId) |
|
3505 |
cls = __qClass(ctlPoints); |
|
3506 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
3507 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
|
3508 |
||
3509 |
ctlElements = (char *)(_InstPtr(ctlPoints)) + nInstBytes; |
|
3510 |
uKnotElements = (char *)(_InstPtr(uKnot)) + nInstBytes; |
|
3511 |
vKnotElements = (char *)(_InstPtr(vKnot)) + nInstBytes; |
|
3512 |
||
3513 |
nurbssurface ( |
|
3514 |
__intVal(uKnotCount), (double *)uKnotElements, |
|
3515 |
__intVal(vKnotCount), (double *)vKnotElements, |
|
3516 |
__intVal(uOffset), __intVal(vOffset), |
|
3517 |
(double *)ctlElements, |
|
3518 |
__intVal(uOrder), __intVal(vOrder), __intVal(type)); |
|
3519 |
RETURN(true); |
|
3520 |
#endif |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3521 |
%}. |
294 | 3522 |
^ false |
3523 |
! |
|
3524 |
||
3525 |
glxPatchBasisU:u v:v in:aGLXWindowId |
|
528 | 3526 |
"set the two basis matrices for a patch" |
294 | 3527 |
|
3528 |
%{ /* NOCONTEXT */ |
|
3529 |
if (__bothSmallInteger(u, v)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3530 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3531 |
patchbasis((long)__intVal(u), (long)__intVal(v)); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3532 |
RETURN (true); |
294 | 3533 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3534 |
%}. |
294 | 3535 |
^ false |
528 | 3536 |
|
3537 |
"Modified: 19.3.1996 / 18:53:18 / cg" |
|
294 | 3538 |
! |
3539 |
||
3540 |
glxPatchCurvesU:u v:v in:aGLXWindowId |
|
528 | 3541 |
"set the number of curves to be drawn in each direction on a patch" |
294 | 3542 |
|
3543 |
%{ /* NOCONTEXT */ |
|
3544 |
if (__bothSmallInteger(u, v)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3545 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3546 |
patchcurves((long)__intVal(u), (long)__intVal(v)); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3547 |
RETURN (true); |
294 | 3548 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3549 |
%}. |
294 | 3550 |
^ false |
528 | 3551 |
|
3552 |
"Modified: 19.3.1996 / 18:53:34 / cg" |
|
294 | 3553 |
! |
3554 |
||
3555 |
glxPatchPrecisionU:u v:v in:aGLXWindowId |
|
3556 |
"set the patch precision" |
|
3557 |
||
3558 |
%{ /* NOCONTEXT */ |
|
3559 |
if (__bothSmallInteger(u, v)) { |
|
3560 |
SETWIN(aGLXWindowId) |
|
3561 |
patchprecision((long)__intVal(u), (long)__intVal(v)); |
|
3562 |
RETURN (true); |
|
3563 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3564 |
%}. |
294 | 3565 |
^ false |
3566 |
! |
|
3567 |
||
3568 |
glxPatchX:arrayOf16XFloats y:arrayOf16YFloats z:arrayOf16ZFloats in:aGLXWindowId |
|
528 | 3569 |
"Draws a bicubic patch. |
3570 |
arguments must be arrays of 16 floats containing the patch" |
|
294 | 3571 |
|
3572 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3573 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3574 |
#else |
294 | 3575 |
Matrix matrixX, matrixY, matrixZ; |
3576 |
Matrix *mX, *mY, *mZ; |
|
3577 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3578 |
if (! (mX = __glx_getFloatsFromMatrixInto(arrayOf16XFloats, &matrixX))) RETURN (false); |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3579 |
if (! (mY = __glx_getFloatsFromMatrixInto(arrayOf16YFloats, &matrixY))) RETURN (false); |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3580 |
if (! (mZ = __glx_getFloatsFromMatrixInto(arrayOf16ZFloats, &matrixZ))) RETURN (false); |
294 | 3581 |
SETWIN(aGLXWindowId) |
3582 |
patch(*mX, *mY, *mZ); |
|
3583 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3584 |
#endif |
294 | 3585 |
%} |
528 | 3586 |
|
3587 |
"Modified: 19.3.1996 / 18:54:02 / cg" |
|
3588 |
! |
|
3589 |
||
3590 |
glxRpatchX:arrayOf16XFloats y:arrayOf16YFloats z:arrayOf16ZFloats w:arrayOf16WFloats in:aGLXWindowId |
|
3591 |
"Draws a rational bicubic patch. |
|
3592 |
arguments must be arrays of 16 floats containing the patch" |
|
3593 |
||
3594 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3595 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3596 |
#else |
529 | 3597 |
Matrix matrixX, matrixY, matrixZ, matrixW; |
3598 |
Matrix *mX, *mY, *mZ, *mW; |
|
528 | 3599 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3600 |
if (! (mX = __glx_getFloatsFromMatrixInto(arrayOf16XFloats, &matrixX))) RETURN (false); |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3601 |
if (! (mY = __glx_getFloatsFromMatrixInto(arrayOf16YFloats, &matrixY))) RETURN (false); |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3602 |
if (! (mZ = __glx_getFloatsFromMatrixInto(arrayOf16ZFloats, &matrixZ))) RETURN (false); |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3603 |
if (! (mW = __glx_getFloatsFromMatrixInto(arrayOf16WFloats, &matrixW))) RETURN (false); |
529 | 3604 |
SETWIN(aGLXWindowId) |
3605 |
rpatch(*mX, *mY, *mZ, *mW); |
|
528 | 3606 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3607 |
#endif |
528 | 3608 |
%} |
3609 |
||
3610 |
"Modified: 19.3.1996 / 18:54:02 / cg" |
|
3611 |
"Created: 19.3.1996 / 18:56:34 / cg" |
|
3612 |
! ! |
|
3613 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3614 |
!GLXWorkstation methodsFor:'pixel copy'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3615 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3616 |
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
|
3617 |
"copy a rectangular area in the view. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3618 |
For now, this is only supported with a true GL. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3619 |
readsource specifies which plane/buffer is affected by this operation." |
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 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3622 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3623 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3624 |
rectcopy(_screencoordVal(x1), _screencoordVal(y1), |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3625 |
_screencoordVal(x2), _screencoordVal(y2), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3626 |
_screencoordVal(newx), _screencoordVal(newy)); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3627 |
RETURN (true); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3628 |
#endif |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3629 |
%}. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3630 |
^ false |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3631 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3632 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3633 |
!GLXWorkstation methodsFor:'pixel reading'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3634 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3635 |
glxReadpixelsTo:dest in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3636 |
"read pixels from the view. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3637 |
Dest must be an array and gets pixel values assigned, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3638 |
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
|
3639 |
For now, pixel-reading is only supported with a true GL. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3640 |
Caveat: the number of pixels is limited to 256. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3641 |
In double buffer mode, the backBuffer is read." |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3642 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3643 |
|n| |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3644 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3645 |
n := dest size. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3646 |
n > 256 ifTrue:[^ 0]. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3647 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3648 |
%{ /* STACK:1024 */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3649 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3650 |
Colorindex buffer[256]; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3651 |
int i, nRead; |
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 |
if (__isArray(dest)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3654 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3655 |
nRead = readpixels(__intVal(n), buffer); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3656 |
for (i=0; i<nRead;i++) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3657 |
__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
|
3658 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3659 |
RETURN (__MKSMALLINT(nRead)); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3660 |
} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3661 |
#endif |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3662 |
%}. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3663 |
^ 0 |
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 |
"Modified: 22.3.1996 / 18:08:00 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3666 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3667 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3668 |
glxReadsource: src in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3669 |
"specify what is read with folowing readPixels requests. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3670 |
For now, pixel-reading is only supported with a true GL" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3671 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3672 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3673 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3674 |
OBJ s = src; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3675 |
int what; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3676 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3677 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3678 |
if (s == @symbol(auto)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3679 |
what = SRC_AUTO; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3680 |
} else if (s == @symbol(front)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3681 |
what = SRC_FRONT; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3682 |
} else if (s == @symbol(back)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3683 |
what = SRC_BACK; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3684 |
} else if (s == @symbol(zBuffer)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3685 |
what = SRC_ZBUFFER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3686 |
} else if (s == @symbol(frameGrabber)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3687 |
what = SRC_FRAMEGRABBER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3688 |
} else if (s == @symbol(over)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3689 |
what = SRC_OVER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3690 |
} else if (s == @symbol(under)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3691 |
what = SRC_UNDER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3692 |
} else if (s == @symbol(popUp)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3693 |
what = SRC_PUP; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3694 |
} else { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3695 |
what = _longVal(src); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3696 |
} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3697 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3698 |
readsource(what); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3699 |
RETURN (true); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3700 |
#endif |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3701 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3702 |
. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3703 |
^ false |
538 | 3704 |
! |
3705 |
||
541 | 3706 |
glxRectreadX1:x1 y1:y1 x2:x2 y2:y2 h:viewHeight to:dest in:aGLXWindowId |
538 | 3707 |
"read pixels from a rectanglular area. |
3708 |
Dest must be an array and gets pixel values assigned, |
|
3709 |
reading n*m pixels. |
|
3710 |
For now, pixel-reading is only supported with a true GL. |
|
3711 |
Caveat: the number of pixels is limited to 256. |
|
3712 |
In double buffer mode, the backBuffer is read." |
|
3713 |
||
541 | 3714 |
|n idx sy1 sy2| |
3715 |
||
3716 |
"/ GLX's y coordinates go bottom to top ... |
|
3717 |
||
3718 |
sy1 := viewHeight - y1. |
|
3719 |
sy2 := viewHeight - y2. |
|
538 | 3720 |
|
3721 |
n := (x2 - x1 + 1) * (y2 - y1 + 1). |
|
3722 |
n > 256 ifTrue:[^ 0]. |
|
3723 |
dest size < n ifTrue:[^ 0]. |
|
3724 |
||
3725 |
%{ /* STACK:1024 */ |
|
3726 |
#ifdef GLX |
|
3727 |
Colorindex buffer[256]; |
|
3728 |
int i, nRead; |
|
3729 |
||
3730 |
if (__isArray(dest) |
|
3731 |
&& __isSmallInteger(x1) && __isSmallInteger(x2) |
|
541 | 3732 |
&& __isSmallInteger(sy1) && __isSmallInteger(sy2) |
538 | 3733 |
) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3734 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3735 |
nRead = rectread(__intVal(x1), __intVal(sy1), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3736 |
__intVal(x2), __intVal(sy2), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3737 |
buffer); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3738 |
for (i=0; i<nRead;i++) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3739 |
__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
|
3740 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3741 |
RETURN (__MKSMALLINT(nRead)); |
538 | 3742 |
} |
3743 |
#endif |
|
3744 |
%}. |
|
3745 |
"/ |
|
3746 |
"/ ok, this is not a GL - use XWorkstations pixel read method |
|
3747 |
"/ and convert |
|
3748 |
"/ |
|
3749 |
idx := 1. |
|
3750 |
y1 to:y2 do:[:y | |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3751 |
x1 to:x2 do:[:x | |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3752 |
|pix| |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3753 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3754 |
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
|
3755 |
dest at:idx put:pix |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3756 |
] |
538 | 3757 |
]. |
3758 |
^ n |
|
3759 |
||
3760 |
"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
|
3761 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3762 |
! |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3763 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3764 |
glxXColorToGLColor:pixel |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3765 |
"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
|
3766 |
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
|
3767 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3768 |
%{ /* NOCONTEXT */ |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3769 |
#ifdef VGL |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3770 |
if (__isSmallInteger(pixel)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3771 |
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
|
3772 |
} |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3773 |
#endif |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3774 |
%}. |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3775 |
^ pixel |
543
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3776 |
! |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3777 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3778 |
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
|
3779 |
"special for VGL" |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3780 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3781 |
%{ |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3782 |
#ifdef VGL |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3783 |
if (__isSmallInteger(x) && __isSmallInteger(y)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3784 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3785 |
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
|
3786 |
} |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3787 |
#endif |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3788 |
%}. |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3789 |
^ 0 |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3790 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3791 |
"Modified: 22.3.1996 / 18:08:00 / cg" |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3792 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3793 |
|
528 | 3794 |
!GLXWorkstation methodsFor:'points'! |
3795 |
||
3796 |
glxPnt2X: x y: y in: aGLXWindowId |
|
3797 |
"plot a point in x, y, 0." |
|
3798 |
||
3799 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3800 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3801 |
#else |
528 | 3802 |
Coord c_x, c_y; |
3803 |
||
3804 |
_COORD_ (x, c_x) |
|
3805 |
_COORD_ (y, c_y) |
|
3806 |
SETWIN(aGLXWindowId) |
|
3807 |
pnt2(c_x, c_y); |
|
3808 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3809 |
#endif |
528 | 3810 |
%} |
3811 |
||
3812 |
"Modified: 19.3.1996 / 18:35:55 / cg" |
|
3813 |
! |
|
3814 |
||
3815 |
glxPnt2iX: x y: y in: aGLXWindowId |
|
3816 |
"plot a point in x, y, 0." |
|
3817 |
||
3818 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3819 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3820 |
#else |
528 | 3821 |
Icoord c_x, c_y; |
3822 |
||
3823 |
_ICOORD_ (x, c_x) |
|
3824 |
_ICOORD_ (y, c_y) |
|
3825 |
SETWIN(aGLXWindowId) |
|
3826 |
pnt2i(c_x, c_y); |
|
3827 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3828 |
#endif |
528 | 3829 |
%} |
3830 |
||
3831 |
"Modified: 19.3.1996 / 18:35:59 / cg" |
|
3832 |
! |
|
3833 |
||
3834 |
glxPnt2sX: x y: y in: aGLXWindowId |
|
3835 |
"plot a point in x, y, 0." |
|
3836 |
||
3837 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3838 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3839 |
#else |
528 | 3840 |
Scoord c_x, c_y; |
3841 |
||
3842 |
_SCOORD_ (x, c_x) |
|
3843 |
_SCOORD_ (y, c_y) |
|
3844 |
SETWIN(aGLXWindowId) |
|
3845 |
pnt2s(c_x, c_y); |
|
3846 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3847 |
#endif |
528 | 3848 |
%} |
3849 |
||
3850 |
"Modified: 19.3.1996 / 18:36:03 / cg" |
|
3851 |
! |
|
3852 |
||
3853 |
glxPntX: x y: y z: z in: aGLXWindowId |
|
3854 |
"plot a point in x, y, z." |
|
3855 |
||
3856 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3857 |
#ifdef OPENGL |
1301 | 3858 |
#else |
528 | 3859 |
Coord c_x, c_y, c_z; |
3860 |
||
3861 |
_COORD_ (x, c_x) |
|
3862 |
_COORD_ (y, c_y) |
|
3863 |
_COORD_ (z, c_z) |
|
3864 |
SETWIN(aGLXWindowId) |
|
3865 |
pnt(c_x, c_y, c_z); |
|
3866 |
RETURN (true); |
|
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:08 / cg" |
|
3871 |
! |
|
3872 |
||
3873 |
glxPntiX: x y: y z: z in: aGLXWindowId |
|
3874 |
"plot a point in x, y, z." |
|
3875 |
||
3876 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3877 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3878 |
#else |
528 | 3879 |
Icoord c_x, c_y, c_z; |
3880 |
||
3881 |
_ICOORD_ (x, c_x) |
|
3882 |
_ICOORD_ (y, c_y) |
|
3883 |
_ICOORD_ (z, c_z) |
|
3884 |
SETWIN(aGLXWindowId) |
|
3885 |
pnti(c_x, c_y, c_z); |
|
3886 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3887 |
#endif |
528 | 3888 |
%} |
3889 |
||
3890 |
"Modified: 19.3.1996 / 18:36:14 / cg" |
|
3891 |
! |
|
3892 |
||
3893 |
glxPntsX: x y: y z: z in: aGLXWindowId |
|
3894 |
"plot a point in x, y, z." |
|
3895 |
||
3896 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3897 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3898 |
#else |
528 | 3899 |
Scoord c_x, c_y, c_z; |
3900 |
||
3901 |
_SCOORD_ (x, c_x) |
|
3902 |
_SCOORD_ (y, c_y) |
|
3903 |
_SCOORD_ (z, c_z) |
|
3904 |
SETWIN(aGLXWindowId) |
|
3905 |
pnts(c_x, c_y, c_z); |
|
3906 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3907 |
#endif |
528 | 3908 |
%} |
3909 |
||
3910 |
"Modified: 19.3.1996 / 18:36:17 / cg" |
|
3911 |
! |
|
3912 |
||
3913 |
glxPntsize: n in: aGLXWindowId |
|
3914 |
||
3915 |
%{ /* NOCONTEXT */ |
|
3916 |
#ifdef GLX |
|
3917 |
SETWIN(aGLXWindowId) |
|
3918 |
pntsize(_shortVal(n)); |
|
3919 |
RETURN (true); |
|
3920 |
#endif |
|
3921 |
%} |
|
3922 |
. |
|
3923 |
^ false |
|
3924 |
! |
|
3925 |
||
3926 |
glxPntsizef: n in: aGLXWindowId |
|
3927 |
||
3928 |
%{ /* NOCONTEXT */ |
|
3929 |
#ifdef GLX |
|
3930 |
SETWIN(aGLXWindowId) |
|
3931 |
pntsizef(_floatVal(n)); |
|
3932 |
RETURN (true); |
|
3933 |
#endif |
|
3934 |
%} |
|
3935 |
. |
|
3936 |
^ false |
|
3937 |
! ! |
|
3938 |
||
3939 |
!GLXWorkstation methodsFor:'polygons'! |
|
3940 |
||
3941 |
glxBackface: b in: aGLXWindowId |
|
3942 |
"enable/disable culling of backfacing polygons (suppress its drawing). |
|
3943 |
A polygon is backfacing if it's orientation in *screen* coords is clockwise" |
|
3944 |
||
3945 |
%{ /* NOCONTEXT */ |
|
3946 |
SETWIN(aGLXWindowId) |
|
3947 |
backface(_booleanVal(b)); |
|
3948 |
RETURN (true); |
|
3949 |
%} |
|
3950 |
||
3951 |
"Modified: 19.3.1996 / 18:26:50 / cg" |
|
3952 |
! |
|
3953 |
||
3954 |
glxConcave: b in: aGLXWindowId |
|
3955 |
"signal wether or not polygons are concave" |
|
3956 |
||
3957 |
%{ /* NOCONTEXT */ |
|
3958 |
SETWIN(aGLXWindowId) |
|
3959 |
concave(_booleanVal(b)); |
|
3960 |
RETURN (true); |
|
3961 |
%} |
|
3962 |
! |
|
3963 |
||
3964 |
glxFrontface: b in: aGLXWindowId |
|
3965 |
"enable/disable culling of frontfacing polygons (suppress its drawing). |
|
3966 |
A polygon is frontfacing if it's orientation in *screen* coords is |
|
3967 |
anti-clockwise" |
|
3968 |
||
3969 |
||
3970 |
%{ /* NOCONTEXT */ |
|
3971 |
SETWIN(aGLXWindowId) |
|
3972 |
frontface(_booleanVal(b)); |
|
3973 |
RETURN (true); |
|
3974 |
%} |
|
3975 |
. |
|
3976 |
^ false |
|
3977 |
||
3978 |
"Modified: 19.3.1996 / 18:27:50 / cg" |
|
3979 |
! |
|
3980 |
||
3981 |
glxPdr2X: x y: y in: aGLXWindowId |
|
3982 |
"add another vertex to the polygon" |
|
3983 |
||
3984 |
%{ /* NOCONTEXT */ |
|
3985 |
Coord c_x, c_y; |
|
3986 |
||
3987 |
_COORD_ (x, c_x) |
|
3988 |
_COORD_ (y, c_y) |
|
3989 |
SETWIN(aGLXWindowId) |
|
3990 |
pdr2(c_x, c_y); |
|
3991 |
RETURN (true); |
|
3992 |
%} |
|
3993 |
||
3994 |
"Modified: 19.3.1996 / 18:33:09 / cg" |
|
3995 |
! |
|
3996 |
||
3997 |
glxPdr2iX: x y: y in: aGLXWindowId |
|
3998 |
"add another vertex to the polygon" |
|
3999 |
||
4000 |
%{ /* NOCONTEXT */ |
|
4001 |
Icoord c_x, c_y; |
|
4002 |
||
4003 |
_ICOORD_ (x, c_x) |
|
4004 |
_ICOORD_ (y, c_y) |
|
4005 |
SETWIN(aGLXWindowId) |
|
4006 |
pdr2i(c_x, c_y); |
|
4007 |
RETURN (true); |
|
4008 |
%} |
|
4009 |
||
4010 |
"Modified: 19.3.1996 / 18:33:28 / cg" |
|
4011 |
! |
|
4012 |
||
4013 |
glxPdr2sX: x y: y in: aGLXWindowId |
|
4014 |
"add another vertex to the polygon" |
|
4015 |
||
4016 |
%{ /* NOCONTEXT */ |
|
4017 |
Scoord c_x, c_y; |
|
4018 |
||
4019 |
_SCOORD_ (x, c_x) |
|
4020 |
_SCOORD_ (y, c_y) |
|
4021 |
SETWIN(aGLXWindowId) |
|
4022 |
pdr2s(c_x, c_y); |
|
4023 |
RETURN (true); |
|
4024 |
%} |
|
4025 |
||
4026 |
"Modified: 19.3.1996 / 18:34:03 / cg" |
|
4027 |
! |
|
4028 |
||
4029 |
glxPdrX: x y: y z: z in: aGLXWindowId |
|
4030 |
"add another vertex to the polygon" |
|
4031 |
||
4032 |
%{ /* NOCONTEXT */ |
|
4033 |
Coord c_x, c_y, c_z; |
|
4034 |
||
4035 |
_COORD_ (x, c_x) |
|
4036 |
_COORD_ (y, c_y) |
|
4037 |
_COORD_ (z, c_z) |
|
4038 |
SETWIN(aGLXWindowId) |
|
4039 |
pdr(c_x, c_y, c_z); |
|
4040 |
RETURN (true); |
|
4041 |
%} |
|
4042 |
||
4043 |
"Modified: 19.3.1996 / 18:34:06 / cg" |
|
4044 |
! |
|
4045 |
||
4046 |
glxPdriX: x y: y z: z in: aGLXWindowId |
|
4047 |
"add another vertex to the polygon" |
|
4048 |
||
4049 |
%{ /* NOCONTEXT */ |
|
4050 |
Icoord c_x, c_y, c_z; |
|
4051 |
||
4052 |
_ICOORD_ (x, c_x) |
|
4053 |
_ICOORD_ (y, c_y) |
|
4054 |
_ICOORD_ (z, c_z) |
|
4055 |
SETWIN(aGLXWindowId) |
|
4056 |
pdri(c_x, c_y, c_z); |
|
4057 |
RETURN (true); |
|
4058 |
%} |
|
4059 |
||
4060 |
"Modified: 19.3.1996 / 18:34:11 / cg" |
|
4061 |
! |
|
4062 |
||
4063 |
glxPdrsX: x y: y z: z in: aGLXWindowId |
|
4064 |
"add another vertex to the polygon" |
|
4065 |
||
4066 |
%{ /* NOCONTEXT */ |
|
4067 |
Scoord c_x, c_y, c_z; |
|
4068 |
||
4069 |
_SCOORD_ (x, c_x) |
|
4070 |
_SCOORD_ (y, c_y) |
|
4071 |
_SCOORD_ (z, c_z) |
|
4072 |
SETWIN(aGLXWindowId) |
|
4073 |
pdrs(c_x, c_y, c_z); |
|
4074 |
RETURN (true); |
|
4075 |
%} |
|
4076 |
||
4077 |
"Modified: 19.3.1996 / 18:34:14 / cg" |
|
4078 |
! |
|
4079 |
||
4080 |
glxPmv2X: x y: y in: aGLXWindowId |
|
4081 |
"set the start position of a polygon" |
|
4082 |
||
4083 |
%{ /* NOCONTEXT */ |
|
4084 |
Coord c_x, c_y; |
|
4085 |
||
4086 |
_COORD_ (x, c_x) |
|
4087 |
_COORD_ (y, c_y) |
|
4088 |
SETWIN(aGLXWindowId) |
|
4089 |
pmv2(c_x, c_y); |
|
4090 |
RETURN (true); |
|
4091 |
%} |
|
4092 |
||
4093 |
"Modified: 19.3.1996 / 18:32:45 / cg" |
|
4094 |
! |
|
4095 |
||
4096 |
glxPmv2iX: x y: y in: aGLXWindowId |
|
4097 |
"set the start position of a polygon" |
|
4098 |
||
4099 |
%{ /* NOCONTEXT */ |
|
4100 |
Icoord c_x, c_y; |
|
4101 |
||
4102 |
_ICOORD_ (x, c_x) |
|
4103 |
_ICOORD_ (y, c_y) |
|
4104 |
SETWIN(aGLXWindowId) |
|
4105 |
pmv2i(c_x, c_y); |
|
4106 |
RETURN (true); |
|
4107 |
%} |
|
4108 |
||
4109 |
"Modified: 19.3.1996 / 18:32:42 / cg" |
|
4110 |
! |
|
4111 |
||
4112 |
glxPmv2sX: x y: y in: aGLXWindowId |
|
4113 |
"set the start position of a polygon" |
|
4114 |
||
4115 |
%{ /* NOCONTEXT */ |
|
4116 |
Scoord c_x, c_y; |
|
4117 |
||
4118 |
_SCOORD_ (x, c_x) |
|
4119 |
_SCOORD_ (y, c_y) |
|
4120 |
SETWIN(aGLXWindowId) |
|
4121 |
pmv2s(c_x, c_y); |
|
4122 |
RETURN (true); |
|
4123 |
%} |
|
4124 |
||
4125 |
"Modified: 19.3.1996 / 18:32:38 / cg" |
|
4126 |
! |
|
4127 |
||
4128 |
glxPmvX: x y: y z: z in: aGLXWindowId |
|
4129 |
"set the start position of a polygon" |
|
4130 |
||
4131 |
%{ /* NOCONTEXT */ |
|
4132 |
Coord c_x, c_y, c_z; |
|
4133 |
||
4134 |
_COORD_ (x, c_x) |
|
4135 |
_COORD_ (y, c_y) |
|
4136 |
_COORD_ (z, c_z) |
|
4137 |
SETWIN(aGLXWindowId) |
|
4138 |
pmv(c_x, c_y, c_z); |
|
4139 |
RETURN (true); |
|
4140 |
%} |
|
4141 |
||
4142 |
"Modified: 19.3.1996 / 18:31:52 / cg" |
|
4143 |
! |
|
4144 |
||
4145 |
glxPmviX: x y: y z: z in: aGLXWindowId |
|
4146 |
"set the start position of a polygon" |
|
4147 |
||
4148 |
%{ /* NOCONTEXT */ |
|
4149 |
Icoord c_x, c_y, c_z; |
|
4150 |
||
4151 |
_ICOORD_ (x, c_x) |
|
4152 |
_ICOORD_ (y, c_y) |
|
4153 |
_ICOORD_ (z, c_z) |
|
4154 |
SETWIN(aGLXWindowId) |
|
4155 |
pmvi(c_x, c_y, c_z); |
|
4156 |
RETURN (true); |
|
4157 |
%} |
|
4158 |
||
4159 |
"Modified: 19.3.1996 / 18:31:59 / cg" |
|
4160 |
! |
|
4161 |
||
4162 |
glxPmvsX: x y: y z: z in: aGLXWindowId |
|
4163 |
"set the start position of a polygon" |
|
4164 |
||
4165 |
%{ /* NOCONTEXT */ |
|
4166 |
Scoord c_x, c_y, c_z; |
|
4167 |
||
4168 |
_SCOORD_ (x, c_x) |
|
4169 |
_SCOORD_ (y, c_y) |
|
4170 |
_SCOORD_ (z, c_z) |
|
4171 |
SETWIN(aGLXWindowId) |
|
4172 |
pmvs(c_x, c_y, c_z); |
|
4173 |
RETURN (true); |
|
4174 |
%} |
|
4175 |
||
4176 |
"Modified: 19.3.1996 / 18:32:03 / cg" |
|
4177 |
! |
|
4178 |
||
4179 |
glxPolymode: mode in: aGLXWindowId |
|
4180 |
"Sets the polygon filling mode - only filled (1) or outlined (0) |
|
4181 |
are supported" |
|
4182 |
||
4183 |
%{ /* NOCONTEXT */ |
|
4184 |
SETWIN(aGLXWindowId) |
|
4185 |
polymode(_longVal(mode)); |
|
4186 |
RETURN (true); |
|
4187 |
%} |
|
4188 |
||
4189 |
"Modified: 19.3.1996 / 18:29:32 / cg" |
|
4190 |
! |
|
4191 |
||
4192 |
glxRpdr2X: x y: y in: aGLXWindowId |
|
4193 |
"add another relative vertex to the polygon" |
|
4194 |
||
4195 |
%{ /* NOCONTEXT */ |
|
4196 |
Coord c_x, c_y; |
|
4197 |
||
4198 |
_COORD_ (x, c_x) |
|
4199 |
_COORD_ (y, c_y) |
|
4200 |
SETWIN(aGLXWindowId) |
|
4201 |
rpdr2(c_x, c_y); |
|
4202 |
RETURN (true); |
|
4203 |
%} |
|
4204 |
||
4205 |
"Modified: 19.3.1996 / 18:34:31 / cg" |
|
4206 |
! |
|
4207 |
||
4208 |
glxRpdr2iX: x y: y in: aGLXWindowId |
|
4209 |
"add another relative vertex to the polygon" |
|
4210 |
||
4211 |
%{ /* NOCONTEXT */ |
|
4212 |
Icoord c_x, c_y; |
|
4213 |
||
4214 |
_ICOORD_ (x, c_x) |
|
4215 |
_ICOORD_ (y, c_y) |
|
4216 |
SETWIN(aGLXWindowId) |
|
4217 |
rpdr2i(c_x, c_y); |
|
4218 |
RETURN (true); |
|
4219 |
%} |
|
4220 |
||
4221 |
"Modified: 19.3.1996 / 18:34:36 / cg" |
|
4222 |
! |
|
4223 |
||
4224 |
glxRpdr2sX: x y: y in: aGLXWindowId |
|
4225 |
"add another relative vertex to the polygon" |
|
4226 |
||
4227 |
%{ /* NOCONTEXT */ |
|
4228 |
Scoord c_x, c_y; |
|
4229 |
||
4230 |
_SCOORD_ (x, c_x) |
|
4231 |
_SCOORD_ (y, c_y) |
|
4232 |
SETWIN(aGLXWindowId) |
|
4233 |
rpdr2s(c_x, c_y); |
|
4234 |
RETURN (true); |
|
4235 |
%} |
|
4236 |
||
4237 |
"Modified: 19.3.1996 / 18:34:40 / cg" |
|
4238 |
! |
|
4239 |
||
4240 |
glxRpdrX: x y: y z: z in: aGLXWindowId |
|
4241 |
"add another relative vertex to the polygon" |
|
4242 |
||
4243 |
%{ /* NOCONTEXT */ |
|
4244 |
Coord c_x, c_y, c_z; |
|
4245 |
||
4246 |
_COORD_ (x, c_x) |
|
4247 |
_COORD_ (y, c_y) |
|
4248 |
_COORD_ (z, c_z) |
|
4249 |
SETWIN(aGLXWindowId) |
|
4250 |
rpdr(c_x, c_y, c_z); |
|
4251 |
RETURN (true); |
|
4252 |
%} |
|
4253 |
||
4254 |
"Modified: 19.3.1996 / 18:34:48 / cg" |
|
4255 |
! |
|
4256 |
||
4257 |
glxRpdriX: x y: y z: z in: aGLXWindowId |
|
4258 |
"add another relative vertex to the polygon" |
|
4259 |
||
4260 |
%{ /* NOCONTEXT */ |
|
4261 |
Icoord c_x, c_y, c_z; |
|
4262 |
||
4263 |
_ICOORD_ (x, c_x) |
|
4264 |
_ICOORD_ (y, c_y) |
|
4265 |
_ICOORD_ (z, c_z) |
|
4266 |
SETWIN(aGLXWindowId) |
|
4267 |
rpdri(c_x, c_y, c_z); |
|
4268 |
RETURN (true); |
|
4269 |
%} |
|
4270 |
||
4271 |
"Modified: 19.3.1996 / 18:34:51 / cg" |
|
4272 |
! |
|
4273 |
||
4274 |
glxRpdrsX: x y: y z: z in: aGLXWindowId |
|
4275 |
"add another relative vertex to the polygon" |
|
4276 |
||
4277 |
%{ /* NOCONTEXT */ |
|
4278 |
Scoord c_x, c_y, c_z; |
|
4279 |
||
4280 |
_SCOORD_ (x, c_x) |
|
4281 |
_SCOORD_ (y, c_y) |
|
4282 |
_SCOORD_ (z, c_z) |
|
4283 |
SETWIN(aGLXWindowId) |
|
4284 |
rpdrs(c_x, c_y, c_z); |
|
4285 |
RETURN (true); |
|
4286 |
%} |
|
4287 |
||
4288 |
"Modified: 19.3.1996 / 18:34:55 / cg" |
|
4289 |
! |
|
4290 |
||
4291 |
glxRpmv2X: x y: y in: aGLXWindowId |
|
4292 |
"set the start position of a polygon" |
|
4293 |
||
4294 |
%{ /* NOCONTEXT */ |
|
4295 |
Coord c_x, c_y; |
|
4296 |
||
4297 |
_COORD_ (x, c_x) |
|
4298 |
_COORD_ (y, c_y) |
|
4299 |
SETWIN(aGLXWindowId) |
|
4300 |
rpmv2(c_x, c_y); |
|
4301 |
RETURN (true); |
|
4302 |
%} |
|
4303 |
||
4304 |
"Modified: 19.3.1996 / 18:37:15 / cg" |
|
4305 |
! |
|
4306 |
||
4307 |
glxRpmv2iX: x y: y in: aGLXWindowId |
|
4308 |
"set the start position of a polygon" |
|
4309 |
||
4310 |
%{ /* NOCONTEXT */ |
|
4311 |
Icoord c_x, c_y; |
|
4312 |
||
4313 |
_ICOORD_ (x, c_x) |
|
4314 |
_ICOORD_ (y, c_y) |
|
4315 |
SETWIN(aGLXWindowId) |
|
4316 |
rpmv2i(c_x, c_y); |
|
4317 |
RETURN (true); |
|
4318 |
%} |
|
4319 |
||
4320 |
"Modified: 19.3.1996 / 18:37:20 / cg" |
|
4321 |
! |
|
4322 |
||
4323 |
glxRpmv2sX: x y: y in: aGLXWindowId |
|
4324 |
"set the relative start position of a polygon" |
|
4325 |
||
4326 |
%{ /* NOCONTEXT */ |
|
4327 |
Scoord c_x, c_y; |
|
4328 |
||
4329 |
_SCOORD_ (x, c_x) |
|
4330 |
_SCOORD_ (y, c_y) |
|
4331 |
SETWIN(aGLXWindowId) |
|
4332 |
rpmv2s(c_x, c_y); |
|
4333 |
RETURN (true); |
|
4334 |
%} |
|
4335 |
||
4336 |
"Modified: 19.3.1996 / 18:38:06 / cg" |
|
4337 |
! |
|
4338 |
||
4339 |
glxRpmvX: x y: y z: z in: aGLXWindowId |
|
4340 |
"set the relative start position of a polygon" |
|
4341 |
||
4342 |
%{ /* NOCONTEXT */ |
|
4343 |
Coord c_x, c_y, c_z; |
|
4344 |
||
4345 |
_COORD_ (x, c_x) |
|
4346 |
_COORD_ (y, c_y) |
|
4347 |
_COORD_ (z, c_z) |
|
4348 |
SETWIN(aGLXWindowId) |
|
4349 |
rpmv(c_x, c_y, c_z); |
|
4350 |
RETURN (true); |
|
4351 |
%} |
|
4352 |
||
4353 |
"Modified: 19.3.1996 / 18:38:03 / cg" |
|
4354 |
! |
|
4355 |
||
4356 |
glxRpmviX: x y: y z: z in: aGLXWindowId |
|
4357 |
"set the relative start position of a polygon" |
|
4358 |
||
4359 |
%{ /* NOCONTEXT */ |
|
4360 |
Icoord c_x, c_y, c_z; |
|
4361 |
||
4362 |
_ICOORD_ (x, c_x) |
|
4363 |
_ICOORD_ (y, c_y) |
|
4364 |
_ICOORD_ (z, c_z) |
|
4365 |
SETWIN(aGLXWindowId) |
|
4366 |
rpmvi(c_x, c_y, c_z); |
|
4367 |
RETURN (true); |
|
4368 |
%} |
|
4369 |
||
4370 |
"Modified: 19.3.1996 / 18:37:53 / cg" |
|
4371 |
! |
|
4372 |
||
4373 |
glxRpmvsX: x y: y z: z in: aGLXWindowId |
|
4374 |
"set the relative start position of a polygon" |
|
4375 |
||
4376 |
%{ /* NOCONTEXT */ |
|
4377 |
Scoord c_x, c_y, c_z; |
|
4378 |
||
4379 |
_SCOORD_ (x, c_x) |
|
4380 |
_SCOORD_ (y, c_y) |
|
4381 |
_SCOORD_ (z, c_z) |
|
4382 |
SETWIN(aGLXWindowId) |
|
4383 |
rpmvs(c_x, c_y, c_z); |
|
4384 |
RETURN (true); |
|
4385 |
%} |
|
4386 |
||
4387 |
"Modified: 19.3.1996 / 18:37:58 / cg" |
|
294 | 4388 |
! ! |
4389 |
||
24 | 4390 |
!GLXWorkstation methodsFor:'queries'! |
4391 |
||
159 | 4392 |
glVersion |
4393 |
"return a string describing the GL version. |
|
4394 |
For informative use only; portable applications do not depend |
|
4395 |
on the returned string." |
|
4396 |
||
4397 |
%{ /* NOCONTEXT */ |
|
4398 |
#ifdef VGL |
|
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
4399 |
RETURN (__MKSTRING("vogl")); |
159 | 4400 |
#else |
4401 |
char buffer[128]; |
|
4402 |
||
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4403 |
if (_INST(glOK) == true) { |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4404 |
gversion(buffer); |
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
4405 |
RETURN (__MKSTRING(buffer)); |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4406 |
} else { |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4407 |
RETURN (nil); |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4408 |
} |
159 | 4409 |
#endif |
4410 |
%} |
|
4411 |
||
4412 |
" |
|
4413 |
Display glVersion |
|
4414 |
" |
|
4415 |
! |
|
4416 |
||
528 | 4417 |
glxGetplanesIn: aGLXWindowId |
4418 |
"Returns the number if bit planes available on the device." |
|
4419 |
||
4420 |
%{ /* NOCONTEXT */ |
|
4421 |
#ifdef GLX |
|
4422 |
SETWIN(aGLXWindowId) |
|
4423 |
RETURN (__MKSMALLINT(getplanes())); |
|
4424 |
#endif |
|
4425 |
%} |
|
4426 |
. |
|
4427 |
^ false |
|
4428 |
||
4429 |
"Modified: 19.3.1996 / 18:50:44 / cg" |
|
4430 |
! |
|
4431 |
||
294 | 4432 |
hasStereoExtension |
4433 |
"return true, if this workstation supports stereo GL drawing. |
|
4434 |
Both the server must support it, and the feature must have been |
|
4435 |
enabled in the smalltalk system, for true to be returned." |
|
4436 |
||
4437 |
^ hasStereoExtension |
|
4438 |
||
4439 |
" |
|
4440 |
Display hasStereoExtension |
|
4441 |
" |
|
4442 |
! |
|
4443 |
||
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4444 |
isTrueGL |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4445 |
"return true, if this is a true GL (as opposed to a simulated VOGL)" |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4446 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4447 |
%{ /* NOCONTEXT */ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4448 |
#ifdef VGL |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4449 |
RETURN ( false ); |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4450 |
#else |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4451 |
RETURN ( true ); |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4452 |
#endif |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4453 |
%} |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4454 |
! |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4455 |
|
294 | 4456 |
maxZValue |
4457 |
"return the max. Z value (only valid if z-buffer is supported)" |
|
4458 |
%{ |
|
4459 |
#ifdef GLX |
|
4460 |
long zMax; |
|
4461 |
||
4462 |
if (_INST(glOK) == true) { |
|
4463 |
zMax = getgdesc(GD_ZMAX); |
|
4464 |
||
4465 |
if ((zMax >= _MIN_INT) && (zMax <= _MAX_INT)) { |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4466 |
RETURN ( __MKSMALLINT(zMax) ); |
294 | 4467 |
} |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4468 |
RETURN ( __MKLARGEINT(zMax) ); |
294 | 4469 |
} |
4470 |
#endif |
|
4471 |
%}. |
|
4472 |
^ nil |
|
4473 |
! |
|
4474 |
||
4475 |
supportsDoubleBuffer |
|
4476 |
"return true, if this gl workstation supports double buffering. |
|
157 | 4477 |
For portable applications, always combine this with a query |
4478 |
if the display supports GL drawing at all." |
|
24 | 4479 |
|
4480 |
%{ /* NOCONTEXT */ |
|
294 | 4481 |
|
4482 |
#ifdef GLX |
|
4483 |
if (getgdesc(GD_BITS_NORM_DBL_RED) != 0) { |
|
4484 |
RETURN ( _INST(glOK) ); |
|
4485 |
} |
|
24 | 4486 |
#endif |
89 | 4487 |
%}. |
4488 |
^ false |
|
4489 |
||
4490 |
" |
|
294 | 4491 |
Display supportsDoubleBuffer |
4492 |
" |
|
4493 |
! |
|
4494 |
||
4495 |
supportsGLDrawing |
|
4496 |
"return true, if this device supports 3D GL drawing." |
|
4497 |
||
4498 |
^ glOK |
|
4499 |
||
4500 |
" |
|
4501 |
Display supportsGLDrawing |
|
89 | 4502 |
" |
64 | 4503 |
! |
4504 |
||
4505 |
supportsLight |
|
157 | 4506 |
"return true, if this gl workstation supports light sources |
4507 |
(i.e. if its a real GL). |
|
4508 |
For portable applications, always combine this with a query |
|
4509 |
if the display supports GL drawing at all." |
|
89 | 4510 |
|
4511 |
%{ /* NOCONTEXT */ |
|
64 | 4512 |
#ifdef GLX |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4513 |
RETURN ( _INST(glOK) ); |
64 | 4514 |
#endif |
89 | 4515 |
%}. |
4516 |
^ false |
|
4517 |
||
4518 |
" |
|
4519 |
Display supportsLight |
|
4520 |
" |
|
4521 |
! |
|
4522 |
||
294 | 4523 |
supportsRGB |
4524 |
"return true, if this gl workstation supports rgb |
|
4525 |
(in addition to indexed) colors. Actually, we return true |
|
4526 |
for a real GL engine, false for the simulator here. |
|
4527 |
For portable applications, always combine this with a query |
|
4528 |
if the display supports GL drawing at all." |
|
4529 |
||
4530 |
%{ /* NOCONTEXT */ |
|
4531 |
#ifdef GLX |
|
4532 |
RETURN ( _INST(glOK) ); |
|
4533 |
#endif |
|
4534 |
%}. |
|
4535 |
^ false |
|
4536 |
||
4537 |
" |
|
4538 |
Display supportsRGB |
|
4539 |
" |
|
4540 |
! |
|
4541 |
||
89 | 4542 |
supportsTextures |
4543 |
"return true, if this gl workstation supports texture mapping |
|
157 | 4544 |
(i.e. if its a real GL). |
4545 |
For portable applications, always combine this with a query |
|
4546 |
if the display supports GL drawing at all." |
|
89 | 4547 |
|
4548 |
%{ /* NOCONTEXT */ |
|
4549 |
#ifdef GLX |
|
4550 |
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
|
4551 |
RETURN ( _INST(glOK) ); |
89 | 4552 |
} |
4553 |
#endif |
|
4554 |
%}. |
|
4555 |
^ false |
|
4556 |
||
4557 |
" |
|
4558 |
Display supportsTextures |
|
4559 |
" |
|
4560 |
! |
|
4561 |
||
4562 |
supportsZBuffer |
|
157 | 4563 |
"return true, if this gl workstation has z buffer support. |
4564 |
For portable applications, always combine this with a query |
|
4565 |
if the display supports GL drawing at all." |
|
4566 |
||
89 | 4567 |
%{ /* NOCONTEXT */ |
4568 |
||
4569 |
#ifdef GLX |
|
4570 |
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
|
4571 |
RETURN ( _INST(glOK) ); |
89 | 4572 |
} |
4573 |
#endif |
|
4574 |
%}. |
|
4575 |
^ false |
|
4576 |
||
4577 |
" |
|
4578 |
Display supportsZBuffer |
|
4579 |
" |
|
294 | 4580 |
! ! |
4581 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4582 |
!GLXWorkstation methodsFor:'rectangles'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4583 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4584 |
glxRectX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4585 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4586 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4587 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4588 |
rect(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4589 |
RETURN (true); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4590 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4591 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4592 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4593 |
glxRectfX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4594 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4595 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4596 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4597 |
rectf(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4598 |
RETURN (true); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4599 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4600 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4601 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4602 |
glxRectfiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4603 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4604 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4605 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4606 |
rectfi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4607 |
RETURN (true); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4608 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4609 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4610 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4611 |
glxRectfsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4612 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4613 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4614 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4615 |
rectfs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4616 |
RETURN (true); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4617 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4618 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4619 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4620 |
glxRectiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4621 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4622 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4623 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4624 |
recti(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4625 |
RETURN (true); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4626 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4627 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4628 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4629 |
glxRectsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4630 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4631 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4632 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4633 |
rects(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4634 |
RETURN (true); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4635 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4636 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4637 |
|
528 | 4638 |
!GLXWorkstation methodsFor:'spheres'! |
294 | 4639 |
|
4640 |
glxSphDraw:arrayOf4Floats in:aGLXWindowId |
|
4641 |
"argument must be an array(a matrix) of 4 floats containing the |
|
4642 |
sphere - in real GL only" |
|
4643 |
||
4644 |
%{ /* NOCONTEXT */ |
|
4645 |
#ifdef GLX |
|
4646 |
float vec[4], *v; |
|
4647 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4648 |
if (! (v = __glx_getFloatsFromInto(arrayOf4Floats, vec, 4))) RETURN(false); |
294 | 4649 |
SETWIN(aGLXWindowId) |
4650 |
sphdraw(v); |
|
4651 |
RETURN (true); |
|
4652 |
#endif |
|
4653 |
%} |
|
4654 |
. |
|
4655 |
^ false |
|
4656 |
! |
|
4657 |
||
4658 |
glxSphDrawX:x y:y z:z radius:r in:aGLXWindowId |
|
4659 |
"arguments must be convertable to floats - in real GL only" |
|
4660 |
||
4661 |
%{ /* NOCONTEXT */ |
|
4662 |
#ifdef GLX |
|
4663 |
float vec[4]; |
|
4664 |
||
4665 |
_FLOAT_(x, vec[0]) |
|
4666 |
_FLOAT_(y, vec[1]) |
|
4667 |
_FLOAT_(z, vec[2]) |
|
4668 |
_FLOAT_(r, vec[3]) |
|
4669 |
SETWIN(aGLXWindowId) |
|
4670 |
sphdraw(vec); |
|
4671 |
RETURN (true); |
|
4672 |
#endif |
|
4673 |
%} |
|
4674 |
. |
|
4675 |
^ false |
|
4676 |
! |
|
4677 |
||
4678 |
glxSphfreeIn: aGLXWindowId |
|
4679 |
||
4680 |
%{ /* NOCONTEXT */ |
|
4681 |
#ifdef GLX |
|
4682 |
SETWIN(aGLXWindowId) |
|
4683 |
sphfree(); |
|
4684 |
RETURN (true); |
|
4685 |
#endif |
|
4686 |
%} |
|
4687 |
. |
|
4688 |
^ false |
|
4689 |
! |
|
4690 |
||
4691 |
glxSphgnpolysIn: aGLXWindowId |
|
4692 |
||
4693 |
%{ /* NOCONTEXT */ |
|
4694 |
#ifdef GLX |
|
4695 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4696 |
RETURN (__MKSMALLINT(sphgnpolys())); |
294 | 4697 |
#endif |
4698 |
%} |
|
4699 |
. |
|
4700 |
^ false |
|
4701 |
! |
|
4702 |
||
4703 |
glxSphmode: attribute value: value in: aGLXWindowId |
|
4704 |
||
4705 |
%{ /* NOCONTEXT */ |
|
4706 |
#ifdef GLX |
|
4707 |
SETWIN(aGLXWindowId) |
|
4708 |
sphmode(__intVal(attribute), __intVal(value)); |
|
4709 |
RETURN (true); |
|
4710 |
#endif |
|
4711 |
%} |
|
4712 |
. |
|
4713 |
^ false |
|
4714 |
! |
|
4715 |
||
4716 |
glxSphobj: objid in: aGLXWindowId |
|
4717 |
||
4718 |
%{ /* NOCONTEXT */ |
|
4719 |
#ifdef GLX |
|
4720 |
SETWIN(aGLXWindowId) |
|
4721 |
sphobj(_objectVal(objid)); |
|
4722 |
RETURN (true); |
|
4723 |
#endif |
|
4724 |
%} |
|
4725 |
. |
|
4726 |
^ false |
|
4727 |
! |
|
4728 |
||
4729 |
glxSphrotmatrix: mat in: aGLXWindowId |
|
4730 |
||
4731 |
%{ /* NOCONTEXT */ |
|
4732 |
#ifdef GLX |
|
4733 |
Matrix matrix, *m; |
|
4734 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4735 |
if (! (m = __glx_getFloatsFromMatrixInto(mat, &matrix))) RETURN (false); |
294 | 4736 |
SETWIN(aGLXWindowId) |
4737 |
sphrotmatrix(*m); |
|
4738 |
RETURN (true); |
|
4739 |
#endif |
|
4740 |
%} |
|
4741 |
. |
|
4742 |
^ false |
|
4743 |
! ! |
|
4744 |
||
4745 |
!GLXWorkstation methodsFor:'stereo extension'! |
|
4746 |
||
528 | 4747 |
glxLeftbuffer: bool in: aGLXWindowId |
4748 |
||
4749 |
%{ /* NOCONTEXT */ |
|
4750 |
#ifdef FULL_GLX |
|
4751 |
SETWIN(aGLXWindowId) |
|
4752 |
leftbuffer(_booleanVal(bool)); |
|
4753 |
RETURN (true); |
|
4754 |
#endif |
|
4755 |
%} |
|
4756 |
. |
|
4757 |
^ false |
|
4758 |
! |
|
4759 |
||
4760 |
glxMonobufferIn: aGLXWindowId |
|
4761 |
||
4762 |
%{ /* NOCONTEXT */ |
|
4763 |
#ifdef FULL_GLX |
|
4764 |
SETWIN(aGLXWindowId) |
|
4765 |
monobuffer(); |
|
4766 |
RETURN (true); |
|
4767 |
#endif |
|
4768 |
%} |
|
4769 |
. |
|
4770 |
^ false |
|
4771 |
! |
|
4772 |
||
4773 |
glxRightbuffer: bool in: aGLXWindowId |
|
4774 |
||
4775 |
%{ /* NOCONTEXT */ |
|
4776 |
#ifdef FULL_GLX |
|
4777 |
SETWIN(aGLXWindowId) |
|
4778 |
rightbuffer(_booleanVal(bool)); |
|
4779 |
RETURN (true); |
|
4780 |
#endif |
|
4781 |
%} |
|
4782 |
. |
|
4783 |
^ false |
|
4784 |
! |
|
4785 |
||
294 | 4786 |
stereoExtensionBuffer:aBufferSymbol for:aWindowId |
4787 |
"set the current stereo buffer; the argument may be one of: |
|
4788 |
#left -> STEREO_BUFFER_LEFT |
|
4789 |
#right -> STEREO_BUFFER_RIGHT |
|
4790 |
" |
|
4791 |
||
4792 |
%{ /* NOCONTEXT */ |
|
4793 |
#if defined(XSGIStereo) && defined(GLX) |
|
4794 |
Status status; |
|
4795 |
int buffer; |
|
4796 |
Window win; |
|
4797 |
||
4798 |
if (ISCONNECTED |
|
4799 |
&& __isExternalAddress(aWindowId)) { |
|
4800 |
win = _WindowVal(aWindowId); |
|
4801 |
if (aBufferSymbol == @symbol(left)) { |
|
4802 |
buffer = STEREO_BUFFER_LEFT; |
|
4803 |
} else { |
|
4804 |
if (aBufferSymbol == @symbol(right)) { |
|
4805 |
buffer = STEREO_BUFFER_RIGHT; |
|
4806 |
} else { |
|
4807 |
goto bad; |
|
4808 |
} |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4809 |
} |
294 | 4810 |
status = XSGISetStereoBuffer(myDpy, win, buffer); |
4811 |
RETURN ( status ? true : false); |
|
4812 |
} |
|
4813 |
bad: ; |
|
4814 |
#endif |
|
4815 |
%}. |
|
4816 |
self primitiveFailed |
|
4817 |
||
4818 |
" |
|
4819 |
|t v| |
|
4820 |
||
4821 |
t := StandardSystemView new. |
|
4822 |
t extent:300@300. |
|
4823 |
v := GLXView origin:0.0@0.0 corner:1.0@1.0 in:t. |
|
4824 |
t openAndWait. |
|
4825 |
||
4826 |
v device stereoExtensionBuffer:#left for:(v id). |
|
4827 |
(Delay forSeconds:10) wait. |
|
4828 |
v device stereoExtensionBuffer:#right for:(v id). |
|
4829 |
" |
|
4830 |
! |
|
4831 |
||
4832 |
stereoExtensionMode:aModeSymbol height:h offset:o for:aWindowId |
|
4833 |
"set the current stereo mode; the argument may be one of: |
|
4834 |
nil/false #off -> turn it off |
|
4835 |
#bottom -> STEREO_BOTTOM |
|
4836 |
#top -> STEREO_TOP |
|
4837 |
" |
|
4838 |
||
4839 |
%{ /* NOCONTEXT */ |
|
4840 |
#if defined(XSGIStereo) && defined(GLX) |
|
4841 |
Status status; |
|
4842 |
int mode; |
|
4843 |
unsigned short us_h, us_o; |
|
4844 |
Window win; |
|
4845 |
||
4846 |
if (ISCONNECTED |
|
4847 |
&& __bothSmallInteger(h, o) |
|
4848 |
&& __isExternalAddress(aWindowId)) { |
|
4849 |
win = _WindowVal(aWindowId); |
|
4850 |
if ((aModeSymbol == nil) |
|
4851 |
|| (aModeSymbol == false) |
|
4852 |
|| (aModeSymbol == @symbol(off))) { |
|
4853 |
mode = STEREO_OFF; |
|
4854 |
} else { |
|
4855 |
if (aModeSymbol == @symbol(bottom)) { |
|
4856 |
mode = STEREO_BOTTOM; |
|
4857 |
} else { |
|
4858 |
if (aModeSymbol == @symbol(top)) { |
|
4859 |
mode = STEREO_TOP; |
|
4860 |
} else { |
|
4861 |
goto bad; |
|
4862 |
} |
|
4863 |
} |
|
4864 |
} |
|
4865 |
us_h = __intVal(h); |
|
4866 |
us_o = __intVal(o); |
|
4867 |
status = XSGISetStereoMode(myDpy, win, us_h, us_o, mode); |
|
4868 |
RETURN ( status ? true : false); |
|
4869 |
} |
|
4870 |
bad: ; |
|
4871 |
#endif |
|
4872 |
%}. |
|
4873 |
self primitiveFailed |
|
4874 |
||
4875 |
" |
|
4876 |
Display stereoExtensionMode:#top height:492 offset:532 for:(Display rootWindowId). |
|
4877 |
(Delay forSeconds:10) wait. |
|
4878 |
Display stereoExtensionMode:#off height:0 offset:0 for:(Display rootWindowId). |
|
4879 |
" |
|
4880 |
! |
|
4881 |
||
4882 |
stereoExtensionModeIn:aWindowId |
|
4883 |
"return the current stereo mode for some window" |
|
4884 |
||
4885 |
%{ /* NOCONTEXT */ |
|
4886 |
#if defined(XSGIStereo) && defined(GLX) |
|
4887 |
int mode; |
|
4888 |
Window win; |
|
4889 |
||
4890 |
if (ISCONNECTED && __isExternalAddress(aWindowId)) { |
|
4891 |
win = _WindowVal(aWindowId); |
|
4892 |
mode = XSGIQueryStereoMode(myDpy, win); |
|
4893 |
switch (mode) { |
|
4894 |
case STEREO_OFF: |
|
4895 |
RETURN ( @symbol(off) ); |
|
4896 |
case STEREO_BOTTOM: |
|
4897 |
RETURN ( @symbol(bottom) ); |
|
4898 |
case STEREO_TOP: |
|
4899 |
RETURN ( @symbol(top) ); |
|
4900 |
} |
|
4901 |
RETURN ( @symbol(unsupported) ); |
|
4902 |
} |
|
4903 |
#endif |
|
4904 |
%}. |
|
4905 |
self primitiveFailed |
|
4906 |
||
4907 |
" |
|
4908 |
|v| |
|
4909 |
||
4910 |
v := StandardSystemView new. |
|
4911 |
v extent:300@300. |
|
4912 |
v openAndWait. |
|
4913 |
v device stereoExtensionModeIn:(v id) |
|
4914 |
||
4915 |
Display stereoExtensionModeIn:Display rootWindowId |
|
4916 |
" |
|
4917 |
! |
|
4918 |
||
4919 |
stereoExtensionVersion |
|
4920 |
"return the stereo extensions version as an array consisting of |
|
4921 |
major and minor numbers." |
|
4922 |
||
4923 |
%{ /* NOCONTEXT */ |
|
4924 |
#if defined(XSGIStereo) && defined(GLX) |
|
4925 |
Status status; |
|
4926 |
Display *dpy = myDpy; |
|
4927 |
int major, minor; |
|
4928 |
||
4929 |
if (ISCONNECTED) { |
|
4930 |
status = XSGIStereoQueryVersion(myDpy, &major, &minor); |
|
4931 |
if (status == True) { |
|
4932 |
RETURN ( __ARRAY_WITH2(__MKSMALLINT(major), __MKSMALLINT(minor))); |
|
4933 |
} |
|
89 | 4934 |
} |
4935 |
#endif |
|
4936 |
%}. |
|
294 | 4937 |
self primitiveFailed |
185 | 4938 |
|
4939 |
" |
|
294 | 4940 |
Display stereoExtensionVersion |
185 | 4941 |
" |
24 | 4942 |
! ! |
4943 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4944 |
!GLXWorkstation methodsFor:'texture data transfer'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4945 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4946 |
glxT2d: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4947 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4948 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4949 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4950 |
double vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4951 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4952 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4953 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4954 |
t2d(c_v); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4955 |
RETURN (true); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4956 |
#endif |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4957 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4958 |
. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4959 |
^ false |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4960 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4961 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4962 |
glxT2f: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4963 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4964 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4965 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4966 |
float vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4967 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4968 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4969 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4970 |
t2f(c_v); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4971 |
RETURN (true); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4972 |
#endif |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4973 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4974 |
. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4975 |
^ false |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4976 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4977 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4978 |
glxT2i: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4979 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4980 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4981 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4982 |
long vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4983 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4984 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4985 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4986 |
t2i(c_v); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4987 |
RETURN (true); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4988 |
#endif |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4989 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4990 |
. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4991 |
^ false |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4992 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4993 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4994 |
glxT2s: v in: aGLXWindowId |
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 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4997 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4998 |
short vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4999 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5000 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5001 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5002 |
t2s(c_v); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5003 |
RETURN (true); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5004 |
#endif |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5005 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5006 |
. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5007 |
^ false |
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 |
glxT3d: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 FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5014 |
double vec[3], *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_getDoublesFromInto(v, vec, 3))) 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 |
t3d(c_v); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5019 |
RETURN (true); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5020 |
#endif |
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 |
^ false |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5026 |
glxT3f:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5027 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5028 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5029 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5030 |
float vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5031 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5032 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5033 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5034 |
t3f(c_v); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5035 |
RETURN (true); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5036 |
#endif |
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 |
. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5039 |
^ false |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5040 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5041 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5042 |
glxT3i:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5043 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5044 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5045 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5046 |
long vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5047 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5048 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5049 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5050 |
t3i(c_v); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5051 |
RETURN (true); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5052 |
#endif |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5053 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5054 |
. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5055 |
^ false |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5056 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5057 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5058 |
glxT3s:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5059 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5060 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5061 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5062 |
short vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5063 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5064 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5065 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5066 |
t3s(c_v); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5067 |
RETURN (true); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5068 |
#endif |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5069 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5070 |
. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5071 |
^ false |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5072 |
! |
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 |
glxT4d: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5075 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5076 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5077 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5078 |
double vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5079 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5080 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5081 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5082 |
t4d(c_v); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5083 |
RETURN (true); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5084 |
#endif |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5085 |
%} |
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 |
^ false |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5088 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5089 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5090 |
glxT4f: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5091 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5092 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5093 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5094 |
float vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5095 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5096 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5097 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5098 |
t4f(c_v); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5099 |
RETURN (true); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5100 |
#endif |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5101 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5102 |
. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5103 |
^ false |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5104 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5105 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5106 |
glxT4i: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5107 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5108 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5109 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5110 |
long vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5111 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5112 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5113 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5114 |
t4i(c_v); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5115 |
RETURN (true); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5116 |
#endif |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5117 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5118 |
. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5119 |
^ false |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5120 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5121 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5122 |
glxT4s: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5123 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5124 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5125 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5126 |
short vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5127 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5128 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5129 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5130 |
t4s(c_v); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5131 |
RETURN (true); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5132 |
#endif |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5133 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5134 |
. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5135 |
^ false |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5136 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5137 |
|
294 | 5138 |
!GLXWorkstation methodsFor:'transformations'! |
5139 |
||
5140 |
glxRotate:angle axis:axis in:aGLXWindowId |
|
5141 |
"rotate the current matrix around the axis given by the axis arg, |
|
5142 |
which must be one of the symbols: #x, #y or #z. |
|
5143 |
The angle is in degrees." |
|
5144 |
||
5145 |
%{ /* NOCONTEXT */ |
|
5146 |
||
5147 |
char c_axis; |
|
5148 |
||
5149 |
if (axis == @symbol(x)) |
|
5150 |
c_axis = 'x'; |
|
5151 |
else if (axis == @symbol(y)) |
|
5152 |
c_axis = 'y'; |
|
5153 |
else if (axis == @symbol(z)) |
|
5154 |
c_axis = 'z'; |
|
5155 |
else { |
|
5156 |
RETURN (false); |
|
5157 |
} |
|
5158 |
||
5159 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5160 |
RETURN ( __glx_doRotate(angle, c_axis) ); |
294 | 5161 |
%} |
5162 |
! |
|
5163 |
||
5164 |
glxRotate:arrayOf3Floats in:aGLXWindowId |
|
5165 |
"rotate current matrix, given a 3-element vector (or more). |
|
5166 |
The elements of the array are degrees." |
|
5167 |
||
5168 |
%{ /* NOCONTEXT */ |
|
5169 |
||
5170 |
float vec[3], *v; |
|
5171 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5172 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5173 |
|
5174 |
SETWIN(aGLXWindowId) |
|
5175 |
rot(v[0], 'x'); |
|
5176 |
rot(v[1], 'y'); |
|
5177 |
rot(v[2], 'z'); |
|
5178 |
RETURN (true); |
|
5179 |
%} |
|
5180 |
! |
|
5181 |
||
5182 |
glxRotateI:angle axis:axis in:aGLXWindowId |
|
5183 |
"rotate the current matrix around the axis given by the axis arg, |
|
5184 |
which must be one of the symbols: #x, #y or #z. |
|
5185 |
The angle is an integer specifying tenths of a degree." |
|
5186 |
||
5187 |
%{ /* NOCONTEXT */ |
|
5188 |
||
5189 |
char c_axis; |
|
5190 |
||
5191 |
if (axis == @symbol(x)) |
|
5192 |
c_axis = 'x'; |
|
5193 |
else if (axis == @symbol(y)) |
|
5194 |
c_axis = 'y'; |
|
5195 |
else if (axis == @symbol(z)) |
|
5196 |
c_axis = 'z'; |
|
5197 |
else { |
|
5198 |
RETURN (false); |
|
5199 |
} |
|
5200 |
||
5201 |
if (__isSmallInteger(angle)) { |
|
5202 |
SETWIN(aGLXWindowId) |
|
5203 |
rotate(__intVal(angle), c_axis); |
|
5204 |
RETURN (true); |
|
5205 |
} |
|
5206 |
%} |
|
5207 |
. |
|
5208 |
^ false |
|
5209 |
! |
|
5210 |
||
5211 |
glxRotateIX:angle in:aGLXWindowId |
|
5212 |
"rotate the current matrix on x axis. |
|
5213 |
The angle is an integer specifying tenths of a degree." |
|
5214 |
||
5215 |
%{ /* NOCONTEXT */ |
|
5216 |
||
5217 |
if (__isSmallInteger(angle)) { |
|
5218 |
SETWIN(aGLXWindowId) |
|
5219 |
rotate(__intVal(angle), 'x'); |
|
5220 |
RETURN (true); |
|
5221 |
} |
|
5222 |
%} |
|
5223 |
. |
|
5224 |
^ false |
|
5225 |
! |
|
5226 |
||
5227 |
glxRotateIX:xAngle y:yAngle z:zAngle in:aGLXWindowId |
|
5228 |
"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
|
5229 |
The values are smallIntegers specifying tenths of a degree." |
294 | 5230 |
|
5231 |
%{ /* NOCONTEXT */ |
|
5232 |
||
5233 |
if (__bothSmallInteger(xAngle, yAngle) |
|
5234 |
&& __isSmallInteger(zAngle)) { |
|
5235 |
SETWIN(aGLXWindowId) |
|
5236 |
rotate(__intVal(xAngle), 'x'); |
|
5237 |
rotate(__intVal(yAngle), 'y'); |
|
5238 |
rotate(__intVal(zAngle), 'z'); |
|
5239 |
RETURN (true); |
|
5240 |
} |
|
5241 |
%} |
|
5242 |
. |
|
5243 |
^ false |
|
5244 |
! |
|
5245 |
||
5246 |
glxRotateIY:angle in:aGLXWindowId |
|
5247 |
"rotate the current matrix on x axis. |
|
5248 |
The angle is an integer specifying tenths of a degree." |
|
5249 |
||
5250 |
%{ /* NOCONTEXT */ |
|
5251 |
||
5252 |
if (__isSmallInteger(angle)) { |
|
5253 |
SETWIN(aGLXWindowId) |
|
5254 |
rotate(__intVal(angle), 'y'); |
|
5255 |
RETURN (true); |
|
5256 |
} |
|
5257 |
%} |
|
5258 |
. |
|
5259 |
^ false |
|
5260 |
! |
|
5261 |
||
5262 |
glxRotateIZ:angle in:aGLXWindowId |
|
5263 |
"rotate the current matrix on x axis. |
|
5264 |
The angle is an integer specifying tenths of a degree." |
|
5265 |
||
5266 |
%{ /* NOCONTEXT */ |
|
5267 |
||
5268 |
if (__isSmallInteger(angle)) { |
|
5269 |
SETWIN(aGLXWindowId) |
|
5270 |
rotate(__intVal(angle), 'z'); |
|
5271 |
RETURN (true); |
|
5272 |
} |
|
5273 |
%} |
|
5274 |
. |
|
5275 |
^ false |
|
5276 |
! |
|
5277 |
||
5278 |
glxRotateX:angle in:aGLXWindowId |
|
5279 |
"rotate the current matrix on x axis. |
|
5280 |
The angle is in degrees." |
|
5281 |
||
5282 |
%{ /* NOCONTEXT */ |
|
5283 |
||
5284 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5285 |
RETURN (__glx_doRotate(angle, 'x')); |
294 | 5286 |
%} |
5287 |
! |
|
5288 |
||
5289 |
glxRotateX:xAngle y:yAngle z:zAngle in:aGLXWindowId |
|
5290 |
"rotate the current matrix on all axes, given individual x, y and z values. |
|
5291 |
The values are in degrees" |
|
5292 |
||
5293 |
%{ /* NOCONTEXT */ |
|
5294 |
||
5295 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5296 |
if ( __glx_doRotate(xAngle, 'x') == true) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5297 |
if ( __glx_doRotate(yAngle, 'y') == true) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5298 |
RETURN (__glx_doRotate(zAngle, 'z')); |
294 | 5299 |
} |
5300 |
} |
|
5301 |
%} |
|
5302 |
. |
|
5303 |
^ false |
|
5304 |
! |
|
5305 |
||
5306 |
glxRotateY:angle in:aGLXWindowId |
|
5307 |
"rotate the current matrix on y axis. |
|
5308 |
The angle is in degrees." |
|
5309 |
||
5310 |
%{ /* NOCONTEXT */ |
|
5311 |
||
5312 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5313 |
RETURN (__glx_doRotate(angle, 'y')); |
294 | 5314 |
%} |
5315 |
! |
|
5316 |
||
5317 |
glxRotateZ:angle in:aGLXWindowId |
|
5318 |
"rotate the current matrix on z axis. |
|
5319 |
The angle is in degrees." |
|
5320 |
||
5321 |
%{ /* NOCONTEXT */ |
|
5322 |
||
5323 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5324 |
RETURN (__glx_doRotate(angle, 'z')); |
294 | 5325 |
%} |
5326 |
! |
|
5327 |
||
5328 |
glxScale:arrayOf3Floats in:aGLXWindowId |
|
5329 |
"scale current matrix, given a 3-element vector" |
|
5330 |
||
5331 |
%{ /* NOCONTEXT */ |
|
5332 |
||
5333 |
float vec[3], *v; |
|
5334 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5335 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5336 |
|
5337 |
SETWIN(aGLXWindowId) |
|
5338 |
scale(v[0], v[1], v[2]); |
|
5339 |
RETURN (true); |
|
5340 |
%} |
|
5341 |
! |
|
5342 |
||
5343 |
glxScaleX:x in:aGLXWindowId |
|
5344 |
"scale in x direction" |
|
5345 |
||
5346 |
%{ /* NOCONTEXT */ |
|
5347 |
||
5348 |
float f_x; |
|
5349 |
||
5350 |
_FLOAT_ (x, f_x) |
|
5351 |
SETWIN(aGLXWindowId) |
|
5352 |
scale(f_x, (float)0, (float)0); |
|
5353 |
RETURN (true); |
|
5354 |
%} |
|
5355 |
! |
|
5356 |
||
5357 |
glxScaleX:x y:y z:z in:aGLXWindowId |
|
5358 |
"scale & mirror current matrix, given individual x, y and z values" |
|
5359 |
||
5360 |
%{ /* NOCONTEXT */ |
|
5361 |
||
5362 |
float f_x, f_y, f_z; |
|
5363 |
||
5364 |
_FLOAT_ (x, f_x) |
|
5365 |
_FLOAT_ (y, f_y) |
|
5366 |
_FLOAT_ (z, f_z) |
|
5367 |
SETWIN(aGLXWindowId) |
|
5368 |
scale(f_x, f_y, f_z); |
|
5369 |
RETURN (true); |
|
5370 |
%} |
|
5371 |
! |
|
5372 |
||
5373 |
glxScaleY:y in:aGLXWindowId |
|
5374 |
"scale in y direction" |
|
5375 |
||
5376 |
%{ /* NOCONTEXT */ |
|
5377 |
||
5378 |
float f_y; |
|
5379 |
||
5380 |
_FLOAT_ (y, f_y) |
|
5381 |
SETWIN(aGLXWindowId) |
|
5382 |
scale((float)0, f_y, (float)0); |
|
5383 |
RETURN (true); |
|
5384 |
%} |
|
5385 |
! |
|
5386 |
||
5387 |
glxScaleZ:z in:aGLXWindowId |
|
5388 |
"scale in z direction" |
|
5389 |
||
5390 |
%{ /* NOCONTEXT */ |
|
5391 |
||
5392 |
float f_z; |
|
5393 |
||
5394 |
_FLOAT_ (z, f_z) |
|
5395 |
SETWIN(aGLXWindowId) |
|
5396 |
scale((float)0, (float)0, f_z); |
|
5397 |
RETURN (true); |
|
5398 |
%} |
|
5399 |
! |
|
5400 |
||
5401 |
glxTranslate:arrayOf3Floats in:aGLXWindowId |
|
5402 |
"translate current matrix, given a 3-element vector" |
|
5403 |
||
5404 |
%{ /* NOCONTEXT */ |
|
5405 |
||
5406 |
float vec[3], *v; |
|
5407 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5408 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5409 |
|
5410 |
SETWIN(aGLXWindowId) |
|
5411 |
translate((Coord)(v[0]), (Coord)(v[1]), (Coord)(v[2])); |
|
5412 |
RETURN (true); |
|
5413 |
%} |
|
5414 |
! |
|
5415 |
||
5416 |
glxTranslateX:x in:aGLXWindowId |
|
5417 |
"translate current matrix on X axis" |
|
5418 |
||
5419 |
%{ /* NOCONTEXT */ |
|
5420 |
||
5421 |
Coord c_x; |
|
5422 |
||
5423 |
_COORD_ (x, c_x) |
|
5424 |
SETWIN(aGLXWindowId) |
|
5425 |
translate(c_x, (Coord)0, (Coord)0); |
|
5426 |
RETURN (true); |
|
5427 |
%} |
|
5428 |
! |
|
5429 |
||
5430 |
glxTranslateX:x y:y z:z in:aGLXWindowId |
|
5431 |
"translate current matrix, given individual x, y and z values" |
|
5432 |
||
5433 |
%{ /* NOCONTEXT */ |
|
5434 |
||
5435 |
Coord c_x, c_y, c_z; |
|
5436 |
||
5437 |
_COORD_ (x, c_x) |
|
5438 |
_COORD_ (y, c_y) |
|
5439 |
_COORD_ (z, c_z) |
|
5440 |
SETWIN(aGLXWindowId) |
|
5441 |
translate(c_x, c_y, c_z); |
|
5442 |
RETURN (true); |
|
5443 |
%} |
|
5444 |
! |
|
5445 |
||
5446 |
glxTranslateY:y in:aGLXWindowId |
|
5447 |
"translate current matrix on Y axis" |
|
5448 |
||
5449 |
%{ /* NOCONTEXT */ |
|
5450 |
||
5451 |
Coord c_y; |
|
5452 |
||
5453 |
_COORD_ (y, c_y) |
|
5454 |
SETWIN(aGLXWindowId) |
|
5455 |
translate((Coord)0, c_y, (Coord)0); |
|
5456 |
RETURN (true); |
|
5457 |
%} |
|
5458 |
! |
|
5459 |
||
5460 |
glxTranslateZ:z in:aGLXWindowId |
|
5461 |
"translate current matrix on Z axis" |
|
5462 |
||
5463 |
%{ /* NOCONTEXT */ |
|
5464 |
||
5465 |
Coord c_z; |
|
5466 |
||
5467 |
_COORD_ (z, c_z) |
|
5468 |
SETWIN(aGLXWindowId) |
|
5469 |
translate((Coord)0, (Coord)0, c_z); |
|
5470 |
RETURN (true); |
|
5471 |
%} |
|
5472 |
! ! |
|
5473 |
||
5474 |
!GLXWorkstation methodsFor:'unspecified rest'! |
|
5475 |
||
5476 |
glxAcbufOp:op value:value in:aGLXWindowId |
|
5477 |
||
5478 |
%{ /* NOCONTEXT */ |
|
5479 |
#ifdef GLX |
|
5480 |
SETWIN(aGLXWindowId) |
|
5481 |
acbuf(__intVal(op), _floatVal(value)); |
|
5482 |
RETURN (true); |
|
5483 |
#endif |
|
5484 |
%} |
|
5485 |
. |
|
5486 |
^ false |
|
5487 |
! |
|
5488 |
||
5489 |
glxAcsizePlanes: planes in: aGLXWindowId |
|
5490 |
||
5491 |
%{ /* NOCONTEXT */ |
|
5492 |
#ifdef GLX |
|
5493 |
SETWIN(aGLXWindowId) |
|
5494 |
acsize(__intVal(planes)); |
|
5495 |
RETURN (true); |
|
5496 |
#endif |
|
5497 |
%} |
|
5498 |
. |
|
5499 |
^ false |
|
5500 |
! |
|
5501 |
||
5502 |
glxAfunctionRef: ref func: func in: aGLXWindowId |
|
5503 |
||
5504 |
%{ /* NOCONTEXT */ |
|
5505 |
#ifdef GLX |
|
5506 |
SETWIN(aGLXWindowId) |
|
5507 |
afunction(__intVal(ref), __intVal(func)); |
|
5508 |
RETURN (true); |
|
5509 |
#endif |
|
5510 |
%} |
|
5511 |
. |
|
5512 |
^ false |
|
5513 |
! |
|
5514 |
||
5515 |
glxBbox2Xmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5516 |
||
5517 |
%{ /* NOCONTEXT */ |
|
5518 |
#ifdef GLX |
|
5519 |
Screencoord c_xmin, c_ymin; |
|
5520 |
Coord c_x1, c_y1, c_x2, c_y2; |
|
5521 |
||
5522 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5523 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5524 |
_COORD_ (x1, c_x1) |
|
5525 |
_COORD_ (y1, c_y1) |
|
5526 |
_COORD_ (x2, c_x2) |
|
5527 |
_COORD_ (y2, c_y2) |
|
5528 |
SETWIN(aGLXWindowId) |
|
5529 |
bbox2(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
|
5530 |
RETURN (true); |
|
5531 |
#endif |
|
5532 |
%} |
|
5533 |
. |
|
5534 |
^ false |
|
5535 |
! |
|
5536 |
||
5537 |
glxBbox2iXmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5538 |
||
5539 |
%{ /* NOCONTEXT */ |
|
5540 |
#ifdef GLX |
|
5541 |
Screencoord c_xmin, c_ymin; |
|
5542 |
Icoord c_x1, c_y1, c_x2, c_y2; |
|
5543 |
||
5544 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5545 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5546 |
_ICOORD_ (x1, c_x1) |
|
5547 |
_ICOORD_ (y1, c_y1) |
|
5548 |
_ICOORD_ (x2, c_x2) |
|
5549 |
_ICOORD_ (y2, c_y2) |
|
5550 |
SETWIN(aGLXWindowId) |
|
5551 |
bbox2i(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
|
5552 |
RETURN (true); |
|
5553 |
#endif |
|
5554 |
%} |
|
5555 |
. |
|
5556 |
^ false |
|
5557 |
! |
|
5558 |
||
5559 |
glxBbox2sXmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5560 |
||
5561 |
%{ /* NOCONTEXT */ |
|
5562 |
#ifdef GLX |
|
5563 |
Screencoord c_xmin, c_ymin; |
|
5564 |
Scoord c_x1, c_y1, c_x2, c_y2; |
|
5565 |
||
5566 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5567 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5568 |
_SCOORD_ (x1, c_x1) |
|
5569 |
_SCOORD_ (y1, c_y1) |
|
5570 |
_SCOORD_ (x2, c_x2) |
|
5571 |
_SCOORD_ (y2, c_y2) |
|
5572 |
SETWIN(aGLXWindowId) |
|
5573 |
bbox2s(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
|
5574 |
RETURN (true); |
|
5575 |
#endif |
|
5576 |
%} |
|
5577 |
. |
|
5578 |
^ false |
|
5579 |
! |
|
5580 |
||
5581 |
glxBeginTrimIn: aGLXWindowId |
|
5582 |
||
5583 |
%{ /* NOCONTEXT */ |
|
5584 |
#ifdef GLX |
|
5585 |
SETWIN(aGLXWindowId) |
|
5586 |
bgntrim(); |
|
5587 |
RETURN (true); |
|
5588 |
#endif |
|
5589 |
%} |
|
5590 |
. |
|
5591 |
^ false |
|
5592 |
! |
|
5593 |
||
5594 |
glxBlankscreen: b in: aGLXWindowId |
|
5595 |
||
5596 |
%{ /* NOCONTEXT */ |
|
5597 |
#ifdef GLX |
|
5598 |
SETWIN(aGLXWindowId) |
|
5599 |
blankscreen(_booleanVal(b)); |
|
5600 |
RETURN (true); |
|
5601 |
#endif |
|
5602 |
%} |
|
5603 |
. |
|
5604 |
^ false |
|
5605 |
! |
|
5606 |
||
5607 |
glxBlanktime: count in: aGLXWindowId |
|
5608 |
||
5609 |
%{ /* NOCONTEXT */ |
|
5610 |
#ifdef GLX |
|
5611 |
SETWIN(aGLXWindowId) |
|
5612 |
blanktime(__intVal(count)); |
|
5613 |
RETURN (true); |
|
5614 |
#endif |
|
5615 |
%} |
|
5616 |
. |
|
5617 |
^ false |
|
5618 |
! |
|
5619 |
||
5620 |
glxBlendcolorRed: red green: green blue: blue alpha: alpha in: aGLXWindowId |
|
5621 |
||
5622 |
%{ /* NOCONTEXT */ |
|
5623 |
#ifdef FULL_GLX |
|
5624 |
SETWIN(aGLXWindowId) |
|
5625 |
blendcolor(_floatVal(red), _floatVal(green), _floatVal(blue), _floatVal(alpha)); |
|
5626 |
RETURN (true); |
|
5627 |
#endif |
|
5628 |
%} |
|
5629 |
. |
|
5630 |
^ false |
|
5631 |
! |
|
5632 |
||
5633 |
glxBlendfunctionSfactr: sfactr dfactr: dfactr in: aGLXWindowId |
|
5634 |
||
5635 |
%{ /* NOCONTEXT */ |
|
5636 |
#ifdef GLX |
|
5637 |
SETWIN(aGLXWindowId) |
|
5638 |
blendfunction(__intVal(sfactr), __intVal(dfactr)); |
|
5639 |
RETURN (true); |
|
5640 |
#endif |
|
5641 |
%} |
|
5642 |
. |
|
5643 |
^ false |
|
5644 |
! |
|
5645 |
||
5646 |
glxBlinkRate: rate i: i red: red green: green blue: blue in: aGLXWindowId |
|
5647 |
||
5648 |
%{ /* NOCONTEXT */ |
|
5649 |
#ifdef GLX |
|
5650 |
SETWIN(aGLXWindowId) |
|
5651 |
blink(_shortVal(rate), _colorindexVal(i), |
|
5652 |
_shortVal(red), _shortVal(green), _shortVal(blue)); |
|
5653 |
RETURN (true); |
|
5654 |
#endif |
|
5655 |
%} |
|
5656 |
. |
|
5657 |
^ false |
|
5658 |
! |
|
5659 |
||
5660 |
glxBlkqreadData: data n: n in: aGLXWindowId |
|
5661 |
||
5662 |
%{ /* NOCONTEXT */ |
|
5663 |
#ifdef GLX |
|
5664 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
5665 |
RETURN (__MKSMALLINT(blkqread((short *)_indexedArea(data), __intVal(n)))); |
294 | 5666 |
#endif |
5667 |
%} |
|
5668 |
. |
|
5669 |
^ false |
|
5670 |
! |
|
5671 |
||
5672 |
glxC3f: v in: aGLXWindowId |
|
5673 |
||
5674 |
%{ /* NOCONTEXT */ |
|
5675 |
#ifdef GLX |
|
5676 |
float vec[3], *c_v; |
|
5677 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5678 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
294 | 5679 |
SETWIN(aGLXWindowId) |
5680 |
c3f(c_v); |
|
5681 |
RETURN (true); |
|
5682 |
#endif |
|
5683 |
%} |
|
5684 |
. |
|
5685 |
^ false |
|
5686 |
! |
|
5687 |
||
5688 |
glxC3i: v in: aGLXWindowId |
|
5689 |
||
5690 |
%{ /* NOCONTEXT */ |
|
5691 |
#ifdef GLX |
|
5692 |
long vec[3], *c_v; |
|
5693 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5694 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
294 | 5695 |
SETWIN(aGLXWindowId) |
5696 |
c3i(c_v); |
|
5697 |
RETURN (true); |
|
5698 |
#endif |
|
5699 |
%} |
|
5700 |
. |
|
5701 |
^ false |
|
5702 |
! |
|
5703 |
||
5704 |
glxC3s: v in: aGLXWindowId |
|
5705 |
||
5706 |
%{ /* NOCONTEXT */ |
|
5707 |
#ifdef GLX |
|
5708 |
short vec[3], *c_v; |
|
5709 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5710 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
294 | 5711 |
SETWIN(aGLXWindowId) |
5712 |
c3s(c_v); |
|
5713 |
RETURN (true); |
|
5714 |
#endif |
|
5715 |
%} |
|
5716 |
. |
|
5717 |
^ false |
|
5718 |
! |
|
5719 |
||
5720 |
glxC4f: v in: aGLXWindowId |
|
5721 |
||
5722 |
%{ /* NOCONTEXT */ |
|
5723 |
#ifdef GLX |
|
5724 |
float vec[4], *c_v; |
|
5725 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5726 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
294 | 5727 |
SETWIN(aGLXWindowId) |
5728 |
c4f(c_v); |
|
5729 |
RETURN (true); |
|
5730 |
#endif |
|
5731 |
%} |
|
5732 |
. |
|
5733 |
^ false |
|
5734 |
! |
|
5735 |
||
5736 |
glxC4i: v in: aGLXWindowId |
|
5737 |
||
5738 |
%{ /* NOCONTEXT */ |
|
5739 |
#ifdef GLX |
|
5740 |
long vec[4], *c_v; |
|
5741 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5742 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
294 | 5743 |
SETWIN(aGLXWindowId) |
5744 |
c4i(c_v); |
|
5745 |
RETURN (true); |
|
5746 |
#endif |
|
5747 |
%} |
|
5748 |
. |
|
5749 |
^ false |
|
5750 |
! |
|
5751 |
||
5752 |
glxC4s: v in: aGLXWindowId |
|
5753 |
||
5754 |
%{ /* NOCONTEXT */ |
|
5755 |
#ifdef GLX |
|
5756 |
short vec[4], *c_v; |
|
5757 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5758 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
294 | 5759 |
SETWIN(aGLXWindowId) |
5760 |
c4s(c_v); |
|
5761 |
RETURN (true); |
|
5762 |
#endif |
|
5763 |
%} |
|
5764 |
. |
|
5765 |
^ false |
|
5766 |
! |
|
5767 |
||
5768 |
glxClearhitcodeIn: aGLXWindowId |
|
5769 |
||
5770 |
%{ /* NOCONTEXT */ |
|
5771 |
#ifdef GLX |
|
5772 |
SETWIN(aGLXWindowId) |
|
5773 |
clearhitcode(); |
|
5774 |
RETURN (true); |
|
5775 |
#endif |
|
5776 |
%} |
|
5777 |
. |
|
5778 |
^ false |
|
5779 |
! |
|
5780 |
||
5781 |
glxClipplaneIndex: index mode: mode params: params in: aGLXWindowId |
|
5782 |
||
5783 |
%{ /* NOCONTEXT */ |
|
5784 |
#ifdef GLX |
|
5785 |
float vec[4], *v; |
|
5786 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5787 |
if (! (v = __glx_getFloatsFromInto(params, vec, 4))) RETURN(false); |
294 | 5788 |
SETWIN(aGLXWindowId) |
5789 |
clipplane(__intVal(index), __intVal(mode), v); |
|
5790 |
RETURN (true); |
|
5791 |
#endif |
|
5792 |
%} |
|
5793 |
. |
|
5794 |
^ false |
|
5795 |
! |
|
5796 |
||
5797 |
glxCmodeIn: aGLXWindowId |
|
5798 |
||
5799 |
%{ /* NOCONTEXT */ |
|
5800 |
#ifdef GLX |
|
5801 |
SETWIN(aGLXWindowId) |
|
5802 |
cmode(); |
|
5803 |
RETURN (true); |
|
5804 |
#endif |
|
5805 |
%} |
|
5806 |
. |
|
5807 |
^ false |
|
5808 |
! |
|
5809 |
||
5810 |
glxColorfIndex: index in: aGLXWindowId |
|
5811 |
||
5812 |
^self glxColor: index in: aGLXWindowId |
|
5813 |
! |
|
5814 |
||
5815 |
glxCuroriginN: n xorigin: xorigin yorigin: yorigin in: aGLXWindowId |
|
5816 |
||
5817 |
%{ /* NOCONTEXT */ |
|
5818 |
#ifdef GLX |
|
5819 |
SETWIN(aGLXWindowId) |
|
5820 |
curorigin(_shortVal(n), _shortVal(xorigin), _shortVal(yorigin)); |
|
5821 |
RETURN (true); |
|
5822 |
#endif |
|
5823 |
%} |
|
5824 |
. |
|
5825 |
^ false |
|
5826 |
! |
|
5827 |
||
5828 |
glxCursoffIn: aGLXWindowId |
|
5829 |
||
5830 |
%{ /* NOCONTEXT */ |
|
5831 |
#ifdef GLX |
|
5832 |
SETWIN(aGLXWindowId) |
|
5833 |
cursoff(); |
|
5834 |
RETURN (true); |
|
5835 |
#endif |
|
5836 |
%} |
|
5837 |
. |
|
5838 |
^ false |
|
5839 |
! |
|
5840 |
||
5841 |
glxCursonIn: aGLXWindowId |
|
5842 |
||
5843 |
%{ /* NOCONTEXT */ |
|
5844 |
#ifdef GLX |
|
5845 |
SETWIN(aGLXWindowId) |
|
5846 |
curson(); |
|
5847 |
RETURN (true); |
|
5848 |
#endif |
|
5849 |
%} |
|
5850 |
. |
|
5851 |
^ false |
|
5852 |
! |
|
5853 |
||
5854 |
glxCurstype: type in: aGLXWindowId |
|
5855 |
||
5856 |
%{ /* NOCONTEXT */ |
|
5857 |
#ifdef GLX |
|
5858 |
SETWIN(aGLXWindowId) |
|
5859 |
curstype(__intVal(type)); |
|
5860 |
RETURN (true); |
|
5861 |
#endif |
|
5862 |
%} |
|
5863 |
. |
|
5864 |
^ false |
|
5865 |
! |
|
5866 |
||
5867 |
glxCyclemapDuration: duration map: map nxtmap: nxtmap in: aGLXWindowId |
|
5868 |
||
5869 |
%{ /* NOCONTEXT */ |
|
5870 |
#ifdef GLX |
|
5871 |
SETWIN(aGLXWindowId) |
|
5872 |
cyclemap(_shortVal(duration), _shortVal(map), _shortVal(nxtmap)); |
|
5873 |
RETURN (true); |
|
5874 |
#endif |
|
5875 |
%} |
|
5876 |
. |
|
5877 |
^ false |
|
5878 |
! |
|
5879 |
||
5880 |
glxDefpatternN: n size: size mask: mask in: aGLXWindowId |
|
5881 |
||
5882 |
%{ /* NOCONTEXT */ |
|
5883 |
#ifdef GLX |
|
5884 |
SETWIN(aGLXWindowId) |
|
5885 |
defpattern(_shortVal(n), _shortVal(size), (unsigned short *)_indexedArea(mask)); |
|
5886 |
RETURN (true); |
|
5887 |
#endif |
|
5888 |
%} |
|
5889 |
. |
|
5890 |
^ false |
|
5891 |
! |
|
5892 |
||
5893 |
glxDeltag: t in: aGLXWindowId |
|
5894 |
||
5895 |
%{ /* NOCONTEXT */ |
|
5896 |
#ifdef GLX |
|
5897 |
SETWIN(aGLXWindowId) |
|
5898 |
deltag(_tagVal(t)); |
|
5899 |
RETURN (true); |
|
5900 |
#endif |
|
5901 |
%} |
|
5902 |
. |
|
5903 |
^ false |
|
5904 |
! |
|
5905 |
||
5906 |
glxDepthcueMode: mode in: aGLXWindowId |
|
5907 |
||
5908 |
%{ /* NOCONTEXT */ |
|
5909 |
#ifdef GLX |
|
5910 |
SETWIN(aGLXWindowId) |
|
5911 |
depthcue(_booleanVal(mode)); |
|
5912 |
RETURN (true); |
|
5913 |
#endif |
|
5914 |
%} |
|
5915 |
. |
|
5916 |
^ false |
|
5917 |
! |
|
5918 |
||
5919 |
glxDitherMode: mode in: aGLXWindowId |
|
5920 |
||
5921 |
%{ /* NOCONTEXT */ |
|
5922 |
#ifdef GLX |
|
5923 |
SETWIN(aGLXWindowId) |
|
5924 |
dither(_longVal(mode)); |
|
5925 |
RETURN (true); |
|
5926 |
#endif |
|
5927 |
%} |
|
5928 |
. |
|
5929 |
^ false |
|
5930 |
! |
|
5931 |
||
5932 |
glxDopup: pup in: aGLXWindowId |
|
5933 |
||
5934 |
%{ /* NOCONTEXT */ |
|
5935 |
#ifdef GLX |
|
5936 |
SETWIN(aGLXWindowId) |
|
5937 |
dopup(_longVal(pup)); |
|
5938 |
RETURN (true); |
|
5939 |
#endif |
|
5940 |
%} |
|
5941 |
. |
|
5942 |
^ false |
|
5943 |
! |
|
5944 |
||
5945 |
glxDrawmode: mode in: aGLXWindowId |
|
5946 |
||
5947 |
%{ /* NOCONTEXT */ |
|
5948 |
#ifdef GLX |
|
5949 |
SETWIN(aGLXWindowId) |
|
5950 |
drawmode(_longVal(mode)); |
|
5951 |
RETURN (true); |
|
5952 |
#endif |
|
5953 |
%} |
|
5954 |
. |
|
5955 |
^ false |
|
5956 |
! |
|
5957 |
||
5958 |
glxEditobj: obj in: aGLXWindowId |
|
5959 |
||
5960 |
%{ /* NOCONTEXT */ |
|
5961 |
#ifdef GLX |
|
5962 |
SETWIN(aGLXWindowId) |
|
5963 |
editobj(_objectVal(obj)); |
|
5964 |
RETURN (true); |
|
5965 |
#endif |
|
5966 |
%} |
|
5967 |
. |
|
5968 |
^ false |
|
5969 |
! |
|
5970 |
||
5971 |
glxEndTrimIn: aGLXWindowId |
|
5972 |
||
5973 |
%{ /* NOCONTEXT */ |
|
5974 |
#ifdef GLX |
|
5975 |
SETWIN(aGLXWindowId) |
|
5976 |
endtrim(); |
|
5977 |
RETURN (true); |
|
5978 |
#endif |
|
5979 |
%} |
|
5980 |
. |
|
5981 |
^ false |
|
5982 |
! |
|
5983 |
||
5984 |
glxEndfullscrnIn: aGLXWindowId |
|
5985 |
||
5986 |
%{ /* NOCONTEXT */ |
|
5987 |
#ifdef GLX |
|
5988 |
SETWIN(aGLXWindowId) |
|
5989 |
endfullscrn(); |
|
5990 |
RETURN (true); |
|
5991 |
#endif |
|
5992 |
%} |
|
5993 |
. |
|
5994 |
^ false |
|
5995 |
! |
|
5996 |
||
5997 |
glxEndpupmodeIn: aGLXWindowId |
|
5998 |
||
5999 |
%{ /* NOCONTEXT */ |
|
6000 |
#ifdef GLX |
|
6001 |
SETWIN(aGLXWindowId) |
|
6002 |
endpupmode(); |
|
6003 |
RETURN (true); |
|
6004 |
#endif |
|
6005 |
%} |
|
6006 |
. |
|
6007 |
^ false |
|
6008 |
! |
|
6009 |
||
6010 |
glxFinishIn: aGLXWindowId |
|
6011 |
||
6012 |
%{ /* NOCONTEXT */ |
|
6013 |
#ifdef GLX |
|
6014 |
SETWIN(aGLXWindowId) |
|
6015 |
finish(); |
|
6016 |
RETURN (true); |
|
6017 |
#endif |
|
6018 |
%} |
|
6019 |
. |
|
6020 |
^ false |
|
6021 |
! |
|
6022 |
||
6023 |
glxFont: fntnum in: aGLXWindowId |
|
6024 |
||
6025 |
%{ /* NOCONTEXT */ |
|
6026 |
SETWIN(aGLXWindowId) |
|
6027 |
font(_shortVal(fntnum)); |
|
6028 |
RETURN (true); |
|
6029 |
%} |
|
6030 |
! |
|
6031 |
||
6032 |
glxForegroundIn: aGLXWindowId |
|
6033 |
||
6034 |
%{ /* NOCONTEXT */ |
|
6035 |
SETWIN(aGLXWindowId) |
|
6036 |
foreground(); |
|
6037 |
RETURN (true); |
|
6038 |
%} |
|
6039 |
! |
|
6040 |
||
6041 |
glxFreepup: pup in: aGLXWindowId |
|
6042 |
||
6043 |
%{ /* NOCONTEXT */ |
|
6044 |
#ifdef GLX |
|
6045 |
SETWIN(aGLXWindowId) |
|
6046 |
freepup(_longVal(pup)); |
|
6047 |
RETURN (true); |
|
6048 |
#endif |
|
6049 |
%} |
|
6050 |
. |
|
6051 |
^ false |
|
6052 |
! |
|
6053 |
||
6054 |
glxFudgeXfudge: xfudge yfudge: yfudge in: aGLXWindowId |
|
6055 |
||
6056 |
%{ /* NOCONTEXT */ |
|
6057 |
#ifdef GLX |
|
6058 |
SETWIN(aGLXWindowId) |
|
6059 |
fudge(_longVal(xfudge), _longVal(yfudge)); |
|
6060 |
RETURN (true); |
|
6061 |
#endif |
|
6062 |
%} |
|
6063 |
. |
|
6064 |
^ false |
|
6065 |
! |
|
6066 |
||
6067 |
glxFullscrnIn: aGLXWindowId |
|
6068 |
||
6069 |
%{ /* NOCONTEXT */ |
|
6070 |
#ifdef GLX |
|
6071 |
SETWIN(aGLXWindowId) |
|
6072 |
fullscrn(); |
|
6073 |
RETURN (true); |
|
6074 |
#endif |
|
6075 |
%} |
|
6076 |
. |
|
6077 |
^ false |
|
6078 |
! |
|
6079 |
||
6080 |
glxGbeginIn: aGLXWindowId |
|
6081 |
||
6082 |
%{ /* NOCONTEXT */ |
|
6083 |
#ifdef GLX |
|
6084 |
SETWIN(aGLXWindowId) |
|
6085 |
gbegin(); |
|
6086 |
RETURN (true); |
|
6087 |
#endif |
|
6088 |
%} |
|
6089 |
. |
|
6090 |
^ false |
|
6091 |
! |
|
6092 |
||
6093 |
glxGentagIn: aGLXWindowId |
|
6094 |
||
6095 |
%{ /* NOCONTEXT */ |
|
6096 |
#ifdef GLX |
|
6097 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6098 |
RETURN (__MKSMALLINT(gentag())); |
294 | 6099 |
#endif |
6100 |
%} |
|
6101 |
. |
|
6102 |
^ false |
|
6103 |
! |
|
6104 |
||
6105 |
glxGetbackfaceIn: aGLXWindowId |
|
6106 |
||
6107 |
%{ /* NOCONTEXT */ |
|
6108 |
#ifdef GLX |
|
6109 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6110 |
RETURN (__MKSMALLINT(getbackface())); |
294 | 6111 |
#endif |
6112 |
%} |
|
6113 |
. |
|
6114 |
^ false |
|
6115 |
! |
|
6116 |
||
6117 |
glxGetbufferIn: aGLXWindowId |
|
6118 |
||
6119 |
%{ /* NOCONTEXT */ |
|
6120 |
#ifdef GLX |
|
6121 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6122 |
RETURN (__MKSMALLINT(getbuffer())); |
294 | 6123 |
#endif |
6124 |
%} |
|
6125 |
. |
|
6126 |
^ false |
|
6127 |
! |
|
6128 |
||
6129 |
glxGetbutton: num in: aGLXWindowId |
|
6130 |
||
6131 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
6132 |
#ifndef OPENGL |
294 | 6133 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6134 |
RETURN (__MKSMALLINT(getbutton(_deviceVal(num)))); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
6135 |
#endif |
294 | 6136 |
%} |
6137 |
! |
|
6138 |
||
6139 |
glxGetcmmodeIn: aGLXWindowId |
|
6140 |
||
6141 |
%{ /* NOCONTEXT */ |
|
6142 |
#ifdef GLX |
|
6143 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6144 |
RETURN (__MKBOOLEAN(getcmmode())); |
294 | 6145 |
#endif |
6146 |
%} |
|
6147 |
. |
|
6148 |
^ false |
|
6149 |
! |
|
6150 |
||
6151 |
glxGetcolorIn: aGLXWindowId |
|
6152 |
"return the current drawing color" |
|
6153 |
||
6154 |
%{ /* NOCONTEXT */ |
|
6155 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6156 |
RETURN (__MKSMALLINT(getcolor())); |
294 | 6157 |
%} |
6158 |
! |
|
6159 |
||
6160 |
glxGetdcmIn: aGLXWindowId |
|
6161 |
||
6162 |
%{ /* NOCONTEXT */ |
|
6163 |
#ifdef GLX |
|
6164 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6165 |
RETURN (__MKBOOLEAN(getdcm())); |
294 | 6166 |
#endif |
6167 |
%} |
|
6168 |
. |
|
6169 |
^ false |
|
6170 |
! |
|
6171 |
||
6172 |
glxGetdescenderIn: aGLXWindowId |
|
6173 |
||
6174 |
%{ /* NOCONTEXT */ |
|
6175 |
#ifdef GLX |
|
6176 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6177 |
RETURN (__MKSMALLINT(getdescender())); |
294 | 6178 |
#endif |
6179 |
%} |
|
6180 |
. |
|
6181 |
^ false |
|
6182 |
! |
|
6183 |
||
6184 |
glxGetdisplaymodeIn: aGLXWindowId |
|
6185 |
||
6186 |
%{ /* NOCONTEXT */ |
|
6187 |
#ifdef GLX |
|
6188 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6189 |
RETURN (__MKSMALLINT(getdisplaymode())); |
294 | 6190 |
#endif |
6191 |
%} |
|
6192 |
. |
|
6193 |
^ false |
|
6194 |
! |
|
6195 |
||
6196 |
glxGetdrawmodeIn: aGLXWindowId |
|
6197 |
||
6198 |
%{ /* NOCONTEXT */ |
|
6199 |
#ifdef GLX |
|
6200 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6201 |
RETURN (__MKSMALLINT(getdrawmode())); |
294 | 6202 |
#endif |
6203 |
%} |
|
6204 |
. |
|
6205 |
^ false |
|
6206 |
! |
|
6207 |
||
6208 |
glxGetfontIn: aGLXWindowId |
|
6209 |
||
6210 |
%{ /* NOCONTEXT */ |
|
6211 |
#ifdef GLX |
|
6212 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6213 |
RETURN (__MKSMALLINT(getfont())); |
294 | 6214 |
#endif |
6215 |
%} |
|
6216 |
. |
|
6217 |
^ false |
|
6218 |
! |
|
6219 |
||
6220 |
glxGetgconfigBuffer: buffer in: aGLXWindowId |
|
6221 |
||
6222 |
%{ /* NOCONTEXT */ |
|
6223 |
#ifdef FULL_GLX |
|
6224 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6225 |
RETURN (__MKSMALLINT(getgconfig(_longVal(buffer)))); |
294 | 6226 |
#endif |
6227 |
%} |
|
6228 |
. |
|
6229 |
^ false |
|
6230 |
! |
|
6231 |
||
6232 |
glxGetgdescInquiry: inquiry in: aGLXWindowId |
|
6233 |
||
6234 |
%{ /* NOCONTEXT */ |
|
6235 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6236 |
RETURN (__MKSMALLINT(getgdesc(_longVal(inquiry)))); |
294 | 6237 |
%} |
6238 |
! |
|
6239 |
||
6240 |
glxGetheightIn: aGLXWindowId |
|
6241 |
||
6242 |
%{ /* NOCONTEXT */ |
|
6243 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6244 |
RETURN (__MKSMALLINT(getheight())); |
294 | 6245 |
%} |
6246 |
! |
|
6247 |
||
6248 |
glxGethitcodeIn: aGLXWindowId |
|
6249 |
||
6250 |
%{ /* NOCONTEXT */ |
|
6251 |
#ifdef GLX |
|
6252 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6253 |
RETURN (__MKSMALLINT(gethitcode())); |
294 | 6254 |
#endif |
6255 |
%} |
|
6256 |
. |
|
6257 |
^ false |
|
6258 |
! |
|
6259 |
||
6260 |
glxGetlsbackupIn: aGLXWindowId |
|
6261 |
||
6262 |
%{ /* NOCONTEXT */ |
|
6263 |
#ifdef GLX |
|
6264 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6265 |
RETURN (__MKBOOLEAN(getlsbackup())); |
294 | 6266 |
#endif |
6267 |
%} |
|
6268 |
. |
|
6269 |
^ false |
|
6270 |
! |
|
6271 |
||
6272 |
glxGetlsrepeatIn: aGLXWindowId |
|
6273 |
||
6274 |
%{ /* NOCONTEXT */ |
|
6275 |
#ifdef GLX |
|
6276 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6277 |
RETURN (__MKSMALLINT(getlsrepeat())); |
294 | 6278 |
#endif |
6279 |
%} |
|
6280 |
. |
|
6281 |
^ false |
|
6282 |
! |
|
6283 |
||
6284 |
glxGetlstyleIn: aGLXWindowId |
|
6285 |
||
6286 |
%{ /* NOCONTEXT */ |
|
6287 |
#ifdef GLX |
|
6288 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6289 |
RETURN (__MKSMALLINT(getlstyle())); |
294 | 6290 |
#endif |
6291 |
%} |
|
6292 |
. |
|
6293 |
^ false |
|
6294 |
! |
|
6295 |
||
6296 |
glxGetlwidthIn: aGLXWindowId |
|
6297 |
||
6298 |
%{ /* NOCONTEXT */ |
|
6299 |
#ifdef GLX |
|
6300 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6301 |
RETURN (__MKSMALLINT(getlwidth())); |
294 | 6302 |
#endif |
6303 |
%} |
|
6304 |
. |
|
6305 |
^ false |
|
6306 |
! |
|
6307 |
||
6308 |
glxGetmapIn: aGLXWindowId |
|
6309 |
||
6310 |
%{ /* NOCONTEXT */ |
|
6311 |
#ifdef GLX |
|
6312 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6313 |
RETURN (__MKSMALLINT(getmap())); |
294 | 6314 |
#endif |
6315 |
%} |
|
6316 |
. |
|
6317 |
^ false |
|
6318 |
! |
|
6319 |
||
6320 |
glxGetmmodeIn: aGLXWindowId |
|
6321 |
||
6322 |
%{ /* NOCONTEXT */ |
|
6323 |
#ifdef GLX |
|
6324 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6325 |
RETURN (__MKSMALLINT(getmmode())); |
294 | 6326 |
#endif |
6327 |
%} |
|
6328 |
. |
|
6329 |
^ false |
|
6330 |
! |
|
6331 |
||
6332 |
glxGetmonitorIn: aGLXWindowId |
|
6333 |
||
6334 |
%{ /* NOCONTEXT */ |
|
6335 |
#ifdef GLX |
|
6336 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6337 |
RETURN (__MKSMALLINT(getmonitor())); |
294 | 6338 |
#endif |
6339 |
%} |
|
6340 |
. |
|
6341 |
^ false |
|
6342 |
! |
|
6343 |
||
6344 |
glxGetmultisampleIn: aGLXWindowId |
|
6345 |
||
6346 |
%{ /* NOCONTEXT */ |
|
6347 |
#ifdef FULL_GLX |
|
6348 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6349 |
RETURN (__MKBOOLEAN(getmultisample())); |
294 | 6350 |
#endif |
6351 |
%} |
|
6352 |
. |
|
6353 |
^ false |
|
6354 |
! |
|
6355 |
||
6356 |
glxGetothermonitorIn: aGLXWindowId |
|
6357 |
||
6358 |
%{ /* NOCONTEXT */ |
|
6359 |
#ifdef GLX |
|
6360 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6361 |
RETURN (__MKSMALLINT(getothermonitor())); |
294 | 6362 |
#endif |
6363 |
%} |
|
6364 |
. |
|
6365 |
^ false |
|
6366 |
! |
|
6367 |
||
6368 |
glxGetpatternIn: aGLXWindowId |
|
6369 |
||
6370 |
%{ /* NOCONTEXT */ |
|
6371 |
#ifdef GLX |
|
6372 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6373 |
RETURN (__MKSMALLINT(getpattern())); |
294 | 6374 |
#endif |
6375 |
%} |
|
6376 |
. |
|
6377 |
^ false |
|
6378 |
! |
|
6379 |
||
6380 |
glxGetresetlsIn: aGLXWindowId |
|
6381 |
||
6382 |
%{ /* NOCONTEXT */ |
|
6383 |
#ifdef GLX |
|
6384 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6385 |
RETURN (__MKBOOLEAN(getresetls())); |
294 | 6386 |
#endif |
6387 |
%} |
|
6388 |
. |
|
6389 |
^ false |
|
6390 |
! |
|
6391 |
||
6392 |
glxGetshadeIn: aGLXWindowId |
|
6393 |
||
6394 |
%{ /* NOCONTEXT */ |
|
6395 |
#ifdef GLX |
|
6396 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6397 |
RETURN (__MKSMALLINT(getshade())); |
294 | 6398 |
#endif |
6399 |
%} |
|
6400 |
. |
|
6401 |
^ false |
|
6402 |
! |
|
6403 |
||
6404 |
glxGetsmIn: aGLXWindowId |
|
6405 |
||
6406 |
%{ /* NOCONTEXT */ |
|
6407 |
#ifdef GLX |
|
6408 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6409 |
RETURN (__MKSMALLINT(getsm())); |
294 | 6410 |
#endif |
6411 |
%} |
|
6412 |
. |
|
6413 |
^ false |
|
6414 |
! |
|
6415 |
||
6416 |
glxGetvaluator: dev in: aGLXWindowId |
|
6417 |
||
6418 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
6419 |
#ifndef OPENGL |
294 | 6420 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6421 |
RETURN (__MKSMALLINT(getvaluator(_deviceVal(dev)))); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
6422 |
#endif |
294 | 6423 |
%} |
6424 |
. |
|
6425 |
^ false |
|
6426 |
! |
|
6427 |
||
6428 |
glxGetvideo: reg in: aGLXWindowId |
|
6429 |
||
6430 |
%{ /* NOCONTEXT */ |
|
6431 |
#ifdef GLX |
|
6432 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6433 |
RETURN (__MKSMALLINT(getvideo(_longVal(reg)))); |
294 | 6434 |
#endif |
6435 |
%} |
|
6436 |
. |
|
6437 |
^ false |
|
6438 |
! |
|
6439 |
||
6440 |
glxGetwritemaskIn: aGLXWindowId |
|
6441 |
||
6442 |
%{ /* NOCONTEXT */ |
|
6443 |
#ifdef GLX |
|
6444 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6445 |
RETURN (__MKSMALLINT(getwritemask())); |
294 | 6446 |
#endif |
6447 |
%} |
|
6448 |
. |
|
6449 |
^ false |
|
6450 |
! |
|
6451 |
||
6452 |
glxGetwscrnIn: aGLXWindowId |
|
6453 |
||
6454 |
%{ /* NOCONTEXT */ |
|
6455 |
#ifdef GLX |
|
6456 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6457 |
RETURN (__MKSMALLINT(getwscrn())); |
294 | 6458 |
#endif |
6459 |
%} |
|
6460 |
. |
|
6461 |
^ false |
|
6462 |
! |
|
6463 |
||
6464 |
glxGetzbufferIn: aGLXWindowId |
|
6465 |
||
6466 |
%{ /* NOCONTEXT */ |
|
6467 |
#ifdef GLX |
|
6468 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6469 |
RETURN (__MKBOOLEAN(getzbuffer())); |
294 | 6470 |
#endif |
6471 |
%} |
|
6472 |
. |
|
6473 |
^ false |
|
6474 |
! |
|
6475 |
||
6476 |
glxGexitIn: aGLXWindowId |
|
6477 |
||
6478 |
%{ /* NOCONTEXT */ |
|
6479 |
#ifdef GLX |
|
6480 |
SETWIN(aGLXWindowId) |
|
6481 |
gexit(); |
|
6482 |
RETURN (true); |
|
6483 |
#endif |
|
6484 |
%} |
|
6485 |
. |
|
6486 |
^ false |
|
6487 |
! |
|
6488 |
||
6489 |
glxGflushIn: aGLXWindowId |
|
6490 |
||
6491 |
%{ /* NOCONTEXT */ |
|
6492 |
#ifdef GLX |
|
6493 |
SETWIN(aGLXWindowId) |
|
6494 |
gflush(); |
|
6495 |
RETURN (true); |
|
6496 |
#endif |
|
6497 |
%} |
|
6498 |
. |
|
6499 |
^ false |
|
6500 |
! |
|
6501 |
||
6502 |
glxGinitIn: aGLXWindowId |
|
6503 |
||
6504 |
%{ /* NOCONTEXT */ |
|
6505 |
#ifdef GLX |
|
6506 |
SETWIN(aGLXWindowId) |
|
6507 |
ginit(); |
|
6508 |
RETURN (true); |
|
6509 |
#endif |
|
6510 |
%} |
|
6511 |
. |
|
6512 |
^ false |
|
6513 |
! |
|
6514 |
||
6515 |
glxGlcompatMode: mode value: value in: aGLXWindowId |
|
6516 |
||
6517 |
%{ /* NOCONTEXT */ |
|
6518 |
#ifdef GLX |
|
6519 |
SETWIN(aGLXWindowId) |
|
6520 |
glcompat(_longVal(mode), _longVal(value)); |
|
6521 |
RETURN (true); |
|
6522 |
#endif |
|
6523 |
%} |
|
6524 |
. |
|
6525 |
^ false |
|
6526 |
! |
|
6527 |
||
6528 |
glxGresetIn: aGLXWindowId |
|
6529 |
||
6530 |
%{ /* NOCONTEXT */ |
|
6531 |
#ifdef GLX |
|
6532 |
SETWIN(aGLXWindowId) |
|
6533 |
greset(); |
|
6534 |
RETURN (true); |
|
6535 |
#endif |
|
6536 |
%} |
|
6537 |
. |
|
6538 |
^ false |
|
6539 |
! |
|
6540 |
||
6541 |
glxGsyncIn: aGLXWindowId |
|
6542 |
||
6543 |
%{ /* NOCONTEXT */ |
|
6544 |
#ifdef GLX |
|
6545 |
SETWIN(aGLXWindowId) |
|
6546 |
gsync(); |
|
6547 |
RETURN (true); |
|
6548 |
#endif |
|
6549 |
%} |
|
6550 |
. |
|
6551 |
^ false |
|
6552 |
! |
|
6553 |
||
6554 |
glxIconsizeX: x y: y in: aGLXWindowId |
|
6555 |
||
6556 |
%{ /* NOCONTEXT */ |
|
6557 |
#ifdef GLX |
|
6558 |
SETWIN(aGLXWindowId) |
|
6559 |
iconsize(_longVal(x), _longVal(y)); |
|
6560 |
RETURN (true); |
|
6561 |
#endif |
|
6562 |
%} |
|
6563 |
. |
|
6564 |
^ false |
|
6565 |
! |
|
6566 |
||
6567 |
glxImakebackgroundIn: aGLXWindowId |
|
6568 |
||
6569 |
%{ /* NOCONTEXT */ |
|
6570 |
#ifdef GLX |
|
6571 |
SETWIN(aGLXWindowId) |
|
6572 |
imakebackground(); |
|
6573 |
RETURN (true); |
|
6574 |
#endif |
|
6575 |
%} |
|
6576 |
. |
|
6577 |
^ false |
|
6578 |
! |
|
6579 |
||
6580 |
glxInitnamesIn: aGLXWindowId |
|
6581 |
||
6582 |
%{ /* NOCONTEXT */ |
|
6583 |
#ifdef GLX |
|
6584 |
SETWIN(aGLXWindowId) |
|
6585 |
initnames(); |
|
6586 |
RETURN (true); |
|
6587 |
#endif |
|
6588 |
%} |
|
6589 |
. |
|
6590 |
^ false |
|
6591 |
! |
|
6592 |
||
6593 |
glxIsqueued: dev in: aGLXWindowId |
|
6594 |
||
6595 |
%{ /* NOCONTEXT */ |
|
6596 |
#ifdef GLX |
|
6597 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6598 |
RETURN (__MKBOOLEAN(isqueued(_deviceVal(dev)))); |
294 | 6599 |
#endif |
6600 |
%} |
|
6601 |
. |
|
6602 |
^ false |
|
6603 |
! |
|
6604 |
||
6605 |
glxIstag: t in: aGLXWindowId |
|
6606 |
||
6607 |
%{ /* NOCONTEXT */ |
|
6608 |
#ifdef GLX |
|
6609 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6610 |
RETURN (__MKBOOLEAN(istag(_tagVal(t)))); |
294 | 6611 |
#endif |
6612 |
%} |
|
6613 |
. |
|
6614 |
^ false |
|
6615 |
! |
|
6616 |
||
6617 |
glxKeepaspectX: x y: y in: aGLXWindowId |
|
6618 |
||
6619 |
%{ /* NOCONTEXT */ |
|
6620 |
#ifdef GLX |
|
6621 |
SETWIN(aGLXWindowId) |
|
6622 |
keepaspect(_longVal(x), _longVal(y)); |
|
6623 |
RETURN (true); |
|
6624 |
#endif |
|
6625 |
%} |
|
6626 |
. |
|
6627 |
^ false |
|
6628 |
! |
|
6629 |
||
6630 |
glxLinesmoothMode: mode in: aGLXWindowId |
|
6631 |
||
6632 |
%{ /* NOCONTEXT */ |
|
6633 |
#ifdef GLX |
|
6634 |
SETWIN(aGLXWindowId) |
|
6635 |
linesmooth((ulong)__intVal(mode)); |
|
6636 |
RETURN (true); |
|
6637 |
#endif |
|
6638 |
%} |
|
6639 |
. |
|
6640 |
^ false |
|
6641 |
! |
|
6642 |
||
6643 |
glxLmcolorMode: mode in: aGLXWindowId |
|
6644 |
||
6645 |
%{ /* NOCONTEXT */ |
|
6646 |
#ifdef GLX |
|
6647 |
SETWIN(aGLXWindowId) |
|
6648 |
lmcolor(_longVal(mode)); |
|
6649 |
RETURN (true); |
|
6650 |
#endif |
|
6651 |
%} |
|
6652 |
. |
|
6653 |
^ false |
|
6654 |
! |
|
6655 |
||
6656 |
glxLoadname: name in: aGLXWindowId |
|
6657 |
||
6658 |
%{ /* NOCONTEXT */ |
|
6659 |
#ifdef GLX |
|
6660 |
SETWIN(aGLXWindowId) |
|
6661 |
loadname(_shortVal(name)); |
|
6662 |
RETURN (true); |
|
6663 |
#endif |
|
6664 |
%} |
|
6665 |
. |
|
6666 |
^ false |
|
6667 |
! |
|
6668 |
||
6669 |
glxLogicop: opcode in: aGLXWindowId |
|
6670 |
||
6671 |
%{ /* NOCONTEXT */ |
|
6672 |
#ifdef GLX |
|
6673 |
SETWIN(aGLXWindowId) |
|
6674 |
logicop(_longVal(opcode)); |
|
6675 |
RETURN (true); |
|
6676 |
#endif |
|
6677 |
%} |
|
6678 |
. |
|
6679 |
^ false |
|
6680 |
! |
|
6681 |
||
6682 |
glxLsbackup: b in: aGLXWindowId |
|
6683 |
||
6684 |
%{ /* NOCONTEXT */ |
|
6685 |
#ifdef GLX |
|
6686 |
SETWIN(aGLXWindowId) |
|
6687 |
lsbackup(_booleanVal(b)); |
|
6688 |
RETURN (true); |
|
6689 |
#endif |
|
6690 |
%} |
|
6691 |
. |
|
6692 |
^ false |
|
6693 |
! |
|
6694 |
||
6695 |
glxLsetdepthNear: near far: far in: aGLXWindowId |
|
6696 |
||
6697 |
%{ /* NOCONTEXT */ |
|
6698 |
#ifdef GLX |
|
6699 |
SETWIN(aGLXWindowId) |
|
6700 |
lsetdepth(_longVal(near), _longVal(far)); |
|
6701 |
RETURN (true); |
|
6702 |
#endif |
|
6703 |
%} |
|
6704 |
. |
|
6705 |
^ false |
|
6706 |
! |
|
6707 |
||
6708 |
glxLshaderangeLowin: lowin hiwin: hiwin znear: znear zfar: zfar in: aGLXWindowId |
|
6709 |
||
6710 |
%{ /* NOCONTEXT */ |
|
6711 |
#ifdef GLX |
|
6712 |
SETWIN(aGLXWindowId) |
|
6713 |
lshaderange(_colorindexVal(lowin), _colorindexVal(hiwin), |
|
6714 |
_longVal(znear), _longVal(zfar)); |
|
6715 |
RETURN (true); |
|
6716 |
#endif |
|
6717 |
%} |
|
6718 |
. |
|
6719 |
^ false |
|
6720 |
! |
|
6721 |
||
6722 |
glxLsrepeatFactor: factor in: aGLXWindowId |
|
6723 |
||
6724 |
%{ /* NOCONTEXT */ |
|
6725 |
#ifdef GLX |
|
6726 |
SETWIN(aGLXWindowId) |
|
6727 |
lsrepeat(_longVal(factor)); |
|
6728 |
RETURN (true); |
|
6729 |
#endif |
|
6730 |
%} |
|
6731 |
. |
|
6732 |
^ false |
|
6733 |
! |
|
6734 |
||
6735 |
glxMaketag: t in: aGLXWindowId |
|
6736 |
||
6737 |
%{ /* NOCONTEXT */ |
|
6738 |
#ifdef GLX |
|
6739 |
SETWIN(aGLXWindowId) |
|
6740 |
maketag(_tagVal(t)); |
|
6741 |
RETURN (true); |
|
6742 |
#endif |
|
6743 |
%} |
|
6744 |
. |
|
6745 |
^ false |
|
6746 |
! |
|
6747 |
||
6748 |
glxMaxsizeX: x y: y in: aGLXWindowId |
|
6749 |
||
6750 |
%{ /* NOCONTEXT */ |
|
6751 |
#ifdef GLX |
|
6752 |
SETWIN(aGLXWindowId) |
|
6753 |
maxsize(_longVal(x), _longVal(y)); |
|
6754 |
RETURN (true); |
|
6755 |
#endif |
|
6756 |
%} |
|
6757 |
. |
|
6758 |
^ false |
|
6759 |
! |
|
6760 |
||
6761 |
glxMinsizeX: x y: y in: aGLXWindowId |
|
6762 |
||
6763 |
%{ /* NOCONTEXT */ |
|
6764 |
#ifdef GLX |
|
6765 |
SETWIN(aGLXWindowId) |
|
6766 |
minsize(_longVal(x), _longVal(y)); |
|
6767 |
RETURN (true); |
|
6768 |
#endif |
|
6769 |
%} |
|
6770 |
. |
|
6771 |
^ false |
|
6772 |
! |
|
6773 |
||
6774 |
glxMsalphaMode: mode in: aGLXWindowId |
|
6775 |
||
6776 |
%{ /* NOCONTEXT */ |
|
6777 |
#ifdef FULL_GLX |
|
6778 |
SETWIN(aGLXWindowId) |
|
6779 |
msalpha(_longVal(mode)); |
|
6780 |
RETURN (true); |
|
6781 |
#endif |
|
6782 |
%} |
|
6783 |
. |
|
6784 |
^ false |
|
6785 |
! |
|
6786 |
||
6787 |
glxMsmask: mask inverse: inverse in: aGLXWindowId |
|
6788 |
||
6789 |
%{ /* NOCONTEXT */ |
|
6790 |
#ifdef FULL_GLX |
|
6791 |
SETWIN(aGLXWindowId) |
|
6792 |
msmask(_floatVal(mask), _booleanVal(inverse)); |
|
6793 |
RETURN (true); |
|
6794 |
#endif |
|
6795 |
%} |
|
6796 |
. |
|
6797 |
^ false |
|
6798 |
! |
|
6799 |
||
6800 |
glxMspattern: pattern in: aGLXWindowId |
|
6801 |
||
6802 |
%{ /* NOCONTEXT */ |
|
6803 |
#ifdef FULL_GLX |
|
6804 |
SETWIN(aGLXWindowId) |
|
6805 |
mspattern(_longVal(pattern)); |
|
6806 |
RETURN (true); |
|
6807 |
#endif |
|
6808 |
%} |
|
6809 |
. |
|
6810 |
^ false |
|
6811 |
! |
|
6812 |
||
6813 |
glxMssizeSamples: samples zsize: zsize ssize: ssize in: aGLXWindowId |
|
6814 |
||
6815 |
%{ /* NOCONTEXT */ |
|
6816 |
#ifdef FULL_GLX |
|
6817 |
SETWIN(aGLXWindowId) |
|
6818 |
mssize(_longVal(samples), _longVal(zsize), _longVal(ssize)); |
|
6819 |
RETURN (true); |
|
6820 |
#endif |
|
6821 |
%} |
|
6822 |
. |
|
6823 |
^ false |
|
6824 |
! |
|
6825 |
||
6826 |
glxMswapbuffers: fbuf in: aGLXWindowId |
|
6827 |
||
6828 |
%{ /* NOCONTEXT */ |
|
6829 |
#ifdef GLX |
|
6830 |
SETWIN(aGLXWindowId) |
|
6831 |
mswapbuffers(_longVal(fbuf)); |
|
6832 |
RETURN (true); |
|
6833 |
#endif |
|
6834 |
%} |
|
6835 |
. |
|
6836 |
^ false |
|
6837 |
! |
|
6838 |
||
6839 |
glxMultimapIn: aGLXWindowId |
|
6840 |
||
6841 |
%{ /* NOCONTEXT */ |
|
6842 |
#ifdef GLX |
|
6843 |
SETWIN(aGLXWindowId) |
|
6844 |
multimap(); |
|
6845 |
RETURN (true); |
|
6846 |
#endif |
|
6847 |
%} |
|
6848 |
. |
|
6849 |
^ false |
|
6850 |
! |
|
6851 |
||
6852 |
glxMultisample: bool in: aGLXWindowId |
|
6853 |
||
6854 |
%{ /* NOCONTEXT */ |
|
6855 |
#ifdef FULL_GLX |
|
6856 |
SETWIN(aGLXWindowId) |
|
6857 |
multisample(_booleanVal(bool)); |
|
6858 |
RETURN (true); |
|
6859 |
#endif |
|
6860 |
%} |
|
6861 |
. |
|
6862 |
^ false |
|
6863 |
! |
|
6864 |
||
6865 |
glxNewpupIn: aGLXWindowId |
|
6866 |
||
6867 |
%{ /* NOCONTEXT */ |
|
6868 |
#ifdef GLX |
|
6869 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6870 |
RETURN (__MKSMALLINT(newpup())); |
294 | 6871 |
#endif |
6872 |
%} |
|
6873 |
. |
|
6874 |
^ false |
|
6875 |
! |
|
6876 |
||
6877 |
glxNewtag: newtg oldtg: oldtg offst: offst in: aGLXWindowId |
|
6878 |
||
6879 |
%{ /* NOCONTEXT */ |
|
6880 |
#ifdef GLX |
|
6881 |
SETWIN(aGLXWindowId) |
|
6882 |
newtag(_tagVal(newtg), _tagVal(oldtg), _offsetVal(offst)); |
|
6883 |
RETURN (true); |
|
6884 |
#endif |
|
6885 |
%} |
|
6886 |
. |
|
6887 |
^ false |
|
6888 |
! |
|
6889 |
||
6890 |
glxNoborderIn: aGLXWindowId |
|
6891 |
||
6892 |
%{ /* NOCONTEXT */ |
|
6893 |
#ifdef GLX |
|
6894 |
SETWIN(aGLXWindowId) |
|
6895 |
noborder(); |
|
6896 |
RETURN (true); |
|
6897 |
#endif |
|
6898 |
%} |
|
6899 |
. |
|
6900 |
^ false |
|
6901 |
! |
|
6902 |
||
6903 |
glxNoise: v delta: delta in: aGLXWindowId |
|
6904 |
||
6905 |
%{ /* NOCONTEXT */ |
|
6906 |
#ifdef GLX |
|
6907 |
SETWIN(aGLXWindowId) |
|
6908 |
noise(_deviceVal(v), _shortVal(delta)); |
|
6909 |
RETURN (true); |
|
6910 |
#endif |
|
6911 |
%} |
|
6912 |
. |
|
6913 |
^ false |
|
6914 |
! |
|
6915 |
||
6916 |
glxNoportIn: aGLXWindowId |
|
6917 |
||
6918 |
%{ /* NOCONTEXT */ |
|
6919 |
#ifdef GLX |
|
6920 |
SETWIN(aGLXWindowId) |
|
6921 |
noport(); |
|
6922 |
RETURN (true); |
|
6923 |
#endif |
|
6924 |
%} |
|
6925 |
. |
|
6926 |
^ false |
|
6927 |
! |
|
6928 |
||
6929 |
glxNurbscurveKnotCount: knotCount knotList: knotList |
|
6930 |
offset: offset ctlArray: ctlArray |
|
6931 |
order: order type: type in: aGLXWindowId |
|
6932 |
||
6933 |
| ctlPoints i | |
|
6934 |
ctlPoints := DoubleArray new: ctlArray size * (ctlArray first size). |
|
6935 |
i := 1. |
|
6936 |
ctlArray do: [:point | |
|
6937 |
point do: [:coord | |
|
6938 |
ctlPoints at: i put: coord. |
|
6939 |
i := i + 1]]. |
|
6940 |
||
6941 |
%{ /* NOCONTEXT */ |
|
6942 |
#ifdef GLX |
|
6943 |
char *knotElements, *ctlElements; |
|
6944 |
OBJ cls; |
|
6945 |
int ninstVars, nInstBytes; |
|
6946 |
||
6947 |
SETWIN(aGLXWindowId) |
|
6948 |
cls = __qClass(ctlPoints); |
|
6949 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
6950 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
|
6951 |
||
6952 |
ctlElements = (char *)(_InstPtr(ctlPoints)) + nInstBytes; |
|
6953 |
knotElements = (char *)(_InstPtr(knotList)) + nInstBytes; |
|
6954 |
||
6955 |
nurbscurve ( |
|
6956 |
_longVal(knotCount), (double *)knotElements, |
|
6957 |
_longVal(offset), (double *)ctlElements, |
|
6958 |
_longVal(order), _longVal(type)); |
|
6959 |
RETURN(true); |
|
6960 |
#endif |
|
6961 |
%} |
|
6962 |
. |
|
6963 |
^ false |
|
6964 |
! |
|
6965 |
||
6966 |
glxObjdeleteTag1: tag1 tag2: tag2 in: aGLXWindowId |
|
6967 |
||
6968 |
%{ /* NOCONTEXT */ |
|
6969 |
#ifdef GLX |
|
6970 |
SETWIN(aGLXWindowId) |
|
6971 |
objdelete(_tagVal(tag1), _tagVal(tag2)); |
|
6972 |
RETURN (true); |
|
6973 |
#endif |
|
6974 |
%} |
|
6975 |
. |
|
6976 |
^ false |
|
6977 |
! |
|
6978 |
||
6979 |
glxObjinsert: t in: aGLXWindowId |
|
6980 |
||
6981 |
%{ /* NOCONTEXT */ |
|
6982 |
#ifdef GLX |
|
6983 |
SETWIN(aGLXWindowId) |
|
6984 |
objinsert(_tagVal(t)); |
|
6985 |
RETURN (true); |
|
6986 |
#endif |
|
6987 |
%} |
|
6988 |
. |
|
6989 |
^ false |
|
6990 |
! |
|
6991 |
||
6992 |
glxObjreplace: t in: aGLXWindowId |
|
6993 |
||
6994 |
%{ /* NOCONTEXT */ |
|
6995 |
#ifdef GLX |
|
6996 |
SETWIN(aGLXWindowId) |
|
6997 |
objreplace(_tagVal(t)); |
|
6998 |
RETURN (true); |
|
6999 |
#endif |
|
7000 |
%} |
|
7001 |
. |
|
7002 |
^ false |
|
7003 |
! |
|
7004 |
||
7005 |
glxOnemapIn: aGLXWindowId |
|
7006 |
||
7007 |
%{ /* NOCONTEXT */ |
|
7008 |
#ifdef GLX |
|
7009 |
SETWIN(aGLXWindowId) |
|
7010 |
onemap(); |
|
7011 |
RETURN (true); |
|
7012 |
#endif |
|
7013 |
%} |
|
7014 |
. |
|
7015 |
^ false |
|
7016 |
! |
|
7017 |
||
7018 |
glxPagecolor: pcolor in: aGLXWindowId |
|
7019 |
||
7020 |
%{ /* NOCONTEXT */ |
|
7021 |
#ifdef GLX |
|
7022 |
SETWIN(aGLXWindowId) |
|
7023 |
pagecolor(_colorindexVal(pcolor)); |
|
7024 |
RETURN (true); |
|
7025 |
#endif |
|
7026 |
%} |
|
7027 |
. |
|
7028 |
^ false |
|
7029 |
! |
|
7030 |
||
7031 |
glxPassthroughToken: token in: aGLXWindowId |
|
7032 |
||
7033 |
%{ /* NOCONTEXT */ |
|
7034 |
#ifdef GLX |
|
7035 |
SETWIN(aGLXWindowId) |
|
7036 |
passthrough(_shortVal(token)); |
|
7037 |
RETURN (true); |
|
7038 |
#endif |
|
7039 |
%} |
|
7040 |
. |
|
7041 |
^ false |
|
7042 |
! |
|
7043 |
||
7044 |
glxPclosIn: aGLXWindowId |
|
7045 |
||
7046 |
%{ /* NOCONTEXT */ |
|
7047 |
#ifdef GLX |
|
7048 |
SETWIN(aGLXWindowId) |
|
7049 |
pclos(); |
|
7050 |
RETURN (true); |
|
7051 |
#endif |
|
7052 |
%} |
|
7053 |
. |
|
7054 |
^ false |
|
7055 |
! |
|
7056 |
||
7057 |
glxPicksizeX: x y: y in: aGLXWindowId |
|
7058 |
||
7059 |
%{ /* NOCONTEXT */ |
|
7060 |
#ifdef GLX |
|
7061 |
SETWIN(aGLXWindowId) |
|
7062 |
picksize(_shortVal(x), _shortVal(y)); |
|
7063 |
RETURN (true); |
|
7064 |
#endif |
|
7065 |
%} |
|
7066 |
. |
|
7067 |
^ false |
|
7068 |
! |
|
7069 |
||
7070 |
glxPixmode: mode value: value in: aGLXWindowId |
|
7071 |
||
7072 |
%{ /* NOCONTEXT */ |
|
7073 |
#ifdef GLX |
|
7074 |
SETWIN(aGLXWindowId) |
|
7075 |
pixmode(_longVal(mode), _longVal(value)); |
|
7076 |
RETURN (true); |
|
7077 |
#endif |
|
7078 |
%} |
|
7079 |
. |
|
7080 |
^ false |
|
7081 |
! |
|
7082 |
||
7083 |
glxPntsmoothMode: mode in: aGLXWindowId |
|
7084 |
||
7085 |
%{ /* NOCONTEXT */ |
|
7086 |
#ifdef GLX |
|
7087 |
SETWIN(aGLXWindowId) |
|
7088 |
pntsmooth((ulong)__intVal(mode)); |
|
7089 |
RETURN (true); |
|
7090 |
#endif |
|
7091 |
%} |
|
7092 |
. |
|
7093 |
^ false |
|
7094 |
! |
|
7095 |
||
7096 |
glxPolysmoothMode: mode in: aGLXWindowId |
|
7097 |
||
7098 |
%{ /* NOCONTEXT */ |
|
7099 |
#ifdef GLX |
|
7100 |
SETWIN(aGLXWindowId) |
|
7101 |
polysmooth(_longVal(mode)); |
|
7102 |
RETURN (true); |
|
7103 |
#endif |
|
7104 |
%} |
|
7105 |
. |
|
7106 |
^ false |
|
7107 |
! |
|
7108 |
||
7109 |
glxPopnameIn: aGLXWindowId |
|
7110 |
||
7111 |
%{ /* NOCONTEXT */ |
|
7112 |
#ifdef GLX |
|
7113 |
SETWIN(aGLXWindowId) |
|
7114 |
popname(); |
|
7115 |
RETURN (true); |
|
7116 |
#endif |
|
7117 |
%} |
|
7118 |
. |
|
7119 |
^ false |
|
7120 |
! |
|
7121 |
||
7122 |
glxPrefpositionX1: x1 x2: x2 y1: y1 y2: y2 in: aGLXWindowId |
|
7123 |
||
7124 |
%{ /* NOCONTEXT */ |
|
7125 |
SETWIN(aGLXWindowId) |
|
7126 |
prefposition(_longVal(x1), _longVal(x2), _longVal(y1), _longVal(y2)); |
|
7127 |
RETURN (true); |
|
7128 |
%} |
|
7129 |
! |
|
7130 |
||
7131 |
glxPrefsizeX: x y: y in: aGLXWindowId |
|
7132 |
||
7133 |
%{ /* NOCONTEXT */ |
|
7134 |
SETWIN(aGLXWindowId) |
|
7135 |
prefsize(_longVal(x), _longVal(y)); |
|
7136 |
RETURN (true); |
|
7137 |
%} |
|
7138 |
! |
|
7139 |
||
7140 |
glxPupmodeIn: aGLXWindowId |
|
7141 |
||
7142 |
%{ /* NOCONTEXT */ |
|
7143 |
#ifdef GLX |
|
7144 |
SETWIN(aGLXWindowId) |
|
7145 |
pupmode(); |
|
7146 |
RETURN (true); |
|
7147 |
#endif |
|
7148 |
%} |
|
7149 |
. |
|
7150 |
^ false |
|
7151 |
! |
|
7152 |
||
7153 |
glxPushname: name In: aGLXWindowId |
|
7154 |
||
7155 |
%{ /* NOCONTEXT */ |
|
7156 |
#ifdef GLX |
|
7157 |
SETWIN(aGLXWindowId) |
|
7158 |
pushname(_shortVal(name)); |
|
7159 |
RETURN (true); |
|
7160 |
#endif |
|
7161 |
%} |
|
7162 |
. |
|
7163 |
^ false |
|
7164 |
! |
|
7165 |
||
7166 |
glxQdevice: dev in: aGLXWindowId |
|
7167 |
||
7168 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7169 |
#ifndef OPENGL |
294 | 7170 |
SETWIN(aGLXWindowId) |
7171 |
qdevice(_deviceVal(dev)); |
|
7172 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7173 |
#endif |
294 | 7174 |
%} |
7175 |
! |
|
7176 |
||
7177 |
glxQenterDev: dev val: val in: aGLXWindowId |
|
7178 |
||
7179 |
%{ /* NOCONTEXT */ |
|
7180 |
SETWIN(aGLXWindowId) |
|
7181 |
qenter(_deviceVal(dev), _shortVal(val)); |
|
7182 |
RETURN (true); |
|
7183 |
%} |
|
7184 |
! |
|
7185 |
||
7186 |
glxQgetfdIn: aGLXWindowId |
|
7187 |
||
7188 |
%{ /* NOCONTEXT */ |
|
7189 |
#ifdef GLX |
|
7190 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7191 |
RETURN (__MKSMALLINT(qgetfd())); |
294 | 7192 |
#endif |
7193 |
%} |
|
7194 |
. |
|
7195 |
^ false |
|
7196 |
! |
|
7197 |
||
7198 |
glxQreadIn: aGLXWindowId |
|
7199 |
||
7200 |
| dev data | |
|
7201 |
%{ |
|
7202 |
short c_data; |
|
7203 |
||
7204 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7205 |
dev = __MKSMALLINT(qread(&c_data)); |
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7206 |
data = __MKSMALLINT(c_data); |
294 | 7207 |
%} |
7208 |
. |
|
7209 |
^ Array with: dev with: data |
|
7210 |
! |
|
7211 |
||
7212 |
glxQresetIn: aGLXWindowId |
|
7213 |
||
7214 |
%{ /* NOCONTEXT */ |
|
7215 |
SETWIN(aGLXWindowId) |
|
7216 |
qreset(); |
|
7217 |
RETURN (true); |
|
7218 |
%} |
|
7219 |
! |
|
7220 |
||
7221 |
glxQtestIn: aGLXWindowId |
|
7222 |
||
7223 |
%{ /* NOCONTEXT */ |
|
7224 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7225 |
RETURN (__MKSMALLINT(qtest())); |
294 | 7226 |
%} |
7227 |
! |
|
7228 |
||
7229 |
glxRGBcursorIndex: index red: red green: green blue: blue |
|
7230 |
redm: redm greenm: greenm bluem: bluem in: aGLXWindowId |
|
7231 |
||
7232 |
%{ /* NOCONTEXT */ |
|
7233 |
#ifdef GLX |
|
7234 |
SETWIN(aGLXWindowId) |
|
7235 |
RGBcursor(_shortVal(index), |
|
7236 |
_shortVal(red), _shortVal(green), _shortVal(blue), |
|
7237 |
_shortVal(redm), _shortVal(greenm), _shortVal(bluem)); |
|
7238 |
RETURN (true); |
|
7239 |
#endif |
|
7240 |
%} |
|
7241 |
. |
|
7242 |
^ false |
|
7243 |
! |
|
7244 |
||
7245 |
glxRGBwritemaskRed: red green: green blue: blue in: aGLXWindowId |
|
7246 |
||
7247 |
%{ /* NOCONTEXT */ |
|
7248 |
#ifdef GLX |
|
7249 |
SETWIN(aGLXWindowId) |
|
7250 |
RGBwritemask(_shortVal(red), _shortVal(green), _shortVal(blue)); |
|
7251 |
RETURN (true); |
|
7252 |
#endif |
|
7253 |
%} |
|
7254 |
. |
|
7255 |
^ false |
|
7256 |
! |
|
7257 |
||
7258 |
glxRectzoomX: xfactor y: yfactor in: aGLXWindowId |
|
7259 |
||
7260 |
%{ /* NOCONTEXT */ |
|
7261 |
#ifdef GLX |
|
7262 |
SETWIN(aGLXWindowId) |
|
7263 |
rectzoom(_floatVal(xfactor), _floatVal(yfactor)); |
|
7264 |
RETURN (true); |
|
7265 |
#endif |
|
7266 |
%} |
|
7267 |
. |
|
7268 |
^ false |
|
7269 |
! |
|
7270 |
||
7271 |
glxResetls: b in: aGLXWindowId |
|
7272 |
||
7273 |
%{ /* NOCONTEXT */ |
|
7274 |
#ifdef GLX |
|
7275 |
SETWIN(aGLXWindowId) |
|
7276 |
resetls(_booleanVal(b)); |
|
7277 |
RETURN (true); |
|
7278 |
#endif |
|
7279 |
%} |
|
7280 |
. |
|
7281 |
^ false |
|
7282 |
! |
|
7283 |
||
7284 |
glxRingbellIn: aGLXWindowId |
|
7285 |
||
7286 |
%{ /* NOCONTEXT */ |
|
7287 |
#ifdef GLX |
|
7288 |
SETWIN(aGLXWindowId) |
|
7289 |
ringbell(); |
|
7290 |
RETURN (true); |
|
7291 |
#endif |
|
7292 |
%} |
|
7293 |
. |
|
7294 |
^ false |
|
7295 |
! |
|
7296 |
||
7297 |
glxSboxX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7298 |
||
7299 |
%{ /* NOCONTEXT */ |
|
7300 |
#ifdef GLX |
|
7301 |
SETWIN(aGLXWindowId) |
|
7302 |
sbox(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
7303 |
RETURN (true); |
|
7304 |
#endif |
|
7305 |
%} |
|
7306 |
. |
|
7307 |
^ false |
|
7308 |
! |
|
7309 |
||
7310 |
glxSboxfX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7311 |
||
7312 |
%{ /* NOCONTEXT */ |
|
7313 |
#ifdef GLX |
|
7314 |
SETWIN(aGLXWindowId) |
|
7315 |
sboxf(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
7316 |
RETURN (true); |
|
7317 |
#endif |
|
7318 |
%} |
|
7319 |
. |
|
7320 |
^ false |
|
7321 |
! |
|
7322 |
||
7323 |
glxSboxfiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7324 |
||
7325 |
%{ /* NOCONTEXT */ |
|
7326 |
#ifdef GLX |
|
7327 |
SETWIN(aGLXWindowId) |
|
7328 |
sboxfi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
7329 |
RETURN (true); |
|
7330 |
#endif |
|
7331 |
%} |
|
7332 |
. |
|
7333 |
^ false |
|
7334 |
! |
|
7335 |
||
7336 |
glxSboxfsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7337 |
||
7338 |
%{ /* NOCONTEXT */ |
|
7339 |
#ifdef GLX |
|
7340 |
SETWIN(aGLXWindowId) |
|
7341 |
sboxfs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
7342 |
RETURN (true); |
|
7343 |
#endif |
|
7344 |
%} |
|
7345 |
. |
|
7346 |
^ false |
|
7347 |
! |
|
7348 |
||
7349 |
glxSboxiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7350 |
||
7351 |
%{ /* NOCONTEXT */ |
|
7352 |
#ifdef GLX |
|
7353 |
SETWIN(aGLXWindowId) |
|
7354 |
sboxi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
7355 |
RETURN (true); |
|
7356 |
#endif |
|
7357 |
%} |
|
7358 |
. |
|
7359 |
^ false |
|
7360 |
! |
|
7361 |
||
7362 |
glxSboxsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7363 |
||
7364 |
%{ /* NOCONTEXT */ |
|
7365 |
#ifdef GLX |
|
7366 |
SETWIN(aGLXWindowId) |
|
7367 |
sboxs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
7368 |
RETURN (true); |
|
7369 |
#endif |
|
7370 |
%} |
|
7371 |
. |
|
7372 |
^ false |
|
7373 |
! |
|
7374 |
||
7375 |
glxSclearSval: sval in: aGLXWindowId |
|
7376 |
||
7377 |
%{ /* NOCONTEXT */ |
|
7378 |
#ifdef GLX |
|
7379 |
SETWIN(aGLXWindowId) |
|
7380 |
sclear((ulong)__intVal(sval)); |
|
7381 |
RETURN (true); |
|
7382 |
#endif |
|
7383 |
%} |
|
7384 |
. |
|
7385 |
^ false |
|
7386 |
! |
|
7387 |
||
7388 |
glxScrbox: arg in: aGLXWindowId |
|
7389 |
||
7390 |
%{ /* NOCONTEXT */ |
|
7391 |
#ifdef GLX |
|
7392 |
SETWIN(aGLXWindowId) |
|
7393 |
scrbox(_longVal(arg)); |
|
7394 |
RETURN (true); |
|
7395 |
#endif |
|
7396 |
%} |
|
7397 |
. |
|
7398 |
^ false |
|
7399 |
! |
|
7400 |
||
7401 |
glxScreenspaceIn: aGLXWindowId |
|
7402 |
||
7403 |
%{ /* NOCONTEXT */ |
|
7404 |
#ifdef GLX |
|
7405 |
SETWIN(aGLXWindowId) |
|
7406 |
screenspace(); |
|
7407 |
RETURN (true); |
|
7408 |
#endif |
|
7409 |
%} |
|
7410 |
. |
|
7411 |
^ false |
|
7412 |
! |
|
7413 |
||
7414 |
glxScrmaskLeft: left right: right bottom: bottom top: top in: aGLXWindowId |
|
7415 |
||
7416 |
%{ /* NOCONTEXT */ |
|
7417 |
#ifdef GLX |
|
7418 |
SETWIN(aGLXWindowId) |
|
7419 |
scrmask(_screencoordVal(left), _screencoordVal(right), |
|
7420 |
_screencoordVal(bottom), _screencoordVal(top)); |
|
7421 |
RETURN (true); |
|
7422 |
#endif |
|
7423 |
%} |
|
7424 |
. |
|
7425 |
^ false |
|
7426 |
! |
|
7427 |
||
7428 |
glxScrnattach: gsnr in: aGLXWindowId |
|
7429 |
||
7430 |
%{ /* NOCONTEXT */ |
|
7431 |
#ifdef GLX |
|
7432 |
SETWIN(aGLXWindowId) |
|
7433 |
scrnattach(_longVal(gsnr)); |
|
7434 |
RETURN (true); |
|
7435 |
#endif |
|
7436 |
%} |
|
7437 |
. |
|
7438 |
^ false |
|
7439 |
! |
|
7440 |
||
7441 |
glxScrnselect: gsnr in: aGLXWindowId |
|
7442 |
||
7443 |
%{ /* NOCONTEXT */ |
|
7444 |
#ifdef GLX |
|
7445 |
SETWIN(aGLXWindowId) |
|
7446 |
scrnselect(_longVal(gsnr)); |
|
7447 |
RETURN (true); |
|
7448 |
#endif |
|
7449 |
%} |
|
7450 |
. |
|
7451 |
^ false |
|
7452 |
! |
|
7453 |
||
7454 |
glxSetcursorIndex: index color: color wtn: wtn in: aGLXWindowId |
|
7455 |
||
7456 |
%{ /* NOCONTEXT */ |
|
7457 |
#ifdef GLX |
|
7458 |
SETWIN(aGLXWindowId) |
|
7459 |
setcursor(_shortVal(index), _colorindexVal(color), _colorindexVal(wtn)); |
|
7460 |
RETURN (true); |
|
7461 |
#endif |
|
7462 |
%} |
|
7463 |
. |
|
7464 |
^ false |
|
7465 |
! |
|
7466 |
||
7467 |
glxSetdblightsMask: mask in: aGLXWindowId |
|
7468 |
||
7469 |
%{ /* NOCONTEXT */ |
|
7470 |
#ifdef GLX |
|
7471 |
SETWIN(aGLXWindowId) |
|
7472 |
setdblights((ulong)__intVal(mask)); |
|
7473 |
RETURN (true); |
|
7474 |
#endif |
|
7475 |
%} |
|
7476 |
. |
|
7477 |
^ false |
|
7478 |
! |
|
7479 |
||
7480 |
glxSetdepthNear: near far: far in: aGLXWindowId |
|
7481 |
||
7482 |
%{ /* NOCONTEXT */ |
|
7483 |
#ifdef GLX |
|
7484 |
SETWIN(aGLXWindowId) |
|
7485 |
setdepth(_screencoordVal(near), _screencoordVal(far)); |
|
7486 |
RETURN (true); |
|
7487 |
#endif |
|
7488 |
%} |
|
7489 |
. |
|
7490 |
^ false |
|
7491 |
! |
|
7492 |
||
7493 |
glxSetmap: mapnum in: aGLXWindowId |
|
7494 |
||
7495 |
%{ /* NOCONTEXT */ |
|
7496 |
#ifdef GLX |
|
7497 |
SETWIN(aGLXWindowId) |
|
7498 |
setmap(_shortVal(mapnum)); |
|
7499 |
RETURN (true); |
|
7500 |
#endif |
|
7501 |
%} |
|
7502 |
. |
|
7503 |
^ false |
|
7504 |
! |
|
7505 |
||
7506 |
glxSetmonitor: mtype in: aGLXWindowId |
|
7507 |
||
7508 |
%{ /* NOCONTEXT */ |
|
7509 |
#ifdef GLX |
|
7510 |
SETWIN(aGLXWindowId) |
|
7511 |
setmonitor(_shortVal(mtype)); |
|
7512 |
RETURN (true); |
|
7513 |
#endif |
|
7514 |
%} |
|
7515 |
. |
|
7516 |
^ false |
|
7517 |
! |
|
7518 |
||
7519 |
glxSetnurbsproperty: property value: value in: aGLXWindowId |
|
7520 |
||
7521 |
%{ /* NOCONTEXT */ |
|
7522 |
#ifdef GLX |
|
7523 |
SETWIN(aGLXWindowId) |
|
7524 |
setnurbsproperty(_longVal(property), _floatVal(value)); |
|
7525 |
RETURN (true); |
|
7526 |
#endif |
|
7527 |
%} |
|
7528 |
. |
|
7529 |
^ false |
|
7530 |
! |
|
7531 |
||
7532 |
glxSetpattern: index in: aGLXWindowId |
|
7533 |
||
7534 |
%{ /* NOCONTEXT */ |
|
7535 |
#ifdef GLX |
|
7536 |
SETWIN(aGLXWindowId) |
|
7537 |
setpattern(_shortVal(index)); |
|
7538 |
RETURN (true); |
|
7539 |
#endif |
|
7540 |
%} |
|
7541 |
. |
|
7542 |
^ false |
|
7543 |
! |
|
7544 |
||
7545 |
glxSetpup: pup entry: entry mode: mode in: aGLXWindowId |
|
7546 |
||
7547 |
%{ /* NOCONTEXT */ |
|
7548 |
#ifdef GLX |
|
7549 |
SETWIN(aGLXWindowId) |
|
7550 |
setpup(_longVal(pup), _longVal(entry), (ulong)__intVal(mode)); |
|
7551 |
RETURN (true); |
|
7552 |
#endif |
|
7553 |
%} |
|
7554 |
. |
|
7555 |
^ false |
|
7556 |
! |
|
7557 |
||
7558 |
glxSetvaluator: v init: init vmin: vmin vmax: vmax in: aGLXWindowId |
|
7559 |
||
7560 |
%{ /* NOCONTEXT */ |
|
7561 |
#ifdef GLX |
|
7562 |
SETWIN(aGLXWindowId) |
|
7563 |
setvaluator(_deviceVal(v), _shortVal(init), _shortVal(vmin), _shortVal(vmax)); |
|
7564 |
RETURN (true); |
|
7565 |
#endif |
|
7566 |
%} |
|
7567 |
. |
|
7568 |
^ false |
|
7569 |
! |
|
7570 |
||
7571 |
glxSetvideo: reg value: value in: aGLXWindowId |
|
7572 |
||
7573 |
%{ /* NOCONTEXT */ |
|
7574 |
#ifdef GLX |
|
7575 |
SETWIN(aGLXWindowId) |
|
7576 |
setvideo(_longVal(reg), _longVal(value)); |
|
7577 |
RETURN (true); |
|
7578 |
#endif |
|
7579 |
%} |
|
7580 |
. |
|
7581 |
^ false |
|
7582 |
! |
|
7583 |
||
7584 |
glxShademodel: model in: aGLXWindowId |
|
7585 |
||
7586 |
%{ /* NOCONTEXT */ |
|
7587 |
#ifdef GLX |
|
7588 |
SETWIN(aGLXWindowId) |
|
7589 |
shademodel(_longVal(model)); |
|
7590 |
RETURN (true); |
|
7591 |
#endif |
|
7592 |
%} |
|
7593 |
. |
|
7594 |
^ false |
|
7595 |
! |
|
7596 |
||
7597 |
glxShaderangeLowin: lowin hiwin: hiwin z1: z1 z2: z2 in: aGLXWindowId |
|
7598 |
||
7599 |
%{ /* NOCONTEXT */ |
|
7600 |
#ifdef GLX |
|
7601 |
SETWIN(aGLXWindowId) |
|
7602 |
shaderange(_colorindexVal(lowin), _colorindexVal(hiwin), |
|
7603 |
_screencoordVal(z1), _screencoordVal(z2)); |
|
7604 |
RETURN (true); |
|
7605 |
#endif |
|
7606 |
%} |
|
7607 |
. |
|
7608 |
^ false |
|
7609 |
! |
|
7610 |
||
7611 |
glxSmoothline: mode in: aGLXWindowId |
|
7612 |
||
7613 |
%{ /* NOCONTEXT */ |
|
7614 |
#ifdef GLX |
|
7615 |
SETWIN(aGLXWindowId) |
|
7616 |
smoothline(_longVal(mode)); |
|
7617 |
RETURN (true); |
|
7618 |
#endif |
|
7619 |
%} |
|
7620 |
. |
|
7621 |
^ false |
|
7622 |
! |
|
7623 |
||
7624 |
glxStencilEnable: enable ref: ref func: func mask: mask fail: fail |
|
7625 |
pass: pass zpass: zpass in: aGLXWindowId |
|
7626 |
||
7627 |
%{ /* NOCONTEXT */ |
|
7628 |
#ifdef GLX |
|
7629 |
SETWIN(aGLXWindowId) |
|
7630 |
stencil(_longVal(enable), (ulong)__intVal(ref), _longVal(func), |
|
7631 |
(ulong)__intVal(mask), _longVal(fail), _longVal(pass), _longVal(zpass)); |
|
7632 |
RETURN (true); |
|
7633 |
#endif |
|
7634 |
%} |
|
7635 |
. |
|
7636 |
^ false |
|
7637 |
! |
|
7638 |
||
7639 |
glxStensize: planes in: aGLXWindowId |
|
7640 |
||
7641 |
%{ /* NOCONTEXT */ |
|
7642 |
#ifdef GLX |
|
7643 |
SETWIN(aGLXWindowId) |
|
7644 |
stensize(_longVal(planes)); |
|
7645 |
RETURN (true); |
|
7646 |
#endif |
|
7647 |
%} |
|
7648 |
. |
|
7649 |
^ false |
|
7650 |
! |
|
7651 |
||
7652 |
glxStepunitX: x y: y in: aGLXWindowId |
|
7653 |
||
7654 |
%{ /* NOCONTEXT */ |
|
7655 |
#ifdef GLX |
|
7656 |
SETWIN(aGLXWindowId) |
|
7657 |
stepunit(_longVal(x), _longVal(y)); |
|
7658 |
RETURN (true); |
|
7659 |
#endif |
|
7660 |
%} |
|
7661 |
. |
|
7662 |
^ false |
|
7663 |
! |
|
7664 |
||
7665 |
glxSubpixel: b in: aGLXWindowId |
|
7666 |
||
7667 |
%{ /* NOCONTEXT */ |
|
7668 |
#ifdef GLX |
|
7669 |
SETWIN(aGLXWindowId) |
|
7670 |
subpixel(_booleanVal(b)); |
|
7671 |
RETURN (true); |
|
7672 |
#endif |
|
7673 |
%} |
|
7674 |
. |
|
7675 |
^ false |
|
7676 |
! |
|
7677 |
||
7678 |
glxSwapinterval: i in: aGLXWindowId |
|
7679 |
||
7680 |
%{ /* NOCONTEXT */ |
|
7681 |
#ifdef GLX |
|
7682 |
SETWIN(aGLXWindowId) |
|
7683 |
swapinterval(_shortVal(i)); |
|
7684 |
RETURN (true); |
|
7685 |
#endif |
|
7686 |
%} |
|
7687 |
. |
|
7688 |
^ false |
|
7689 |
! |
|
7690 |
||
7691 |
glxSwaptmeshIn: aGLXWindowId |
|
7692 |
||
7693 |
%{ /* NOCONTEXT */ |
|
7694 |
#ifdef GLX |
|
7695 |
SETWIN(aGLXWindowId) |
|
7696 |
swaptmesh(); |
|
7697 |
RETURN (true); |
|
7698 |
#endif |
|
7699 |
%} |
|
7700 |
. |
|
7701 |
^ false |
|
7702 |
! |
|
7703 |
||
7704 |
glxSwinopen: parent in: aGLXWindowId |
|
7705 |
||
7706 |
%{ /* NOCONTEXT */ |
|
7707 |
#ifdef GLX |
|
7708 |
SETWIN(aGLXWindowId) |
|
7709 |
swinopen(_longVal(parent)); |
|
7710 |
RETURN (true); |
|
7711 |
#endif |
|
7712 |
%} |
|
7713 |
. |
|
7714 |
^ false |
|
7715 |
! |
|
7716 |
||
7717 |
glxSwritemask: mask in: aGLXWindowId |
|
7718 |
||
7719 |
%{ /* NOCONTEXT */ |
|
7720 |
#ifdef GLX |
|
7721 |
SETWIN(aGLXWindowId) |
|
7722 |
swritemask((ulong)__intVal(mask)); |
|
7723 |
RETURN (true); |
|
7724 |
#endif |
|
7725 |
%} |
|
7726 |
. |
|
7727 |
^ false |
|
7728 |
! |
|
7729 |
||
7730 |
glxTextinitIn: aGLXWindowId |
|
7731 |
||
7732 |
%{ /* NOCONTEXT */ |
|
7733 |
#ifdef GLX |
|
7734 |
SETWIN(aGLXWindowId) |
|
7735 |
textinit(); |
|
7736 |
RETURN (true); |
|
7737 |
#endif |
|
7738 |
%} |
|
7739 |
. |
|
7740 |
^ false |
|
7741 |
! |
|
7742 |
||
7743 |
glxTextportLeft: left right: right bottom: bottom top: top in: aGLXWindowId |
|
7744 |
||
7745 |
%{ /* NOCONTEXT */ |
|
7746 |
#ifdef GLX |
|
7747 |
SETWIN(aGLXWindowId) |
|
7748 |
textport(_screencoordVal(left), _screencoordVal(right), |
|
7749 |
_screencoordVal(bottom), _screencoordVal(top)); |
|
7750 |
RETURN (true); |
|
7751 |
#endif |
|
7752 |
%} |
|
7753 |
. |
|
7754 |
^ false |
|
7755 |
! |
|
7756 |
||
7757 |
glxTieB: b v1: v1 v2: v2 in: aGLXWindowId |
|
7758 |
||
7759 |
%{ /* NOCONTEXT */ |
|
7760 |
#ifdef GLX |
|
7761 |
SETWIN(aGLXWindowId) |
|
7762 |
tie(_deviceVal(b), _deviceVal(v1), _deviceVal(v2)); |
|
7763 |
RETURN (true); |
|
7764 |
#endif |
|
7765 |
%} |
|
7766 |
. |
|
7767 |
^ false |
|
7768 |
! |
|
7769 |
||
7770 |
glxTlutbind: target index: index in: aGLXWindowId |
|
7771 |
||
7772 |
%{ /* NOCONTEXT */ |
|
7773 |
#ifdef FULL_GLX |
|
7774 |
SETWIN(aGLXWindowId) |
|
7775 |
tlutbind(_longVal(target), _longVal(index)); |
|
7776 |
RETURN (true); |
|
7777 |
#endif |
|
7778 |
%} |
|
7779 |
. |
|
7780 |
^ false |
|
7781 |
! |
|
7782 |
||
7783 |
glxTpoffIn: aGLXWindowId |
|
7784 |
||
7785 |
%{ /* NOCONTEXT */ |
|
7786 |
#ifdef GLX |
|
7787 |
SETWIN(aGLXWindowId) |
|
7788 |
tpoff(); |
|
7789 |
RETURN (true); |
|
7790 |
#endif |
|
7791 |
%} |
|
7792 |
. |
|
7793 |
^ false |
|
7794 |
! |
|
7795 |
||
7796 |
glxTponIn: aGLXWindowId |
|
7797 |
||
7798 |
%{ /* NOCONTEXT */ |
|
7799 |
#ifdef GLX |
|
7800 |
SETWIN(aGLXWindowId) |
|
7801 |
tpon(); |
|
7802 |
RETURN (true); |
|
7803 |
#endif |
|
7804 |
%} |
|
7805 |
. |
|
7806 |
^ false |
|
7807 |
! |
|
7808 |
||
7809 |
glxUnqdevice: dev in: aGLXWindowId |
|
7810 |
||
7811 |
%{ /* NOCONTEXT */ |
|
7812 |
#ifdef GLX |
|
7813 |
SETWIN(aGLXWindowId) |
|
7814 |
unqdevice(_deviceVal(dev)); |
|
7815 |
RETURN (true); |
|
7816 |
#endif |
|
7817 |
%} |
|
7818 |
. |
|
7819 |
^ false |
|
7820 |
! |
|
7821 |
||
7822 |
glxWmpack: pack in: aGLXWindowId |
|
7823 |
||
7824 |
%{ /* NOCONTEXT */ |
|
7825 |
#ifdef GLX |
|
7826 |
SETWIN(aGLXWindowId) |
|
7827 |
wmpack((ulong)__intVal(pack)); |
|
7828 |
RETURN (true); |
|
7829 |
#endif |
|
7830 |
%} |
|
7831 |
. |
|
7832 |
^ false |
|
7833 |
! |
|
7834 |
||
7835 |
glxWritemask: wtm in: aGLXWindowId |
|
7836 |
||
7837 |
%{ /* NOCONTEXT */ |
|
7838 |
#ifdef GLX |
|
7839 |
SETWIN(aGLXWindowId) |
|
7840 |
writemask(_colorindexVal(wtm)); |
|
7841 |
RETURN (true); |
|
7842 |
#endif |
|
7843 |
%} |
|
7844 |
. |
|
7845 |
^ false |
|
7846 |
! |
|
7847 |
||
7848 |
glxXfpt2X: x y: y in: aGLXWindowId |
|
7849 |
||
7850 |
%{ /* NOCONTEXT */ |
|
7851 |
#ifdef GLX |
|
7852 |
Coord c_x, c_y; |
|
7853 |
||
7854 |
_COORD_ (x, c_x) |
|
7855 |
_COORD_ (y, c_y) |
|
7856 |
SETWIN(aGLXWindowId) |
|
7857 |
xfpt2(c_x, c_y); |
|
7858 |
RETURN (true); |
|
7859 |
#endif |
|
7860 |
%} |
|
7861 |
. |
|
7862 |
^ false |
|
7863 |
! |
|
7864 |
||
7865 |
glxXfpt2iX: x y: y in: aGLXWindowId |
|
7866 |
||
7867 |
%{ /* NOCONTEXT */ |
|
7868 |
#ifdef GLX |
|
7869 |
Icoord c_x, c_y; |
|
7870 |
||
7871 |
_ICOORD_ (x, c_x) |
|
7872 |
_ICOORD_ (y, c_y) |
|
7873 |
SETWIN(aGLXWindowId) |
|
7874 |
xfpt2i(c_x, c_y); |
|
7875 |
RETURN (true); |
|
7876 |
#endif |
|
7877 |
%} |
|
7878 |
. |
|
7879 |
^ false |
|
7880 |
! |
|
7881 |
||
7882 |
glxXfpt2sX: x y: y in: aGLXWindowId |
|
7883 |
||
7884 |
%{ /* NOCONTEXT */ |
|
7885 |
#ifdef GLX |
|
7886 |
Scoord c_x, c_y; |
|
7887 |
||
7888 |
_SCOORD_ (x, c_x) |
|
7889 |
_SCOORD_ (y, c_y) |
|
7890 |
SETWIN(aGLXWindowId) |
|
7891 |
xfpt2s(c_x, c_y); |
|
7892 |
RETURN (true); |
|
7893 |
#endif |
|
7894 |
%} |
|
7895 |
. |
|
7896 |
^ false |
|
7897 |
! |
|
7898 |
||
7899 |
glxXfpt4X: x y: y z: z w: w in: aGLXWindowId |
|
7900 |
||
7901 |
%{ /* NOCONTEXT */ |
|
7902 |
#ifdef GLX |
|
7903 |
Coord c_x, c_y, c_z, c_w; |
|
7904 |
||
7905 |
_COORD_ (x, c_x) |
|
7906 |
_COORD_ (y, c_y) |
|
7907 |
_COORD_ (z, c_z) |
|
7908 |
_COORD_ (w, c_w) |
|
7909 |
SETWIN(aGLXWindowId) |
|
7910 |
xfpt4(c_x, c_y, c_z, c_w); |
|
7911 |
RETURN (true); |
|
7912 |
#endif |
|
7913 |
%} |
|
7914 |
. |
|
7915 |
^ false |
|
7916 |
! |
|
7917 |
||
7918 |
glxXfpt4iX: x y: y z: z w: w in: aGLXWindowId |
|
7919 |
||
7920 |
%{ /* NOCONTEXT */ |
|
7921 |
#ifdef GLX |
|
7922 |
Icoord c_x, c_y, c_z, c_w; |
|
7923 |
||
7924 |
_ICOORD_ (x, c_x) |
|
7925 |
_ICOORD_ (y, c_y) |
|
7926 |
_ICOORD_ (z, c_z) |
|
7927 |
_ICOORD_ (w, c_w) |
|
7928 |
SETWIN(aGLXWindowId) |
|
7929 |
xfpt4i(c_x, c_y, c_z, c_w); |
|
7930 |
RETURN (true); |
|
7931 |
#endif |
|
7932 |
%} |
|
7933 |
. |
|
7934 |
^ false |
|
7935 |
! |
|
7936 |
||
7937 |
glxXfpt4sX: x y: y z: z w: w in: aGLXWindowId |
|
7938 |
||
7939 |
%{ /* NOCONTEXT */ |
|
7940 |
#ifdef GLX |
|
7941 |
Scoord c_x, c_y, c_z, c_w; |
|
7942 |
||
7943 |
_SCOORD_ (x, c_x) |
|
7944 |
_SCOORD_ (y, c_y) |
|
7945 |
_SCOORD_ (z, c_z) |
|
7946 |
_SCOORD_ (w, c_w) |
|
7947 |
SETWIN(aGLXWindowId) |
|
7948 |
xfpt4s(c_x, c_y, c_z, c_w); |
|
7949 |
RETURN (true); |
|
7950 |
#endif |
|
7951 |
%} |
|
7952 |
. |
|
7953 |
^ false |
|
7954 |
! |
|
7955 |
||
7956 |
glxXfptX: x y: y z: z in: aGLXWindowId |
|
7957 |
||
7958 |
%{ /* NOCONTEXT */ |
|
7959 |
#ifdef GLX |
|
7960 |
Coord c_x, c_y, c_z; |
|
7961 |
||
7962 |
_COORD_ (x, c_x) |
|
7963 |
_COORD_ (y, c_y) |
|
7964 |
_COORD_ (z, c_z) |
|
7965 |
SETWIN(aGLXWindowId) |
|
7966 |
xfpt(c_x, c_y, c_z); |
|
7967 |
RETURN (true); |
|
7968 |
#endif |
|
7969 |
%} |
|
7970 |
. |
|
7971 |
^ false |
|
7972 |
! |
|
7973 |
||
7974 |
glxXfptiX: x y: y z: z in: aGLXWindowId |
|
7975 |
||
7976 |
%{ /* NOCONTEXT */ |
|
7977 |
#ifdef GLX |
|
7978 |
Icoord c_x, c_y, c_z; |
|
7979 |
||
7980 |
_ICOORD_ (x, c_x) |
|
7981 |
_ICOORD_ (y, c_y) |
|
7982 |
_ICOORD_ (z, c_z) |
|
7983 |
SETWIN(aGLXWindowId) |
|
7984 |
xfpti(c_x, c_y, c_z); |
|
7985 |
RETURN (true); |
|
7986 |
#endif |
|
7987 |
%} |
|
7988 |
. |
|
7989 |
^ false |
|
7990 |
! |
|
7991 |
||
7992 |
glxXfptsX: x y: y z: z in: aGLXWindowId |
|
7993 |
||
7994 |
%{ /* NOCONTEXT */ |
|
7995 |
#ifdef GLX |
|
7996 |
Scoord c_x, c_y, c_z; |
|
7997 |
||
7998 |
_SCOORD_ (x, c_x) |
|
7999 |
_SCOORD_ (y, c_y) |
|
8000 |
_SCOORD_ (z, c_z) |
|
8001 |
SETWIN(aGLXWindowId) |
|
8002 |
xfpts(c_x, c_y, c_z); |
|
8003 |
RETURN (true); |
|
8004 |
#endif |
|
8005 |
%} |
|
8006 |
. |
|
8007 |
^ false |
|
8008 |
! ! |
|
8009 |
||
8010 |
!GLXWorkstation methodsFor:'vertex data transfer'! |
|
8011 |
||
8012 |
glxN3f:arrayOf3Floats in:aGLXWindowId |
|
8013 |
"argument must be an array of 3 floats containing the |
|
8014 |
current vertex normal - in real GL only" |
|
8015 |
||
8016 |
%{ /* NOCONTEXT */ |
|
8017 |
#ifdef GLX |
|
8018 |
float vec[3], *v; |
|
8019 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8020 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 8021 |
SETWIN(aGLXWindowId) |
8022 |
n3f(v); |
|
8023 |
RETURN (true); |
|
8024 |
#endif |
|
8025 |
%} |
|
8026 |
. |
|
8027 |
^ false |
|
8028 |
! |
|
8029 |
||
8030 |
glxV2d:v in:aGLXWindowId |
|
8031 |
"pass a vertex; v must be a vector with 2 doubles; z is taken as 0" |
|
8032 |
||
8033 |
%{ /* NOCONTEXT */ |
|
8034 |
double vec[2], *c_v; |
|
8035 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8036 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 2))) RETURN(false); |
294 | 8037 |
SETWIN(aGLXWindowId) |
8038 |
v2d(c_v); |
|
8039 |
RETURN (true); |
|
8040 |
%} |
|
8041 |
! |
|
8042 |
||
8043 |
glxV2f:v in:aGLXWindowId |
|
8044 |
"pass a vertex; v must be a vector with 2 floats; z is taken as 0" |
|
8045 |
||
8046 |
%{ /* NOCONTEXT */ |
|
8047 |
float vec[2], *c_v; |
|
8048 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8049 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
294 | 8050 |
SETWIN(aGLXWindowId) |
8051 |
v2f(c_v); |
|
8052 |
RETURN (true); |
|
8053 |
%} |
|
8054 |
! |
|
8055 |
||
8056 |
glxV2fX:x y:y in:aGLXWindowId |
|
8057 |
"pass a vertex from individual x and y values; z is taken as 0.0" |
|
8058 |
||
8059 |
%{ /* NOCONTEXT */ |
|
8060 |
float vec[2]; |
|
8061 |
||
8062 |
_FLOAT_(x, vec[0]) |
|
8063 |
_FLOAT_(y, vec[1]) |
|
8064 |
SETWIN(aGLXWindowId) |
|
8065 |
v2f(vec); |
|
8066 |
RETURN (true); |
|
8067 |
%} |
|
8068 |
! |
|
8069 |
||
8070 |
glxV2i:v in:aGLXWindowId |
|
8071 |
"pass a vertex; v must be a vector with 2 longs; z is taken as 0" |
|
8072 |
||
8073 |
%{ /* NOCONTEXT */ |
|
8074 |
long vec[2], *c_v; |
|
8075 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8076 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 2))) RETURN(false); |
294 | 8077 |
SETWIN(aGLXWindowId) |
8078 |
v2i(c_v); |
|
8079 |
RETURN (true); |
|
8080 |
%} |
|
8081 |
! |
|
8082 |
||
8083 |
glxV2s:v in:aGLXWindowId |
|
8084 |
"pass a vertex; v must be a vector with 2 shorts; z is taken as 0" |
|
8085 |
||
8086 |
%{ /* NOCONTEXT */ |
|
8087 |
short vec[2], *c_v; |
|
8088 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8089 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 2))) RETURN(false); |
294 | 8090 |
SETWIN(aGLXWindowId) |
8091 |
v2s(c_v); |
|
8092 |
RETURN (true); |
|
8093 |
%} |
|
8094 |
! |
|
8095 |
||
8096 |
glxV3d:v in:aGLXWindowId |
|
8097 |
"pass a vertex; v must be a 3-element double-vector" |
|
8098 |
||
8099 |
%{ /* NOCONTEXT */ |
|
8100 |
double vec[3], *c_v; |
|
8101 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8102 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 3))) RETURN(false); |
294 | 8103 |
SETWIN(aGLXWindowId) |
8104 |
v3d(c_v); |
|
8105 |
RETURN (true); |
|
8106 |
%} |
|
8107 |
. |
|
8108 |
^ false |
|
8109 |
! |
|
8110 |
||
8111 |
glxV3f:v in:aGLXWindowId |
|
8112 |
"pass a vertex; v must be a 3-element float-vector" |
|
8113 |
||
8114 |
%{ /* NOCONTEXT */ |
|
8115 |
float vec[3], *c_v; |
|
8116 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8117 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
294 | 8118 |
SETWIN(aGLXWindowId) |
8119 |
v3f(c_v); |
|
8120 |
RETURN (true); |
|
8121 |
%} |
|
8122 |
! |
|
8123 |
||
8124 |
glxV3fX:x y:y z:z in: aGLXWindowId |
|
8125 |
"pass a vector from individual x, y and z (float) values" |
|
8126 |
||
8127 |
%{ /* NOCONTEXT */ |
|
8128 |
float vec[3]; |
|
8129 |
||
8130 |
_FLOAT_(x, vec[0]) |
|
8131 |
_FLOAT_(y, vec[1]) |
|
8132 |
_FLOAT_(z, vec[2]) |
|
8133 |
SETWIN(aGLXWindowId) |
|
8134 |
v3f(vec); |
|
8135 |
RETURN (true); |
|
8136 |
%} |
|
8137 |
! |
|
8138 |
||
8139 |
glxV3i:v in:aGLXWindowId |
|
8140 |
"pass a vertex; v must be a vector with 3 longs" |
|
8141 |
||
8142 |
%{ /* NOCONTEXT */ |
|
8143 |
long vec[3], *c_v; |
|
8144 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8145 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
294 | 8146 |
SETWIN(aGLXWindowId) |
8147 |
v3i(c_v); |
|
8148 |
RETURN (true); |
|
8149 |
%} |
|
8150 |
! |
|
8151 |
||
8152 |
glxV3s:v in:aGLXWindowId |
|
8153 |
"pass a vertex; v must be a vector with 3 shorts" |
|
8154 |
||
8155 |
%{ /* NOCONTEXT */ |
|
8156 |
short vec[3], *c_v; |
|
8157 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8158 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
294 | 8159 |
SETWIN(aGLXWindowId) |
8160 |
v3s(c_v); |
|
8161 |
RETURN (true); |
|
8162 |
%} |
|
8163 |
! |
|
8164 |
||
8165 |
glxV4d:v in:aGLXWindowId |
|
8166 |
"pass a vertex; v must be a 4-element double-vector, |
|
8167 |
containing x, y, z and w" |
|
8168 |
||
8169 |
%{ /* NOCONTEXT */ |
|
8170 |
double vec[4], *c_v; |
|
8171 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8172 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 4))) RETURN(false); |
294 | 8173 |
SETWIN(aGLXWindowId) |
8174 |
v4d(c_v); |
|
8175 |
RETURN (true); |
|
8176 |
%} |
|
8177 |
! |
|
8178 |
||
8179 |
glxV4f:v in:aGLXWindowId |
|
8180 |
"pass a vertex; v must be a 4-element float-vector, |
|
8181 |
containing x, y, z and w" |
|
8182 |
||
8183 |
%{ /* NOCONTEXT */ |
|
8184 |
float vec[4], *c_v; |
|
8185 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8186 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
294 | 8187 |
SETWIN(aGLXWindowId) |
8188 |
v4f(c_v); |
|
8189 |
RETURN (true); |
|
8190 |
%} |
|
8191 |
! |
|
8192 |
||
8193 |
glxV4i:v in:aGLXWindowId |
|
8194 |
"pass a vertex; v must be a 4-element int-vector, |
|
8195 |
containing x, y, z and w" |
|
8196 |
||
8197 |
%{ /* NOCONTEXT */ |
|
8198 |
long vec[4], *c_v; |
|
8199 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8200 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
294 | 8201 |
SETWIN(aGLXWindowId) |
8202 |
v4i(c_v); |
|
8203 |
RETURN (true); |
|
8204 |
%} |
|
8205 |
! |
|
8206 |
||
8207 |
glxV4s:v in:aGLXWindowId |
|
8208 |
"pass a vertex; v must be a 4-element short-vector, |
|
8209 |
containing x, y, z and w" |
|
8210 |
||
8211 |
%{ /* NOCONTEXT */ |
|
8212 |
short vec[4], *c_v; |
|
8213 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8214 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
294 | 8215 |
SETWIN(aGLXWindowId) |
8216 |
v4s(c_v); |
|
8217 |
RETURN (true); |
|
8218 |
%} |
|
8219 |
! |
|
8220 |
||
8221 |
glxVOriginIn:aGLXWindowId |
|
8222 |
"pass a 0.0/0.0/0.0 vector. |
|
8223 |
This is the same as v3f:#(0.0 0.0 0.0), but, since its so |
|
8224 |
common, this somewhat faster method has been provided" |
|
8225 |
||
8226 |
%{ /* NOCONTEXT */ |
|
8227 |
static float vec[3] = {0.0, 0.0, 0.0}; |
|
8228 |
||
8229 |
SETWIN(aGLXWindowId) |
|
8230 |
v3f(vec); |
|
8231 |
RETURN (true); |
|
8232 |
%} |
|
8233 |
! |
|
8234 |
||
8235 |
glxVUnitXIn:aGLXWindowId |
|
8236 |
"pass a 1.0/0.0/0.0 vector. |
|
8237 |
This is the same as v3f:#(1.0 0.0 0.0), but, since its so |
|
8238 |
common, this somewhat faster method has been provided" |
|
8239 |
||
8240 |
%{ /* NOCONTEXT */ |
|
8241 |
static float vec[3] = {1.0, 0.0, 0.0}; |
|
8242 |
||
8243 |
SETWIN(aGLXWindowId) |
|
8244 |
v3f(vec); |
|
8245 |
RETURN (true); |
|
8246 |
%} |
|
8247 |
! |
|
8248 |
||
8249 |
glxVUnitYIn:aGLXWindowId |
|
8250 |
"pass a 0.0/1.0/0.0 vector. |
|
8251 |
This is the same as v3f:#(0.0 1.0 0.0), but, since its so |
|
8252 |
common, this somewhat faster method has been provided" |
|
8253 |
||
8254 |
%{ /* NOCONTEXT */ |
|
8255 |
static float vec[3] = {0.0, 1.0, 0.0}; |
|
8256 |
||
8257 |
SETWIN(aGLXWindowId) |
|
8258 |
v3f(vec); |
|
8259 |
RETURN (true); |
|
8260 |
%} |
|
8261 |
! |
|
8262 |
||
8263 |
glxVUnitZIn:aGLXWindowId |
|
8264 |
"pass a 0.0/0.0/1.0 vector. |
|
8265 |
This is the same as v3f:#(0.0 0.0 1.0), but, since its so |
|
8266 |
common, this somewhat faster method has been provided" |
|
8267 |
||
8268 |
%{ /* NOCONTEXT */ |
|
8269 |
static float vec[3] = {0.0, 0.0, 1.0}; |
|
8270 |
||
8271 |
SETWIN(aGLXWindowId) |
|
8272 |
v3f(vec); |
|
8273 |
RETURN (true); |
|
8274 |
%} |
|
8275 |
! ! |
|
8276 |
||
8277 |
!GLXWorkstation methodsFor:'video and planes'! |
|
8278 |
||
8279 |
glxOverlayPlanes: planes in: aGLXWindowId |
|
8280 |
||
8281 |
%{ /* NOCONTEXT */ |
|
8282 |
#ifdef GLX |
|
8283 |
SETWIN(aGLXWindowId) |
|
8284 |
overlay(_longVal(planes)); |
|
8285 |
RETURN (true); |
|
8286 |
#endif |
|
8287 |
%} |
|
8288 |
. |
|
8289 |
^ false |
|
8290 |
! |
|
8291 |
||
8292 |
glxStereobufferIn: aGLXWindowId |
|
8293 |
||
8294 |
%{ /* NOCONTEXT */ |
|
8295 |
#ifdef FULL_GLX |
|
8296 |
SETWIN(aGLXWindowId) |
|
8297 |
stereobuffer(); |
|
8298 |
RETURN (true); |
|
8299 |
#endif |
|
8300 |
%} |
|
8301 |
. |
|
8302 |
^ false |
|
8303 |
! |
|
8304 |
||
8305 |
glxUnderlay: planes in: aGLXWindowId |
|
8306 |
||
8307 |
%{ /* NOCONTEXT */ |
|
8308 |
#ifdef GLX |
|
8309 |
SETWIN(aGLXWindowId) |
|
8310 |
underlay(_longVal(planes)); |
|
8311 |
RETURN (true); |
|
8312 |
#endif |
|
8313 |
%} |
|
8314 |
. |
|
8315 |
^ false |
|
8316 |
! |
|
8317 |
||
8318 |
glxVideocmd:cmd in:aGLXWindowId |
|
8319 |
||
8320 |
%{ /* NOCONTEXT */ |
|
8321 |
#ifdef GLX |
|
8322 |
SETWIN(aGLXWindowId) |
|
8323 |
videocmd(_longVal(cmd)); |
|
8324 |
RETURN (true); |
|
8325 |
#endif |
|
8326 |
%} |
|
8327 |
. |
|
8328 |
^ false |
|
8329 |
! ! |
|
8330 |
||
8331 |
!GLXWorkstation methodsFor:'viewing'! |
|
8332 |
||
8333 |
glxLookatVx:vx vy:vy vz:vz px:px py:py pz:pz twist:twist in:aGLXWindowId |
|
8334 |
"define viewing transformation" |
|
8335 |
||
8336 |
%{ /* NOCONTEXT */ |
|
8337 |
||
8338 |
Coord f_vx, f_vy, f_vz, f_px, f_py, f_pz; |
|
8339 |
Angle a_twist; |
|
8340 |
||
8341 |
_COORD_ (vx, f_vx) |
|
8342 |
_COORD_ (vy, f_vy) |
|
8343 |
_COORD_ (vz, f_vz) |
|
8344 |
_COORD_ (px, f_px) |
|
8345 |
_COORD_ (py, f_py) |
|
8346 |
_COORD_ (pz, f_pz) |
|
8347 |
_ANGLE_ (twist, a_twist) |
|
8348 |
SETWIN(aGLXWindowId) |
|
8349 |
lookat(f_vx, f_vy, f_vz, f_px, f_py, f_pz, a_twist); |
|
8350 |
RETURN (true); |
|
8351 |
%} |
|
8352 |
! |
|
8353 |
||
8354 |
glxOrtho2Left: left right: right bottom: bottom top: top in: aGLXWindowId |
|
8355 |
"define 2D orthogonal projection" |
|
8356 |
||
8357 |
%{ /* NOCONTEXT */ |
|
8358 |
float f_left, f_right, f_top, f_bottom; |
|
8359 |
||
8360 |
SETWIN(aGLXWindowId) |
|
8361 |
_FLOAT_(left, f_left) |
|
8362 |
_FLOAT_(right, f_right) |
|
8363 |
_FLOAT_(bottom, f_bottom) |
|
8364 |
_FLOAT_(top, f_top) |
|
8365 |
ortho2(f_left, f_right, f_bottom, f_top); |
|
8366 |
%} |
|
8367 |
. |
|
8368 |
^ true |
|
8369 |
! |
|
8370 |
||
8371 |
glxOrthoLeft: left right: right bottom: bottom top: top near: near far: far in: aGLXWindowId |
|
8372 |
"define orthogonal projection" |
|
8373 |
||
8374 |
%{ /* NOCONTEXT */ |
|
8375 |
float f_left, f_right, f_bottom, f_top, |
|
8376 |
f_near, f_far; |
|
8377 |
||
8378 |
_FLOAT_(left, f_left) |
|
8379 |
_FLOAT_(right, f_right) |
|
8380 |
_FLOAT_(bottom, f_bottom) |
|
8381 |
_FLOAT_(top, f_top) |
|
8382 |
_FLOAT_(near, f_near) |
|
8383 |
_FLOAT_(far, f_far) |
|
8384 |
SETWIN(aGLXWindowId) |
|
8385 |
ortho(f_left, f_right, f_bottom, f_top, f_near, f_far); |
|
8386 |
RETURN (true); |
|
8387 |
%} |
|
8388 |
! |
|
8389 |
||
8390 |
glxPerspectiveFovy:fovy aspect:aspect near:near far:far in:aGLXWindowId |
|
8391 |
"define perspective projection" |
|
8392 |
||
8393 |
%{ /* NOCONTEXT */ |
|
8394 |
||
8395 |
Angle a_fovy; |
|
8396 |
Coord c_near, c_far; |
|
8397 |
float f_aspect; |
|
8398 |
||
8399 |
_ANGLE_ (fovy, a_fovy) |
|
8400 |
_FLOAT_ (aspect, f_aspect) |
|
8401 |
_COORD_ (near, c_near) |
|
8402 |
_COORD_ (far, c_far) |
|
8403 |
||
8404 |
SETWIN(aGLXWindowId) |
|
8405 |
perspective(a_fovy, f_aspect, c_near, c_far); |
|
8406 |
||
8407 |
RETURN (true); |
|
8408 |
%} |
|
8409 |
! |
|
8410 |
||
8411 |
glxPolarviewDist: dist azim: azim inc: inc twist: twist in: aGLXWindowId |
|
8412 |
||
8413 |
%{ /* NOCONTEXT */ |
|
8414 |
Coord c_dist; |
|
8415 |
Angle a_azim, a_inc, a_twist; |
|
8416 |
||
8417 |
_COORD_(dist, c_dist) |
|
8418 |
_ANGLE_(azim, a_azim) |
|
8419 |
_ANGLE_(inc, a_inc) |
|
8420 |
_ANGLE_(twist, a_twist) |
|
8421 |
SETWIN(aGLXWindowId) |
|
8422 |
polarview(c_dist, a_azim, a_inc, a_twist); |
|
8423 |
RETURN (true); |
|
8424 |
%} |
|
8425 |
! |
|
8426 |
||
528 | 8427 |
glxPopviewportIn: aGLXWindowId |
8428 |
"pops the top viewport off the viewport stack" |
|
8429 |
||
8430 |
%{ /* NOCONTEXT */ |
|
8431 |
SETWIN(aGLXWindowId) |
|
8432 |
popviewport(); |
|
8433 |
RETURN (true); |
|
8434 |
%} |
|
8435 |
||
8436 |
"Modified: 19.3.1996 / 18:58:24 / cg" |
|
8437 |
! |
|
8438 |
||
8439 |
glxPushviewportIn: aGLXWindowId |
|
8440 |
"pushes the current viewport on the viewport stack" |
|
8441 |
||
8442 |
%{ /* NOCONTEXT */ |
|
8443 |
SETWIN(aGLXWindowId) |
|
8444 |
pushviewport(); |
|
8445 |
RETURN (true); |
|
8446 |
%} |
|
8447 |
||
8448 |
"Modified: 19.3.1996 / 18:58:02 / cg" |
|
8449 |
! |
|
8450 |
||
294 | 8451 |
glxReshapeViewPortIn: aGLXWindowId |
8452 |
||
8453 |
%{ /* NOCONTEXT */ |
|
8454 |
SETWIN(aGLXWindowId) |
|
8455 |
reshapeviewport(); |
|
8456 |
%} |
|
8457 |
. |
|
8458 |
^ true |
|
8459 |
! |
|
8460 |
||
8461 |
glxViewportLeft:left right:right bottom:bottom top:top in:aGLXWindowId |
|
8462 |
||
8463 |
%{ /* NOCONTEXT */ |
|
8464 |
SETWIN(aGLXWindowId) |
|
8465 |
viewport(_screencoordVal(left), _screencoordVal(right), |
|
8466 |
_screencoordVal(bottom), _screencoordVal(top)); |
|
8467 |
RETURN (true); |
|
8468 |
%} |
|
8469 |
! |
|
8470 |
||
8471 |
glxWindowLeft: left right: right bottom: bottom top: top near: near far: far in: aGLXWindowId |
|
8472 |
"this one was added independently by JEFF - kept for his programs ..." |
|
8473 |
||
8474 |
self glxWindowLeft:left right:right top:top bottom:bottom near:near far:far in:aGLXWindowId |
|
8475 |
! |
|
8476 |
||
8477 |
glxWindowLeft:left right:right top:top bottom:bottom near:near far:far in:aGLXWindowId |
|
8478 |
"define perspective viewing pyramid" |
|
8479 |
||
8480 |
%{ /* NOCONTEXT */ |
|
8481 |
Coord c_left, c_right, c_top, c_bot, c_near, c_far; |
|
8482 |
||
8483 |
_COORD_ (left, c_left) |
|
8484 |
_COORD_ (right, c_right) |
|
8485 |
_COORD_ (top, c_top) |
|
8486 |
_COORD_ (bottom, c_bot) |
|
8487 |
_COORD_ (near, c_near) |
|
8488 |
_COORD_ (far, c_far) |
|
8489 |
SETWIN(aGLXWindowId) |
|
8490 |
window(c_left, c_right, c_bot, c_top, c_near, c_far); |
|
8491 |
||
8492 |
RETURN (true); |
|
8493 |
%} |
|
8494 |
! ! |
|
8495 |
||
8496 |
!GLXWorkstation methodsFor:'window control'! |
|
8497 |
||
8498 |
glxWinclose:gwid in:aGLXWindowId |
|
8499 |
||
8500 |
%{ /* NOCONTEXT */ |
|
8501 |
#ifdef GLX |
|
8502 |
SETWIN(aGLXWindowId) |
|
8503 |
winclose(_longVal(gwid)); |
|
8504 |
RETURN (true); |
|
8505 |
#endif |
|
8506 |
%} |
|
8507 |
. |
|
8508 |
^ false |
|
8509 |
! |
|
8510 |
||
8511 |
glxWinconstraintsIn: aGLXWindowId |
|
8512 |
||
8513 |
%{ /* NOCONTEXT */ |
|
8514 |
#ifdef GLX |
|
8515 |
SETWIN(aGLXWindowId) |
|
8516 |
winconstraints(); |
|
8517 |
RETURN (true); |
|
8518 |
#endif |
|
8519 |
%} |
|
8520 |
. |
|
8521 |
^ false |
|
8522 |
! |
|
8523 |
||
8524 |
glxWindepth: gwid in: aGLXWindowId |
|
8525 |
||
8526 |
%{ /* NOCONTEXT */ |
|
8527 |
#ifdef GLX |
|
8528 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
8529 |
RETURN (__MKSMALLINT(windepth(_longVal(gwid)))); |
294 | 8530 |
#endif |
8531 |
%} |
|
8532 |
. |
|
8533 |
^ false |
|
8534 |
! |
|
8535 |
||
8536 |
glxWingetIn: aGLXWindowId |
|
8537 |
||
8538 |
%{ /* NOCONTEXT */ |
|
8539 |
#ifdef GLX |
|
8540 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
8541 |
RETURN (__MKSMALLINT(winget())); |
294 | 8542 |
#endif |
8543 |
%} |
|
8544 |
. |
|
8545 |
^ false |
|
8546 |
! |
|
8547 |
||
8548 |
glxWinmoveX: x y: y in: aGLXWindowId |
|
8549 |
||
8550 |
%{ /* NOCONTEXT */ |
|
8551 |
#ifdef GLX |
|
8552 |
SETWIN(aGLXWindowId) |
|
8553 |
winmove(_longVal(x), _longVal(y)); |
|
8554 |
RETURN (true); |
|
8555 |
#endif |
|
8556 |
%} |
|
8557 |
. |
|
8558 |
^ false |
|
8559 |
! |
|
8560 |
||
8561 |
glxWinpopIn: aGLXWindowId |
|
8562 |
||
8563 |
%{ /* NOCONTEXT */ |
|
8564 |
#ifdef GLX |
|
8565 |
SETWIN(aGLXWindowId) |
|
8566 |
winpop(); |
|
8567 |
RETURN (true); |
|
8568 |
#endif |
|
8569 |
%} |
|
8570 |
. |
|
8571 |
^ false |
|
8572 |
! |
|
8573 |
||
8574 |
glxWinpositionX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
8575 |
||
8576 |
%{ /* NOCONTEXT */ |
|
8577 |
#ifdef GLX |
|
8578 |
SETWIN(aGLXWindowId) |
|
8579 |
winposition(_longVal(x1), _longVal(y1), _longVal(x2), _longVal(y2)); |
|
8580 |
RETURN (true); |
|
8581 |
#endif |
|
8582 |
%} |
|
8583 |
. |
|
8584 |
^ false |
|
8585 |
! |
|
8586 |
||
8587 |
glxWinpushIn: aGLXWindowId |
|
8588 |
||
8589 |
%{ /* NOCONTEXT */ |
|
8590 |
#ifdef GLX |
|
8591 |
SETWIN(aGLXWindowId) |
|
8592 |
winpush(); |
|
8593 |
RETURN (true); |
|
8594 |
#endif |
|
8595 |
%} |
|
8596 |
. |
|
8597 |
^ false |
|
8598 |
! |
|
8599 |
||
8600 |
glxWinset: gwid in: aGLXWindowId |
|
8601 |
||
8602 |
%{ /* NOCONTEXT */ |
|
8603 |
#ifdef GLX |
|
8604 |
SETWIN(aGLXWindowId) |
|
8605 |
winset(_longVal(gwid)); |
|
8606 |
RETURN (true); |
|
8607 |
#endif |
|
8608 |
%} |
|
8609 |
. |
|
8610 |
^ false |
|
8611 |
! ! |
|
8612 |
||
0 | 8613 |
!GLXWorkstation methodsFor:'window creation'! |
8614 |
||
12 | 8615 |
createGLXWindowFor:aView left:xpos top:ypos width:wwidth height:wheight type:glxType |
157 | 8616 |
|ext wsuperView wsuperViewId windowId| |
0 | 8617 |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
8618 |
glOK ifFalse:[^ nil]. |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
8619 |
|
793 | 8620 |
wsuperView := aView superView view. |
0 | 8621 |
wsuperView notNil ifTrue:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8622 |
wsuperViewId := wsuperView id |
0 | 8623 |
]. |
8624 |
||
524 | 8625 |
%{ /* CALLSSTACK: 20000 */ |
0 | 8626 |
Display *dpy = myDpy; |
185 | 8627 |
int screen = __intVal(_INST(screen)); |
0 | 8628 |
Window newWindow, parentWindow; |
12 | 8629 |
int t; |
0 | 8630 |
|
97 | 8631 |
if (__isSmallInteger(xpos) && __isSmallInteger(ypos) |
8632 |
&& __isSmallInteger(wwidth) && __isSmallInteger(wheight)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8633 |
if (__isExternalAddress(wsuperViewId)) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8634 |
parentWindow = _WindowVal(wsuperViewId); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8635 |
} else { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8636 |
parentWindow = RootWindow(dpy, screen); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8637 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8638 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8639 |
if (glxType == @symbol(colorIndexSingleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8640 |
t = GLXcolorIndexSingleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8641 |
else if (glxType == @symbol(colorIndexDoubleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8642 |
t = GLXcolorIndexDoubleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8643 |
else if (glxType == @symbol(rgbSingleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8644 |
t = GLXrgbSingleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8645 |
else if (glxType == @symbol(rgbDoubleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8646 |
t = GLXrgbDoubleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8647 |
else { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8648 |
RETURN ( nil ); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8649 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8650 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8651 |
ENTERGLX; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8652 |
newWindow = __GLXCreateWindow(dpy, parentWindow, |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8653 |
__intVal(xpos), __intVal(ypos), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8654 |
__intVal(wwidth), __intVal(wheight), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8655 |
0, t); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8656 |
LEAVEGLX; |
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 |
if (! newWindow) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8659 |
RETURN ( nil ); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8660 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8661 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8662 |
windowId = __MKOBJ(newWindow); |
0 | 8663 |
} |
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
8664 |
%}. |
0 | 8665 |
windowId notNil ifTrue:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8666 |
self addKnownView:aView withId:windowId. |
0 | 8667 |
]. |
8668 |
^ windowId |
|
20 | 8669 |
! |
8670 |
||
8671 |
unlinkGLXView:aGLXWindowId |
|
8672 |
"remove X/GLX link" |
|
524 | 8673 |
|
8674 |
%{ /* CALLSSTACK: 20000 */ |
|
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
8675 |
if (__isExternalAddress(aGLXWindowId)) { |
134 | 8676 |
ENTERGLX; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8677 |
__GLXUnlinkWindow(myDpy, _WindowVal(aGLXWindowId)); |
134 | 8678 |
LEAVEGLX; |
8679 |
} |
|
20 | 8680 |
%} |
0 | 8681 |
! ! |
8682 |
||
294 | 8683 |
!GLXWorkstation methodsFor:'zbuffer'! |
8684 |
||
8685 |
glxZbsize: planes in: aGLXWindowId |
|
127 | 8686 |
|
8687 |
%{ /* NOCONTEXT */ |
|
8688 |
#ifdef FULL_GLX |
|
8689 |
SETWIN(aGLXWindowId) |
|
294 | 8690 |
zbsize(_longVal(planes)); |
8691 |
RETURN (true); |
|
8692 |
#endif |
|
8693 |
%} |
|
8694 |
. |
|
8695 |
^ false |
|
8696 |
! |
|
64 | 8697 |
|
8698 |
glxZbuffer:aBoolean in:aGLXWindowId |
|
8699 |
"enable/disable z-buffer operation" |
|
8700 |
||
8701 |
%{ /* NOCONTEXT */ |
|
8702 |
#ifdef GLX |
|
8703 |
SETWIN(aGLXWindowId) |
|
8704 |
zbuffer(aBoolean == false ? FALSE : TRUE); |
|
8705 |
RETURN (true); |
|
8706 |
#endif |
|
8707 |
%} |
|
8708 |
. |
|
8709 |
^ false |
|
294 | 8710 |
! |
64 | 8711 |
|
8712 |
glxZdraw: b in: aGLXWindowId |
|
8713 |
"enable/disable drawing into the z-buffer" |
|
8714 |
||
8715 |
%{ /* NOCONTEXT */ |
|
8716 |
#ifdef GLX |
|
8717 |
SETWIN(aGLXWindowId) |
|
8718 |
zdraw(_booleanVal(b)); |
|
8719 |
RETURN (true); |
|
8720 |
#endif |
|
8721 |
%} |
|
8722 |
. |
|
8723 |
^ false |
|
294 | 8724 |
! |
64 | 8725 |
|
8726 |
glxZfunction: func in: aGLXWindowId |
|
8727 |
"set the z-buffer comparison function. |
|
8728 |
func may be either the numeric value or a symbol (preferred)" |
|
8729 |
||
8730 |
%{ /* NOCONTEXT */ |
|
8731 |
#ifdef GLX |
|
8732 |
long f; |
|
8733 |
||
8734 |
SETWIN(aGLXWindowId) |
|
8735 |
if (func == @symbol(NEVER)) |
|
77 | 8736 |
f = ZF_NEVER; |
64 | 8737 |
else if (func == @symbol(LESS)) |
77 | 8738 |
f = ZF_LESS; |
64 | 8739 |
else if (func == @symbol(EQUAL)) |
77 | 8740 |
f = ZF_EQUAL; |
64 | 8741 |
else if (func == @symbol(LEQUAL)) |
77 | 8742 |
f = ZF_LEQUAL; |
64 | 8743 |
else if (func == @symbol(GREATER)) |
77 | 8744 |
f = ZF_GREATER; |
64 | 8745 |
else if (func == @symbol(NOTEQUAL)) |
77 | 8746 |
f = ZF_NOTEQUAL; |
64 | 8747 |
else if (func == @symbol(GEQUAL)) |
77 | 8748 |
f = ZF_GEQUAL; |
64 | 8749 |
else if (func == @symbol(ALWAYS)) |
77 | 8750 |
f = ZF_ALWAYS; |
64 | 8751 |
else |
77 | 8752 |
f = _longVal(func); |
64 | 8753 |
zfunction(f); |
8754 |
RETURN (true); |
|
8755 |
#endif |
|
8756 |
%} |
|
8757 |
. |
|
8758 |
^ false |
|
294 | 8759 |
! |
64 | 8760 |
|
8761 |
glxZsource: src in: aGLXWindowId |
|
8762 |
||
8763 |
%{ /* NOCONTEXT */ |
|
8764 |
#ifdef GLX |
|
8765 |
SETWIN(aGLXWindowId) |
|
8766 |
zsource(_longVal(src)); |
|
8767 |
RETURN (true); |
|
8768 |
#endif |
|
8769 |
%} |
|
8770 |
. |
|
8771 |
^ false |
|
294 | 8772 |
! |
64 | 8773 |
|
8774 |
glxZwritemask: mask in: aGLXWindowId |
|
8775 |
||
8776 |
%{ /* NOCONTEXT */ |
|
8777 |
#ifdef GLX |
|
8778 |
SETWIN(aGLXWindowId) |
|
185 | 8779 |
zwritemask((ulong)__intVal(mask)); |
64 | 8780 |
RETURN (true); |
8781 |
#endif |
|
8782 |
%} |
|
8783 |
. |
|
8784 |
^ false |
|
8785 |
! ! |
|
8786 |
||
294 | 8787 |
!GLXWorkstation class methodsFor:'documentation'! |
8788 |
||
8789 |
version |
|
1882 | 8790 |
^ '$Header: /cvs/stx/stx/libview/GLXWorkstation.st,v 1.65 1997-08-20 21:43:10 cg Exp $' |
89 | 8791 |
! ! |