author | Claus Gittinger <cg@exept.de> |
Fri, 15 Jan 1999 22:33:42 +0100 | |
changeset 2422 | 6bffcb4c8360 |
parent 2075 | 7fc93b8da816 |
child 2449 | 5fdfb68d0bcc |
permissions | -rw-r--r-- |
0 | 1 |
" |
614 | 2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
77 | 3 |
All Rights Reserved |
0 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
12 |
||
13 |
XWorkstation subclass:#GLXWorkstation |
|
528 | 14 |
instanceVariableNames:'activeWindow hasStereoExtension glOK' |
15 |
classVariableNames:'ForceGL' |
|
16 |
poolDictionaries:'' |
|
17 |
category:'Interface-Graphics' |
|
294 | 18 |
! |
77 | 19 |
|
89 | 20 |
!GLXWorkstation primitiveDefinitions! |
0 | 21 |
%{ |
24 | 22 |
/* |
23 |
* on SGI, this class is compiled with -DGLX, while |
|
29 | 24 |
* for simulation (using vogl), this is compiled with -DVGL |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
25 |
* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
26 |
* New note: starting to support openGL (tm) (compile with -DOPENGL) |
1932 | 27 |
* or its simulation (compile with -DMESA) |
24 | 28 |
*/ |
29 | 29 |
|
0 | 30 |
/* |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
31 |
* SAD, SAD: |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
32 |
* on SGI, the GL library seems to come in different versions, |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
33 |
* some include the functions below, others dont. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
34 |
* To avoid getting undefined symbol errors when linking, these |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
35 |
* functions are not included by default. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
36 |
* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
37 |
* enable the #define below (or compile with -DFULL_GLX) to enable |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
38 |
* the following: |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
39 |
* |
46 | 40 |
* blendcolor getgconfig getmultisample leftbuffer rightbuffer monobuffer |
41 |
* msalpha msmask mspattern mssize multisample stereobuffer |
|
42 |
* t3s t3i t3f t3d t4s t4i t4f t4d tlutbind zbsize |
|
43 |
* |
|
44 |
* these are not available on all gl's |
|
45 |
*/ |
|
46 |
||
1932 | 47 |
#ifdef GLX |
46 | 48 |
/* #define FULL_GLX */ |
1932 | 49 |
#endif |
46 | 50 |
|
51 |
/* |
|
554
34cc776bcc0f
compilable with String/Object definition
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
52 |
* this is stupid, GLX type-defs String, which is also defined here ... |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
53 |
* ... and xlib defines True and False |
554
34cc776bcc0f
compilable with String/Object definition
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
54 |
* It might be a better idea, to completely separate GLX stuff from ST/X |
0 | 55 |
*/ |
1899 | 56 |
#ifdef String |
57 |
# undef String |
|
58 |
#endif |
|
59 |
#define String GLX_String |
|
60 |
||
61 |
#ifdef Object |
|
62 |
# undef Object |
|
63 |
#endif |
|
64 |
#define Object GLX_Object |
|
65 |
||
66 |
#undef True |
|
67 |
#undef False |
|
68 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
69 |
#if defined(__openVMS__) || defined(LINUX) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
70 |
/* |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
71 |
* mhmh - used in stdio ... |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
72 |
* (new linuxes) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
73 |
*/ |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
74 |
# undef __new |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
75 |
# define __NEED_REDEF_new__ |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
76 |
#endif |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
77 |
|
1899 | 78 |
#ifdef __VMS__ |
79 |
# include "vms_Xnames.h" |
|
80 |
#endif |
|
24 | 81 |
|
168 | 82 |
#include <stdio.h> |
83 |
||
1932 | 84 |
#ifndef OPENGL |
85 |
# ifdef MESA |
|
86 |
# define OPENGL |
|
87 |
# endif |
|
88 |
#endif |
|
89 |
||
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
90 |
#ifdef OPENGL /* SGI or others OPENGL library */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
91 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
92 |
# include "GL/gl.h" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
93 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
94 |
# ifdef MESA /* GNU MESA openGL simulation */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
95 |
# include "GL/xmesa.h" |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
96 |
# define OPENGLCONTEXT XMesaContext |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
97 |
# define GLXMAKECURRENT(dpy, draw, con) XMesaMakeCurrent(con) |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
98 |
# else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
99 |
/* 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
|
100 |
# define OPENGLCONTEXT GLXContext |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
101 |
# 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
|
102 |
# endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
103 |
|
24 | 104 |
#else |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
105 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
106 |
# ifdef GLX /* SGI's GL library */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
107 |
# include <gl/glws.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
108 |
# include <gl/sphere.h> |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
109 |
# else /* VOGL GL simulation */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
110 |
# undef memset |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
111 |
# include <vogl.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
112 |
# undef move |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
113 |
# include <X11/Xlib.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
114 |
# endif |
24 | 115 |
#endif |
0 | 116 |
|
185 | 117 |
/* |
118 |
* XSGIStereo extension - if available |
|
119 |
*/ |
|
120 |
#ifdef XSGIStereo |
|
121 |
# include <X11/extensions/SGIStereo.h> |
|
122 |
#endif |
|
123 |
||
35 | 124 |
#ifndef NULL |
58 | 125 |
# define NULL (char *)0 /* sigh */ |
35 | 126 |
#endif |
127 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
128 |
#ifdef __NEED_REDEF_new__ |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
129 |
# define __new __STX___new |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
130 |
#endif |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
131 |
|
0 | 132 |
typedef enum { |
133 |
GLXcolorIndexSingleBuffer, |
|
134 |
GLXcolorIndexDoubleBuffer, |
|
135 |
GLXrgbSingleBuffer, |
|
136 |
GLXrgbDoubleBuffer |
|
137 |
} GLXWindowType; |
|
138 |
||
333 | 139 |
# define ENTERGLX __BEGIN_PROTECT_REGISTERS__ |
140 |
# define LEAVEGLX __END_PROTECT_REGISTERS__ |
|
134 | 141 |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
142 |
/* |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
143 |
* 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
|
144 |
*/ |
0 | 145 |
#undef String |
969 | 146 |
#ifdef __DEF_String |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
147 |
# define String __DEF_String |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
148 |
#endif |
969 | 149 |
#undef Object |
150 |
#ifdef __DEF_Object |
|
151 |
# define Object __DEF_Object |
|
152 |
#endif |
|
0 | 153 |
|
154 |
/* |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
155 |
* mhmh - openGL has its separate gl-context, |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
156 |
* which is distinct (?) from the windowID. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
157 |
* We dont want to add another instvar to View - do we ? |
0 | 158 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
159 |
#if defined(OPENGL) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
160 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
161 |
# ifndef MAX_OPENGL_VIEWS |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
162 |
# define MAX_OPENGL_VIEWS 50 |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
163 |
# endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
164 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
165 |
struct windowIDToGLContextMapping { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
166 |
Window win; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
167 |
OPENGLCONTEXT con; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
168 |
}; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
169 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
170 |
static struct windowIDToGLContextMapping windowIDToGLContextMapping[MAX_OPENGL_VIEWS]; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
171 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
172 |
static OPENGLCONTEXT |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
173 |
__glxWindowIdToGLContext(xId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
174 |
Window xId; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
175 |
{ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
176 |
int i; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
177 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
178 |
for (i=0; i<MAX_OPENGL_VIEWS; i++) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
179 |
if (windowIDToGLContextMapping[i].win == xId) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
180 |
return windowIDToGLContextMapping[i].con; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
181 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
182 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
183 |
return (OPENGLCONTEXT) 0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
184 |
} |
0 | 185 |
|
157 | 186 |
/* |
187 |
* set the GLXWindow for followup drawing |
|
188 |
*/ |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
189 |
#define SETWIN(aGLXWindowId) \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
190 |
{ \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
191 |
OPENGLCONTEXT context; \ |
553
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 |
if (_INST(activeWindow) != aGLXWindowId) { \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
194 |
if (! ISCONNECTED ) { \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
195 |
RETURN (false); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
196 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
197 |
if (! __isExternalAddress(aGLXWindowId)) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
198 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
199 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
200 |
context = (OPENGLCONTEXT) __glxWindowIdToGLContext(_WindowVal(aGLXWindowId)); \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
201 |
if (! context) { \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
202 |
RETURN (false); \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
203 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
204 |
GLXMAKECURRENT(myDpy, _WindowVal(aGLXWindowId), context ); \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
205 |
_INST(activeWindow) = aGLXWindowId; \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
206 |
__STORE(self, aGLXWindowId); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
207 |
} else { \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
208 |
if (aGLXWindowId == nil) { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
209 |
RETURN (false); \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
210 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
211 |
} \ |
12 | 212 |
} |
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 |
#else /* old GL */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
216 |
|
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 |
* set the GLXWindow for followup drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
219 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
220 |
#define SETWIN(aGLXWindowId) \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
221 |
{ \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
222 |
if (_INST(activeWindow) != aGLXWindowId) { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
223 |
if (! ISCONNECTED ) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
224 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
225 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
226 |
if (! __isExternalAddress(aGLXWindowId)) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
227 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
228 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
229 |
if (GLXwinset(myDpy, _WindowVal(aGLXWindowId)) < 0) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
230 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
231 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
232 |
_INST(activeWindow) = aGLXWindowId; \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
233 |
__STORE(self, aGLXWindowId); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
234 |
} else { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
235 |
if (aGLXWindowId == nil) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
236 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
237 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
238 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
239 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
240 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
241 |
#endif /* old GL */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
242 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
243 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
244 |
* some defines - tired of typing ... |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
245 |
* 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
|
246 |
* put/pack them into corresponding c variables. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
247 |
* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
248 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
249 |
#ifdef OPENGL |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
250 |
# define Boolean int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
251 |
# define TRUE 1 |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
252 |
# define FALSE 0 |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
253 |
# define Coord float |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
254 |
# define Icoord int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
255 |
# define Scoord int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
256 |
# define Colorindex int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
257 |
# define Linestyle int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
258 |
# define Offset int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
259 |
# define Angle int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
260 |
# define Screencoord int |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
261 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
262 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
263 |
#define myDpy (Display *)(__MKCP(_INST(displayId))) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
264 |
#define ISCONNECTED (_INST(displayId) != nil) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
265 |
#define _WindowVal(o) (Window)(__MKCP(o)) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
266 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
267 |
#define __MKBOOLEAN(b) ((b==FALSE) ? false : true) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
268 |
#define _booleanVal(b) ((b==false) ? (Boolean)FALSE : (Boolean)TRUE) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
269 |
#define _coordVal(c) ((__isFloat(c)) ? (Coord)(_floatVal(c)) : (Coord)(__intVal(c))) |
185 | 270 |
#define _icoordVal(c) ((Icoord)(__intVal(c))) |
271 |
#define _scoordVal(c) ((Scoord)(__intVal(c))) |
|
272 |
#define _screencoordVal(c) ((Screencoord)(__intVal(c))) |
|
273 |
#define _colorindexVal(c) ((Colorindex)(__intVal(c))) |
|
274 |
#define _linestyleVal(l) ((Linestyle)(__intVal(l))) |
|
275 |
#define _shortVal(l) ((short)(__intVal(l))) |
|
276 |
#define _longVal(l) ((long)(__intVal(l))) |
|
277 |
#define _deviceVal(l) ((Device)(__intVal(l))) |
|
278 |
#define _tagVal(l) ((Tag)(__intVal(l))) |
|
969 | 279 |
#define _objectVal(l) ((GLX_Object)(__intVal(l))) |
185 | 280 |
#define _offsetVal(l) ((Offset)(__intVal(l))) |
281 |
#define _rgbVal(l) ((RGBvalue)(__intVal(l))) |
|
282 |
#define _angleVal(c) ((Angle)(__intVal(c))) |
|
157 | 283 |
|
29 | 284 |
/* |
285 |
* 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
|
286 |
* ST-object must be true or false. Return from method if invalid. |
29 | 287 |
*/ |
288 |
#define _BOOLEAN_(arg, dst) \ |
|
30 | 289 |
if (arg==true) \ |
77 | 290 |
dst = (Boolean)TRUE; \ |
30 | 291 |
else if (arg==false) \ |
77 | 292 |
dst = (Boolean)FALSE; \ |
29 | 293 |
else { RETURN(false); } |
294 |
||
295 |
/* |
|
296 |
* check for and fetch a coord from ST-arg into C-dst |
|
157 | 297 |
* ST-object must be Float, SmallInteger or Fraction. |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
298 |
* Return from method if invalid. |
29 | 299 |
*/ |
0 | 300 |
#define _COORD_(arg, dst) \ |
97 | 301 |
if (__isFloat(arg)) \ |
77 | 302 |
dst = (Coord)(_floatVal(arg)); \ |
97 | 303 |
else if (__isSmallInteger(arg)) \ |
185 | 304 |
dst = (Coord)(__intVal(arg)); \ |
97 | 305 |
else if (__isFraction(arg) \ |
306 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_numerator) \ |
|
307 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_denominator)) { \ |
|
77 | 308 |
float n, d; \ |
309 |
\ |
|
185 | 310 |
n = (float)(__intVal(_FractionInstPtr(arg)->f_numerator)); \ |
311 |
d = (float)(__intVal(_FractionInstPtr(arg)->f_denominator)); \ |
|
77 | 312 |
dst = (Coord)(n / d); \ |
29 | 313 |
} else { RETURN(false); } |
314 |
||
315 |
/* |
|
316 |
* 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
|
317 |
* ST-object must be SmallInteger. Return from method if invalid. |
29 | 318 |
*/ |
319 |
#define _ICOORD_(arg, dst) \ |
|
97 | 320 |
if (__isSmallInteger(arg)) \ |
185 | 321 |
dst = (Icoord)(__intVal(arg)); \ |
29 | 322 |
else { RETURN(false); } |
323 |
||
324 |
/* |
|
157 | 325 |
* 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
|
326 |
* ST-object must be SmallInteger. Return from method if invalid. |
29 | 327 |
*/ |
328 |
#define _SCOORD_(arg, dst) \ |
|
97 | 329 |
if (__isSmallInteger(arg)) \ |
185 | 330 |
dst = (Scoord)(__intVal(arg)); \ |
29 | 331 |
else { RETURN(false); } |
332 |
||
333 |
#define _SCREENCOORD_(arg, dst) \ |
|
97 | 334 |
if (__isSmallInteger(arg)) \ |
185 | 335 |
dst = (Screencoord)(__intVal(arg)); \ |
29 | 336 |
else { RETURN(false); } |
337 |
||
338 |
#define _COLORINDEX_(arg, dst) \ |
|
97 | 339 |
if (__isSmallInteger(arg)) \ |
185 | 340 |
dst = (Colorindex)(__intVal(arg)); \ |
29 | 341 |
else { RETURN(false); } |
342 |
||
343 |
#define _ANGLE_(arg, dst) \ |
|
97 | 344 |
if (__isSmallInteger(arg)) \ |
185 | 345 |
dst = (Angle)(__intVal(arg)); \ |
29 | 346 |
else { RETURN(false); } |
0 | 347 |
|
348 |
#define _FLOAT_(arg, dst) \ |
|
97 | 349 |
if (__isFloat(arg)) \ |
77 | 350 |
dst = (float)(_floatVal(arg)); \ |
97 | 351 |
else if (__isSmallInteger(arg)) \ |
185 | 352 |
dst = (float)(__intVal(arg)); \ |
97 | 353 |
else if (__isFraction(arg) \ |
354 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_numerator) \ |
|
355 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_denominator)) { \ |
|
77 | 356 |
float n, d; \ |
357 |
\ |
|
185 | 358 |
n = (float)(__intVal(_FractionInstPtr(arg)->f_numerator)); \ |
359 |
d = (float)(__intVal(_FractionInstPtr(arg)->f_denominator)); \ |
|
77 | 360 |
dst = (float)(n / d); \ |
29 | 361 |
} else { RETURN(false); } |
0 | 362 |
|
363 |
#define _INT_(arg, dst) \ |
|
97 | 364 |
if (__isSmallInteger(arg)) \ |
185 | 365 |
dst = (int)(__intVal(arg)); \ |
29 | 366 |
else { RETURN(false); } |
367 |
||
30 | 368 |
#define _indexedArea(object) \ |
369 |
(((char *) (_InstPtr(object))) \ |
|
77 | 370 |
+ OHDR_SIZE \ |
185 | 371 |
+ (__intVal(_ClassInstPtr(__qClass(object))->c_ninstvars)) * sizeof(OBJ)) |
77 | 372 |
%} |
373 |
! ! |
|
374 |
||
168 | 375 |
!GLXWorkstation primitiveVariables! |
376 |
%{ |
|
377 |
/* |
|
378 |
* remembered info from private error handler |
|
379 |
*/ |
|
380 |
static char lastErrorMsg[80] = ""; |
|
381 |
static unsigned lastRequestCode = 0; |
|
382 |
static unsigned lastMinorCode = 0; |
|
383 |
static unsigned lastResource = 0; |
|
384 |
||
385 |
%} |
|
386 |
! ! |
|
387 |
||
89 | 388 |
!GLXWorkstation primitiveFunctions! |
77 | 389 |
%{ |
151 | 390 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
391 |
#ifdef DYNAMICALLY_LOADABLE |
168 | 392 |
/* |
393 |
* catch X-errors and forward as errorInterrupt:#DisplayError, |
|
394 |
* (which itself invokes my handler and optionally raises an exceptionSignal) |
|
395 |
* the implementation below is somewhat wrong: it will |
|
396 |
* report all errors for Display, even though there could be |
|
397 |
* more than one display connection. (being fixed, new errorInterrupt mechanism |
|
398 |
* allows passing an additional argument, which is the displayID ...) |
|
399 |
* |
|
400 |
* this dublicates the functionality as found in XWorkstation; |
|
401 |
* the reason is to allow dynamic loading systems to load this module |
|
402 |
* before XWorkstation (which was not possible otherwise, due to unresolved |
|
403 |
* external references while loading this one) |
|
404 |
*/ |
|
405 |
static |
|
406 |
__XErrorHandler__(dpy, event) |
|
407 |
Display *dpy; |
|
408 |
XErrorEvent *event; |
|
409 |
{ |
|
410 |
XGetErrorText(dpy, event->error_code, lastErrorMsg, 80); |
|
411 |
if (lastErrorMsg[0] == '\0') { |
|
185 | 412 |
sprintf(lastErrorMsg, "code: %d", event->error_code); |
168 | 413 |
} |
414 |
lastRequestCode = event->request_code; |
|
415 |
lastMinorCode = event->minor_code; |
|
416 |
lastResource = event->resourceid; |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
417 |
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
|
418 |
/* |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
419 |
* 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
|
420 |
* 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
|
421 |
* in non bottom-up window order. |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
422 |
*/ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
423 |
return 0; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
424 |
} |
168 | 425 |
|
218
10072d9beba5
can now turn off Xlib error messages from the errorHandler
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
426 |
if (@global(ErrorPrinting) == true) { |
1932 | 427 |
fprintf(stderr, "GLXWORKSTAT: x-error caught maj=%d (0x%x) min=%d (0x%x) resource=%x\n", |
219
9ff0660f447f
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
218
diff
changeset
|
428 |
event->request_code, event->request_code, |
9ff0660f447f
uff - version methods changed to return stings
Claus Gittinger <cg@exept.de>
parents:
218
diff
changeset
|
429 |
event->minor_code, event->minor_code, event->resourceid); |
1932 | 430 |
fprintf(stderr, "GLXWORKSTAT: x-error message is [%d] '%s'\n", event->error_code, lastErrorMsg); |
218
10072d9beba5
can now turn off Xlib error messages from the errorHandler
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
431 |
} |
168 | 432 |
|
207
9124817bbb03
use new c-pointer wrapper macros (based on externalAddress)
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
433 |
__errorInterruptWithIDAndParameter__(@symbol(DisplayError), __MKOBJ(dpy)); |
168 | 434 |
return 0; |
435 |
} |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
436 |
#else |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
437 |
extern __XErrorHandler__(); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
438 |
#endif |
168 | 439 |
|
151 | 440 |
/* |
441 |
* begin moved from GLXsupport.c |
|
442 |
*/ |
|
443 |
||
444 |
/* |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
445 |
* This provides a helper function "GLXCreateWindow", which does |
151 | 446 |
* 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
|
447 |
* to take place within. See the definition of GLXCreateWindow for a |
151 | 448 |
* description of how to call it. |
449 |
* |
|
450 |
* claus: I really had no time to look into all this, |
|
451 |
* this file has been just copied from a 4Dgifts demo .. |
|
452 |
* (will need more than a day to show more ...) |
|
453 |
*/ |
|
1932 | 454 |
#if !defined(OPENGL) |
151 | 455 |
|
1899 | 456 |
# include <X11/Xlib.h> |
457 |
# include <X11/Xutil.h> |
|
458 |
# ifndef VGL |
|
459 |
# include <gl/glws.h> |
|
460 |
# endif |
|
461 |
# include <signal.h> |
|
462 |
# include <setjmp.h> |
|
463 |
# include "stcIntern.h" |
|
151 | 464 |
|
465 |
/* |
|
466 |
* glxhelper.h: |
|
467 |
* |
|
468 |
* List of drawing modes supported by GLXCreateWindow (in glxhelper.c). |
|
469 |
* More than this are possible with mixed model, but this is just an |
|
470 |
* example. You can either expand this list (and the corresponding code in |
|
471 |
* GLXCreateWindow) or call the mixed model calls yourself, using |
|
472 |
* GLXCreateWindow as an example. |
|
473 |
*/ |
|
474 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
475 |
static char * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
476 |
typeToName[] = { |
151 | 477 |
"color index single buffer", |
478 |
"color index double buffer", |
|
479 |
"rgb single buffer", |
|
480 |
"rgb double buffer", |
|
481 |
}; |
|
482 |
||
1932 | 483 |
#endif /* GLX || VGL */ |
484 |
||
485 |
#if defined(GLX) && !defined(VGL) |
|
151 | 486 |
/* |
487 |
* Dorky little helper function used to build up a GLXconfig array. |
|
488 |
*/ |
|
489 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
490 |
static void |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
491 |
set_entry (GLXconfig* ptr, int b, int m, int a) |
151 | 492 |
{ |
493 |
ptr->buffer = b; |
|
494 |
ptr->mode = m; |
|
495 |
ptr->arg = a; |
|
496 |
} |
|
1932 | 497 |
#endif /* GLX & not VGL */ |
151 | 498 |
|
499 |
static JMP_BUF errorReturn; |
|
500 |
||
501 |
static void |
|
502 |
glAbort() { |
|
503 |
longjmp(errorReturn, 1); |
|
504 |
} |
|
505 |
||
506 |
/* |
|
507 |
* GLXCreateWindow(dpy, parent, x, y, w, h, boderWidth, type) |
|
508 |
* |
|
509 |
* Return value is the X window id of the newly created window. |
|
510 |
* |
|
511 |
* Arguments are: |
|
512 |
* dpy The X "Display*" returned by XOpenDisplay |
|
513 |
* parent The parent of the newly created window, |
|
514 |
* a typical value for this is |
|
515 |
* RootWindow(dpy, DefaultScreen(dpy)) |
|
516 |
* x,y The location of the window to be created, |
|
517 |
* y coordinate is measured from the top down. |
|
518 |
* w,h size of the new window |
|
519 |
* borderWidth the X border size for this window, should probably |
|
520 |
* be zero. |
|
521 |
* type the GLXWindowType (see glxhelper.h) desribing the |
|
522 |
* typer of GL drawing to be done in this window |
|
523 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
524 |
Window |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
525 |
__GLXCreateWindow(dpy, parent, x, y, w, h, borderWidth, type) |
151 | 526 |
Display* dpy; |
527 |
Window parent; |
|
528 |
GLXWindowType type; |
|
529 |
{ |
|
1932 | 530 |
#if !defined(OPENGL) |
531 |
# ifndef VGL |
|
151 | 532 |
GLXconfig params[50]; |
533 |
GLXconfig* next; |
|
534 |
GLXconfig* retconfig; |
|
535 |
Colormap cmap = DefaultColormap(dpy, DefaultScreen(dpy)); |
|
1932 | 536 |
# endif |
537 |
#endif |
|
538 |
Visual visual; |
|
151 | 539 |
XVisualInfo *vis; |
540 |
XVisualInfo template; |
|
541 |
XColor white; |
|
542 |
XSetWindowAttributes cwa; |
|
543 |
XWindowAttributes pwa; |
|
544 |
int scr, i, nret; |
|
545 |
Window win; |
|
1932 | 546 |
#ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
547 |
struct sigaction oldSig, newSig; |
1932 | 548 |
#else |
151 | 549 |
void *oldSig; |
1932 | 550 |
#endif |
551 |
||
552 |
#if !defined(OPENGL) |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
553 |
__catchExit(1); |
1932 | 554 |
#endif |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
555 |
|
151 | 556 |
if (setjmp(errorReturn)) { |
557 |
printf("hard error in GL - return\n"); |
|
1932 | 558 |
#ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
559 |
sigaction(SIGSEGV, &oldSig, 0); |
1932 | 560 |
#else |
151 | 561 |
signal(SIGSEGV, oldSig); |
1932 | 562 |
#endif |
563 |
#if !defined(OPENGL) |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
564 |
__catchExit(0); |
1932 | 565 |
#endif |
151 | 566 |
return 0; |
567 |
} |
|
568 |
__CONT__ |
|
569 |
||
1932 | 570 |
if (w <= 0) { |
571 |
printf("GL: bad width: %d\n", w); |
|
572 |
w = 1; |
|
573 |
} |
|
574 |
if (h <= 0) { |
|
575 |
printf("GL: bad height: %d\n", h); |
|
576 |
h = 1; |
|
577 |
} |
|
578 |
||
579 |
#if !defined(OPENGL) |
|
1899 | 580 |
# ifdef VGL |
151 | 581 |
/* |
582 |
* I know what VGL supports; its somewhat unclean to hard code it here |
|
583 |
*/ |
|
584 |
switch (type) { |
|
585 |
case GLXcolorIndexSingleBuffer: |
|
586 |
case GLXcolorIndexDoubleBuffer: |
|
587 |
break; |
|
588 |
||
589 |
case GLXrgbSingleBuffer: |
|
590 |
case GLXrgbDoubleBuffer: |
|
591 |
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
|
592 |
__catchExit(0); |
151 | 593 |
return 0; |
594 |
} |
|
595 |
||
596 |
scr = DefaultScreen(dpy); |
|
597 |
visual.visualid = CopyFromParent; |
|
598 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
599 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
600 |
borderWidth, DisplayPlanes(dpy, scr), |
|
601 |
InputOutput, &visual, |
|
602 |
CWBorderPixel, &cwa); |
|
603 |
||
604 |
/* |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
605 |
* on some, seg-violations occur in the GL, if too many |
151 | 606 |
* views are created ... just to make certain, we catch those |
607 |
* in GL too. |
|
608 |
*/ |
|
1899 | 609 |
# ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
610 |
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
|
611 |
newSig = oldSig; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
612 |
newSig.sa_handler = glAbort; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
613 |
sigaction(SIGSEGV, &newSig, (struct sigaction *)0); |
1899 | 614 |
# else |
151 | 615 |
oldSig = signal(SIGSEGV, glAbort); |
1899 | 616 |
# endif |
151 | 617 |
i = GLXlink(dpy, win); |
1899 | 618 |
# ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
619 |
sigaction(SIGSEGV, &oldSig, (struct sigaction *)0); |
1899 | 620 |
# else |
151 | 621 |
signal(SIGSEGV, oldSig); |
1899 | 622 |
# endif |
151 | 623 |
|
624 |
if (i < 0) { |
|
625 |
printf("GLXlink returned %d\n", i); |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
626 |
__catchExit(0); |
151 | 627 |
return 0; |
628 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
629 |
|
1899 | 630 |
# else /* not VGL */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
631 |
|
151 | 632 |
/* |
633 |
* This builds an array in "params" that describes for GLXgetconfig(3G) |
|
634 |
* the type of GL drawing that will be done. |
|
635 |
*/ |
|
636 |
next = params; |
|
637 |
switch (type) { |
|
638 |
case GLXcolorIndexSingleBuffer: |
|
639 |
set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE); |
|
640 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE); |
|
641 |
break; |
|
642 |
case GLXcolorIndexDoubleBuffer: |
|
643 |
set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE); |
|
644 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE); |
|
645 |
break; |
|
646 |
case GLXrgbSingleBuffer: |
|
647 |
set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE); |
|
648 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE); |
|
649 |
break; |
|
650 |
case GLXrgbDoubleBuffer: |
|
651 |
set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE); |
|
652 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE); |
|
653 |
break; |
|
654 |
} |
|
655 |
set_entry(next, 0, 0, 0); /* The input to GLXgetconfig is null terminated */ |
|
656 |
||
657 |
/* |
|
658 |
* Get configuration data for a window based on above parameters |
|
659 |
* First we have to find out which screen the parent window is on, |
|
660 |
* then we can call GXLgetconfig() |
|
661 |
*/ |
|
662 |
XGetWindowAttributes(dpy, parent, &pwa); |
|
663 |
retconfig = GLXgetconfig(dpy, XScreenNumberOfScreen(pwa.screen), params); |
|
664 |
if (retconfig == 0) { |
|
665 |
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
|
666 |
__catchExit(0); |
151 | 667 |
return 0; |
668 |
} |
|
669 |
||
670 |
/* |
|
671 |
* Scan through config info, pulling info needed to create a window |
|
672 |
* that supports the rendering mode. |
|
673 |
*/ |
|
674 |
for (next = retconfig; next->buffer; next++) { |
|
675 |
unsigned long buffer = next->buffer; |
|
676 |
unsigned long mode = next->mode; |
|
677 |
unsigned long value = next->arg; |
|
678 |
switch (mode) { |
|
679 |
case GLX_COLORMAP: |
|
680 |
if (buffer == GLX_NORMAL) { |
|
681 |
cmap = value; |
|
682 |
} |
|
683 |
break; |
|
684 |
case GLX_VISUAL: |
|
685 |
if (buffer == GLX_NORMAL) { |
|
686 |
template.visualid = value; |
|
687 |
template.screen = DefaultScreen(dpy); |
|
688 |
vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask, |
|
689 |
&template, &nret); |
|
690 |
} |
|
691 |
break; |
|
692 |
} |
|
693 |
} |
|
694 |
||
695 |
/* |
|
696 |
* Create the window |
|
697 |
*/ |
|
698 |
cwa.colormap = cmap; |
|
699 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
700 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
701 |
borderWidth, vis->depth, InputOutput, vis->visual, |
|
702 |
CWColormap|CWBorderPixel, &cwa); |
|
703 |
||
704 |
/* |
|
705 |
* Rescan configuration info and find window slot that getconfig |
|
706 |
* provided. Fill it in with the window we just created. |
|
707 |
*/ |
|
708 |
for (next = retconfig; next->buffer; next++) { |
|
709 |
if ((next->buffer == GLX_NORMAL) && (next->mode == GLX_WINDOW)) { |
|
710 |
next->arg = win; |
|
711 |
break; |
|
712 |
} |
|
713 |
} |
|
714 |
||
715 |
/* |
|
716 |
* Now "retconfig" contains all the information the GL needs to |
|
717 |
* configure the window and its own internal state. |
|
718 |
*/ |
|
719 |
/* |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
720 |
* on iris, seg-violations occur in the GL, if too many |
151 | 721 |
* views are created ... |
722 |
*/ |
|
1899 | 723 |
# ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
724 |
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
|
725 |
newSig = oldSig; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
726 |
newSig.sa_handler = glAbort; |
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
727 |
sigaction(SIGSEGV, &newSig, (struct sigaction *)0); |
1899 | 728 |
# else |
151 | 729 |
oldSig = signal(SIGSEGV, glAbort); |
1899 | 730 |
# endif |
151 | 731 |
i = GLXlink(dpy, retconfig); |
1899 | 732 |
# ifdef HAS_SIGACTION |
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
733 |
sigaction(SIGSEGV, &oldSig, (struct sigaction *)0); |
1899 | 734 |
# else |
151 | 735 |
signal(SIGSEGV, oldSig); |
1899 | 736 |
# endif |
151 | 737 |
|
738 |
if (i < 0) { |
|
739 |
printf("GLXlink returned %d\n", i); |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
740 |
__catchExit(0); |
151 | 741 |
return 0; |
742 |
} |
|
743 |
||
744 |
/* |
|
745 |
* The GL sets its own X error handlers, which exits - this is not what we want |
|
746 |
*/ |
|
747 |
XSetErrorHandler(__XErrorHandler__); |
|
1899 | 748 |
# endif /* not VGL */ |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
749 |
__catchExit(0); |
1932 | 750 |
|
751 |
#else /* OPENGL | MESA */ |
|
752 |
||
753 |
scr = DefaultScreen(dpy); |
|
754 |
visual.visualid = CopyFromParent; |
|
755 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
756 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
757 |
borderWidth, DisplayPlanes(dpy, scr), |
|
758 |
InputOutput, &visual, |
|
759 |
CWBorderPixel, &cwa); |
|
760 |
||
761 |
vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask, &visual, &nret); |
|
762 |
printf("vis is %x\n", vis); |
|
763 |
#endif /* GLX || VGL */ |
|
764 |
||
151 | 765 |
return win; |
766 |
} |
|
767 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
768 |
__GLXUnlinkWindow(dpy, win) |
151 | 769 |
Display* dpy; |
770 |
Window win; |
|
771 |
{ |
|
772 |
/* |
|
773 |
* only needed for VGL - GLX does it automatically |
|
774 |
*/ |
|
1932 | 775 |
#ifdef VGL |
151 | 776 |
GLXunlink(dpy, win); |
1932 | 777 |
#endif |
151 | 778 |
} |
779 |
||
29 | 780 |
/* |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
781 |
* helper for rotation - calls rot() |
29 | 782 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
783 |
OBJ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
784 |
__glx_doRotate(angle, axis) |
29 | 785 |
OBJ angle; |
786 |
char axis; |
|
787 |
{ |
|
788 |
float f_angle; |
|
789 |
||
35 | 790 |
if (__isFloat(angle)) { |
77 | 791 |
f_angle = (float)(_floatVal(angle)); |
1932 | 792 |
if (f_angle != 0.0) { |
793 |
#ifdef OPENGL |
|
794 |
#else |
|
77 | 795 |
rot(f_angle, axis); |
1932 | 796 |
#endif |
797 |
} |
|
77 | 798 |
return (true); |
29 | 799 |
} |
35 | 800 |
if (__isFraction(angle) |
97 | 801 |
&& __isSmallInteger(_FractionInstPtr(angle)->f_numerator) |
802 |
&& __isSmallInteger(_FractionInstPtr(angle)->f_denominator)) { |
|
77 | 803 |
float n, d; |
804 |
||
185 | 805 |
n = (float)(__intVal(_FractionInstPtr(angle)->f_numerator)); |
806 |
d = (float)(__intVal(_FractionInstPtr(angle)->f_denominator)); |
|
77 | 807 |
f_angle = n / d; |
1932 | 808 |
if (f_angle != 0.0) { |
809 |
#ifdef OPENGL |
|
810 |
#else |
|
77 | 811 |
rot(f_angle, axis); |
1932 | 812 |
#endif |
813 |
} |
|
77 | 814 |
return (true); |
29 | 815 |
} |
97 | 816 |
if (__isSmallInteger(angle)) { |
185 | 817 |
f_angle = (float)(__intVal(angle)); |
1932 | 818 |
if (f_angle != 0.0) { |
819 |
#ifdef OPENGL |
|
820 |
#else |
|
77 | 821 |
rot(f_angle, axis); |
1932 | 822 |
#endif |
823 |
} |
|
77 | 824 |
return (true); |
29 | 825 |
} |
826 |
return false; |
|
827 |
} |
|
0 | 828 |
|
24 | 829 |
/* |
29 | 830 |
* fetch integers from an st-array (elements must be smallIntegers) |
831 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
832 |
long * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
833 |
__glx_getLongsFromInto(obj, vec, count) |
29 | 834 |
OBJ obj; |
835 |
long *vec; |
|
836 |
{ |
|
837 |
OBJ cls, o; |
|
838 |
int nByte, i, ninstVars, nInstBytes; |
|
839 |
char *pElem; |
|
840 |
||
841 |
if (! _isNonNilObject(obj)) return (long *)NULL; |
|
134 | 842 |
cls = __qClass(obj); |
185 | 843 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 844 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 845 |
nByte = __qSize(obj) - nInstBytes; |
29 | 846 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
847 |
if (nByte < (count * sizeof(OBJ))) return (long *)NULL; |
|
848 |
for (i=0; i<count; i++) { |
|
77 | 849 |
o = *(OBJ *)pElem; |
97 | 850 |
if (! __isSmallInteger(o)) return (long *)NULL; |
185 | 851 |
vec[i] = (long)__intVal(o); |
77 | 852 |
pElem += sizeof(OBJ); |
29 | 853 |
} |
854 |
return vec; |
|
855 |
} |
|
856 |
||
857 |
/* |
|
858 |
* fetch shorts from an st-array (elements must be smallIntegers) |
|
859 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
860 |
short * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
861 |
__glx_getShortsFromInto(obj, vec, count) |
29 | 862 |
OBJ obj; |
863 |
short *vec; |
|
864 |
{ |
|
865 |
OBJ cls, o; |
|
866 |
int nByte, i, ninstVars, nInstBytes; |
|
867 |
char *pElem; |
|
868 |
||
869 |
if (! _isNonNilObject(obj)) return (short *)NULL; |
|
134 | 870 |
cls = __qClass(obj); |
185 | 871 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 872 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 873 |
nByte = __qSize(obj) - nInstBytes; |
29 | 874 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
875 |
if (nByte < (count * sizeof(OBJ))) return (short *)NULL; |
|
876 |
for (i=0; i<count; i++) { |
|
77 | 877 |
o = *(OBJ *)pElem; |
97 | 878 |
if (! __isSmallInteger(o)) return (short *)NULL; |
185 | 879 |
vec[i] = (short)__intVal(o); |
77 | 880 |
pElem += sizeof(OBJ); |
29 | 881 |
} |
882 |
return vec; |
|
883 |
} |
|
884 |
||
885 |
/* |
|
886 |
* fetch floats from an st-object into a c-float array |
|
887 |
* which may be a floatArray, doubleArray or array-of-something, |
|
888 |
* where something may be a float, fraction or smallInteger, |
|
24 | 889 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
890 |
float * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
891 |
__glx_getFloatsFromInto(obj, vec, count) |
12 | 892 |
OBJ obj; |
893 |
float *vec; |
|
894 |
{ |
|
895 |
OBJ cls; |
|
896 |
int nByte; |
|
897 |
OBJ o; |
|
898 |
int i, ninstVars, nInstBytes; |
|
899 |
char *pElem; |
|
900 |
||
901 |
if (! _isNonNilObject(obj)) return (float *)0; |
|
902 |
||
134 | 903 |
cls = __qClass(obj); |
185 | 904 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
12 | 905 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 906 |
nByte = __qSize(obj) - nInstBytes; |
12 | 907 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
908 |
||
185 | 909 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
12 | 910 |
case FLOATARRAY: |
77 | 911 |
/* |
912 |
* best speed for float array |
|
913 |
* - the data is already as we want it |
|
914 |
*/ |
|
915 |
if (nByte < (count * sizeof(float))) return (float *)0; |
|
916 |
return (float *)pElem; |
|
12 | 917 |
|
918 |
case DOUBLEARRAY: |
|
77 | 919 |
/* |
920 |
* for double array, have to copy-and-cast |
|
921 |
*/ |
|
922 |
if (nByte < (count * sizeof(double))) return (float *)0; |
|
923 |
for (i=0; i<count; i++) { |
|
924 |
vec[i] = *((double *)pElem); |
|
925 |
pElem += sizeof(double); |
|
926 |
} |
|
927 |
return vec; |
|
12 | 928 |
|
929 |
case POINTERARRAY: |
|
77 | 930 |
/* |
931 |
* for other array, have to fetch, check and store |
|
932 |
* the elements can be floats, smallintegers or fractions |
|
933 |
*/ |
|
934 |
if (nByte < (count * sizeof(OBJ))) return (float *)0; |
|
935 |
/* get elements one-by-one */ |
|
936 |
for (i=0; i<count; i++) { |
|
937 |
o = *(OBJ *)pElem; |
|
938 |
if (__isFloat(o)) { |
|
939 |
vec[i] = _floatVal(o); |
|
97 | 940 |
} else if (__isSmallInteger(o)) { |
185 | 941 |
vec[i] = (float)(__intVal(o)); |
77 | 942 |
} else if (__isFraction(o) |
97 | 943 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
944 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
77 | 945 |
float n, d; |
946 |
||
185 | 947 |
n = (float)(__intVal(_FractionInstPtr(o)->f_numerator)); |
948 |
d = (float)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
77 | 949 |
vec[i] = n / d; |
950 |
} else |
|
951 |
return 0; |
|
952 |
pElem += sizeof(OBJ); |
|
953 |
} |
|
954 |
return vec; |
|
12 | 955 |
} |
956 |
return (float *)0; |
|
957 |
} |
|
958 |
||
29 | 959 |
/* |
960 |
* fetch doubles from an st-object into a c-double array |
|
961 |
* which may be a floatArray, doubleArray or array-of-something, |
|
962 |
* where something may be a float, fraction or smallInteger, |
|
963 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
964 |
double * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
965 |
__glx_getDoublesFromInto(obj, vec, count) |
29 | 966 |
OBJ obj; |
967 |
double *vec; |
|
968 |
{ |
|
969 |
OBJ cls, o; |
|
970 |
int nByte, i, ninstVars, nInstBytes; |
|
971 |
char *pElem; |
|
972 |
||
973 |
if (! _isNonNilObject(obj)) return (double *)0; |
|
134 | 974 |
cls = __qClass(obj); |
185 | 975 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 976 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 977 |
nByte = __qSize(obj) - nInstBytes; |
29 | 978 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
979 |
||
185 | 980 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
29 | 981 |
case DOUBLEARRAY: |
77 | 982 |
/* best speed for double array - the data is already as we want it */ |
983 |
if (nByte < (count * sizeof(double))) return (double *)0; |
|
984 |
return (double *)pElem; |
|
29 | 985 |
|
986 |
case FLOATARRAY: |
|
77 | 987 |
if (nByte < (count * sizeof(float))) return (double *)0; |
988 |
for (i=0; i<count; i++) { |
|
989 |
vec[i] = *((float *)pElem); |
|
990 |
pElem += sizeof(float); |
|
991 |
} |
|
992 |
return vec; |
|
29 | 993 |
|
994 |
case POINTERARRAY: |
|
77 | 995 |
if (nByte < (count * sizeof(OBJ))) return (double *)0; |
996 |
/* get elements one-by-one */ |
|
997 |
for (i=0; i<count; i++) { |
|
998 |
o = *(OBJ *)pElem; |
|
999 |
if (__isFloat(o)) |
|
1000 |
vec[i] = _floatVal(o); |
|
97 | 1001 |
else if (__isSmallInteger(o)) |
185 | 1002 |
vec[i] = (double)(__intVal(o)); |
77 | 1003 |
else if (__isFraction(o) |
97 | 1004 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
1005 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
77 | 1006 |
double n, d; |
1007 |
||
185 | 1008 |
n = (double)(__intVal(_FractionInstPtr(o)->f_numerator)); |
1009 |
d = (double)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
77 | 1010 |
vec[i] = n / d; |
1011 |
||
1012 |
} else |
|
1013 |
return 0; |
|
1014 |
pElem += sizeof(OBJ); |
|
1015 |
} |
|
1016 |
return vec; |
|
29 | 1017 |
} |
1018 |
return (double *)0; |
|
1019 |
} |
|
1020 |
||
1021 |
/* |
|
1022 |
* move from a c-float array into an st-object, |
|
1023 |
* the st-object MUST be either a float- or double array |
|
1024 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1025 |
__glx_putFloatsFromInto(vec, obj, count) |
12 | 1026 |
OBJ obj; |
1027 |
float *vec; |
|
1028 |
{ |
|
1029 |
OBJ cls; |
|
1030 |
int nByte; |
|
1031 |
OBJ o; |
|
1032 |
int i, ninstVars, nInstBytes; |
|
1033 |
char *pElem; |
|
1034 |
||
1035 |
if (! _isNonNilObject(obj)) return 0; |
|
1036 |
||
134 | 1037 |
cls = __qClass(obj); |
185 | 1038 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
12 | 1039 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1040 |
nByte = __qSize(obj) - nInstBytes; |
12 | 1041 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1042 |
||
185 | 1043 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
12 | 1044 |
case FLOATARRAY: |
77 | 1045 |
if (nByte < (count * sizeof(float))) return 0; |
1046 |
for (i=0; i<count; i++) { |
|
1047 |
*(float *)pElem = vec[i]; |
|
1048 |
pElem += sizeof(float); |
|
1049 |
} |
|
1050 |
return 1; |
|
12 | 1051 |
|
1052 |
case DOUBLEARRAY: |
|
77 | 1053 |
if (nByte < (count * sizeof(float))) return 0; |
1054 |
for (i=0; i<count; i++) { |
|
1055 |
*(double *)pElem = vec[i]; |
|
1056 |
pElem += sizeof(double); |
|
1057 |
} |
|
1058 |
return 1; |
|
12 | 1059 |
} |
1060 |
/* not implemented for others */ |
|
1061 |
||
1062 |
return 0; |
|
1063 |
} |
|
1064 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1065 |
#ifndef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1066 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1067 |
Matrix * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1068 |
__glx_getFloatsFromMatrixInto(obj, mp) |
12 | 1069 |
OBJ obj; |
1070 |
Matrix *mp; |
|
1071 |
{ |
|
1072 |
OBJ cls; |
|
1073 |
int nByte; |
|
1074 |
OBJ o; |
|
29 | 1075 |
int ninstVars, nInstBytes; |
1076 |
char *pElem; |
|
1077 |
int x = 0; |
|
1078 |
int i,j; |
|
12 | 1079 |
|
1080 |
if (! _isNonNilObject(obj)) return (Matrix *)0; |
|
1081 |
||
134 | 1082 |
cls = __qClass(obj); |
185 | 1083 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 1084 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1085 |
nByte = __qSize(obj) - nInstBytes; |
29 | 1086 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1087 |
||
185 | 1088 |
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
|
1089 |
case FLOATARRAY: |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1090 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1091 |
* very easy for FLOATARRAY objects - no copying needed |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1092 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1093 |
if (nByte < (16 * sizeof(float))) return (Matrix *)0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1094 |
return (Matrix *) _FloatArrayInstPtr(obj)->f_element; |
12 | 1095 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1096 |
case DOUBLEARRAY: |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1097 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1098 |
* for DOUBLEARRAY objects copy and cast |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1099 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1100 |
if (nByte < (16 * sizeof(double))) return (Matrix *)0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1101 |
for (i=0; i<4; i++) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1102 |
for (j=0; j<4; j++) { |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1103 |
(*mp)[i][j] = _DoubleArrayInstPtr(obj)->d_element[x]; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1104 |
x++; |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1105 |
} |
77 | 1106 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1107 |
return mp; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1108 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1109 |
case POINTERARRAY: |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1110 |
if (nByte < (16 * sizeof(OBJ))) return (Matrix *)0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1111 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1112 |
* get elements one-by-one |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1113 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1114 |
for (i=0; i<4; i++) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1115 |
for (j=0; j<4; j++) { |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1116 |
o = _ArrayInstPtr(obj)->a_element[x]; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1117 |
if (__isFloat(o)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1118 |
(*mp)[i][j] = _floatVal(o); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1119 |
} else if (__isSmallInteger(o)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1120 |
(*mp)[i][j] = (double)__intVal(o); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1121 |
} else if (__isFraction(o) |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1122 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1123 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1124 |
double n, d; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1125 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1126 |
n = (double)(__intVal(_FractionInstPtr(o)->f_numerator)); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1127 |
d = (double)(__intVal(_FractionInstPtr(o)->f_denominator)); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1128 |
(*mp)[i][j] = n / d; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1129 |
} else |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1130 |
return (Matrix *)0; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1131 |
x++; |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1132 |
} |
77 | 1133 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1134 |
return mp; |
12 | 1135 |
} |
1136 |
return (Matrix *)0; |
|
1137 |
} |
|
1138 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1139 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1140 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1141 |
float* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1142 |
__glx_getFloatsFromFloatArrayInto(obj, fp) |
46 | 1143 |
OBJ obj; |
1144 |
float *fp; |
|
1145 |
{ |
|
1146 |
OBJ cls; |
|
1147 |
int ninstVars; |
|
1148 |
||
1149 |
if (! _isNonNilObject(obj)) return (float *)0; |
|
134 | 1150 |
cls = __qClass(obj); |
350 | 1151 |
if (cls == @global(FloatArray)) |
77 | 1152 |
return _FloatArrayInstPtr(obj)->f_element; |
46 | 1153 |
|
185 | 1154 |
if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) { |
1155 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
77 | 1156 |
return (float *) &(_InstPtr(obj)->i_instvars[ninstVars]); |
46 | 1157 |
} |
1158 |
||
1159 |
/* |
|
1160 |
* need more here (i.e. convert from array-of-floats) |
|
1161 |
*/ |
|
1162 |
return (float *)0; |
|
1163 |
} |
|
1164 |
||
1165 |
%} |
|
1166 |
! ! |
|
0 | 1167 |
|
294 | 1168 |
!GLXWorkstation class methodsFor:'documentation'! |
1169 |
||
1170 |
copyright |
|
1171 |
" |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1172 |
COPYRIGHT (c) 1993 by Claus Gittinger |
294 | 1173 |
All Rights Reserved |
1174 |
||
1175 |
This software is furnished under a license and may be used |
|
1176 |
only in accordance with the terms of that license and with the |
|
1177 |
inclusion of the above copyright notice. This software may not |
|
1178 |
be provided or otherwise made available to, or used by, any |
|
1179 |
other person. No title to or ownership of the software is |
|
1180 |
hereby transferred. |
|
1181 |
" |
|
1182 |
! |
|
1183 |
||
1184 |
documentation |
|
1185 |
" |
|
1186 |
this class was originally written as a demo on how an interface to |
|
1187 |
a c graphics library could be implemented. In the mean time, it has become |
|
1188 |
quite complete ... |
|
1189 |
||
1190 |
It provides an interface to either a real GL (on SGI workstations) |
|
1191 |
or a simulated VGL (i.e. GL-light; low nicotine). |
|
1192 |
The GL simulation is derived from the PD vogl library, with slight |
|
1193 |
modifictions to support multiple GL views. |
|
1194 |
||
1195 |
Most of the hard work was done by Jeff (thanks indeed) ... |
|
1196 |
||
1197 |
||
1198 |
Some notes: |
|
1199 |
||
1200 |
I do not really know what most of these functions do - for more |
|
1201 |
detail, see the GL man pages (on SGI) or the doc provided with VGL. |
|
1202 |
||
1203 |
The interface offered here provides a very very low level (i.e one-to-one) |
|
1204 |
interface to GL functions. More high-level stuff is required, to make |
|
1205 |
3D drawing be more object-oriented. |
|
1206 |
(see a bit of this in 'clients/IRIS-specials') |
|
1207 |
||
1208 |
Some functions are duplicated, Jeff and I developed those in parallel - |
|
1209 |
for now, both will remain - finally they will be merged and duplicates removed ... |
|
1210 |
(examples are makeobj and makeObject). |
|
1211 |
||
1212 |
Also, in a hurry to implement all those methods, many do no or only |
|
1213 |
limited argument checking - make certain, that you pass the correct |
|
1214 |
arguments. |
|
1215 |
||
1216 |
There might be some confusion in the v3[sifd] functions: basically they |
|
1217 |
all do the same, and could be mapped onto one st-method (such as vertex3). |
|
1218 |
However, the C-functions expect different argument types - I dont know if |
|
1219 |
one or another of these functions suffers from any performance penalties. |
|
1220 |
Therefore, I leave the direct 1-to-1 mapping; GL experts might know more |
|
1221 |
about this (I use v3f in all of my code). |
|
1222 |
||
1223 |
written june 93 by claus |
|
1224 |
VGL stuff dec 93 |
|
1225 |
many many additions jan 94 by Jeff McAffer <jeff@is.s.u-tokyo.ac.jp> |
|
1226 |
||
1227 |
Since this is a demo (consider it a free add-on goody) there is |
|
1228 |
*** NO WARRANTY ** for this. |
|
1229 |
||
1230 |
Notice: this should be rewritten to use the openGL library functions |
|
1231 |
(actually, to not loose the VGL interface, another OpenGLWorkstation |
|
1232 |
class should be written) |
|
614 | 1233 |
|
1234 |
[author:] |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1235 |
Claus Gittinger |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1236 |
Jeff McAffer |
294 | 1237 |
" |
1238 |
! ! |
|
1239 |
||
168 | 1240 |
!GLXWorkstation class methodsFor:'error handling'! |
1241 |
||
294 | 1242 |
errorStringOfLastError |
1243 |
%{ |
|
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1244 |
RETURN ( __MKSTRING(lastErrorMsg) ); |
168 | 1245 |
%} |
1246 |
! |
|
1247 |
||
528 | 1248 |
forceGL:aBoolean |
1249 |
ForceGL := aBoolean. |
|
1250 |
AllScreens notNil ifTrue:[ |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1251 |
AllScreens do:[:screen | screen initializeScreenProperties] |
528 | 1252 |
]. |
1253 |
! |
|
1254 |
||
168 | 1255 |
minorCodeOfLastError |
1256 |
%{ /* NOCONTEXT */ |
|
1257 |
||
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
1258 |
RETURN ( __MKSMALLINT(lastMinorCode) ); |
168 | 1259 |
%} |
1260 |
! |
|
1261 |
||
294 | 1262 |
requestCodeOfLastError |
1263 |
%{ /* NOCONTEXT */ |
|
1264 |
||
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
1265 |
RETURN ( __MKSMALLINT(lastRequestCode) ); |
294 | 1266 |
%} |
1267 |
! |
|
1268 |
||
168 | 1269 |
resourceIdOfLastError |
1270 |
%{ /* NOCONTEXT */ |
|
1271 |
||
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
1272 |
RETURN ( __MKSMALLINT(lastResource) ); |
168 | 1273 |
%} |
294 | 1274 |
! ! |
1275 |
||
1276 |
!GLXWorkstation methodsFor:'arcs and circles'! |
|
1277 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1278 |
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
|
1279 |
"draw an arc at a given location. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1280 |
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
|
1281 |
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
|
1282 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1283 |
%{ /* NOCONTEXT */ |
294 | 1284 |
Coord c_x, c_y, c_radius; |
1285 |
Angle a_startang, a_endang; |
|
1286 |
||
1287 |
_COORD_(x, c_x) |
|
1288 |
_COORD_(y, c_y) |
|
1289 |
_COORD_(radius, c_radius) |
|
1290 |
_ANGLE_(startang, a_startang) |
|
1291 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1292 |
|
294 | 1293 |
SETWIN(aGLXWindowId) |
1932 | 1294 |
#ifdef OPENGL |
1295 |
#else |
|
294 | 1296 |
arc(c_x, c_y, c_radius, a_startang, a_endang); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1297 |
#endif |
294 | 1298 |
%} |
528 | 1299 |
|
1300 |
"Modified: 19.3.1996 / 18:43:52 / cg" |
|
294 | 1301 |
! |
1302 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1303 |
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
|
1304 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1305 |
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
|
1306 |
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
|
1307 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1308 |
%{ /* NOCONTEXT */ |
294 | 1309 |
Coord c_x, c_y, c_radius; |
1310 |
Angle a_startang, a_endang; |
|
1311 |
||
1312 |
_COORD_(x, c_x) |
|
1313 |
_COORD_(y, c_y) |
|
1314 |
_COORD_(radius, c_radius) |
|
1315 |
_ANGLE_(startang, a_startang) |
|
1316 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1317 |
|
294 | 1318 |
SETWIN(aGLXWindowId) |
1932 | 1319 |
#ifdef OPENGL |
1320 |
#else |
|
294 | 1321 |
arcf(c_x, c_y, c_radius, a_startang, a_endang); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1322 |
#endif |
294 | 1323 |
%} |
1324 |
! |
|
1325 |
||
1326 |
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
|
1327 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1328 |
All arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1329 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1330 |
%{ /* NOCONTEXT */ |
294 | 1331 |
Icoord c_x, c_y, c_radius; |
1332 |
Angle a_startang, a_endang; |
|
1333 |
||
1334 |
_ICOORD_(x, c_x) |
|
1335 |
_ICOORD_(y, c_y) |
|
1336 |
_ICOORD_(radius, c_radius) |
|
1337 |
_ANGLE_(startang, a_startang); |
|
1338 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1339 |
|
294 | 1340 |
SETWIN(aGLXWindowId) |
1932 | 1341 |
#ifdef OPENGL |
1342 |
#else |
|
294 | 1343 |
arcfi(c_x, c_y, c_radius, a_startang, a_endang); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1344 |
#endif |
294 | 1345 |
%} |
1346 |
! |
|
1347 |
||
1348 |
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
|
1349 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1350 |
All arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1351 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1352 |
%{ /* NOCONTEXT */ |
294 | 1353 |
Scoord c_x, c_y, c_radius; |
1354 |
Angle a_startang, a_endang; |
|
1355 |
||
1356 |
_SCOORD_(x, c_x) |
|
1357 |
_SCOORD_(y, c_y) |
|
1358 |
_SCOORD_(radius, c_radius) |
|
1359 |
_ANGLE_(startang, a_startang) |
|
1360 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1361 |
|
294 | 1362 |
SETWIN(aGLXWindowId) |
1932 | 1363 |
#ifdef OPENGL |
1364 |
#else |
|
294 | 1365 |
arcfs(c_x, c_y, c_radius, a_startang, a_endang); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1366 |
#endif |
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 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1369 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1370 |
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
|
1371 |
"draw an (unfilled) arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1372 |
All arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1373 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1374 |
%{ /* NOCONTEXT */ |
294 | 1375 |
Icoord c_x, c_y, c_radius; |
1376 |
Angle a_startang, a_endang; |
|
1377 |
||
1378 |
_ICOORD_(x, c_x) |
|
1379 |
_ICOORD_(y, c_y) |
|
1380 |
_ICOORD_(radius, c_radius) |
|
1381 |
_ANGLE_(startang, a_startang) |
|
1382 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1383 |
|
294 | 1384 |
SETWIN(aGLXWindowId) |
1932 | 1385 |
#ifdef OPENGL |
1386 |
#else |
|
294 | 1387 |
arci(c_x, c_y, c_radius, a_startang, a_endang); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1388 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1389 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1390 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1391 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1392 |
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
|
1393 |
"draw an (unfilled) arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1394 |
All arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1395 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1396 |
%{ /* NOCONTEXT */ |
1932 | 1397 |
Scoord c_x, c_y, c_radius; |
1398 |
Angle a_startang, a_endang; |
|
1399 |
||
1400 |
_SCOORD_(x, c_x) |
|
1401 |
_SCOORD_(y, c_y) |
|
1402 |
_SCOORD_(radius, c_radius) |
|
1403 |
_ANGLE_(startang, a_startang) |
|
1404 |
_ANGLE_(endang, a_endang) |
|
1405 |
||
1406 |
SETWIN(aGLXWindowId) |
|
1407 |
#ifdef OPENGL |
|
1408 |
#else |
|
1409 |
arcs(c_x, c_y, c_radius, a_startang, a_endang); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1410 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1411 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1412 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1413 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1414 |
glxCircX:x y:y radius: radius in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1415 |
"draw a circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1416 |
x/y/radius may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1417 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1418 |
%{ /* NOCONTEXT */ |
1932 | 1419 |
Coord c_x, c_y, c_radius; |
1420 |
||
1421 |
_COORD_ (x, c_x) |
|
1422 |
_COORD_ (y, c_y) |
|
1423 |
_COORD_ (radius, c_radius) |
|
1424 |
||
1425 |
SETWIN(aGLXWindowId) |
|
1426 |
#ifdef OPENGL |
|
1427 |
#else |
|
1428 |
circ(c_x, c_y, c_radius); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1429 |
#endif |
294 | 1430 |
%} |
1431 |
! |
|
1432 |
||
1433 |
glxCircfX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1434 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1435 |
x/y/radius may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1436 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1437 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1438 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1439 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1440 |
Coord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1441 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1442 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1443 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1444 |
_COORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1445 |
|
1932 | 1446 |
#ifdef OPENGL |
1447 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1448 |
circf(c_x, c_y, c_radius); |
1932 | 1449 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1450 |
} |
294 | 1451 |
%} |
1452 |
! |
|
1453 |
||
1454 |
glxCircfiX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1455 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1456 |
x/y/radius must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1457 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1458 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1459 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1460 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1461 |
Icoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1462 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1463 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1464 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1465 |
_ICOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1466 |
|
1932 | 1467 |
#ifdef OPENGL |
1468 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1469 |
circfi(c_x, c_y, c_radius); |
1932 | 1470 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1471 |
} |
294 | 1472 |
%} |
1473 |
! |
|
1474 |
||
1475 |
glxCircfsX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1476 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1477 |
x/y/radius must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1478 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1479 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1480 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1481 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1482 |
Scoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1483 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1484 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1485 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1486 |
_SCOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1487 |
|
1932 | 1488 |
#ifdef OPENGL |
1489 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1490 |
circfs(c_x, c_y, c_radius); |
1932 | 1491 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1492 |
} |
294 | 1493 |
%} |
1494 |
! |
|
1495 |
||
1496 |
glxCirciX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1497 |
"draw a circle (unfilled). |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1498 |
x/y/radius must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1499 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1500 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1501 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1502 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1503 |
Icoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1504 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1505 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1506 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1507 |
_ICOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1508 |
|
1932 | 1509 |
#ifdef OPENGL |
1510 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1511 |
circi(c_x, c_y, c_radius); |
1932 | 1512 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1513 |
} |
294 | 1514 |
%} |
1515 |
! |
|
1516 |
||
1517 |
glxCircsX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1518 |
"draw a circle (unfilled) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1519 |
x/y/radius must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1520 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1521 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1522 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1523 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1524 |
Scoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1525 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1526 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1527 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1528 |
_SCOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1529 |
|
1932 | 1530 |
#ifdef OPENGL |
1531 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1532 |
circs(c_x, c_y, c_radius); |
1932 | 1533 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1534 |
} |
294 | 1535 |
%} |
1536 |
! ! |
|
1537 |
||
528 | 1538 |
!GLXWorkstation methodsFor:'attribute stack'! |
1539 |
||
1540 |
glxPopattributesIn: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1541 |
"pop (and forget) the top entry on the attribute stack" |
528 | 1542 |
|
1543 |
%{ /* NOCONTEXT */ |
|
1544 |
SETWIN(aGLXWindowId) |
|
1932 | 1545 |
#ifndef OPENGL |
528 | 1546 |
popattributes(); |
1932 | 1547 |
#endif |
528 | 1548 |
%} |
1549 |
||
1550 |
"Modified: 19.3.1996 / 18:42:53 / cg" |
|
1551 |
! |
|
1552 |
||
1553 |
glxPushattributesIn: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1554 |
"save the current attributes on the attribute stack" |
528 | 1555 |
|
1556 |
%{ /* NOCONTEXT */ |
|
1557 |
SETWIN(aGLXWindowId) |
|
1932 | 1558 |
#ifndef OPENGL |
528 | 1559 |
pushattributes(); |
1932 | 1560 |
#endif |
528 | 1561 |
%} |
1562 |
||
1563 |
"Modified: 19.3.1996 / 18:43:04 / cg" |
|
1564 |
! ! |
|
1565 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1566 |
!GLXWorkstation methodsFor:'character position'! |
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 |
glxCmov2X: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1569 |
"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
|
1570 |
The arguments may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1571 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1572 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1573 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1574 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1575 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1576 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1577 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1578 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1579 |
|
1932 | 1580 |
#ifdef OPENGL |
1581 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1582 |
cmov2(c_x, c_y); |
1932 | 1583 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1584 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1585 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1586 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1587 |
"Modified: 22.3.1996 / 18:17:38 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1588 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1589 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1590 |
glxCmov2iX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1591 |
"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
|
1592 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1593 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1594 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1595 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1596 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1597 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1598 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1599 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1600 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1601 |
|
1932 | 1602 |
#ifdef OPENGL |
1603 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1604 |
cmov2i(c_x, c_y); |
1932 | 1605 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1606 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1607 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1608 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1609 |
"Modified: 22.3.1996 / 18:17:43 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1610 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1611 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1612 |
glxCmov2sX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1613 |
"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
|
1614 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1615 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1616 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1617 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1618 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1619 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1620 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1621 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1622 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1623 |
|
1932 | 1624 |
#ifdef OPENGL |
1625 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1626 |
cmov2s(c_x, c_y); |
1932 | 1627 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1628 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1629 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1630 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1631 |
"Modified: 22.3.1996 / 18:17:47 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1632 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1633 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1634 |
glxCmovX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1635 |
"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
|
1636 |
The arguments may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1637 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1638 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1639 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1640 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1641 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1642 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1643 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1644 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1645 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1646 |
|
1932 | 1647 |
#ifdef OPENGL |
1648 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1649 |
cmov(c_x, c_y, c_z); |
1932 | 1650 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1651 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1652 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1653 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1654 |
"Modified: 22.3.1996 / 18:17:22 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1655 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1656 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1657 |
glxCmoviX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1658 |
"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
|
1659 |
The arguments must be smallIntegers." |
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 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1662 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1663 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1664 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1665 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1666 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1667 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1668 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1669 |
|
1932 | 1670 |
#ifdef OPENGL |
1671 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1672 |
cmovi(c_x, c_y, c_z); |
1932 | 1673 |
#endif |
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 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1676 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1677 |
"Modified: 22.3.1996 / 18:17:55 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1678 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1679 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1680 |
glxCmovsX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1681 |
"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
|
1682 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1683 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1684 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1685 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1686 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1687 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1688 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1689 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1690 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1691 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1692 |
|
1932 | 1693 |
#ifdef OPENGL |
1694 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1695 |
cmovs(c_x, c_y, c_z); |
1932 | 1696 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1697 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1698 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1699 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1700 |
"Modified: 22.3.1996 / 18:17:59 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1701 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1702 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1703 |
glxGetcposIn: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1704 |
"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
|
1705 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1706 |
| x y | |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1707 |
%{ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1708 |
short s_x, s_y; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1709 |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1710 |
SETWIN(aGLXWindowId) |
1932 | 1711 |
#ifdef OPENGL |
1712 |
#else |
|
1713 |
# ifdef GLX |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1714 |
getcpos(&s_x, &s_y); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1715 |
x = __MKSMALLINT(s_x); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1716 |
y = __MKSMALLINT(s_y); |
1932 | 1717 |
# endif |
1718 |
#endif |
|
1719 |
%}. |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1720 |
^x @ y |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1721 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1722 |
|
294 | 1723 |
!GLXWorkstation methodsFor:'clearing'! |
1724 |
||
1725 |
glxClearIn:aGLXWindowId |
|
1726 |
"clear to current color" |
|
1727 |
||
1728 |
%{ /* NOCONTEXT */ |
|
1729 |
SETWIN(aGLXWindowId) |
|
1932 | 1730 |
#ifdef OPENGL |
1731 |
#else |
|
294 | 1732 |
clear(); |
1932 | 1733 |
#endif |
294 | 1734 |
%} |
1735 |
! |
|
1736 |
||
1737 |
glxCzclearCval:cval zval:zval in:aGLXWindowId |
|
1738 |
"clear to a color (cval) and clear z buffer to zval simultaniously" |
|
1739 |
||
1740 |
%{ /* NOCONTEXT */ |
|
1932 | 1741 |
SETWIN(aGLXWindowId) |
1742 |
#ifdef OPENGL |
|
1743 |
#else |
|
1744 |
# ifdef GLX |
|
294 | 1745 |
czclear((ulong)__intVal(cval), __intVal(zval)); |
1932 | 1746 |
# endif |
1747 |
#endif |
|
1748 |
%} |
|
294 | 1749 |
! |
1750 |
||
1751 |
glxZClearIn:aGLXWindowId |
|
1752 |
"clear z buffer" |
|
1753 |
||
1754 |
%{ /* NOCONTEXT */ |
|
1932 | 1755 |
SETWIN(aGLXWindowId) |
1756 |
#ifdef OPENGL |
|
1757 |
#else |
|
1758 |
# ifdef GLX |
|
294 | 1759 |
zclear(); |
1932 | 1760 |
# endif |
1761 |
#endif |
|
1762 |
%} |
|
294 | 1763 |
! ! |
1764 |
||
1765 |
!GLXWorkstation methodsFor:'color'! |
|
1766 |
||
1767 |
glxColor:index in:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1768 |
"set the drawing color; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1769 |
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
|
1770 |
otherwise, better results are expected with float values." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1771 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1772 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1773 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1774 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1775 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1776 |
#else |
294 | 1777 |
if (__isSmallInteger(index)) { |
1778 |
color((Colorindex)(__intVal(index))); |
|
1932 | 1779 |
RETURN (self); |
294 | 1780 |
} |
1781 |
if (__isFloat(index)) { |
|
1782 |
colorf((float)(_floatVal(index))); |
|
1932 | 1783 |
RETURN (self); |
294 | 1784 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1785 |
#endif |
1932 | 1786 |
%} |
294 | 1787 |
! |
1788 |
||
1789 |
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
|
1790 |
"set the drawing color, including alpha value. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1791 |
The args must be integer values within 0..255" |
294 | 1792 |
|
1793 |
%{ /* NOCONTEXT */ |
|
1794 |
short s_r, s_g, s_b, s_a; |
|
1795 |
||
1796 |
_INT_(r, s_r); |
|
1797 |
_INT_(g, s_g); |
|
1798 |
_INT_(b, s_b); |
|
1799 |
_INT_(a, s_a); |
|
1800 |
SETWIN(aGLXWindowId) |
|
1932 | 1801 |
#ifdef GLX |
294 | 1802 |
cpack((((((s_a<<8) | s_b) << 8) | s_g) << 8) | s_r); |
1932 | 1803 |
#endif |
1804 |
%} |
|
294 | 1805 |
! |
1806 |
||
1807 |
glxColorRed:r green:g blue:b in:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1808 |
"set the drawing color. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1809 |
The args must be integer values in 0..255" |
294 | 1810 |
|
1811 |
%{ /* NOCONTEXT */ |
|
1812 |
short s_r, s_g, s_b; |
|
1813 |
||
1814 |
_INT_(r, s_r); |
|
1815 |
_INT_(g, s_g); |
|
1816 |
_INT_(b, s_b); |
|
1817 |
SETWIN(aGLXWindowId) |
|
1932 | 1818 |
#ifdef GLX |
294 | 1819 |
RGBcolor(s_r, s_g, s_b); |
1932 | 1820 |
#endif |
1821 |
%} |
|
294 | 1822 |
! |
1823 |
||
528 | 1824 |
glxLrgbrangeRmin: rmin gmin: gmin bmin: bmin rmax: rmax gmax: gmax bmax: bmax |
1825 |
znear: znear zfar: zfar in: aGLXWindowId |
|
1826 |
||
1827 |
%{ /* NOCONTEXT */ |
|
1932 | 1828 |
SETWIN(aGLXWindowId) |
1829 |
#ifdef GLX |
|
528 | 1830 |
lRGBrange(_shortVal(rmin), _shortVal(gmin), _shortVal(bmin), |
1831 |
_shortVal(rmax), _shortVal(gmax), _shortVal(bmax), |
|
1832 |
_longVal(znear), _longVal(zfar)); |
|
1932 | 1833 |
#endif |
1834 |
%} |
|
528 | 1835 |
! |
1836 |
||
1837 |
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
|
1838 |
"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
|
1839 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1840 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1841 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1842 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1843 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1844 |
#else |
528 | 1845 |
mapcolor(_colorindexVal(i), _shortVal(red), _shortVal(green), _shortVal(blue)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1846 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1847 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1848 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1849 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1850 |
glxTextcolor:tcolor in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1851 |
"change the color used for text drawing" |
294 | 1852 |
|
1853 |
%{ /* NOCONTEXT */ |
|
1932 | 1854 |
SETWIN(aGLXWindowId) |
1855 |
#ifdef GLX |
|
294 | 1856 |
textcolor(_colorindexVal(tcolor)); |
1932 | 1857 |
#endif |
1858 |
%} |
|
294 | 1859 |
! ! |
1860 |
||
528 | 1861 |
!GLXWorkstation methodsFor:'curves'! |
1862 |
||
1863 |
glxCurvebasis: basid in: aGLXWindowId |
|
1864 |
"sets the basis type of curves" |
|
1865 |
||
1866 |
%{ /* NOCONTEXT */ |
|
1867 |
SETWIN(aGLXWindowId) |
|
1932 | 1868 |
#ifdef GLX |
528 | 1869 |
curvebasis(_shortVal(basid)); |
1932 | 1870 |
#endif |
528 | 1871 |
%} |
1872 |
||
1873 |
"Modified: 19.3.1996 / 18:47:09 / cg" |
|
1874 |
! |
|
1875 |
||
1876 |
glxCurveit: iterationcount in: aGLXWindowId |
|
1877 |
"Iterates the top matrix on the stack as a forward difference |
|
1878 |
matrix, drawing as it goes along." |
|
1879 |
||
1880 |
%{ /* NOCONTEXT */ |
|
1881 |
SETWIN(aGLXWindowId) |
|
1932 | 1882 |
#ifdef GLX |
528 | 1883 |
curveit(_shortVal(iterationcount)); |
1932 | 1884 |
#endif |
528 | 1885 |
%} |
1886 |
||
1887 |
"Modified: 19.3.1996 / 18:48:57 / cg" |
|
1888 |
! |
|
1889 |
||
1890 |
glxCurveprecision: nsegments in: aGLXWindowId |
|
1891 |
"sets the number of line segments that make up a curve segment" |
|
1892 |
||
1893 |
%{ /* NOCONTEXT */ |
|
1894 |
SETWIN(aGLXWindowId) |
|
1932 | 1895 |
#ifdef GLX |
528 | 1896 |
curveprecision(_shortVal(nsegments)); |
1932 | 1897 |
#endif |
528 | 1898 |
%} |
1899 |
||
1900 |
"Modified: 19.3.1996 / 18:47:43 / cg" |
|
1901 |
! ! |
|
1902 |
||
294 | 1903 |
!GLXWorkstation methodsFor:'double buffering'! |
1904 |
||
1905 |
glxBackBufferIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1906 |
"switch to back buffer drawing - turning frontbuffer drawing off" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1907 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1908 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1909 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1910 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1911 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1912 |
# ifdef GLX |
294 | 1913 |
frontbuffer(FALSE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1914 |
# endif |
294 | 1915 |
backbuffer(TRUE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1916 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1917 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1918 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1919 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1920 |
glxBackbuffer:b in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1921 |
"turn backBuffer drawing on/off. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1922 |
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
|
1923 |
... enabling the backbuffer automatically disables frontbuffer drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1924 |
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
|
1925 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1926 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1927 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1928 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1929 |
#else |
294 | 1930 |
backbuffer(_booleanVal(b)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1931 |
#endif |
294 | 1932 |
%} |
528 | 1933 |
|
1934 |
"Modified: 19.3.1996 / 18:45:05 / cg" |
|
294 | 1935 |
! |
1936 |
||
1937 |
glxDoubleBufferIn:aGLXWindowId |
|
1938 |
"set double buffer mode" |
|
1939 |
||
1940 |
%{ /* NOCONTEXT */ |
|
1941 |
SETWIN(aGLXWindowId) |
|
1932 | 1942 |
#ifdef OPENGL |
1943 |
#else |
|
294 | 1944 |
doublebuffer(); |
1932 | 1945 |
#endif |
294 | 1946 |
%} |
1947 |
! |
|
1948 |
||
1949 |
glxFrontBufferIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1950 |
"switch to front buffer drawing - turning backbuffer drawing off" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1951 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1952 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1953 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1954 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1955 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1956 |
# ifdef GLX |
294 | 1957 |
backbuffer(FALSE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1958 |
# endif |
294 | 1959 |
frontbuffer(TRUE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1960 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1961 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1962 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1963 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1964 |
glxFrontbuffer:b in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1965 |
"turn on/off frontbuffer drawing. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1966 |
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
|
1967 |
... enabling the backbuffer automatically disables frontbuffer drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1968 |
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
|
1969 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1970 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1971 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1972 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1973 |
#else |
294 | 1974 |
frontbuffer(_booleanVal(b)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1975 |
#endif |
294 | 1976 |
%} |
528 | 1977 |
|
1978 |
"Modified: 19.3.1996 / 18:45:31 / cg" |
|
294 | 1979 |
! |
1980 |
||
1981 |
glxSingleBufferIn: aGLXWindowId |
|
1982 |
"set single buffer mode" |
|
1983 |
||
1984 |
%{ /* NOCONTEXT */ |
|
1985 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1986 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1987 |
#else |
294 | 1988 |
singlebuffer(); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1989 |
#endif |
294 | 1990 |
%} |
1991 |
! |
|
1992 |
||
1993 |
glxSwapBuffersIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1994 |
"swap the back and front buffers. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1995 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1996 |
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
|
1997 |
displayed and swap them for every frame." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1998 |
|
1903 | 1999 |
%{ /* UNLIMITEDSTACK */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2000 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2001 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2002 |
#else |
294 | 2003 |
swapbuffers(); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2004 |
#endif |
294 | 2005 |
%} |
528 | 2006 |
|
2007 |
"Modified: 19.3.1996 / 18:45:47 / cg" |
|
294 | 2008 |
! ! |
2009 |
||
2010 |
!GLXWorkstation methodsFor:'flat drawing'! |
|
2011 |
||
2012 |
glxBeginClosedLineIn:aGLXWindowId |
|
2013 |
"start a closed line" |
|
2014 |
||
2015 |
%{ /* NOCONTEXT */ |
|
1932 | 2016 |
#ifdef OPENGL |
2017 |
#else |
|
294 | 2018 |
SETWIN(aGLXWindowId) |
2019 |
bgnclosedline(); |
|
1932 | 2020 |
#endif |
294 | 2021 |
%} |
2022 |
! |
|
2023 |
||
2024 |
glxBeginLineIn:aGLXWindowId |
|
2025 |
"start a line group" |
|
2026 |
||
2075 | 2027 |
%{ /* NOCONTEXT STACK:32000 */ |
1932 | 2028 |
#ifdef OPENGL |
2029 |
#else |
|
294 | 2030 |
SETWIN(aGLXWindowId) |
2031 |
bgnline(); |
|
1932 | 2032 |
#endif |
294 | 2033 |
%} |
2034 |
! |
|
2035 |
||
2036 |
glxBeginPointIn:aGLXWindowId |
|
2037 |
"start a point-group" |
|
2038 |
||
2039 |
%{ /* NOCONTEXT */ |
|
1932 | 2040 |
#ifdef OPENGL |
2041 |
#else |
|
294 | 2042 |
SETWIN(aGLXWindowId) |
2043 |
bgnpoint(); |
|
1932 | 2044 |
#endif |
294 | 2045 |
%} |
2046 |
! |
|
2047 |
||
2048 |
glxBeginPolygonIn:aGLXWindowId |
|
2049 |
"start a polygon" |
|
2050 |
||
2051 |
%{ /* NOCONTEXT */ |
|
1932 | 2052 |
#ifdef OPENGL |
2053 |
#else |
|
294 | 2054 |
SETWIN(aGLXWindowId) |
2055 |
bgnpolygon(); |
|
1932 | 2056 |
#endif |
294 | 2057 |
%} |
2058 |
! |
|
2059 |
||
2060 |
glxBeginQuadrilateralStripIn:aGLXWindowId |
|
2061 |
"start a quadrilateral strip" |
|
2062 |
||
2063 |
%{ /* NOCONTEXT */ |
|
1932 | 2064 |
#ifdef OPENGL |
2065 |
#else |
|
294 | 2066 |
SETWIN(aGLXWindowId) |
2067 |
bgnqstrip(); |
|
1932 | 2068 |
#endif |
294 | 2069 |
%} |
2070 |
! |
|
2071 |
||
2072 |
glxBeginTriangleMeshIn:aGLXWindowId |
|
2073 |
"start a triangle mesh" |
|
2074 |
||
2075 |
%{ /* NOCONTEXT */ |
|
1932 | 2076 |
#ifdef OPENGL |
2077 |
#else |
|
294 | 2078 |
SETWIN(aGLXWindowId) |
2079 |
bgntmesh(); |
|
1932 | 2080 |
#endif |
294 | 2081 |
%} |
2082 |
! |
|
2083 |
||
2084 |
glxEndClosedLineIn:aGLXWindowId |
|
2085 |
"end a closed line" |
|
2086 |
||
2087 |
%{ /* NOCONTEXT */ |
|
1932 | 2088 |
#ifdef OPENGL |
2089 |
#else |
|
294 | 2090 |
SETWIN(aGLXWindowId) |
2091 |
endclosedline(); |
|
1932 | 2092 |
#endif |
294 | 2093 |
%} |
2094 |
! |
|
2095 |
||
2096 |
glxEndLineIn:aGLXWindowId |
|
2097 |
"end a line group" |
|
2098 |
||
2075 | 2099 |
%{ /* NOCONTEXT STACK:32000 */ |
1932 | 2100 |
#ifdef OPENGL |
2101 |
#else |
|
294 | 2102 |
SETWIN(aGLXWindowId) |
2103 |
endline(); |
|
1932 | 2104 |
#endif |
294 | 2105 |
%} |
2106 |
! |
|
2107 |
||
2108 |
glxEndPointIn:aGLXWindowId |
|
2109 |
"end a point group" |
|
2110 |
||
2111 |
%{ /* NOCONTEXT */ |
|
1932 | 2112 |
#ifdef OPENGL |
2113 |
#else |
|
294 | 2114 |
SETWIN(aGLXWindowId) |
2115 |
endpoint(); |
|
1932 | 2116 |
#endif |
294 | 2117 |
%} |
2118 |
! |
|
2119 |
||
2120 |
glxEndPolygonIn:aGLXWindowId |
|
2121 |
"end a polygon" |
|
2122 |
||
2123 |
%{ /* NOCONTEXT */ |
|
1932 | 2124 |
#ifdef OPENGL |
2125 |
#else |
|
294 | 2126 |
SETWIN(aGLXWindowId) |
2127 |
endpolygon(); |
|
1932 | 2128 |
#endif |
294 | 2129 |
%} |
2130 |
! |
|
2131 |
||
2132 |
glxEndQuadrilateralStripIn:aGLXWindowId |
|
2133 |
"end a quadrilateral strip" |
|
2134 |
||
2135 |
%{ /* NOCONTEXT */ |
|
1932 | 2136 |
#ifdef OPENGL |
2137 |
#else |
|
294 | 2138 |
SETWIN(aGLXWindowId) |
2139 |
endqstrip(); |
|
1932 | 2140 |
#endif |
294 | 2141 |
%} |
2142 |
! |
|
2143 |
||
2144 |
glxEndTriangleMeshIn:aGLXWindowId |
|
2145 |
"end a triangle mesh" |
|
2146 |
||
2147 |
%{ /* NOCONTEXT */ |
|
1932 | 2148 |
#ifdef OPENGL |
2149 |
#else |
|
294 | 2150 |
SETWIN(aGLXWindowId) |
2151 |
endtmesh(); |
|
1932 | 2152 |
#endif |
168 | 2153 |
%} |
2154 |
! ! |
|
2155 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2156 |
!GLXWorkstation methodsFor:'graphics position'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2157 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2158 |
glxMove2:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2159 |
"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
|
2160 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2161 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2162 |
float vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2163 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2164 |
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
|
2165 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2166 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2167 |
#else |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2168 |
move2((Coord)(c_v[0]), (Coord)(c_v[1])); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2169 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2170 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2171 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2172 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2173 |
"Modified: 22.3.1996 / 18:15:23 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2174 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2175 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2176 |
glxMove2X: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2177 |
"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
|
2178 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2179 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2180 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2181 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2182 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2183 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2184 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2185 |
SETWIN(aGLXWindowId) |
1932 | 2186 |
#ifdef OPENGL |
2187 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2188 |
move2(c_x, c_y); |
1932 | 2189 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2190 |
} |
537
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 |
"Modified: 22.3.1996 / 18:15:02 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2194 |
! |
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 |
glxMove2iX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2197 |
"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
|
2198 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2199 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2200 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2201 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2202 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2203 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2204 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2205 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2206 |
SETWIN(aGLXWindowId) |
1932 | 2207 |
#ifdef OPENGL |
2208 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2209 |
move2i(c_x, c_y); |
1932 | 2210 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2211 |
} |
537
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2214 |
"Modified: 22.3.1996 / 18:15:08 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2217 |
glxMove2sX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2218 |
"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
|
2219 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2220 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2221 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2222 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2223 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2224 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2225 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2226 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2227 |
SETWIN(aGLXWindowId) |
1932 | 2228 |
#ifdef OPENGL |
2229 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2230 |
move2s(c_x, c_y); |
1932 | 2231 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2232 |
} |
537
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 |
"Modified: 22.3.1996 / 18:15:13 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2236 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2237 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2238 |
glxMove:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2239 |
"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
|
2240 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2241 |
%{ /* NOCONTEXT */ |
553
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 |
float vec[3], *c_v; |
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 |
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
|
2246 |
SETWIN(aGLXWindowId) |
1932 | 2247 |
#ifdef OPENGL |
2248 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2249 |
move((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
1932 | 2250 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2251 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2252 |
%} |
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 |
"Modified: 22.3.1996 / 18:14:29 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2255 |
! |
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 |
glxMoveX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2258 |
"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
|
2259 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2260 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2261 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2262 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2263 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2264 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2265 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2266 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2267 |
SETWIN(aGLXWindowId) |
1932 | 2268 |
#ifdef OPENGL |
2269 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2270 |
move(c_x, c_y, c_z); |
1932 | 2271 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2272 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2273 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2274 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2275 |
"Modified: 22.3.1996 / 18:14:38 / cg" |
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 |
glxMoveiX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2279 |
"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
|
2280 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2281 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2282 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2283 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2284 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2285 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2286 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2287 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2288 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2289 |
SETWIN(aGLXWindowId) |
1932 | 2290 |
#ifdef OPENGL |
2291 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2292 |
movei(c_x, c_y, c_z); |
1932 | 2293 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2294 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2295 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2296 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2297 |
"Modified: 22.3.1996 / 18:14:44 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2300 |
glxMovesX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2301 |
"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
|
2302 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2303 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2304 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2305 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2306 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2307 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2308 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2309 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2310 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2311 |
SETWIN(aGLXWindowId) |
1932 | 2312 |
#ifdef OPENGL |
2313 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2314 |
moves(c_x, c_y, c_z); |
1932 | 2315 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2316 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2317 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2318 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2319 |
"Modified: 22.3.1996 / 18:14:48 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2322 |
glxRmv2:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2323 |
"change the graphics position to a 2D point, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2324 |
the relative distance is passed in vector v" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2325 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2326 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2327 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2328 |
float vec[2], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2329 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2330 |
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
|
2331 |
SETWIN(aGLXWindowId) |
1932 | 2332 |
#ifdef OPENGL |
2333 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2334 |
rmv2((Coord)(c_v[0]), (Coord)(c_v[1])); |
1932 | 2335 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2336 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2337 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2338 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2339 |
"Modified: 22.3.1996 / 18:15:57 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2340 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2341 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2342 |
glxRmv2X: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2343 |
"change the graphics position to a 2D point, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2344 |
the relative distance is passed in x/y" |
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 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2347 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2348 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2349 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2350 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2351 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2352 |
SETWIN(aGLXWindowId) |
1932 | 2353 |
#ifdef OPENGL |
2354 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2355 |
rmv2(c_x, c_y); |
1932 | 2356 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2357 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2358 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2359 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2360 |
"Modified: 22.3.1996 / 18:16:42 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2361 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2362 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2363 |
glxRmv2iX: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2364 |
"change the graphics position to a 2D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2365 |
the relative distance is passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2366 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2367 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2368 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2369 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2370 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2371 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2372 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2373 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2374 |
SETWIN(aGLXWindowId) |
1932 | 2375 |
#ifdef OPENGL |
2376 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2377 |
rmv2i(c_x, c_y); |
1932 | 2378 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2379 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2380 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2381 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2382 |
"Modified: 22.3.1996 / 18:16:39 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2383 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2384 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2385 |
glxRmv2sX: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2386 |
"change the graphics position to a 2D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2387 |
the relative distance is passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2388 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2389 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2390 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2391 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2392 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2393 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2394 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2395 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2396 |
SETWIN(aGLXWindowId) |
1932 | 2397 |
#ifdef OPENGL |
2398 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2399 |
rmv2s(c_x, c_y); |
1932 | 2400 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2401 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2402 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2403 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2404 |
"Modified: 22.3.1996 / 18:16:33 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2405 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2406 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2407 |
glxRmv:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2408 |
"change the graphics position to a 3D point, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2409 |
the relative distance is passed in vector v" |
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 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2412 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2413 |
float vec[3], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2414 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2415 |
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
|
2416 |
SETWIN(aGLXWindowId) |
1932 | 2417 |
#ifdef OPENGL |
2418 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2419 |
rmv((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
1932 | 2420 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2421 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2422 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2423 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2424 |
"Modified: 22.3.1996 / 18:16:08 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2425 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2426 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2427 |
glxRmvX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2428 |
"change the graphics position to a 3D point, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2429 |
the relative distance is passed in x/y/z" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2430 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2431 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2432 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2433 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2434 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2435 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2436 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2437 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2438 |
SETWIN(aGLXWindowId) |
1932 | 2439 |
#ifdef OPENGL |
2440 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2441 |
rmv(c_x, c_y, c_z); |
1932 | 2442 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2443 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2444 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2445 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2446 |
"Modified: 22.3.1996 / 18:16:16 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2447 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2448 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2449 |
glxRmviX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2450 |
"change the graphics position to a 3D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2451 |
the relative distance is passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2452 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2453 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2454 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2455 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2456 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2457 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2458 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2459 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2460 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2461 |
SETWIN(aGLXWindowId) |
1932 | 2462 |
#ifdef OPENGL |
2463 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2464 |
rmvi(c_x, c_y, c_z); |
1932 | 2465 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2466 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2467 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2468 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2469 |
"Modified: 22.3.1996 / 18:16:21 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2470 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2471 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2472 |
glxRmvsX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2473 |
"change the graphics position to a 3D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2474 |
the relative distance is passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2475 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2476 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2477 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2478 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2479 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2480 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2481 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2482 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2483 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2484 |
SETWIN(aGLXWindowId) |
1932 | 2485 |
#ifdef OPENGL |
2486 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2487 |
rmvs(c_x, c_y, c_z); |
1932 | 2488 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2489 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2490 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2491 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2492 |
"Modified: 22.3.1996 / 18:16:25 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2493 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2494 |
|
168 | 2495 |
!GLXWorkstation methodsFor:'initialization'! |
2496 |
||
2497 |
initializeFor:aDisplayName |
|
169 | 2498 |
(super initializeFor:aDisplayName) isNil ifTrue:[^ nil]. |
168 | 2499 |
%{ |
2500 |
if (_INST(displayId) != nil) { |
|
185 | 2501 |
XSetErrorHandler(__XErrorHandler__); |
2502 |
} |
|
2503 |
%} |
|
2504 |
! |
|
2505 |
||
2506 |
initializeScreenProperties |
|
2507 |
super initializeScreenProperties. |
|
2508 |
||
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2509 |
"/ 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
|
2510 |
"/ 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
|
2511 |
"/ 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
|
2512 |
"/ 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
|
2513 |
"/ 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
|
2514 |
"/ 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
|
2515 |
"/ 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
|
2516 |
"/ have no documentation). |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2517 |
"/ 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
|
2518 |
"/ 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
|
2519 |
"/ 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
|
2520 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2521 |
(self isTrueGL and:[ForceGL ~~ true]) ifTrue:[ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2522 |
glOK := (displayName = ':0') or:[displayName = ':0.0']. |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2523 |
] ifFalse:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2524 |
glOK := true. |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2525 |
]. |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2526 |
|
185 | 2527 |
%{ |
2528 |
Display *dpy = myDpy; |
|
2529 |
int dummy; |
|
2530 |
||
2531 |
if (ISCONNECTED) { |
|
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2532 |
_INST(hasStereoExtension) = false; |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2533 |
|
1932 | 2534 |
#if defined(XSGIStereo) && defined(GLX) |
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2535 |
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
|
2536 |
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
|
2537 |
_INST(hasStereoExtension) = true; |
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2538 |
} |
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2539 |
#endif |
168 | 2540 |
} |
2541 |
%} |
|
2542 |
! ! |
|
2543 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2544 |
!GLXWorkstation methodsFor:'lines'! |
528 | 2545 |
|
2546 |
glxDeflinestyleN: n ls: ls in: aGLXWindowId |
|
2547 |
"define a line style" |
|
2548 |
||
2549 |
%{ /* NOCONTEXT */ |
|
1932 | 2550 |
SETWIN(aGLXWindowId) |
2551 |
#ifdef OPENGL |
|
2552 |
#else |
|
528 | 2553 |
deflinestyle(_shortVal(n), _linestyleVal(ls)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2554 |
#endif |
528 | 2555 |
%} |
2556 |
! |
|
2557 |
||
2558 |
glxDraw2:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2559 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2560 |
to a new 2D position, passed in vector v." |
528 | 2561 |
|
2562 |
%{ /* NOCONTEXT */ |
|
2563 |
float vec[2], *c_v; |
|
2564 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2565 |
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
|
2566 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2567 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2568 |
#else |
528 | 2569 |
draw2((Coord)(c_v[0]), (Coord)(c_v[1])); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2570 |
#endif |
528 | 2571 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2572 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2573 |
"Modified: 22.3.1996 / 18:03:29 / cg" |
528 | 2574 |
! |
2575 |
||
2576 |
glxDraw2X: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2577 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2578 |
to a new 2D position, passed in x/y." |
528 | 2579 |
|
2580 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2581 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2582 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2583 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2584 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2585 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2586 |
SETWIN(aGLXWindowId) |
1932 | 2587 |
#ifdef OPENGL |
2588 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2589 |
draw2(c_x, c_y); |
1932 | 2590 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2591 |
} |
528 | 2592 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2593 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2594 |
"Modified: 22.3.1996 / 18:03:50 / cg" |
528 | 2595 |
! |
2596 |
||
2597 |
glxDraw2iX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2598 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2599 |
to a new 2D position, passed in x/y." |
528 | 2600 |
|
2601 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2602 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2603 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2604 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2605 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2606 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2607 |
SETWIN(aGLXWindowId) |
1932 | 2608 |
#ifdef OPENGL |
2609 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2610 |
draw2i(c_x, c_y); |
1932 | 2611 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2612 |
} |
528 | 2613 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2614 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2615 |
"Modified: 22.3.1996 / 18:04:07 / cg" |
528 | 2616 |
! |
2617 |
||
2618 |
glxDraw2sX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2619 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2620 |
to a new 2D position, passed in x/y." |
528 | 2621 |
|
2622 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2623 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2624 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2625 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2626 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2627 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2628 |
SETWIN(aGLXWindowId) |
1932 | 2629 |
#ifdef OPENGL |
2630 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2631 |
draw2s(c_x, c_y); |
1932 | 2632 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2633 |
} |
528 | 2634 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2635 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2636 |
"Modified: 22.3.1996 / 18:04:19 / cg" |
528 | 2637 |
! |
2638 |
||
2639 |
glxDraw:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2640 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2641 |
to a new 3D position, passed in vector v." |
528 | 2642 |
|
2643 |
%{ /* NOCONTEXT */ |
|
2644 |
float vec[3], *c_v; |
|
2645 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2646 |
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
|
2647 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2648 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2649 |
#else |
528 | 2650 |
draw((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2651 |
#endif |
528 | 2652 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2653 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2654 |
"Modified: 22.3.1996 / 18:04:34 / cg" |
528 | 2655 |
! |
2656 |
||
2657 |
glxDrawX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2658 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2659 |
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
|
2660 |
The arguments may be floats, fractions or smallIntegers" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2661 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2662 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2663 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2664 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2665 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2666 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2667 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2668 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2669 |
SETWIN(aGLXWindowId) |
1932 | 2670 |
#ifdef OPENGL |
2671 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2672 |
draw(c_x, c_y, c_z); |
1932 | 2673 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2674 |
} |
528 | 2675 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2676 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2677 |
"Modified: 22.3.1996 / 18:04:46 / cg" |
528 | 2678 |
! |
2679 |
||
2680 |
glxDrawiX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2681 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2682 |
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
|
2683 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2684 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2685 |
%{ /* NOCONTEXT */ |
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 |
Icoord 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 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2690 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2691 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2692 |
SETWIN(aGLXWindowId) |
1932 | 2693 |
#ifdef OPENGL |
2694 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2695 |
drawi(c_x, c_y, c_z); |
1932 | 2696 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2697 |
} |
528 | 2698 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2699 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2700 |
"Modified: 22.3.1996 / 18:04:54 / cg" |
528 | 2701 |
! |
2702 |
||
2703 |
glxDrawsX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2704 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2705 |
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
|
2706 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2707 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2708 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2709 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2710 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2711 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2712 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2713 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2714 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2715 |
SETWIN(aGLXWindowId) |
1932 | 2716 |
#ifdef OPENGL |
2717 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2718 |
draws(c_x, c_y, c_z); |
1932 | 2719 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2720 |
} |
528 | 2721 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2722 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2723 |
"Modified: 22.3.1996 / 18:05:01 / cg" |
528 | 2724 |
! |
2725 |
||
2726 |
glxLinewidth: n in: aGLXWindowId |
|
2727 |
"set the linewidth" |
|
2728 |
||
2729 |
%{ /* NOCONTEXT */ |
|
2730 |
SETWIN(aGLXWindowId) |
|
1932 | 2731 |
#ifdef OPENGL |
2732 |
#else |
|
528 | 2733 |
linewidth(_shortVal(n)); |
1932 | 2734 |
#endif |
528 | 2735 |
%} |
2736 |
! |
|
2737 |
||
2738 |
glxLinewidthf: n in: aGLXWindowId |
|
2739 |
"set the linewidth" |
|
2740 |
||
2741 |
%{ /* NOCONTEXT */ |
|
2742 |
SETWIN(aGLXWindowId) |
|
1932 | 2743 |
#ifdef OPENGL |
2744 |
#else |
|
528 | 2745 |
linewidthf(_floatVal(n)); |
1932 | 2746 |
#endif |
528 | 2747 |
RETURN (true); |
2748 |
%} |
|
2749 |
! |
|
2750 |
||
2751 |
glxRdr2:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2752 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2753 |
to a new 2D position, passing the relative distance in the vector v." |
528 | 2754 |
|
2755 |
%{ /* NOCONTEXT */ |
|
2756 |
float vec[2], *c_v; |
|
2757 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2758 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
528 | 2759 |
SETWIN(aGLXWindowId) |
1932 | 2760 |
#ifdef OPENGL |
2761 |
#else |
|
528 | 2762 |
rdr2((Coord)(c_v[0]), (Coord)(c_v[1])); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2763 |
#endif |
528 | 2764 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2765 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2766 |
"Modified: 22.3.1996 / 18:05:54 / cg" |
528 | 2767 |
! |
2768 |
||
2769 |
glxRdr2X: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2770 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2771 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2772 |
|
2773 |
%{ /* NOCONTEXT */ |
|
2774 |
Coord c_x, c_y; |
|
2775 |
||
2776 |
_COORD_ (x, c_x) |
|
2777 |
_COORD_ (y, c_y) |
|
2778 |
SETWIN(aGLXWindowId) |
|
1932 | 2779 |
#ifdef OPENGL |
2780 |
#else |
|
528 | 2781 |
rdr2(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2782 |
#endif |
528 | 2783 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2784 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2785 |
"Modified: 22.3.1996 / 18:06:20 / cg" |
528 | 2786 |
! |
2787 |
||
2788 |
glxRdr2iX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2789 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2790 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2791 |
|
2792 |
%{ /* NOCONTEXT */ |
|
2793 |
Icoord c_x, c_y; |
|
2794 |
||
2795 |
_ICOORD_ (x, c_x) |
|
2796 |
_ICOORD_ (y, c_y) |
|
2797 |
SETWIN(aGLXWindowId) |
|
1932 | 2798 |
#ifdef OPENGL |
2799 |
#else |
|
528 | 2800 |
rdr2i(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2801 |
#endif |
528 | 2802 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2803 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2804 |
"Modified: 22.3.1996 / 18:06:28 / cg" |
528 | 2805 |
! |
2806 |
||
2807 |
glxRdr2sX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2808 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2809 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2810 |
|
2811 |
%{ /* NOCONTEXT */ |
|
2812 |
Scoord c_x, c_y; |
|
2813 |
||
2814 |
_SCOORD_ (x, c_x) |
|
2815 |
_SCOORD_ (y, c_y) |
|
2816 |
SETWIN(aGLXWindowId) |
|
1932 | 2817 |
#ifdef OPENGL |
2818 |
#else |
|
528 | 2819 |
rdr2s(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2820 |
#endif |
528 | 2821 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2822 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2823 |
"Modified: 22.3.1996 / 18:06:34 / cg" |
528 | 2824 |
! |
2825 |
||
2826 |
glxRdr:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2827 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2828 |
to a new 3D position, passing the relative distance in the vector v." |
528 | 2829 |
|
2830 |
%{ /* NOCONTEXT */ |
|
2831 |
float vec[3], *c_v; |
|
2832 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2833 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
528 | 2834 |
SETWIN(aGLXWindowId) |
1932 | 2835 |
#ifdef OPENGL |
2836 |
#else |
|
528 | 2837 |
rdr((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2838 |
#endif |
528 | 2839 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2840 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2841 |
"Modified: 22.3.1996 / 18:06:07 / cg" |
528 | 2842 |
! |
2843 |
||
2844 |
glxRdrX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2845 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2846 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2847 |
|
2848 |
%{ /* NOCONTEXT */ |
|
2849 |
Coord c_x, c_y, c_z; |
|
2850 |
||
2851 |
_COORD_ (x, c_x) |
|
2852 |
_COORD_ (y, c_y) |
|
2853 |
_COORD_ (z, c_z) |
|
2854 |
SETWIN(aGLXWindowId) |
|
1932 | 2855 |
#ifdef OPENGL |
2856 |
#else |
|
528 | 2857 |
rdr(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2858 |
#endif |
528 | 2859 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2860 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2861 |
"Modified: 22.3.1996 / 18:06:44 / cg" |
528 | 2862 |
! |
2863 |
||
2864 |
glxRdriX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2865 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2866 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2867 |
|
2868 |
%{ /* NOCONTEXT */ |
|
2869 |
Icoord c_x, c_y, c_z; |
|
2870 |
||
2871 |
_ICOORD_ (x, c_x) |
|
2872 |
_ICOORD_ (y, c_y) |
|
2873 |
_ICOORD_ (z, c_z) |
|
2874 |
SETWIN(aGLXWindowId) |
|
1932 | 2875 |
#ifdef OPENGL |
2876 |
#else |
|
528 | 2877 |
rdri(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2878 |
#endif |
528 | 2879 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2880 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2881 |
"Modified: 22.3.1996 / 18:06:51 / cg" |
528 | 2882 |
! |
2883 |
||
2884 |
glxRdrsX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2885 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2886 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2887 |
|
2888 |
%{ /* NOCONTEXT */ |
|
2889 |
Scoord c_x, c_y, c_z; |
|
2890 |
||
2891 |
_SCOORD_ (x, c_x) |
|
2892 |
_SCOORD_ (y, c_y) |
|
2893 |
_SCOORD_ (z, c_z) |
|
2894 |
SETWIN(aGLXWindowId) |
|
1932 | 2895 |
#ifdef OPENGL |
2896 |
#else |
|
528 | 2897 |
rdrs(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2898 |
#endif |
528 | 2899 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2900 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2901 |
"Modified: 22.3.1996 / 18:06:55 / cg" |
528 | 2902 |
! |
2903 |
||
2904 |
glxSetlinestyle: index in: aGLXWindowId |
|
2905 |
"set the linestyle" |
|
2906 |
||
2907 |
%{ /* NOCONTEXT */ |
|
2908 |
SETWIN(aGLXWindowId) |
|
1932 | 2909 |
#ifdef OPENGL |
2910 |
#else |
|
528 | 2911 |
setlinestyle(_shortVal(index)); |
1932 | 2912 |
#endif |
2913 |
%} |
|
528 | 2914 |
! ! |
2915 |
||
294 | 2916 |
!GLXWorkstation methodsFor:'materials & lights'! |
2917 |
||
2918 |
glxLmbind:target index:index in:aGLXWindowId |
|
2919 |
"select a material, light or lighting model. |
|
2920 |
target must be a symbol from: #material, #backMaterial, |
|
2921 |
#light0-light7 or #lightModel." |
|
2922 |
||
2923 |
%{ /* NOCONTEXT */ |
|
2924 |
#ifdef GLX |
|
2925 |
short defType; |
|
2926 |
short i_index; |
|
2927 |
||
2928 |
if (target == @symbol(material)) |
|
2929 |
defType = MATERIAL; |
|
2930 |
else if (target == @symbol(backMaterial)) |
|
2931 |
defType = BACKMATERIAL; |
|
2932 |
else if (target == @symbol(light0)) |
|
2933 |
defType = LIGHT0; |
|
2934 |
else if (target == @symbol(light1)) |
|
2935 |
defType = LIGHT1; |
|
2936 |
else if (target == @symbol(light2)) |
|
2937 |
defType = LIGHT2; |
|
2938 |
else if (target == @symbol(light3)) |
|
2939 |
defType = LIGHT3; |
|
2940 |
else if (target == @symbol(light4)) |
|
2941 |
defType = LIGHT4; |
|
2942 |
else if (target == @symbol(light5)) |
|
2943 |
defType = LIGHT5; |
|
2944 |
else if (target == @symbol(light6)) |
|
2945 |
defType = LIGHT6; |
|
2946 |
else if (target == @symbol(light7)) |
|
2947 |
defType = LIGHT7; |
|
2948 |
else if (target == @symbol(lightModel)) |
|
2949 |
defType = LMODEL; |
|
2950 |
else { |
|
1932 | 2951 |
RETURN (nil); |
294 | 2952 |
} |
2953 |
||
2954 |
_INT_ (index, i_index); |
|
2955 |
SETWIN(aGLXWindowId) |
|
2956 |
lmbind(defType, i_index); |
|
1932 | 2957 |
#endif |
2958 |
%} |
|
294 | 2959 |
! |
2960 |
||
2961 |
glxLmdef:what index:index np:np props:props in:aGLXWindowId |
|
2962 |
"define a material, light source or lighting model; |
|
2963 |
what must be one of #material, #light or #lightModel. |
|
2964 |
props must be a FloatArray or a subclass of FloatArray" |
|
2965 |
||
2966 |
%{ /* NOCONTEXT */ |
|
2967 |
#ifdef GLX |
|
2968 |
short defType; |
|
2969 |
short i_index, i_np; |
|
2970 |
float *fp; |
|
2971 |
OBJ cls; |
|
2972 |
int ninstVars, nInstBytes; |
|
2973 |
||
2974 |
if (what == @symbol(material)) |
|
2975 |
defType = DEFMATERIAL; |
|
2976 |
else if (what == @symbol(light)) |
|
2977 |
defType = DEFLIGHT; |
|
2978 |
else if (what == @symbol(lightModel)) |
|
2979 |
defType = DEFLMODEL; |
|
2980 |
else { |
|
1932 | 2981 |
RETURN (nil); |
294 | 2982 |
} |
2983 |
||
2984 |
_INT_ (index, i_index); |
|
2985 |
_INT_ (np, i_np); |
|
2986 |
||
2987 |
if (! _isNonNilObject(props)) fp = NULL; |
|
2988 |
else { |
|
2989 |
cls = __qClass(props); |
|
350 | 2990 |
if (cls == @global(FloatArray)) |
294 | 2991 |
fp = _FloatArrayInstPtr(props)->f_element; |
2992 |
else { |
|
2993 |
if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) { |
|
2994 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
2995 |
fp = (float *) &(_InstPtr(props)->i_instvars[ninstVars]); |
|
2996 |
} else { |
|
1932 | 2997 |
RETURN (nil); |
294 | 2998 |
} |
2999 |
} |
|
3000 |
} |
|
3001 |
SETWIN(aGLXWindowId) |
|
3002 |
lmdef(defType, i_index, i_np, fp); |
|
1932 | 3003 |
#endif |
3004 |
%} |
|
294 | 3005 |
! |
3006 |
||
3007 |
glxTevbind:target index:index in:aGLXWindowId |
|
3008 |
"bind a texture environment; target must be 0 |
|
3009 |
or the symbol #env0." |
|
3010 |
||
3011 |
%{ /* NOCONTEXT */ |
|
3012 |
#ifdef GLX |
|
3013 |
long t; |
|
3014 |
||
3015 |
if (__isSmallInteger(target)) { |
|
3016 |
t = __intVal(target); |
|
3017 |
} else { |
|
3018 |
if (target == @symbol(env0)) { |
|
3019 |
t = TV_ENV0; |
|
3020 |
} else { |
|
1932 | 3021 |
RETURN (nil); |
294 | 3022 |
} |
3023 |
} |
|
3024 |
SETWIN(aGLXWindowId) |
|
3025 |
tevbind(t, __intVal(index)); |
|
1932 | 3026 |
#endif |
3027 |
%} |
|
294 | 3028 |
! |
3029 |
||
3030 |
glxTevdef:index np:np props:props in:aGLXWindowId |
|
3031 |
||
3032 |
%{ /* NOCONTEXT */ |
|
3033 |
#ifdef GLX |
|
3034 |
const float *fp; |
|
3035 |
float fbuff[30]; |
|
3036 |
||
3037 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3038 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
294 | 3039 |
tevdef(__intVal(index), __intVal(np), fp); |
1932 | 3040 |
#endif |
3041 |
%} |
|
294 | 3042 |
! |
3043 |
||
3044 |
glxTexDef2d:index nc:nc width:w height:h bits:image np:np props:props in:aGLXWindowId |
|
3045 |
"define a 2D texture. index is the 'name' of the texture; |
|
3046 |
nc is the number of components (1-4) per pixel; |
|
3047 |
w/h define the size of the texture; bits is a byteArray containing the |
|
3048 |
long-word aligned pixel data; np is the number of props found in |
|
3049 |
the floatArray props. Props must be delimited by a 0.0 entry." |
|
3050 |
||
3051 |
%{ /* NOCONTEXT */ |
|
3052 |
#ifdef GLX |
|
3053 |
unsigned char *cp; |
|
3054 |
const float *fp; |
|
3055 |
OBJ cls; |
|
3056 |
float fbuff[30]; |
|
3057 |
||
3058 |
if (__isByteArray(image)) { |
|
3059 |
cp = _ByteArrayInstPtr(image)->ba_element; |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3060 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
294 | 3061 |
|
3062 |
SETWIN(aGLXWindowId) |
|
3063 |
texdef2d(__intVal(index), __intVal(nc), __intVal(w), __intVal(h), |
|
3064 |
(const unsigned long *)cp, __intVal(np), fp); |
|
3065 |
} |
|
3066 |
#endif |
|
3067 |
%} |
|
3068 |
! |
|
3069 |
||
3070 |
glxTexDef3d:index nc:nc width:w height:h depth:d bits:image np:np props:props in:aGLXWindowId |
|
3071 |
"define a 3D texture. index is the 'name' of the texture; |
|
3072 |
nc is the number of components (1-4) per pixel; |
|
3073 |
w/h/d define the size of the texture; bits is a byteArray containing the |
|
3074 |
long-word aligned pixel data; np is the number of props found in |
|
3075 |
the floatArray props. Props must be delimited by a 0.0 entry." |
|
3076 |
||
3077 |
%{ /* NOCONTEXT */ |
|
3078 |
#ifdef GLX |
|
3079 |
unsigned char *cp; |
|
3080 |
const float *fp; |
|
3081 |
OBJ cls; |
|
3082 |
float fbuff[30]; |
|
3083 |
||
3084 |
if (__isByteArray(image)) { |
|
3085 |
cp = _ByteArrayInstPtr(image)->ba_element; |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3086 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
294 | 3087 |
|
3088 |
SETWIN(aGLXWindowId) |
|
3089 |
texdef3d(__intVal(index), __intVal(nc), __intVal(w), __intVal(h), |
|
3090 |
__intVal(d), |
|
3091 |
(const unsigned long *)cp, __intVal(np), fp); |
|
3092 |
} |
|
3093 |
#endif |
|
3094 |
%} |
|
3095 |
! |
|
3096 |
||
3097 |
glxTexbind:target index:index in:aGLXWindowId |
|
3098 |
"bind a texture; target must be an integer or one |
|
3099 |
of the symbols #texture0, #textureDetail or #textureIdle." |
|
3100 |
||
3101 |
%{ /* NOCONTEXT */ |
|
3102 |
#ifdef GLX |
|
3103 |
long t; |
|
3104 |
||
3105 |
if (__isSmallInteger(target)) { |
|
3106 |
t = __intVal(target); |
|
3107 |
} else { |
|
3108 |
if (target == @symbol(texture0)) { |
|
3109 |
t = TX_TEXTURE_0; |
|
3110 |
} else if (target == @symbol(textureDetail)) { |
|
3111 |
t = TX_TEXTURE_DETAIL; |
|
3112 |
} else if (target == @symbol(textureIdle)) { |
|
3113 |
t = TX_TEXTURE_IDLE; |
|
3114 |
} else { |
|
1932 | 3115 |
RETURN (nil); |
294 | 3116 |
} |
3117 |
} |
|
3118 |
SETWIN(aGLXWindowId) |
|
3119 |
texbind(t, __intVal(index)); |
|
1932 | 3120 |
#endif |
3121 |
%} |
|
294 | 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); |
1932 | 3138 |
#endif |
3139 |
%} |
|
294 | 3140 |
! |
3141 |
||
3142 |
glxLoadMatrix:arrayOf16Floats in:aGLXWindowId |
|
3143 |
"argument must be an array(a matrix) of 16 floats. The current matrix |
|
3144 |
will be loaded from that." |
|
3145 |
||
3146 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3147 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3148 |
#else |
294 | 3149 |
Matrix matrix; |
3150 |
Matrix *m; |
|
3151 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3152 |
if (! (m = __glx_getFloatsFromMatrixInto(arrayOf16Floats, &matrix))) RETURN (false); |
294 | 3153 |
SETWIN(aGLXWindowId) |
3154 |
loadmatrix(*m); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3155 |
#endif |
294 | 3156 |
%} |
3157 |
! |
|
3158 |
||
3159 |
glxMultMatrix:arrayOf16Floats in:aGLXWindowId |
|
3160 |
"argument must be an array(a matrix) of 16 floats containing a |
|
3161 |
matrix to multiply into the current matrix." |
|
3162 |
||
3163 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3164 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3165 |
#else |
294 | 3166 |
Matrix matrix; |
3167 |
Matrix *m; |
|
3168 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3169 |
if (! (m = __glx_getFloatsFromMatrixInto(arrayOf16Floats, &matrix))) RETURN (false); |
294 | 3170 |
SETWIN(aGLXWindowId) |
3171 |
multmatrix(*m); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3172 |
#endif |
294 | 3173 |
%} |
3174 |
! |
|
3175 |
||
3176 |
glxPopmatrixIn:aGLXWindowId |
|
3177 |
"pop transformation stack" |
|
3178 |
||
3179 |
%{ /* NOCONTEXT */ |
|
3180 |
SETWIN(aGLXWindowId) |
|
1932 | 3181 |
#ifdef OPENGL |
3182 |
#else |
|
294 | 3183 |
popmatrix(); |
1932 | 3184 |
#endif |
294 | 3185 |
%} |
3186 |
! |
|
3187 |
||
3188 |
glxPushmatrixIn:aGLXWindowId |
|
3189 |
"push down transformation stack" |
|
3190 |
||
3191 |
%{ /* NOCONTEXT */ |
|
3192 |
SETWIN(aGLXWindowId) |
|
1932 | 3193 |
#ifdef OPENGL |
3194 |
#else |
|
294 | 3195 |
pushmatrix(); |
1932 | 3196 |
#endif |
294 | 3197 |
%} |
3198 |
! ! |
|
3199 |
||
3200 |
!GLXWorkstation methodsFor:'misc'! |
|
3201 |
||
3202 |
glxGconfigIn:aGLXWindowId |
|
3203 |
"must be sent after RGBmode, doubleBuffer etc. to have these |
|
3204 |
changes really take effect. See GLX manual. |
|
3205 |
(Actually, it seems to be not allowed - I dont really know)" |
|
3206 |
||
3207 |
%{ /* NOCONTEXT */ |
|
3208 |
SETWIN(aGLXWindowId) |
|
1932 | 3209 |
#ifdef OPENGL |
3210 |
#else |
|
294 | 3211 |
gconfig(); |
1932 | 3212 |
#endif |
294 | 3213 |
%} |
3214 |
! |
|
3215 |
||
3216 |
glxMmode:aSymbol in:aGLXWindowId |
|
3217 |
"set matrix mode: #single, #viewing, #projection or #texture" |
|
3218 |
||
3219 |
%{ /* NOCONTEXT */ |
|
3220 |
#ifdef GLX |
|
3221 |
if (aSymbol == @symbol(single)) { |
|
3222 |
mmode(MSINGLE); |
|
3223 |
RETURN (true); |
|
3224 |
} |
|
3225 |
if (aSymbol == @symbol(viewing)) { |
|
3226 |
mmode(MVIEWING); |
|
3227 |
RETURN (true); |
|
3228 |
} |
|
3229 |
if (aSymbol == @symbol(projection)) { |
|
3230 |
mmode(MPROJECTION); |
|
3231 |
RETURN (true); |
|
3232 |
} |
|
3233 |
if (aSymbol == @symbol(texture)) { |
|
3234 |
mmode(MTEXTURE); |
|
3235 |
RETURN (true); |
|
3236 |
} |
|
3237 |
#endif |
|
3238 |
%} |
|
3239 |
. |
|
3240 |
^ false |
|
3241 |
! |
|
3242 |
||
3243 |
glxNmode:aSymbol in:aGLXWindowId |
|
3244 |
"set normalize mode: #auto, #normalize" |
|
3245 |
||
3246 |
%{ /* NOCONTEXT */ |
|
3247 |
#ifdef GLX |
|
3248 |
if (aSymbol == @symbol(auto)) { |
|
3249 |
nmode(NAUTO); |
|
3250 |
RETURN (true); |
|
3251 |
} |
|
3252 |
if (aSymbol == @symbol(normalize)) { |
|
3253 |
nmode(NNORMALIZE); |
|
3254 |
RETURN (true); |
|
3255 |
} |
|
3256 |
#endif |
|
3257 |
%} |
|
3258 |
. |
|
3259 |
^ false |
|
3260 |
! |
|
3261 |
||
3262 |
glxRGBmodeIn:aGLXWindowId |
|
3263 |
"set true color mode (no colormap)" |
|
3264 |
||
3265 |
%{ /* NOCONTEXT */ |
|
3266 |
#ifdef GLX |
|
3267 |
SETWIN(aGLXWindowId) |
|
3268 |
RGBmode(); |
|
3269 |
RETURN (true); |
|
3270 |
#endif |
|
3271 |
%} |
|
3272 |
. |
|
3273 |
^ false |
|
3274 |
! ! |
|
3275 |
||
3276 |
!GLXWorkstation methodsFor:'objects'! |
|
3277 |
||
3278 |
glxCallObject:obj in:aGLXWindowId |
|
3279 |
"perform the commands of an object (macro)." |
|
3280 |
||
2075 | 3281 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3282 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3283 |
#else |
294 | 3284 |
if (__isSmallInteger(obj)) { |
3285 |
SETWIN(aGLXWindowId) |
|
3286 |
callobj(_objectVal(obj)); |
|
3287 |
RETURN (true); |
|
3288 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3289 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3290 |
%}. |
294 | 3291 |
^ false |
3292 |
! |
|
3293 |
||
3294 |
glxCallobj: obj in: aGLXWindowId |
|
3295 |
"OBSOLETE; use glxCallObject:in: |
|
3296 |
This one will be removed soon." |
|
3297 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3298 |
self halt |
294 | 3299 |
! |
3300 |
||
3301 |
glxCloseObjectIn:aGLXWindowId |
|
3302 |
"end object defnition" |
|
3303 |
||
2075 | 3304 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3305 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3306 |
#else |
294 | 3307 |
SETWIN(aGLXWindowId) |
3308 |
closeobj(); |
|
3309 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3310 |
#endif |
294 | 3311 |
%} |
3312 |
! |
|
3313 |
||
3314 |
glxCloseobjIn:aGLXWindowId |
|
3315 |
"OBSOLETE: use glxCloseObjectIn: |
|
3316 |
This one will be removed." |
|
3317 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3318 |
self halt |
294 | 3319 |
! |
3320 |
||
3321 |
glxDeleteObject:obj in:aGLXWindowId |
|
3322 |
||
2075 | 3323 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3324 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3325 |
#else |
1882 | 3326 |
if (__isSmallInteger(obj)) { |
3327 |
SETWIN(aGLXWindowId) |
|
3328 |
delobj(_objectVal(obj)); |
|
3329 |
RETURN (true); |
|
3330 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3331 |
#endif |
294 | 3332 |
%} |
3333 |
! |
|
3334 |
||
3335 |
glxDelobj:obj in:aGLXWindowId |
|
3336 |
"OBSOLETE: use glxDeleteObject:in: |
|
3337 |
This one will be removed." |
|
3338 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3339 |
self halt |
294 | 3340 |
! |
3341 |
||
3342 |
glxGenObjectIn:aGLXWindowId |
|
3343 |
"return a new (free & unused) object id for use |
|
3344 |
with makeObj" |
|
3345 |
||
3346 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3347 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3348 |
#else |
294 | 3349 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3350 |
RETURN (__MKSMALLINT(genobj())); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3351 |
#endif |
294 | 3352 |
%} |
3353 |
! |
|
3354 |
||
3355 |
glxGenobjIn:aGLXWindowId |
|
3356 |
"OBSOLETE: use glxGenObject:in: |
|
3357 |
This one will be removed." |
|
3358 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3359 |
self halt |
294 | 3360 |
! |
3361 |
||
3362 |
glxGetopenobjIn:aGLXWindowId |
|
3363 |
"return the currently open objects id; -1 if none is open" |
|
3364 |
||
3365 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3366 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3367 |
#else |
294 | 3368 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3369 |
RETURN (__MKSMALLINT(getopenobj())); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3370 |
#endif |
294 | 3371 |
%} |
3372 |
! |
|
3373 |
||
3374 |
glxIsobj:obj in:aGLXWindowId |
|
3375 |
"return true, if obj is a valid object id" |
|
3376 |
||
3377 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3378 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3379 |
#else |
294 | 3380 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3381 |
RETURN (__MKBOOLEAN(isobj(_objectVal(obj)))); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3382 |
#endif |
294 | 3383 |
%} |
3384 |
! |
|
3385 |
||
3386 |
glxMakeObject:id in:aGLXWindowId |
|
3387 |
"start object definition - |
|
3388 |
another name conflict" |
|
3389 |
||
2075 | 3390 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3391 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3392 |
#else |
294 | 3393 |
if (__isSmallInteger(id)) { |
3394 |
SETWIN(aGLXWindowId) |
|
3395 |
makeobj(_objectVal(id)); |
|
3396 |
RETURN (true); |
|
3397 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3398 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3399 |
%}. |
294 | 3400 |
^ false |
3401 |
! |
|
3402 |
||
3403 |
glxMakeobj:obj in:aGLXWindowId |
|
3404 |
"OBSOLETE; use glxMakeObject:in: |
|
3405 |
This one will be removed soon." |
|
3406 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3407 |
self halt |
294 | 3408 |
! ! |
3409 |
||
3410 |
!GLXWorkstation methodsFor:'patches & surfaces'! |
|
3411 |
||
3412 |
glxBeginCurveIn:aGLXWindowId |
|
3413 |
"start a NURBS curve def - in real GL only" |
|
3414 |
||
3415 |
%{ /* NOCONTEXT */ |
|
1932 | 3416 |
SETWIN(aGLXWindowId) |
3417 |
#ifdef GLX |
|
294 | 3418 |
bgncurve(); |
1932 | 3419 |
#endif |
3420 |
%} |
|
294 | 3421 |
! |
3422 |
||
3423 |
glxBeginSurfaceIn:aGLXWindowId |
|
3424 |
"start a NURBS surface def - in real GL only" |
|
3425 |
||
3426 |
%{ /* NOCONTEXT */ |
|
1932 | 3427 |
SETWIN(aGLXWindowId) |
3428 |
#ifdef GLX |
|
294 | 3429 |
bgnsurface(); |
1932 | 3430 |
#endif |
3431 |
%} |
|
294 | 3432 |
! |
3433 |
||
3434 |
glxDefBasis:id mat:aMatrix in:aGLXWindowId |
|
528 | 3435 |
"define the basis matrix for a patch or curve" |
294 | 3436 |
|
3437 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3438 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3439 |
#else |
294 | 3440 |
Matrix matrix; |
3441 |
Matrix *m; |
|
3442 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3443 |
if (! (m = __glx_getFloatsFromMatrixInto(aMatrix, &matrix))) RETURN (false); |
294 | 3444 |
if (__isSmallInteger(id)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3445 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3446 |
defbasis((short)(__intVal(id)), *m); |
294 | 3447 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3448 |
#endif |
1932 | 3449 |
%} |
528 | 3450 |
|
3451 |
"Modified: 19.3.1996 / 18:52:56 / cg" |
|
294 | 3452 |
! |
3453 |
||
3454 |
glxEndCurveIn:aGLXWindowId |
|
3455 |
"end a NURBS curve def - in real GL only" |
|
3456 |
||
3457 |
%{ /* NOCONTEXT */ |
|
1932 | 3458 |
SETWIN(aGLXWindowId) |
3459 |
#ifdef GLX |
|
294 | 3460 |
endcurve(); |
1932 | 3461 |
#endif |
3462 |
%} |
|
294 | 3463 |
! |
3464 |
||
3465 |
glxEndSurfaceIn:aGLXWindowId |
|
3466 |
"end a NURBS surface def - in real GL only" |
|
3467 |
||
3468 |
%{ /* NOCONTEXT */ |
|
1932 | 3469 |
SETWIN(aGLXWindowId) |
3470 |
#ifdef GLX |
|
294 | 3471 |
endsurface(); |
1932 | 3472 |
#endif |
3473 |
%} |
|
294 | 3474 |
! |
3475 |
||
3476 |
glxNurbsSurfaceUKnotCount: uKnotCount uKnot: uKnot |
|
3477 |
vKnotCount: vKnotCount vKnot: vKnot |
|
3478 |
uOffset: uOffset vOffset: vOffset |
|
3479 |
ctlArray: ctlArray |
|
3480 |
uOrder: uOrder vOrder: vOrder |
|
3481 |
type: type in: aGLXWindowId |
|
3482 |
||
3483 |
| ctlPoints i | |
|
3484 |
ctlPoints := DoubleArray new: ctlArray size * (ctlArray first size). |
|
3485 |
i := 1. |
|
3486 |
ctlArray do: [:point | |
|
3487 |
point do: [:coord | |
|
3488 |
ctlPoints at: i put: coord. |
|
3489 |
i := i + 1]]. |
|
3490 |
||
3491 |
%{ /* NOCONTEXT */ |
|
3492 |
#ifdef GLX |
|
3493 |
char *uKnotElements, *vKnotElements, *ctlElements; |
|
3494 |
OBJ cls; |
|
3495 |
int ninstVars, nInstBytes; |
|
3496 |
||
3497 |
SETWIN(aGLXWindowId) |
|
3498 |
cls = __qClass(ctlPoints); |
|
3499 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
3500 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
|
3501 |
||
3502 |
ctlElements = (char *)(_InstPtr(ctlPoints)) + nInstBytes; |
|
3503 |
uKnotElements = (char *)(_InstPtr(uKnot)) + nInstBytes; |
|
3504 |
vKnotElements = (char *)(_InstPtr(vKnot)) + nInstBytes; |
|
3505 |
||
3506 |
nurbssurface ( |
|
3507 |
__intVal(uKnotCount), (double *)uKnotElements, |
|
3508 |
__intVal(vKnotCount), (double *)vKnotElements, |
|
3509 |
__intVal(uOffset), __intVal(vOffset), |
|
3510 |
(double *)ctlElements, |
|
3511 |
__intVal(uOrder), __intVal(vOrder), __intVal(type)); |
|
3512 |
RETURN(true); |
|
3513 |
#endif |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3514 |
%}. |
294 | 3515 |
^ false |
3516 |
! |
|
3517 |
||
3518 |
glxPatchBasisU:u v:v in:aGLXWindowId |
|
528 | 3519 |
"set the two basis matrices for a patch" |
294 | 3520 |
|
3521 |
%{ /* NOCONTEXT */ |
|
3522 |
if (__bothSmallInteger(u, v)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3523 |
SETWIN(aGLXWindowId) |
1932 | 3524 |
#ifdef OPENGL |
3525 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3526 |
patchbasis((long)__intVal(u), (long)__intVal(v)); |
1932 | 3527 |
#endif |
294 | 3528 |
} |
1932 | 3529 |
%} |
528 | 3530 |
|
3531 |
"Modified: 19.3.1996 / 18:53:18 / cg" |
|
294 | 3532 |
! |
3533 |
||
3534 |
glxPatchCurvesU:u v:v in:aGLXWindowId |
|
528 | 3535 |
"set the number of curves to be drawn in each direction on a patch" |
294 | 3536 |
|
3537 |
%{ /* NOCONTEXT */ |
|
3538 |
if (__bothSmallInteger(u, v)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3539 |
SETWIN(aGLXWindowId) |
1932 | 3540 |
#ifdef OPENGL |
3541 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3542 |
patchcurves((long)__intVal(u), (long)__intVal(v)); |
1932 | 3543 |
#endif |
294 | 3544 |
} |
1932 | 3545 |
%} |
528 | 3546 |
|
3547 |
"Modified: 19.3.1996 / 18:53:34 / cg" |
|
294 | 3548 |
! |
3549 |
||
3550 |
glxPatchPrecisionU:u v:v in:aGLXWindowId |
|
3551 |
"set the patch precision" |
|
3552 |
||
3553 |
%{ /* NOCONTEXT */ |
|
3554 |
if (__bothSmallInteger(u, v)) { |
|
3555 |
SETWIN(aGLXWindowId) |
|
1932 | 3556 |
#ifdef OPENGL |
3557 |
#else |
|
294 | 3558 |
patchprecision((long)__intVal(u), (long)__intVal(v)); |
1932 | 3559 |
#endif |
294 | 3560 |
} |
1932 | 3561 |
%} |
294 | 3562 |
! |
3563 |
||
3564 |
glxPatchX:arrayOf16XFloats y:arrayOf16YFloats z:arrayOf16ZFloats in:aGLXWindowId |
|
528 | 3565 |
"Draws a bicubic patch. |
3566 |
arguments must be arrays of 16 floats containing the patch" |
|
294 | 3567 |
|
3568 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3569 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3570 |
#else |
294 | 3571 |
Matrix matrixX, matrixY, matrixZ; |
3572 |
Matrix *mX, *mY, *mZ; |
|
3573 |
||
1932 | 3574 |
if (! (mX = __glx_getFloatsFromMatrixInto(arrayOf16XFloats, &matrixX))) |
3575 |
RETURN (nil); |
|
3576 |
if (! (mY = __glx_getFloatsFromMatrixInto(arrayOf16YFloats, &matrixY))) |
|
3577 |
RETURN (nil); |
|
3578 |
if (! (mZ = __glx_getFloatsFromMatrixInto(arrayOf16ZFloats, &matrixZ))) |
|
3579 |
RETURN (nil); |
|
294 | 3580 |
SETWIN(aGLXWindowId) |
3581 |
patch(*mX, *mY, *mZ); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3582 |
#endif |
294 | 3583 |
%} |
528 | 3584 |
|
3585 |
"Modified: 19.3.1996 / 18:54:02 / cg" |
|
3586 |
! |
|
3587 |
||
3588 |
glxRpatchX:arrayOf16XFloats y:arrayOf16YFloats z:arrayOf16ZFloats w:arrayOf16WFloats in:aGLXWindowId |
|
3589 |
"Draws a rational bicubic patch. |
|
3590 |
arguments must be arrays of 16 floats containing the patch" |
|
3591 |
||
3592 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3593 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3594 |
#else |
529 | 3595 |
Matrix matrixX, matrixY, matrixZ, matrixW; |
3596 |
Matrix *mX, *mY, *mZ, *mW; |
|
528 | 3597 |
|
1932 | 3598 |
if (! (mX = __glx_getFloatsFromMatrixInto(arrayOf16XFloats, &matrixX))) |
3599 |
RETURN (nil); |
|
3600 |
if (! (mY = __glx_getFloatsFromMatrixInto(arrayOf16YFloats, &matrixY))) |
|
3601 |
RETURN (nil); |
|
3602 |
if (! (mZ = __glx_getFloatsFromMatrixInto(arrayOf16ZFloats, &matrixZ))) |
|
3603 |
RETURN (nil); |
|
3604 |
if (! (mW = __glx_getFloatsFromMatrixInto(arrayOf16WFloats, &matrixW))) |
|
3605 |
RETURN (nil); |
|
529 | 3606 |
SETWIN(aGLXWindowId) |
3607 |
rpatch(*mX, *mY, *mZ, *mW); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3608 |
#endif |
528 | 3609 |
%} |
3610 |
||
3611 |
"Modified: 19.3.1996 / 18:54:02 / cg" |
|
3612 |
"Created: 19.3.1996 / 18:56:34 / cg" |
|
3613 |
! ! |
|
3614 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3615 |
!GLXWorkstation methodsFor:'pixel copy'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3616 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3617 |
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
|
3618 |
"copy a rectangular area in the view. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3619 |
For now, this is only supported with a true GL. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3620 |
readsource specifies which plane/buffer is affected by this operation." |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3621 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3622 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3623 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3624 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3625 |
rectcopy(_screencoordVal(x1), _screencoordVal(y1), |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3626 |
_screencoordVal(x2), _screencoordVal(y2), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3627 |
_screencoordVal(newx), _screencoordVal(newy)); |
1932 | 3628 |
#endif |
3629 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3630 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3631 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3632 |
!GLXWorkstation methodsFor:'pixel reading'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3633 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3634 |
glxReadpixelsTo:dest in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3635 |
"read pixels from the view. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3636 |
Dest must be an array and gets pixel values assigned, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3637 |
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
|
3638 |
For now, pixel-reading is only supported with a true GL. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3639 |
Caveat: the number of pixels is limited to 256. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3640 |
In double buffer mode, the backBuffer is read." |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3641 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3642 |
|n| |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3643 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3644 |
n := dest size. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3645 |
n > 256 ifTrue:[^ 0]. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3646 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3647 |
%{ /* STACK:1024 */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3648 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3649 |
Colorindex buffer[256]; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3650 |
int i, nRead; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3651 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3652 |
if (__isArray(dest)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3653 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3654 |
nRead = readpixels(__intVal(n), buffer); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3655 |
for (i=0; i<nRead;i++) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3656 |
__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
|
3657 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3658 |
RETURN (__MKSMALLINT(nRead)); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3659 |
} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3660 |
#endif |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3661 |
%}. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3662 |
^ 0 |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3663 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3664 |
"Modified: 22.3.1996 / 18:08:00 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3665 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3666 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3667 |
glxReadsource: src in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3668 |
"specify what is read with folowing readPixels requests. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3669 |
For now, pixel-reading is only supported with a true GL" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3670 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3671 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3672 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3673 |
OBJ s = src; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3674 |
int what; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3675 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3676 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3677 |
if (s == @symbol(auto)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3678 |
what = SRC_AUTO; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3679 |
} else if (s == @symbol(front)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3680 |
what = SRC_FRONT; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3681 |
} else if (s == @symbol(back)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3682 |
what = SRC_BACK; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3683 |
} else if (s == @symbol(zBuffer)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3684 |
what = SRC_ZBUFFER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3685 |
} else if (s == @symbol(frameGrabber)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3686 |
what = SRC_FRAMEGRABBER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3687 |
} else if (s == @symbol(over)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3688 |
what = SRC_OVER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3689 |
} else if (s == @symbol(under)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3690 |
what = SRC_UNDER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3691 |
} else if (s == @symbol(popUp)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3692 |
what = SRC_PUP; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3693 |
} else { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3694 |
what = _longVal(src); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3695 |
} |
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 |
readsource(what); |
1932 | 3698 |
#endif |
3699 |
%} |
|
538 | 3700 |
! |
3701 |
||
541 | 3702 |
glxRectreadX1:x1 y1:y1 x2:x2 y2:y2 h:viewHeight to:dest in:aGLXWindowId |
538 | 3703 |
"read pixels from a rectanglular area. |
3704 |
Dest must be an array and gets pixel values assigned, |
|
3705 |
reading n*m pixels. |
|
3706 |
For now, pixel-reading is only supported with a true GL. |
|
3707 |
Caveat: the number of pixels is limited to 256. |
|
3708 |
In double buffer mode, the backBuffer is read." |
|
3709 |
||
541 | 3710 |
|n idx sy1 sy2| |
3711 |
||
3712 |
"/ GLX's y coordinates go bottom to top ... |
|
3713 |
||
3714 |
sy1 := viewHeight - y1. |
|
3715 |
sy2 := viewHeight - y2. |
|
538 | 3716 |
|
3717 |
n := (x2 - x1 + 1) * (y2 - y1 + 1). |
|
3718 |
n > 256 ifTrue:[^ 0]. |
|
3719 |
dest size < n ifTrue:[^ 0]. |
|
3720 |
||
3721 |
%{ /* STACK:1024 */ |
|
3722 |
#ifdef GLX |
|
3723 |
Colorindex buffer[256]; |
|
3724 |
int i, nRead; |
|
3725 |
||
3726 |
if (__isArray(dest) |
|
3727 |
&& __isSmallInteger(x1) && __isSmallInteger(x2) |
|
541 | 3728 |
&& __isSmallInteger(sy1) && __isSmallInteger(sy2) |
538 | 3729 |
) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3730 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3731 |
nRead = rectread(__intVal(x1), __intVal(sy1), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3732 |
__intVal(x2), __intVal(sy2), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3733 |
buffer); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3734 |
for (i=0; i<nRead;i++) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3735 |
__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
|
3736 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3737 |
RETURN (__MKSMALLINT(nRead)); |
538 | 3738 |
} |
3739 |
#endif |
|
3740 |
%}. |
|
3741 |
"/ |
|
3742 |
"/ ok, this is not a GL - use XWorkstations pixel read method |
|
3743 |
"/ and convert |
|
3744 |
"/ |
|
3745 |
idx := 1. |
|
3746 |
y1 to:y2 do:[:y | |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3747 |
x1 to:x2 do:[:x | |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3748 |
|pix| |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3749 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3750 |
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
|
3751 |
dest at:idx put:pix |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3752 |
] |
538 | 3753 |
]. |
3754 |
^ n |
|
3755 |
||
3756 |
"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
|
3757 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3758 |
! |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3759 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3760 |
glxXColorToGLColor:pixel |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3761 |
"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
|
3762 |
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
|
3763 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3764 |
%{ /* NOCONTEXT */ |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3765 |
#ifdef VGL |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3766 |
if (__isSmallInteger(pixel)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3767 |
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
|
3768 |
} |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3769 |
#endif |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3770 |
%}. |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3771 |
^ pixel |
543
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3772 |
! |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3773 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3774 |
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
|
3775 |
"special for VGL" |
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 |
#ifdef VGL |
1932 | 3779 |
if (__bothSmallInteger(x, y)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3780 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3781 |
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
|
3782 |
} |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3783 |
#endif |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3784 |
%}. |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3785 |
^ 0 |
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 |
"Modified: 22.3.1996 / 18:08:00 / cg" |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3788 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3789 |
|
528 | 3790 |
!GLXWorkstation methodsFor:'points'! |
3791 |
||
3792 |
glxPnt2X: x y: y in: aGLXWindowId |
|
3793 |
"plot a point in x, y, 0." |
|
3794 |
||
3795 |
%{ /* NOCONTEXT */ |
|
3796 |
Coord c_x, c_y; |
|
3797 |
||
3798 |
_COORD_ (x, c_x) |
|
3799 |
_COORD_ (y, c_y) |
|
3800 |
SETWIN(aGLXWindowId) |
|
1932 | 3801 |
#ifdef OPENGL |
3802 |
#else |
|
528 | 3803 |
pnt2(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3804 |
#endif |
528 | 3805 |
%} |
3806 |
||
3807 |
"Modified: 19.3.1996 / 18:35:55 / cg" |
|
3808 |
! |
|
3809 |
||
3810 |
glxPnt2iX: x y: y in: aGLXWindowId |
|
3811 |
"plot a point in x, y, 0." |
|
3812 |
||
3813 |
%{ /* NOCONTEXT */ |
|
3814 |
Icoord c_x, c_y; |
|
3815 |
||
3816 |
_ICOORD_ (x, c_x) |
|
3817 |
_ICOORD_ (y, c_y) |
|
3818 |
SETWIN(aGLXWindowId) |
|
1932 | 3819 |
#ifdef OPENGL |
3820 |
#else |
|
528 | 3821 |
pnt2i(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3822 |
#endif |
528 | 3823 |
%} |
3824 |
||
3825 |
"Modified: 19.3.1996 / 18:35:59 / cg" |
|
3826 |
! |
|
3827 |
||
3828 |
glxPnt2sX: x y: y in: aGLXWindowId |
|
3829 |
"plot a point in x, y, 0." |
|
3830 |
||
3831 |
%{ /* NOCONTEXT */ |
|
3832 |
Scoord c_x, c_y; |
|
3833 |
||
3834 |
_SCOORD_ (x, c_x) |
|
3835 |
_SCOORD_ (y, c_y) |
|
3836 |
SETWIN(aGLXWindowId) |
|
1932 | 3837 |
#ifdef OPENGL |
3838 |
#else |
|
528 | 3839 |
pnt2s(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3840 |
#endif |
528 | 3841 |
%} |
3842 |
||
3843 |
"Modified: 19.3.1996 / 18:36:03 / cg" |
|
3844 |
! |
|
3845 |
||
3846 |
glxPntX: x y: y z: z in: aGLXWindowId |
|
3847 |
"plot a point in x, y, z." |
|
3848 |
||
3849 |
%{ /* NOCONTEXT */ |
|
3850 |
Coord c_x, c_y, c_z; |
|
3851 |
||
3852 |
_COORD_ (x, c_x) |
|
3853 |
_COORD_ (y, c_y) |
|
3854 |
_COORD_ (z, c_z) |
|
3855 |
SETWIN(aGLXWindowId) |
|
1932 | 3856 |
#ifdef OPENGL |
3857 |
#else |
|
528 | 3858 |
pnt(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3859 |
#endif |
528 | 3860 |
%} |
3861 |
||
3862 |
"Modified: 19.3.1996 / 18:36:08 / cg" |
|
3863 |
! |
|
3864 |
||
3865 |
glxPntiX: x y: y z: z in: aGLXWindowId |
|
3866 |
"plot a point in x, y, z." |
|
3867 |
||
3868 |
%{ /* NOCONTEXT */ |
|
3869 |
Icoord c_x, c_y, c_z; |
|
3870 |
||
3871 |
_ICOORD_ (x, c_x) |
|
3872 |
_ICOORD_ (y, c_y) |
|
3873 |
_ICOORD_ (z, c_z) |
|
3874 |
SETWIN(aGLXWindowId) |
|
1932 | 3875 |
#ifdef OPENGL |
3876 |
#else |
|
528 | 3877 |
pnti(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3878 |
#endif |
528 | 3879 |
%} |
3880 |
||
3881 |
"Modified: 19.3.1996 / 18:36:14 / cg" |
|
3882 |
! |
|
3883 |
||
3884 |
glxPntsX: x y: y z: z in: aGLXWindowId |
|
3885 |
"plot a point in x, y, z." |
|
3886 |
||
3887 |
%{ /* NOCONTEXT */ |
|
3888 |
Scoord c_x, c_y, c_z; |
|
3889 |
||
3890 |
_SCOORD_ (x, c_x) |
|
3891 |
_SCOORD_ (y, c_y) |
|
3892 |
_SCOORD_ (z, c_z) |
|
3893 |
SETWIN(aGLXWindowId) |
|
1932 | 3894 |
#ifdef OPENGL |
3895 |
#else |
|
528 | 3896 |
pnts(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3897 |
#endif |
528 | 3898 |
%} |
3899 |
||
3900 |
"Modified: 19.3.1996 / 18:36:17 / cg" |
|
3901 |
! |
|
3902 |
||
3903 |
glxPntsize: n in: aGLXWindowId |
|
3904 |
||
3905 |
%{ /* NOCONTEXT */ |
|
1932 | 3906 |
SETWIN(aGLXWindowId) |
3907 |
#ifdef GLX |
|
528 | 3908 |
pntsize(_shortVal(n)); |
1932 | 3909 |
#endif |
3910 |
%} |
|
528 | 3911 |
! |
3912 |
||
3913 |
glxPntsizef: n in: aGLXWindowId |
|
3914 |
||
3915 |
%{ /* NOCONTEXT */ |
|
1932 | 3916 |
SETWIN(aGLXWindowId) |
3917 |
#ifdef GLX |
|
528 | 3918 |
pntsizef(_floatVal(n)); |
1932 | 3919 |
#endif |
3920 |
%} |
|
528 | 3921 |
! ! |
3922 |
||
3923 |
!GLXWorkstation methodsFor:'polygons'! |
|
3924 |
||
3925 |
glxBackface: b in: aGLXWindowId |
|
3926 |
"enable/disable culling of backfacing polygons (suppress its drawing). |
|
3927 |
A polygon is backfacing if it's orientation in *screen* coords is clockwise" |
|
3928 |
||
3929 |
%{ /* NOCONTEXT */ |
|
3930 |
SETWIN(aGLXWindowId) |
|
1932 | 3931 |
#ifdef OPENGL |
3932 |
#else |
|
528 | 3933 |
backface(_booleanVal(b)); |
1932 | 3934 |
#endif |
528 | 3935 |
%} |
3936 |
||
3937 |
"Modified: 19.3.1996 / 18:26:50 / cg" |
|
3938 |
! |
|
3939 |
||
3940 |
glxConcave: b in: aGLXWindowId |
|
3941 |
"signal wether or not polygons are concave" |
|
3942 |
||
3943 |
%{ /* NOCONTEXT */ |
|
3944 |
SETWIN(aGLXWindowId) |
|
1932 | 3945 |
#ifdef OPENGL |
3946 |
#else |
|
528 | 3947 |
concave(_booleanVal(b)); |
1932 | 3948 |
#endif |
528 | 3949 |
%} |
3950 |
! |
|
3951 |
||
3952 |
glxFrontface: b in: aGLXWindowId |
|
3953 |
"enable/disable culling of frontfacing polygons (suppress its drawing). |
|
3954 |
A polygon is frontfacing if it's orientation in *screen* coords is |
|
3955 |
anti-clockwise" |
|
3956 |
||
3957 |
||
3958 |
%{ /* NOCONTEXT */ |
|
3959 |
SETWIN(aGLXWindowId) |
|
1932 | 3960 |
#ifdef OPENGL |
3961 |
#else |
|
528 | 3962 |
frontface(_booleanVal(b)); |
1932 | 3963 |
#endif |
3964 |
%} |
|
528 | 3965 |
! |
3966 |
||
3967 |
glxPdr2X: x y: y in: aGLXWindowId |
|
3968 |
"add another vertex to the polygon" |
|
3969 |
||
3970 |
%{ /* NOCONTEXT */ |
|
3971 |
Coord c_x, c_y; |
|
3972 |
||
3973 |
_COORD_ (x, c_x) |
|
3974 |
_COORD_ (y, c_y) |
|
3975 |
SETWIN(aGLXWindowId) |
|
1932 | 3976 |
#ifdef OPENGL |
3977 |
#else |
|
528 | 3978 |
pdr2(c_x, c_y); |
1932 | 3979 |
#endif |
3980 |
%} |
|
528 | 3981 |
! |
3982 |
||
3983 |
glxPdr2iX: x y: y in: aGLXWindowId |
|
3984 |
"add another vertex to the polygon" |
|
3985 |
||
3986 |
%{ /* NOCONTEXT */ |
|
3987 |
Icoord c_x, c_y; |
|
3988 |
||
3989 |
_ICOORD_ (x, c_x) |
|
3990 |
_ICOORD_ (y, c_y) |
|
3991 |
SETWIN(aGLXWindowId) |
|
1932 | 3992 |
#ifdef OPENGL |
3993 |
#else |
|
528 | 3994 |
pdr2i(c_x, c_y); |
1932 | 3995 |
#endif |
528 | 3996 |
%} |
3997 |
||
3998 |
"Modified: 19.3.1996 / 18:33:28 / cg" |
|
3999 |
! |
|
4000 |
||
4001 |
glxPdr2sX: x y: y in: aGLXWindowId |
|
4002 |
"add another vertex to the polygon" |
|
4003 |
||
4004 |
%{ /* NOCONTEXT */ |
|
4005 |
Scoord c_x, c_y; |
|
4006 |
||
4007 |
_SCOORD_ (x, c_x) |
|
4008 |
_SCOORD_ (y, c_y) |
|
4009 |
SETWIN(aGLXWindowId) |
|
1932 | 4010 |
#ifdef OPENGL |
4011 |
#else |
|
528 | 4012 |
pdr2s(c_x, c_y); |
1932 | 4013 |
#endif |
528 | 4014 |
%} |
4015 |
||
4016 |
"Modified: 19.3.1996 / 18:34:03 / cg" |
|
4017 |
! |
|
4018 |
||
4019 |
glxPdrX: x y: y z: z in: aGLXWindowId |
|
4020 |
"add another vertex to the polygon" |
|
4021 |
||
4022 |
%{ /* NOCONTEXT */ |
|
4023 |
Coord c_x, c_y, c_z; |
|
4024 |
||
4025 |
_COORD_ (x, c_x) |
|
4026 |
_COORD_ (y, c_y) |
|
4027 |
_COORD_ (z, c_z) |
|
4028 |
SETWIN(aGLXWindowId) |
|
1932 | 4029 |
#ifdef OPENGL |
4030 |
#else |
|
528 | 4031 |
pdr(c_x, c_y, c_z); |
1932 | 4032 |
#endif |
528 | 4033 |
%} |
4034 |
||
4035 |
"Modified: 19.3.1996 / 18:34:06 / cg" |
|
4036 |
! |
|
4037 |
||
4038 |
glxPdriX: x y: y z: z in: aGLXWindowId |
|
4039 |
"add another vertex to the polygon" |
|
4040 |
||
4041 |
%{ /* NOCONTEXT */ |
|
4042 |
Icoord c_x, c_y, c_z; |
|
4043 |
||
4044 |
_ICOORD_ (x, c_x) |
|
4045 |
_ICOORD_ (y, c_y) |
|
4046 |
_ICOORD_ (z, c_z) |
|
4047 |
SETWIN(aGLXWindowId) |
|
1932 | 4048 |
#ifdef OPENGL |
4049 |
#else |
|
528 | 4050 |
pdri(c_x, c_y, c_z); |
1932 | 4051 |
#endif |
528 | 4052 |
%} |
4053 |
||
4054 |
"Modified: 19.3.1996 / 18:34:11 / cg" |
|
4055 |
! |
|
4056 |
||
4057 |
glxPdrsX: x y: y z: z in: aGLXWindowId |
|
4058 |
"add another vertex to the polygon" |
|
4059 |
||
4060 |
%{ /* NOCONTEXT */ |
|
4061 |
Scoord c_x, c_y, c_z; |
|
4062 |
||
4063 |
_SCOORD_ (x, c_x) |
|
4064 |
_SCOORD_ (y, c_y) |
|
4065 |
_SCOORD_ (z, c_z) |
|
4066 |
SETWIN(aGLXWindowId) |
|
1932 | 4067 |
#ifdef OPENGL |
4068 |
#else |
|
528 | 4069 |
pdrs(c_x, c_y, c_z); |
1932 | 4070 |
#endif |
528 | 4071 |
%} |
4072 |
||
4073 |
"Modified: 19.3.1996 / 18:34:14 / cg" |
|
4074 |
! |
|
4075 |
||
4076 |
glxPmv2X: x y: y in: aGLXWindowId |
|
4077 |
"set the start position of a polygon" |
|
4078 |
||
4079 |
%{ /* NOCONTEXT */ |
|
4080 |
Coord c_x, c_y; |
|
4081 |
||
4082 |
_COORD_ (x, c_x) |
|
4083 |
_COORD_ (y, c_y) |
|
4084 |
SETWIN(aGLXWindowId) |
|
1932 | 4085 |
#ifdef OPENGL |
4086 |
#else |
|
528 | 4087 |
pmv2(c_x, c_y); |
1932 | 4088 |
#endif |
528 | 4089 |
%} |
4090 |
||
4091 |
"Modified: 19.3.1996 / 18:32:45 / cg" |
|
4092 |
! |
|
4093 |
||
4094 |
glxPmv2iX: x y: y in: aGLXWindowId |
|
4095 |
"set the start position of a polygon" |
|
4096 |
||
4097 |
%{ /* NOCONTEXT */ |
|
4098 |
Icoord c_x, c_y; |
|
4099 |
||
4100 |
_ICOORD_ (x, c_x) |
|
4101 |
_ICOORD_ (y, c_y) |
|
4102 |
SETWIN(aGLXWindowId) |
|
1932 | 4103 |
#ifdef OPENGL |
4104 |
#else |
|
528 | 4105 |
pmv2i(c_x, c_y); |
1932 | 4106 |
#endif |
528 | 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) |
|
1932 | 4121 |
#ifdef OPENGL |
4122 |
#else |
|
528 | 4123 |
pmv2s(c_x, c_y); |
1932 | 4124 |
#endif |
528 | 4125 |
%} |
4126 |
||
4127 |
"Modified: 19.3.1996 / 18:32:38 / cg" |
|
4128 |
! |
|
4129 |
||
4130 |
glxPmvX: x y: y z: z in: aGLXWindowId |
|
4131 |
"set the start position of a polygon" |
|
4132 |
||
4133 |
%{ /* NOCONTEXT */ |
|
4134 |
Coord c_x, c_y, c_z; |
|
4135 |
||
4136 |
_COORD_ (x, c_x) |
|
4137 |
_COORD_ (y, c_y) |
|
4138 |
_COORD_ (z, c_z) |
|
4139 |
SETWIN(aGLXWindowId) |
|
1932 | 4140 |
#ifdef OPENGL |
4141 |
#else |
|
528 | 4142 |
pmv(c_x, c_y, c_z); |
1932 | 4143 |
#endif |
528 | 4144 |
%} |
4145 |
||
4146 |
"Modified: 19.3.1996 / 18:31:52 / cg" |
|
4147 |
! |
|
4148 |
||
4149 |
glxPmviX: x y: y z: z in: aGLXWindowId |
|
4150 |
"set the start position of a polygon" |
|
4151 |
||
4152 |
%{ /* NOCONTEXT */ |
|
4153 |
Icoord c_x, c_y, c_z; |
|
4154 |
||
4155 |
_ICOORD_ (x, c_x) |
|
4156 |
_ICOORD_ (y, c_y) |
|
4157 |
_ICOORD_ (z, c_z) |
|
4158 |
SETWIN(aGLXWindowId) |
|
1932 | 4159 |
#ifdef OPENGL |
4160 |
#else |
|
528 | 4161 |
pmvi(c_x, c_y, c_z); |
1932 | 4162 |
#endif |
528 | 4163 |
%} |
4164 |
||
4165 |
"Modified: 19.3.1996 / 18:31:59 / cg" |
|
4166 |
! |
|
4167 |
||
4168 |
glxPmvsX: x y: y z: z in: aGLXWindowId |
|
4169 |
"set the start position of a polygon" |
|
4170 |
||
4171 |
%{ /* NOCONTEXT */ |
|
4172 |
Scoord c_x, c_y, c_z; |
|
4173 |
||
4174 |
_SCOORD_ (x, c_x) |
|
4175 |
_SCOORD_ (y, c_y) |
|
4176 |
_SCOORD_ (z, c_z) |
|
4177 |
SETWIN(aGLXWindowId) |
|
1932 | 4178 |
#ifdef OPENGL |
4179 |
#else |
|
528 | 4180 |
pmvs(c_x, c_y, c_z); |
1932 | 4181 |
#endif |
528 | 4182 |
%} |
4183 |
||
4184 |
"Modified: 19.3.1996 / 18:32:03 / cg" |
|
4185 |
! |
|
4186 |
||
4187 |
glxPolymode: mode in: aGLXWindowId |
|
4188 |
"Sets the polygon filling mode - only filled (1) or outlined (0) |
|
4189 |
are supported" |
|
4190 |
||
4191 |
%{ /* NOCONTEXT */ |
|
4192 |
SETWIN(aGLXWindowId) |
|
1932 | 4193 |
#ifdef OPENGL |
4194 |
#else |
|
528 | 4195 |
polymode(_longVal(mode)); |
1932 | 4196 |
#endif |
528 | 4197 |
%} |
4198 |
||
4199 |
"Modified: 19.3.1996 / 18:29:32 / cg" |
|
4200 |
! |
|
4201 |
||
4202 |
glxRpdr2X: x y: y in: aGLXWindowId |
|
4203 |
"add another relative vertex to the polygon" |
|
4204 |
||
4205 |
%{ /* NOCONTEXT */ |
|
4206 |
Coord c_x, c_y; |
|
4207 |
||
4208 |
_COORD_ (x, c_x) |
|
4209 |
_COORD_ (y, c_y) |
|
4210 |
SETWIN(aGLXWindowId) |
|
1932 | 4211 |
#ifdef OPENGL |
4212 |
#else |
|
528 | 4213 |
rpdr2(c_x, c_y); |
1932 | 4214 |
#endif |
528 | 4215 |
%} |
4216 |
||
4217 |
"Modified: 19.3.1996 / 18:34:31 / cg" |
|
4218 |
! |
|
4219 |
||
4220 |
glxRpdr2iX: x y: y in: aGLXWindowId |
|
4221 |
"add another relative vertex to the polygon" |
|
4222 |
||
4223 |
%{ /* NOCONTEXT */ |
|
4224 |
Icoord c_x, c_y; |
|
4225 |
||
4226 |
_ICOORD_ (x, c_x) |
|
4227 |
_ICOORD_ (y, c_y) |
|
4228 |
SETWIN(aGLXWindowId) |
|
1932 | 4229 |
#ifdef OPENGL |
4230 |
#else |
|
528 | 4231 |
rpdr2i(c_x, c_y); |
1932 | 4232 |
#endif |
528 | 4233 |
%} |
4234 |
||
4235 |
"Modified: 19.3.1996 / 18:34:36 / cg" |
|
4236 |
! |
|
4237 |
||
4238 |
glxRpdr2sX: x y: y in: aGLXWindowId |
|
4239 |
"add another relative vertex to the polygon" |
|
4240 |
||
4241 |
%{ /* NOCONTEXT */ |
|
4242 |
Scoord c_x, c_y; |
|
4243 |
||
4244 |
_SCOORD_ (x, c_x) |
|
4245 |
_SCOORD_ (y, c_y) |
|
4246 |
SETWIN(aGLXWindowId) |
|
1932 | 4247 |
#ifdef OPENGL |
4248 |
#else |
|
528 | 4249 |
rpdr2s(c_x, c_y); |
1932 | 4250 |
#endif |
528 | 4251 |
%} |
4252 |
||
4253 |
"Modified: 19.3.1996 / 18:34:40 / cg" |
|
4254 |
! |
|
4255 |
||
4256 |
glxRpdrX: x y: y z: z in: aGLXWindowId |
|
4257 |
"add another relative vertex to the polygon" |
|
4258 |
||
4259 |
%{ /* NOCONTEXT */ |
|
4260 |
Coord c_x, c_y, c_z; |
|
4261 |
||
4262 |
_COORD_ (x, c_x) |
|
4263 |
_COORD_ (y, c_y) |
|
4264 |
_COORD_ (z, c_z) |
|
4265 |
SETWIN(aGLXWindowId) |
|
1932 | 4266 |
#ifdef OPENGL |
4267 |
#else |
|
528 | 4268 |
rpdr(c_x, c_y, c_z); |
1932 | 4269 |
#endif |
528 | 4270 |
%} |
4271 |
||
4272 |
"Modified: 19.3.1996 / 18:34:48 / cg" |
|
4273 |
! |
|
4274 |
||
4275 |
glxRpdriX: x y: y z: z in: aGLXWindowId |
|
4276 |
"add another relative vertex to the polygon" |
|
4277 |
||
4278 |
%{ /* NOCONTEXT */ |
|
4279 |
Icoord c_x, c_y, c_z; |
|
4280 |
||
4281 |
_ICOORD_ (x, c_x) |
|
4282 |
_ICOORD_ (y, c_y) |
|
4283 |
_ICOORD_ (z, c_z) |
|
4284 |
SETWIN(aGLXWindowId) |
|
1932 | 4285 |
#ifdef OPENGL |
4286 |
#else |
|
528 | 4287 |
rpdri(c_x, c_y, c_z); |
1932 | 4288 |
#endif |
528 | 4289 |
%} |
4290 |
||
4291 |
"Modified: 19.3.1996 / 18:34:51 / cg" |
|
4292 |
! |
|
4293 |
||
4294 |
glxRpdrsX: x y: y z: z in: aGLXWindowId |
|
4295 |
"add another relative vertex to the polygon" |
|
4296 |
||
4297 |
%{ /* NOCONTEXT */ |
|
4298 |
Scoord c_x, c_y, c_z; |
|
4299 |
||
4300 |
_SCOORD_ (x, c_x) |
|
4301 |
_SCOORD_ (y, c_y) |
|
4302 |
_SCOORD_ (z, c_z) |
|
4303 |
SETWIN(aGLXWindowId) |
|
1932 | 4304 |
#ifdef OPENGL |
4305 |
#else |
|
528 | 4306 |
rpdrs(c_x, c_y, c_z); |
1932 | 4307 |
#endif |
528 | 4308 |
%} |
4309 |
||
4310 |
"Modified: 19.3.1996 / 18:34:55 / cg" |
|
4311 |
! |
|
4312 |
||
4313 |
glxRpmv2X: x y: y in: aGLXWindowId |
|
4314 |
"set the start position of a polygon" |
|
4315 |
||
4316 |
%{ /* NOCONTEXT */ |
|
4317 |
Coord c_x, c_y; |
|
4318 |
||
4319 |
_COORD_ (x, c_x) |
|
4320 |
_COORD_ (y, c_y) |
|
4321 |
SETWIN(aGLXWindowId) |
|
1932 | 4322 |
#ifdef OPENGL |
4323 |
#else |
|
528 | 4324 |
rpmv2(c_x, c_y); |
1932 | 4325 |
#endif |
528 | 4326 |
%} |
4327 |
||
4328 |
"Modified: 19.3.1996 / 18:37:15 / cg" |
|
4329 |
! |
|
4330 |
||
4331 |
glxRpmv2iX: x y: y in: aGLXWindowId |
|
4332 |
"set the start position of a polygon" |
|
4333 |
||
4334 |
%{ /* NOCONTEXT */ |
|
4335 |
Icoord c_x, c_y; |
|
4336 |
||
4337 |
_ICOORD_ (x, c_x) |
|
4338 |
_ICOORD_ (y, c_y) |
|
4339 |
SETWIN(aGLXWindowId) |
|
1932 | 4340 |
#ifdef OPENGL |
4341 |
#else |
|
528 | 4342 |
rpmv2i(c_x, c_y); |
1932 | 4343 |
#endif |
528 | 4344 |
%} |
4345 |
||
4346 |
"Modified: 19.3.1996 / 18:37:20 / cg" |
|
4347 |
! |
|
4348 |
||
4349 |
glxRpmv2sX: x y: y in: aGLXWindowId |
|
4350 |
"set the relative start position of a polygon" |
|
4351 |
||
4352 |
%{ /* NOCONTEXT */ |
|
4353 |
Scoord c_x, c_y; |
|
4354 |
||
4355 |
_SCOORD_ (x, c_x) |
|
4356 |
_SCOORD_ (y, c_y) |
|
4357 |
SETWIN(aGLXWindowId) |
|
1932 | 4358 |
#ifdef OPENGL |
4359 |
#else |
|
528 | 4360 |
rpmv2s(c_x, c_y); |
1932 | 4361 |
#endif |
528 | 4362 |
%} |
4363 |
||
4364 |
"Modified: 19.3.1996 / 18:38:06 / cg" |
|
4365 |
! |
|
4366 |
||
4367 |
glxRpmvX: x y: y z: z in: aGLXWindowId |
|
4368 |
"set the relative start position of a polygon" |
|
4369 |
||
4370 |
%{ /* NOCONTEXT */ |
|
4371 |
Coord c_x, c_y, c_z; |
|
4372 |
||
4373 |
_COORD_ (x, c_x) |
|
4374 |
_COORD_ (y, c_y) |
|
4375 |
_COORD_ (z, c_z) |
|
4376 |
SETWIN(aGLXWindowId) |
|
1932 | 4377 |
#ifdef OPENGL |
4378 |
#else |
|
528 | 4379 |
rpmv(c_x, c_y, c_z); |
1932 | 4380 |
#endif |
528 | 4381 |
%} |
4382 |
||
4383 |
"Modified: 19.3.1996 / 18:38:03 / cg" |
|
4384 |
! |
|
4385 |
||
4386 |
glxRpmviX: x y: y z: z in: aGLXWindowId |
|
4387 |
"set the relative start position of a polygon" |
|
4388 |
||
4389 |
%{ /* NOCONTEXT */ |
|
4390 |
Icoord c_x, c_y, c_z; |
|
4391 |
||
4392 |
_ICOORD_ (x, c_x) |
|
4393 |
_ICOORD_ (y, c_y) |
|
4394 |
_ICOORD_ (z, c_z) |
|
4395 |
SETWIN(aGLXWindowId) |
|
1932 | 4396 |
#ifdef OPENGL |
4397 |
#else |
|
528 | 4398 |
rpmvi(c_x, c_y, c_z); |
1932 | 4399 |
#endif |
528 | 4400 |
%} |
4401 |
||
4402 |
"Modified: 19.3.1996 / 18:37:53 / cg" |
|
4403 |
! |
|
4404 |
||
4405 |
glxRpmvsX: x y: y z: z in: aGLXWindowId |
|
4406 |
"set the relative start position of a polygon" |
|
4407 |
||
4408 |
%{ /* NOCONTEXT */ |
|
4409 |
Scoord c_x, c_y, c_z; |
|
4410 |
||
4411 |
_SCOORD_ (x, c_x) |
|
4412 |
_SCOORD_ (y, c_y) |
|
4413 |
_SCOORD_ (z, c_z) |
|
4414 |
SETWIN(aGLXWindowId) |
|
1932 | 4415 |
#ifdef OPENGL |
4416 |
#else |
|
528 | 4417 |
rpmvs(c_x, c_y, c_z); |
1932 | 4418 |
#endif |
528 | 4419 |
%} |
4420 |
||
4421 |
"Modified: 19.3.1996 / 18:37:58 / cg" |
|
294 | 4422 |
! ! |
4423 |
||
24 | 4424 |
!GLXWorkstation methodsFor:'queries'! |
4425 |
||
159 | 4426 |
glVersion |
4427 |
"return a string describing the GL version. |
|
4428 |
For informative use only; portable applications do not depend |
|
4429 |
on the returned string." |
|
4430 |
||
4431 |
%{ /* NOCONTEXT */ |
|
4432 |
#ifdef VGL |
|
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
4433 |
RETURN (__MKSTRING("vogl")); |
159 | 4434 |
#else |
1932 | 4435 |
# ifdef GLX |
159 | 4436 |
char buffer[128]; |
4437 |
||
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4438 |
if (_INST(glOK) == true) { |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4439 |
gversion(buffer); |
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
4440 |
RETURN (__MKSTRING(buffer)); |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4441 |
} |
1932 | 4442 |
RETURN (nil); |
4443 |
# else |
|
4444 |
RETURN (nil); |
|
4445 |
# endif |
|
159 | 4446 |
#endif |
4447 |
%} |
|
4448 |
||
4449 |
" |
|
4450 |
Display glVersion |
|
4451 |
" |
|
4452 |
! |
|
4453 |
||
528 | 4454 |
glxGetplanesIn: aGLXWindowId |
4455 |
"Returns the number if bit planes available on the device." |
|
4456 |
||
4457 |
%{ /* NOCONTEXT */ |
|
1932 | 4458 |
SETWIN(aGLXWindowId) |
4459 |
#ifdef OPENGL |
|
4460 |
#else |
|
528 | 4461 |
RETURN (__MKSMALLINT(getplanes())); |
4462 |
#endif |
|
1932 | 4463 |
%}. |
4464 |
^ 0 |
|
528 | 4465 |
|
4466 |
"Modified: 19.3.1996 / 18:50:44 / cg" |
|
4467 |
! |
|
4468 |
||
294 | 4469 |
hasStereoExtension |
4470 |
"return true, if this workstation supports stereo GL drawing. |
|
4471 |
Both the server must support it, and the feature must have been |
|
4472 |
enabled in the smalltalk system, for true to be returned." |
|
4473 |
||
4474 |
^ hasStereoExtension |
|
4475 |
||
4476 |
" |
|
4477 |
Display hasStereoExtension |
|
4478 |
" |
|
4479 |
! |
|
4480 |
||
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4481 |
isTrueGL |
1932 | 4482 |
"return true, if this is a true GL (as opposed to a simulated VOGL). |
4483 |
Returns false for all openGL systems." |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4484 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4485 |
%{ /* NOCONTEXT */ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4486 |
#ifdef VGL |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4487 |
RETURN ( false ); |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4488 |
#else |
1932 | 4489 |
# ifdef GLX |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4490 |
RETURN ( true ); |
1932 | 4491 |
# else |
4492 |
RETURN (false); |
|
4493 |
# endif |
|
4494 |
#endif |
|
4495 |
%} |
|
4496 |
! |
|
4497 |
||
4498 |
isOpenGL |
|
4499 |
"return true, if this is an openGL (as opposed to a GL)" |
|
4500 |
||
4501 |
%{ /* NOCONTEXT */ |
|
4502 |
#ifdef OPENGL |
|
4503 |
RETURN ( true ); |
|
4504 |
#else |
|
4505 |
RETURN ( false ); |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4506 |
#endif |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4507 |
%} |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4508 |
! |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4509 |
|
294 | 4510 |
maxZValue |
4511 |
"return the max. Z value (only valid if z-buffer is supported)" |
|
4512 |
%{ |
|
1932 | 4513 |
#ifndef OPENGL |
4514 |
# ifdef GD_ZMAX |
|
294 | 4515 |
long zMax; |
4516 |
||
4517 |
if (_INST(glOK) == true) { |
|
4518 |
zMax = getgdesc(GD_ZMAX); |
|
4519 |
||
4520 |
if ((zMax >= _MIN_INT) && (zMax <= _MAX_INT)) { |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4521 |
RETURN ( __MKSMALLINT(zMax) ); |
294 | 4522 |
} |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4523 |
RETURN ( __MKLARGEINT(zMax) ); |
294 | 4524 |
} |
1932 | 4525 |
# endif |
294 | 4526 |
#endif |
4527 |
%}. |
|
4528 |
^ nil |
|
4529 |
! |
|
4530 |
||
4531 |
supportsDoubleBuffer |
|
4532 |
"return true, if this gl workstation supports double buffering. |
|
157 | 4533 |
For portable applications, always combine this with a query |
4534 |
if the display supports GL drawing at all." |
|
24 | 4535 |
|
4536 |
%{ /* NOCONTEXT */ |
|
294 | 4537 |
|
1932 | 4538 |
#ifndef OPENGL |
4539 |
# ifdef VGL |
|
4540 |
RETURN (true); |
|
4541 |
# else |
|
4542 |
# ifdef GD_BITS_NORM_DBL_RED |
|
294 | 4543 |
if (getgdesc(GD_BITS_NORM_DBL_RED) != 0) { |
4544 |
RETURN ( _INST(glOK) ); |
|
4545 |
} |
|
1932 | 4546 |
# endif |
4547 |
# endif |
|
24 | 4548 |
#endif |
89 | 4549 |
%}. |
4550 |
^ false |
|
4551 |
||
4552 |
" |
|
294 | 4553 |
Display supportsDoubleBuffer |
4554 |
" |
|
4555 |
! |
|
4556 |
||
4557 |
supportsGLDrawing |
|
4558 |
"return true, if this device supports 3D GL drawing." |
|
4559 |
||
4560 |
^ glOK |
|
4561 |
||
4562 |
" |
|
4563 |
Display supportsGLDrawing |
|
89 | 4564 |
" |
64 | 4565 |
! |
4566 |
||
4567 |
supportsLight |
|
157 | 4568 |
"return true, if this gl workstation supports light sources |
4569 |
(i.e. if its a real GL). |
|
4570 |
For portable applications, always combine this with a query |
|
4571 |
if the display supports GL drawing at all." |
|
89 | 4572 |
|
4573 |
%{ /* NOCONTEXT */ |
|
64 | 4574 |
#ifdef GLX |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4575 |
RETURN ( _INST(glOK) ); |
64 | 4576 |
#endif |
89 | 4577 |
%}. |
4578 |
^ false |
|
4579 |
||
4580 |
" |
|
4581 |
Display supportsLight |
|
4582 |
" |
|
4583 |
! |
|
4584 |
||
294 | 4585 |
supportsRGB |
4586 |
"return true, if this gl workstation supports rgb |
|
4587 |
(in addition to indexed) colors. Actually, we return true |
|
4588 |
for a real GL engine, false for the simulator here. |
|
4589 |
For portable applications, always combine this with a query |
|
4590 |
if the display supports GL drawing at all." |
|
4591 |
||
4592 |
%{ /* NOCONTEXT */ |
|
4593 |
#ifdef GLX |
|
4594 |
RETURN ( _INST(glOK) ); |
|
4595 |
#endif |
|
4596 |
%}. |
|
4597 |
^ false |
|
4598 |
||
4599 |
" |
|
4600 |
Display supportsRGB |
|
4601 |
" |
|
4602 |
! |
|
4603 |
||
89 | 4604 |
supportsTextures |
4605 |
"return true, if this gl workstation supports texture mapping |
|
157 | 4606 |
(i.e. if its a real GL). |
4607 |
For portable applications, always combine this with a query |
|
4608 |
if the display supports GL drawing at all." |
|
89 | 4609 |
|
4610 |
%{ /* NOCONTEXT */ |
|
1932 | 4611 |
#ifndef OPENGL |
4612 |
# ifdef GD_TEXTURE |
|
89 | 4613 |
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
|
4614 |
RETURN ( _INST(glOK) ); |
89 | 4615 |
} |
1932 | 4616 |
# endif |
89 | 4617 |
#endif |
4618 |
%}. |
|
4619 |
^ false |
|
4620 |
||
4621 |
" |
|
4622 |
Display supportsTextures |
|
4623 |
" |
|
4624 |
! |
|
4625 |
||
4626 |
supportsZBuffer |
|
157 | 4627 |
"return true, if this gl workstation has z buffer support. |
4628 |
For portable applications, always combine this with a query |
|
4629 |
if the display supports GL drawing at all." |
|
4630 |
||
89 | 4631 |
%{ /* NOCONTEXT */ |
4632 |
||
1932 | 4633 |
#ifndef OPENGL |
4634 |
# ifdef GD_BITS_NORM_ZBUFFER |
|
89 | 4635 |
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
|
4636 |
RETURN ( _INST(glOK) ); |
89 | 4637 |
} |
1932 | 4638 |
# endif |
89 | 4639 |
#endif |
4640 |
%}. |
|
4641 |
^ false |
|
4642 |
||
4643 |
" |
|
4644 |
Display supportsZBuffer |
|
4645 |
" |
|
294 | 4646 |
! ! |
4647 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4648 |
!GLXWorkstation methodsFor:'rectangles'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4649 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4650 |
glxRectX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4651 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4652 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4653 |
SETWIN(aGLXWindowId) |
1932 | 4654 |
#ifdef OPENGL |
4655 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4656 |
rect(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
1932 | 4657 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4658 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4659 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4660 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4661 |
glxRectfX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4662 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4663 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4664 |
SETWIN(aGLXWindowId) |
1932 | 4665 |
#ifdef OPENGL |
4666 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4667 |
rectf(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
1932 | 4668 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4669 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4670 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4671 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4672 |
glxRectfiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4673 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4674 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4675 |
SETWIN(aGLXWindowId) |
1932 | 4676 |
#ifdef OPENGL |
4677 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4678 |
rectfi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
1932 | 4679 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4680 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4681 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4682 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4683 |
glxRectfsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4684 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4685 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4686 |
SETWIN(aGLXWindowId) |
1932 | 4687 |
#ifdef OPENGL |
4688 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4689 |
rectfs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
1932 | 4690 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4691 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4692 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4693 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4694 |
glxRectiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4695 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4696 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4697 |
SETWIN(aGLXWindowId) |
1932 | 4698 |
#ifdef OPENGL |
4699 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4700 |
recti(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
1932 | 4701 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4702 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4703 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4704 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4705 |
glxRectsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4706 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4707 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4708 |
SETWIN(aGLXWindowId) |
1932 | 4709 |
#ifdef OPENGL |
4710 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4711 |
rects(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
1932 | 4712 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4713 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4714 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4715 |
|
528 | 4716 |
!GLXWorkstation methodsFor:'spheres'! |
294 | 4717 |
|
4718 |
glxSphDraw:arrayOf4Floats in:aGLXWindowId |
|
4719 |
"argument must be an array(a matrix) of 4 floats containing the |
|
4720 |
sphere - in real GL only" |
|
4721 |
||
4722 |
%{ /* NOCONTEXT */ |
|
4723 |
#ifdef GLX |
|
4724 |
float vec[4], *v; |
|
4725 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4726 |
if (! (v = __glx_getFloatsFromInto(arrayOf4Floats, vec, 4))) RETURN(false); |
294 | 4727 |
SETWIN(aGLXWindowId) |
4728 |
sphdraw(v); |
|
1932 | 4729 |
#endif |
4730 |
%} |
|
294 | 4731 |
! |
4732 |
||
4733 |
glxSphDrawX:x y:y z:z radius:r in:aGLXWindowId |
|
4734 |
"arguments must be convertable to floats - in real GL only" |
|
4735 |
||
4736 |
%{ /* NOCONTEXT */ |
|
4737 |
#ifdef GLX |
|
4738 |
float vec[4]; |
|
4739 |
||
4740 |
_FLOAT_(x, vec[0]) |
|
4741 |
_FLOAT_(y, vec[1]) |
|
4742 |
_FLOAT_(z, vec[2]) |
|
4743 |
_FLOAT_(r, vec[3]) |
|
4744 |
SETWIN(aGLXWindowId) |
|
4745 |
sphdraw(vec); |
|
1932 | 4746 |
#endif |
4747 |
%} |
|
294 | 4748 |
! |
4749 |
||
4750 |
glxSphfreeIn: aGLXWindowId |
|
4751 |
||
4752 |
%{ /* NOCONTEXT */ |
|
4753 |
#ifdef GLX |
|
4754 |
SETWIN(aGLXWindowId) |
|
4755 |
sphfree(); |
|
1932 | 4756 |
#endif |
4757 |
%} |
|
294 | 4758 |
! |
4759 |
||
4760 |
glxSphgnpolysIn: aGLXWindowId |
|
4761 |
||
4762 |
%{ /* NOCONTEXT */ |
|
4763 |
#ifdef GLX |
|
4764 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4765 |
RETURN (__MKSMALLINT(sphgnpolys())); |
294 | 4766 |
#endif |
4767 |
%} |
|
4768 |
! |
|
4769 |
||
4770 |
glxSphmode: attribute value: value in: aGLXWindowId |
|
4771 |
||
4772 |
%{ /* NOCONTEXT */ |
|
4773 |
#ifdef GLX |
|
4774 |
SETWIN(aGLXWindowId) |
|
4775 |
sphmode(__intVal(attribute), __intVal(value)); |
|
1932 | 4776 |
#endif |
4777 |
%} |
|
294 | 4778 |
! |
4779 |
||
4780 |
glxSphobj: objid in: aGLXWindowId |
|
4781 |
||
4782 |
%{ /* NOCONTEXT */ |
|
4783 |
#ifdef GLX |
|
4784 |
SETWIN(aGLXWindowId) |
|
4785 |
sphobj(_objectVal(objid)); |
|
1932 | 4786 |
#endif |
4787 |
%} |
|
294 | 4788 |
! |
4789 |
||
4790 |
glxSphrotmatrix: mat in: aGLXWindowId |
|
4791 |
||
4792 |
%{ /* NOCONTEXT */ |
|
4793 |
#ifdef GLX |
|
4794 |
Matrix matrix, *m; |
|
4795 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4796 |
if (! (m = __glx_getFloatsFromMatrixInto(mat, &matrix))) RETURN (false); |
294 | 4797 |
SETWIN(aGLXWindowId) |
4798 |
sphrotmatrix(*m); |
|
1932 | 4799 |
#endif |
4800 |
%} |
|
294 | 4801 |
! ! |
4802 |
||
4803 |
!GLXWorkstation methodsFor:'stereo extension'! |
|
4804 |
||
528 | 4805 |
glxLeftbuffer: bool in: aGLXWindowId |
4806 |
||
4807 |
%{ /* NOCONTEXT */ |
|
4808 |
#ifdef FULL_GLX |
|
4809 |
SETWIN(aGLXWindowId) |
|
4810 |
leftbuffer(_booleanVal(bool)); |
|
1932 | 4811 |
#endif |
4812 |
%} |
|
528 | 4813 |
! |
4814 |
||
4815 |
glxMonobufferIn: aGLXWindowId |
|
4816 |
||
4817 |
%{ /* NOCONTEXT */ |
|
4818 |
#ifdef FULL_GLX |
|
4819 |
SETWIN(aGLXWindowId) |
|
4820 |
monobuffer(); |
|
1932 | 4821 |
#endif |
4822 |
%} |
|
528 | 4823 |
! |
4824 |
||
4825 |
glxRightbuffer: bool in: aGLXWindowId |
|
4826 |
||
4827 |
%{ /* NOCONTEXT */ |
|
4828 |
#ifdef FULL_GLX |
|
4829 |
SETWIN(aGLXWindowId) |
|
4830 |
rightbuffer(_booleanVal(bool)); |
|
1932 | 4831 |
#endif |
4832 |
%} |
|
528 | 4833 |
! |
4834 |
||
294 | 4835 |
stereoExtensionBuffer:aBufferSymbol for:aWindowId |
4836 |
"set the current stereo buffer; the argument may be one of: |
|
4837 |
#left -> STEREO_BUFFER_LEFT |
|
4838 |
#right -> STEREO_BUFFER_RIGHT |
|
4839 |
" |
|
4840 |
||
4841 |
%{ /* NOCONTEXT */ |
|
4842 |
#if defined(XSGIStereo) && defined(GLX) |
|
4843 |
Status status; |
|
4844 |
int buffer; |
|
4845 |
Window win; |
|
4846 |
||
4847 |
if (ISCONNECTED |
|
4848 |
&& __isExternalAddress(aWindowId)) { |
|
4849 |
win = _WindowVal(aWindowId); |
|
4850 |
if (aBufferSymbol == @symbol(left)) { |
|
4851 |
buffer = STEREO_BUFFER_LEFT; |
|
4852 |
} else { |
|
4853 |
if (aBufferSymbol == @symbol(right)) { |
|
4854 |
buffer = STEREO_BUFFER_RIGHT; |
|
4855 |
} else { |
|
4856 |
goto bad; |
|
4857 |
} |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4858 |
} |
294 | 4859 |
status = XSGISetStereoBuffer(myDpy, win, buffer); |
4860 |
RETURN ( status ? true : false); |
|
4861 |
} |
|
4862 |
bad: ; |
|
4863 |
#endif |
|
4864 |
%}. |
|
4865 |
self primitiveFailed |
|
4866 |
||
4867 |
" |
|
4868 |
|t v| |
|
4869 |
||
4870 |
t := StandardSystemView new. |
|
4871 |
t extent:300@300. |
|
4872 |
v := GLXView origin:0.0@0.0 corner:1.0@1.0 in:t. |
|
4873 |
t openAndWait. |
|
4874 |
||
4875 |
v device stereoExtensionBuffer:#left for:(v id). |
|
4876 |
(Delay forSeconds:10) wait. |
|
4877 |
v device stereoExtensionBuffer:#right for:(v id). |
|
4878 |
" |
|
4879 |
! |
|
4880 |
||
4881 |
stereoExtensionMode:aModeSymbol height:h offset:o for:aWindowId |
|
4882 |
"set the current stereo mode; the argument may be one of: |
|
4883 |
nil/false #off -> turn it off |
|
4884 |
#bottom -> STEREO_BOTTOM |
|
4885 |
#top -> STEREO_TOP |
|
4886 |
" |
|
4887 |
||
4888 |
%{ /* NOCONTEXT */ |
|
4889 |
#if defined(XSGIStereo) && defined(GLX) |
|
4890 |
Status status; |
|
4891 |
int mode; |
|
4892 |
unsigned short us_h, us_o; |
|
4893 |
Window win; |
|
4894 |
||
4895 |
if (ISCONNECTED |
|
4896 |
&& __bothSmallInteger(h, o) |
|
4897 |
&& __isExternalAddress(aWindowId)) { |
|
4898 |
win = _WindowVal(aWindowId); |
|
4899 |
if ((aModeSymbol == nil) |
|
4900 |
|| (aModeSymbol == false) |
|
4901 |
|| (aModeSymbol == @symbol(off))) { |
|
4902 |
mode = STEREO_OFF; |
|
4903 |
} else { |
|
4904 |
if (aModeSymbol == @symbol(bottom)) { |
|
4905 |
mode = STEREO_BOTTOM; |
|
4906 |
} else { |
|
4907 |
if (aModeSymbol == @symbol(top)) { |
|
4908 |
mode = STEREO_TOP; |
|
4909 |
} else { |
|
4910 |
goto bad; |
|
4911 |
} |
|
4912 |
} |
|
4913 |
} |
|
4914 |
us_h = __intVal(h); |
|
4915 |
us_o = __intVal(o); |
|
4916 |
status = XSGISetStereoMode(myDpy, win, us_h, us_o, mode); |
|
4917 |
RETURN ( status ? true : false); |
|
4918 |
} |
|
4919 |
bad: ; |
|
4920 |
#endif |
|
4921 |
%}. |
|
4922 |
self primitiveFailed |
|
4923 |
||
4924 |
" |
|
4925 |
Display stereoExtensionMode:#top height:492 offset:532 for:(Display rootWindowId). |
|
4926 |
(Delay forSeconds:10) wait. |
|
4927 |
Display stereoExtensionMode:#off height:0 offset:0 for:(Display rootWindowId). |
|
4928 |
" |
|
4929 |
! |
|
4930 |
||
4931 |
stereoExtensionModeIn:aWindowId |
|
4932 |
"return the current stereo mode for some window" |
|
4933 |
||
4934 |
%{ /* NOCONTEXT */ |
|
4935 |
#if defined(XSGIStereo) && defined(GLX) |
|
4936 |
int mode; |
|
4937 |
Window win; |
|
4938 |
||
4939 |
if (ISCONNECTED && __isExternalAddress(aWindowId)) { |
|
4940 |
win = _WindowVal(aWindowId); |
|
4941 |
mode = XSGIQueryStereoMode(myDpy, win); |
|
4942 |
switch (mode) { |
|
4943 |
case STEREO_OFF: |
|
4944 |
RETURN ( @symbol(off) ); |
|
4945 |
case STEREO_BOTTOM: |
|
4946 |
RETURN ( @symbol(bottom) ); |
|
4947 |
case STEREO_TOP: |
|
4948 |
RETURN ( @symbol(top) ); |
|
4949 |
} |
|
4950 |
RETURN ( @symbol(unsupported) ); |
|
4951 |
} |
|
4952 |
#endif |
|
4953 |
%}. |
|
4954 |
self primitiveFailed |
|
4955 |
||
4956 |
" |
|
4957 |
|v| |
|
4958 |
||
4959 |
v := StandardSystemView new. |
|
4960 |
v extent:300@300. |
|
4961 |
v openAndWait. |
|
4962 |
v device stereoExtensionModeIn:(v id) |
|
4963 |
||
4964 |
Display stereoExtensionModeIn:Display rootWindowId |
|
4965 |
" |
|
4966 |
! |
|
4967 |
||
4968 |
stereoExtensionVersion |
|
4969 |
"return the stereo extensions version as an array consisting of |
|
4970 |
major and minor numbers." |
|
4971 |
||
4972 |
%{ /* NOCONTEXT */ |
|
4973 |
#if defined(XSGIStereo) && defined(GLX) |
|
4974 |
Status status; |
|
4975 |
Display *dpy = myDpy; |
|
4976 |
int major, minor; |
|
4977 |
||
4978 |
if (ISCONNECTED) { |
|
4979 |
status = XSGIStereoQueryVersion(myDpy, &major, &minor); |
|
4980 |
if (status == True) { |
|
4981 |
RETURN ( __ARRAY_WITH2(__MKSMALLINT(major), __MKSMALLINT(minor))); |
|
4982 |
} |
|
89 | 4983 |
} |
4984 |
#endif |
|
4985 |
%}. |
|
294 | 4986 |
self primitiveFailed |
185 | 4987 |
|
4988 |
" |
|
294 | 4989 |
Display stereoExtensionVersion |
185 | 4990 |
" |
24 | 4991 |
! ! |
4992 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4993 |
!GLXWorkstation methodsFor:'texture data transfer'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4994 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4995 |
glxT2d: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4996 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4997 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4998 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4999 |
double vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5000 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5001 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5002 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5003 |
t2d(c_v); |
1932 | 5004 |
#endif |
5005 |
%} |
|
537
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5008 |
glxT2f: v in: aGLXWindowId |
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 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5011 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5012 |
float vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5013 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5014 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5015 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5016 |
t2f(c_v); |
1932 | 5017 |
#endif |
5018 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5019 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5020 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5021 |
glxT2i: v in: aGLXWindowId |
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 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5024 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5025 |
long vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5026 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5027 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5028 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5029 |
t2i(c_v); |
1932 | 5030 |
#endif |
5031 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5032 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5033 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5034 |
glxT2s: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5035 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5036 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5037 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5038 |
short vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5039 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5040 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5041 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5042 |
t2s(c_v); |
1932 | 5043 |
#endif |
5044 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5045 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5046 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5047 |
glxT3d:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5048 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5049 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5050 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5051 |
double vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5052 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5053 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5054 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5055 |
t3d(c_v); |
1932 | 5056 |
#endif |
5057 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5058 |
! |
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 |
glxT3f:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5061 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5062 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5063 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5064 |
float vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5065 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5066 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5067 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5068 |
t3f(c_v); |
1932 | 5069 |
#endif |
5070 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5071 |
! |
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 |
glxT3i:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5074 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5075 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5076 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5077 |
long vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5078 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5079 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5080 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5081 |
t3i(c_v); |
1932 | 5082 |
#endif |
5083 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5084 |
! |
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 |
glxT3s:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5087 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5088 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5089 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5090 |
short vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5091 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5092 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5093 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5094 |
t3s(c_v); |
1932 | 5095 |
#endif |
5096 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5097 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5098 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5099 |
glxT4d: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5100 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5101 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5102 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5103 |
double vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5104 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5105 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5106 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5107 |
t4d(c_v); |
1932 | 5108 |
#endif |
5109 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5110 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5111 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5112 |
glxT4f: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5113 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5114 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5115 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5116 |
float vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5117 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5118 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5119 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5120 |
t4f(c_v); |
1932 | 5121 |
#endif |
5122 |
%} |
|
537
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5125 |
glxT4i: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5126 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5127 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5128 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5129 |
long vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5130 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5131 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5132 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5133 |
t4i(c_v); |
1932 | 5134 |
#endif |
5135 |
%} |
|
537
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5138 |
glxT4s: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5139 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5140 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5141 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5142 |
short vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5143 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5144 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5145 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5146 |
t4s(c_v); |
1932 | 5147 |
#endif |
5148 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5149 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5150 |
|
294 | 5151 |
!GLXWorkstation methodsFor:'transformations'! |
5152 |
||
5153 |
glxRotate:angle axis:axis in:aGLXWindowId |
|
5154 |
"rotate the current matrix around the axis given by the axis arg, |
|
5155 |
which must be one of the symbols: #x, #y or #z. |
|
5156 |
The angle is in degrees." |
|
5157 |
||
5158 |
%{ /* NOCONTEXT */ |
|
5159 |
||
5160 |
char c_axis; |
|
5161 |
||
5162 |
if (axis == @symbol(x)) |
|
5163 |
c_axis = 'x'; |
|
5164 |
else if (axis == @symbol(y)) |
|
5165 |
c_axis = 'y'; |
|
5166 |
else if (axis == @symbol(z)) |
|
5167 |
c_axis = 'z'; |
|
5168 |
else { |
|
5169 |
RETURN (false); |
|
5170 |
} |
|
5171 |
||
5172 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5173 |
RETURN ( __glx_doRotate(angle, c_axis) ); |
294 | 5174 |
%} |
5175 |
! |
|
5176 |
||
5177 |
glxRotate:arrayOf3Floats in:aGLXWindowId |
|
5178 |
"rotate current matrix, given a 3-element vector (or more). |
|
5179 |
The elements of the array are degrees." |
|
5180 |
||
5181 |
%{ /* NOCONTEXT */ |
|
5182 |
||
5183 |
float vec[3], *v; |
|
5184 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5185 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5186 |
|
5187 |
SETWIN(aGLXWindowId) |
|
1932 | 5188 |
#ifdef OPENGL |
5189 |
#else |
|
294 | 5190 |
rot(v[0], 'x'); |
5191 |
rot(v[1], 'y'); |
|
5192 |
rot(v[2], 'z'); |
|
1932 | 5193 |
#endif |
294 | 5194 |
%} |
5195 |
! |
|
5196 |
||
5197 |
glxRotateI:angle axis:axis in:aGLXWindowId |
|
5198 |
"rotate the current matrix around the axis given by the axis arg, |
|
5199 |
which must be one of the symbols: #x, #y or #z. |
|
5200 |
The angle is an integer specifying tenths of a degree." |
|
5201 |
||
5202 |
%{ /* NOCONTEXT */ |
|
5203 |
||
5204 |
char c_axis; |
|
5205 |
||
5206 |
if (axis == @symbol(x)) |
|
5207 |
c_axis = 'x'; |
|
5208 |
else if (axis == @symbol(y)) |
|
5209 |
c_axis = 'y'; |
|
5210 |
else if (axis == @symbol(z)) |
|
5211 |
c_axis = 'z'; |
|
5212 |
else { |
|
5213 |
RETURN (false); |
|
5214 |
} |
|
5215 |
||
5216 |
if (__isSmallInteger(angle)) { |
|
5217 |
SETWIN(aGLXWindowId) |
|
1932 | 5218 |
#ifdef OPENGL |
5219 |
#else |
|
294 | 5220 |
rotate(__intVal(angle), c_axis); |
1932 | 5221 |
#endif |
294 | 5222 |
} |
5223 |
%} |
|
5224 |
! |
|
5225 |
||
5226 |
glxRotateIX:angle in:aGLXWindowId |
|
5227 |
"rotate the current matrix on x axis. |
|
5228 |
The angle is an integer specifying tenths of a degree." |
|
5229 |
||
5230 |
%{ /* NOCONTEXT */ |
|
5231 |
||
5232 |
if (__isSmallInteger(angle)) { |
|
5233 |
SETWIN(aGLXWindowId) |
|
1932 | 5234 |
#ifdef OPENGL |
5235 |
#else |
|
294 | 5236 |
rotate(__intVal(angle), 'x'); |
1932 | 5237 |
#endif |
294 | 5238 |
} |
5239 |
%} |
|
5240 |
! |
|
5241 |
||
5242 |
glxRotateIX:xAngle y:yAngle z:zAngle in:aGLXWindowId |
|
5243 |
"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
|
5244 |
The values are smallIntegers specifying tenths of a degree." |
294 | 5245 |
|
5246 |
%{ /* NOCONTEXT */ |
|
5247 |
||
5248 |
if (__bothSmallInteger(xAngle, yAngle) |
|
5249 |
&& __isSmallInteger(zAngle)) { |
|
5250 |
SETWIN(aGLXWindowId) |
|
1932 | 5251 |
#ifdef OPENGL |
5252 |
#else |
|
294 | 5253 |
rotate(__intVal(xAngle), 'x'); |
5254 |
rotate(__intVal(yAngle), 'y'); |
|
5255 |
rotate(__intVal(zAngle), 'z'); |
|
1932 | 5256 |
#endif |
294 | 5257 |
} |
5258 |
%} |
|
5259 |
! |
|
5260 |
||
5261 |
glxRotateIY:angle in:aGLXWindowId |
|
5262 |
"rotate the current matrix on x axis. |
|
5263 |
The angle is an integer specifying tenths of a degree." |
|
5264 |
||
5265 |
%{ /* NOCONTEXT */ |
|
5266 |
||
5267 |
if (__isSmallInteger(angle)) { |
|
5268 |
SETWIN(aGLXWindowId) |
|
1932 | 5269 |
#ifdef OPENGL |
5270 |
#else |
|
294 | 5271 |
rotate(__intVal(angle), 'y'); |
1932 | 5272 |
#endif |
294 | 5273 |
} |
5274 |
%} |
|
5275 |
! |
|
5276 |
||
5277 |
glxRotateIZ:angle in:aGLXWindowId |
|
5278 |
"rotate the current matrix on x axis. |
|
5279 |
The angle is an integer specifying tenths of a degree." |
|
5280 |
||
5281 |
%{ /* NOCONTEXT */ |
|
5282 |
||
5283 |
if (__isSmallInteger(angle)) { |
|
5284 |
SETWIN(aGLXWindowId) |
|
1932 | 5285 |
#ifdef OPENGL |
5286 |
#else |
|
294 | 5287 |
rotate(__intVal(angle), 'z'); |
1932 | 5288 |
#endif |
294 | 5289 |
} |
5290 |
%} |
|
5291 |
! |
|
5292 |
||
5293 |
glxRotateX:angle in:aGLXWindowId |
|
5294 |
"rotate the current matrix on x axis. |
|
5295 |
The angle is in degrees." |
|
5296 |
||
5297 |
%{ /* NOCONTEXT */ |
|
5298 |
||
5299 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5300 |
RETURN (__glx_doRotate(angle, 'x')); |
294 | 5301 |
%} |
5302 |
! |
|
5303 |
||
5304 |
glxRotateX:xAngle y:yAngle z:zAngle in:aGLXWindowId |
|
5305 |
"rotate the current matrix on all axes, given individual x, y and z values. |
|
5306 |
The values are in degrees" |
|
5307 |
||
5308 |
%{ /* NOCONTEXT */ |
|
5309 |
||
5310 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5311 |
if ( __glx_doRotate(xAngle, 'x') == true) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5312 |
if ( __glx_doRotate(yAngle, 'y') == true) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5313 |
RETURN (__glx_doRotate(zAngle, 'z')); |
294 | 5314 |
} |
5315 |
} |
|
5316 |
%} |
|
5317 |
! |
|
5318 |
||
5319 |
glxRotateY:angle in:aGLXWindowId |
|
5320 |
"rotate the current matrix on y axis. |
|
5321 |
The angle is in degrees." |
|
5322 |
||
5323 |
%{ /* NOCONTEXT */ |
|
5324 |
||
5325 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5326 |
RETURN (__glx_doRotate(angle, 'y')); |
294 | 5327 |
%} |
5328 |
! |
|
5329 |
||
5330 |
glxRotateZ:angle in:aGLXWindowId |
|
5331 |
"rotate the current matrix on z axis. |
|
5332 |
The angle is in degrees." |
|
5333 |
||
5334 |
%{ /* NOCONTEXT */ |
|
5335 |
||
5336 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5337 |
RETURN (__glx_doRotate(angle, 'z')); |
294 | 5338 |
%} |
5339 |
! |
|
5340 |
||
5341 |
glxScale:arrayOf3Floats in:aGLXWindowId |
|
5342 |
"scale current matrix, given a 3-element vector" |
|
5343 |
||
5344 |
%{ /* NOCONTEXT */ |
|
5345 |
||
5346 |
float vec[3], *v; |
|
5347 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5348 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5349 |
|
5350 |
SETWIN(aGLXWindowId) |
|
1932 | 5351 |
#ifdef OPENGL |
5352 |
#else |
|
294 | 5353 |
scale(v[0], v[1], v[2]); |
1932 | 5354 |
#endif |
294 | 5355 |
%} |
5356 |
! |
|
5357 |
||
5358 |
glxScaleX:x in:aGLXWindowId |
|
5359 |
"scale in x direction" |
|
5360 |
||
5361 |
%{ /* NOCONTEXT */ |
|
5362 |
||
5363 |
float f_x; |
|
5364 |
||
5365 |
_FLOAT_ (x, f_x) |
|
5366 |
SETWIN(aGLXWindowId) |
|
1932 | 5367 |
#ifdef OPENGL |
5368 |
#else |
|
294 | 5369 |
scale(f_x, (float)0, (float)0); |
1932 | 5370 |
#endif |
294 | 5371 |
%} |
5372 |
! |
|
5373 |
||
5374 |
glxScaleX:x y:y z:z in:aGLXWindowId |
|
5375 |
"scale & mirror current matrix, given individual x, y and z values" |
|
5376 |
||
5377 |
%{ /* NOCONTEXT */ |
|
5378 |
||
5379 |
float f_x, f_y, f_z; |
|
5380 |
||
5381 |
_FLOAT_ (x, f_x) |
|
5382 |
_FLOAT_ (y, f_y) |
|
5383 |
_FLOAT_ (z, f_z) |
|
5384 |
SETWIN(aGLXWindowId) |
|
1932 | 5385 |
#ifdef OPENGL |
5386 |
#else |
|
294 | 5387 |
scale(f_x, f_y, f_z); |
1932 | 5388 |
#endif |
294 | 5389 |
%} |
5390 |
! |
|
5391 |
||
5392 |
glxScaleY:y in:aGLXWindowId |
|
5393 |
"scale in y direction" |
|
5394 |
||
5395 |
%{ /* NOCONTEXT */ |
|
5396 |
||
5397 |
float f_y; |
|
5398 |
||
5399 |
_FLOAT_ (y, f_y) |
|
5400 |
SETWIN(aGLXWindowId) |
|
1932 | 5401 |
#ifdef OPENGL |
5402 |
#else |
|
294 | 5403 |
scale((float)0, f_y, (float)0); |
1932 | 5404 |
#endif |
294 | 5405 |
%} |
5406 |
! |
|
5407 |
||
5408 |
glxScaleZ:z in:aGLXWindowId |
|
5409 |
"scale in z direction" |
|
5410 |
||
5411 |
%{ /* NOCONTEXT */ |
|
5412 |
||
5413 |
float f_z; |
|
5414 |
||
5415 |
_FLOAT_ (z, f_z) |
|
5416 |
SETWIN(aGLXWindowId) |
|
1932 | 5417 |
#ifdef OPENGL |
5418 |
#else |
|
294 | 5419 |
scale((float)0, (float)0, f_z); |
1932 | 5420 |
#endif |
294 | 5421 |
%} |
5422 |
! |
|
5423 |
||
5424 |
glxTranslate:arrayOf3Floats in:aGLXWindowId |
|
5425 |
"translate current matrix, given a 3-element vector" |
|
5426 |
||
5427 |
%{ /* NOCONTEXT */ |
|
5428 |
||
5429 |
float vec[3], *v; |
|
5430 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5431 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5432 |
|
5433 |
SETWIN(aGLXWindowId) |
|
1932 | 5434 |
#ifdef OPENGL |
5435 |
#else |
|
294 | 5436 |
translate((Coord)(v[0]), (Coord)(v[1]), (Coord)(v[2])); |
1932 | 5437 |
#endif |
294 | 5438 |
%} |
5439 |
! |
|
5440 |
||
5441 |
glxTranslateX:x in:aGLXWindowId |
|
5442 |
"translate current matrix on X axis" |
|
5443 |
||
5444 |
%{ /* NOCONTEXT */ |
|
5445 |
||
5446 |
Coord c_x; |
|
5447 |
||
5448 |
_COORD_ (x, c_x) |
|
5449 |
SETWIN(aGLXWindowId) |
|
1932 | 5450 |
#ifdef OPENGL |
5451 |
#else |
|
294 | 5452 |
translate(c_x, (Coord)0, (Coord)0); |
1932 | 5453 |
#endif |
294 | 5454 |
%} |
5455 |
! |
|
5456 |
||
5457 |
glxTranslateX:x y:y z:z in:aGLXWindowId |
|
5458 |
"translate current matrix, given individual x, y and z values" |
|
5459 |
||
5460 |
%{ /* NOCONTEXT */ |
|
5461 |
||
5462 |
Coord c_x, c_y, c_z; |
|
5463 |
||
5464 |
_COORD_ (x, c_x) |
|
5465 |
_COORD_ (y, c_y) |
|
5466 |
_COORD_ (z, c_z) |
|
5467 |
SETWIN(aGLXWindowId) |
|
1932 | 5468 |
#ifdef OPENGL |
5469 |
#else |
|
294 | 5470 |
translate(c_x, c_y, c_z); |
1932 | 5471 |
#endif |
294 | 5472 |
%} |
5473 |
! |
|
5474 |
||
5475 |
glxTranslateY:y in:aGLXWindowId |
|
5476 |
"translate current matrix on Y axis" |
|
5477 |
||
5478 |
%{ /* NOCONTEXT */ |
|
5479 |
||
5480 |
Coord c_y; |
|
5481 |
||
5482 |
_COORD_ (y, c_y) |
|
5483 |
SETWIN(aGLXWindowId) |
|
1932 | 5484 |
#ifdef OPENGL |
5485 |
#else |
|
294 | 5486 |
translate((Coord)0, c_y, (Coord)0); |
1932 | 5487 |
#endif |
294 | 5488 |
%} |
5489 |
! |
|
5490 |
||
5491 |
glxTranslateZ:z in:aGLXWindowId |
|
5492 |
"translate current matrix on Z axis" |
|
5493 |
||
5494 |
%{ /* NOCONTEXT */ |
|
5495 |
||
5496 |
Coord c_z; |
|
5497 |
||
5498 |
_COORD_ (z, c_z) |
|
5499 |
SETWIN(aGLXWindowId) |
|
1932 | 5500 |
#ifdef OPENGL |
5501 |
#else |
|
294 | 5502 |
translate((Coord)0, (Coord)0, c_z); |
1932 | 5503 |
#endif |
294 | 5504 |
%} |
5505 |
! ! |
|
5506 |
||
5507 |
!GLXWorkstation methodsFor:'unspecified rest'! |
|
5508 |
||
5509 |
glxAcbufOp:op value:value in:aGLXWindowId |
|
5510 |
||
5511 |
%{ /* NOCONTEXT */ |
|
1932 | 5512 |
SETWIN(aGLXWindowId) |
5513 |
#ifdef GLX |
|
294 | 5514 |
acbuf(__intVal(op), _floatVal(value)); |
1932 | 5515 |
#endif |
5516 |
%} |
|
294 | 5517 |
! |
5518 |
||
5519 |
glxAcsizePlanes: planes in: aGLXWindowId |
|
5520 |
||
5521 |
%{ /* NOCONTEXT */ |
|
1932 | 5522 |
SETWIN(aGLXWindowId) |
5523 |
#ifdef GLX |
|
294 | 5524 |
acsize(__intVal(planes)); |
1932 | 5525 |
#endif |
5526 |
%} |
|
294 | 5527 |
! |
5528 |
||
5529 |
glxAfunctionRef: ref func: func in: aGLXWindowId |
|
5530 |
||
5531 |
%{ /* NOCONTEXT */ |
|
1932 | 5532 |
SETWIN(aGLXWindowId) |
5533 |
#ifdef GLX |
|
294 | 5534 |
afunction(__intVal(ref), __intVal(func)); |
1932 | 5535 |
#endif |
5536 |
%} |
|
294 | 5537 |
! |
5538 |
||
5539 |
glxBbox2Xmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5540 |
||
5541 |
%{ /* NOCONTEXT */ |
|
5542 |
Screencoord c_xmin, c_ymin; |
|
5543 |
Coord c_x1, c_y1, c_x2, c_y2; |
|
5544 |
||
5545 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5546 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5547 |
_COORD_ (x1, c_x1) |
|
5548 |
_COORD_ (y1, c_y1) |
|
5549 |
_COORD_ (x2, c_x2) |
|
5550 |
_COORD_ (y2, c_y2) |
|
5551 |
SETWIN(aGLXWindowId) |
|
1932 | 5552 |
#ifdef GLX |
294 | 5553 |
bbox2(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5554 |
#endif |
5555 |
%} |
|
294 | 5556 |
! |
5557 |
||
5558 |
glxBbox2iXmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5559 |
||
5560 |
%{ /* NOCONTEXT */ |
|
5561 |
Screencoord c_xmin, c_ymin; |
|
5562 |
Icoord c_x1, c_y1, c_x2, c_y2; |
|
5563 |
||
5564 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5565 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5566 |
_ICOORD_ (x1, c_x1) |
|
5567 |
_ICOORD_ (y1, c_y1) |
|
5568 |
_ICOORD_ (x2, c_x2) |
|
5569 |
_ICOORD_ (y2, c_y2) |
|
5570 |
SETWIN(aGLXWindowId) |
|
1932 | 5571 |
#ifdef GLX |
294 | 5572 |
bbox2i(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5573 |
#endif |
5574 |
%} |
|
294 | 5575 |
! |
5576 |
||
5577 |
glxBbox2sXmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5578 |
||
5579 |
%{ /* NOCONTEXT */ |
|
5580 |
Screencoord c_xmin, c_ymin; |
|
5581 |
Scoord c_x1, c_y1, c_x2, c_y2; |
|
5582 |
||
5583 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5584 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5585 |
_SCOORD_ (x1, c_x1) |
|
5586 |
_SCOORD_ (y1, c_y1) |
|
5587 |
_SCOORD_ (x2, c_x2) |
|
5588 |
_SCOORD_ (y2, c_y2) |
|
5589 |
SETWIN(aGLXWindowId) |
|
1932 | 5590 |
#ifdef GLX |
294 | 5591 |
bbox2s(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5592 |
#endif |
5593 |
%} |
|
294 | 5594 |
! |
5595 |
||
5596 |
glxBeginTrimIn: aGLXWindowId |
|
5597 |
||
5598 |
%{ /* NOCONTEXT */ |
|
1932 | 5599 |
SETWIN(aGLXWindowId) |
5600 |
#ifdef GLX |
|
294 | 5601 |
bgntrim(); |
1932 | 5602 |
#endif |
5603 |
%} |
|
294 | 5604 |
! |
5605 |
||
5606 |
glxBlankscreen: b in: aGLXWindowId |
|
5607 |
||
5608 |
%{ /* NOCONTEXT */ |
|
1932 | 5609 |
SETWIN(aGLXWindowId) |
5610 |
#ifdef GLX |
|
294 | 5611 |
blankscreen(_booleanVal(b)); |
1932 | 5612 |
#endif |
5613 |
%} |
|
294 | 5614 |
! |
5615 |
||
5616 |
glxBlanktime: count in: aGLXWindowId |
|
5617 |
||
5618 |
%{ /* NOCONTEXT */ |
|
1932 | 5619 |
SETWIN(aGLXWindowId) |
5620 |
#ifdef GLX |
|
294 | 5621 |
blanktime(__intVal(count)); |
1932 | 5622 |
#endif |
5623 |
%} |
|
294 | 5624 |
! |
5625 |
||
5626 |
glxBlendcolorRed: red green: green blue: blue alpha: alpha in: aGLXWindowId |
|
5627 |
||
5628 |
%{ /* NOCONTEXT */ |
|
1932 | 5629 |
SETWIN(aGLXWindowId) |
294 | 5630 |
#ifdef FULL_GLX |
5631 |
blendcolor(_floatVal(red), _floatVal(green), _floatVal(blue), _floatVal(alpha)); |
|
1932 | 5632 |
#endif |
5633 |
%} |
|
294 | 5634 |
! |
5635 |
||
5636 |
glxBlendfunctionSfactr: sfactr dfactr: dfactr in: aGLXWindowId |
|
5637 |
||
5638 |
%{ /* NOCONTEXT */ |
|
1932 | 5639 |
SETWIN(aGLXWindowId) |
5640 |
#ifdef GLX |
|
294 | 5641 |
blendfunction(__intVal(sfactr), __intVal(dfactr)); |
1932 | 5642 |
#endif |
5643 |
%} |
|
294 | 5644 |
! |
5645 |
||
5646 |
glxBlinkRate: rate i: i red: red green: green blue: blue in: aGLXWindowId |
|
5647 |
||
5648 |
%{ /* NOCONTEXT */ |
|
1932 | 5649 |
SETWIN(aGLXWindowId) |
5650 |
#ifdef GLX |
|
294 | 5651 |
blink(_shortVal(rate), _colorindexVal(i), |
5652 |
_shortVal(red), _shortVal(green), _shortVal(blue)); |
|
1932 | 5653 |
#endif |
5654 |
%} |
|
294 | 5655 |
! |
5656 |
||
5657 |
glxBlkqreadData: data n: n in: aGLXWindowId |
|
5658 |
||
5659 |
%{ /* NOCONTEXT */ |
|
1932 | 5660 |
int rslt = -1; |
5661 |
||
5662 |
SETWIN(aGLXWindowId) |
|
5663 |
#ifdef GLX |
|
5664 |
rslt = blkqread((short *)_indexedArea(data), __intVal(n)); |
|
5665 |
#endif |
|
5666 |
RETURN (__MKSMALLINT(rslt)); |
|
5667 |
%} |
|
294 | 5668 |
! |
5669 |
||
5670 |
glxC3f: v in: aGLXWindowId |
|
5671 |
||
5672 |
%{ /* NOCONTEXT */ |
|
5673 |
float vec[3], *c_v; |
|
5674 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5675 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
294 | 5676 |
SETWIN(aGLXWindowId) |
1932 | 5677 |
#ifdef GLX |
294 | 5678 |
c3f(c_v); |
1932 | 5679 |
#endif |
5680 |
%} |
|
294 | 5681 |
! |
5682 |
||
5683 |
glxC3i: v in: aGLXWindowId |
|
5684 |
||
5685 |
%{ /* NOCONTEXT */ |
|
5686 |
long vec[3], *c_v; |
|
5687 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5688 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
294 | 5689 |
SETWIN(aGLXWindowId) |
1932 | 5690 |
#ifdef GLX |
294 | 5691 |
c3i(c_v); |
1932 | 5692 |
#endif |
5693 |
%} |
|
294 | 5694 |
! |
5695 |
||
5696 |
glxC3s: v in: aGLXWindowId |
|
5697 |
||
5698 |
%{ /* NOCONTEXT */ |
|
5699 |
short vec[3], *c_v; |
|
5700 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5701 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
294 | 5702 |
SETWIN(aGLXWindowId) |
1932 | 5703 |
#ifdef GLX |
294 | 5704 |
c3s(c_v); |
1932 | 5705 |
#endif |
5706 |
%} |
|
294 | 5707 |
! |
5708 |
||
5709 |
glxC4f: v in: aGLXWindowId |
|
5710 |
||
5711 |
%{ /* NOCONTEXT */ |
|
5712 |
float vec[4], *c_v; |
|
5713 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5714 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
294 | 5715 |
SETWIN(aGLXWindowId) |
1932 | 5716 |
#ifdef GLX |
294 | 5717 |
c4f(c_v); |
1932 | 5718 |
#endif |
5719 |
%} |
|
294 | 5720 |
! |
5721 |
||
5722 |
glxC4i: v in: aGLXWindowId |
|
5723 |
||
5724 |
%{ /* NOCONTEXT */ |
|
5725 |
long vec[4], *c_v; |
|
5726 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5727 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
294 | 5728 |
SETWIN(aGLXWindowId) |
1932 | 5729 |
#ifdef GLX |
294 | 5730 |
c4i(c_v); |
1932 | 5731 |
#endif |
5732 |
%} |
|
294 | 5733 |
! |
5734 |
||
5735 |
glxC4s: v in: aGLXWindowId |
|
5736 |
||
5737 |
%{ /* NOCONTEXT */ |
|
5738 |
short vec[4], *c_v; |
|
5739 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5740 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
294 | 5741 |
SETWIN(aGLXWindowId) |
1932 | 5742 |
#ifdef GLX |
294 | 5743 |
c4s(c_v); |
1932 | 5744 |
#endif |
5745 |
%} |
|
294 | 5746 |
! |
5747 |
||
5748 |
glxClearhitcodeIn: aGLXWindowId |
|
5749 |
||
5750 |
%{ /* NOCONTEXT */ |
|
1932 | 5751 |
SETWIN(aGLXWindowId) |
5752 |
#ifdef GLX |
|
294 | 5753 |
clearhitcode(); |
1932 | 5754 |
#endif |
5755 |
%} |
|
294 | 5756 |
! |
5757 |
||
5758 |
glxClipplaneIndex: index mode: mode params: params in: aGLXWindowId |
|
5759 |
||
5760 |
%{ /* NOCONTEXT */ |
|
5761 |
float vec[4], *v; |
|
5762 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5763 |
if (! (v = __glx_getFloatsFromInto(params, vec, 4))) RETURN(false); |
294 | 5764 |
SETWIN(aGLXWindowId) |
1932 | 5765 |
#ifdef GLX |
294 | 5766 |
clipplane(__intVal(index), __intVal(mode), v); |
1932 | 5767 |
#endif |
5768 |
%} |
|
294 | 5769 |
! |
5770 |
||
5771 |
glxCmodeIn: aGLXWindowId |
|
5772 |
||
5773 |
%{ /* NOCONTEXT */ |
|
1932 | 5774 |
SETWIN(aGLXWindowId) |
5775 |
#ifdef GLX |
|
294 | 5776 |
cmode(); |
1932 | 5777 |
#endif |
5778 |
%} |
|
294 | 5779 |
! |
5780 |
||
5781 |
glxColorfIndex: index in: aGLXWindowId |
|
5782 |
||
5783 |
^self glxColor: index in: aGLXWindowId |
|
5784 |
! |
|
5785 |
||
5786 |
glxCuroriginN: n xorigin: xorigin yorigin: yorigin in: aGLXWindowId |
|
5787 |
||
5788 |
%{ /* NOCONTEXT */ |
|
1932 | 5789 |
SETWIN(aGLXWindowId) |
5790 |
#ifdef GLX |
|
294 | 5791 |
curorigin(_shortVal(n), _shortVal(xorigin), _shortVal(yorigin)); |
1932 | 5792 |
#endif |
5793 |
%} |
|
294 | 5794 |
! |
5795 |
||
5796 |
glxCursoffIn: aGLXWindowId |
|
5797 |
||
5798 |
%{ /* NOCONTEXT */ |
|
1932 | 5799 |
SETWIN(aGLXWindowId) |
5800 |
#ifdef GLX |
|
294 | 5801 |
cursoff(); |
1932 | 5802 |
#endif |
5803 |
%} |
|
294 | 5804 |
! |
5805 |
||
5806 |
glxCursonIn: aGLXWindowId |
|
5807 |
||
5808 |
%{ /* NOCONTEXT */ |
|
1932 | 5809 |
SETWIN(aGLXWindowId) |
5810 |
#ifdef GLX |
|
294 | 5811 |
curson(); |
1932 | 5812 |
#endif |
5813 |
%} |
|
294 | 5814 |
! |
5815 |
||
5816 |
glxCurstype: type in: aGLXWindowId |
|
5817 |
||
5818 |
%{ /* NOCONTEXT */ |
|
1932 | 5819 |
SETWIN(aGLXWindowId) |
5820 |
#ifdef GLX |
|
294 | 5821 |
curstype(__intVal(type)); |
1932 | 5822 |
#endif |
5823 |
%} |
|
294 | 5824 |
! |
5825 |
||
5826 |
glxCyclemapDuration: duration map: map nxtmap: nxtmap in: aGLXWindowId |
|
5827 |
||
5828 |
%{ /* NOCONTEXT */ |
|
1932 | 5829 |
SETWIN(aGLXWindowId) |
5830 |
#ifdef GLX |
|
294 | 5831 |
cyclemap(_shortVal(duration), _shortVal(map), _shortVal(nxtmap)); |
1932 | 5832 |
#endif |
5833 |
%} |
|
294 | 5834 |
! |
5835 |
||
5836 |
glxDefpatternN: n size: size mask: mask in: aGLXWindowId |
|
5837 |
||
5838 |
%{ /* NOCONTEXT */ |
|
1932 | 5839 |
SETWIN(aGLXWindowId) |
5840 |
#ifdef GLX |
|
294 | 5841 |
defpattern(_shortVal(n), _shortVal(size), (unsigned short *)_indexedArea(mask)); |
1932 | 5842 |
#endif |
5843 |
%} |
|
294 | 5844 |
! |
5845 |
||
5846 |
glxDeltag: t in: aGLXWindowId |
|
5847 |
||
5848 |
%{ /* NOCONTEXT */ |
|
1932 | 5849 |
SETWIN(aGLXWindowId) |
5850 |
#ifdef GLX |
|
294 | 5851 |
deltag(_tagVal(t)); |
1932 | 5852 |
#endif |
5853 |
%} |
|
294 | 5854 |
! |
5855 |
||
5856 |
glxDepthcueMode: mode in: aGLXWindowId |
|
5857 |
||
5858 |
%{ /* NOCONTEXT */ |
|
1932 | 5859 |
SETWIN(aGLXWindowId) |
5860 |
#ifdef GLX |
|
294 | 5861 |
depthcue(_booleanVal(mode)); |
1932 | 5862 |
#endif |
5863 |
%} |
|
294 | 5864 |
! |
5865 |
||
5866 |
glxDitherMode: mode in: aGLXWindowId |
|
5867 |
||
5868 |
%{ /* NOCONTEXT */ |
|
1932 | 5869 |
SETWIN(aGLXWindowId) |
5870 |
#ifdef GLX |
|
294 | 5871 |
dither(_longVal(mode)); |
1932 | 5872 |
#endif |
5873 |
%} |
|
294 | 5874 |
! |
5875 |
||
5876 |
glxDopup: pup in: aGLXWindowId |
|
5877 |
||
5878 |
%{ /* NOCONTEXT */ |
|
1932 | 5879 |
SETWIN(aGLXWindowId) |
5880 |
#ifdef GLX |
|
294 | 5881 |
dopup(_longVal(pup)); |
1932 | 5882 |
#endif |
5883 |
%} |
|
294 | 5884 |
! |
5885 |
||
5886 |
glxDrawmode: mode in: aGLXWindowId |
|
5887 |
||
5888 |
%{ /* NOCONTEXT */ |
|
1932 | 5889 |
SETWIN(aGLXWindowId) |
5890 |
#ifdef GLX |
|
294 | 5891 |
drawmode(_longVal(mode)); |
1932 | 5892 |
#endif |
5893 |
%} |
|
294 | 5894 |
! |
5895 |
||
5896 |
glxEditobj: obj in: aGLXWindowId |
|
5897 |
||
5898 |
%{ /* NOCONTEXT */ |
|
1932 | 5899 |
SETWIN(aGLXWindowId) |
5900 |
#ifdef GLX |
|
294 | 5901 |
editobj(_objectVal(obj)); |
1932 | 5902 |
#endif |
5903 |
%} |
|
294 | 5904 |
! |
5905 |
||
5906 |
glxEndTrimIn: aGLXWindowId |
|
5907 |
||
5908 |
%{ /* NOCONTEXT */ |
|
1932 | 5909 |
SETWIN(aGLXWindowId) |
5910 |
#ifdef GLX |
|
294 | 5911 |
endtrim(); |
1932 | 5912 |
#endif |
5913 |
%} |
|
294 | 5914 |
! |
5915 |
||
5916 |
glxEndfullscrnIn: aGLXWindowId |
|
5917 |
||
5918 |
%{ /* NOCONTEXT */ |
|
1932 | 5919 |
SETWIN(aGLXWindowId) |
5920 |
#ifdef GLX |
|
294 | 5921 |
endfullscrn(); |
1932 | 5922 |
#endif |
5923 |
%} |
|
294 | 5924 |
! |
5925 |
||
5926 |
glxEndpupmodeIn: aGLXWindowId |
|
5927 |
||
5928 |
%{ /* NOCONTEXT */ |
|
1932 | 5929 |
SETWIN(aGLXWindowId) |
5930 |
#ifdef GLX |
|
294 | 5931 |
endpupmode(); |
1932 | 5932 |
#endif |
5933 |
%} |
|
294 | 5934 |
! |
5935 |
||
5936 |
glxFinishIn: aGLXWindowId |
|
5937 |
||
5938 |
%{ /* NOCONTEXT */ |
|
1932 | 5939 |
SETWIN(aGLXWindowId) |
5940 |
#ifdef GLX |
|
294 | 5941 |
finish(); |
1932 | 5942 |
#endif |
5943 |
%} |
|
294 | 5944 |
! |
5945 |
||
5946 |
glxFont: fntnum in: aGLXWindowId |
|
5947 |
||
5948 |
%{ /* NOCONTEXT */ |
|
5949 |
SETWIN(aGLXWindowId) |
|
1932 | 5950 |
#ifdef GLX |
294 | 5951 |
font(_shortVal(fntnum)); |
1932 | 5952 |
#endif |
294 | 5953 |
%} |
5954 |
! |
|
5955 |
||
5956 |
glxForegroundIn: aGLXWindowId |
|
5957 |
||
5958 |
%{ /* NOCONTEXT */ |
|
5959 |
SETWIN(aGLXWindowId) |
|
1932 | 5960 |
#ifdef OPENGL |
5961 |
#else |
|
294 | 5962 |
foreground(); |
1932 | 5963 |
#endif |
294 | 5964 |
%} |
5965 |
! |
|
5966 |
||
5967 |
glxFreepup: pup in: aGLXWindowId |
|
5968 |
||
5969 |
%{ /* NOCONTEXT */ |
|
1932 | 5970 |
SETWIN(aGLXWindowId) |
5971 |
#ifdef GLX |
|
294 | 5972 |
freepup(_longVal(pup)); |
1932 | 5973 |
#endif |
5974 |
%} |
|
294 | 5975 |
! |
5976 |
||
5977 |
glxFudgeXfudge: xfudge yfudge: yfudge in: aGLXWindowId |
|
5978 |
||
5979 |
%{ /* NOCONTEXT */ |
|
1932 | 5980 |
SETWIN(aGLXWindowId) |
5981 |
#ifdef GLX |
|
294 | 5982 |
fudge(_longVal(xfudge), _longVal(yfudge)); |
1932 | 5983 |
#endif |
5984 |
%} |
|
294 | 5985 |
! |
5986 |
||
5987 |
glxFullscrnIn: aGLXWindowId |
|
5988 |
||
5989 |
%{ /* NOCONTEXT */ |
|
1932 | 5990 |
SETWIN(aGLXWindowId) |
5991 |
#ifdef GLX |
|
294 | 5992 |
fullscrn(); |
1932 | 5993 |
#endif |
5994 |
%} |
|
294 | 5995 |
! |
5996 |
||
5997 |
glxGbeginIn: aGLXWindowId |
|
5998 |
||
5999 |
%{ /* NOCONTEXT */ |
|
1932 | 6000 |
SETWIN(aGLXWindowId) |
6001 |
#ifdef GLX |
|
294 | 6002 |
gbegin(); |
1932 | 6003 |
#endif |
6004 |
%} |
|
294 | 6005 |
! |
6006 |
||
6007 |
glxGentagIn: aGLXWindowId |
|
6008 |
||
6009 |
%{ /* NOCONTEXT */ |
|
1932 | 6010 |
int rslt = -1; |
6011 |
||
6012 |
#ifdef GLX |
|
6013 |
SETWIN(aGLXWindowId) |
|
6014 |
rslt = gentag(); |
|
6015 |
#endif |
|
6016 |
RETURN (__MKSMALLINT(rslt)); |
|
6017 |
%} |
|
294 | 6018 |
! |
6019 |
||
6020 |
glxGetbackfaceIn: aGLXWindowId |
|
6021 |
||
6022 |
%{ /* NOCONTEXT */ |
|
1932 | 6023 |
int rslt = -1; |
6024 |
||
6025 |
#ifdef GLX |
|
6026 |
SETWIN(aGLXWindowId) |
|
6027 |
rslt = getbackface(); |
|
6028 |
#endif |
|
6029 |
RETURN (__MKSMALLINT(rslt)); |
|
6030 |
%} |
|
294 | 6031 |
! |
6032 |
||
6033 |
glxGetbufferIn: aGLXWindowId |
|
6034 |
||
6035 |
%{ /* NOCONTEXT */ |
|
1932 | 6036 |
int rslt = -1; |
6037 |
||
6038 |
#ifdef GLX |
|
6039 |
SETWIN(aGLXWindowId) |
|
6040 |
rslt = getbuffer(); |
|
6041 |
#endif |
|
6042 |
RETURN (__MKSMALLINT(rslt)); |
|
6043 |
%} |
|
294 | 6044 |
! |
6045 |
||
6046 |
glxGetbutton: num in: aGLXWindowId |
|
6047 |
||
6048 |
%{ /* NOCONTEXT */ |
|
1932 | 6049 |
int rslt = -1; |
6050 |
||
6051 |
SETWIN(aGLXWindowId) |
|
6052 |
#ifdef OPENGL |
|
6053 |
#else |
|
6054 |
rslt = getbutton(_deviceVal(num)); |
|
6055 |
#endif |
|
6056 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6057 |
%} |
6058 |
! |
|
6059 |
||
6060 |
glxGetcmmodeIn: aGLXWindowId |
|
6061 |
||
6062 |
%{ /* NOCONTEXT */ |
|
1932 | 6063 |
int rslt = 0; |
6064 |
||
6065 |
SETWIN(aGLXWindowId) |
|
6066 |
#ifdef GLX |
|
6067 |
rslt = getcmmode(); |
|
6068 |
#endif |
|
6069 |
RETURN (__MKBOOLEAN(rslt)); |
|
6070 |
%} |
|
294 | 6071 |
! |
6072 |
||
6073 |
glxGetcolorIn: aGLXWindowId |
|
6074 |
"return the current drawing color" |
|
6075 |
||
6076 |
%{ /* NOCONTEXT */ |
|
1932 | 6077 |
int rslt = -1; |
6078 |
||
6079 |
SETWIN(aGLXWindowId) |
|
6080 |
#ifdef OPENGL |
|
6081 |
#else |
|
6082 |
rslt = getcolor(); |
|
6083 |
#endif |
|
6084 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6085 |
%} |
6086 |
! |
|
6087 |
||
6088 |
glxGetdcmIn: aGLXWindowId |
|
6089 |
||
6090 |
%{ /* NOCONTEXT */ |
|
6091 |
#ifdef GLX |
|
6092 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6093 |
RETURN (__MKBOOLEAN(getdcm())); |
294 | 6094 |
#endif |
6095 |
%} |
|
6096 |
. |
|
6097 |
^ false |
|
6098 |
! |
|
6099 |
||
6100 |
glxGetdescenderIn: aGLXWindowId |
|
6101 |
||
6102 |
%{ /* NOCONTEXT */ |
|
6103 |
#ifdef GLX |
|
6104 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6105 |
RETURN (__MKSMALLINT(getdescender())); |
294 | 6106 |
#endif |
6107 |
%} |
|
6108 |
. |
|
6109 |
^ false |
|
6110 |
! |
|
6111 |
||
6112 |
glxGetdisplaymodeIn: aGLXWindowId |
|
6113 |
||
6114 |
%{ /* NOCONTEXT */ |
|
6115 |
#ifdef GLX |
|
6116 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6117 |
RETURN (__MKSMALLINT(getdisplaymode())); |
294 | 6118 |
#endif |
6119 |
%} |
|
6120 |
. |
|
6121 |
^ false |
|
6122 |
! |
|
6123 |
||
6124 |
glxGetdrawmodeIn: aGLXWindowId |
|
6125 |
||
6126 |
%{ /* NOCONTEXT */ |
|
6127 |
#ifdef GLX |
|
6128 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6129 |
RETURN (__MKSMALLINT(getdrawmode())); |
294 | 6130 |
#endif |
6131 |
%} |
|
6132 |
. |
|
6133 |
^ false |
|
6134 |
! |
|
6135 |
||
6136 |
glxGetfontIn: aGLXWindowId |
|
6137 |
||
6138 |
%{ /* NOCONTEXT */ |
|
6139 |
#ifdef GLX |
|
6140 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6141 |
RETURN (__MKSMALLINT(getfont())); |
294 | 6142 |
#endif |
6143 |
%} |
|
6144 |
. |
|
6145 |
^ false |
|
6146 |
! |
|
6147 |
||
6148 |
glxGetgconfigBuffer: buffer in: aGLXWindowId |
|
6149 |
||
6150 |
%{ /* NOCONTEXT */ |
|
6151 |
#ifdef FULL_GLX |
|
6152 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6153 |
RETURN (__MKSMALLINT(getgconfig(_longVal(buffer)))); |
294 | 6154 |
#endif |
6155 |
%} |
|
6156 |
. |
|
6157 |
^ false |
|
6158 |
! |
|
6159 |
||
6160 |
glxGetgdescInquiry: inquiry in: aGLXWindowId |
|
6161 |
||
6162 |
%{ /* NOCONTEXT */ |
|
1932 | 6163 |
int rslt = 0; |
6164 |
||
6165 |
SETWIN(aGLXWindowId) |
|
6166 |
#ifdef OPENGL |
|
6167 |
#else |
|
6168 |
rslt = getgdesc(_longVal(inquiry)); |
|
6169 |
#endif |
|
6170 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6171 |
%} |
6172 |
! |
|
6173 |
||
6174 |
glxGetheightIn: aGLXWindowId |
|
6175 |
||
6176 |
%{ /* NOCONTEXT */ |
|
1932 | 6177 |
int rslt = 0; |
6178 |
||
6179 |
SETWIN(aGLXWindowId) |
|
6180 |
#ifdef OPENGL |
|
6181 |
#else |
|
6182 |
rslt = getheight(); |
|
6183 |
#endif |
|
6184 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6185 |
%} |
6186 |
! |
|
6187 |
||
6188 |
glxGethitcodeIn: aGLXWindowId |
|
6189 |
||
6190 |
%{ /* NOCONTEXT */ |
|
6191 |
#ifdef GLX |
|
6192 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6193 |
RETURN (__MKSMALLINT(gethitcode())); |
294 | 6194 |
#endif |
6195 |
%} |
|
6196 |
. |
|
6197 |
^ false |
|
6198 |
! |
|
6199 |
||
6200 |
glxGetlsbackupIn: aGLXWindowId |
|
6201 |
||
6202 |
%{ /* NOCONTEXT */ |
|
6203 |
#ifdef GLX |
|
6204 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6205 |
RETURN (__MKBOOLEAN(getlsbackup())); |
294 | 6206 |
#endif |
6207 |
%} |
|
6208 |
. |
|
6209 |
^ false |
|
6210 |
! |
|
6211 |
||
6212 |
glxGetlsrepeatIn: aGLXWindowId |
|
6213 |
||
6214 |
%{ /* NOCONTEXT */ |
|
6215 |
#ifdef GLX |
|
6216 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6217 |
RETURN (__MKSMALLINT(getlsrepeat())); |
294 | 6218 |
#endif |
6219 |
%} |
|
6220 |
. |
|
6221 |
^ false |
|
6222 |
! |
|
6223 |
||
6224 |
glxGetlstyleIn: aGLXWindowId |
|
6225 |
||
6226 |
%{ /* NOCONTEXT */ |
|
6227 |
#ifdef GLX |
|
6228 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6229 |
RETURN (__MKSMALLINT(getlstyle())); |
294 | 6230 |
#endif |
6231 |
%} |
|
6232 |
. |
|
6233 |
^ false |
|
6234 |
! |
|
6235 |
||
6236 |
glxGetlwidthIn: aGLXWindowId |
|
6237 |
||
6238 |
%{ /* NOCONTEXT */ |
|
6239 |
#ifdef GLX |
|
6240 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6241 |
RETURN (__MKSMALLINT(getlwidth())); |
294 | 6242 |
#endif |
6243 |
%} |
|
6244 |
. |
|
6245 |
^ false |
|
6246 |
! |
|
6247 |
||
6248 |
glxGetmapIn: 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(getmap())); |
294 | 6254 |
#endif |
6255 |
%} |
|
6256 |
. |
|
6257 |
^ false |
|
6258 |
! |
|
6259 |
||
6260 |
glxGetmmodeIn: 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 (__MKSMALLINT(getmmode())); |
294 | 6266 |
#endif |
6267 |
%} |
|
6268 |
. |
|
6269 |
^ false |
|
6270 |
! |
|
6271 |
||
6272 |
glxGetmonitorIn: 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(getmonitor())); |
294 | 6278 |
#endif |
6279 |
%} |
|
6280 |
. |
|
6281 |
^ false |
|
6282 |
! |
|
6283 |
||
6284 |
glxGetmultisampleIn: aGLXWindowId |
|
6285 |
||
6286 |
%{ /* NOCONTEXT */ |
|
6287 |
#ifdef FULL_GLX |
|
6288 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6289 |
RETURN (__MKBOOLEAN(getmultisample())); |
294 | 6290 |
#endif |
6291 |
%} |
|
6292 |
. |
|
6293 |
^ false |
|
6294 |
! |
|
6295 |
||
6296 |
glxGetothermonitorIn: 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(getothermonitor())); |
294 | 6302 |
#endif |
6303 |
%} |
|
6304 |
. |
|
6305 |
^ false |
|
6306 |
! |
|
6307 |
||
6308 |
glxGetpatternIn: 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(getpattern())); |
294 | 6314 |
#endif |
6315 |
%} |
|
6316 |
. |
|
6317 |
^ false |
|
6318 |
! |
|
6319 |
||
6320 |
glxGetresetlsIn: 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 (__MKBOOLEAN(getresetls())); |
294 | 6326 |
#endif |
6327 |
%} |
|
6328 |
. |
|
6329 |
^ false |
|
6330 |
! |
|
6331 |
||
6332 |
glxGetshadeIn: 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(getshade())); |
294 | 6338 |
#endif |
6339 |
%} |
|
6340 |
. |
|
6341 |
^ false |
|
6342 |
! |
|
6343 |
||
6344 |
glxGetsmIn: aGLXWindowId |
|
6345 |
||
6346 |
%{ /* NOCONTEXT */ |
|
6347 |
#ifdef GLX |
|
6348 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6349 |
RETURN (__MKSMALLINT(getsm())); |
294 | 6350 |
#endif |
6351 |
%} |
|
6352 |
. |
|
6353 |
^ false |
|
6354 |
! |
|
6355 |
||
6356 |
glxGetvaluator: dev in: aGLXWindowId |
|
6357 |
||
6358 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
6359 |
#ifndef OPENGL |
294 | 6360 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6361 |
RETURN (__MKSMALLINT(getvaluator(_deviceVal(dev)))); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
6362 |
#endif |
294 | 6363 |
%} |
6364 |
. |
|
6365 |
^ false |
|
6366 |
! |
|
6367 |
||
6368 |
glxGetvideo: reg in: 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(getvideo(_longVal(reg)))); |
294 | 6374 |
#endif |
6375 |
%} |
|
6376 |
. |
|
6377 |
^ false |
|
6378 |
! |
|
6379 |
||
6380 |
glxGetwritemaskIn: 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 (__MKSMALLINT(getwritemask())); |
294 | 6386 |
#endif |
6387 |
%} |
|
6388 |
. |
|
6389 |
^ false |
|
6390 |
! |
|
6391 |
||
6392 |
glxGetwscrnIn: 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(getwscrn())); |
294 | 6398 |
#endif |
6399 |
%} |
|
6400 |
. |
|
6401 |
^ false |
|
6402 |
! |
|
6403 |
||
6404 |
glxGetzbufferIn: 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 (__MKBOOLEAN(getzbuffer())); |
294 | 6410 |
#endif |
6411 |
%} |
|
6412 |
. |
|
6413 |
^ false |
|
6414 |
! |
|
6415 |
||
6416 |
glxGexitIn: aGLXWindowId |
|
6417 |
||
6418 |
%{ /* NOCONTEXT */ |
|
1932 | 6419 |
SETWIN(aGLXWindowId) |
6420 |
#ifdef OPENGL |
|
6421 |
#else |
|
294 | 6422 |
gexit(); |
1932 | 6423 |
#endif |
6424 |
%} |
|
294 | 6425 |
! |
6426 |
||
6427 |
glxGflushIn: aGLXWindowId |
|
6428 |
||
6429 |
%{ /* NOCONTEXT */ |
|
6430 |
#ifdef GLX |
|
6431 |
SETWIN(aGLXWindowId) |
|
6432 |
gflush(); |
|
1932 | 6433 |
#endif |
6434 |
%} |
|
294 | 6435 |
! |
6436 |
||
6437 |
glxGinitIn: aGLXWindowId |
|
6438 |
||
6439 |
%{ /* NOCONTEXT */ |
|
1932 | 6440 |
SETWIN(aGLXWindowId) |
6441 |
#ifdef OPENGL |
|
6442 |
#else |
|
294 | 6443 |
ginit(); |
1932 | 6444 |
#endif |
6445 |
%} |
|
294 | 6446 |
! |
6447 |
||
6448 |
glxGlcompatMode: mode value: value in: aGLXWindowId |
|
6449 |
||
6450 |
%{ /* NOCONTEXT */ |
|
6451 |
#ifdef GLX |
|
6452 |
SETWIN(aGLXWindowId) |
|
6453 |
glcompat(_longVal(mode), _longVal(value)); |
|
1932 | 6454 |
#endif |
6455 |
%} |
|
294 | 6456 |
! |
6457 |
||
6458 |
glxGresetIn: aGLXWindowId |
|
6459 |
||
6460 |
%{ /* NOCONTEXT */ |
|
6461 |
#ifdef GLX |
|
6462 |
SETWIN(aGLXWindowId) |
|
6463 |
greset(); |
|
1932 | 6464 |
#endif |
6465 |
%} |
|
294 | 6466 |
! |
6467 |
||
6468 |
glxGsyncIn: aGLXWindowId |
|
6469 |
||
6470 |
%{ /* NOCONTEXT */ |
|
6471 |
#ifdef GLX |
|
6472 |
SETWIN(aGLXWindowId) |
|
6473 |
gsync(); |
|
1932 | 6474 |
#endif |
6475 |
%} |
|
294 | 6476 |
! |
6477 |
||
6478 |
glxIconsizeX: x y: y in: aGLXWindowId |
|
6479 |
||
6480 |
%{ /* NOCONTEXT */ |
|
6481 |
#ifdef GLX |
|
6482 |
SETWIN(aGLXWindowId) |
|
6483 |
iconsize(_longVal(x), _longVal(y)); |
|
1932 | 6484 |
#endif |
6485 |
%} |
|
294 | 6486 |
! |
6487 |
||
6488 |
glxImakebackgroundIn: aGLXWindowId |
|
6489 |
||
6490 |
%{ /* NOCONTEXT */ |
|
6491 |
#ifdef GLX |
|
6492 |
SETWIN(aGLXWindowId) |
|
6493 |
imakebackground(); |
|
1932 | 6494 |
#endif |
6495 |
%} |
|
294 | 6496 |
! |
6497 |
||
6498 |
glxInitnamesIn: aGLXWindowId |
|
6499 |
||
6500 |
%{ /* NOCONTEXT */ |
|
6501 |
#ifdef GLX |
|
6502 |
SETWIN(aGLXWindowId) |
|
6503 |
initnames(); |
|
1932 | 6504 |
#endif |
6505 |
%} |
|
294 | 6506 |
! |
6507 |
||
6508 |
glxIsqueued: dev in: aGLXWindowId |
|
6509 |
||
6510 |
%{ /* NOCONTEXT */ |
|
6511 |
#ifdef GLX |
|
6512 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6513 |
RETURN (__MKBOOLEAN(isqueued(_deviceVal(dev)))); |
294 | 6514 |
#endif |
6515 |
%} |
|
6516 |
. |
|
6517 |
^ false |
|
6518 |
! |
|
6519 |
||
6520 |
glxIstag: t in: aGLXWindowId |
|
6521 |
||
6522 |
%{ /* NOCONTEXT */ |
|
6523 |
#ifdef GLX |
|
6524 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6525 |
RETURN (__MKBOOLEAN(istag(_tagVal(t)))); |
294 | 6526 |
#endif |
6527 |
%} |
|
6528 |
. |
|
6529 |
^ false |
|
6530 |
! |
|
6531 |
||
6532 |
glxKeepaspectX: x y: y in: aGLXWindowId |
|
6533 |
||
6534 |
%{ /* NOCONTEXT */ |
|
6535 |
#ifdef GLX |
|
6536 |
SETWIN(aGLXWindowId) |
|
6537 |
keepaspect(_longVal(x), _longVal(y)); |
|
6538 |
RETURN (true); |
|
6539 |
#endif |
|
6540 |
%} |
|
6541 |
. |
|
6542 |
^ false |
|
6543 |
! |
|
6544 |
||
6545 |
glxLinesmoothMode: mode in: aGLXWindowId |
|
6546 |
||
6547 |
%{ /* NOCONTEXT */ |
|
6548 |
#ifdef GLX |
|
6549 |
SETWIN(aGLXWindowId) |
|
6550 |
linesmooth((ulong)__intVal(mode)); |
|
6551 |
RETURN (true); |
|
6552 |
#endif |
|
6553 |
%} |
|
6554 |
. |
|
6555 |
^ false |
|
6556 |
! |
|
6557 |
||
6558 |
glxLmcolorMode: mode in: aGLXWindowId |
|
6559 |
||
6560 |
%{ /* NOCONTEXT */ |
|
6561 |
#ifdef GLX |
|
6562 |
SETWIN(aGLXWindowId) |
|
6563 |
lmcolor(_longVal(mode)); |
|
6564 |
RETURN (true); |
|
6565 |
#endif |
|
6566 |
%} |
|
6567 |
. |
|
6568 |
^ false |
|
6569 |
! |
|
6570 |
||
6571 |
glxLoadname: name in: aGLXWindowId |
|
6572 |
||
6573 |
%{ /* NOCONTEXT */ |
|
6574 |
#ifdef GLX |
|
6575 |
SETWIN(aGLXWindowId) |
|
6576 |
loadname(_shortVal(name)); |
|
6577 |
RETURN (true); |
|
6578 |
#endif |
|
6579 |
%} |
|
6580 |
. |
|
6581 |
^ false |
|
6582 |
! |
|
6583 |
||
6584 |
glxLogicop: opcode in: aGLXWindowId |
|
6585 |
||
6586 |
%{ /* NOCONTEXT */ |
|
6587 |
#ifdef GLX |
|
6588 |
SETWIN(aGLXWindowId) |
|
6589 |
logicop(_longVal(opcode)); |
|
6590 |
RETURN (true); |
|
6591 |
#endif |
|
6592 |
%} |
|
6593 |
. |
|
6594 |
^ false |
|
6595 |
! |
|
6596 |
||
6597 |
glxLsbackup: b in: aGLXWindowId |
|
6598 |
||
6599 |
%{ /* NOCONTEXT */ |
|
6600 |
#ifdef GLX |
|
6601 |
SETWIN(aGLXWindowId) |
|
6602 |
lsbackup(_booleanVal(b)); |
|
6603 |
RETURN (true); |
|
6604 |
#endif |
|
6605 |
%} |
|
6606 |
. |
|
6607 |
^ false |
|
6608 |
! |
|
6609 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6610 |
glxLsetdepthNear:znear far:zfar in: aGLXWindowId |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6611 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6612 |
%{ /* NOCONTEXT */ |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6613 |
#ifdef GLX |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6614 |
SETWIN(aGLXWindowId) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6615 |
lsetdepth(_longVal(znear), _longVal(zfar)); |
294 | 6616 |
RETURN (true); |
6617 |
#endif |
|
6618 |
%} |
|
6619 |
. |
|
6620 |
^ false |
|
6621 |
! |
|
6622 |
||
6623 |
glxLshaderangeLowin: lowin hiwin: hiwin znear: znear zfar: zfar in: aGLXWindowId |
|
6624 |
||
6625 |
%{ /* NOCONTEXT */ |
|
6626 |
#ifdef GLX |
|
6627 |
SETWIN(aGLXWindowId) |
|
6628 |
lshaderange(_colorindexVal(lowin), _colorindexVal(hiwin), |
|
6629 |
_longVal(znear), _longVal(zfar)); |
|
6630 |
RETURN (true); |
|
6631 |
#endif |
|
6632 |
%} |
|
6633 |
. |
|
6634 |
^ false |
|
6635 |
! |
|
6636 |
||
6637 |
glxLsrepeatFactor: factor in: aGLXWindowId |
|
6638 |
||
6639 |
%{ /* NOCONTEXT */ |
|
6640 |
#ifdef GLX |
|
6641 |
SETWIN(aGLXWindowId) |
|
6642 |
lsrepeat(_longVal(factor)); |
|
6643 |
RETURN (true); |
|
6644 |
#endif |
|
6645 |
%} |
|
6646 |
. |
|
6647 |
^ false |
|
6648 |
! |
|
6649 |
||
6650 |
glxMaketag: t in: aGLXWindowId |
|
6651 |
||
6652 |
%{ /* NOCONTEXT */ |
|
6653 |
#ifdef GLX |
|
6654 |
SETWIN(aGLXWindowId) |
|
6655 |
maketag(_tagVal(t)); |
|
6656 |
RETURN (true); |
|
6657 |
#endif |
|
6658 |
%} |
|
6659 |
. |
|
6660 |
^ false |
|
6661 |
! |
|
6662 |
||
6663 |
glxMaxsizeX: x y: y in: aGLXWindowId |
|
6664 |
||
6665 |
%{ /* NOCONTEXT */ |
|
6666 |
#ifdef GLX |
|
6667 |
SETWIN(aGLXWindowId) |
|
6668 |
maxsize(_longVal(x), _longVal(y)); |
|
6669 |
RETURN (true); |
|
6670 |
#endif |
|
6671 |
%} |
|
6672 |
. |
|
6673 |
^ false |
|
6674 |
! |
|
6675 |
||
6676 |
glxMinsizeX: x y: y in: aGLXWindowId |
|
6677 |
||
6678 |
%{ /* NOCONTEXT */ |
|
6679 |
#ifdef GLX |
|
6680 |
SETWIN(aGLXWindowId) |
|
6681 |
minsize(_longVal(x), _longVal(y)); |
|
6682 |
RETURN (true); |
|
6683 |
#endif |
|
6684 |
%} |
|
6685 |
. |
|
6686 |
^ false |
|
6687 |
! |
|
6688 |
||
6689 |
glxMsalphaMode: mode in: aGLXWindowId |
|
6690 |
||
6691 |
%{ /* NOCONTEXT */ |
|
6692 |
#ifdef FULL_GLX |
|
6693 |
SETWIN(aGLXWindowId) |
|
6694 |
msalpha(_longVal(mode)); |
|
6695 |
RETURN (true); |
|
6696 |
#endif |
|
6697 |
%} |
|
6698 |
. |
|
6699 |
^ false |
|
6700 |
! |
|
6701 |
||
6702 |
glxMsmask: mask inverse: inverse in: aGLXWindowId |
|
6703 |
||
6704 |
%{ /* NOCONTEXT */ |
|
6705 |
#ifdef FULL_GLX |
|
6706 |
SETWIN(aGLXWindowId) |
|
6707 |
msmask(_floatVal(mask), _booleanVal(inverse)); |
|
6708 |
RETURN (true); |
|
6709 |
#endif |
|
6710 |
%} |
|
6711 |
. |
|
6712 |
^ false |
|
6713 |
! |
|
6714 |
||
6715 |
glxMspattern: pattern in: aGLXWindowId |
|
6716 |
||
6717 |
%{ /* NOCONTEXT */ |
|
6718 |
#ifdef FULL_GLX |
|
6719 |
SETWIN(aGLXWindowId) |
|
6720 |
mspattern(_longVal(pattern)); |
|
6721 |
RETURN (true); |
|
6722 |
#endif |
|
6723 |
%} |
|
6724 |
. |
|
6725 |
^ false |
|
6726 |
! |
|
6727 |
||
6728 |
glxMssizeSamples: samples zsize: zsize ssize: ssize in: aGLXWindowId |
|
6729 |
||
6730 |
%{ /* NOCONTEXT */ |
|
6731 |
#ifdef FULL_GLX |
|
6732 |
SETWIN(aGLXWindowId) |
|
6733 |
mssize(_longVal(samples), _longVal(zsize), _longVal(ssize)); |
|
6734 |
RETURN (true); |
|
6735 |
#endif |
|
6736 |
%} |
|
6737 |
. |
|
6738 |
^ false |
|
6739 |
! |
|
6740 |
||
6741 |
glxMswapbuffers: fbuf in: aGLXWindowId |
|
6742 |
||
6743 |
%{ /* NOCONTEXT */ |
|
6744 |
#ifdef GLX |
|
6745 |
SETWIN(aGLXWindowId) |
|
6746 |
mswapbuffers(_longVal(fbuf)); |
|
6747 |
RETURN (true); |
|
6748 |
#endif |
|
6749 |
%} |
|
6750 |
. |
|
6751 |
^ false |
|
6752 |
! |
|
6753 |
||
6754 |
glxMultimapIn: aGLXWindowId |
|
6755 |
||
6756 |
%{ /* NOCONTEXT */ |
|
6757 |
#ifdef GLX |
|
6758 |
SETWIN(aGLXWindowId) |
|
6759 |
multimap(); |
|
6760 |
RETURN (true); |
|
6761 |
#endif |
|
6762 |
%} |
|
6763 |
. |
|
6764 |
^ false |
|
6765 |
! |
|
6766 |
||
6767 |
glxMultisample: bool in: aGLXWindowId |
|
6768 |
||
6769 |
%{ /* NOCONTEXT */ |
|
6770 |
#ifdef FULL_GLX |
|
6771 |
SETWIN(aGLXWindowId) |
|
6772 |
multisample(_booleanVal(bool)); |
|
6773 |
RETURN (true); |
|
6774 |
#endif |
|
6775 |
%} |
|
6776 |
. |
|
6777 |
^ false |
|
6778 |
! |
|
6779 |
||
6780 |
glxNewpupIn: aGLXWindowId |
|
6781 |
||
6782 |
%{ /* NOCONTEXT */ |
|
6783 |
#ifdef GLX |
|
6784 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6785 |
RETURN (__MKSMALLINT(newpup())); |
294 | 6786 |
#endif |
6787 |
%} |
|
6788 |
. |
|
6789 |
^ false |
|
6790 |
! |
|
6791 |
||
6792 |
glxNewtag: newtg oldtg: oldtg offst: offst in: aGLXWindowId |
|
6793 |
||
6794 |
%{ /* NOCONTEXT */ |
|
6795 |
#ifdef GLX |
|
6796 |
SETWIN(aGLXWindowId) |
|
6797 |
newtag(_tagVal(newtg), _tagVal(oldtg), _offsetVal(offst)); |
|
6798 |
RETURN (true); |
|
6799 |
#endif |
|
6800 |
%} |
|
6801 |
. |
|
6802 |
^ false |
|
6803 |
! |
|
6804 |
||
6805 |
glxNoborderIn: aGLXWindowId |
|
6806 |
||
6807 |
%{ /* NOCONTEXT */ |
|
6808 |
#ifdef GLX |
|
6809 |
SETWIN(aGLXWindowId) |
|
6810 |
noborder(); |
|
6811 |
RETURN (true); |
|
6812 |
#endif |
|
6813 |
%} |
|
6814 |
. |
|
6815 |
^ false |
|
6816 |
! |
|
6817 |
||
6818 |
glxNoise: v delta: delta in: aGLXWindowId |
|
6819 |
||
6820 |
%{ /* NOCONTEXT */ |
|
6821 |
#ifdef GLX |
|
6822 |
SETWIN(aGLXWindowId) |
|
6823 |
noise(_deviceVal(v), _shortVal(delta)); |
|
6824 |
RETURN (true); |
|
6825 |
#endif |
|
6826 |
%} |
|
6827 |
. |
|
6828 |
^ false |
|
6829 |
! |
|
6830 |
||
6831 |
glxNoportIn: aGLXWindowId |
|
6832 |
||
6833 |
%{ /* NOCONTEXT */ |
|
6834 |
#ifdef GLX |
|
6835 |
SETWIN(aGLXWindowId) |
|
6836 |
noport(); |
|
6837 |
RETURN (true); |
|
6838 |
#endif |
|
6839 |
%} |
|
6840 |
. |
|
6841 |
^ false |
|
6842 |
! |
|
6843 |
||
6844 |
glxNurbscurveKnotCount: knotCount knotList: knotList |
|
6845 |
offset: offset ctlArray: ctlArray |
|
6846 |
order: order type: type in: aGLXWindowId |
|
6847 |
||
6848 |
| ctlPoints i | |
|
6849 |
ctlPoints := DoubleArray new: ctlArray size * (ctlArray first size). |
|
6850 |
i := 1. |
|
6851 |
ctlArray do: [:point | |
|
6852 |
point do: [:coord | |
|
6853 |
ctlPoints at: i put: coord. |
|
6854 |
i := i + 1]]. |
|
6855 |
||
6856 |
%{ /* NOCONTEXT */ |
|
6857 |
#ifdef GLX |
|
6858 |
char *knotElements, *ctlElements; |
|
6859 |
OBJ cls; |
|
6860 |
int ninstVars, nInstBytes; |
|
6861 |
||
6862 |
SETWIN(aGLXWindowId) |
|
6863 |
cls = __qClass(ctlPoints); |
|
6864 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
6865 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
|
6866 |
||
6867 |
ctlElements = (char *)(_InstPtr(ctlPoints)) + nInstBytes; |
|
6868 |
knotElements = (char *)(_InstPtr(knotList)) + nInstBytes; |
|
6869 |
||
6870 |
nurbscurve ( |
|
6871 |
_longVal(knotCount), (double *)knotElements, |
|
6872 |
_longVal(offset), (double *)ctlElements, |
|
6873 |
_longVal(order), _longVal(type)); |
|
6874 |
RETURN(true); |
|
6875 |
#endif |
|
6876 |
%} |
|
6877 |
. |
|
6878 |
^ false |
|
6879 |
! |
|
6880 |
||
6881 |
glxObjdeleteTag1: tag1 tag2: tag2 in: aGLXWindowId |
|
6882 |
||
6883 |
%{ /* NOCONTEXT */ |
|
6884 |
#ifdef GLX |
|
6885 |
SETWIN(aGLXWindowId) |
|
6886 |
objdelete(_tagVal(tag1), _tagVal(tag2)); |
|
6887 |
RETURN (true); |
|
6888 |
#endif |
|
6889 |
%} |
|
6890 |
. |
|
6891 |
^ false |
|
6892 |
! |
|
6893 |
||
6894 |
glxObjinsert: t in: aGLXWindowId |
|
6895 |
||
6896 |
%{ /* NOCONTEXT */ |
|
6897 |
#ifdef GLX |
|
6898 |
SETWIN(aGLXWindowId) |
|
6899 |
objinsert(_tagVal(t)); |
|
6900 |
RETURN (true); |
|
6901 |
#endif |
|
6902 |
%} |
|
6903 |
. |
|
6904 |
^ false |
|
6905 |
! |
|
6906 |
||
6907 |
glxObjreplace: t in: aGLXWindowId |
|
6908 |
||
6909 |
%{ /* NOCONTEXT */ |
|
6910 |
#ifdef GLX |
|
6911 |
SETWIN(aGLXWindowId) |
|
6912 |
objreplace(_tagVal(t)); |
|
6913 |
RETURN (true); |
|
6914 |
#endif |
|
6915 |
%} |
|
6916 |
. |
|
6917 |
^ false |
|
6918 |
! |
|
6919 |
||
6920 |
glxOnemapIn: aGLXWindowId |
|
6921 |
||
6922 |
%{ /* NOCONTEXT */ |
|
6923 |
#ifdef GLX |
|
6924 |
SETWIN(aGLXWindowId) |
|
6925 |
onemap(); |
|
6926 |
RETURN (true); |
|
6927 |
#endif |
|
6928 |
%} |
|
6929 |
. |
|
6930 |
^ false |
|
6931 |
! |
|
6932 |
||
6933 |
glxPagecolor: pcolor in: aGLXWindowId |
|
6934 |
||
6935 |
%{ /* NOCONTEXT */ |
|
6936 |
#ifdef GLX |
|
6937 |
SETWIN(aGLXWindowId) |
|
6938 |
pagecolor(_colorindexVal(pcolor)); |
|
6939 |
RETURN (true); |
|
6940 |
#endif |
|
6941 |
%} |
|
6942 |
. |
|
6943 |
^ false |
|
6944 |
! |
|
6945 |
||
6946 |
glxPassthroughToken: token in: aGLXWindowId |
|
6947 |
||
6948 |
%{ /* NOCONTEXT */ |
|
6949 |
#ifdef GLX |
|
6950 |
SETWIN(aGLXWindowId) |
|
6951 |
passthrough(_shortVal(token)); |
|
6952 |
RETURN (true); |
|
6953 |
#endif |
|
6954 |
%} |
|
6955 |
. |
|
6956 |
^ false |
|
6957 |
! |
|
6958 |
||
6959 |
glxPclosIn: aGLXWindowId |
|
6960 |
||
6961 |
%{ /* NOCONTEXT */ |
|
6962 |
#ifdef GLX |
|
6963 |
SETWIN(aGLXWindowId) |
|
6964 |
pclos(); |
|
6965 |
RETURN (true); |
|
6966 |
#endif |
|
6967 |
%} |
|
6968 |
. |
|
6969 |
^ false |
|
6970 |
! |
|
6971 |
||
6972 |
glxPicksizeX: x y: y in: aGLXWindowId |
|
6973 |
||
6974 |
%{ /* NOCONTEXT */ |
|
6975 |
#ifdef GLX |
|
6976 |
SETWIN(aGLXWindowId) |
|
6977 |
picksize(_shortVal(x), _shortVal(y)); |
|
6978 |
RETURN (true); |
|
6979 |
#endif |
|
6980 |
%} |
|
6981 |
. |
|
6982 |
^ false |
|
6983 |
! |
|
6984 |
||
6985 |
glxPixmode: mode value: value in: aGLXWindowId |
|
6986 |
||
6987 |
%{ /* NOCONTEXT */ |
|
6988 |
#ifdef GLX |
|
6989 |
SETWIN(aGLXWindowId) |
|
6990 |
pixmode(_longVal(mode), _longVal(value)); |
|
6991 |
RETURN (true); |
|
6992 |
#endif |
|
6993 |
%} |
|
6994 |
. |
|
6995 |
^ false |
|
6996 |
! |
|
6997 |
||
6998 |
glxPntsmoothMode: mode in: aGLXWindowId |
|
6999 |
||
7000 |
%{ /* NOCONTEXT */ |
|
7001 |
#ifdef GLX |
|
7002 |
SETWIN(aGLXWindowId) |
|
7003 |
pntsmooth((ulong)__intVal(mode)); |
|
7004 |
RETURN (true); |
|
7005 |
#endif |
|
7006 |
%} |
|
7007 |
. |
|
7008 |
^ false |
|
7009 |
! |
|
7010 |
||
7011 |
glxPolysmoothMode: mode in: aGLXWindowId |
|
7012 |
||
7013 |
%{ /* NOCONTEXT */ |
|
7014 |
#ifdef GLX |
|
7015 |
SETWIN(aGLXWindowId) |
|
7016 |
polysmooth(_longVal(mode)); |
|
7017 |
RETURN (true); |
|
7018 |
#endif |
|
7019 |
%} |
|
7020 |
. |
|
7021 |
^ false |
|
7022 |
! |
|
7023 |
||
7024 |
glxPopnameIn: aGLXWindowId |
|
7025 |
||
7026 |
%{ /* NOCONTEXT */ |
|
7027 |
#ifdef GLX |
|
7028 |
SETWIN(aGLXWindowId) |
|
7029 |
popname(); |
|
7030 |
RETURN (true); |
|
7031 |
#endif |
|
7032 |
%} |
|
7033 |
. |
|
7034 |
^ false |
|
7035 |
! |
|
7036 |
||
7037 |
glxPrefpositionX1: x1 x2: x2 y1: y1 y2: y2 in: aGLXWindowId |
|
7038 |
||
7039 |
%{ /* NOCONTEXT */ |
|
7040 |
SETWIN(aGLXWindowId) |
|
1932 | 7041 |
#ifdef OPENGL |
7042 |
#else |
|
294 | 7043 |
prefposition(_longVal(x1), _longVal(x2), _longVal(y1), _longVal(y2)); |
1932 | 7044 |
#endif |
294 | 7045 |
RETURN (true); |
7046 |
%} |
|
7047 |
! |
|
7048 |
||
7049 |
glxPrefsizeX: x y: y in: aGLXWindowId |
|
7050 |
||
7051 |
%{ /* NOCONTEXT */ |
|
7052 |
SETWIN(aGLXWindowId) |
|
1932 | 7053 |
#ifdef OPENGL |
7054 |
#else |
|
294 | 7055 |
prefsize(_longVal(x), _longVal(y)); |
1932 | 7056 |
#endif |
294 | 7057 |
RETURN (true); |
7058 |
%} |
|
7059 |
! |
|
7060 |
||
7061 |
glxPupmodeIn: aGLXWindowId |
|
7062 |
||
7063 |
%{ /* NOCONTEXT */ |
|
7064 |
#ifdef GLX |
|
7065 |
SETWIN(aGLXWindowId) |
|
7066 |
pupmode(); |
|
7067 |
RETURN (true); |
|
7068 |
#endif |
|
7069 |
%} |
|
7070 |
. |
|
7071 |
^ false |
|
7072 |
! |
|
7073 |
||
7074 |
glxPushname: name In: aGLXWindowId |
|
7075 |
||
7076 |
%{ /* NOCONTEXT */ |
|
7077 |
#ifdef GLX |
|
7078 |
SETWIN(aGLXWindowId) |
|
7079 |
pushname(_shortVal(name)); |
|
7080 |
RETURN (true); |
|
7081 |
#endif |
|
7082 |
%} |
|
7083 |
. |
|
7084 |
^ false |
|
7085 |
! |
|
7086 |
||
7087 |
glxQdevice: dev in: aGLXWindowId |
|
7088 |
||
7089 |
%{ /* NOCONTEXT */ |
|
1932 | 7090 |
SETWIN(aGLXWindowId) |
7091 |
#ifdef OPENGL |
|
7092 |
#else |
|
294 | 7093 |
qdevice(_deviceVal(dev)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7094 |
#endif |
294 | 7095 |
%} |
7096 |
! |
|
7097 |
||
7098 |
glxQenterDev: dev val: val in: aGLXWindowId |
|
7099 |
||
7100 |
%{ /* NOCONTEXT */ |
|
7101 |
SETWIN(aGLXWindowId) |
|
1932 | 7102 |
#ifdef OPENGL |
7103 |
#else |
|
294 | 7104 |
qenter(_deviceVal(dev), _shortVal(val)); |
1932 | 7105 |
#endif |
294 | 7106 |
%} |
7107 |
! |
|
7108 |
||
7109 |
glxQgetfdIn: aGLXWindowId |
|
7110 |
||
7111 |
%{ /* NOCONTEXT */ |
|
7112 |
#ifdef GLX |
|
7113 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7114 |
RETURN (__MKSMALLINT(qgetfd())); |
294 | 7115 |
#endif |
7116 |
%} |
|
7117 |
. |
|
7118 |
^ false |
|
7119 |
! |
|
7120 |
||
7121 |
glxQreadIn: aGLXWindowId |
|
7122 |
||
7123 |
| dev data | |
|
7124 |
%{ |
|
7125 |
short c_data; |
|
7126 |
||
7127 |
SETWIN(aGLXWindowId) |
|
1932 | 7128 |
#ifdef OPENGL |
7129 |
#else |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7130 |
dev = __MKSMALLINT(qread(&c_data)); |
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7131 |
data = __MKSMALLINT(c_data); |
1932 | 7132 |
#endif |
294 | 7133 |
%} |
7134 |
. |
|
7135 |
^ Array with: dev with: data |
|
7136 |
! |
|
7137 |
||
7138 |
glxQresetIn: aGLXWindowId |
|
7139 |
||
7140 |
%{ /* NOCONTEXT */ |
|
7141 |
SETWIN(aGLXWindowId) |
|
1932 | 7142 |
#ifdef OPENGL |
7143 |
#else |
|
294 | 7144 |
qreset(); |
1932 | 7145 |
#endif |
294 | 7146 |
RETURN (true); |
7147 |
%} |
|
7148 |
! |
|
7149 |
||
7150 |
glxQtestIn: aGLXWindowId |
|
7151 |
||
7152 |
%{ /* NOCONTEXT */ |
|
1932 | 7153 |
int rslt = 0; |
7154 |
||
7155 |
SETWIN(aGLXWindowId) |
|
7156 |
#ifdef OPENGL |
|
7157 |
#else |
|
7158 |
rslt = qtest(); |
|
7159 |
#endif |
|
7160 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 7161 |
%} |
7162 |
! |
|
7163 |
||
7164 |
glxRGBcursorIndex: index red: red green: green blue: blue |
|
7165 |
redm: redm greenm: greenm bluem: bluem in: aGLXWindowId |
|
7166 |
||
7167 |
%{ /* NOCONTEXT */ |
|
7168 |
#ifdef GLX |
|
7169 |
SETWIN(aGLXWindowId) |
|
7170 |
RGBcursor(_shortVal(index), |
|
7171 |
_shortVal(red), _shortVal(green), _shortVal(blue), |
|
7172 |
_shortVal(redm), _shortVal(greenm), _shortVal(bluem)); |
|
7173 |
RETURN (true); |
|
7174 |
#endif |
|
7175 |
%} |
|
7176 |
. |
|
7177 |
^ false |
|
7178 |
! |
|
7179 |
||
7180 |
glxRGBwritemaskRed: red green: green blue: blue in: aGLXWindowId |
|
7181 |
||
7182 |
%{ /* NOCONTEXT */ |
|
7183 |
#ifdef GLX |
|
7184 |
SETWIN(aGLXWindowId) |
|
7185 |
RGBwritemask(_shortVal(red), _shortVal(green), _shortVal(blue)); |
|
7186 |
RETURN (true); |
|
7187 |
#endif |
|
7188 |
%} |
|
7189 |
. |
|
7190 |
^ false |
|
7191 |
! |
|
7192 |
||
7193 |
glxRectzoomX: xfactor y: yfactor in: aGLXWindowId |
|
7194 |
||
7195 |
%{ /* NOCONTEXT */ |
|
7196 |
#ifdef GLX |
|
7197 |
SETWIN(aGLXWindowId) |
|
7198 |
rectzoom(_floatVal(xfactor), _floatVal(yfactor)); |
|
7199 |
RETURN (true); |
|
7200 |
#endif |
|
7201 |
%} |
|
7202 |
. |
|
7203 |
^ false |
|
7204 |
! |
|
7205 |
||
7206 |
glxResetls: b in: aGLXWindowId |
|
7207 |
||
7208 |
%{ /* NOCONTEXT */ |
|
7209 |
#ifdef GLX |
|
7210 |
SETWIN(aGLXWindowId) |
|
7211 |
resetls(_booleanVal(b)); |
|
7212 |
RETURN (true); |
|
7213 |
#endif |
|
7214 |
%} |
|
7215 |
. |
|
7216 |
^ false |
|
7217 |
! |
|
7218 |
||
7219 |
glxRingbellIn: aGLXWindowId |
|
7220 |
||
7221 |
%{ /* NOCONTEXT */ |
|
7222 |
#ifdef GLX |
|
7223 |
SETWIN(aGLXWindowId) |
|
7224 |
ringbell(); |
|
7225 |
RETURN (true); |
|
7226 |
#endif |
|
7227 |
%} |
|
7228 |
. |
|
7229 |
^ false |
|
7230 |
! |
|
7231 |
||
7232 |
glxSboxX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7233 |
||
7234 |
%{ /* NOCONTEXT */ |
|
7235 |
#ifdef GLX |
|
7236 |
SETWIN(aGLXWindowId) |
|
7237 |
sbox(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
7238 |
RETURN (true); |
|
7239 |
#endif |
|
7240 |
%} |
|
7241 |
. |
|
7242 |
^ false |
|
7243 |
! |
|
7244 |
||
7245 |
glxSboxfX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7246 |
||
7247 |
%{ /* NOCONTEXT */ |
|
7248 |
#ifdef GLX |
|
7249 |
SETWIN(aGLXWindowId) |
|
7250 |
sboxf(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
7251 |
RETURN (true); |
|
7252 |
#endif |
|
7253 |
%} |
|
7254 |
. |
|
7255 |
^ false |
|
7256 |
! |
|
7257 |
||
7258 |
glxSboxfiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7259 |
||
7260 |
%{ /* NOCONTEXT */ |
|
7261 |
#ifdef GLX |
|
7262 |
SETWIN(aGLXWindowId) |
|
7263 |
sboxfi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
7264 |
RETURN (true); |
|
7265 |
#endif |
|
7266 |
%} |
|
7267 |
. |
|
7268 |
^ false |
|
7269 |
! |
|
7270 |
||
7271 |
glxSboxfsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7272 |
||
7273 |
%{ /* NOCONTEXT */ |
|
7274 |
#ifdef GLX |
|
7275 |
SETWIN(aGLXWindowId) |
|
7276 |
sboxfs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
7277 |
RETURN (true); |
|
7278 |
#endif |
|
7279 |
%} |
|
7280 |
. |
|
7281 |
^ false |
|
7282 |
! |
|
7283 |
||
7284 |
glxSboxiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7285 |
||
7286 |
%{ /* NOCONTEXT */ |
|
7287 |
#ifdef GLX |
|
7288 |
SETWIN(aGLXWindowId) |
|
7289 |
sboxi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
7290 |
RETURN (true); |
|
7291 |
#endif |
|
7292 |
%} |
|
7293 |
. |
|
7294 |
^ false |
|
7295 |
! |
|
7296 |
||
7297 |
glxSboxsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7298 |
||
7299 |
%{ /* NOCONTEXT */ |
|
7300 |
#ifdef GLX |
|
7301 |
SETWIN(aGLXWindowId) |
|
7302 |
sboxs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
7303 |
RETURN (true); |
|
7304 |
#endif |
|
7305 |
%} |
|
7306 |
. |
|
7307 |
^ false |
|
7308 |
! |
|
7309 |
||
7310 |
glxSclearSval: sval in: aGLXWindowId |
|
7311 |
||
7312 |
%{ /* NOCONTEXT */ |
|
7313 |
#ifdef GLX |
|
7314 |
SETWIN(aGLXWindowId) |
|
7315 |
sclear((ulong)__intVal(sval)); |
|
7316 |
RETURN (true); |
|
7317 |
#endif |
|
7318 |
%} |
|
7319 |
. |
|
7320 |
^ false |
|
7321 |
! |
|
7322 |
||
7323 |
glxScrbox: arg in: aGLXWindowId |
|
7324 |
||
7325 |
%{ /* NOCONTEXT */ |
|
7326 |
#ifdef GLX |
|
7327 |
SETWIN(aGLXWindowId) |
|
7328 |
scrbox(_longVal(arg)); |
|
7329 |
RETURN (true); |
|
7330 |
#endif |
|
7331 |
%} |
|
7332 |
. |
|
7333 |
^ false |
|
7334 |
! |
|
7335 |
||
7336 |
glxScreenspaceIn: aGLXWindowId |
|
7337 |
||
7338 |
%{ /* NOCONTEXT */ |
|
7339 |
#ifdef GLX |
|
7340 |
SETWIN(aGLXWindowId) |
|
7341 |
screenspace(); |
|
7342 |
RETURN (true); |
|
7343 |
#endif |
|
7344 |
%} |
|
7345 |
. |
|
7346 |
^ false |
|
7347 |
! |
|
7348 |
||
7349 |
glxScrmaskLeft: left right: right bottom: bottom top: top in: aGLXWindowId |
|
7350 |
||
7351 |
%{ /* NOCONTEXT */ |
|
7352 |
#ifdef GLX |
|
7353 |
SETWIN(aGLXWindowId) |
|
7354 |
scrmask(_screencoordVal(left), _screencoordVal(right), |
|
7355 |
_screencoordVal(bottom), _screencoordVal(top)); |
|
7356 |
RETURN (true); |
|
7357 |
#endif |
|
7358 |
%} |
|
7359 |
. |
|
7360 |
^ false |
|
7361 |
! |
|
7362 |
||
7363 |
glxScrnattach: gsnr in: aGLXWindowId |
|
7364 |
||
7365 |
%{ /* NOCONTEXT */ |
|
7366 |
#ifdef GLX |
|
7367 |
SETWIN(aGLXWindowId) |
|
7368 |
scrnattach(_longVal(gsnr)); |
|
7369 |
RETURN (true); |
|
7370 |
#endif |
|
7371 |
%} |
|
7372 |
. |
|
7373 |
^ false |
|
7374 |
! |
|
7375 |
||
7376 |
glxScrnselect: gsnr in: aGLXWindowId |
|
7377 |
||
7378 |
%{ /* NOCONTEXT */ |
|
7379 |
#ifdef GLX |
|
7380 |
SETWIN(aGLXWindowId) |
|
7381 |
scrnselect(_longVal(gsnr)); |
|
7382 |
RETURN (true); |
|
7383 |
#endif |
|
7384 |
%} |
|
7385 |
. |
|
7386 |
^ false |
|
7387 |
! |
|
7388 |
||
7389 |
glxSetcursorIndex: index color: color wtn: wtn in: aGLXWindowId |
|
7390 |
||
7391 |
%{ /* NOCONTEXT */ |
|
7392 |
#ifdef GLX |
|
7393 |
SETWIN(aGLXWindowId) |
|
7394 |
setcursor(_shortVal(index), _colorindexVal(color), _colorindexVal(wtn)); |
|
7395 |
RETURN (true); |
|
7396 |
#endif |
|
7397 |
%} |
|
7398 |
. |
|
7399 |
^ false |
|
7400 |
! |
|
7401 |
||
7402 |
glxSetdblightsMask: mask in: aGLXWindowId |
|
7403 |
||
7404 |
%{ /* NOCONTEXT */ |
|
7405 |
#ifdef GLX |
|
7406 |
SETWIN(aGLXWindowId) |
|
7407 |
setdblights((ulong)__intVal(mask)); |
|
7408 |
RETURN (true); |
|
7409 |
#endif |
|
7410 |
%} |
|
7411 |
. |
|
7412 |
^ false |
|
7413 |
! |
|
7414 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7415 |
glxSetdepthNear:znear far:zfar in: aGLXWindowId |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7416 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7417 |
%{ /* NOCONTEXT */ |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7418 |
#ifdef GLX |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7419 |
SETWIN(aGLXWindowId) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7420 |
setdepth(_screencoordVal(znear), _screencoordVal(zfar)); |
294 | 7421 |
RETURN (true); |
7422 |
#endif |
|
7423 |
%} |
|
7424 |
. |
|
7425 |
^ false |
|
7426 |
! |
|
7427 |
||
7428 |
glxSetmap: mapnum in: aGLXWindowId |
|
7429 |
||
7430 |
%{ /* NOCONTEXT */ |
|
7431 |
#ifdef GLX |
|
7432 |
SETWIN(aGLXWindowId) |
|
7433 |
setmap(_shortVal(mapnum)); |
|
7434 |
RETURN (true); |
|
7435 |
#endif |
|
7436 |
%} |
|
7437 |
. |
|
7438 |
^ false |
|
7439 |
! |
|
7440 |
||
7441 |
glxSetmonitor: mtype in: aGLXWindowId |
|
7442 |
||
7443 |
%{ /* NOCONTEXT */ |
|
7444 |
#ifdef GLX |
|
7445 |
SETWIN(aGLXWindowId) |
|
7446 |
setmonitor(_shortVal(mtype)); |
|
7447 |
RETURN (true); |
|
7448 |
#endif |
|
7449 |
%} |
|
7450 |
. |
|
7451 |
^ false |
|
7452 |
! |
|
7453 |
||
7454 |
glxSetnurbsproperty: property value: value in: aGLXWindowId |
|
7455 |
||
7456 |
%{ /* NOCONTEXT */ |
|
7457 |
#ifdef GLX |
|
7458 |
SETWIN(aGLXWindowId) |
|
7459 |
setnurbsproperty(_longVal(property), _floatVal(value)); |
|
7460 |
RETURN (true); |
|
7461 |
#endif |
|
7462 |
%} |
|
7463 |
. |
|
7464 |
^ false |
|
7465 |
! |
|
7466 |
||
7467 |
glxSetpattern: index in: aGLXWindowId |
|
7468 |
||
7469 |
%{ /* NOCONTEXT */ |
|
7470 |
#ifdef GLX |
|
7471 |
SETWIN(aGLXWindowId) |
|
7472 |
setpattern(_shortVal(index)); |
|
7473 |
RETURN (true); |
|
7474 |
#endif |
|
7475 |
%} |
|
7476 |
. |
|
7477 |
^ false |
|
7478 |
! |
|
7479 |
||
7480 |
glxSetpup: pup entry: entry mode: mode in: aGLXWindowId |
|
7481 |
||
7482 |
%{ /* NOCONTEXT */ |
|
7483 |
#ifdef GLX |
|
7484 |
SETWIN(aGLXWindowId) |
|
7485 |
setpup(_longVal(pup), _longVal(entry), (ulong)__intVal(mode)); |
|
7486 |
RETURN (true); |
|
7487 |
#endif |
|
7488 |
%} |
|
7489 |
. |
|
7490 |
^ false |
|
7491 |
! |
|
7492 |
||
7493 |
glxSetvaluator: v init: init vmin: vmin vmax: vmax in: aGLXWindowId |
|
7494 |
||
7495 |
%{ /* NOCONTEXT */ |
|
7496 |
#ifdef GLX |
|
7497 |
SETWIN(aGLXWindowId) |
|
7498 |
setvaluator(_deviceVal(v), _shortVal(init), _shortVal(vmin), _shortVal(vmax)); |
|
7499 |
RETURN (true); |
|
7500 |
#endif |
|
7501 |
%} |
|
7502 |
. |
|
7503 |
^ false |
|
7504 |
! |
|
7505 |
||
7506 |
glxSetvideo: reg value: value in: aGLXWindowId |
|
7507 |
||
7508 |
%{ /* NOCONTEXT */ |
|
7509 |
#ifdef GLX |
|
7510 |
SETWIN(aGLXWindowId) |
|
7511 |
setvideo(_longVal(reg), _longVal(value)); |
|
7512 |
RETURN (true); |
|
7513 |
#endif |
|
7514 |
%} |
|
7515 |
. |
|
7516 |
^ false |
|
7517 |
! |
|
7518 |
||
7519 |
glxShademodel: model in: aGLXWindowId |
|
7520 |
||
7521 |
%{ /* NOCONTEXT */ |
|
7522 |
#ifdef GLX |
|
7523 |
SETWIN(aGLXWindowId) |
|
7524 |
shademodel(_longVal(model)); |
|
7525 |
RETURN (true); |
|
7526 |
#endif |
|
7527 |
%} |
|
7528 |
. |
|
7529 |
^ false |
|
7530 |
! |
|
7531 |
||
7532 |
glxShaderangeLowin: lowin hiwin: hiwin z1: z1 z2: z2 in: aGLXWindowId |
|
7533 |
||
7534 |
%{ /* NOCONTEXT */ |
|
7535 |
#ifdef GLX |
|
7536 |
SETWIN(aGLXWindowId) |
|
7537 |
shaderange(_colorindexVal(lowin), _colorindexVal(hiwin), |
|
7538 |
_screencoordVal(z1), _screencoordVal(z2)); |
|
7539 |
RETURN (true); |
|
7540 |
#endif |
|
7541 |
%} |
|
7542 |
. |
|
7543 |
^ false |
|
7544 |
! |
|
7545 |
||
7546 |
glxSmoothline: mode in: aGLXWindowId |
|
7547 |
||
7548 |
%{ /* NOCONTEXT */ |
|
7549 |
#ifdef GLX |
|
7550 |
SETWIN(aGLXWindowId) |
|
7551 |
smoothline(_longVal(mode)); |
|
7552 |
RETURN (true); |
|
7553 |
#endif |
|
7554 |
%} |
|
7555 |
. |
|
7556 |
^ false |
|
7557 |
! |
|
7558 |
||
7559 |
glxStencilEnable: enable ref: ref func: func mask: mask fail: fail |
|
7560 |
pass: pass zpass: zpass in: aGLXWindowId |
|
7561 |
||
7562 |
%{ /* NOCONTEXT */ |
|
7563 |
#ifdef GLX |
|
7564 |
SETWIN(aGLXWindowId) |
|
7565 |
stencil(_longVal(enable), (ulong)__intVal(ref), _longVal(func), |
|
7566 |
(ulong)__intVal(mask), _longVal(fail), _longVal(pass), _longVal(zpass)); |
|
7567 |
RETURN (true); |
|
7568 |
#endif |
|
7569 |
%} |
|
7570 |
. |
|
7571 |
^ false |
|
7572 |
! |
|
7573 |
||
7574 |
glxStensize: planes in: aGLXWindowId |
|
7575 |
||
7576 |
%{ /* NOCONTEXT */ |
|
7577 |
#ifdef GLX |
|
7578 |
SETWIN(aGLXWindowId) |
|
7579 |
stensize(_longVal(planes)); |
|
7580 |
RETURN (true); |
|
7581 |
#endif |
|
7582 |
%} |
|
7583 |
. |
|
7584 |
^ false |
|
7585 |
! |
|
7586 |
||
7587 |
glxStepunitX: x y: y in: aGLXWindowId |
|
7588 |
||
7589 |
%{ /* NOCONTEXT */ |
|
7590 |
#ifdef GLX |
|
7591 |
SETWIN(aGLXWindowId) |
|
7592 |
stepunit(_longVal(x), _longVal(y)); |
|
7593 |
RETURN (true); |
|
7594 |
#endif |
|
7595 |
%} |
|
7596 |
. |
|
7597 |
^ false |
|
7598 |
! |
|
7599 |
||
7600 |
glxSubpixel: b in: aGLXWindowId |
|
7601 |
||
7602 |
%{ /* NOCONTEXT */ |
|
7603 |
#ifdef GLX |
|
7604 |
SETWIN(aGLXWindowId) |
|
7605 |
subpixel(_booleanVal(b)); |
|
7606 |
RETURN (true); |
|
7607 |
#endif |
|
7608 |
%} |
|
7609 |
. |
|
7610 |
^ false |
|
7611 |
! |
|
7612 |
||
7613 |
glxSwapinterval: i in: aGLXWindowId |
|
7614 |
||
7615 |
%{ /* NOCONTEXT */ |
|
7616 |
#ifdef GLX |
|
7617 |
SETWIN(aGLXWindowId) |
|
7618 |
swapinterval(_shortVal(i)); |
|
7619 |
RETURN (true); |
|
7620 |
#endif |
|
7621 |
%} |
|
7622 |
. |
|
7623 |
^ false |
|
7624 |
! |
|
7625 |
||
7626 |
glxSwaptmeshIn: aGLXWindowId |
|
7627 |
||
7628 |
%{ /* NOCONTEXT */ |
|
7629 |
#ifdef GLX |
|
7630 |
SETWIN(aGLXWindowId) |
|
7631 |
swaptmesh(); |
|
7632 |
RETURN (true); |
|
7633 |
#endif |
|
7634 |
%} |
|
7635 |
. |
|
7636 |
^ false |
|
7637 |
! |
|
7638 |
||
7639 |
glxSwinopen: parent in: aGLXWindowId |
|
7640 |
||
7641 |
%{ /* NOCONTEXT */ |
|
7642 |
#ifdef GLX |
|
7643 |
SETWIN(aGLXWindowId) |
|
7644 |
swinopen(_longVal(parent)); |
|
7645 |
RETURN (true); |
|
7646 |
#endif |
|
7647 |
%} |
|
7648 |
. |
|
7649 |
^ false |
|
7650 |
! |
|
7651 |
||
7652 |
glxSwritemask: mask in: aGLXWindowId |
|
7653 |
||
7654 |
%{ /* NOCONTEXT */ |
|
7655 |
#ifdef GLX |
|
7656 |
SETWIN(aGLXWindowId) |
|
7657 |
swritemask((ulong)__intVal(mask)); |
|
7658 |
RETURN (true); |
|
7659 |
#endif |
|
7660 |
%} |
|
7661 |
. |
|
7662 |
^ false |
|
7663 |
! |
|
7664 |
||
7665 |
glxTextinitIn: aGLXWindowId |
|
7666 |
||
7667 |
%{ /* NOCONTEXT */ |
|
7668 |
#ifdef GLX |
|
7669 |
SETWIN(aGLXWindowId) |
|
7670 |
textinit(); |
|
7671 |
RETURN (true); |
|
7672 |
#endif |
|
7673 |
%} |
|
7674 |
. |
|
7675 |
^ false |
|
7676 |
! |
|
7677 |
||
7678 |
glxTextportLeft: left right: right bottom: bottom top: top in: aGLXWindowId |
|
7679 |
||
7680 |
%{ /* NOCONTEXT */ |
|
7681 |
#ifdef GLX |
|
7682 |
SETWIN(aGLXWindowId) |
|
7683 |
textport(_screencoordVal(left), _screencoordVal(right), |
|
7684 |
_screencoordVal(bottom), _screencoordVal(top)); |
|
7685 |
RETURN (true); |
|
7686 |
#endif |
|
7687 |
%} |
|
7688 |
. |
|
7689 |
^ false |
|
7690 |
! |
|
7691 |
||
7692 |
glxTieB: b v1: v1 v2: v2 in: aGLXWindowId |
|
7693 |
||
7694 |
%{ /* NOCONTEXT */ |
|
7695 |
#ifdef GLX |
|
7696 |
SETWIN(aGLXWindowId) |
|
7697 |
tie(_deviceVal(b), _deviceVal(v1), _deviceVal(v2)); |
|
7698 |
RETURN (true); |
|
7699 |
#endif |
|
7700 |
%} |
|
7701 |
. |
|
7702 |
^ false |
|
7703 |
! |
|
7704 |
||
7705 |
glxTlutbind: target index: index in: aGLXWindowId |
|
7706 |
||
7707 |
%{ /* NOCONTEXT */ |
|
7708 |
#ifdef FULL_GLX |
|
7709 |
SETWIN(aGLXWindowId) |
|
7710 |
tlutbind(_longVal(target), _longVal(index)); |
|
7711 |
RETURN (true); |
|
7712 |
#endif |
|
7713 |
%} |
|
7714 |
. |
|
7715 |
^ false |
|
7716 |
! |
|
7717 |
||
7718 |
glxTpoffIn: aGLXWindowId |
|
7719 |
||
7720 |
%{ /* NOCONTEXT */ |
|
7721 |
#ifdef GLX |
|
7722 |
SETWIN(aGLXWindowId) |
|
7723 |
tpoff(); |
|
7724 |
RETURN (true); |
|
7725 |
#endif |
|
7726 |
%} |
|
7727 |
. |
|
7728 |
^ false |
|
7729 |
! |
|
7730 |
||
7731 |
glxTponIn: aGLXWindowId |
|
7732 |
||
7733 |
%{ /* NOCONTEXT */ |
|
7734 |
#ifdef GLX |
|
7735 |
SETWIN(aGLXWindowId) |
|
7736 |
tpon(); |
|
7737 |
RETURN (true); |
|
7738 |
#endif |
|
7739 |
%} |
|
7740 |
. |
|
7741 |
^ false |
|
7742 |
! |
|
7743 |
||
7744 |
glxUnqdevice: dev in: aGLXWindowId |
|
7745 |
||
7746 |
%{ /* NOCONTEXT */ |
|
1932 | 7747 |
SETWIN(aGLXWindowId) |
7748 |
#ifdef OPENGL |
|
7749 |
#else |
|
294 | 7750 |
unqdevice(_deviceVal(dev)); |
1932 | 7751 |
#endif |
7752 |
%} |
|
294 | 7753 |
! |
7754 |
||
7755 |
glxWmpack: pack in: aGLXWindowId |
|
7756 |
||
7757 |
%{ /* NOCONTEXT */ |
|
7758 |
#ifdef GLX |
|
7759 |
SETWIN(aGLXWindowId) |
|
7760 |
wmpack((ulong)__intVal(pack)); |
|
7761 |
RETURN (true); |
|
7762 |
#endif |
|
7763 |
%} |
|
7764 |
. |
|
7765 |
^ false |
|
7766 |
! |
|
7767 |
||
7768 |
glxWritemask: wtm in: aGLXWindowId |
|
7769 |
||
7770 |
%{ /* NOCONTEXT */ |
|
7771 |
#ifdef GLX |
|
7772 |
SETWIN(aGLXWindowId) |
|
7773 |
writemask(_colorindexVal(wtm)); |
|
7774 |
RETURN (true); |
|
7775 |
#endif |
|
7776 |
%} |
|
7777 |
. |
|
7778 |
^ false |
|
7779 |
! |
|
7780 |
||
7781 |
glxXfpt2X: x y: y in: aGLXWindowId |
|
7782 |
||
7783 |
%{ /* NOCONTEXT */ |
|
7784 |
#ifdef GLX |
|
7785 |
Coord c_x, c_y; |
|
7786 |
||
7787 |
_COORD_ (x, c_x) |
|
7788 |
_COORD_ (y, c_y) |
|
7789 |
SETWIN(aGLXWindowId) |
|
7790 |
xfpt2(c_x, c_y); |
|
7791 |
RETURN (true); |
|
7792 |
#endif |
|
7793 |
%} |
|
7794 |
. |
|
7795 |
^ false |
|
7796 |
! |
|
7797 |
||
7798 |
glxXfpt2iX: x y: y in: aGLXWindowId |
|
7799 |
||
7800 |
%{ /* NOCONTEXT */ |
|
7801 |
#ifdef GLX |
|
7802 |
Icoord c_x, c_y; |
|
7803 |
||
7804 |
_ICOORD_ (x, c_x) |
|
7805 |
_ICOORD_ (y, c_y) |
|
7806 |
SETWIN(aGLXWindowId) |
|
7807 |
xfpt2i(c_x, c_y); |
|
7808 |
RETURN (true); |
|
7809 |
#endif |
|
7810 |
%} |
|
7811 |
. |
|
7812 |
^ false |
|
7813 |
! |
|
7814 |
||
7815 |
glxXfpt2sX: x y: y in: aGLXWindowId |
|
7816 |
||
7817 |
%{ /* NOCONTEXT */ |
|
7818 |
#ifdef GLX |
|
7819 |
Scoord c_x, c_y; |
|
7820 |
||
7821 |
_SCOORD_ (x, c_x) |
|
7822 |
_SCOORD_ (y, c_y) |
|
7823 |
SETWIN(aGLXWindowId) |
|
7824 |
xfpt2s(c_x, c_y); |
|
7825 |
RETURN (true); |
|
7826 |
#endif |
|
7827 |
%} |
|
7828 |
. |
|
7829 |
^ false |
|
7830 |
! |
|
7831 |
||
7832 |
glxXfpt4X: x y: y z: z w: w in: aGLXWindowId |
|
7833 |
||
7834 |
%{ /* NOCONTEXT */ |
|
7835 |
#ifdef GLX |
|
7836 |
Coord c_x, c_y, c_z, c_w; |
|
7837 |
||
7838 |
_COORD_ (x, c_x) |
|
7839 |
_COORD_ (y, c_y) |
|
7840 |
_COORD_ (z, c_z) |
|
7841 |
_COORD_ (w, c_w) |
|
7842 |
SETWIN(aGLXWindowId) |
|
7843 |
xfpt4(c_x, c_y, c_z, c_w); |
|
7844 |
RETURN (true); |
|
7845 |
#endif |
|
7846 |
%} |
|
7847 |
. |
|
7848 |
^ false |
|
7849 |
! |
|
7850 |
||
7851 |
glxXfpt4iX: x y: y z: z w: w in: aGLXWindowId |
|
7852 |
||
7853 |
%{ /* NOCONTEXT */ |
|
7854 |
#ifdef GLX |
|
7855 |
Icoord c_x, c_y, c_z, c_w; |
|
7856 |
||
7857 |
_ICOORD_ (x, c_x) |
|
7858 |
_ICOORD_ (y, c_y) |
|
7859 |
_ICOORD_ (z, c_z) |
|
7860 |
_ICOORD_ (w, c_w) |
|
7861 |
SETWIN(aGLXWindowId) |
|
7862 |
xfpt4i(c_x, c_y, c_z, c_w); |
|
7863 |
RETURN (true); |
|
7864 |
#endif |
|
7865 |
%} |
|
7866 |
. |
|
7867 |
^ false |
|
7868 |
! |
|
7869 |
||
7870 |
glxXfpt4sX: x y: y z: z w: w in: aGLXWindowId |
|
7871 |
||
7872 |
%{ /* NOCONTEXT */ |
|
7873 |
#ifdef GLX |
|
7874 |
Scoord c_x, c_y, c_z, c_w; |
|
7875 |
||
7876 |
_SCOORD_ (x, c_x) |
|
7877 |
_SCOORD_ (y, c_y) |
|
7878 |
_SCOORD_ (z, c_z) |
|
7879 |
_SCOORD_ (w, c_w) |
|
7880 |
SETWIN(aGLXWindowId) |
|
7881 |
xfpt4s(c_x, c_y, c_z, c_w); |
|
7882 |
RETURN (true); |
|
7883 |
#endif |
|
7884 |
%} |
|
7885 |
. |
|
7886 |
^ false |
|
7887 |
! |
|
7888 |
||
7889 |
glxXfptX: x y: y z: z in: aGLXWindowId |
|
7890 |
||
7891 |
%{ /* NOCONTEXT */ |
|
7892 |
#ifdef GLX |
|
7893 |
Coord c_x, c_y, c_z; |
|
7894 |
||
7895 |
_COORD_ (x, c_x) |
|
7896 |
_COORD_ (y, c_y) |
|
7897 |
_COORD_ (z, c_z) |
|
7898 |
SETWIN(aGLXWindowId) |
|
7899 |
xfpt(c_x, c_y, c_z); |
|
7900 |
RETURN (true); |
|
7901 |
#endif |
|
7902 |
%} |
|
7903 |
. |
|
7904 |
^ false |
|
7905 |
! |
|
7906 |
||
7907 |
glxXfptiX: x y: y z: z in: aGLXWindowId |
|
7908 |
||
7909 |
%{ /* NOCONTEXT */ |
|
7910 |
#ifdef GLX |
|
7911 |
Icoord c_x, c_y, c_z; |
|
7912 |
||
7913 |
_ICOORD_ (x, c_x) |
|
7914 |
_ICOORD_ (y, c_y) |
|
7915 |
_ICOORD_ (z, c_z) |
|
7916 |
SETWIN(aGLXWindowId) |
|
7917 |
xfpti(c_x, c_y, c_z); |
|
7918 |
RETURN (true); |
|
7919 |
#endif |
|
7920 |
%} |
|
7921 |
. |
|
7922 |
^ false |
|
7923 |
! |
|
7924 |
||
7925 |
glxXfptsX: x y: y z: z in: aGLXWindowId |
|
7926 |
||
7927 |
%{ /* NOCONTEXT */ |
|
7928 |
#ifdef GLX |
|
7929 |
Scoord c_x, c_y, c_z; |
|
7930 |
||
7931 |
_SCOORD_ (x, c_x) |
|
7932 |
_SCOORD_ (y, c_y) |
|
7933 |
_SCOORD_ (z, c_z) |
|
7934 |
SETWIN(aGLXWindowId) |
|
7935 |
xfpts(c_x, c_y, c_z); |
|
7936 |
RETURN (true); |
|
7937 |
#endif |
|
7938 |
%} |
|
7939 |
. |
|
7940 |
^ false |
|
7941 |
! ! |
|
7942 |
||
7943 |
!GLXWorkstation methodsFor:'vertex data transfer'! |
|
7944 |
||
7945 |
glxN3f:arrayOf3Floats in:aGLXWindowId |
|
7946 |
"argument must be an array of 3 floats containing the |
|
7947 |
current vertex normal - in real GL only" |
|
7948 |
||
7949 |
%{ /* NOCONTEXT */ |
|
7950 |
#ifdef GLX |
|
7951 |
float vec[3], *v; |
|
7952 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7953 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 7954 |
SETWIN(aGLXWindowId) |
7955 |
n3f(v); |
|
7956 |
RETURN (true); |
|
7957 |
#endif |
|
7958 |
%} |
|
7959 |
. |
|
7960 |
^ false |
|
7961 |
! |
|
7962 |
||
7963 |
glxV2d:v in:aGLXWindowId |
|
7964 |
"pass a vertex; v must be a vector with 2 doubles; z is taken as 0" |
|
7965 |
||
7966 |
%{ /* NOCONTEXT */ |
|
7967 |
double vec[2], *c_v; |
|
7968 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7969 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 2))) RETURN(false); |
294 | 7970 |
SETWIN(aGLXWindowId) |
1932 | 7971 |
#ifdef OPENGL |
7972 |
#else |
|
294 | 7973 |
v2d(c_v); |
1932 | 7974 |
#endif |
294 | 7975 |
RETURN (true); |
7976 |
%} |
|
7977 |
! |
|
7978 |
||
7979 |
glxV2f:v in:aGLXWindowId |
|
7980 |
"pass a vertex; v must be a vector with 2 floats; z is taken as 0" |
|
7981 |
||
7982 |
%{ /* NOCONTEXT */ |
|
7983 |
float vec[2], *c_v; |
|
7984 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7985 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
294 | 7986 |
SETWIN(aGLXWindowId) |
1932 | 7987 |
#ifdef OPENGL |
7988 |
#else |
|
294 | 7989 |
v2f(c_v); |
1932 | 7990 |
#endif |
294 | 7991 |
RETURN (true); |
7992 |
%} |
|
7993 |
! |
|
7994 |
||
7995 |
glxV2fX:x y:y in:aGLXWindowId |
|
7996 |
"pass a vertex from individual x and y values; z is taken as 0.0" |
|
7997 |
||
7998 |
%{ /* NOCONTEXT */ |
|
7999 |
float vec[2]; |
|
8000 |
||
8001 |
_FLOAT_(x, vec[0]) |
|
8002 |
_FLOAT_(y, vec[1]) |
|
8003 |
SETWIN(aGLXWindowId) |
|
1932 | 8004 |
#ifdef OPENGL |
8005 |
#else |
|
294 | 8006 |
v2f(vec); |
1932 | 8007 |
#endif |
294 | 8008 |
RETURN (true); |
8009 |
%} |
|
8010 |
! |
|
8011 |
||
8012 |
glxV2i:v in:aGLXWindowId |
|
8013 |
"pass a vertex; v must be a vector with 2 longs; z is taken as 0" |
|
8014 |
||
8015 |
%{ /* NOCONTEXT */ |
|
8016 |
long vec[2], *c_v; |
|
8017 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8018 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 2))) RETURN(false); |
294 | 8019 |
SETWIN(aGLXWindowId) |
1932 | 8020 |
#ifdef OPENGL |
8021 |
#else |
|
294 | 8022 |
v2i(c_v); |
1932 | 8023 |
#endif |
294 | 8024 |
RETURN (true); |
8025 |
%} |
|
8026 |
! |
|
8027 |
||
8028 |
glxV2s:v in:aGLXWindowId |
|
8029 |
"pass a vertex; v must be a vector with 2 shorts; z is taken as 0" |
|
8030 |
||
8031 |
%{ /* NOCONTEXT */ |
|
8032 |
short vec[2], *c_v; |
|
8033 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8034 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 2))) RETURN(false); |
294 | 8035 |
SETWIN(aGLXWindowId) |
1932 | 8036 |
#ifdef OPENGL |
8037 |
#else |
|
294 | 8038 |
v2s(c_v); |
1932 | 8039 |
#endif |
294 | 8040 |
RETURN (true); |
8041 |
%} |
|
8042 |
! |
|
8043 |
||
8044 |
glxV3d:v in:aGLXWindowId |
|
8045 |
"pass a vertex; v must be a 3-element double-vector" |
|
8046 |
||
8047 |
%{ /* NOCONTEXT */ |
|
8048 |
double vec[3], *c_v; |
|
8049 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8050 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 3))) RETURN(false); |
294 | 8051 |
SETWIN(aGLXWindowId) |
1932 | 8052 |
#ifdef OPENGL |
8053 |
#else |
|
294 | 8054 |
v3d(c_v); |
1932 | 8055 |
#endif |
294 | 8056 |
RETURN (true); |
8057 |
%} |
|
8058 |
. |
|
8059 |
^ false |
|
8060 |
! |
|
8061 |
||
8062 |
glxV3f:v in:aGLXWindowId |
|
8063 |
"pass a vertex; v must be a 3-element float-vector" |
|
8064 |
||
8065 |
%{ /* NOCONTEXT */ |
|
8066 |
float vec[3], *c_v; |
|
8067 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8068 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
294 | 8069 |
SETWIN(aGLXWindowId) |
1932 | 8070 |
#ifdef OPENGL |
8071 |
#else |
|
294 | 8072 |
v3f(c_v); |
1932 | 8073 |
#endif |
294 | 8074 |
RETURN (true); |
8075 |
%} |
|
8076 |
! |
|
8077 |
||
8078 |
glxV3fX:x y:y z:z in: aGLXWindowId |
|
8079 |
"pass a vector from individual x, y and z (float) values" |
|
8080 |
||
8081 |
%{ /* NOCONTEXT */ |
|
8082 |
float vec[3]; |
|
8083 |
||
8084 |
_FLOAT_(x, vec[0]) |
|
8085 |
_FLOAT_(y, vec[1]) |
|
8086 |
_FLOAT_(z, vec[2]) |
|
8087 |
SETWIN(aGLXWindowId) |
|
1932 | 8088 |
#ifdef OPENGL |
8089 |
#else |
|
294 | 8090 |
v3f(vec); |
1932 | 8091 |
#endif |
294 | 8092 |
RETURN (true); |
8093 |
%} |
|
8094 |
! |
|
8095 |
||
8096 |
glxV3i:v in:aGLXWindowId |
|
8097 |
"pass a vertex; v must be a vector with 3 longs" |
|
8098 |
||
8099 |
%{ /* NOCONTEXT */ |
|
8100 |
long 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_getLongsFromInto(v, vec, 3))) RETURN(false); |
294 | 8103 |
SETWIN(aGLXWindowId) |
1932 | 8104 |
#ifdef OPENGL |
8105 |
#else |
|
294 | 8106 |
v3i(c_v); |
1932 | 8107 |
#endif |
294 | 8108 |
RETURN (true); |
8109 |
%} |
|
8110 |
! |
|
8111 |
||
8112 |
glxV3s:v in:aGLXWindowId |
|
8113 |
"pass a vertex; v must be a vector with 3 shorts" |
|
8114 |
||
8115 |
%{ /* NOCONTEXT */ |
|
8116 |
short vec[3], *c_v; |
|
8117 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8118 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
294 | 8119 |
SETWIN(aGLXWindowId) |
1932 | 8120 |
#ifdef OPENGL |
8121 |
#else |
|
294 | 8122 |
v3s(c_v); |
1932 | 8123 |
#endif |
294 | 8124 |
RETURN (true); |
8125 |
%} |
|
8126 |
! |
|
8127 |
||
8128 |
glxV4d:v in:aGLXWindowId |
|
8129 |
"pass a vertex; v must be a 4-element double-vector, |
|
8130 |
containing x, y, z and w" |
|
8131 |
||
8132 |
%{ /* NOCONTEXT */ |
|
8133 |
double vec[4], *c_v; |
|
8134 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8135 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 4))) RETURN(false); |
294 | 8136 |
SETWIN(aGLXWindowId) |
1932 | 8137 |
#ifdef OPENGL |
8138 |
#else |
|
294 | 8139 |
v4d(c_v); |
1932 | 8140 |
#endif |
294 | 8141 |
RETURN (true); |
8142 |
%} |
|
8143 |
! |
|
8144 |
||
8145 |
glxV4f:v in:aGLXWindowId |
|
8146 |
"pass a vertex; v must be a 4-element float-vector, |
|
8147 |
containing x, y, z and w" |
|
8148 |
||
8149 |
%{ /* NOCONTEXT */ |
|
8150 |
float vec[4], *c_v; |
|
8151 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8152 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
294 | 8153 |
SETWIN(aGLXWindowId) |
1932 | 8154 |
#ifdef OPENGL |
8155 |
#else |
|
294 | 8156 |
v4f(c_v); |
1932 | 8157 |
#endif |
294 | 8158 |
RETURN (true); |
8159 |
%} |
|
8160 |
! |
|
8161 |
||
8162 |
glxV4i:v in:aGLXWindowId |
|
8163 |
"pass a vertex; v must be a 4-element int-vector, |
|
8164 |
containing x, y, z and w" |
|
8165 |
||
8166 |
%{ /* NOCONTEXT */ |
|
8167 |
long vec[4], *c_v; |
|
8168 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8169 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
294 | 8170 |
SETWIN(aGLXWindowId) |
1932 | 8171 |
#ifdef OPENGL |
8172 |
#else |
|
294 | 8173 |
v4i(c_v); |
1932 | 8174 |
#endif |
294 | 8175 |
RETURN (true); |
8176 |
%} |
|
8177 |
! |
|
8178 |
||
8179 |
glxV4s:v in:aGLXWindowId |
|
8180 |
"pass a vertex; v must be a 4-element short-vector, |
|
8181 |
containing x, y, z and w" |
|
8182 |
||
8183 |
%{ /* NOCONTEXT */ |
|
8184 |
short 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_getShortsFromInto(v, vec, 4))) RETURN(false); |
294 | 8187 |
SETWIN(aGLXWindowId) |
1932 | 8188 |
#ifdef OPENGL |
8189 |
#else |
|
294 | 8190 |
v4s(c_v); |
1932 | 8191 |
#endif |
294 | 8192 |
RETURN (true); |
8193 |
%} |
|
8194 |
! |
|
8195 |
||
8196 |
glxVOriginIn:aGLXWindowId |
|
8197 |
"pass a 0.0/0.0/0.0 vector. |
|
8198 |
This is the same as v3f:#(0.0 0.0 0.0), but, since its so |
|
8199 |
common, this somewhat faster method has been provided" |
|
8200 |
||
8201 |
%{ /* NOCONTEXT */ |
|
8202 |
static float vec[3] = {0.0, 0.0, 0.0}; |
|
8203 |
||
8204 |
SETWIN(aGLXWindowId) |
|
1932 | 8205 |
#ifdef OPENGL |
8206 |
#else |
|
294 | 8207 |
v3f(vec); |
1932 | 8208 |
#endif |
294 | 8209 |
RETURN (true); |
8210 |
%} |
|
8211 |
! |
|
8212 |
||
8213 |
glxVUnitXIn:aGLXWindowId |
|
8214 |
"pass a 1.0/0.0/0.0 vector. |
|
8215 |
This is the same as v3f:#(1.0 0.0 0.0), but, since its so |
|
8216 |
common, this somewhat faster method has been provided" |
|
8217 |
||
8218 |
%{ /* NOCONTEXT */ |
|
8219 |
static float vec[3] = {1.0, 0.0, 0.0}; |
|
8220 |
||
8221 |
SETWIN(aGLXWindowId) |
|
1932 | 8222 |
#ifdef OPENGL |
8223 |
#else |
|
294 | 8224 |
v3f(vec); |
1932 | 8225 |
#endif |
294 | 8226 |
RETURN (true); |
8227 |
%} |
|
8228 |
! |
|
8229 |
||
8230 |
glxVUnitYIn:aGLXWindowId |
|
8231 |
"pass a 0.0/1.0/0.0 vector. |
|
8232 |
This is the same as v3f:#(0.0 1.0 0.0), but, since its so |
|
8233 |
common, this somewhat faster method has been provided" |
|
8234 |
||
8235 |
%{ /* NOCONTEXT */ |
|
8236 |
static float vec[3] = {0.0, 1.0, 0.0}; |
|
8237 |
||
8238 |
SETWIN(aGLXWindowId) |
|
1932 | 8239 |
#ifdef OPENGL |
8240 |
#else |
|
294 | 8241 |
v3f(vec); |
1932 | 8242 |
#endif |
294 | 8243 |
RETURN (true); |
8244 |
%} |
|
8245 |
! |
|
8246 |
||
8247 |
glxVUnitZIn:aGLXWindowId |
|
8248 |
"pass a 0.0/0.0/1.0 vector. |
|
8249 |
This is the same as v3f:#(0.0 0.0 1.0), but, since its so |
|
8250 |
common, this somewhat faster method has been provided" |
|
8251 |
||
8252 |
%{ /* NOCONTEXT */ |
|
8253 |
static float vec[3] = {0.0, 0.0, 1.0}; |
|
8254 |
||
8255 |
SETWIN(aGLXWindowId) |
|
1932 | 8256 |
#ifdef OPENGL |
8257 |
#else |
|
294 | 8258 |
v3f(vec); |
1932 | 8259 |
#endif |
294 | 8260 |
RETURN (true); |
8261 |
%} |
|
8262 |
! ! |
|
8263 |
||
8264 |
!GLXWorkstation methodsFor:'video and planes'! |
|
8265 |
||
8266 |
glxOverlayPlanes: planes in: aGLXWindowId |
|
8267 |
||
8268 |
%{ /* NOCONTEXT */ |
|
8269 |
#ifdef GLX |
|
8270 |
SETWIN(aGLXWindowId) |
|
8271 |
overlay(_longVal(planes)); |
|
8272 |
RETURN (true); |
|
8273 |
#endif |
|
8274 |
%} |
|
8275 |
. |
|
8276 |
^ false |
|
8277 |
! |
|
8278 |
||
8279 |
glxStereobufferIn: aGLXWindowId |
|
8280 |
||
8281 |
%{ /* NOCONTEXT */ |
|
8282 |
#ifdef FULL_GLX |
|
8283 |
SETWIN(aGLXWindowId) |
|
8284 |
stereobuffer(); |
|
8285 |
RETURN (true); |
|
8286 |
#endif |
|
8287 |
%} |
|
8288 |
. |
|
8289 |
^ false |
|
8290 |
! |
|
8291 |
||
8292 |
glxUnderlay: planes in: aGLXWindowId |
|
8293 |
||
8294 |
%{ /* NOCONTEXT */ |
|
8295 |
#ifdef GLX |
|
8296 |
SETWIN(aGLXWindowId) |
|
8297 |
underlay(_longVal(planes)); |
|
8298 |
RETURN (true); |
|
8299 |
#endif |
|
8300 |
%} |
|
8301 |
. |
|
8302 |
^ false |
|
8303 |
! |
|
8304 |
||
8305 |
glxVideocmd:cmd in:aGLXWindowId |
|
8306 |
||
8307 |
%{ /* NOCONTEXT */ |
|
8308 |
#ifdef GLX |
|
8309 |
SETWIN(aGLXWindowId) |
|
8310 |
videocmd(_longVal(cmd)); |
|
8311 |
RETURN (true); |
|
8312 |
#endif |
|
8313 |
%} |
|
8314 |
. |
|
8315 |
^ false |
|
8316 |
! ! |
|
8317 |
||
8318 |
!GLXWorkstation methodsFor:'viewing'! |
|
8319 |
||
8320 |
glxLookatVx:vx vy:vy vz:vz px:px py:py pz:pz twist:twist in:aGLXWindowId |
|
8321 |
"define viewing transformation" |
|
8322 |
||
8323 |
%{ /* NOCONTEXT */ |
|
8324 |
||
8325 |
Coord f_vx, f_vy, f_vz, f_px, f_py, f_pz; |
|
8326 |
Angle a_twist; |
|
8327 |
||
8328 |
_COORD_ (vx, f_vx) |
|
8329 |
_COORD_ (vy, f_vy) |
|
8330 |
_COORD_ (vz, f_vz) |
|
8331 |
_COORD_ (px, f_px) |
|
8332 |
_COORD_ (py, f_py) |
|
8333 |
_COORD_ (pz, f_pz) |
|
8334 |
_ANGLE_ (twist, a_twist) |
|
8335 |
SETWIN(aGLXWindowId) |
|
1932 | 8336 |
#ifdef OPENGL |
8337 |
#else |
|
294 | 8338 |
lookat(f_vx, f_vy, f_vz, f_px, f_py, f_pz, a_twist); |
1932 | 8339 |
#endif |
294 | 8340 |
%} |
8341 |
! |
|
8342 |
||
8343 |
glxOrtho2Left: left right: right bottom: bottom top: top in: aGLXWindowId |
|
8344 |
"define 2D orthogonal projection" |
|
8345 |
||
8346 |
%{ /* NOCONTEXT */ |
|
8347 |
float f_left, f_right, f_top, f_bottom; |
|
8348 |
||
8349 |
SETWIN(aGLXWindowId) |
|
8350 |
_FLOAT_(left, f_left) |
|
8351 |
_FLOAT_(right, f_right) |
|
8352 |
_FLOAT_(bottom, f_bottom) |
|
8353 |
_FLOAT_(top, f_top) |
|
1932 | 8354 |
#ifdef OPENGL |
8355 |
#else |
|
294 | 8356 |
ortho2(f_left, f_right, f_bottom, f_top); |
1932 | 8357 |
#endif |
8358 |
%} |
|
294 | 8359 |
! |
8360 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8361 |
glxOrthoLeft: left right: right bottom: bottom top: top near: znear far: zfar in: aGLXWindowId |
294 | 8362 |
"define orthogonal projection" |
8363 |
||
8364 |
%{ /* NOCONTEXT */ |
|
8365 |
float f_left, f_right, f_bottom, f_top, |
|
8366 |
f_near, f_far; |
|
8367 |
||
8368 |
_FLOAT_(left, f_left) |
|
8369 |
_FLOAT_(right, f_right) |
|
8370 |
_FLOAT_(bottom, f_bottom) |
|
8371 |
_FLOAT_(top, f_top) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8372 |
_FLOAT_(znear, f_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8373 |
_FLOAT_(zfar, f_far) |
294 | 8374 |
SETWIN(aGLXWindowId) |
1932 | 8375 |
#ifdef OPENGL |
8376 |
#else |
|
294 | 8377 |
ortho(f_left, f_right, f_bottom, f_top, f_near, f_far); |
1932 | 8378 |
#endif |
294 | 8379 |
%} |
8380 |
! |
|
8381 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8382 |
glxPerspectiveFovy:fovy aspect:aspect near:znear far:zfar in:aGLXWindowId |
294 | 8383 |
"define perspective projection" |
8384 |
||
8385 |
%{ /* NOCONTEXT */ |
|
8386 |
||
8387 |
Angle a_fovy; |
|
8388 |
Coord c_near, c_far; |
|
8389 |
float f_aspect; |
|
8390 |
||
8391 |
_ANGLE_ (fovy, a_fovy) |
|
8392 |
_FLOAT_ (aspect, f_aspect) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8393 |
_COORD_ (znear, c_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8394 |
_COORD_ (zfar, c_far) |
294 | 8395 |
|
8396 |
SETWIN(aGLXWindowId) |
|
1932 | 8397 |
#ifdef OPENGL |
8398 |
#else |
|
294 | 8399 |
perspective(a_fovy, f_aspect, c_near, c_far); |
1932 | 8400 |
#endif |
294 | 8401 |
%} |
8402 |
! |
|
8403 |
||
8404 |
glxPolarviewDist: dist azim: azim inc: inc twist: twist in: aGLXWindowId |
|
8405 |
||
8406 |
%{ /* NOCONTEXT */ |
|
8407 |
Coord c_dist; |
|
8408 |
Angle a_azim, a_inc, a_twist; |
|
8409 |
||
8410 |
_COORD_(dist, c_dist) |
|
8411 |
_ANGLE_(azim, a_azim) |
|
8412 |
_ANGLE_(inc, a_inc) |
|
8413 |
_ANGLE_(twist, a_twist) |
|
8414 |
SETWIN(aGLXWindowId) |
|
1932 | 8415 |
#ifdef OPENGL |
8416 |
#else |
|
294 | 8417 |
polarview(c_dist, a_azim, a_inc, a_twist); |
1932 | 8418 |
#endif |
294 | 8419 |
%} |
8420 |
! |
|
8421 |
||
528 | 8422 |
glxPopviewportIn: aGLXWindowId |
8423 |
"pops the top viewport off the viewport stack" |
|
8424 |
||
8425 |
%{ /* NOCONTEXT */ |
|
8426 |
SETWIN(aGLXWindowId) |
|
1932 | 8427 |
#ifdef OPENGL |
8428 |
#else |
|
528 | 8429 |
popviewport(); |
1932 | 8430 |
#endif |
528 | 8431 |
%} |
8432 |
||
8433 |
"Modified: 19.3.1996 / 18:58:24 / cg" |
|
8434 |
! |
|
8435 |
||
8436 |
glxPushviewportIn: aGLXWindowId |
|
8437 |
"pushes the current viewport on the viewport stack" |
|
8438 |
||
8439 |
%{ /* NOCONTEXT */ |
|
8440 |
SETWIN(aGLXWindowId) |
|
1932 | 8441 |
#ifdef OPENGL |
8442 |
#else |
|
528 | 8443 |
pushviewport(); |
1932 | 8444 |
#endif |
528 | 8445 |
%} |
8446 |
||
8447 |
"Modified: 19.3.1996 / 18:58:02 / cg" |
|
8448 |
! |
|
8449 |
||
294 | 8450 |
glxReshapeViewPortIn: aGLXWindowId |
8451 |
||
8452 |
%{ /* NOCONTEXT */ |
|
8453 |
SETWIN(aGLXWindowId) |
|
1932 | 8454 |
#ifdef OPENGL |
8455 |
#else |
|
294 | 8456 |
reshapeviewport(); |
1932 | 8457 |
#endif |
8458 |
%} |
|
294 | 8459 |
! |
8460 |
||
8461 |
glxViewportLeft:left right:right bottom:bottom top:top in:aGLXWindowId |
|
8462 |
||
8463 |
%{ /* NOCONTEXT */ |
|
8464 |
SETWIN(aGLXWindowId) |
|
1932 | 8465 |
#ifdef OPENGL |
8466 |
#else |
|
294 | 8467 |
viewport(_screencoordVal(left), _screencoordVal(right), |
8468 |
_screencoordVal(bottom), _screencoordVal(top)); |
|
1932 | 8469 |
#endif |
294 | 8470 |
%} |
8471 |
! |
|
8472 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8473 |
glxWindowLeft: left right: right bottom: bottom top: top near: znear far: zfar in: aGLXWindowId |
294 | 8474 |
"this one was added independently by JEFF - kept for his programs ..." |
8475 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8476 |
self glxWindowLeft:left right:right top:top bottom:bottom near:znear far:zfar in:aGLXWindowId |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8477 |
! |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8478 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8479 |
glxWindowLeft:left right:right top:top bottom:bottom near:znear far:zfar in:aGLXWindowId |
294 | 8480 |
"define perspective viewing pyramid" |
8481 |
||
8482 |
%{ /* NOCONTEXT */ |
|
8483 |
Coord c_left, c_right, c_top, c_bot, c_near, c_far; |
|
8484 |
||
8485 |
_COORD_ (left, c_left) |
|
8486 |
_COORD_ (right, c_right) |
|
8487 |
_COORD_ (top, c_top) |
|
8488 |
_COORD_ (bottom, c_bot) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8489 |
_COORD_ (znear, c_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8490 |
_COORD_ (zfar, c_far) |
294 | 8491 |
SETWIN(aGLXWindowId) |
1932 | 8492 |
#ifdef OPENGL |
8493 |
#else |
|
294 | 8494 |
window(c_left, c_right, c_bot, c_top, c_near, c_far); |
1932 | 8495 |
#endif |
294 | 8496 |
%} |
8497 |
! ! |
|
8498 |
||
8499 |
!GLXWorkstation methodsFor:'window control'! |
|
8500 |
||
2045 | 8501 |
glxResizedView:aGLXWindowId width:width height:height |
2048 | 8502 |
"pass down resize info to the GL - this adjusts the viewport. |
8503 |
This only works with VGL or openGL" |
|
8504 |
||
8505 |
%{ /* NOCONTEXT */ |
|
2074 | 8506 |
SETWIN(aGLXWindowId) |
8507 |
#ifdef VGL |
|
2045 | 8508 |
X11_resized(__intVal(width), __intVal(height)); |
8509 |
RETURN (true); |
|
8510 |
#endif |
|
8511 |
%} |
|
8512 |
. |
|
8513 |
^ false |
|
8514 |
! |
|
8515 |
||
294 | 8516 |
glxWinclose:gwid in:aGLXWindowId |
8517 |
||
8518 |
%{ /* NOCONTEXT */ |
|
8519 |
#ifdef GLX |
|
8520 |
SETWIN(aGLXWindowId) |
|
8521 |
winclose(_longVal(gwid)); |
|
8522 |
RETURN (true); |
|
8523 |
#endif |
|
8524 |
%} |
|
8525 |
. |
|
8526 |
^ false |
|
8527 |
! |
|
8528 |
||
8529 |
glxWinconstraintsIn: aGLXWindowId |
|
8530 |
||
8531 |
%{ /* NOCONTEXT */ |
|
8532 |
#ifdef GLX |
|
8533 |
SETWIN(aGLXWindowId) |
|
8534 |
winconstraints(); |
|
8535 |
RETURN (true); |
|
8536 |
#endif |
|
8537 |
%} |
|
8538 |
. |
|
8539 |
^ false |
|
8540 |
! |
|
8541 |
||
8542 |
glxWindepth: gwid in: aGLXWindowId |
|
8543 |
||
8544 |
%{ /* NOCONTEXT */ |
|
8545 |
#ifdef GLX |
|
8546 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
8547 |
RETURN (__MKSMALLINT(windepth(_longVal(gwid)))); |
294 | 8548 |
#endif |
8549 |
%} |
|
8550 |
. |
|
8551 |
^ false |
|
8552 |
! |
|
8553 |
||
8554 |
glxWingetIn: aGLXWindowId |
|
8555 |
||
8556 |
%{ /* NOCONTEXT */ |
|
8557 |
#ifdef GLX |
|
8558 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
8559 |
RETURN (__MKSMALLINT(winget())); |
294 | 8560 |
#endif |
8561 |
%} |
|
8562 |
. |
|
8563 |
^ false |
|
8564 |
! |
|
8565 |
||
8566 |
glxWinmoveX: x y: y in: aGLXWindowId |
|
8567 |
||
8568 |
%{ /* NOCONTEXT */ |
|
8569 |
#ifdef GLX |
|
8570 |
SETWIN(aGLXWindowId) |
|
8571 |
winmove(_longVal(x), _longVal(y)); |
|
8572 |
RETURN (true); |
|
8573 |
#endif |
|
8574 |
%} |
|
8575 |
. |
|
8576 |
^ false |
|
8577 |
! |
|
8578 |
||
8579 |
glxWinpopIn: aGLXWindowId |
|
8580 |
||
8581 |
%{ /* NOCONTEXT */ |
|
8582 |
#ifdef GLX |
|
8583 |
SETWIN(aGLXWindowId) |
|
8584 |
winpop(); |
|
8585 |
RETURN (true); |
|
8586 |
#endif |
|
8587 |
%} |
|
8588 |
. |
|
8589 |
^ false |
|
8590 |
! |
|
8591 |
||
8592 |
glxWinpositionX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
8593 |
||
8594 |
%{ /* NOCONTEXT */ |
|
8595 |
#ifdef GLX |
|
8596 |
SETWIN(aGLXWindowId) |
|
8597 |
winposition(_longVal(x1), _longVal(y1), _longVal(x2), _longVal(y2)); |
|
8598 |
RETURN (true); |
|
8599 |
#endif |
|
8600 |
%} |
|
8601 |
. |
|
8602 |
^ false |
|
8603 |
! |
|
8604 |
||
8605 |
glxWinpushIn: aGLXWindowId |
|
8606 |
||
8607 |
%{ /* NOCONTEXT */ |
|
8608 |
#ifdef GLX |
|
8609 |
SETWIN(aGLXWindowId) |
|
8610 |
winpush(); |
|
8611 |
RETURN (true); |
|
8612 |
#endif |
|
8613 |
%} |
|
8614 |
. |
|
8615 |
^ false |
|
8616 |
! |
|
8617 |
||
8618 |
glxWinset: gwid in: aGLXWindowId |
|
8619 |
||
8620 |
%{ /* NOCONTEXT */ |
|
8621 |
#ifdef GLX |
|
8622 |
SETWIN(aGLXWindowId) |
|
8623 |
winset(_longVal(gwid)); |
|
8624 |
RETURN (true); |
|
8625 |
#endif |
|
8626 |
%} |
|
8627 |
. |
|
8628 |
^ false |
|
8629 |
! ! |
|
8630 |
||
0 | 8631 |
!GLXWorkstation methodsFor:'window creation'! |
8632 |
||
12 | 8633 |
createGLXWindowFor:aView left:xpos top:ypos width:wwidth height:wheight type:glxType |
157 | 8634 |
|ext wsuperView wsuperViewId windowId| |
0 | 8635 |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
8636 |
glOK ifFalse:[^ nil]. |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
8637 |
|
793 | 8638 |
wsuperView := aView superView view. |
0 | 8639 |
wsuperView notNil ifTrue:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8640 |
wsuperViewId := wsuperView id |
0 | 8641 |
]. |
8642 |
||
524 | 8643 |
%{ /* CALLSSTACK: 20000 */ |
0 | 8644 |
Display *dpy = myDpy; |
185 | 8645 |
int screen = __intVal(_INST(screen)); |
0 | 8646 |
Window newWindow, parentWindow; |
12 | 8647 |
int t; |
0 | 8648 |
|
97 | 8649 |
if (__isSmallInteger(xpos) && __isSmallInteger(ypos) |
8650 |
&& __isSmallInteger(wwidth) && __isSmallInteger(wheight)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8651 |
if (__isExternalAddress(wsuperViewId)) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8652 |
parentWindow = _WindowVal(wsuperViewId); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8653 |
} else { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8654 |
parentWindow = RootWindow(dpy, screen); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8655 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8656 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8657 |
if (glxType == @symbol(colorIndexSingleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8658 |
t = GLXcolorIndexSingleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8659 |
else if (glxType == @symbol(colorIndexDoubleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8660 |
t = GLXcolorIndexDoubleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8661 |
else if (glxType == @symbol(rgbSingleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8662 |
t = GLXrgbSingleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8663 |
else if (glxType == @symbol(rgbDoubleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8664 |
t = GLXrgbDoubleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8665 |
else { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8666 |
RETURN ( nil ); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8667 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8668 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8669 |
ENTERGLX; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8670 |
newWindow = __GLXCreateWindow(dpy, parentWindow, |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8671 |
__intVal(xpos), __intVal(ypos), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8672 |
__intVal(wwidth), __intVal(wheight), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8673 |
0, t); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8674 |
LEAVEGLX; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8675 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8676 |
if (! newWindow) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8677 |
RETURN ( nil ); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8678 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8679 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8680 |
windowId = __MKOBJ(newWindow); |
0 | 8681 |
} |
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
8682 |
%}. |
0 | 8683 |
windowId notNil ifTrue:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8684 |
self addKnownView:aView withId:windowId. |
0 | 8685 |
]. |
8686 |
^ windowId |
|
20 | 8687 |
! |
8688 |
||
8689 |
unlinkGLXView:aGLXWindowId |
|
8690 |
"remove X/GLX link" |
|
524 | 8691 |
|
8692 |
%{ /* CALLSSTACK: 20000 */ |
|
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
8693 |
if (__isExternalAddress(aGLXWindowId)) { |
134 | 8694 |
ENTERGLX; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8695 |
__GLXUnlinkWindow(myDpy, _WindowVal(aGLXWindowId)); |
134 | 8696 |
LEAVEGLX; |
8697 |
} |
|
20 | 8698 |
%} |
0 | 8699 |
! ! |
8700 |
||
294 | 8701 |
!GLXWorkstation methodsFor:'zbuffer'! |
8702 |
||
8703 |
glxZbsize: planes in: aGLXWindowId |
|
127 | 8704 |
|
8705 |
%{ /* NOCONTEXT */ |
|
8706 |
#ifdef FULL_GLX |
|
8707 |
SETWIN(aGLXWindowId) |
|
294 | 8708 |
zbsize(_longVal(planes)); |
8709 |
RETURN (true); |
|
8710 |
#endif |
|
8711 |
%} |
|
8712 |
. |
|
8713 |
^ false |
|
8714 |
! |
|
64 | 8715 |
|
8716 |
glxZbuffer:aBoolean in:aGLXWindowId |
|
8717 |
"enable/disable z-buffer operation" |
|
8718 |
||
8719 |
%{ /* NOCONTEXT */ |
|
8720 |
#ifdef GLX |
|
8721 |
SETWIN(aGLXWindowId) |
|
8722 |
zbuffer(aBoolean == false ? FALSE : TRUE); |
|
8723 |
RETURN (true); |
|
8724 |
#endif |
|
8725 |
%} |
|
8726 |
. |
|
8727 |
^ false |
|
294 | 8728 |
! |
64 | 8729 |
|
8730 |
glxZdraw: b in: aGLXWindowId |
|
8731 |
"enable/disable drawing into the z-buffer" |
|
8732 |
||
8733 |
%{ /* NOCONTEXT */ |
|
8734 |
#ifdef GLX |
|
8735 |
SETWIN(aGLXWindowId) |
|
8736 |
zdraw(_booleanVal(b)); |
|
8737 |
RETURN (true); |
|
8738 |
#endif |
|
8739 |
%} |
|
8740 |
. |
|
8741 |
^ false |
|
294 | 8742 |
! |
64 | 8743 |
|
8744 |
glxZfunction: func in: aGLXWindowId |
|
8745 |
"set the z-buffer comparison function. |
|
8746 |
func may be either the numeric value or a symbol (preferred)" |
|
8747 |
||
8748 |
%{ /* NOCONTEXT */ |
|
8749 |
#ifdef GLX |
|
8750 |
long f; |
|
8751 |
||
8752 |
SETWIN(aGLXWindowId) |
|
8753 |
if (func == @symbol(NEVER)) |
|
77 | 8754 |
f = ZF_NEVER; |
64 | 8755 |
else if (func == @symbol(LESS)) |
77 | 8756 |
f = ZF_LESS; |
64 | 8757 |
else if (func == @symbol(EQUAL)) |
77 | 8758 |
f = ZF_EQUAL; |
64 | 8759 |
else if (func == @symbol(LEQUAL)) |
77 | 8760 |
f = ZF_LEQUAL; |
64 | 8761 |
else if (func == @symbol(GREATER)) |
77 | 8762 |
f = ZF_GREATER; |
64 | 8763 |
else if (func == @symbol(NOTEQUAL)) |
77 | 8764 |
f = ZF_NOTEQUAL; |
64 | 8765 |
else if (func == @symbol(GEQUAL)) |
77 | 8766 |
f = ZF_GEQUAL; |
64 | 8767 |
else if (func == @symbol(ALWAYS)) |
77 | 8768 |
f = ZF_ALWAYS; |
64 | 8769 |
else |
77 | 8770 |
f = _longVal(func); |
64 | 8771 |
zfunction(f); |
8772 |
RETURN (true); |
|
8773 |
#endif |
|
8774 |
%} |
|
8775 |
. |
|
8776 |
^ false |
|
294 | 8777 |
! |
64 | 8778 |
|
8779 |
glxZsource: src in: aGLXWindowId |
|
8780 |
||
8781 |
%{ /* NOCONTEXT */ |
|
8782 |
#ifdef GLX |
|
8783 |
SETWIN(aGLXWindowId) |
|
8784 |
zsource(_longVal(src)); |
|
8785 |
RETURN (true); |
|
8786 |
#endif |
|
8787 |
%} |
|
8788 |
. |
|
8789 |
^ false |
|
294 | 8790 |
! |
64 | 8791 |
|
8792 |
glxZwritemask: mask in: aGLXWindowId |
|
8793 |
||
8794 |
%{ /* NOCONTEXT */ |
|
8795 |
#ifdef GLX |
|
8796 |
SETWIN(aGLXWindowId) |
|
185 | 8797 |
zwritemask((ulong)__intVal(mask)); |
64 | 8798 |
RETURN (true); |
8799 |
#endif |
|
8800 |
%} |
|
8801 |
. |
|
8802 |
^ false |
|
8803 |
! ! |
|
8804 |
||
294 | 8805 |
!GLXWorkstation class methodsFor:'documentation'! |
8806 |
||
8807 |
version |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8808 |
^ '$Header: /cvs/stx/stx/libview/GLXWorkstation.st,v 1.73 1999-01-15 21:33:19 cg Exp $' |
89 | 8809 |
! ! |