author | Claus Gittinger <cg@exept.de> |
Thu, 09 Jan 2020 12:19:29 +0100 | |
changeset 8960 | d6383fb34194 |
parent 8817 | 9f9c8e943648 |
permissions | -rw-r--r-- |
8344 | 1 |
"{ Encoding: utf8 }" |
2 |
||
0 | 3 |
" |
614 | 4 |
COPYRIGHT (c) 1993 by Claus Gittinger |
77 | 5 |
All Rights Reserved |
0 | 6 |
|
7 |
This software is furnished under a license and may be used |
|
8 |
only in accordance with the terms of that license and with the |
|
9 |
inclusion of the above copyright notice. This software may not |
|
10 |
be provided or otherwise made available to, or used by, any |
|
11 |
other person. No title to or ownership of the software is |
|
12 |
hereby transferred. |
|
13 |
" |
|
3214 | 14 |
"{ Package: 'stx:libview' }" |
15 |
||
7656 | 16 |
"{ NameSpace: Smalltalk }" |
17 |
||
0 | 18 |
XWorkstation subclass:#GLXWorkstation |
528 | 19 |
instanceVariableNames:'activeWindow hasStereoExtension glOK' |
20 |
classVariableNames:'ForceGL' |
|
21 |
poolDictionaries:'' |
|
22 |
category:'Interface-Graphics' |
|
294 | 23 |
! |
77 | 24 |
|
89 | 25 |
!GLXWorkstation primitiveDefinitions! |
0 | 26 |
%{ |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
27 |
#include "stxOSDefs.h" |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
28 |
|
24 | 29 |
/* |
30 |
* on SGI, this class is compiled with -DGLX, while |
|
29 | 31 |
* for simulation (using vogl), this is compiled with -DVGL |
4718 | 32 |
* |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
33 |
* New note: starting to support openGL (tm) (compile with -DOPENGL) |
1932 | 34 |
* or its simulation (compile with -DMESA) |
24 | 35 |
*/ |
29 | 36 |
|
0 | 37 |
/* |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
38 |
* SAD, SAD: |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
39 |
* 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
|
40 |
* some include the functions below, others dont. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
41 |
* To avoid getting undefined symbol errors when linking, these |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
42 |
* functions are not included by default. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
43 |
* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
44 |
* 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
|
45 |
* the following: |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
46 |
* |
46 | 47 |
* blendcolor getgconfig getmultisample leftbuffer rightbuffer monobuffer |
48 |
* msalpha msmask mspattern mssize multisample stereobuffer |
|
49 |
* t3s t3i t3f t3d t4s t4i t4f t4d tlutbind zbsize |
|
50 |
* |
|
51 |
* these are not available on all gl's |
|
52 |
*/ |
|
53 |
||
1932 | 54 |
#ifdef GLX |
46 | 55 |
/* #define FULL_GLX */ |
1932 | 56 |
#endif |
46 | 57 |
|
58 |
/* |
|
554
34cc776bcc0f
compilable with String/Object definition
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
59 |
* 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
|
60 |
* ... and xlib defines True and False |
554
34cc776bcc0f
compilable with String/Object definition
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
61 |
* It might be a better idea, to completely separate GLX stuff from ST/X |
0 | 62 |
*/ |
1899 | 63 |
#ifdef String |
64 |
# undef String |
|
65 |
#endif |
|
66 |
#define String GLX_String |
|
67 |
||
68 |
#ifdef Object |
|
69 |
# undef Object |
|
70 |
#endif |
|
71 |
#define Object GLX_Object |
|
72 |
||
73 |
#undef True |
|
74 |
#undef False |
|
75 |
||
2768 | 76 |
#ifdef Time |
77 |
# undef Time |
|
78 |
#endif |
|
79 |
#define Time X_Time |
|
80 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
81 |
|
1899 | 82 |
#ifdef __VMS__ |
83 |
# include "vms_Xnames.h" |
|
84 |
#endif |
|
24 | 85 |
|
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
86 |
#ifdef __arm__ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
87 |
// # define _POSIX_C_SOURCE |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
88 |
#endif |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
89 |
|
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
90 |
#ifndef _STDIO_H_INCLUDED_ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
91 |
# include <stdio.h> |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
92 |
# define _STDIO_H_INCLUDED_ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
93 |
#endif |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
94 |
|
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
95 |
#ifdef __arm__ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
96 |
# ifndef _SYS_TYPES_H_INCLUDED_ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
97 |
# include <sys/types.h> |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
98 |
# define _SYS_TYPES_H_INCLUDED_ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
99 |
# endif |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
100 |
# ifndef _SYS_SIGNAL_H_INCLUDED_ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
101 |
# include <sys/signal.h> |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
102 |
# define _SYS_SIGNAL_H_INCLUDED_ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
103 |
# endif |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
104 |
|
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
105 |
#endif |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
106 |
|
6254 | 107 |
#ifdef __osx__ |
108 |
# include <sys/signal.h> |
|
109 |
# define DYNAMICALLY_LOADABLE |
|
110 |
#endif |
|
168 | 111 |
|
1932 | 112 |
#ifndef OPENGL |
113 |
# ifdef MESA |
|
114 |
# define OPENGL |
|
115 |
# endif |
|
116 |
#endif |
|
117 |
||
6978 | 118 |
#ifdef OPENGL /* SGI or other's OPENGL library */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
119 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
120 |
# include "GL/gl.h" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
121 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
122 |
# ifdef MESA /* GNU MESA openGL simulation */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
123 |
# include "GL/xmesa.h" |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
124 |
# define OPENGLCONTEXT XMesaContext |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
125 |
# define GLXMAKECURRENT(dpy, draw, con) XMesaMakeCurrent(con) |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
126 |
# else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
127 |
/* 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
|
128 |
# define OPENGLCONTEXT GLXContext |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
129 |
# 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
|
130 |
# endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
131 |
|
24 | 132 |
#else |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
133 |
|
6978 | 134 |
# ifdef GLX /* SGI's native GL library */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
135 |
# include <gl/glws.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
136 |
# include <gl/sphere.h> |
6978 | 137 |
# else /* VOGL GL subset simulation */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
138 |
# undef memset |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
139 |
# include <vogl.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
140 |
# undef move |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
141 |
# include <X11/Xlib.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
142 |
# endif |
24 | 143 |
#endif |
0 | 144 |
|
185 | 145 |
/* |
146 |
* XSGIStereo extension - if available |
|
147 |
*/ |
|
148 |
#ifdef XSGIStereo |
|
149 |
# include <X11/extensions/SGIStereo.h> |
|
150 |
#endif |
|
151 |
||
35 | 152 |
#ifndef NULL |
58 | 153 |
# define NULL (char *)0 /* sigh */ |
35 | 154 |
#endif |
155 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
156 |
|
0 | 157 |
typedef enum { |
158 |
GLXcolorIndexSingleBuffer, |
|
159 |
GLXcolorIndexDoubleBuffer, |
|
160 |
GLXrgbSingleBuffer, |
|
161 |
GLXrgbDoubleBuffer |
|
162 |
} GLXWindowType; |
|
163 |
||
333 | 164 |
# define ENTERGLX __BEGIN_PROTECT_REGISTERS__ |
165 |
# define LEAVEGLX __END_PROTECT_REGISTERS__ |
|
134 | 166 |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
167 |
/* |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
168 |
* 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
|
169 |
*/ |
0 | 170 |
#undef String |
969 | 171 |
#ifdef __DEF_String |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
172 |
# define String __DEF_String |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
173 |
#endif |
969 | 174 |
#undef Object |
175 |
#ifdef __DEF_Object |
|
176 |
# define Object __DEF_Object |
|
177 |
#endif |
|
0 | 178 |
|
179 |
/* |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
180 |
* mhmh - openGL has its separate gl-context, |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
181 |
* which is distinct (?) from the windowID. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
182 |
* We dont want to add another instvar to View - do we ? |
0 | 183 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
184 |
#if defined(OPENGL) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
185 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
186 |
# ifndef MAX_OPENGL_VIEWS |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
187 |
# define MAX_OPENGL_VIEWS 50 |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
188 |
# endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
189 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
190 |
struct windowIDToGLContextMapping { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
191 |
Window win; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
192 |
OPENGLCONTEXT con; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
193 |
}; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
194 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
195 |
static struct windowIDToGLContextMapping windowIDToGLContextMapping[MAX_OPENGL_VIEWS]; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
196 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
197 |
static OPENGLCONTEXT |
4718 | 198 |
__glxWindowIdToGLContext(xId) |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
199 |
Window xId; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
200 |
{ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
201 |
int i; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
202 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
203 |
for (i=0; i<MAX_OPENGL_VIEWS; i++) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
204 |
if (windowIDToGLContextMapping[i].win == xId) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
205 |
return windowIDToGLContextMapping[i].con; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
206 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
207 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
208 |
return (OPENGLCONTEXT) 0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
209 |
} |
0 | 210 |
|
157 | 211 |
/* |
212 |
* set the GLXWindow for followup drawing |
|
213 |
*/ |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
214 |
#define SETWIN(aGLXWindowId) \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
215 |
{ \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
216 |
OPENGLCONTEXT context; \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
217 |
\ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
218 |
if (_INST(activeWindow) != aGLXWindowId) { \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
219 |
if (! ISCONNECTED ) { \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
220 |
RETURN (false); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
221 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
222 |
if (! __isExternalAddress(aGLXWindowId)) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
223 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
224 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
225 |
context = (OPENGLCONTEXT) __glxWindowIdToGLContext(_WindowVal(aGLXWindowId)); \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
226 |
if (! context) { \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
227 |
RETURN (false); \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
228 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
229 |
GLXMAKECURRENT(myDpy, _WindowVal(aGLXWindowId), context ); \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
230 |
_INST(activeWindow) = aGLXWindowId; \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
231 |
__STORE(self, aGLXWindowId); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
232 |
} else { \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
233 |
if (aGLXWindowId == nil) { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
234 |
RETURN (false); \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
235 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
236 |
} \ |
12 | 237 |
} |
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 |
#else /* old GL */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
241 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
242 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
243 |
* set the GLXWindow for followup drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
244 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
245 |
#define SETWIN(aGLXWindowId) \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
246 |
{ \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
247 |
if (_INST(activeWindow) != aGLXWindowId) { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
248 |
if (! ISCONNECTED ) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
249 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
250 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
251 |
if (! __isExternalAddress(aGLXWindowId)) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
252 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
253 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
254 |
if (GLXwinset(myDpy, _WindowVal(aGLXWindowId)) < 0) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
255 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
256 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
257 |
_INST(activeWindow) = aGLXWindowId; \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
258 |
__STORE(self, aGLXWindowId); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
259 |
} else { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
260 |
if (aGLXWindowId == nil) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
261 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
262 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
263 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
264 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
265 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
266 |
#endif /* old GL */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
267 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
268 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
269 |
* some defines - tired of typing ... |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
270 |
* 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
|
271 |
* put/pack them into corresponding c variables. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
272 |
* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
273 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
274 |
#ifdef OPENGL |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
275 |
# define Boolean int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
276 |
# define TRUE 1 |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
277 |
# define FALSE 0 |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
278 |
# define Coord float |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
279 |
# define Icoord int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
280 |
# define Scoord int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
281 |
# define Colorindex int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
282 |
# define Linestyle int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
283 |
# define Offset int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
284 |
# define Angle int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
285 |
# define Screencoord int |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
286 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
287 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
288 |
#define myDpy (Display *)(__MKCP(_INST(displayId))) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
289 |
#define ISCONNECTED (_INST(displayId) != nil) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
290 |
#define _WindowVal(o) (Window)(__MKCP(o)) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
291 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
292 |
#define __MKBOOLEAN(b) ((b==FALSE) ? false : true) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
293 |
#define _booleanVal(b) ((b==false) ? (Boolean)FALSE : (Boolean)TRUE) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
294 |
#define _coordVal(c) ((__isFloat(c)) ? (Coord)(_floatVal(c)) : (Coord)(__intVal(c))) |
185 | 295 |
#define _icoordVal(c) ((Icoord)(__intVal(c))) |
296 |
#define _scoordVal(c) ((Scoord)(__intVal(c))) |
|
297 |
#define _screencoordVal(c) ((Screencoord)(__intVal(c))) |
|
298 |
#define _colorindexVal(c) ((Colorindex)(__intVal(c))) |
|
299 |
#define _linestyleVal(l) ((Linestyle)(__intVal(l))) |
|
300 |
#define _shortVal(l) ((short)(__intVal(l))) |
|
301 |
#define _longVal(l) ((long)(__intVal(l))) |
|
302 |
#define _deviceVal(l) ((Device)(__intVal(l))) |
|
303 |
#define _tagVal(l) ((Tag)(__intVal(l))) |
|
969 | 304 |
#define _objectVal(l) ((GLX_Object)(__intVal(l))) |
185 | 305 |
#define _offsetVal(l) ((Offset)(__intVal(l))) |
306 |
#define _rgbVal(l) ((RGBvalue)(__intVal(l))) |
|
307 |
#define _angleVal(c) ((Angle)(__intVal(c))) |
|
157 | 308 |
|
29 | 309 |
/* |
310 |
* 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
|
311 |
* ST-object must be true or false. Return from method if invalid. |
29 | 312 |
*/ |
313 |
#define _BOOLEAN_(arg, dst) \ |
|
30 | 314 |
if (arg==true) \ |
77 | 315 |
dst = (Boolean)TRUE; \ |
30 | 316 |
else if (arg==false) \ |
77 | 317 |
dst = (Boolean)FALSE; \ |
29 | 318 |
else { RETURN(false); } |
319 |
||
320 |
/* |
|
321 |
* check for and fetch a coord from ST-arg into C-dst |
|
157 | 322 |
* ST-object must be Float, SmallInteger or Fraction. |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
323 |
* Return from method if invalid. |
29 | 324 |
*/ |
0 | 325 |
#define _COORD_(arg, dst) \ |
97 | 326 |
if (__isFloat(arg)) \ |
77 | 327 |
dst = (Coord)(_floatVal(arg)); \ |
97 | 328 |
else if (__isSmallInteger(arg)) \ |
185 | 329 |
dst = (Coord)(__intVal(arg)); \ |
97 | 330 |
else if (__isFraction(arg) \ |
331 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_numerator) \ |
|
332 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_denominator)) { \ |
|
77 | 333 |
float n, d; \ |
334 |
\ |
|
185 | 335 |
n = (float)(__intVal(_FractionInstPtr(arg)->f_numerator)); \ |
336 |
d = (float)(__intVal(_FractionInstPtr(arg)->f_denominator)); \ |
|
77 | 337 |
dst = (Coord)(n / d); \ |
29 | 338 |
} else { RETURN(false); } |
339 |
||
340 |
/* |
|
341 |
* check for and fetch an icoord from ST-arg into C-dst |
|
4718 | 342 |
* ST-object must be SmallInteger. Return from method if invalid. |
29 | 343 |
*/ |
344 |
#define _ICOORD_(arg, dst) \ |
|
97 | 345 |
if (__isSmallInteger(arg)) \ |
185 | 346 |
dst = (Icoord)(__intVal(arg)); \ |
29 | 347 |
else { RETURN(false); } |
348 |
||
349 |
/* |
|
157 | 350 |
* check for and fetch an scoord from ST-arg into C-dst |
4718 | 351 |
* ST-object must be SmallInteger. Return from method if invalid. |
29 | 352 |
*/ |
353 |
#define _SCOORD_(arg, dst) \ |
|
97 | 354 |
if (__isSmallInteger(arg)) \ |
185 | 355 |
dst = (Scoord)(__intVal(arg)); \ |
29 | 356 |
else { RETURN(false); } |
357 |
||
358 |
#define _SCREENCOORD_(arg, dst) \ |
|
97 | 359 |
if (__isSmallInteger(arg)) \ |
185 | 360 |
dst = (Screencoord)(__intVal(arg)); \ |
29 | 361 |
else { RETURN(false); } |
362 |
||
363 |
#define _COLORINDEX_(arg, dst) \ |
|
97 | 364 |
if (__isSmallInteger(arg)) \ |
185 | 365 |
dst = (Colorindex)(__intVal(arg)); \ |
29 | 366 |
else { RETURN(false); } |
367 |
||
368 |
#define _ANGLE_(arg, dst) \ |
|
97 | 369 |
if (__isSmallInteger(arg)) \ |
185 | 370 |
dst = (Angle)(__intVal(arg)); \ |
29 | 371 |
else { RETURN(false); } |
0 | 372 |
|
373 |
#define _FLOAT_(arg, dst) \ |
|
97 | 374 |
if (__isFloat(arg)) \ |
77 | 375 |
dst = (float)(_floatVal(arg)); \ |
97 | 376 |
else if (__isSmallInteger(arg)) \ |
185 | 377 |
dst = (float)(__intVal(arg)); \ |
97 | 378 |
else if (__isFraction(arg) \ |
379 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_numerator) \ |
|
380 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_denominator)) { \ |
|
77 | 381 |
float n, d; \ |
382 |
\ |
|
185 | 383 |
n = (float)(__intVal(_FractionInstPtr(arg)->f_numerator)); \ |
384 |
d = (float)(__intVal(_FractionInstPtr(arg)->f_denominator)); \ |
|
77 | 385 |
dst = (float)(n / d); \ |
29 | 386 |
} else { RETURN(false); } |
0 | 387 |
|
388 |
#define _INT_(arg, dst) \ |
|
97 | 389 |
if (__isSmallInteger(arg)) \ |
185 | 390 |
dst = (int)(__intVal(arg)); \ |
29 | 391 |
else { RETURN(false); } |
392 |
||
30 | 393 |
#define _indexedArea(object) \ |
394 |
(((char *) (_InstPtr(object))) \ |
|
77 | 395 |
+ OHDR_SIZE \ |
185 | 396 |
+ (__intVal(_ClassInstPtr(__qClass(object))->c_ninstvars)) * sizeof(OBJ)) |
77 | 397 |
%} |
398 |
! ! |
|
399 |
||
168 | 400 |
!GLXWorkstation primitiveVariables! |
401 |
%{ |
|
402 |
/* |
|
403 |
* remembered info from private error handler |
|
404 |
*/ |
|
4164
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
405 |
static char lastErrorMsg[128] = ""; |
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
406 |
static unsigned INT lastRequestCode = 0; |
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
407 |
static unsigned INT lastMinorCode = 0; |
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
408 |
static unsigned INT lastResource = 0; |
168 | 409 |
|
410 |
%} |
|
411 |
! ! |
|
412 |
||
89 | 413 |
!GLXWorkstation primitiveFunctions! |
77 | 414 |
%{ |
151 | 415 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
416 |
#ifdef DYNAMICALLY_LOADABLE |
168 | 417 |
/* |
418 |
* catch X-errors and forward as errorInterrupt:#DisplayError, |
|
4251 | 419 |
* (which itself invokes my handler and optionally raises an exception) |
168 | 420 |
* the implementation below is somewhat wrong: it will |
421 |
* report all errors for Display, even though there could be |
|
422 |
* more than one display connection. (being fixed, new errorInterrupt mechanism |
|
423 |
* allows passing an additional argument, which is the displayID ...) |
|
424 |
* |
|
4251 | 425 |
* this duplicates the functionality as found in XWorkstation; |
168 | 426 |
* the reason is to allow dynamic loading systems to load this module |
427 |
* before XWorkstation (which was not possible otherwise, due to unresolved |
|
428 |
* external references while loading this one) |
|
429 |
*/ |
|
430 |
static |
|
431 |
__XErrorHandler__(dpy, event) |
|
432 |
Display *dpy; |
|
433 |
XErrorEvent *event; |
|
434 |
{ |
|
435 |
XGetErrorText(dpy, event->error_code, lastErrorMsg, 80); |
|
436 |
if (lastErrorMsg[0] == '\0') { |
|
4718 | 437 |
sprintf(lastErrorMsg, "code: %d", event->error_code); |
168 | 438 |
} |
439 |
lastRequestCode = event->request_code; |
|
440 |
lastMinorCode = event->minor_code; |
|
441 |
lastResource = event->resourceid; |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
442 |
if ((event->error_code == BadWindow) && (lastRequestCode == 4) && (lastMinorCode == 0)) { |
4718 | 443 |
/* |
444 |
* this is a BadWindow error for X_DestroyWindow. |
|
445 |
* ignore it here, since it results from the GC freeing windows |
|
446 |
* in non bottom-up window order. |
|
447 |
*/ |
|
448 |
return 0; |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
449 |
} |
168 | 450 |
|
218
10072d9beba5
can now turn off Xlib error messages from the errorHandler
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
451 |
if (@global(ErrorPrinting) == true) { |
4718 | 452 |
console_fprintf(stderr, "GLXWORKSTAT: x-error caught maj=%d (0x%x) min=%d (0x%x) resource=%x\n", |
453 |
event->request_code, event->request_code, |
|
454 |
event->minor_code, event->minor_code, event->resourceid); |
|
455 |
console_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
|
456 |
} |
168 | 457 |
|
207
9124817bbb03
use new c-pointer wrapper macros (based on externalAddress)
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
458 |
__errorInterruptWithIDAndParameter__(@symbol(DisplayError), __MKOBJ(dpy)); |
168 | 459 |
return 0; |
460 |
} |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
461 |
#else |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
462 |
extern __XErrorHandler__(); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
463 |
#endif |
168 | 464 |
|
4718 | 465 |
/* |
151 | 466 |
* begin moved from GLXsupport.c |
467 |
*/ |
|
468 |
||
469 |
/* |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
470 |
* This provides a helper function "GLXCreateWindow", which does |
4718 | 471 |
* all the necessary magic to create an X window suitable for GL drawing |
472 |
* to take place within. See the definition of GLXCreateWindow for a |
|
151 | 473 |
* description of how to call it. |
474 |
* |
|
475 |
* claus: I really had no time to look into all this, |
|
476 |
* this file has been just copied from a 4Dgifts demo .. |
|
477 |
* (will need more than a day to show more ...) |
|
478 |
*/ |
|
1932 | 479 |
#if !defined(OPENGL) |
151 | 480 |
|
1899 | 481 |
# include <X11/Xlib.h> |
482 |
# include <X11/Xutil.h> |
|
483 |
# ifndef VGL |
|
4718 | 484 |
# include <gl/glws.h> |
1899 | 485 |
# endif |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
486 |
# ifndef _SIGNAL_H_INCLUDED_ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
487 |
# include <signal.h> |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
488 |
# endif |
1899 | 489 |
# include <setjmp.h> |
490 |
# include "stcIntern.h" |
|
151 | 491 |
|
492 |
/* |
|
493 |
* glxhelper.h: |
|
494 |
* |
|
495 |
* List of drawing modes supported by GLXCreateWindow (in glxhelper.c). |
|
4718 | 496 |
* More than this are possible with mixed model, but this is just an |
497 |
* example. You can either expand this list (and the corresponding code in |
|
498 |
* GLXCreateWindow) or call the mixed model calls yourself, using |
|
151 | 499 |
* GLXCreateWindow as an example. |
500 |
*/ |
|
501 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
502 |
static char * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
503 |
typeToName[] = { |
151 | 504 |
"color index single buffer", |
505 |
"color index double buffer", |
|
506 |
"rgb single buffer", |
|
507 |
"rgb double buffer", |
|
508 |
}; |
|
509 |
||
1932 | 510 |
#endif /* GLX || VGL */ |
511 |
||
512 |
#if defined(GLX) && !defined(VGL) |
|
151 | 513 |
/* |
514 |
* Dorky little helper function used to build up a GLXconfig array. |
|
515 |
*/ |
|
516 |
||
4718 | 517 |
static void |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
518 |
set_entry (GLXconfig* ptr, int b, int m, int a) |
151 | 519 |
{ |
520 |
ptr->buffer = b; |
|
521 |
ptr->mode = m; |
|
522 |
ptr->arg = a; |
|
523 |
} |
|
1932 | 524 |
#endif /* GLX & not VGL */ |
151 | 525 |
|
4711 | 526 |
static stx_jmp_buf errorReturn; |
151 | 527 |
|
528 |
static void |
|
529 |
glAbort() { |
|
6002 | 530 |
stx_longjmp(errorReturn, 1); |
151 | 531 |
} |
532 |
||
533 |
/* |
|
534 |
* GLXCreateWindow(dpy, parent, x, y, w, h, boderWidth, type) |
|
535 |
* |
|
536 |
* Return value is the X window id of the newly created window. |
|
537 |
* |
|
538 |
* Arguments are: |
|
539 |
* dpy The X "Display*" returned by XOpenDisplay |
|
540 |
* parent The parent of the newly created window, |
|
541 |
* a typical value for this is |
|
542 |
* RootWindow(dpy, DefaultScreen(dpy)) |
|
543 |
* x,y The location of the window to be created, |
|
544 |
* y coordinate is measured from the top down. |
|
545 |
* w,h size of the new window |
|
546 |
* borderWidth the X border size for this window, should probably |
|
547 |
* be zero. |
|
548 |
* type the GLXWindowType (see glxhelper.h) desribing the |
|
549 |
* typer of GL drawing to be done in this window |
|
550 |
*/ |
|
4718 | 551 |
Window |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
552 |
__GLXCreateWindow(dpy, parent, x, y, w, h, borderWidth, type) |
151 | 553 |
Display* dpy; |
554 |
Window parent; |
|
555 |
GLXWindowType type; |
|
556 |
{ |
|
1932 | 557 |
#if !defined(OPENGL) |
558 |
# ifndef VGL |
|
151 | 559 |
GLXconfig params[50]; |
560 |
GLXconfig* next; |
|
561 |
GLXconfig* retconfig; |
|
562 |
Colormap cmap = DefaultColormap(dpy, DefaultScreen(dpy)); |
|
1932 | 563 |
# endif |
564 |
#endif |
|
565 |
Visual visual; |
|
151 | 566 |
XVisualInfo *vis; |
567 |
XVisualInfo template; |
|
568 |
XColor white; |
|
569 |
XSetWindowAttributes cwa; |
|
570 |
XWindowAttributes pwa; |
|
571 |
int scr, i, nret; |
|
572 |
Window win; |
|
1932 | 573 |
#ifdef HAS_SIGACTION |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
574 |
struct sigaction oldSigSegv, newSigSegv; |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
575 |
#else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
576 |
void *oldSigSegv; |
1932 | 577 |
#endif |
578 |
||
579 |
#if !defined(OPENGL) |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
580 |
__catchExit(1); |
1932 | 581 |
#endif |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
582 |
|
6002 | 583 |
if (stx_setjmp(errorReturn)) { |
4718 | 584 |
console_fprintf(stderr, "hard error in GL - return\n"); |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
585 |
#ifdef SIGSEGV |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
586 |
# ifdef HAS_SIGACTION |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
587 |
sigaction(SIGSEGV, &oldSigSegv, 0); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
588 |
# else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
589 |
signal(SIGSEGV, oldSigSegv); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
590 |
# endif |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
591 |
#endif |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
592 |
|
1932 | 593 |
#if !defined(OPENGL) |
4718 | 594 |
__catchExit(0); |
595 |
#endif |
|
596 |
return 0; |
|
151 | 597 |
} |
598 |
__CONT__ |
|
599 |
||
1932 | 600 |
if (w <= 0) { |
4718 | 601 |
console_fprintf(stderr, "GL: bad width: %d\n", w); |
602 |
w = 1; |
|
1932 | 603 |
} |
604 |
if (h <= 0) { |
|
4718 | 605 |
console_fprintf(stderr, "GL: bad height: %d\n", h); |
606 |
h = 1; |
|
1932 | 607 |
} |
608 |
||
609 |
#if !defined(OPENGL) |
|
1899 | 610 |
# ifdef VGL |
151 | 611 |
/* |
612 |
* I know what VGL supports; its somewhat unclean to hard code it here |
|
613 |
*/ |
|
614 |
switch (type) { |
|
615 |
case GLXcolorIndexSingleBuffer: |
|
616 |
case GLXcolorIndexDoubleBuffer: |
|
4718 | 617 |
break; |
151 | 618 |
|
619 |
case GLXrgbSingleBuffer: |
|
620 |
case GLXrgbDoubleBuffer: |
|
4718 | 621 |
console_fprintf(stderr, "Sorry, VGL can't support %s type of windows\n", typeToName[type]); |
622 |
__catchExit(0); |
|
623 |
return 0; |
|
151 | 624 |
} |
625 |
||
626 |
scr = DefaultScreen(dpy); |
|
627 |
visual.visualid = CopyFromParent; |
|
628 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
629 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
4718 | 630 |
borderWidth, DisplayPlanes(dpy, scr), |
631 |
InputOutput, &visual, |
|
632 |
CWBorderPixel, &cwa); |
|
151 | 633 |
|
634 |
/* |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
635 |
* on some, seg-violations occur in the GL, if too many |
151 | 636 |
* views are created ... just to make certain, we catch those |
637 |
* in GL too. |
|
638 |
*/ |
|
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
639 |
# ifdef SIGSEGV |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
640 |
# ifdef HAS_SIGACTION |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
641 |
sigaction(SIGSEGV, (struct sigaction *)0, &oldSigSegv); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
642 |
newSigSegv = oldSigSegv; |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
643 |
newSigSegv.sa_handler = glAbort; |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
644 |
sigaction(SIGSEGV, &newSigSegv, (struct sigaction *)0); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
645 |
# else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
646 |
oldSigSegv = signal(SIGSEGV, glAbort); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
647 |
# endif |
1899 | 648 |
# endif |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
649 |
|
151 | 650 |
i = GLXlink(dpy, win); |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
651 |
|
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
652 |
# ifdef SIGSEGV |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
653 |
# ifdef HAS_SIGACTION |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
654 |
sigaction(SIGSEGV, &oldSigSegv, (struct sigaction *)0); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
655 |
# else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
656 |
signal(SIGSEGV, oldSigSegv); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
657 |
# endif |
1899 | 658 |
# endif |
151 | 659 |
|
660 |
if (i < 0) { |
|
4718 | 661 |
console_fprintf(stderr, "GLXlink returned %d\n", i); |
662 |
__catchExit(0); |
|
663 |
return 0; |
|
151 | 664 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
665 |
|
1899 | 666 |
# else /* not VGL */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
667 |
|
151 | 668 |
/* |
669 |
* This builds an array in "params" that describes for GLXgetconfig(3G) |
|
670 |
* the type of GL drawing that will be done. |
|
671 |
*/ |
|
672 |
next = params; |
|
673 |
switch (type) { |
|
674 |
case GLXcolorIndexSingleBuffer: |
|
4718 | 675 |
set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE); |
676 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE); |
|
677 |
break; |
|
151 | 678 |
case GLXcolorIndexDoubleBuffer: |
4718 | 679 |
set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE); |
680 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE); |
|
681 |
break; |
|
151 | 682 |
case GLXrgbSingleBuffer: |
4718 | 683 |
set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE); |
684 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE); |
|
685 |
break; |
|
151 | 686 |
case GLXrgbDoubleBuffer: |
4718 | 687 |
set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE); |
688 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE); |
|
689 |
break; |
|
151 | 690 |
} |
691 |
set_entry(next, 0, 0, 0); /* The input to GLXgetconfig is null terminated */ |
|
692 |
||
693 |
/* |
|
694 |
* Get configuration data for a window based on above parameters |
|
695 |
* First we have to find out which screen the parent window is on, |
|
696 |
* then we can call GXLgetconfig() |
|
697 |
*/ |
|
698 |
XGetWindowAttributes(dpy, parent, &pwa); |
|
699 |
retconfig = GLXgetconfig(dpy, XScreenNumberOfScreen(pwa.screen), params); |
|
700 |
if (retconfig == 0) { |
|
4718 | 701 |
console_fprintf(stderr, "Sorry, can't support %s type of windows\n", typeToName[type]); |
702 |
__catchExit(0); |
|
703 |
return 0; |
|
151 | 704 |
} |
705 |
||
706 |
/* |
|
707 |
* Scan through config info, pulling info needed to create a window |
|
708 |
* that supports the rendering mode. |
|
709 |
*/ |
|
710 |
for (next = retconfig; next->buffer; next++) { |
|
4718 | 711 |
unsigned long buffer = next->buffer; |
712 |
unsigned long mode = next->mode; |
|
713 |
unsigned long value = next->arg; |
|
714 |
switch (mode) { |
|
715 |
case GLX_COLORMAP: |
|
716 |
if (buffer == GLX_NORMAL) { |
|
717 |
cmap = value; |
|
718 |
} |
|
719 |
break; |
|
720 |
case GLX_VISUAL: |
|
721 |
if (buffer == GLX_NORMAL) { |
|
722 |
template.visualid = value; |
|
723 |
template.screen = DefaultScreen(dpy); |
|
724 |
vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask, |
|
725 |
&template, &nret); |
|
726 |
} |
|
727 |
break; |
|
728 |
} |
|
151 | 729 |
} |
730 |
||
731 |
/* |
|
732 |
* Create the window |
|
733 |
*/ |
|
734 |
cwa.colormap = cmap; |
|
735 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
736 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
4718 | 737 |
borderWidth, vis->depth, InputOutput, vis->visual, |
738 |
CWColormap|CWBorderPixel, &cwa); |
|
151 | 739 |
|
740 |
/* |
|
741 |
* Rescan configuration info and find window slot that getconfig |
|
742 |
* provided. Fill it in with the window we just created. |
|
743 |
*/ |
|
744 |
for (next = retconfig; next->buffer; next++) { |
|
4718 | 745 |
if ((next->buffer == GLX_NORMAL) && (next->mode == GLX_WINDOW)) { |
746 |
next->arg = win; |
|
747 |
break; |
|
748 |
} |
|
151 | 749 |
} |
750 |
||
751 |
/* |
|
752 |
* Now "retconfig" contains all the information the GL needs to |
|
753 |
* configure the window and its own internal state. |
|
754 |
*/ |
|
755 |
/* |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
756 |
* on iris, seg-violations occur in the GL, if too many |
151 | 757 |
* views are created ... |
758 |
*/ |
|
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
759 |
# ifdef SIGSEGV |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
760 |
# ifdef HAS_SIGACTION |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
761 |
sigaction(SIGSEGV, (struct sigaction *)0, &oldSigSegv); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
762 |
newSigSegv = oldSigSegv; |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
763 |
newSigSegv.sa_handler = glAbort; |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
764 |
sigaction(SIGSEGV, &newSigSegv, (struct sigaction *)0); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
765 |
# else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
766 |
oldSigSegv = signal(SIGSEGV, glAbort); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
767 |
# endif |
1899 | 768 |
# endif |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
769 |
|
151 | 770 |
i = GLXlink(dpy, retconfig); |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
771 |
|
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
772 |
# ifdef SIGSEGV |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
773 |
# ifdef HAS_SIGACTION |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
774 |
sigaction(SIGSEGV, &oldSigSegv, (struct sigaction *)0); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
775 |
# else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
776 |
signal(SIGSEGV, oldSigSegv); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
777 |
# endif |
1899 | 778 |
# endif |
151 | 779 |
|
780 |
if (i < 0) { |
|
4718 | 781 |
console_fprintf(stderr, "GLXlink returned %d\n", i); |
782 |
__catchExit(0); |
|
783 |
return 0; |
|
151 | 784 |
} |
785 |
||
786 |
/* |
|
787 |
* The GL sets its own X error handlers, which exits - this is not what we want |
|
788 |
*/ |
|
789 |
XSetErrorHandler(__XErrorHandler__); |
|
1899 | 790 |
# endif /* not VGL */ |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
791 |
__catchExit(0); |
1932 | 792 |
|
793 |
#else /* OPENGL | MESA */ |
|
794 |
||
795 |
scr = DefaultScreen(dpy); |
|
796 |
visual.visualid = CopyFromParent; |
|
797 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
798 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
4718 | 799 |
borderWidth, DisplayPlanes(dpy, scr), |
800 |
InputOutput, &visual, |
|
801 |
CWBorderPixel, &cwa); |
|
1932 | 802 |
|
803 |
vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask, &visual, &nret); |
|
4718 | 804 |
console_fprintf(stderr, "vis is %x\n", vis); |
1932 | 805 |
#endif /* GLX || VGL */ |
806 |
||
151 | 807 |
return win; |
808 |
} |
|
809 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
810 |
__GLXUnlinkWindow(dpy, win) |
151 | 811 |
Display* dpy; |
812 |
Window win; |
|
813 |
{ |
|
814 |
/* |
|
815 |
* only needed for VGL - GLX does it automatically |
|
816 |
*/ |
|
1932 | 817 |
#ifdef VGL |
151 | 818 |
GLXunlink(dpy, win); |
1932 | 819 |
#endif |
151 | 820 |
} |
821 |
||
29 | 822 |
/* |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
823 |
* helper for rotation - calls rot() |
29 | 824 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
825 |
OBJ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
826 |
__glx_doRotate(angle, axis) |
29 | 827 |
OBJ angle; |
828 |
char axis; |
|
829 |
{ |
|
830 |
float f_angle; |
|
831 |
||
35 | 832 |
if (__isFloat(angle)) { |
4718 | 833 |
f_angle = (float)(_floatVal(angle)); |
834 |
if (f_angle != 0.0) { |
|
835 |
#ifdef OPENGL |
|
836 |
#else |
|
837 |
rot(f_angle, axis); |
|
838 |
#endif |
|
839 |
} |
|
840 |
return (true); |
|
29 | 841 |
} |
35 | 842 |
if (__isFraction(angle) |
97 | 843 |
&& __isSmallInteger(_FractionInstPtr(angle)->f_numerator) |
844 |
&& __isSmallInteger(_FractionInstPtr(angle)->f_denominator)) { |
|
4718 | 845 |
float n, d; |
846 |
||
847 |
n = (float)(__intVal(_FractionInstPtr(angle)->f_numerator)); |
|
848 |
d = (float)(__intVal(_FractionInstPtr(angle)->f_denominator)); |
|
849 |
f_angle = n / d; |
|
850 |
if (f_angle != 0.0) { |
|
851 |
#ifdef OPENGL |
|
852 |
#else |
|
853 |
rot(f_angle, axis); |
|
854 |
#endif |
|
855 |
} |
|
856 |
return (true); |
|
29 | 857 |
} |
97 | 858 |
if (__isSmallInteger(angle)) { |
4718 | 859 |
f_angle = (float)(__intVal(angle)); |
860 |
if (f_angle != 0.0) { |
|
861 |
#ifdef OPENGL |
|
862 |
#else |
|
863 |
rot(f_angle, axis); |
|
864 |
#endif |
|
865 |
} |
|
866 |
return (true); |
|
29 | 867 |
} |
868 |
return false; |
|
869 |
} |
|
0 | 870 |
|
24 | 871 |
/* |
29 | 872 |
* fetch integers from an st-array (elements must be smallIntegers) |
873 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
874 |
long * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
875 |
__glx_getLongsFromInto(obj, vec, count) |
29 | 876 |
OBJ obj; |
877 |
long *vec; |
|
878 |
{ |
|
879 |
OBJ cls, o; |
|
880 |
int nByte, i, ninstVars, nInstBytes; |
|
881 |
char *pElem; |
|
882 |
||
883 |
if (! _isNonNilObject(obj)) return (long *)NULL; |
|
134 | 884 |
cls = __qClass(obj); |
185 | 885 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 886 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 887 |
nByte = __qSize(obj) - nInstBytes; |
29 | 888 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
889 |
if (nByte < (count * sizeof(OBJ))) return (long *)NULL; |
|
890 |
for (i=0; i<count; i++) { |
|
4718 | 891 |
o = *(OBJ *)pElem; |
892 |
if (! __isSmallInteger(o)) return (long *)NULL; |
|
893 |
vec[i] = (long)__intVal(o); |
|
894 |
pElem += sizeof(OBJ); |
|
29 | 895 |
} |
896 |
return vec; |
|
897 |
} |
|
898 |
||
899 |
/* |
|
900 |
* fetch shorts from an st-array (elements must be smallIntegers) |
|
901 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
902 |
short * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
903 |
__glx_getShortsFromInto(obj, vec, count) |
29 | 904 |
OBJ obj; |
905 |
short *vec; |
|
906 |
{ |
|
907 |
OBJ cls, o; |
|
908 |
int nByte, i, ninstVars, nInstBytes; |
|
909 |
char *pElem; |
|
910 |
||
911 |
if (! _isNonNilObject(obj)) return (short *)NULL; |
|
134 | 912 |
cls = __qClass(obj); |
185 | 913 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 914 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 915 |
nByte = __qSize(obj) - nInstBytes; |
29 | 916 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
917 |
if (nByte < (count * sizeof(OBJ))) return (short *)NULL; |
|
918 |
for (i=0; i<count; i++) { |
|
4718 | 919 |
o = *(OBJ *)pElem; |
920 |
if (! __isSmallInteger(o)) return (short *)NULL; |
|
921 |
vec[i] = (short)__intVal(o); |
|
922 |
pElem += sizeof(OBJ); |
|
29 | 923 |
} |
924 |
return vec; |
|
925 |
} |
|
926 |
||
927 |
/* |
|
4718 | 928 |
* fetch floats from an st-object into a c-float array |
29 | 929 |
* which may be a floatArray, doubleArray or array-of-something, |
930 |
* where something may be a float, fraction or smallInteger, |
|
24 | 931 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
932 |
float * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
933 |
__glx_getFloatsFromInto(obj, vec, count) |
12 | 934 |
OBJ obj; |
935 |
float *vec; |
|
936 |
{ |
|
937 |
OBJ cls; |
|
938 |
int nByte; |
|
939 |
OBJ o; |
|
940 |
int i, ninstVars, nInstBytes; |
|
941 |
char *pElem; |
|
942 |
||
943 |
if (! _isNonNilObject(obj)) return (float *)0; |
|
944 |
||
134 | 945 |
cls = __qClass(obj); |
185 | 946 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
12 | 947 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 948 |
nByte = __qSize(obj) - nInstBytes; |
12 | 949 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
950 |
||
185 | 951 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
12 | 952 |
case FLOATARRAY: |
4718 | 953 |
/* |
954 |
* best speed for float array |
|
955 |
* - the data is already as we want it |
|
956 |
*/ |
|
957 |
if (nByte < (count * sizeof(float))) return (float *)0; |
|
958 |
return (float *)pElem; |
|
12 | 959 |
|
960 |
case DOUBLEARRAY: |
|
4718 | 961 |
/* |
962 |
* for double array, have to copy-and-cast |
|
963 |
*/ |
|
964 |
if (nByte < (count * sizeof(double))) return (float *)0; |
|
965 |
for (i=0; i<count; i++) { |
|
966 |
vec[i] = *((double *)pElem); |
|
967 |
pElem += sizeof(double); |
|
968 |
} |
|
969 |
return vec; |
|
12 | 970 |
|
971 |
case POINTERARRAY: |
|
4718 | 972 |
/* |
973 |
* for other array, have to fetch, check and store |
|
974 |
* the elements can be floats, smallintegers or fractions |
|
975 |
*/ |
|
976 |
if (nByte < (count * sizeof(OBJ))) return (float *)0; |
|
977 |
/* get elements one-by-one */ |
|
978 |
for (i=0; i<count; i++) { |
|
979 |
o = *(OBJ *)pElem; |
|
980 |
if (__isFloat(o)) { |
|
981 |
vec[i] = _floatVal(o); |
|
982 |
} else if (__isSmallInteger(o)) { |
|
983 |
vec[i] = (float)(__intVal(o)); |
|
984 |
} else if (__isFraction(o) |
|
985 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
|
986 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
987 |
float n, d; |
|
988 |
||
989 |
n = (float)(__intVal(_FractionInstPtr(o)->f_numerator)); |
|
990 |
d = (float)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
991 |
vec[i] = n / d; |
|
992 |
} else |
|
993 |
return 0; |
|
994 |
pElem += sizeof(OBJ); |
|
995 |
} |
|
996 |
return vec; |
|
12 | 997 |
} |
998 |
return (float *)0; |
|
999 |
} |
|
1000 |
||
29 | 1001 |
/* |
4718 | 1002 |
* fetch doubles from an st-object into a c-double array |
29 | 1003 |
* which may be a floatArray, doubleArray or array-of-something, |
1004 |
* where something may be a float, fraction or smallInteger, |
|
1005 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1006 |
double * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1007 |
__glx_getDoublesFromInto(obj, vec, count) |
29 | 1008 |
OBJ obj; |
1009 |
double *vec; |
|
1010 |
{ |
|
1011 |
OBJ cls, o; |
|
1012 |
int nByte, i, ninstVars, nInstBytes; |
|
1013 |
char *pElem; |
|
1014 |
||
1015 |
if (! _isNonNilObject(obj)) return (double *)0; |
|
134 | 1016 |
cls = __qClass(obj); |
185 | 1017 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 1018 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1019 |
nByte = __qSize(obj) - nInstBytes; |
29 | 1020 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1021 |
||
185 | 1022 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
29 | 1023 |
case DOUBLEARRAY: |
4718 | 1024 |
/* best speed for double array - the data is already as we want it */ |
1025 |
if (nByte < (count * sizeof(double))) return (double *)0; |
|
1026 |
return (double *)pElem; |
|
29 | 1027 |
|
1028 |
case FLOATARRAY: |
|
4718 | 1029 |
if (nByte < (count * sizeof(float))) return (double *)0; |
1030 |
for (i=0; i<count; i++) { |
|
1031 |
vec[i] = *((float *)pElem); |
|
1032 |
pElem += sizeof(float); |
|
1033 |
} |
|
1034 |
return vec; |
|
29 | 1035 |
|
1036 |
case POINTERARRAY: |
|
4718 | 1037 |
if (nByte < (count * sizeof(OBJ))) return (double *)0; |
1038 |
/* get elements one-by-one */ |
|
1039 |
for (i=0; i<count; i++) { |
|
1040 |
o = *(OBJ *)pElem; |
|
1041 |
if (__isFloat(o)) |
|
1042 |
vec[i] = _floatVal(o); |
|
1043 |
else if (__isSmallInteger(o)) |
|
1044 |
vec[i] = (double)(__intVal(o)); |
|
1045 |
else if (__isFraction(o) |
|
1046 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
|
1047 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
1048 |
double n, d; |
|
1049 |
||
1050 |
n = (double)(__intVal(_FractionInstPtr(o)->f_numerator)); |
|
1051 |
d = (double)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
1052 |
vec[i] = n / d; |
|
1053 |
||
1054 |
} else |
|
1055 |
return 0; |
|
1056 |
pElem += sizeof(OBJ); |
|
1057 |
} |
|
1058 |
return vec; |
|
29 | 1059 |
} |
1060 |
return (double *)0; |
|
1061 |
} |
|
1062 |
||
1063 |
/* |
|
1064 |
* move from a c-float array into an st-object, |
|
1065 |
* the st-object MUST be either a float- or double array |
|
1066 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1067 |
__glx_putFloatsFromInto(vec, obj, count) |
12 | 1068 |
OBJ obj; |
1069 |
float *vec; |
|
1070 |
{ |
|
1071 |
OBJ cls; |
|
1072 |
int nByte; |
|
1073 |
OBJ o; |
|
1074 |
int i, ninstVars, nInstBytes; |
|
1075 |
char *pElem; |
|
1076 |
||
1077 |
if (! _isNonNilObject(obj)) return 0; |
|
1078 |
||
134 | 1079 |
cls = __qClass(obj); |
185 | 1080 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
12 | 1081 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1082 |
nByte = __qSize(obj) - nInstBytes; |
12 | 1083 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1084 |
||
185 | 1085 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
12 | 1086 |
case FLOATARRAY: |
4718 | 1087 |
if (nByte < (count * sizeof(float))) return 0; |
1088 |
for (i=0; i<count; i++) { |
|
1089 |
*(float *)pElem = vec[i]; |
|
1090 |
pElem += sizeof(float); |
|
1091 |
} |
|
1092 |
return 1; |
|
12 | 1093 |
|
1094 |
case DOUBLEARRAY: |
|
4718 | 1095 |
if (nByte < (count * sizeof(float))) return 0; |
1096 |
for (i=0; i<count; i++) { |
|
1097 |
*(double *)pElem = vec[i]; |
|
1098 |
pElem += sizeof(double); |
|
1099 |
} |
|
1100 |
return 1; |
|
12 | 1101 |
} |
1102 |
/* not implemented for others */ |
|
1103 |
||
1104 |
return 0; |
|
1105 |
} |
|
1106 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1107 |
#ifndef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1108 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1109 |
Matrix * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1110 |
__glx_getFloatsFromMatrixInto(obj, mp) |
12 | 1111 |
OBJ obj; |
1112 |
Matrix *mp; |
|
1113 |
{ |
|
1114 |
OBJ cls; |
|
1115 |
int nByte; |
|
1116 |
OBJ o; |
|
29 | 1117 |
int ninstVars, nInstBytes; |
1118 |
char *pElem; |
|
1119 |
int x = 0; |
|
1120 |
int i,j; |
|
12 | 1121 |
|
1122 |
if (! _isNonNilObject(obj)) return (Matrix *)0; |
|
1123 |
||
134 | 1124 |
cls = __qClass(obj); |
185 | 1125 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 1126 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1127 |
nByte = __qSize(obj) - nInstBytes; |
29 | 1128 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1129 |
||
185 | 1130 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
4718 | 1131 |
case FLOATARRAY: |
1132 |
/* |
|
1133 |
* very easy for FLOATARRAY objects - no copying needed |
|
1134 |
*/ |
|
1135 |
if (nByte < (16 * sizeof(float))) return (Matrix *)0; |
|
1136 |
return (Matrix *) _FloatArrayInstPtr(obj)->f_element; |
|
1137 |
||
1138 |
case DOUBLEARRAY: |
|
1139 |
/* |
|
1140 |
* for DOUBLEARRAY objects copy and cast |
|
1141 |
*/ |
|
1142 |
if (nByte < (16 * sizeof(double))) return (Matrix *)0; |
|
1143 |
for (i=0; i<4; i++) { |
|
1144 |
for (j=0; j<4; j++) { |
|
1145 |
(*mp)[i][j] = _DoubleArrayInstPtr(obj)->d_element[x]; |
|
1146 |
x++; |
|
1147 |
} |
|
1148 |
} |
|
1149 |
return mp; |
|
1150 |
||
1151 |
case POINTERARRAY: |
|
1152 |
if (nByte < (16 * sizeof(OBJ))) return (Matrix *)0; |
|
1153 |
/* |
|
1154 |
* get elements one-by-one |
|
1155 |
*/ |
|
1156 |
for (i=0; i<4; i++) { |
|
1157 |
for (j=0; j<4; j++) { |
|
1158 |
o = _ArrayInstPtr(obj)->a_element[x]; |
|
1159 |
if (__isFloat(o)) { |
|
1160 |
(*mp)[i][j] = _floatVal(o); |
|
1161 |
} else if (__isSmallInteger(o)) { |
|
1162 |
(*mp)[i][j] = (double)__intVal(o); |
|
1163 |
} else if (__isFraction(o) |
|
1164 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
|
1165 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
1166 |
double n, d; |
|
1167 |
||
1168 |
n = (double)(__intVal(_FractionInstPtr(o)->f_numerator)); |
|
1169 |
d = (double)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
1170 |
(*mp)[i][j] = n / d; |
|
1171 |
} else |
|
1172 |
return (Matrix *)0; |
|
1173 |
x++; |
|
1174 |
} |
|
1175 |
} |
|
1176 |
return mp; |
|
12 | 1177 |
} |
1178 |
return (Matrix *)0; |
|
1179 |
} |
|
1180 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1181 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1182 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1183 |
float* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1184 |
__glx_getFloatsFromFloatArrayInto(obj, fp) |
46 | 1185 |
OBJ obj; |
1186 |
float *fp; |
|
1187 |
{ |
|
1188 |
OBJ cls; |
|
1189 |
int ninstVars; |
|
1190 |
||
1191 |
if (! _isNonNilObject(obj)) return (float *)0; |
|
134 | 1192 |
cls = __qClass(obj); |
350 | 1193 |
if (cls == @global(FloatArray)) |
4718 | 1194 |
return _FloatArrayInstPtr(obj)->f_element; |
46 | 1195 |
|
185 | 1196 |
if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) { |
4718 | 1197 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
1198 |
return (float *) &(_InstPtr(obj)->i_instvars[ninstVars]); |
|
46 | 1199 |
} |
1200 |
||
1201 |
/* |
|
1202 |
* need more here (i.e. convert from array-of-floats) |
|
1203 |
*/ |
|
1204 |
return (float *)0; |
|
1205 |
} |
|
1206 |
||
1207 |
%} |
|
1208 |
! ! |
|
0 | 1209 |
|
294 | 1210 |
!GLXWorkstation class methodsFor:'documentation'! |
1211 |
||
1212 |
copyright |
|
1213 |
" |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1214 |
COPYRIGHT (c) 1993 by Claus Gittinger |
294 | 1215 |
All Rights Reserved |
1216 |
||
1217 |
This software is furnished under a license and may be used |
|
1218 |
only in accordance with the terms of that license and with the |
|
1219 |
inclusion of the above copyright notice. This software may not |
|
1220 |
be provided or otherwise made available to, or used by, any |
|
1221 |
other person. No title to or ownership of the software is |
|
1222 |
hereby transferred. |
|
1223 |
" |
|
1224 |
! |
|
1225 |
||
1226 |
documentation |
|
1227 |
" |
|
1228 |
this class was originally written as a demo on how an interface to |
|
1229 |
a c graphics library could be implemented. In the mean time, it has become |
|
1230 |
quite complete ... |
|
1231 |
||
1232 |
It provides an interface to either a real GL (on SGI workstations) |
|
1233 |
or a simulated VGL (i.e. GL-light; low nicotine). |
|
1234 |
The GL simulation is derived from the PD vogl library, with slight |
|
1235 |
modifictions to support multiple GL views. |
|
1236 |
||
1237 |
Most of the hard work was done by Jeff (thanks indeed) ... |
|
1238 |
||
1239 |
||
1240 |
Some notes: |
|
1241 |
||
1242 |
I do not really know what most of these functions do - for more |
|
1243 |
detail, see the GL man pages (on SGI) or the doc provided with VGL. |
|
1244 |
||
1245 |
The interface offered here provides a very very low level (i.e one-to-one) |
|
1246 |
interface to GL functions. More high-level stuff is required, to make |
|
4718 | 1247 |
3D drawing be more object-oriented. |
294 | 1248 |
(see a bit of this in 'clients/IRIS-specials') |
1249 |
||
1250 |
Some functions are duplicated, Jeff and I developed those in parallel - |
|
1251 |
for now, both will remain - finally they will be merged and duplicates removed ... |
|
1252 |
(examples are makeobj and makeObject). |
|
1253 |
||
1254 |
Also, in a hurry to implement all those methods, many do no or only |
|
1255 |
limited argument checking - make certain, that you pass the correct |
|
1256 |
arguments. |
|
1257 |
||
1258 |
There might be some confusion in the v3[sifd] functions: basically they |
|
1259 |
all do the same, and could be mapped onto one st-method (such as vertex3). |
|
7657 | 1260 |
However, the C-functions expect different argument types - I don't know if |
294 | 1261 |
one or another of these functions suffers from any performance penalties. |
1262 |
Therefore, I leave the direct 1-to-1 mapping; GL experts might know more |
|
1263 |
about this (I use v3f in all of my code). |
|
1264 |
||
1265 |
written june 93 by claus |
|
1266 |
VGL stuff dec 93 |
|
1267 |
many many additions jan 94 by Jeff McAffer <jeff@is.s.u-tokyo.ac.jp> |
|
1268 |
||
4718 | 1269 |
Since this is a demo (consider it a free add-on goody) there is |
294 | 1270 |
*** NO WARRANTY ** for this. |
1271 |
||
1272 |
Notice: this should be rewritten to use the openGL library functions |
|
1273 |
(actually, to not loose the VGL interface, another OpenGLWorkstation |
|
1274 |
class should be written) |
|
614 | 1275 |
|
1276 |
[author:] |
|
7657 | 1277 |
Claus Gittinger |
1278 |
Jeff McAffer |
|
294 | 1279 |
" |
1280 |
! ! |
|
1281 |
||
168 | 1282 |
!GLXWorkstation class methodsFor:'error handling'! |
1283 |
||
294 | 1284 |
errorStringOfLastError |
1285 |
%{ |
|
4251 | 1286 |
#ifdef DYNAMICALLY_LOADABLE |
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1287 |
RETURN ( __MKSTRING(lastErrorMsg) ); |
4251 | 1288 |
#endif |
1289 |
%}. |
|
1290 |
||
1291 |
^ super errorStringOfLastError. |
|
1292 |
! |
|
1293 |
||
1294 |
minorCodeOfLastError |
|
1295 |
%{ /* NOCONTEXT */ |
|
1296 |
#ifdef DYNAMICALLY_LOADABLE |
|
1297 |
RETURN ( __MKSMALLINT(lastMinorCode) ); |
|
1298 |
#endif |
|
1299 |
%}. |
|
1300 |
||
1301 |
^ super minorCodeOfLastError. |
|
1302 |
! |
|
1303 |
||
1304 |
requestCodeOfLastError |
|
1305 |
%{ /* NOCONTEXT */ |
|
1306 |
#ifdef DYNAMICALLY_LOADABLE |
|
1307 |
RETURN ( __MKSMALLINT(lastRequestCode) ); |
|
1308 |
#endif |
|
1309 |
%}. |
|
1310 |
||
1311 |
^ super requestCodeOfLastError. |
|
1312 |
! |
|
1313 |
||
1314 |
resourceIdOfLastError |
|
1315 |
%{ /* NOCONTEXT */ |
|
1316 |
#ifdef DYNAMICALLY_LOADABLE |
|
1317 |
if (lastResource != 0) { |
|
1318 |
RETURN ( __MKEXTERNALADDRESS(lastResource) ); |
|
1319 |
} |
|
1320 |
RETURN ( nil ); |
|
1321 |
#endif |
|
1322 |
%}. |
|
1323 |
||
1324 |
^ super resourceIdOfLastError. |
|
1325 |
! ! |
|
1326 |
||
1327 |
!GLXWorkstation class methodsFor:'misc'! |
|
168 | 1328 |
|
528 | 1329 |
forceGL:aBoolean |
1330 |
ForceGL := aBoolean. |
|
1331 |
AllScreens notNil ifTrue:[ |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1332 |
AllScreens do:[:screen | screen initializeScreenProperties] |
528 | 1333 |
]. |
294 | 1334 |
! ! |
1335 |
||
1336 |
!GLXWorkstation methodsFor:'arcs and circles'! |
|
1337 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1338 |
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
|
1339 |
"draw an arc at a given location. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1340 |
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
|
1341 |
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
|
1342 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1343 |
%{ /* NOCONTEXT */ |
294 | 1344 |
Coord c_x, c_y, c_radius; |
1345 |
Angle a_startang, a_endang; |
|
1346 |
||
1347 |
_COORD_(x, c_x) |
|
1348 |
_COORD_(y, c_y) |
|
1349 |
_COORD_(radius, c_radius) |
|
1350 |
_ANGLE_(startang, a_startang) |
|
1351 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1352 |
|
294 | 1353 |
SETWIN(aGLXWindowId) |
1932 | 1354 |
#ifdef OPENGL |
1355 |
#else |
|
294 | 1356 |
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
|
1357 |
#endif |
294 | 1358 |
%} |
528 | 1359 |
|
1360 |
"Modified: 19.3.1996 / 18:43:52 / cg" |
|
294 | 1361 |
! |
1362 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1363 |
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
|
1364 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1365 |
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
|
1366 |
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
|
1367 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1368 |
%{ /* NOCONTEXT */ |
294 | 1369 |
Coord c_x, c_y, c_radius; |
1370 |
Angle a_startang, a_endang; |
|
1371 |
||
1372 |
_COORD_(x, c_x) |
|
1373 |
_COORD_(y, c_y) |
|
1374 |
_COORD_(radius, c_radius) |
|
1375 |
_ANGLE_(startang, a_startang) |
|
1376 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1377 |
|
294 | 1378 |
SETWIN(aGLXWindowId) |
1932 | 1379 |
#ifdef OPENGL |
1380 |
#else |
|
294 | 1381 |
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
|
1382 |
#endif |
294 | 1383 |
%} |
1384 |
! |
|
1385 |
||
1386 |
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
|
1387 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1388 |
All arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1389 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1390 |
%{ /* NOCONTEXT */ |
294 | 1391 |
Icoord c_x, c_y, c_radius; |
1392 |
Angle a_startang, a_endang; |
|
1393 |
||
1394 |
_ICOORD_(x, c_x) |
|
1395 |
_ICOORD_(y, c_y) |
|
1396 |
_ICOORD_(radius, c_radius) |
|
1397 |
_ANGLE_(startang, a_startang); |
|
1398 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1399 |
|
294 | 1400 |
SETWIN(aGLXWindowId) |
1932 | 1401 |
#ifdef OPENGL |
1402 |
#else |
|
294 | 1403 |
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
|
1404 |
#endif |
294 | 1405 |
%} |
1406 |
! |
|
1407 |
||
1408 |
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
|
1409 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1410 |
All arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1411 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1412 |
%{ /* NOCONTEXT */ |
294 | 1413 |
Scoord c_x, c_y, c_radius; |
1414 |
Angle a_startang, a_endang; |
|
1415 |
||
1416 |
_SCOORD_(x, c_x) |
|
1417 |
_SCOORD_(y, c_y) |
|
1418 |
_SCOORD_(radius, c_radius) |
|
1419 |
_ANGLE_(startang, a_startang) |
|
1420 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1421 |
|
294 | 1422 |
SETWIN(aGLXWindowId) |
1932 | 1423 |
#ifdef OPENGL |
1424 |
#else |
|
294 | 1425 |
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
|
1426 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1427 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1428 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1429 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1430 |
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
|
1431 |
"draw an (unfilled) arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1432 |
All arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1433 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1434 |
%{ /* NOCONTEXT */ |
294 | 1435 |
Icoord c_x, c_y, c_radius; |
1436 |
Angle a_startang, a_endang; |
|
1437 |
||
1438 |
_ICOORD_(x, c_x) |
|
1439 |
_ICOORD_(y, c_y) |
|
1440 |
_ICOORD_(radius, c_radius) |
|
1441 |
_ANGLE_(startang, a_startang) |
|
1442 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1443 |
|
294 | 1444 |
SETWIN(aGLXWindowId) |
1932 | 1445 |
#ifdef OPENGL |
1446 |
#else |
|
294 | 1447 |
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
|
1448 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1449 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1450 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1451 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1452 |
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
|
1453 |
"draw an (unfilled) arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1454 |
All arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1455 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1456 |
%{ /* NOCONTEXT */ |
1932 | 1457 |
Scoord c_x, c_y, c_radius; |
1458 |
Angle a_startang, a_endang; |
|
1459 |
||
1460 |
_SCOORD_(x, c_x) |
|
1461 |
_SCOORD_(y, c_y) |
|
1462 |
_SCOORD_(radius, c_radius) |
|
1463 |
_ANGLE_(startang, a_startang) |
|
1464 |
_ANGLE_(endang, a_endang) |
|
1465 |
||
1466 |
SETWIN(aGLXWindowId) |
|
1467 |
#ifdef OPENGL |
|
1468 |
#else |
|
1469 |
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
|
1470 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1471 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1472 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1473 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1474 |
glxCircX:x y:y radius: radius in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1475 |
"draw a circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1476 |
x/y/radius may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1477 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1478 |
%{ /* NOCONTEXT */ |
1932 | 1479 |
Coord c_x, c_y, c_radius; |
1480 |
||
1481 |
_COORD_ (x, c_x) |
|
1482 |
_COORD_ (y, c_y) |
|
1483 |
_COORD_ (radius, c_radius) |
|
1484 |
||
1485 |
SETWIN(aGLXWindowId) |
|
1486 |
#ifdef OPENGL |
|
1487 |
#else |
|
1488 |
circ(c_x, c_y, c_radius); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1489 |
#endif |
294 | 1490 |
%} |
1491 |
! |
|
1492 |
||
1493 |
glxCircfX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1494 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1495 |
x/y/radius may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1496 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1497 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1498 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1499 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1500 |
Coord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1501 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1502 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1503 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1504 |
_COORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1505 |
|
1932 | 1506 |
#ifdef OPENGL |
1507 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1508 |
circf(c_x, c_y, c_radius); |
1932 | 1509 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1510 |
} |
294 | 1511 |
%} |
1512 |
! |
|
1513 |
||
1514 |
glxCircfiX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1515 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1516 |
x/y/radius must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1517 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1518 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1519 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1520 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1521 |
Icoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1522 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1523 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1524 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1525 |
_ICOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1526 |
|
1932 | 1527 |
#ifdef OPENGL |
1528 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1529 |
circfi(c_x, c_y, c_radius); |
1932 | 1530 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1531 |
} |
294 | 1532 |
%} |
1533 |
! |
|
1534 |
||
1535 |
glxCircfsX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1536 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1537 |
x/y/radius must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1538 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1539 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1540 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1541 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1542 |
Scoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1543 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1544 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1545 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1546 |
_SCOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1547 |
|
1932 | 1548 |
#ifdef OPENGL |
1549 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1550 |
circfs(c_x, c_y, c_radius); |
1932 | 1551 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1552 |
} |
294 | 1553 |
%} |
1554 |
! |
|
1555 |
||
1556 |
glxCirciX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1557 |
"draw a circle (unfilled). |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1558 |
x/y/radius must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1559 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1560 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1561 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1562 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1563 |
Icoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1564 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1565 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1566 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1567 |
_ICOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1568 |
|
1932 | 1569 |
#ifdef OPENGL |
1570 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1571 |
circi(c_x, c_y, c_radius); |
1932 | 1572 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1573 |
} |
294 | 1574 |
%} |
1575 |
! |
|
1576 |
||
1577 |
glxCircsX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1578 |
"draw a circle (unfilled) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1579 |
x/y/radius must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1580 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1581 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1582 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1583 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1584 |
Scoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1585 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1586 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1587 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1588 |
_SCOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1589 |
|
1932 | 1590 |
#ifdef OPENGL |
1591 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1592 |
circs(c_x, c_y, c_radius); |
1932 | 1593 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1594 |
} |
294 | 1595 |
%} |
1596 |
! ! |
|
1597 |
||
528 | 1598 |
!GLXWorkstation methodsFor:'attribute stack'! |
1599 |
||
1600 |
glxPopattributesIn: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1601 |
"pop (and forget) the top entry on the attribute stack" |
528 | 1602 |
|
1603 |
%{ /* NOCONTEXT */ |
|
1604 |
SETWIN(aGLXWindowId) |
|
1932 | 1605 |
#ifndef OPENGL |
528 | 1606 |
popattributes(); |
1932 | 1607 |
#endif |
528 | 1608 |
%} |
1609 |
||
1610 |
"Modified: 19.3.1996 / 18:42:53 / cg" |
|
1611 |
! |
|
1612 |
||
1613 |
glxPushattributesIn: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1614 |
"save the current attributes on the attribute stack" |
528 | 1615 |
|
1616 |
%{ /* NOCONTEXT */ |
|
1617 |
SETWIN(aGLXWindowId) |
|
1932 | 1618 |
#ifndef OPENGL |
528 | 1619 |
pushattributes(); |
1932 | 1620 |
#endif |
528 | 1621 |
%} |
1622 |
||
1623 |
"Modified: 19.3.1996 / 18:43:04 / cg" |
|
1624 |
! ! |
|
1625 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1626 |
!GLXWorkstation methodsFor:'character position'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1627 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1628 |
glxCmov2X: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1629 |
"change the character position to a 2D point, as passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1630 |
The arguments may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1631 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1632 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1633 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1634 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1635 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1636 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1637 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1638 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1639 |
|
1932 | 1640 |
#ifdef OPENGL |
1641 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1642 |
cmov2(c_x, c_y); |
1932 | 1643 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1644 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1645 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1646 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1647 |
"Modified: 22.3.1996 / 18:17:38 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1648 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1649 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1650 |
glxCmov2iX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1651 |
"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
|
1652 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1653 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1654 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1655 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1656 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1657 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1658 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1659 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1660 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1661 |
|
1932 | 1662 |
#ifdef OPENGL |
1663 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1664 |
cmov2i(c_x, c_y); |
1932 | 1665 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1666 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1667 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1668 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1669 |
"Modified: 22.3.1996 / 18:17:43 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1670 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1671 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1672 |
glxCmov2sX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1673 |
"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
|
1674 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1675 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1676 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1677 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1678 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1679 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1680 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1681 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1682 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1683 |
|
1932 | 1684 |
#ifdef OPENGL |
1685 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1686 |
cmov2s(c_x, c_y); |
1932 | 1687 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1688 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1689 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1690 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1691 |
"Modified: 22.3.1996 / 18:17:47 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1692 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1693 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1694 |
glxCmovX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1695 |
"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
|
1696 |
The arguments may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1697 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1698 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1699 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1700 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1701 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1702 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1703 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1704 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1705 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1706 |
|
1932 | 1707 |
#ifdef OPENGL |
1708 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1709 |
cmov(c_x, c_y, c_z); |
1932 | 1710 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1711 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1712 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1713 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1714 |
"Modified: 22.3.1996 / 18:17:22 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1715 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1716 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1717 |
glxCmoviX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1718 |
"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
|
1719 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1720 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1721 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1722 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1723 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1724 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1725 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1726 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1727 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1728 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1729 |
|
1932 | 1730 |
#ifdef OPENGL |
1731 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1732 |
cmovi(c_x, c_y, c_z); |
1932 | 1733 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1734 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1735 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1736 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1737 |
"Modified: 22.3.1996 / 18:17:55 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1738 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1739 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1740 |
glxCmovsX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1741 |
"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
|
1742 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1743 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1744 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1745 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1746 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1747 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1748 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1749 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1750 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1751 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1752 |
|
1932 | 1753 |
#ifdef OPENGL |
1754 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1755 |
cmovs(c_x, c_y, c_z); |
1932 | 1756 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1757 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1758 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1759 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1760 |
"Modified: 22.3.1996 / 18:17:59 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1761 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1762 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1763 |
glxGetcposIn: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1764 |
"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
|
1765 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1766 |
| x y | |
4718 | 1767 |
%{ |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1768 |
short s_x, s_y; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1769 |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1770 |
SETWIN(aGLXWindowId) |
1932 | 1771 |
#ifdef OPENGL |
1772 |
#else |
|
1773 |
# ifdef GLX |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1774 |
getcpos(&s_x, &s_y); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1775 |
x = __MKSMALLINT(s_x); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1776 |
y = __MKSMALLINT(s_y); |
1932 | 1777 |
# endif |
1778 |
#endif |
|
1779 |
%}. |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1780 |
^x @ y |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1781 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1782 |
|
294 | 1783 |
!GLXWorkstation methodsFor:'clearing'! |
1784 |
||
1785 |
glxClearIn:aGLXWindowId |
|
1786 |
"clear to current color" |
|
1787 |
||
1788 |
%{ /* NOCONTEXT */ |
|
1789 |
SETWIN(aGLXWindowId) |
|
1932 | 1790 |
#ifdef OPENGL |
1791 |
#else |
|
294 | 1792 |
clear(); |
1932 | 1793 |
#endif |
294 | 1794 |
%} |
1795 |
! |
|
1796 |
||
1797 |
glxCzclearCval:cval zval:zval in:aGLXWindowId |
|
1798 |
"clear to a color (cval) and clear z buffer to zval simultaniously" |
|
1799 |
||
1800 |
%{ /* NOCONTEXT */ |
|
1932 | 1801 |
SETWIN(aGLXWindowId) |
1802 |
#ifdef OPENGL |
|
1803 |
#else |
|
1804 |
# ifdef GLX |
|
294 | 1805 |
czclear((ulong)__intVal(cval), __intVal(zval)); |
1932 | 1806 |
# endif |
1807 |
#endif |
|
1808 |
%} |
|
294 | 1809 |
! |
1810 |
||
1811 |
glxZClearIn:aGLXWindowId |
|
1812 |
"clear z buffer" |
|
1813 |
||
1814 |
%{ /* NOCONTEXT */ |
|
1932 | 1815 |
SETWIN(aGLXWindowId) |
1816 |
#ifdef OPENGL |
|
1817 |
#else |
|
1818 |
# ifdef GLX |
|
294 | 1819 |
zclear(); |
1932 | 1820 |
# endif |
1821 |
#endif |
|
1822 |
%} |
|
294 | 1823 |
! ! |
1824 |
||
1825 |
!GLXWorkstation methodsFor:'color'! |
|
1826 |
||
1827 |
glxColor:index in:aGLXWindowId |
|
4718 | 1828 |
"set the drawing color; |
7656 | 1829 |
for non gouraud shading, we don't care if the argument is integer or float; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1830 |
otherwise, better results are expected with float values." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1831 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1832 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1833 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1834 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1835 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1836 |
#else |
294 | 1837 |
if (__isSmallInteger(index)) { |
7656 | 1838 |
color((Colorindex)(__intVal(index))); |
1839 |
RETURN (self); |
|
294 | 1840 |
} |
1841 |
if (__isFloat(index)) { |
|
7656 | 1842 |
colorf((float)(_floatVal(index))); |
1843 |
RETURN (self); |
|
294 | 1844 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1845 |
#endif |
1932 | 1846 |
%} |
294 | 1847 |
! |
1848 |
||
1849 |
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
|
1850 |
"set the drawing color, including alpha value. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1851 |
The args must be integer values within 0..255" |
294 | 1852 |
|
1853 |
%{ /* NOCONTEXT */ |
|
1854 |
short s_r, s_g, s_b, s_a; |
|
1855 |
||
1856 |
_INT_(r, s_r); |
|
1857 |
_INT_(g, s_g); |
|
1858 |
_INT_(b, s_b); |
|
1859 |
_INT_(a, s_a); |
|
1860 |
SETWIN(aGLXWindowId) |
|
1932 | 1861 |
#ifdef GLX |
294 | 1862 |
cpack((((((s_a<<8) | s_b) << 8) | s_g) << 8) | s_r); |
1932 | 1863 |
#endif |
1864 |
%} |
|
294 | 1865 |
! |
1866 |
||
1867 |
glxColorRed:r green:g blue:b in:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1868 |
"set the drawing color. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1869 |
The args must be integer values in 0..255" |
294 | 1870 |
|
1871 |
%{ /* NOCONTEXT */ |
|
1872 |
short s_r, s_g, s_b; |
|
1873 |
||
1874 |
_INT_(r, s_r); |
|
1875 |
_INT_(g, s_g); |
|
1876 |
_INT_(b, s_b); |
|
1877 |
SETWIN(aGLXWindowId) |
|
1932 | 1878 |
#ifdef GLX |
294 | 1879 |
RGBcolor(s_r, s_g, s_b); |
1932 | 1880 |
#endif |
1881 |
%} |
|
294 | 1882 |
! |
1883 |
||
528 | 1884 |
glxLrgbrangeRmin: rmin gmin: gmin bmin: bmin rmax: rmax gmax: gmax bmax: bmax |
1885 |
znear: znear zfar: zfar in: aGLXWindowId |
|
1886 |
||
1887 |
%{ /* NOCONTEXT */ |
|
1932 | 1888 |
SETWIN(aGLXWindowId) |
1889 |
#ifdef GLX |
|
4718 | 1890 |
lRGBrange(_shortVal(rmin), _shortVal(gmin), _shortVal(bmin), |
1891 |
_shortVal(rmax), _shortVal(gmax), _shortVal(bmax), |
|
528 | 1892 |
_longVal(znear), _longVal(zfar)); |
1932 | 1893 |
#endif |
1894 |
%} |
|
528 | 1895 |
! |
1896 |
||
1897 |
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
|
1898 |
"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
|
1899 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1900 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1901 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1902 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1903 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1904 |
#else |
528 | 1905 |
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
|
1906 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1907 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1908 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1909 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1910 |
glxTextcolor:tcolor in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1911 |
"change the color used for text drawing" |
294 | 1912 |
|
1913 |
%{ /* NOCONTEXT */ |
|
1932 | 1914 |
SETWIN(aGLXWindowId) |
1915 |
#ifdef GLX |
|
294 | 1916 |
textcolor(_colorindexVal(tcolor)); |
1932 | 1917 |
#endif |
1918 |
%} |
|
294 | 1919 |
! ! |
1920 |
||
528 | 1921 |
!GLXWorkstation methodsFor:'curves'! |
1922 |
||
1923 |
glxCurvebasis: basid in: aGLXWindowId |
|
1924 |
"sets the basis type of curves" |
|
1925 |
||
1926 |
%{ /* NOCONTEXT */ |
|
1927 |
SETWIN(aGLXWindowId) |
|
1932 | 1928 |
#ifdef GLX |
528 | 1929 |
curvebasis(_shortVal(basid)); |
1932 | 1930 |
#endif |
528 | 1931 |
%} |
1932 |
||
1933 |
"Modified: 19.3.1996 / 18:47:09 / cg" |
|
1934 |
! |
|
1935 |
||
1936 |
glxCurveit: iterationcount in: aGLXWindowId |
|
1937 |
"Iterates the top matrix on the stack as a forward difference |
|
1938 |
matrix, drawing as it goes along." |
|
1939 |
||
1940 |
%{ /* NOCONTEXT */ |
|
1941 |
SETWIN(aGLXWindowId) |
|
1932 | 1942 |
#ifdef GLX |
528 | 1943 |
curveit(_shortVal(iterationcount)); |
1932 | 1944 |
#endif |
528 | 1945 |
%} |
1946 |
||
1947 |
"Modified: 19.3.1996 / 18:48:57 / cg" |
|
1948 |
! |
|
1949 |
||
1950 |
glxCurveprecision: nsegments in: aGLXWindowId |
|
1951 |
"sets the number of line segments that make up a curve segment" |
|
1952 |
||
1953 |
%{ /* NOCONTEXT */ |
|
1954 |
SETWIN(aGLXWindowId) |
|
1932 | 1955 |
#ifdef GLX |
528 | 1956 |
curveprecision(_shortVal(nsegments)); |
1932 | 1957 |
#endif |
528 | 1958 |
%} |
1959 |
||
1960 |
"Modified: 19.3.1996 / 18:47:43 / cg" |
|
1961 |
! ! |
|
1962 |
||
294 | 1963 |
!GLXWorkstation methodsFor:'double buffering'! |
1964 |
||
1965 |
glxBackBufferIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1966 |
"switch to back buffer drawing - turning frontbuffer drawing off" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1967 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1968 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1969 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1970 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1971 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1972 |
# ifdef GLX |
294 | 1973 |
frontbuffer(FALSE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1974 |
# endif |
294 | 1975 |
backbuffer(TRUE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1976 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1977 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1978 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1979 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1980 |
glxBackbuffer:b in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1981 |
"turn backBuffer drawing on/off. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1982 |
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
|
1983 |
... enabling the backbuffer automatically disables frontbuffer drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1984 |
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
|
1985 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1986 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1987 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1988 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1989 |
#else |
294 | 1990 |
backbuffer(_booleanVal(b)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1991 |
#endif |
294 | 1992 |
%} |
528 | 1993 |
|
1994 |
"Modified: 19.3.1996 / 18:45:05 / cg" |
|
294 | 1995 |
! |
1996 |
||
1997 |
glxDoubleBufferIn:aGLXWindowId |
|
1998 |
"set double buffer mode" |
|
1999 |
||
2000 |
%{ /* NOCONTEXT */ |
|
2001 |
SETWIN(aGLXWindowId) |
|
1932 | 2002 |
#ifdef OPENGL |
2003 |
#else |
|
294 | 2004 |
doublebuffer(); |
1932 | 2005 |
#endif |
294 | 2006 |
%} |
2007 |
! |
|
2008 |
||
2009 |
glxFrontBufferIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2010 |
"switch to front buffer drawing - turning backbuffer drawing off" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2011 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2012 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2013 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2014 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2015 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2016 |
# ifdef GLX |
294 | 2017 |
backbuffer(FALSE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2018 |
# endif |
294 | 2019 |
frontbuffer(TRUE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2020 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2021 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2022 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2023 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2024 |
glxFrontbuffer:b in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2025 |
"turn on/off frontbuffer drawing. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2026 |
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
|
2027 |
... enabling the backbuffer automatically disables frontbuffer drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2028 |
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
|
2029 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2030 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2031 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2032 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2033 |
#else |
294 | 2034 |
frontbuffer(_booleanVal(b)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2035 |
#endif |
294 | 2036 |
%} |
528 | 2037 |
|
2038 |
"Modified: 19.3.1996 / 18:45:31 / cg" |
|
294 | 2039 |
! |
2040 |
||
2041 |
glxSingleBufferIn: aGLXWindowId |
|
2042 |
"set single buffer mode" |
|
2043 |
||
2044 |
%{ /* NOCONTEXT */ |
|
2045 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2046 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2047 |
#else |
294 | 2048 |
singlebuffer(); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2049 |
#endif |
294 | 2050 |
%} |
2051 |
! |
|
2052 |
||
2053 |
glxSwapBuffersIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2054 |
"swap the back and front buffers. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2055 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2056 |
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
|
2057 |
displayed and swap them for every frame." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2058 |
|
1903 | 2059 |
%{ /* UNLIMITEDSTACK */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2060 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2061 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2062 |
#else |
294 | 2063 |
swapbuffers(); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2064 |
#endif |
294 | 2065 |
%} |
528 | 2066 |
|
2067 |
"Modified: 19.3.1996 / 18:45:47 / cg" |
|
294 | 2068 |
! ! |
2069 |
||
2070 |
!GLXWorkstation methodsFor:'flat drawing'! |
|
2071 |
||
2072 |
glxBeginClosedLineIn:aGLXWindowId |
|
2073 |
"start a closed line" |
|
2074 |
||
2075 |
%{ /* NOCONTEXT */ |
|
1932 | 2076 |
#ifdef OPENGL |
2077 |
#else |
|
294 | 2078 |
SETWIN(aGLXWindowId) |
2079 |
bgnclosedline(); |
|
1932 | 2080 |
#endif |
294 | 2081 |
%} |
2082 |
! |
|
2083 |
||
2084 |
glxBeginLineIn:aGLXWindowId |
|
2085 |
"start a line group" |
|
2086 |
||
2075 | 2087 |
%{ /* NOCONTEXT STACK:32000 */ |
1932 | 2088 |
#ifdef OPENGL |
2089 |
#else |
|
294 | 2090 |
SETWIN(aGLXWindowId) |
2091 |
bgnline(); |
|
1932 | 2092 |
#endif |
294 | 2093 |
%} |
2094 |
! |
|
2095 |
||
2096 |
glxBeginPointIn:aGLXWindowId |
|
2097 |
"start a point-group" |
|
2098 |
||
2099 |
%{ /* NOCONTEXT */ |
|
1932 | 2100 |
#ifdef OPENGL |
2101 |
#else |
|
294 | 2102 |
SETWIN(aGLXWindowId) |
2103 |
bgnpoint(); |
|
1932 | 2104 |
#endif |
294 | 2105 |
%} |
2106 |
! |
|
2107 |
||
2108 |
glxBeginPolygonIn:aGLXWindowId |
|
2109 |
"start a polygon" |
|
2110 |
||
2111 |
%{ /* NOCONTEXT */ |
|
1932 | 2112 |
#ifdef OPENGL |
2113 |
#else |
|
294 | 2114 |
SETWIN(aGLXWindowId) |
2115 |
bgnpolygon(); |
|
1932 | 2116 |
#endif |
294 | 2117 |
%} |
2118 |
! |
|
2119 |
||
2120 |
glxBeginQuadrilateralStripIn:aGLXWindowId |
|
2121 |
"start a quadrilateral strip" |
|
2122 |
||
2123 |
%{ /* NOCONTEXT */ |
|
1932 | 2124 |
#ifdef OPENGL |
2125 |
#else |
|
294 | 2126 |
SETWIN(aGLXWindowId) |
2127 |
bgnqstrip(); |
|
1932 | 2128 |
#endif |
294 | 2129 |
%} |
2130 |
! |
|
2131 |
||
2132 |
glxBeginTriangleMeshIn:aGLXWindowId |
|
2133 |
"start a triangle mesh" |
|
2134 |
||
2135 |
%{ /* NOCONTEXT */ |
|
1932 | 2136 |
#ifdef OPENGL |
2137 |
#else |
|
294 | 2138 |
SETWIN(aGLXWindowId) |
2139 |
bgntmesh(); |
|
1932 | 2140 |
#endif |
294 | 2141 |
%} |
2142 |
! |
|
2143 |
||
2144 |
glxEndClosedLineIn:aGLXWindowId |
|
2145 |
"end a closed line" |
|
2146 |
||
2147 |
%{ /* NOCONTEXT */ |
|
1932 | 2148 |
#ifdef OPENGL |
2149 |
#else |
|
294 | 2150 |
SETWIN(aGLXWindowId) |
2151 |
endclosedline(); |
|
1932 | 2152 |
#endif |
294 | 2153 |
%} |
2154 |
! |
|
2155 |
||
2156 |
glxEndLineIn:aGLXWindowId |
|
2157 |
"end a line group" |
|
2158 |
||
2075 | 2159 |
%{ /* NOCONTEXT STACK:32000 */ |
1932 | 2160 |
#ifdef OPENGL |
2161 |
#else |
|
294 | 2162 |
SETWIN(aGLXWindowId) |
2163 |
endline(); |
|
1932 | 2164 |
#endif |
294 | 2165 |
%} |
2166 |
! |
|
2167 |
||
2168 |
glxEndPointIn:aGLXWindowId |
|
2169 |
"end a point group" |
|
2170 |
||
2171 |
%{ /* NOCONTEXT */ |
|
1932 | 2172 |
#ifdef OPENGL |
2173 |
#else |
|
294 | 2174 |
SETWIN(aGLXWindowId) |
2175 |
endpoint(); |
|
1932 | 2176 |
#endif |
294 | 2177 |
%} |
2178 |
! |
|
2179 |
||
2180 |
glxEndPolygonIn:aGLXWindowId |
|
2181 |
"end a polygon" |
|
2182 |
||
2183 |
%{ /* NOCONTEXT */ |
|
1932 | 2184 |
#ifdef OPENGL |
2185 |
#else |
|
294 | 2186 |
SETWIN(aGLXWindowId) |
2187 |
endpolygon(); |
|
1932 | 2188 |
#endif |
294 | 2189 |
%} |
2190 |
! |
|
2191 |
||
2192 |
glxEndQuadrilateralStripIn:aGLXWindowId |
|
2193 |
"end a quadrilateral strip" |
|
2194 |
||
2195 |
%{ /* NOCONTEXT */ |
|
1932 | 2196 |
#ifdef OPENGL |
2197 |
#else |
|
294 | 2198 |
SETWIN(aGLXWindowId) |
2199 |
endqstrip(); |
|
1932 | 2200 |
#endif |
294 | 2201 |
%} |
2202 |
! |
|
2203 |
||
2204 |
glxEndTriangleMeshIn:aGLXWindowId |
|
2205 |
"end a triangle mesh" |
|
2206 |
||
2207 |
%{ /* NOCONTEXT */ |
|
1932 | 2208 |
#ifdef OPENGL |
2209 |
#else |
|
294 | 2210 |
SETWIN(aGLXWindowId) |
2211 |
endtmesh(); |
|
1932 | 2212 |
#endif |
168 | 2213 |
%} |
2214 |
! ! |
|
2215 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2216 |
!GLXWorkstation methodsFor:'graphics position'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2217 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2218 |
glxMove2:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2219 |
"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
|
2220 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2221 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2222 |
float vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2223 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2224 |
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
|
2225 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2226 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2227 |
#else |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2228 |
move2((Coord)(c_v[0]), (Coord)(c_v[1])); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2229 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2230 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2231 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2232 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2233 |
"Modified: 22.3.1996 / 18:15:23 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2236 |
glxMove2X: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2237 |
"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
|
2238 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2239 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2240 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2241 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2242 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2243 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2244 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2245 |
SETWIN(aGLXWindowId) |
1932 | 2246 |
#ifdef OPENGL |
2247 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2248 |
move2(c_x, c_y); |
1932 | 2249 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2250 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2251 |
%} |
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 |
"Modified: 22.3.1996 / 18:15:02 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2254 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2255 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2256 |
glxMove2iX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2257 |
"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
|
2258 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2259 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2260 |
%{ /* NOCONTEXT */ |
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 |
Icoord c_x, c_y; |
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 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2265 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2266 |
SETWIN(aGLXWindowId) |
1932 | 2267 |
#ifdef OPENGL |
2268 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2269 |
move2i(c_x, c_y); |
1932 | 2270 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2271 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2272 |
%} |
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 |
"Modified: 22.3.1996 / 18:15:08 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2275 |
! |
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 |
glxMove2sX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2278 |
"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
|
2279 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2280 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2281 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2282 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2283 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2284 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2285 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2286 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2287 |
SETWIN(aGLXWindowId) |
1932 | 2288 |
#ifdef OPENGL |
2289 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2290 |
move2s(c_x, c_y); |
1932 | 2291 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2292 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2293 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2294 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2295 |
"Modified: 22.3.1996 / 18:15:13 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2298 |
glxMove:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2299 |
"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
|
2300 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2301 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2302 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2303 |
float vec[3], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2304 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2305 |
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
|
2306 |
SETWIN(aGLXWindowId) |
1932 | 2307 |
#ifdef OPENGL |
2308 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2309 |
move((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
1932 | 2310 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2311 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2312 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2313 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2314 |
"Modified: 22.3.1996 / 18:14:29 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2315 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2316 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2317 |
glxMoveX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2318 |
"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
|
2319 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2320 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2321 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2322 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2323 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2324 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2325 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2326 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2327 |
SETWIN(aGLXWindowId) |
1932 | 2328 |
#ifdef OPENGL |
2329 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2330 |
move(c_x, c_y, c_z); |
1932 | 2331 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2332 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2333 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2334 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2335 |
"Modified: 22.3.1996 / 18:14:38 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2336 |
! |
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 |
glxMoveiX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2339 |
"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
|
2340 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2341 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2342 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2343 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2344 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2345 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2346 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2347 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2348 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2349 |
SETWIN(aGLXWindowId) |
1932 | 2350 |
#ifdef OPENGL |
2351 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2352 |
movei(c_x, c_y, c_z); |
1932 | 2353 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2354 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2355 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2356 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2357 |
"Modified: 22.3.1996 / 18:14:44 / cg" |
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 |
glxMovesX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2361 |
"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
|
2362 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2363 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2364 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2365 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2366 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2367 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2368 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2369 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2370 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2371 |
SETWIN(aGLXWindowId) |
1932 | 2372 |
#ifdef OPENGL |
2373 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2374 |
moves(c_x, c_y, c_z); |
1932 | 2375 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2376 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2377 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2378 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2379 |
"Modified: 22.3.1996 / 18:14:48 / cg" |
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 |
glxRmv2:v in: aGLXWindowId |
4718 | 2383 |
"change the graphics position to a 2D point, |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2384 |
the relative distance is passed in vector v" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2385 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2386 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2387 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2388 |
float vec[2], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2389 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2390 |
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
|
2391 |
SETWIN(aGLXWindowId) |
1932 | 2392 |
#ifdef OPENGL |
2393 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2394 |
rmv2((Coord)(c_v[0]), (Coord)(c_v[1])); |
1932 | 2395 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2396 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2397 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2398 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2399 |
"Modified: 22.3.1996 / 18:15:57 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2400 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2401 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2402 |
glxRmv2X: x y: y in: aGLXWindowId |
4718 | 2403 |
"change the graphics position to a 2D point, |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2404 |
the relative distance is passed in x/y" |
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 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2407 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2408 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2409 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2410 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2411 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2412 |
SETWIN(aGLXWindowId) |
1932 | 2413 |
#ifdef OPENGL |
2414 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2415 |
rmv2(c_x, c_y); |
1932 | 2416 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2417 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2418 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2419 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2420 |
"Modified: 22.3.1996 / 18:16:42 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2421 |
! |
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 |
glxRmv2iX: x y: y in: aGLXWindowId |
4718 | 2424 |
"change the graphics position to a 2D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2425 |
the relative distance is passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2426 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2427 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2428 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2429 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2430 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2431 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2432 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2433 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2434 |
SETWIN(aGLXWindowId) |
1932 | 2435 |
#ifdef OPENGL |
2436 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2437 |
rmv2i(c_x, c_y); |
1932 | 2438 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2439 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2440 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2441 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2442 |
"Modified: 22.3.1996 / 18:16:39 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2443 |
! |
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 |
glxRmv2sX: x y: y in: aGLXWindowId |
4718 | 2446 |
"change the graphics position to a 2D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2447 |
the relative distance is passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2448 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2449 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2450 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2451 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2452 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2453 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2454 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2455 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2456 |
SETWIN(aGLXWindowId) |
1932 | 2457 |
#ifdef OPENGL |
2458 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2459 |
rmv2s(c_x, c_y); |
1932 | 2460 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2461 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2462 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2463 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2464 |
"Modified: 22.3.1996 / 18:16:33 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2465 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2466 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2467 |
glxRmv:v in: aGLXWindowId |
4718 | 2468 |
"change the graphics position to a 3D point, |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2469 |
the relative distance is passed in vector v" |
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 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2472 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2473 |
float vec[3], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2474 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2475 |
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
|
2476 |
SETWIN(aGLXWindowId) |
1932 | 2477 |
#ifdef OPENGL |
2478 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2479 |
rmv((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
1932 | 2480 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2481 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2482 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2483 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2484 |
"Modified: 22.3.1996 / 18:16:08 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2485 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2486 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2487 |
glxRmvX: x y: y z: z in: aGLXWindowId |
4718 | 2488 |
"change the graphics position to a 3D point, |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2489 |
the relative distance is passed in x/y/z" |
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 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2492 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2493 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2494 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2495 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2496 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2497 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2498 |
SETWIN(aGLXWindowId) |
1932 | 2499 |
#ifdef OPENGL |
2500 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2501 |
rmv(c_x, c_y, c_z); |
1932 | 2502 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2503 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2504 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2505 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2506 |
"Modified: 22.3.1996 / 18:16:16 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2507 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2508 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2509 |
glxRmviX: x y: y z: z in: aGLXWindowId |
4718 | 2510 |
"change the graphics position to a 3D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2511 |
the relative distance is passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2512 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2513 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2514 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2515 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2516 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2517 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2518 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2519 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2520 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2521 |
SETWIN(aGLXWindowId) |
1932 | 2522 |
#ifdef OPENGL |
2523 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2524 |
rmvi(c_x, c_y, c_z); |
1932 | 2525 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2526 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2527 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2528 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2529 |
"Modified: 22.3.1996 / 18:16:21 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2530 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2531 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2532 |
glxRmvsX: x y: y z: z in: aGLXWindowId |
4718 | 2533 |
"change the graphics position to a 3D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2534 |
the relative distance is passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2535 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2536 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2537 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2538 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2539 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2540 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2541 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2542 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2543 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2544 |
SETWIN(aGLXWindowId) |
1932 | 2545 |
#ifdef OPENGL |
2546 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2547 |
rmvs(c_x, c_y, c_z); |
1932 | 2548 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2549 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2550 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2551 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2552 |
"Modified: 22.3.1996 / 18:16:25 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2553 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2554 |
|
168 | 2555 |
!GLXWorkstation methodsFor:'initialization'! |
2556 |
||
2557 |
initializeFor:aDisplayName |
|
169 | 2558 |
(super initializeFor:aDisplayName) isNil ifTrue:[^ nil]. |
168 | 2559 |
%{ |
2560 |
if (_INST(displayId) != nil) { |
|
185 | 2561 |
XSetErrorHandler(__XErrorHandler__); |
2562 |
} |
|
2563 |
%} |
|
2564 |
! |
|
2565 |
||
2566 |
initializeScreenProperties |
|
2567 |
super initializeScreenProperties. |
|
2568 |
||
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2569 |
"/ 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
|
2570 |
"/ 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
|
2571 |
"/ 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
|
2572 |
"/ 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
|
2573 |
"/ 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
|
2574 |
"/ 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
|
2575 |
"/ 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
|
2576 |
"/ have no documentation). |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2577 |
"/ Late note: setting the ForceGL classVar overrides above behavior. |
4718 | 2578 |
"/ it may be set from a startupScript with: 'GLXWorkstation forceGL:true' |
2579 |
"/ however: be careful: only set it to true, if you are certain that remoteGL works |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2580 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2581 |
(self isTrueGL and:[ForceGL ~~ true]) ifTrue:[ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2582 |
glOK := (displayName = ':0') or:[displayName = ':0.0']. |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2583 |
] ifFalse:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2584 |
glOK := true. |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2585 |
]. |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2586 |
|
185 | 2587 |
%{ |
2588 |
Display *dpy = myDpy; |
|
2589 |
int dummy; |
|
2590 |
||
2591 |
if (ISCONNECTED) { |
|
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2592 |
_INST(hasStereoExtension) = false; |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2593 |
|
1932 | 2594 |
#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
|
2595 |
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
|
2596 |
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
|
2597 |
_INST(hasStereoExtension) = true; |
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2598 |
} |
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2599 |
#endif |
168 | 2600 |
} |
2601 |
%} |
|
2602 |
! ! |
|
2603 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2604 |
!GLXWorkstation methodsFor:'lines'! |
528 | 2605 |
|
2606 |
glxDeflinestyleN: n ls: ls in: aGLXWindowId |
|
2607 |
"define a line style" |
|
2608 |
||
2609 |
%{ /* NOCONTEXT */ |
|
1932 | 2610 |
SETWIN(aGLXWindowId) |
2611 |
#ifdef OPENGL |
|
2612 |
#else |
|
528 | 2613 |
deflinestyle(_shortVal(n), _linestyleVal(ls)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2614 |
#endif |
528 | 2615 |
%} |
2616 |
! |
|
2617 |
||
2618 |
glxDraw2:v 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 vector v." |
528 | 2621 |
|
2622 |
%{ /* NOCONTEXT */ |
|
2623 |
float vec[2], *c_v; |
|
2624 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2625 |
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
|
2626 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2627 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2628 |
#else |
528 | 2629 |
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
|
2630 |
#endif |
528 | 2631 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2632 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2633 |
"Modified: 22.3.1996 / 18:03:29 / cg" |
528 | 2634 |
! |
2635 |
||
2636 |
glxDraw2X: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2637 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2638 |
to a new 2D position, passed in x/y." |
528 | 2639 |
|
2640 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2641 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2642 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2643 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2644 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2645 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2646 |
SETWIN(aGLXWindowId) |
1932 | 2647 |
#ifdef OPENGL |
2648 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2649 |
draw2(c_x, c_y); |
1932 | 2650 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2651 |
} |
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:03:50 / cg" |
528 | 2655 |
! |
2656 |
||
2657 |
glxDraw2iX: x y: y 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 |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2659 |
to a new 2D position, passed in x/y." |
528 | 2660 |
|
2661 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2662 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2663 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2664 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2665 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2666 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2667 |
SETWIN(aGLXWindowId) |
1932 | 2668 |
#ifdef OPENGL |
2669 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2670 |
draw2i(c_x, c_y); |
1932 | 2671 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2672 |
} |
528 | 2673 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2674 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2675 |
"Modified: 22.3.1996 / 18:04:07 / cg" |
528 | 2676 |
! |
2677 |
||
2678 |
glxDraw2sX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2679 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2680 |
to a new 2D position, passed in x/y." |
528 | 2681 |
|
2682 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2683 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2684 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2685 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2686 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2687 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2688 |
SETWIN(aGLXWindowId) |
1932 | 2689 |
#ifdef OPENGL |
2690 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2691 |
draw2s(c_x, c_y); |
1932 | 2692 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2693 |
} |
528 | 2694 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2695 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2696 |
"Modified: 22.3.1996 / 18:04:19 / cg" |
528 | 2697 |
! |
2698 |
||
2699 |
glxDraw:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2700 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2701 |
to a new 3D position, passed in vector v." |
528 | 2702 |
|
2703 |
%{ /* NOCONTEXT */ |
|
2704 |
float vec[3], *c_v; |
|
2705 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2706 |
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
|
2707 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2708 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2709 |
#else |
528 | 2710 |
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
|
2711 |
#endif |
528 | 2712 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2713 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2714 |
"Modified: 22.3.1996 / 18:04:34 / cg" |
528 | 2715 |
! |
2716 |
||
2717 |
glxDrawX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2718 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2719 |
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
|
2720 |
The arguments may be floats, fractions or smallIntegers" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2721 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2722 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2723 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2724 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2725 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2726 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2727 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2728 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2729 |
SETWIN(aGLXWindowId) |
1932 | 2730 |
#ifdef OPENGL |
2731 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2732 |
draw(c_x, c_y, c_z); |
1932 | 2733 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2734 |
} |
528 | 2735 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2736 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2737 |
"Modified: 22.3.1996 / 18:04:46 / cg" |
528 | 2738 |
! |
2739 |
||
2740 |
glxDrawiX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2741 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2742 |
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
|
2743 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2744 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2745 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2746 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2747 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2748 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2749 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2750 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2751 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2752 |
SETWIN(aGLXWindowId) |
1932 | 2753 |
#ifdef OPENGL |
2754 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2755 |
drawi(c_x, c_y, c_z); |
1932 | 2756 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2757 |
} |
528 | 2758 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2759 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2760 |
"Modified: 22.3.1996 / 18:04:54 / cg" |
528 | 2761 |
! |
2762 |
||
2763 |
glxDrawsX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2764 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2765 |
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
|
2766 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2767 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2768 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2769 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2770 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2771 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2772 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2773 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2774 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2775 |
SETWIN(aGLXWindowId) |
1932 | 2776 |
#ifdef OPENGL |
2777 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2778 |
draws(c_x, c_y, c_z); |
1932 | 2779 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2780 |
} |
528 | 2781 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2782 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2783 |
"Modified: 22.3.1996 / 18:05:01 / cg" |
528 | 2784 |
! |
2785 |
||
2786 |
glxLinewidth: n in: aGLXWindowId |
|
2787 |
"set the linewidth" |
|
2788 |
||
2789 |
%{ /* NOCONTEXT */ |
|
2790 |
SETWIN(aGLXWindowId) |
|
1932 | 2791 |
#ifdef OPENGL |
2792 |
#else |
|
528 | 2793 |
linewidth(_shortVal(n)); |
1932 | 2794 |
#endif |
528 | 2795 |
%} |
2796 |
! |
|
2797 |
||
2798 |
glxLinewidthf: n in: aGLXWindowId |
|
2799 |
"set the linewidth" |
|
2800 |
||
2801 |
%{ /* NOCONTEXT */ |
|
2802 |
SETWIN(aGLXWindowId) |
|
1932 | 2803 |
#ifdef OPENGL |
2804 |
#else |
|
528 | 2805 |
linewidthf(_floatVal(n)); |
1932 | 2806 |
#endif |
528 | 2807 |
RETURN (true); |
2808 |
%} |
|
2809 |
! |
|
2810 |
||
2811 |
glxRdr2:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2812 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2813 |
to a new 2D position, passing the relative distance in the vector v." |
528 | 2814 |
|
2815 |
%{ /* NOCONTEXT */ |
|
2816 |
float vec[2], *c_v; |
|
2817 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2818 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
528 | 2819 |
SETWIN(aGLXWindowId) |
1932 | 2820 |
#ifdef OPENGL |
2821 |
#else |
|
528 | 2822 |
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
|
2823 |
#endif |
528 | 2824 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2825 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2826 |
"Modified: 22.3.1996 / 18:05:54 / cg" |
528 | 2827 |
! |
2828 |
||
2829 |
glxRdr2X: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2830 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2831 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2832 |
|
2833 |
%{ /* NOCONTEXT */ |
|
2834 |
Coord c_x, c_y; |
|
2835 |
||
2836 |
_COORD_ (x, c_x) |
|
2837 |
_COORD_ (y, c_y) |
|
2838 |
SETWIN(aGLXWindowId) |
|
1932 | 2839 |
#ifdef OPENGL |
2840 |
#else |
|
528 | 2841 |
rdr2(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2842 |
#endif |
528 | 2843 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2844 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2845 |
"Modified: 22.3.1996 / 18:06:20 / cg" |
528 | 2846 |
! |
2847 |
||
2848 |
glxRdr2iX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2849 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2850 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2851 |
|
2852 |
%{ /* NOCONTEXT */ |
|
2853 |
Icoord c_x, c_y; |
|
2854 |
||
2855 |
_ICOORD_ (x, c_x) |
|
2856 |
_ICOORD_ (y, c_y) |
|
2857 |
SETWIN(aGLXWindowId) |
|
1932 | 2858 |
#ifdef OPENGL |
2859 |
#else |
|
528 | 2860 |
rdr2i(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2861 |
#endif |
528 | 2862 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2863 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2864 |
"Modified: 22.3.1996 / 18:06:28 / cg" |
528 | 2865 |
! |
2866 |
||
2867 |
glxRdr2sX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2868 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2869 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2870 |
|
2871 |
%{ /* NOCONTEXT */ |
|
2872 |
Scoord c_x, c_y; |
|
2873 |
||
2874 |
_SCOORD_ (x, c_x) |
|
2875 |
_SCOORD_ (y, c_y) |
|
2876 |
SETWIN(aGLXWindowId) |
|
1932 | 2877 |
#ifdef OPENGL |
2878 |
#else |
|
528 | 2879 |
rdr2s(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2880 |
#endif |
528 | 2881 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2882 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2883 |
"Modified: 22.3.1996 / 18:06:34 / cg" |
528 | 2884 |
! |
2885 |
||
2886 |
glxRdr:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2887 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2888 |
to a new 3D position, passing the relative distance in the vector v." |
528 | 2889 |
|
2890 |
%{ /* NOCONTEXT */ |
|
2891 |
float vec[3], *c_v; |
|
2892 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2893 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
528 | 2894 |
SETWIN(aGLXWindowId) |
1932 | 2895 |
#ifdef OPENGL |
2896 |
#else |
|
528 | 2897 |
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
|
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:07 / cg" |
528 | 2902 |
! |
2903 |
||
2904 |
glxRdrX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2905 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2906 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2907 |
|
2908 |
%{ /* NOCONTEXT */ |
|
2909 |
Coord c_x, c_y, c_z; |
|
2910 |
||
2911 |
_COORD_ (x, c_x) |
|
2912 |
_COORD_ (y, c_y) |
|
2913 |
_COORD_ (z, c_z) |
|
2914 |
SETWIN(aGLXWindowId) |
|
1932 | 2915 |
#ifdef OPENGL |
2916 |
#else |
|
528 | 2917 |
rdr(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2918 |
#endif |
528 | 2919 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2920 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2921 |
"Modified: 22.3.1996 / 18:06:44 / cg" |
528 | 2922 |
! |
2923 |
||
2924 |
glxRdriX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2925 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2926 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2927 |
|
2928 |
%{ /* NOCONTEXT */ |
|
2929 |
Icoord c_x, c_y, c_z; |
|
2930 |
||
2931 |
_ICOORD_ (x, c_x) |
|
2932 |
_ICOORD_ (y, c_y) |
|
2933 |
_ICOORD_ (z, c_z) |
|
2934 |
SETWIN(aGLXWindowId) |
|
1932 | 2935 |
#ifdef OPENGL |
2936 |
#else |
|
528 | 2937 |
rdri(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2938 |
#endif |
528 | 2939 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2940 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2941 |
"Modified: 22.3.1996 / 18:06:51 / cg" |
528 | 2942 |
! |
2943 |
||
2944 |
glxRdrsX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2945 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2946 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2947 |
|
2948 |
%{ /* NOCONTEXT */ |
|
2949 |
Scoord c_x, c_y, c_z; |
|
2950 |
||
2951 |
_SCOORD_ (x, c_x) |
|
2952 |
_SCOORD_ (y, c_y) |
|
2953 |
_SCOORD_ (z, c_z) |
|
2954 |
SETWIN(aGLXWindowId) |
|
1932 | 2955 |
#ifdef OPENGL |
2956 |
#else |
|
528 | 2957 |
rdrs(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2958 |
#endif |
528 | 2959 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2960 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2961 |
"Modified: 22.3.1996 / 18:06:55 / cg" |
528 | 2962 |
! |
2963 |
||
2964 |
glxSetlinestyle: index in: aGLXWindowId |
|
2965 |
"set the linestyle" |
|
2966 |
||
2967 |
%{ /* NOCONTEXT */ |
|
2968 |
SETWIN(aGLXWindowId) |
|
1932 | 2969 |
#ifdef OPENGL |
2970 |
#else |
|
528 | 2971 |
setlinestyle(_shortVal(index)); |
1932 | 2972 |
#endif |
2973 |
%} |
|
528 | 2974 |
! ! |
2975 |
||
294 | 2976 |
!GLXWorkstation methodsFor:'materials & lights'! |
2977 |
||
2978 |
glxLmbind:target index:index in:aGLXWindowId |
|
2979 |
"select a material, light or lighting model. |
|
2980 |
target must be a symbol from: #material, #backMaterial, |
|
2981 |
#light0-light7 or #lightModel." |
|
2982 |
||
2983 |
%{ /* NOCONTEXT */ |
|
2984 |
#ifdef GLX |
|
2985 |
short defType; |
|
2986 |
short i_index; |
|
2987 |
||
2988 |
if (target == @symbol(material)) |
|
2989 |
defType = MATERIAL; |
|
2990 |
else if (target == @symbol(backMaterial)) |
|
2991 |
defType = BACKMATERIAL; |
|
2992 |
else if (target == @symbol(light0)) |
|
2993 |
defType = LIGHT0; |
|
2994 |
else if (target == @symbol(light1)) |
|
2995 |
defType = LIGHT1; |
|
2996 |
else if (target == @symbol(light2)) |
|
2997 |
defType = LIGHT2; |
|
2998 |
else if (target == @symbol(light3)) |
|
2999 |
defType = LIGHT3; |
|
3000 |
else if (target == @symbol(light4)) |
|
3001 |
defType = LIGHT4; |
|
3002 |
else if (target == @symbol(light5)) |
|
3003 |
defType = LIGHT5; |
|
3004 |
else if (target == @symbol(light6)) |
|
3005 |
defType = LIGHT6; |
|
3006 |
else if (target == @symbol(light7)) |
|
3007 |
defType = LIGHT7; |
|
3008 |
else if (target == @symbol(lightModel)) |
|
3009 |
defType = LMODEL; |
|
4718 | 3010 |
else { |
3011 |
RETURN (nil); |
|
294 | 3012 |
} |
3013 |
||
3014 |
_INT_ (index, i_index); |
|
3015 |
SETWIN(aGLXWindowId) |
|
3016 |
lmbind(defType, i_index); |
|
1932 | 3017 |
#endif |
3018 |
%} |
|
294 | 3019 |
! |
3020 |
||
3021 |
glxLmdef:what index:index np:np props:props in:aGLXWindowId |
|
3022 |
"define a material, light source or lighting model; |
|
3023 |
what must be one of #material, #light or #lightModel. |
|
3024 |
props must be a FloatArray or a subclass of FloatArray" |
|
3025 |
||
3026 |
%{ /* NOCONTEXT */ |
|
3027 |
#ifdef GLX |
|
3028 |
short defType; |
|
3029 |
short i_index, i_np; |
|
3030 |
float *fp; |
|
3031 |
OBJ cls; |
|
3032 |
int ninstVars, nInstBytes; |
|
3033 |
||
3034 |
if (what == @symbol(material)) |
|
3035 |
defType = DEFMATERIAL; |
|
3036 |
else if (what == @symbol(light)) |
|
3037 |
defType = DEFLIGHT; |
|
3038 |
else if (what == @symbol(lightModel)) |
|
3039 |
defType = DEFLMODEL; |
|
3040 |
else { |
|
1932 | 3041 |
RETURN (nil); |
294 | 3042 |
} |
3043 |
||
3044 |
_INT_ (index, i_index); |
|
3045 |
_INT_ (np, i_np); |
|
3046 |
||
3047 |
if (! _isNonNilObject(props)) fp = NULL; |
|
3048 |
else { |
|
3049 |
cls = __qClass(props); |
|
350 | 3050 |
if (cls == @global(FloatArray)) |
294 | 3051 |
fp = _FloatArrayInstPtr(props)->f_element; |
3052 |
else { |
|
3053 |
if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) { |
|
3054 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
3055 |
fp = (float *) &(_InstPtr(props)->i_instvars[ninstVars]); |
|
3056 |
} else { |
|
1932 | 3057 |
RETURN (nil); |
294 | 3058 |
} |
4718 | 3059 |
} |
294 | 3060 |
} |
3061 |
SETWIN(aGLXWindowId) |
|
3062 |
lmdef(defType, i_index, i_np, fp); |
|
1932 | 3063 |
#endif |
3064 |
%} |
|
294 | 3065 |
! |
3066 |
||
3067 |
glxTevbind:target index:index in:aGLXWindowId |
|
3068 |
"bind a texture environment; target must be 0 |
|
3069 |
or the symbol #env0." |
|
3070 |
||
3071 |
%{ /* NOCONTEXT */ |
|
3072 |
#ifdef GLX |
|
3073 |
long t; |
|
3074 |
||
3075 |
if (__isSmallInteger(target)) { |
|
3076 |
t = __intVal(target); |
|
3077 |
} else { |
|
3078 |
if (target == @symbol(env0)) { |
|
3079 |
t = TV_ENV0; |
|
3080 |
} else { |
|
1932 | 3081 |
RETURN (nil); |
294 | 3082 |
} |
3083 |
} |
|
3084 |
SETWIN(aGLXWindowId) |
|
3085 |
tevbind(t, __intVal(index)); |
|
1932 | 3086 |
#endif |
3087 |
%} |
|
294 | 3088 |
! |
3089 |
||
3090 |
glxTevdef:index np:np props:props in:aGLXWindowId |
|
3091 |
||
3092 |
%{ /* NOCONTEXT */ |
|
3093 |
#ifdef GLX |
|
3094 |
const float *fp; |
|
3095 |
float fbuff[30]; |
|
3096 |
||
3097 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3098 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
294 | 3099 |
tevdef(__intVal(index), __intVal(np), fp); |
1932 | 3100 |
#endif |
3101 |
%} |
|
294 | 3102 |
! |
3103 |
||
3104 |
glxTexDef2d:index nc:nc width:w height:h bits:image np:np props:props in:aGLXWindowId |
|
3105 |
"define a 2D texture. index is the 'name' of the texture; |
|
3106 |
nc is the number of components (1-4) per pixel; |
|
3107 |
w/h define the size of the texture; bits is a byteArray containing the |
|
3108 |
long-word aligned pixel data; np is the number of props found in |
|
3109 |
the floatArray props. Props must be delimited by a 0.0 entry." |
|
3110 |
||
3111 |
%{ /* NOCONTEXT */ |
|
6254 | 3112 |
#ifdef GLX |
294 | 3113 |
unsigned char *cp; |
3114 |
const float *fp; |
|
3115 |
OBJ cls; |
|
3116 |
float fbuff[30]; |
|
3117 |
||
5479
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3118 |
if (__isByteArrayLike(image)) { |
6254 | 3119 |
cp = _ByteArrayInstPtr(image)->ba_element; |
3120 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
|
3121 |
||
3122 |
SETWIN(aGLXWindowId) |
|
3123 |
texdef2d(__intVal(index), __intVal(nc), __intVal(w), __intVal(h), |
|
3124 |
(const unsigned long *)cp, __intVal(np), fp); |
|
294 | 3125 |
} |
3126 |
#endif |
|
3127 |
%} |
|
3128 |
! |
|
3129 |
||
3130 |
glxTexDef3d:index nc:nc width:w height:h depth:d bits:image np:np props:props in:aGLXWindowId |
|
3131 |
"define a 3D texture. index is the 'name' of the texture; |
|
3132 |
nc is the number of components (1-4) per pixel; |
|
3133 |
w/h/d define the size of the texture; bits is a byteArray containing the |
|
3134 |
long-word aligned pixel data; np is the number of props found in |
|
3135 |
the floatArray props. Props must be delimited by a 0.0 entry." |
|
3136 |
||
3137 |
%{ /* NOCONTEXT */ |
|
3138 |
#ifdef GLX |
|
3139 |
unsigned char *cp; |
|
3140 |
const float *fp; |
|
3141 |
OBJ cls; |
|
3142 |
float fbuff[30]; |
|
3143 |
||
5479
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3144 |
if (__isByteArrayLike(image)) { |
6254 | 3145 |
cp = _ByteArrayInstPtr(image)->ba_element; |
3146 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
|
3147 |
||
3148 |
SETWIN(aGLXWindowId) |
|
3149 |
texdef3d(__intVal(index), __intVal(nc), __intVal(w), __intVal(h), |
|
3150 |
__intVal(d), |
|
3151 |
(const unsigned long *)cp, __intVal(np), fp); |
|
294 | 3152 |
} |
3153 |
#endif |
|
3154 |
%} |
|
3155 |
! |
|
3156 |
||
3157 |
glxTexbind:target index:index in:aGLXWindowId |
|
3158 |
"bind a texture; target must be an integer or one |
|
3159 |
of the symbols #texture0, #textureDetail or #textureIdle." |
|
3160 |
||
3161 |
%{ /* NOCONTEXT */ |
|
3162 |
#ifdef GLX |
|
3163 |
long t; |
|
3164 |
||
3165 |
if (__isSmallInteger(target)) { |
|
3166 |
t = __intVal(target); |
|
3167 |
} else { |
|
3168 |
if (target == @symbol(texture0)) { |
|
3169 |
t = TX_TEXTURE_0; |
|
3170 |
} else if (target == @symbol(textureDetail)) { |
|
3171 |
t = TX_TEXTURE_DETAIL; |
|
3172 |
} else if (target == @symbol(textureIdle)) { |
|
3173 |
t = TX_TEXTURE_IDLE; |
|
3174 |
} else { |
|
1932 | 3175 |
RETURN (nil); |
294 | 3176 |
} |
3177 |
} |
|
3178 |
SETWIN(aGLXWindowId) |
|
3179 |
texbind(t, __intVal(index)); |
|
1932 | 3180 |
#endif |
3181 |
%} |
|
294 | 3182 |
! ! |
3183 |
||
3184 |
!GLXWorkstation methodsFor:'matrix stack'! |
|
3185 |
||
3186 |
glxGetMatrix:arrayOf16Floats in:aGLXWindowId |
|
3187 |
"argument must be an array (a matrix) of 16 floats. The current matrix |
|
3188 |
will be stored into that." |
|
3189 |
||
3190 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3191 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3192 |
#else |
294 | 3193 |
Matrix matrix; |
3194 |
||
3195 |
SETWIN(aGLXWindowId) |
|
3196 |
getmatrix(matrix); |
|
8817 | 3197 |
if (! __glx_putFloatsFromInto((float*)matrix, arrayOf16Floats, 16)) RETURN(false); |
1932 | 3198 |
#endif |
3199 |
%} |
|
294 | 3200 |
! |
3201 |
||
3202 |
glxLoadMatrix:arrayOf16Floats in:aGLXWindowId |
|
3203 |
"argument must be an array(a matrix) of 16 floats. The current matrix |
|
3204 |
will be loaded from that." |
|
3205 |
||
3206 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3207 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3208 |
#else |
294 | 3209 |
Matrix matrix; |
3210 |
Matrix *m; |
|
3211 |
||
8817 | 3212 |
if (! (m = __glx_getFloatsFromMatrixInto(arrayOf16Floats, (float*)matrix))) RETURN (false); |
294 | 3213 |
SETWIN(aGLXWindowId) |
3214 |
loadmatrix(*m); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3215 |
#endif |
294 | 3216 |
%} |
3217 |
! |
|
3218 |
||
3219 |
glxMultMatrix:arrayOf16Floats in:aGLXWindowId |
|
3220 |
"argument must be an array(a matrix) of 16 floats containing a |
|
3221 |
matrix to multiply into the current matrix." |
|
3222 |
||
3223 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3224 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3225 |
#else |
294 | 3226 |
Matrix matrix; |
3227 |
Matrix *m; |
|
3228 |
||
8817 | 3229 |
if (! (m = __glx_getFloatsFromMatrixInto(arrayOf16Floats, (float*)matrix))) RETURN (false); |
294 | 3230 |
SETWIN(aGLXWindowId) |
3231 |
multmatrix(*m); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3232 |
#endif |
294 | 3233 |
%} |
3234 |
! |
|
3235 |
||
3236 |
glxPopmatrixIn:aGLXWindowId |
|
3237 |
"pop transformation stack" |
|
3238 |
||
3239 |
%{ /* NOCONTEXT */ |
|
3240 |
SETWIN(aGLXWindowId) |
|
1932 | 3241 |
#ifdef OPENGL |
3242 |
#else |
|
294 | 3243 |
popmatrix(); |
1932 | 3244 |
#endif |
294 | 3245 |
%} |
3246 |
! |
|
3247 |
||
3248 |
glxPushmatrixIn:aGLXWindowId |
|
3249 |
"push down transformation stack" |
|
3250 |
||
3251 |
%{ /* NOCONTEXT */ |
|
3252 |
SETWIN(aGLXWindowId) |
|
1932 | 3253 |
#ifdef OPENGL |
3254 |
#else |
|
294 | 3255 |
pushmatrix(); |
1932 | 3256 |
#endif |
294 | 3257 |
%} |
3258 |
! ! |
|
3259 |
||
3260 |
!GLXWorkstation methodsFor:'misc'! |
|
3261 |
||
3262 |
glxGconfigIn:aGLXWindowId |
|
3263 |
"must be sent after RGBmode, doubleBuffer etc. to have these |
|
3264 |
changes really take effect. See GLX manual. |
|
7656 | 3265 |
(Actually, it seems to be not allowed - I don't really know)" |
294 | 3266 |
|
3267 |
%{ /* NOCONTEXT */ |
|
3268 |
SETWIN(aGLXWindowId) |
|
1932 | 3269 |
#ifdef OPENGL |
3270 |
#else |
|
294 | 3271 |
gconfig(); |
1932 | 3272 |
#endif |
294 | 3273 |
%} |
3274 |
! |
|
3275 |
||
3276 |
glxMmode:aSymbol in:aGLXWindowId |
|
3277 |
"set matrix mode: #single, #viewing, #projection or #texture" |
|
3278 |
||
3279 |
%{ /* NOCONTEXT */ |
|
3280 |
#ifdef GLX |
|
3281 |
if (aSymbol == @symbol(single)) { |
|
3282 |
mmode(MSINGLE); |
|
3283 |
RETURN (true); |
|
3284 |
} |
|
3285 |
if (aSymbol == @symbol(viewing)) { |
|
3286 |
mmode(MVIEWING); |
|
3287 |
RETURN (true); |
|
3288 |
} |
|
3289 |
if (aSymbol == @symbol(projection)) { |
|
3290 |
mmode(MPROJECTION); |
|
3291 |
RETURN (true); |
|
3292 |
} |
|
3293 |
if (aSymbol == @symbol(texture)) { |
|
3294 |
mmode(MTEXTURE); |
|
3295 |
RETURN (true); |
|
3296 |
} |
|
3297 |
#endif |
|
3298 |
%} |
|
3299 |
. |
|
3300 |
^ false |
|
3301 |
! |
|
3302 |
||
3303 |
glxNmode:aSymbol in:aGLXWindowId |
|
3304 |
"set normalize mode: #auto, #normalize" |
|
3305 |
||
3306 |
%{ /* NOCONTEXT */ |
|
3307 |
#ifdef GLX |
|
3308 |
if (aSymbol == @symbol(auto)) { |
|
3309 |
nmode(NAUTO); |
|
3310 |
RETURN (true); |
|
3311 |
} |
|
3312 |
if (aSymbol == @symbol(normalize)) { |
|
3313 |
nmode(NNORMALIZE); |
|
3314 |
RETURN (true); |
|
3315 |
} |
|
3316 |
#endif |
|
3317 |
%} |
|
3318 |
. |
|
3319 |
^ false |
|
3320 |
! |
|
3321 |
||
3322 |
glxRGBmodeIn:aGLXWindowId |
|
3323 |
"set true color mode (no colormap)" |
|
3324 |
||
3325 |
%{ /* NOCONTEXT */ |
|
3326 |
#ifdef GLX |
|
3327 |
SETWIN(aGLXWindowId) |
|
3328 |
RGBmode(); |
|
3329 |
RETURN (true); |
|
3330 |
#endif |
|
3331 |
%} |
|
3332 |
. |
|
3333 |
^ false |
|
3334 |
! ! |
|
3335 |
||
3336 |
!GLXWorkstation methodsFor:'objects'! |
|
3337 |
||
3338 |
glxCallObject:obj in:aGLXWindowId |
|
3339 |
"perform the commands of an object (macro)." |
|
3340 |
||
2075 | 3341 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3342 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3343 |
#else |
294 | 3344 |
if (__isSmallInteger(obj)) { |
3345 |
SETWIN(aGLXWindowId) |
|
3346 |
callobj(_objectVal(obj)); |
|
3347 |
RETURN (true); |
|
3348 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3349 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3350 |
%}. |
294 | 3351 |
^ false |
3352 |
! |
|
3353 |
||
3354 |
glxCloseObjectIn:aGLXWindowId |
|
3355 |
"end object defnition" |
|
3356 |
||
2075 | 3357 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3358 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3359 |
#else |
294 | 3360 |
SETWIN(aGLXWindowId) |
3361 |
closeobj(); |
|
3362 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3363 |
#endif |
294 | 3364 |
%} |
3365 |
! |
|
3366 |
||
3367 |
glxDeleteObject:obj in:aGLXWindowId |
|
3368 |
||
2075 | 3369 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3370 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3371 |
#else |
1882 | 3372 |
if (__isSmallInteger(obj)) { |
4718 | 3373 |
SETWIN(aGLXWindowId) |
3374 |
delobj(_objectVal(obj)); |
|
3375 |
RETURN (true); |
|
1882 | 3376 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3377 |
#endif |
294 | 3378 |
%} |
3379 |
! |
|
3380 |
||
3381 |
glxGenObjectIn:aGLXWindowId |
|
3382 |
"return a new (free & unused) object id for use |
|
3383 |
with makeObj" |
|
3384 |
||
3385 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3386 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3387 |
#else |
294 | 3388 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3389 |
RETURN (__MKSMALLINT(genobj())); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3390 |
#endif |
294 | 3391 |
%} |
3392 |
! |
|
3393 |
||
3394 |
glxGetopenobjIn:aGLXWindowId |
|
3395 |
"return the currently open objects id; -1 if none is open" |
|
3396 |
||
3397 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3398 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3399 |
#else |
294 | 3400 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3401 |
RETURN (__MKSMALLINT(getopenobj())); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3402 |
#endif |
294 | 3403 |
%} |
3404 |
! |
|
3405 |
||
3406 |
glxIsobj:obj in:aGLXWindowId |
|
3407 |
"return true, if obj is a valid object id" |
|
3408 |
||
3409 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3410 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3411 |
#else |
294 | 3412 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3413 |
RETURN (__MKBOOLEAN(isobj(_objectVal(obj)))); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3414 |
#endif |
294 | 3415 |
%} |
3416 |
! |
|
3417 |
||
3418 |
glxMakeObject:id in:aGLXWindowId |
|
3419 |
"start object definition - |
|
3420 |
another name conflict" |
|
3421 |
||
2075 | 3422 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3423 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3424 |
#else |
294 | 3425 |
if (__isSmallInteger(id)) { |
3426 |
SETWIN(aGLXWindowId) |
|
3427 |
makeobj(_objectVal(id)); |
|
3428 |
RETURN (true); |
|
3429 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3430 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3431 |
%}. |
294 | 3432 |
^ false |
3433 |
! ! |
|
3434 |
||
3435 |
!GLXWorkstation methodsFor:'patches & surfaces'! |
|
3436 |
||
3437 |
glxBeginCurveIn:aGLXWindowId |
|
3438 |
"start a NURBS curve def - in real GL only" |
|
3439 |
||
3440 |
%{ /* NOCONTEXT */ |
|
1932 | 3441 |
SETWIN(aGLXWindowId) |
3442 |
#ifdef GLX |
|
294 | 3443 |
bgncurve(); |
1932 | 3444 |
#endif |
3445 |
%} |
|
294 | 3446 |
! |
3447 |
||
3448 |
glxBeginSurfaceIn:aGLXWindowId |
|
3449 |
"start a NURBS surface def - in real GL only" |
|
3450 |
||
3451 |
%{ /* NOCONTEXT */ |
|
1932 | 3452 |
SETWIN(aGLXWindowId) |
3453 |
#ifdef GLX |
|
294 | 3454 |
bgnsurface(); |
1932 | 3455 |
#endif |
3456 |
%} |
|
294 | 3457 |
! |
3458 |
||
3459 |
glxDefBasis:id mat:aMatrix in:aGLXWindowId |
|
528 | 3460 |
"define the basis matrix for a patch or curve" |
294 | 3461 |
|
3462 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3463 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3464 |
#else |
294 | 3465 |
Matrix matrix; |
3466 |
Matrix *m; |
|
3467 |
||
2814 | 3468 |
if (! (m = __glx_getFloatsFromMatrixInto(aMatrix, matrix))) RETURN (false); |
294 | 3469 |
if (__isSmallInteger(id)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3470 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3471 |
defbasis((short)(__intVal(id)), *m); |
294 | 3472 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3473 |
#endif |
1932 | 3474 |
%} |
528 | 3475 |
|
3476 |
"Modified: 19.3.1996 / 18:52:56 / cg" |
|
294 | 3477 |
! |
3478 |
||
3479 |
glxEndCurveIn:aGLXWindowId |
|
3480 |
"end a NURBS curve def - in real GL only" |
|
3481 |
||
3482 |
%{ /* NOCONTEXT */ |
|
1932 | 3483 |
SETWIN(aGLXWindowId) |
3484 |
#ifdef GLX |
|
294 | 3485 |
endcurve(); |
1932 | 3486 |
#endif |
3487 |
%} |
|
294 | 3488 |
! |
3489 |
||
3490 |
glxEndSurfaceIn:aGLXWindowId |
|
3491 |
"end a NURBS surface def - in real GL only" |
|
3492 |
||
3493 |
%{ /* NOCONTEXT */ |
|
1932 | 3494 |
SETWIN(aGLXWindowId) |
3495 |
#ifdef GLX |
|
294 | 3496 |
endsurface(); |
1932 | 3497 |
#endif |
3498 |
%} |
|
294 | 3499 |
! |
3500 |
||
4718 | 3501 |
glxNurbsSurfaceUKnotCount: uKnotCount uKnot: uKnot |
294 | 3502 |
vKnotCount: vKnotCount vKnot: vKnot |
4718 | 3503 |
uOffset: uOffset vOffset: vOffset |
3504 |
ctlArray: ctlArray |
|
3505 |
uOrder: uOrder vOrder: vOrder |
|
294 | 3506 |
type: type in: aGLXWindowId |
3507 |
||
3508 |
| ctlPoints i | |
|
3509 |
ctlPoints := DoubleArray new: ctlArray size * (ctlArray first size). |
|
3510 |
i := 1. |
|
3511 |
ctlArray do: [:point | |
|
4718 | 3512 |
point do: [:coord | |
294 | 3513 |
ctlPoints at: i put: coord. |
3514 |
i := i + 1]]. |
|
3515 |
||
3516 |
%{ /* NOCONTEXT */ |
|
3517 |
#ifdef GLX |
|
3518 |
char *uKnotElements, *vKnotElements, *ctlElements; |
|
3519 |
OBJ cls; |
|
3520 |
int ninstVars, nInstBytes; |
|
3521 |
||
3522 |
SETWIN(aGLXWindowId) |
|
3523 |
cls = __qClass(ctlPoints); |
|
3524 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
3525 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
|
3526 |
||
3527 |
ctlElements = (char *)(_InstPtr(ctlPoints)) + nInstBytes; |
|
3528 |
uKnotElements = (char *)(_InstPtr(uKnot)) + nInstBytes; |
|
3529 |
vKnotElements = (char *)(_InstPtr(vKnot)) + nInstBytes; |
|
3530 |
||
3531 |
nurbssurface ( |
|
3532 |
__intVal(uKnotCount), (double *)uKnotElements, |
|
3533 |
__intVal(vKnotCount), (double *)vKnotElements, |
|
3534 |
__intVal(uOffset), __intVal(vOffset), |
|
4718 | 3535 |
(double *)ctlElements, |
294 | 3536 |
__intVal(uOrder), __intVal(vOrder), __intVal(type)); |
3537 |
RETURN(true); |
|
3538 |
#endif |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3539 |
%}. |
294 | 3540 |
^ false |
3541 |
! |
|
3542 |
||
3543 |
glxPatchBasisU:u v:v in:aGLXWindowId |
|
528 | 3544 |
"set the two basis matrices for a patch" |
294 | 3545 |
|
3546 |
%{ /* NOCONTEXT */ |
|
3547 |
if (__bothSmallInteger(u, v)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3548 |
SETWIN(aGLXWindowId) |
1932 | 3549 |
#ifdef OPENGL |
3550 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3551 |
patchbasis((long)__intVal(u), (long)__intVal(v)); |
1932 | 3552 |
#endif |
294 | 3553 |
} |
1932 | 3554 |
%} |
528 | 3555 |
|
3556 |
"Modified: 19.3.1996 / 18:53:18 / cg" |
|
294 | 3557 |
! |
3558 |
||
3559 |
glxPatchCurvesU:u v:v in:aGLXWindowId |
|
528 | 3560 |
"set the number of curves to be drawn in each direction on a patch" |
294 | 3561 |
|
3562 |
%{ /* NOCONTEXT */ |
|
3563 |
if (__bothSmallInteger(u, v)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3564 |
SETWIN(aGLXWindowId) |
1932 | 3565 |
#ifdef OPENGL |
3566 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3567 |
patchcurves((long)__intVal(u), (long)__intVal(v)); |
1932 | 3568 |
#endif |
294 | 3569 |
} |
1932 | 3570 |
%} |
528 | 3571 |
|
3572 |
"Modified: 19.3.1996 / 18:53:34 / cg" |
|
294 | 3573 |
! |
3574 |
||
3575 |
glxPatchPrecisionU:u v:v in:aGLXWindowId |
|
3576 |
"set the patch precision" |
|
3577 |
||
3578 |
%{ /* NOCONTEXT */ |
|
3579 |
if (__bothSmallInteger(u, v)) { |
|
3580 |
SETWIN(aGLXWindowId) |
|
1932 | 3581 |
#ifdef OPENGL |
3582 |
#else |
|
294 | 3583 |
patchprecision((long)__intVal(u), (long)__intVal(v)); |
1932 | 3584 |
#endif |
294 | 3585 |
} |
1932 | 3586 |
%} |
294 | 3587 |
! |
3588 |
||
3589 |
glxPatchX:arrayOf16XFloats y:arrayOf16YFloats z:arrayOf16ZFloats in:aGLXWindowId |
|
528 | 3590 |
"Draws a bicubic patch. |
3591 |
arguments must be arrays of 16 floats containing the patch" |
|
294 | 3592 |
|
3593 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3594 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3595 |
#else |
294 | 3596 |
Matrix matrixX, matrixY, matrixZ; |
3597 |
Matrix *mX, *mY, *mZ; |
|
3598 |
||
8817 | 3599 |
if (! (mX = __glx_getFloatsFromMatrixInto(arrayOf16XFloats, (float*)matrixX))) |
1932 | 3600 |
RETURN (nil); |
8817 | 3601 |
if (! (mY = __glx_getFloatsFromMatrixInto(arrayOf16YFloats, (float*)matrixY))) |
1932 | 3602 |
RETURN (nil); |
8817 | 3603 |
if (! (mZ = __glx_getFloatsFromMatrixInto(arrayOf16ZFloats, (float*)matrixZ))) |
1932 | 3604 |
RETURN (nil); |
294 | 3605 |
SETWIN(aGLXWindowId) |
3606 |
patch(*mX, *mY, *mZ); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3607 |
#endif |
294 | 3608 |
%} |
528 | 3609 |
|
3610 |
"Modified: 19.3.1996 / 18:54:02 / cg" |
|
3611 |
! |
|
3612 |
||
3613 |
glxRpatchX:arrayOf16XFloats y:arrayOf16YFloats z:arrayOf16ZFloats w:arrayOf16WFloats in:aGLXWindowId |
|
3614 |
"Draws a rational bicubic patch. |
|
3615 |
arguments must be arrays of 16 floats containing the patch" |
|
3616 |
||
3617 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3618 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3619 |
#else |
529 | 3620 |
Matrix matrixX, matrixY, matrixZ, matrixW; |
3621 |
Matrix *mX, *mY, *mZ, *mW; |
|
528 | 3622 |
|
8817 | 3623 |
if (! (mX = __glx_getFloatsFromMatrixInto(arrayOf16XFloats, (float*)matrixX))) |
1932 | 3624 |
RETURN (nil); |
8817 | 3625 |
if (! (mY = __glx_getFloatsFromMatrixInto(arrayOf16YFloats, (float*)matrixY))) |
1932 | 3626 |
RETURN (nil); |
8817 | 3627 |
if (! (mZ = __glx_getFloatsFromMatrixInto(arrayOf16ZFloats, (float*)matrixZ))) |
1932 | 3628 |
RETURN (nil); |
8817 | 3629 |
if (! (mW = __glx_getFloatsFromMatrixInto(arrayOf16WFloats, (float*)matrixW))) |
1932 | 3630 |
RETURN (nil); |
529 | 3631 |
SETWIN(aGLXWindowId) |
3632 |
rpatch(*mX, *mY, *mZ, *mW); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3633 |
#endif |
528 | 3634 |
%} |
3635 |
||
3636 |
"Modified: 19.3.1996 / 18:54:02 / cg" |
|
3637 |
"Created: 19.3.1996 / 18:56:34 / cg" |
|
3638 |
! ! |
|
3639 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3640 |
!GLXWorkstation methodsFor:'pixel copy'! |
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 |
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
|
3643 |
"copy a rectangular area in the view. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3644 |
For now, this is only supported with a true GL. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3645 |
readsource specifies which plane/buffer is affected by this operation." |
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 |
%{ /* NOCONTEXT */ |
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 |
SETWIN(aGLXWindowId) |
4718 | 3650 |
rectcopy(_screencoordVal(x1), _screencoordVal(y1), |
3651 |
_screencoordVal(x2), _screencoordVal(y2), |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3652 |
_screencoordVal(newx), _screencoordVal(newy)); |
1932 | 3653 |
#endif |
3654 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3655 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3656 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3657 |
!GLXWorkstation methodsFor:'pixel reading'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3658 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3659 |
glxReadpixelsTo:dest in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3660 |
"read pixels from the view. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3661 |
Dest must be an array and gets pixel values assigned, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3662 |
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
|
3663 |
For now, pixel-reading is only supported with a true GL. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3664 |
Caveat: the number of pixels is limited to 256. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3665 |
In double buffer mode, the backBuffer is read." |
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 |
|n| |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3668 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3669 |
n := dest size. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3670 |
n > 256 ifTrue:[^ 0]. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3671 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3672 |
%{ /* STACK:1024 */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3673 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3674 |
Colorindex buffer[256]; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3675 |
int i, nRead; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3676 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3677 |
if (__isArray(dest)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3678 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3679 |
nRead = readpixels(__intVal(n), buffer); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3680 |
for (i=0; i<nRead;i++) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3681 |
__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
|
3682 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3683 |
RETURN (__MKSMALLINT(nRead)); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3684 |
} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3685 |
#endif |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3686 |
%}. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3687 |
^ 0 |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3688 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3689 |
"Modified: 22.3.1996 / 18:08:00 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3690 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3691 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3692 |
glxReadsource: src in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3693 |
"specify what is read with folowing readPixels requests. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3694 |
For now, pixel-reading is only supported with a true GL" |
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 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3697 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3698 |
OBJ s = src; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3699 |
int what; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3700 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3701 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3702 |
if (s == @symbol(auto)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3703 |
what = SRC_AUTO; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3704 |
} else if (s == @symbol(front)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3705 |
what = SRC_FRONT; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3706 |
} else if (s == @symbol(back)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3707 |
what = SRC_BACK; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3708 |
} else if (s == @symbol(zBuffer)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3709 |
what = SRC_ZBUFFER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3710 |
} else if (s == @symbol(frameGrabber)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3711 |
what = SRC_FRAMEGRABBER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3712 |
} else if (s == @symbol(over)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3713 |
what = SRC_OVER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3714 |
} else if (s == @symbol(under)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3715 |
what = SRC_UNDER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3716 |
} else if (s == @symbol(popUp)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3717 |
what = SRC_PUP; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3718 |
} else { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3719 |
what = _longVal(src); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3720 |
} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3721 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3722 |
readsource(what); |
1932 | 3723 |
#endif |
3724 |
%} |
|
538 | 3725 |
! |
3726 |
||
541 | 3727 |
glxRectreadX1:x1 y1:y1 x2:x2 y2:y2 h:viewHeight to:dest in:aGLXWindowId |
538 | 3728 |
"read pixels from a rectanglular area. |
3729 |
Dest must be an array and gets pixel values assigned, |
|
3730 |
reading n*m pixels. |
|
3731 |
For now, pixel-reading is only supported with a true GL. |
|
3732 |
Caveat: the number of pixels is limited to 256. |
|
3733 |
In double buffer mode, the backBuffer is read." |
|
3734 |
||
541 | 3735 |
|n idx sy1 sy2| |
3736 |
||
3737 |
"/ GLX's y coordinates go bottom to top ... |
|
3738 |
||
3739 |
sy1 := viewHeight - y1. |
|
3740 |
sy2 := viewHeight - y2. |
|
538 | 3741 |
|
3742 |
n := (x2 - x1 + 1) * (y2 - y1 + 1). |
|
3743 |
n > 256 ifTrue:[^ 0]. |
|
3744 |
dest size < n ifTrue:[^ 0]. |
|
3745 |
||
3746 |
%{ /* STACK:1024 */ |
|
3747 |
#ifdef GLX |
|
3748 |
Colorindex buffer[256]; |
|
3749 |
int i, nRead; |
|
3750 |
||
3751 |
if (__isArray(dest) |
|
3752 |
&& __isSmallInteger(x1) && __isSmallInteger(x2) |
|
541 | 3753 |
&& __isSmallInteger(sy1) && __isSmallInteger(sy2) |
538 | 3754 |
) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3755 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3756 |
nRead = rectread(__intVal(x1), __intVal(sy1), |
4718 | 3757 |
__intVal(x2), __intVal(sy2), |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3758 |
buffer); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3759 |
for (i=0; i<nRead;i++) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3760 |
__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
|
3761 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3762 |
RETURN (__MKSMALLINT(nRead)); |
538 | 3763 |
} |
3764 |
#endif |
|
3765 |
%}. |
|
3766 |
"/ |
|
3767 |
"/ ok, this is not a GL - use XWorkstations pixel read method |
|
3768 |
"/ and convert |
|
3769 |
"/ |
|
3770 |
idx := 1. |
|
3771 |
y1 to:y2 do:[:y | |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3772 |
x1 to:x2 do:[:x | |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3773 |
|pix| |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3774 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3775 |
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
|
3776 |
dest at:idx put:pix |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3777 |
] |
538 | 3778 |
]. |
3779 |
^ n |
|
3780 |
||
3781 |
"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
|
3782 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3783 |
! |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3784 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3785 |
glxXColorToGLColor:pixel |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3786 |
"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
|
3787 |
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
|
3788 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3789 |
%{ /* NOCONTEXT */ |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3790 |
#ifdef VGL |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3791 |
if (__isSmallInteger(pixel)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3792 |
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
|
3793 |
} |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3794 |
#endif |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3795 |
%}. |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3796 |
^ pixel |
543
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3797 |
! |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3798 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3799 |
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
|
3800 |
"special for VGL" |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3801 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3802 |
%{ |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3803 |
#ifdef VGL |
1932 | 3804 |
if (__bothSmallInteger(x, y)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3805 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3806 |
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
|
3807 |
} |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3808 |
#endif |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3809 |
%}. |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3810 |
^ 0 |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3811 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3812 |
"Modified: 22.3.1996 / 18:08:00 / cg" |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3813 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3814 |
|
528 | 3815 |
!GLXWorkstation methodsFor:'points'! |
3816 |
||
3817 |
glxPnt2X: x y: y in: aGLXWindowId |
|
3818 |
"plot a point in x, y, 0." |
|
3819 |
||
3820 |
%{ /* NOCONTEXT */ |
|
3821 |
Coord c_x, c_y; |
|
3822 |
||
3823 |
_COORD_ (x, c_x) |
|
3824 |
_COORD_ (y, c_y) |
|
3825 |
SETWIN(aGLXWindowId) |
|
1932 | 3826 |
#ifdef OPENGL |
3827 |
#else |
|
528 | 3828 |
pnt2(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3829 |
#endif |
528 | 3830 |
%} |
3831 |
||
3832 |
"Modified: 19.3.1996 / 18:35:55 / cg" |
|
3833 |
! |
|
3834 |
||
3835 |
glxPnt2iX: x y: y in: aGLXWindowId |
|
3836 |
"plot a point in x, y, 0." |
|
3837 |
||
3838 |
%{ /* NOCONTEXT */ |
|
3839 |
Icoord c_x, c_y; |
|
3840 |
||
3841 |
_ICOORD_ (x, c_x) |
|
3842 |
_ICOORD_ (y, c_y) |
|
3843 |
SETWIN(aGLXWindowId) |
|
1932 | 3844 |
#ifdef OPENGL |
3845 |
#else |
|
528 | 3846 |
pnt2i(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3847 |
#endif |
528 | 3848 |
%} |
3849 |
||
3850 |
"Modified: 19.3.1996 / 18:35:59 / cg" |
|
3851 |
! |
|
3852 |
||
3853 |
glxPnt2sX: x y: y in: aGLXWindowId |
|
3854 |
"plot a point in x, y, 0." |
|
3855 |
||
3856 |
%{ /* NOCONTEXT */ |
|
3857 |
Scoord c_x, c_y; |
|
3858 |
||
3859 |
_SCOORD_ (x, c_x) |
|
3860 |
_SCOORD_ (y, c_y) |
|
3861 |
SETWIN(aGLXWindowId) |
|
1932 | 3862 |
#ifdef OPENGL |
3863 |
#else |
|
528 | 3864 |
pnt2s(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3865 |
#endif |
528 | 3866 |
%} |
3867 |
||
3868 |
"Modified: 19.3.1996 / 18:36:03 / cg" |
|
3869 |
! |
|
3870 |
||
3871 |
glxPntX: x y: y z: z in: aGLXWindowId |
|
3872 |
"plot a point in x, y, z." |
|
3873 |
||
3874 |
%{ /* NOCONTEXT */ |
|
3875 |
Coord c_x, c_y, c_z; |
|
3876 |
||
3877 |
_COORD_ (x, c_x) |
|
3878 |
_COORD_ (y, c_y) |
|
3879 |
_COORD_ (z, c_z) |
|
3880 |
SETWIN(aGLXWindowId) |
|
1932 | 3881 |
#ifdef OPENGL |
3882 |
#else |
|
528 | 3883 |
pnt(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3884 |
#endif |
528 | 3885 |
%} |
3886 |
||
3887 |
"Modified: 19.3.1996 / 18:36:08 / cg" |
|
3888 |
! |
|
3889 |
||
3890 |
glxPntiX: x y: y z: z in: aGLXWindowId |
|
3891 |
"plot a point in x, y, z." |
|
3892 |
||
3893 |
%{ /* NOCONTEXT */ |
|
3894 |
Icoord c_x, c_y, c_z; |
|
3895 |
||
3896 |
_ICOORD_ (x, c_x) |
|
3897 |
_ICOORD_ (y, c_y) |
|
3898 |
_ICOORD_ (z, c_z) |
|
3899 |
SETWIN(aGLXWindowId) |
|
1932 | 3900 |
#ifdef OPENGL |
3901 |
#else |
|
528 | 3902 |
pnti(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3903 |
#endif |
528 | 3904 |
%} |
3905 |
||
3906 |
"Modified: 19.3.1996 / 18:36:14 / cg" |
|
3907 |
! |
|
3908 |
||
3909 |
glxPntsX: x y: y z: z in: aGLXWindowId |
|
3910 |
"plot a point in x, y, z." |
|
3911 |
||
3912 |
%{ /* NOCONTEXT */ |
|
3913 |
Scoord c_x, c_y, c_z; |
|
3914 |
||
3915 |
_SCOORD_ (x, c_x) |
|
3916 |
_SCOORD_ (y, c_y) |
|
3917 |
_SCOORD_ (z, c_z) |
|
3918 |
SETWIN(aGLXWindowId) |
|
1932 | 3919 |
#ifdef OPENGL |
3920 |
#else |
|
528 | 3921 |
pnts(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3922 |
#endif |
528 | 3923 |
%} |
3924 |
||
3925 |
"Modified: 19.3.1996 / 18:36:17 / cg" |
|
3926 |
! |
|
3927 |
||
3928 |
glxPntsize: n in: aGLXWindowId |
|
3929 |
||
3930 |
%{ /* NOCONTEXT */ |
|
1932 | 3931 |
SETWIN(aGLXWindowId) |
3932 |
#ifdef GLX |
|
528 | 3933 |
pntsize(_shortVal(n)); |
1932 | 3934 |
#endif |
3935 |
%} |
|
528 | 3936 |
! |
3937 |
||
3938 |
glxPntsizef: n in: aGLXWindowId |
|
3939 |
||
3940 |
%{ /* NOCONTEXT */ |
|
1932 | 3941 |
SETWIN(aGLXWindowId) |
3942 |
#ifdef GLX |
|
528 | 3943 |
pntsizef(_floatVal(n)); |
1932 | 3944 |
#endif |
3945 |
%} |
|
528 | 3946 |
! ! |
3947 |
||
3948 |
!GLXWorkstation methodsFor:'polygons'! |
|
3949 |
||
3950 |
glxBackface: b in: aGLXWindowId |
|
4718 | 3951 |
"enable/disable culling of backfacing polygons (suppress its drawing). |
528 | 3952 |
A polygon is backfacing if it's orientation in *screen* coords is clockwise" |
3953 |
||
3954 |
%{ /* NOCONTEXT */ |
|
3955 |
SETWIN(aGLXWindowId) |
|
1932 | 3956 |
#ifdef OPENGL |
3957 |
#else |
|
528 | 3958 |
backface(_booleanVal(b)); |
1932 | 3959 |
#endif |
528 | 3960 |
%} |
3961 |
||
3962 |
"Modified: 19.3.1996 / 18:26:50 / cg" |
|
3963 |
! |
|
3964 |
||
3965 |
glxConcave: b in: aGLXWindowId |
|
7829 | 3966 |
"signal whether or not polygons are concave" |
528 | 3967 |
|
3968 |
%{ /* NOCONTEXT */ |
|
3969 |
SETWIN(aGLXWindowId) |
|
1932 | 3970 |
#ifdef OPENGL |
3971 |
#else |
|
528 | 3972 |
concave(_booleanVal(b)); |
1932 | 3973 |
#endif |
528 | 3974 |
%} |
3975 |
! |
|
3976 |
||
3977 |
glxFrontface: b in: aGLXWindowId |
|
4718 | 3978 |
"enable/disable culling of frontfacing polygons (suppress its drawing). |
3979 |
A polygon is frontfacing if it's orientation in *screen* coords is |
|
528 | 3980 |
anti-clockwise" |
3981 |
||
3982 |
||
3983 |
%{ /* NOCONTEXT */ |
|
3984 |
SETWIN(aGLXWindowId) |
|
1932 | 3985 |
#ifdef OPENGL |
3986 |
#else |
|
528 | 3987 |
frontface(_booleanVal(b)); |
1932 | 3988 |
#endif |
3989 |
%} |
|
528 | 3990 |
! |
3991 |
||
3992 |
glxPdr2X: x y: y in: aGLXWindowId |
|
3993 |
"add another vertex to the polygon" |
|
3994 |
||
3995 |
%{ /* NOCONTEXT */ |
|
3996 |
Coord c_x, c_y; |
|
3997 |
||
3998 |
_COORD_ (x, c_x) |
|
3999 |
_COORD_ (y, c_y) |
|
4000 |
SETWIN(aGLXWindowId) |
|
1932 | 4001 |
#ifdef OPENGL |
4002 |
#else |
|
528 | 4003 |
pdr2(c_x, c_y); |
1932 | 4004 |
#endif |
4005 |
%} |
|
528 | 4006 |
! |
4007 |
||
4008 |
glxPdr2iX: x y: y in: aGLXWindowId |
|
4009 |
"add another vertex to the polygon" |
|
4010 |
||
4011 |
%{ /* NOCONTEXT */ |
|
4012 |
Icoord c_x, c_y; |
|
4013 |
||
4014 |
_ICOORD_ (x, c_x) |
|
4015 |
_ICOORD_ (y, c_y) |
|
4016 |
SETWIN(aGLXWindowId) |
|
1932 | 4017 |
#ifdef OPENGL |
4018 |
#else |
|
528 | 4019 |
pdr2i(c_x, c_y); |
1932 | 4020 |
#endif |
528 | 4021 |
%} |
4022 |
||
4023 |
"Modified: 19.3.1996 / 18:33:28 / cg" |
|
4024 |
! |
|
4025 |
||
4026 |
glxPdr2sX: x y: y in: aGLXWindowId |
|
4027 |
"add another vertex to the polygon" |
|
4028 |
||
4029 |
%{ /* NOCONTEXT */ |
|
4030 |
Scoord c_x, c_y; |
|
4031 |
||
4032 |
_SCOORD_ (x, c_x) |
|
4033 |
_SCOORD_ (y, c_y) |
|
4034 |
SETWIN(aGLXWindowId) |
|
1932 | 4035 |
#ifdef OPENGL |
4036 |
#else |
|
528 | 4037 |
pdr2s(c_x, c_y); |
1932 | 4038 |
#endif |
528 | 4039 |
%} |
4040 |
||
4041 |
"Modified: 19.3.1996 / 18:34:03 / cg" |
|
4042 |
! |
|
4043 |
||
4044 |
glxPdrX: x y: y z: z in: aGLXWindowId |
|
4045 |
"add another vertex to the polygon" |
|
4046 |
||
4047 |
%{ /* NOCONTEXT */ |
|
4048 |
Coord c_x, c_y, c_z; |
|
4049 |
||
4050 |
_COORD_ (x, c_x) |
|
4051 |
_COORD_ (y, c_y) |
|
4052 |
_COORD_ (z, c_z) |
|
4053 |
SETWIN(aGLXWindowId) |
|
1932 | 4054 |
#ifdef OPENGL |
4055 |
#else |
|
528 | 4056 |
pdr(c_x, c_y, c_z); |
1932 | 4057 |
#endif |
528 | 4058 |
%} |
4059 |
||
4060 |
"Modified: 19.3.1996 / 18:34:06 / cg" |
|
4061 |
! |
|
4062 |
||
4063 |
glxPdriX: x y: y z: z in: aGLXWindowId |
|
4064 |
"add another vertex to the polygon" |
|
4065 |
||
4066 |
%{ /* NOCONTEXT */ |
|
4067 |
Icoord c_x, c_y, c_z; |
|
4068 |
||
4069 |
_ICOORD_ (x, c_x) |
|
4070 |
_ICOORD_ (y, c_y) |
|
4071 |
_ICOORD_ (z, c_z) |
|
4072 |
SETWIN(aGLXWindowId) |
|
1932 | 4073 |
#ifdef OPENGL |
4074 |
#else |
|
528 | 4075 |
pdri(c_x, c_y, c_z); |
1932 | 4076 |
#endif |
528 | 4077 |
%} |
4078 |
||
4079 |
"Modified: 19.3.1996 / 18:34:11 / cg" |
|
4080 |
! |
|
4081 |
||
4082 |
glxPdrsX: x y: y z: z in: aGLXWindowId |
|
4083 |
"add another vertex to the polygon" |
|
4084 |
||
4085 |
%{ /* NOCONTEXT */ |
|
4086 |
Scoord c_x, c_y, c_z; |
|
4087 |
||
4088 |
_SCOORD_ (x, c_x) |
|
4089 |
_SCOORD_ (y, c_y) |
|
4090 |
_SCOORD_ (z, c_z) |
|
4091 |
SETWIN(aGLXWindowId) |
|
1932 | 4092 |
#ifdef OPENGL |
4093 |
#else |
|
528 | 4094 |
pdrs(c_x, c_y, c_z); |
1932 | 4095 |
#endif |
528 | 4096 |
%} |
4097 |
||
4098 |
"Modified: 19.3.1996 / 18:34:14 / cg" |
|
4099 |
! |
|
4100 |
||
4101 |
glxPmv2X: x y: y in: aGLXWindowId |
|
4102 |
"set the start position of a polygon" |
|
4103 |
||
4104 |
%{ /* NOCONTEXT */ |
|
4105 |
Coord c_x, c_y; |
|
4106 |
||
4107 |
_COORD_ (x, c_x) |
|
4108 |
_COORD_ (y, c_y) |
|
4109 |
SETWIN(aGLXWindowId) |
|
1932 | 4110 |
#ifdef OPENGL |
4111 |
#else |
|
528 | 4112 |
pmv2(c_x, c_y); |
1932 | 4113 |
#endif |
528 | 4114 |
%} |
4115 |
||
4116 |
"Modified: 19.3.1996 / 18:32:45 / cg" |
|
4117 |
! |
|
4118 |
||
4119 |
glxPmv2iX: x y: y in: aGLXWindowId |
|
4120 |
"set the start position of a polygon" |
|
4121 |
||
4122 |
%{ /* NOCONTEXT */ |
|
4123 |
Icoord c_x, c_y; |
|
4124 |
||
4125 |
_ICOORD_ (x, c_x) |
|
4126 |
_ICOORD_ (y, c_y) |
|
4127 |
SETWIN(aGLXWindowId) |
|
1932 | 4128 |
#ifdef OPENGL |
4129 |
#else |
|
528 | 4130 |
pmv2i(c_x, c_y); |
1932 | 4131 |
#endif |
528 | 4132 |
%} |
4133 |
||
4134 |
"Modified: 19.3.1996 / 18:32:42 / cg" |
|
4135 |
! |
|
4136 |
||
4137 |
glxPmv2sX: x y: y in: aGLXWindowId |
|
4138 |
"set the start position of a polygon" |
|
4139 |
||
4140 |
%{ /* NOCONTEXT */ |
|
4141 |
Scoord c_x, c_y; |
|
4142 |
||
4143 |
_SCOORD_ (x, c_x) |
|
4144 |
_SCOORD_ (y, c_y) |
|
4145 |
SETWIN(aGLXWindowId) |
|
1932 | 4146 |
#ifdef OPENGL |
4147 |
#else |
|
528 | 4148 |
pmv2s(c_x, c_y); |
1932 | 4149 |
#endif |
528 | 4150 |
%} |
4151 |
||
4152 |
"Modified: 19.3.1996 / 18:32:38 / cg" |
|
4153 |
! |
|
4154 |
||
4155 |
glxPmvX: x y: y z: z in: aGLXWindowId |
|
4156 |
"set the start position of a polygon" |
|
4157 |
||
4158 |
%{ /* NOCONTEXT */ |
|
4159 |
Coord c_x, c_y, c_z; |
|
4160 |
||
4161 |
_COORD_ (x, c_x) |
|
4162 |
_COORD_ (y, c_y) |
|
4163 |
_COORD_ (z, c_z) |
|
4164 |
SETWIN(aGLXWindowId) |
|
1932 | 4165 |
#ifdef OPENGL |
4166 |
#else |
|
528 | 4167 |
pmv(c_x, c_y, c_z); |
1932 | 4168 |
#endif |
528 | 4169 |
%} |
4170 |
||
4171 |
"Modified: 19.3.1996 / 18:31:52 / cg" |
|
4172 |
! |
|
4173 |
||
4174 |
glxPmviX: x y: y z: z in: aGLXWindowId |
|
4175 |
"set the start position of a polygon" |
|
4176 |
||
4177 |
%{ /* NOCONTEXT */ |
|
4178 |
Icoord c_x, c_y, c_z; |
|
4179 |
||
4180 |
_ICOORD_ (x, c_x) |
|
4181 |
_ICOORD_ (y, c_y) |
|
4182 |
_ICOORD_ (z, c_z) |
|
4183 |
SETWIN(aGLXWindowId) |
|
1932 | 4184 |
#ifdef OPENGL |
4185 |
#else |
|
528 | 4186 |
pmvi(c_x, c_y, c_z); |
1932 | 4187 |
#endif |
528 | 4188 |
%} |
4189 |
||
4190 |
"Modified: 19.3.1996 / 18:31:59 / cg" |
|
4191 |
! |
|
4192 |
||
4193 |
glxPmvsX: x y: y z: z in: aGLXWindowId |
|
4194 |
"set the start position of a polygon" |
|
4195 |
||
4196 |
%{ /* NOCONTEXT */ |
|
4197 |
Scoord c_x, c_y, c_z; |
|
4198 |
||
4199 |
_SCOORD_ (x, c_x) |
|
4200 |
_SCOORD_ (y, c_y) |
|
4201 |
_SCOORD_ (z, c_z) |
|
4202 |
SETWIN(aGLXWindowId) |
|
1932 | 4203 |
#ifdef OPENGL |
4204 |
#else |
|
528 | 4205 |
pmvs(c_x, c_y, c_z); |
1932 | 4206 |
#endif |
528 | 4207 |
%} |
4208 |
||
4209 |
"Modified: 19.3.1996 / 18:32:03 / cg" |
|
4210 |
! |
|
4211 |
||
4212 |
glxPolymode: mode in: aGLXWindowId |
|
4213 |
"Sets the polygon filling mode - only filled (1) or outlined (0) |
|
4214 |
are supported" |
|
4215 |
||
4216 |
%{ /* NOCONTEXT */ |
|
4217 |
SETWIN(aGLXWindowId) |
|
1932 | 4218 |
#ifdef OPENGL |
4219 |
#else |
|
528 | 4220 |
polymode(_longVal(mode)); |
1932 | 4221 |
#endif |
528 | 4222 |
%} |
4223 |
||
4224 |
"Modified: 19.3.1996 / 18:29:32 / cg" |
|
4225 |
! |
|
4226 |
||
4227 |
glxRpdr2X: x y: y in: aGLXWindowId |
|
4228 |
"add another relative vertex to the polygon" |
|
4229 |
||
4230 |
%{ /* NOCONTEXT */ |
|
4231 |
Coord c_x, c_y; |
|
4232 |
||
4233 |
_COORD_ (x, c_x) |
|
4234 |
_COORD_ (y, c_y) |
|
4235 |
SETWIN(aGLXWindowId) |
|
1932 | 4236 |
#ifdef OPENGL |
4237 |
#else |
|
528 | 4238 |
rpdr2(c_x, c_y); |
1932 | 4239 |
#endif |
528 | 4240 |
%} |
4241 |
||
4242 |
"Modified: 19.3.1996 / 18:34:31 / cg" |
|
4243 |
! |
|
4244 |
||
4245 |
glxRpdr2iX: x y: y in: aGLXWindowId |
|
4246 |
"add another relative vertex to the polygon" |
|
4247 |
||
4248 |
%{ /* NOCONTEXT */ |
|
4249 |
Icoord c_x, c_y; |
|
4250 |
||
4251 |
_ICOORD_ (x, c_x) |
|
4252 |
_ICOORD_ (y, c_y) |
|
4253 |
SETWIN(aGLXWindowId) |
|
1932 | 4254 |
#ifdef OPENGL |
4255 |
#else |
|
528 | 4256 |
rpdr2i(c_x, c_y); |
1932 | 4257 |
#endif |
528 | 4258 |
%} |
4259 |
||
4260 |
"Modified: 19.3.1996 / 18:34:36 / cg" |
|
4261 |
! |
|
4262 |
||
4263 |
glxRpdr2sX: x y: y in: aGLXWindowId |
|
4264 |
"add another relative vertex to the polygon" |
|
4265 |
||
4266 |
%{ /* NOCONTEXT */ |
|
4267 |
Scoord c_x, c_y; |
|
4268 |
||
4269 |
_SCOORD_ (x, c_x) |
|
4270 |
_SCOORD_ (y, c_y) |
|
4271 |
SETWIN(aGLXWindowId) |
|
1932 | 4272 |
#ifdef OPENGL |
4273 |
#else |
|
528 | 4274 |
rpdr2s(c_x, c_y); |
1932 | 4275 |
#endif |
528 | 4276 |
%} |
4277 |
||
4278 |
"Modified: 19.3.1996 / 18:34:40 / cg" |
|
4279 |
! |
|
4280 |
||
4281 |
glxRpdrX: x y: y z: z in: aGLXWindowId |
|
4282 |
"add another relative vertex to the polygon" |
|
4283 |
||
4284 |
%{ /* NOCONTEXT */ |
|
4285 |
Coord c_x, c_y, c_z; |
|
4286 |
||
4287 |
_COORD_ (x, c_x) |
|
4288 |
_COORD_ (y, c_y) |
|
4289 |
_COORD_ (z, c_z) |
|
4290 |
SETWIN(aGLXWindowId) |
|
1932 | 4291 |
#ifdef OPENGL |
4292 |
#else |
|
528 | 4293 |
rpdr(c_x, c_y, c_z); |
1932 | 4294 |
#endif |
528 | 4295 |
%} |
4296 |
||
4297 |
"Modified: 19.3.1996 / 18:34:48 / cg" |
|
4298 |
! |
|
4299 |
||
4300 |
glxRpdriX: x y: y z: z in: aGLXWindowId |
|
4301 |
"add another relative vertex to the polygon" |
|
4302 |
||
4303 |
%{ /* NOCONTEXT */ |
|
4304 |
Icoord c_x, c_y, c_z; |
|
4305 |
||
4306 |
_ICOORD_ (x, c_x) |
|
4307 |
_ICOORD_ (y, c_y) |
|
4308 |
_ICOORD_ (z, c_z) |
|
4309 |
SETWIN(aGLXWindowId) |
|
1932 | 4310 |
#ifdef OPENGL |
4311 |
#else |
|
528 | 4312 |
rpdri(c_x, c_y, c_z); |
1932 | 4313 |
#endif |
528 | 4314 |
%} |
4315 |
||
4316 |
"Modified: 19.3.1996 / 18:34:51 / cg" |
|
4317 |
! |
|
4318 |
||
4319 |
glxRpdrsX: x y: y z: z in: aGLXWindowId |
|
4320 |
"add another relative vertex to the polygon" |
|
4321 |
||
4322 |
%{ /* NOCONTEXT */ |
|
4323 |
Scoord c_x, c_y, c_z; |
|
4324 |
||
4325 |
_SCOORD_ (x, c_x) |
|
4326 |
_SCOORD_ (y, c_y) |
|
4327 |
_SCOORD_ (z, c_z) |
|
4328 |
SETWIN(aGLXWindowId) |
|
1932 | 4329 |
#ifdef OPENGL |
4330 |
#else |
|
528 | 4331 |
rpdrs(c_x, c_y, c_z); |
1932 | 4332 |
#endif |
528 | 4333 |
%} |
4334 |
||
4335 |
"Modified: 19.3.1996 / 18:34:55 / cg" |
|
4336 |
! |
|
4337 |
||
4338 |
glxRpmv2X: x y: y in: aGLXWindowId |
|
4339 |
"set the start position of a polygon" |
|
4340 |
||
4341 |
%{ /* NOCONTEXT */ |
|
4342 |
Coord c_x, c_y; |
|
4343 |
||
4344 |
_COORD_ (x, c_x) |
|
4345 |
_COORD_ (y, c_y) |
|
4346 |
SETWIN(aGLXWindowId) |
|
1932 | 4347 |
#ifdef OPENGL |
4348 |
#else |
|
528 | 4349 |
rpmv2(c_x, c_y); |
1932 | 4350 |
#endif |
528 | 4351 |
%} |
4352 |
||
4353 |
"Modified: 19.3.1996 / 18:37:15 / cg" |
|
4354 |
! |
|
4355 |
||
4356 |
glxRpmv2iX: x y: y in: aGLXWindowId |
|
4357 |
"set the start position of a polygon" |
|
4358 |
||
4359 |
%{ /* NOCONTEXT */ |
|
4360 |
Icoord c_x, c_y; |
|
4361 |
||
4362 |
_ICOORD_ (x, c_x) |
|
4363 |
_ICOORD_ (y, c_y) |
|
4364 |
SETWIN(aGLXWindowId) |
|
1932 | 4365 |
#ifdef OPENGL |
4366 |
#else |
|
528 | 4367 |
rpmv2i(c_x, c_y); |
1932 | 4368 |
#endif |
528 | 4369 |
%} |
4370 |
||
4371 |
"Modified: 19.3.1996 / 18:37:20 / cg" |
|
4372 |
! |
|
4373 |
||
4374 |
glxRpmv2sX: x y: y in: aGLXWindowId |
|
4375 |
"set the relative start position of a polygon" |
|
4376 |
||
4377 |
%{ /* NOCONTEXT */ |
|
4378 |
Scoord c_x, c_y; |
|
4379 |
||
4380 |
_SCOORD_ (x, c_x) |
|
4381 |
_SCOORD_ (y, c_y) |
|
4382 |
SETWIN(aGLXWindowId) |
|
1932 | 4383 |
#ifdef OPENGL |
4384 |
#else |
|
528 | 4385 |
rpmv2s(c_x, c_y); |
1932 | 4386 |
#endif |
528 | 4387 |
%} |
4388 |
||
4389 |
"Modified: 19.3.1996 / 18:38:06 / cg" |
|
4390 |
! |
|
4391 |
||
4392 |
glxRpmvX: x y: y z: z in: aGLXWindowId |
|
4393 |
"set the relative start position of a polygon" |
|
4394 |
||
4395 |
%{ /* NOCONTEXT */ |
|
4396 |
Coord c_x, c_y, c_z; |
|
4397 |
||
4398 |
_COORD_ (x, c_x) |
|
4399 |
_COORD_ (y, c_y) |
|
4400 |
_COORD_ (z, c_z) |
|
4401 |
SETWIN(aGLXWindowId) |
|
1932 | 4402 |
#ifdef OPENGL |
4403 |
#else |
|
528 | 4404 |
rpmv(c_x, c_y, c_z); |
1932 | 4405 |
#endif |
528 | 4406 |
%} |
4407 |
||
4408 |
"Modified: 19.3.1996 / 18:38:03 / cg" |
|
4409 |
! |
|
4410 |
||
4411 |
glxRpmviX: x y: y z: z in: aGLXWindowId |
|
4412 |
"set the relative start position of a polygon" |
|
4413 |
||
4414 |
%{ /* NOCONTEXT */ |
|
4415 |
Icoord c_x, c_y, c_z; |
|
4416 |
||
4417 |
_ICOORD_ (x, c_x) |
|
4418 |
_ICOORD_ (y, c_y) |
|
4419 |
_ICOORD_ (z, c_z) |
|
4420 |
SETWIN(aGLXWindowId) |
|
1932 | 4421 |
#ifdef OPENGL |
4422 |
#else |
|
528 | 4423 |
rpmvi(c_x, c_y, c_z); |
1932 | 4424 |
#endif |
528 | 4425 |
%} |
4426 |
||
4427 |
"Modified: 19.3.1996 / 18:37:53 / cg" |
|
4428 |
! |
|
4429 |
||
4430 |
glxRpmvsX: x y: y z: z in: aGLXWindowId |
|
4431 |
"set the relative start position of a polygon" |
|
4432 |
||
4433 |
%{ /* NOCONTEXT */ |
|
4434 |
Scoord c_x, c_y, c_z; |
|
4435 |
||
4436 |
_SCOORD_ (x, c_x) |
|
4437 |
_SCOORD_ (y, c_y) |
|
4438 |
_SCOORD_ (z, c_z) |
|
4439 |
SETWIN(aGLXWindowId) |
|
1932 | 4440 |
#ifdef OPENGL |
4441 |
#else |
|
528 | 4442 |
rpmvs(c_x, c_y, c_z); |
1932 | 4443 |
#endif |
528 | 4444 |
%} |
4445 |
||
4446 |
"Modified: 19.3.1996 / 18:37:58 / cg" |
|
294 | 4447 |
! ! |
4448 |
||
24 | 4449 |
!GLXWorkstation methodsFor:'queries'! |
4450 |
||
159 | 4451 |
glVersion |
4452 |
"return a string describing the GL version. |
|
4453 |
For informative use only; portable applications do not depend |
|
4454 |
on the returned string." |
|
4455 |
||
4456 |
%{ /* NOCONTEXT */ |
|
4457 |
#ifdef VGL |
|
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
4458 |
RETURN (__MKSTRING("vogl")); |
159 | 4459 |
#else |
1932 | 4460 |
# ifdef GLX |
159 | 4461 |
char buffer[128]; |
4462 |
||
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4463 |
if (_INST(glOK) == true) { |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4464 |
gversion(buffer); |
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
4465 |
RETURN (__MKSTRING(buffer)); |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4466 |
} |
1932 | 4467 |
RETURN (nil); |
4468 |
# else |
|
4469 |
RETURN (nil); |
|
4470 |
# endif |
|
159 | 4471 |
#endif |
4472 |
%} |
|
4473 |
||
4474 |
" |
|
4718 | 4475 |
Display glVersion |
159 | 4476 |
" |
4477 |
! |
|
4478 |
||
528 | 4479 |
glxGetplanesIn: aGLXWindowId |
4480 |
"Returns the number if bit planes available on the device." |
|
4481 |
||
4482 |
%{ /* NOCONTEXT */ |
|
1932 | 4483 |
SETWIN(aGLXWindowId) |
4484 |
#ifdef OPENGL |
|
4485 |
#else |
|
528 | 4486 |
RETURN (__MKSMALLINT(getplanes())); |
4487 |
#endif |
|
1932 | 4488 |
%}. |
4489 |
^ 0 |
|
528 | 4490 |
|
4491 |
"Modified: 19.3.1996 / 18:50:44 / cg" |
|
4492 |
! |
|
4493 |
||
294 | 4494 |
hasStereoExtension |
4495 |
"return true, if this workstation supports stereo GL drawing. |
|
4496 |
Both the server must support it, and the feature must have been |
|
4497 |
enabled in the smalltalk system, for true to be returned." |
|
4498 |
||
4499 |
^ hasStereoExtension |
|
4500 |
||
4501 |
" |
|
4718 | 4502 |
Display hasStereoExtension |
294 | 4503 |
" |
4504 |
! |
|
4505 |
||
3214 | 4506 |
isOpenGL |
4507 |
"return true, if this is an openGL (as opposed to a GL)" |
|
4508 |
||
4509 |
%{ /* NOCONTEXT */ |
|
4510 |
#ifdef OPENGL |
|
4511 |
RETURN ( true ); |
|
4512 |
#else |
|
4513 |
RETURN ( false ); |
|
4514 |
#endif |
|
4515 |
%} |
|
4516 |
! |
|
4517 |
||
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4518 |
isTrueGL |
1932 | 4519 |
"return true, if this is a true GL (as opposed to a simulated VOGL). |
4520 |
Returns false for all openGL systems." |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4521 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4522 |
%{ /* NOCONTEXT */ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4523 |
#ifdef VGL |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4524 |
RETURN ( false ); |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4525 |
#else |
1932 | 4526 |
# ifdef GLX |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4527 |
RETURN ( true ); |
1932 | 4528 |
# endif |
4529 |
#endif |
|
3214 | 4530 |
%}. |
4531 |
^ false |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4532 |
! |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4533 |
|
294 | 4534 |
maxZValue |
4535 |
"return the max. Z value (only valid if z-buffer is supported)" |
|
4718 | 4536 |
%{ |
1932 | 4537 |
#ifndef OPENGL |
4538 |
# ifdef GD_ZMAX |
|
294 | 4539 |
long zMax; |
4540 |
||
4541 |
if (_INST(glOK) == true) { |
|
4542 |
zMax = getgdesc(GD_ZMAX); |
|
4543 |
||
4544 |
if ((zMax >= _MIN_INT) && (zMax <= _MAX_INT)) { |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4545 |
RETURN ( __MKSMALLINT(zMax) ); |
294 | 4546 |
} |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4547 |
RETURN ( __MKLARGEINT(zMax) ); |
294 | 4548 |
} |
1932 | 4549 |
# endif |
294 | 4550 |
#endif |
4551 |
%}. |
|
4552 |
^ nil |
|
4553 |
! |
|
4554 |
||
4555 |
supportsDoubleBuffer |
|
4556 |
"return true, if this gl workstation supports double buffering. |
|
157 | 4557 |
For portable applications, always combine this with a query |
4558 |
if the display supports GL drawing at all." |
|
24 | 4559 |
|
4560 |
%{ /* NOCONTEXT */ |
|
294 | 4561 |
|
1932 | 4562 |
#ifndef OPENGL |
4563 |
# ifdef VGL |
|
4564 |
RETURN (true); |
|
4565 |
# else |
|
4566 |
# ifdef GD_BITS_NORM_DBL_RED |
|
294 | 4567 |
if (getgdesc(GD_BITS_NORM_DBL_RED) != 0) { |
4568 |
RETURN ( _INST(glOK) ); |
|
4569 |
} |
|
1932 | 4570 |
# endif |
4571 |
# endif |
|
24 | 4572 |
#endif |
89 | 4573 |
%}. |
4574 |
^ false |
|
4575 |
||
4576 |
" |
|
4718 | 4577 |
Display supportsDoubleBuffer |
294 | 4578 |
" |
4579 |
! |
|
4580 |
||
4581 |
supportsGLDrawing |
|
4582 |
"return true, if this device supports 3D GL drawing." |
|
4583 |
||
4584 |
^ glOK |
|
4585 |
||
4586 |
" |
|
4718 | 4587 |
Display supportsGLDrawing |
89 | 4588 |
" |
64 | 4589 |
! |
4590 |
||
4591 |
supportsLight |
|
157 | 4592 |
"return true, if this gl workstation supports light sources |
7893 | 4593 |
(i.e. if it's a real GL). |
157 | 4594 |
For portable applications, always combine this with a query |
4595 |
if the display supports GL drawing at all." |
|
89 | 4596 |
|
4597 |
%{ /* NOCONTEXT */ |
|
64 | 4598 |
#ifdef GLX |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4599 |
RETURN ( _INST(glOK) ); |
64 | 4600 |
#endif |
89 | 4601 |
%}. |
4602 |
^ false |
|
4603 |
||
4604 |
" |
|
4718 | 4605 |
Display supportsLight |
89 | 4606 |
" |
7893 | 4607 |
|
4608 |
"Modified (comment): / 13-02-2017 / 20:19:29 / cg" |
|
89 | 4609 |
! |
4610 |
||
294 | 4611 |
supportsRGB |
4612 |
"return true, if this gl workstation supports rgb |
|
4613 |
(in addition to indexed) colors. Actually, we return true |
|
4614 |
for a real GL engine, false for the simulator here. |
|
4615 |
For portable applications, always combine this with a query |
|
4616 |
if the display supports GL drawing at all." |
|
4617 |
||
4618 |
%{ /* NOCONTEXT */ |
|
4619 |
#ifdef GLX |
|
4620 |
RETURN ( _INST(glOK) ); |
|
4621 |
#endif |
|
4622 |
%}. |
|
4623 |
^ false |
|
4624 |
||
4625 |
" |
|
4718 | 4626 |
Display supportsRGB |
294 | 4627 |
" |
4628 |
! |
|
4629 |
||
89 | 4630 |
supportsTextures |
4631 |
"return true, if this gl workstation supports texture mapping |
|
7893 | 4632 |
(i.e. if it's a real GL). |
157 | 4633 |
For portable applications, always combine this with a query |
4634 |
if the display supports GL drawing at all." |
|
89 | 4635 |
|
4636 |
%{ /* NOCONTEXT */ |
|
1932 | 4637 |
#ifndef OPENGL |
4638 |
# ifdef GD_TEXTURE |
|
89 | 4639 |
if (getgdesc(GD_TEXTURE) != 0) { |
7893 | 4640 |
RETURN ( _INST(glOK) ); |
89 | 4641 |
} |
1932 | 4642 |
# endif |
89 | 4643 |
#endif |
4644 |
%}. |
|
4645 |
^ false |
|
4646 |
||
4647 |
" |
|
4718 | 4648 |
Display supportsTextures |
89 | 4649 |
" |
7893 | 4650 |
|
4651 |
"Modified: / 13-02-2017 / 20:19:40 / cg" |
|
89 | 4652 |
! |
4653 |
||
4654 |
supportsZBuffer |
|
157 | 4655 |
"return true, if this gl workstation has z buffer support. |
4656 |
For portable applications, always combine this with a query |
|
4657 |
if the display supports GL drawing at all." |
|
4658 |
||
89 | 4659 |
%{ /* NOCONTEXT */ |
4660 |
||
1932 | 4661 |
#ifndef OPENGL |
4662 |
# ifdef GD_BITS_NORM_ZBUFFER |
|
89 | 4663 |
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
|
4664 |
RETURN ( _INST(glOK) ); |
89 | 4665 |
} |
1932 | 4666 |
# endif |
89 | 4667 |
#endif |
4668 |
%}. |
|
4669 |
^ false |
|
4670 |
||
4671 |
" |
|
4718 | 4672 |
Display supportsZBuffer |
89 | 4673 |
" |
294 | 4674 |
! ! |
4675 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4676 |
!GLXWorkstation methodsFor:'rectangles'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4677 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4678 |
glxRectX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4679 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4680 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4681 |
SETWIN(aGLXWindowId) |
1932 | 4682 |
#ifdef OPENGL |
4683 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4684 |
rect(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
1932 | 4685 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4686 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4687 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4688 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4689 |
glxRectfX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4690 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4691 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4692 |
SETWIN(aGLXWindowId) |
1932 | 4693 |
#ifdef OPENGL |
4694 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4695 |
rectf(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
1932 | 4696 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4697 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4698 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4699 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4700 |
glxRectfiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4701 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4702 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4703 |
SETWIN(aGLXWindowId) |
1932 | 4704 |
#ifdef OPENGL |
4705 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4706 |
rectfi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
1932 | 4707 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4708 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4709 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4710 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4711 |
glxRectfsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4712 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4713 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4714 |
SETWIN(aGLXWindowId) |
1932 | 4715 |
#ifdef OPENGL |
4716 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4717 |
rectfs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
1932 | 4718 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4719 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4720 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4721 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4722 |
glxRectiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4723 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4724 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4725 |
SETWIN(aGLXWindowId) |
1932 | 4726 |
#ifdef OPENGL |
4727 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4728 |
recti(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
1932 | 4729 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4730 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4731 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4732 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4733 |
glxRectsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4734 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4735 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4736 |
SETWIN(aGLXWindowId) |
1932 | 4737 |
#ifdef OPENGL |
4738 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4739 |
rects(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
1932 | 4740 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4741 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4742 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4743 |
|
528 | 4744 |
!GLXWorkstation methodsFor:'spheres'! |
294 | 4745 |
|
4746 |
glxSphDraw:arrayOf4Floats in:aGLXWindowId |
|
4747 |
"argument must be an array(a matrix) of 4 floats containing the |
|
4748 |
sphere - in real GL only" |
|
4749 |
||
4750 |
%{ /* NOCONTEXT */ |
|
4751 |
#ifdef GLX |
|
4752 |
float vec[4], *v; |
|
4753 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4754 |
if (! (v = __glx_getFloatsFromInto(arrayOf4Floats, vec, 4))) RETURN(false); |
294 | 4755 |
SETWIN(aGLXWindowId) |
4756 |
sphdraw(v); |
|
1932 | 4757 |
#endif |
4758 |
%} |
|
294 | 4759 |
! |
4760 |
||
4761 |
glxSphDrawX:x y:y z:z radius:r in:aGLXWindowId |
|
4762 |
"arguments must be convertable to floats - in real GL only" |
|
4763 |
||
4764 |
%{ /* NOCONTEXT */ |
|
4765 |
#ifdef GLX |
|
4766 |
float vec[4]; |
|
4767 |
||
4768 |
_FLOAT_(x, vec[0]) |
|
4769 |
_FLOAT_(y, vec[1]) |
|
4770 |
_FLOAT_(z, vec[2]) |
|
4771 |
_FLOAT_(r, vec[3]) |
|
4772 |
SETWIN(aGLXWindowId) |
|
4773 |
sphdraw(vec); |
|
1932 | 4774 |
#endif |
4775 |
%} |
|
294 | 4776 |
! |
4777 |
||
4778 |
glxSphfreeIn: aGLXWindowId |
|
4779 |
||
4780 |
%{ /* NOCONTEXT */ |
|
4781 |
#ifdef GLX |
|
4782 |
SETWIN(aGLXWindowId) |
|
4783 |
sphfree(); |
|
1932 | 4784 |
#endif |
4785 |
%} |
|
294 | 4786 |
! |
4787 |
||
4788 |
glxSphgnpolysIn: aGLXWindowId |
|
4789 |
||
4790 |
%{ /* NOCONTEXT */ |
|
4791 |
#ifdef GLX |
|
4792 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4793 |
RETURN (__MKSMALLINT(sphgnpolys())); |
294 | 4794 |
#endif |
4795 |
%} |
|
4796 |
! |
|
4797 |
||
4798 |
glxSphmode: attribute value: value in: aGLXWindowId |
|
4799 |
||
4800 |
%{ /* NOCONTEXT */ |
|
4801 |
#ifdef GLX |
|
4802 |
SETWIN(aGLXWindowId) |
|
4803 |
sphmode(__intVal(attribute), __intVal(value)); |
|
1932 | 4804 |
#endif |
4805 |
%} |
|
294 | 4806 |
! |
4807 |
||
4808 |
glxSphobj: objid in: aGLXWindowId |
|
4809 |
||
4810 |
%{ /* NOCONTEXT */ |
|
4811 |
#ifdef GLX |
|
4812 |
SETWIN(aGLXWindowId) |
|
4813 |
sphobj(_objectVal(objid)); |
|
1932 | 4814 |
#endif |
4815 |
%} |
|
294 | 4816 |
! |
4817 |
||
4818 |
glxSphrotmatrix: mat in: aGLXWindowId |
|
4819 |
||
4820 |
%{ /* NOCONTEXT */ |
|
4821 |
#ifdef GLX |
|
4822 |
Matrix matrix, *m; |
|
4823 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4824 |
if (! (m = __glx_getFloatsFromMatrixInto(mat, &matrix))) RETURN (false); |
294 | 4825 |
SETWIN(aGLXWindowId) |
4826 |
sphrotmatrix(*m); |
|
1932 | 4827 |
#endif |
4828 |
%} |
|
294 | 4829 |
! ! |
4830 |
||
4831 |
!GLXWorkstation methodsFor:'stereo extension'! |
|
4832 |
||
528 | 4833 |
glxLeftbuffer: bool in: aGLXWindowId |
4834 |
||
4835 |
%{ /* NOCONTEXT */ |
|
4836 |
#ifdef FULL_GLX |
|
4837 |
SETWIN(aGLXWindowId) |
|
4838 |
leftbuffer(_booleanVal(bool)); |
|
1932 | 4839 |
#endif |
4840 |
%} |
|
528 | 4841 |
! |
4842 |
||
4843 |
glxMonobufferIn: aGLXWindowId |
|
4844 |
||
4845 |
%{ /* NOCONTEXT */ |
|
4846 |
#ifdef FULL_GLX |
|
4847 |
SETWIN(aGLXWindowId) |
|
4848 |
monobuffer(); |
|
1932 | 4849 |
#endif |
4850 |
%} |
|
528 | 4851 |
! |
4852 |
||
4853 |
glxRightbuffer: bool in: aGLXWindowId |
|
4854 |
||
4855 |
%{ /* NOCONTEXT */ |
|
4856 |
#ifdef FULL_GLX |
|
4857 |
SETWIN(aGLXWindowId) |
|
4858 |
rightbuffer(_booleanVal(bool)); |
|
1932 | 4859 |
#endif |
4860 |
%} |
|
528 | 4861 |
! |
4862 |
||
294 | 4863 |
stereoExtensionBuffer:aBufferSymbol for:aWindowId |
4864 |
"set the current stereo buffer; the argument may be one of: |
|
4865 |
#left -> STEREO_BUFFER_LEFT |
|
4866 |
#right -> STEREO_BUFFER_RIGHT |
|
4867 |
" |
|
4868 |
||
4869 |
%{ /* NOCONTEXT */ |
|
4870 |
#if defined(XSGIStereo) && defined(GLX) |
|
4871 |
Status status; |
|
4872 |
int buffer; |
|
4873 |
Window win; |
|
4874 |
||
4718 | 4875 |
if (ISCONNECTED |
294 | 4876 |
&& __isExternalAddress(aWindowId)) { |
4877 |
win = _WindowVal(aWindowId); |
|
4878 |
if (aBufferSymbol == @symbol(left)) { |
|
4879 |
buffer = STEREO_BUFFER_LEFT; |
|
4880 |
} else { |
|
4881 |
if (aBufferSymbol == @symbol(right)) { |
|
4882 |
buffer = STEREO_BUFFER_RIGHT; |
|
4883 |
} else { |
|
4884 |
goto bad; |
|
4885 |
} |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4886 |
} |
294 | 4887 |
status = XSGISetStereoBuffer(myDpy, win, buffer); |
4888 |
RETURN ( status ? true : false); |
|
4889 |
} |
|
4890 |
bad: ; |
|
4891 |
#endif |
|
4892 |
%}. |
|
4893 |
self primitiveFailed |
|
4894 |
||
4895 |
" |
|
4896 |
|t v| |
|
4897 |
||
4898 |
t := StandardSystemView new. |
|
4899 |
t extent:300@300. |
|
4900 |
v := GLXView origin:0.0@0.0 corner:1.0@1.0 in:t. |
|
4901 |
t openAndWait. |
|
4902 |
||
4718 | 4903 |
v device stereoExtensionBuffer:#left for:(v id). |
294 | 4904 |
(Delay forSeconds:10) wait. |
4718 | 4905 |
v device stereoExtensionBuffer:#right for:(v id). |
294 | 4906 |
" |
4907 |
! |
|
4908 |
||
4909 |
stereoExtensionMode:aModeSymbol height:h offset:o for:aWindowId |
|
4910 |
"set the current stereo mode; the argument may be one of: |
|
4911 |
nil/false #off -> turn it off |
|
4912 |
#bottom -> STEREO_BOTTOM |
|
4913 |
#top -> STEREO_TOP |
|
4914 |
" |
|
4915 |
||
4916 |
%{ /* NOCONTEXT */ |
|
4917 |
#if defined(XSGIStereo) && defined(GLX) |
|
4918 |
Status status; |
|
4919 |
int mode; |
|
4920 |
unsigned short us_h, us_o; |
|
4921 |
Window win; |
|
4922 |
||
4718 | 4923 |
if (ISCONNECTED |
294 | 4924 |
&& __bothSmallInteger(h, o) |
4925 |
&& __isExternalAddress(aWindowId)) { |
|
4926 |
win = _WindowVal(aWindowId); |
|
4927 |
if ((aModeSymbol == nil) |
|
4928 |
|| (aModeSymbol == false) |
|
4929 |
|| (aModeSymbol == @symbol(off))) { |
|
4930 |
mode = STEREO_OFF; |
|
4931 |
} else { |
|
4932 |
if (aModeSymbol == @symbol(bottom)) { |
|
4933 |
mode = STEREO_BOTTOM; |
|
4934 |
} else { |
|
4935 |
if (aModeSymbol == @symbol(top)) { |
|
4936 |
mode = STEREO_TOP; |
|
4937 |
} else { |
|
4938 |
goto bad; |
|
4939 |
} |
|
4940 |
} |
|
4941 |
} |
|
4942 |
us_h = __intVal(h); |
|
4943 |
us_o = __intVal(o); |
|
4944 |
status = XSGISetStereoMode(myDpy, win, us_h, us_o, mode); |
|
4945 |
RETURN ( status ? true : false); |
|
4946 |
} |
|
4947 |
bad: ; |
|
4948 |
#endif |
|
4949 |
%}. |
|
4950 |
self primitiveFailed |
|
4951 |
||
4952 |
" |
|
4718 | 4953 |
Display stereoExtensionMode:#top height:492 offset:532 for:(Display rootWindowId). |
294 | 4954 |
(Delay forSeconds:10) wait. |
4718 | 4955 |
Display stereoExtensionMode:#off height:0 offset:0 for:(Display rootWindowId). |
294 | 4956 |
" |
4957 |
! |
|
4958 |
||
4959 |
stereoExtensionModeIn:aWindowId |
|
4960 |
"return the current stereo mode for some window" |
|
4961 |
||
4962 |
%{ /* NOCONTEXT */ |
|
4963 |
#if defined(XSGIStereo) && defined(GLX) |
|
4964 |
int mode; |
|
4965 |
Window win; |
|
4966 |
||
4967 |
if (ISCONNECTED && __isExternalAddress(aWindowId)) { |
|
4968 |
win = _WindowVal(aWindowId); |
|
4969 |
mode = XSGIQueryStereoMode(myDpy, win); |
|
4970 |
switch (mode) { |
|
4971 |
case STEREO_OFF: |
|
4972 |
RETURN ( @symbol(off) ); |
|
4973 |
case STEREO_BOTTOM: |
|
4974 |
RETURN ( @symbol(bottom) ); |
|
4975 |
case STEREO_TOP: |
|
4976 |
RETURN ( @symbol(top) ); |
|
4977 |
} |
|
4978 |
RETURN ( @symbol(unsupported) ); |
|
4979 |
} |
|
4980 |
#endif |
|
4981 |
%}. |
|
4982 |
self primitiveFailed |
|
4983 |
||
4984 |
" |
|
4985 |
|v| |
|
4986 |
||
4987 |
v := StandardSystemView new. |
|
4988 |
v extent:300@300. |
|
4989 |
v openAndWait. |
|
4990 |
v device stereoExtensionModeIn:(v id) |
|
4991 |
||
4718 | 4992 |
Display stereoExtensionModeIn:Display rootWindowId |
294 | 4993 |
" |
4994 |
! |
|
4995 |
||
4996 |
stereoExtensionVersion |
|
4997 |
"return the stereo extensions version as an array consisting of |
|
4998 |
major and minor numbers." |
|
4999 |
||
5000 |
%{ /* NOCONTEXT */ |
|
5001 |
#if defined(XSGIStereo) && defined(GLX) |
|
5002 |
Status status; |
|
5003 |
Display *dpy = myDpy; |
|
5004 |
int major, minor; |
|
5005 |
||
5006 |
if (ISCONNECTED) { |
|
5007 |
status = XSGIStereoQueryVersion(myDpy, &major, &minor); |
|
5008 |
if (status == True) { |
|
5009 |
RETURN ( __ARRAY_WITH2(__MKSMALLINT(major), __MKSMALLINT(minor))); |
|
5010 |
} |
|
89 | 5011 |
} |
5012 |
#endif |
|
5013 |
%}. |
|
294 | 5014 |
self primitiveFailed |
185 | 5015 |
|
5016 |
" |
|
294 | 5017 |
Display stereoExtensionVersion |
185 | 5018 |
" |
24 | 5019 |
! ! |
5020 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5021 |
!GLXWorkstation methodsFor:'texture data transfer'! |
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 |
glxT2d: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5024 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5025 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5026 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5027 |
double vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5028 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5029 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5030 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5031 |
t2d(c_v); |
1932 | 5032 |
#endif |
5033 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5034 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5035 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5036 |
glxT2f: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5037 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5038 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5039 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5040 |
float vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5041 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5042 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5043 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5044 |
t2f(c_v); |
1932 | 5045 |
#endif |
5046 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5047 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5048 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5049 |
glxT2i: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5050 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5051 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5052 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5053 |
long vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5054 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5055 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5056 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5057 |
t2i(c_v); |
1932 | 5058 |
#endif |
5059 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5060 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5061 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5062 |
glxT2s: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5063 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5064 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5065 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5066 |
short vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5067 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5068 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5069 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5070 |
t2s(c_v); |
1932 | 5071 |
#endif |
5072 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5073 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5074 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5075 |
glxT3d:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5076 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5077 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5078 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5079 |
double vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5080 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5081 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5082 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5083 |
t3d(c_v); |
1932 | 5084 |
#endif |
5085 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5086 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5087 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5088 |
glxT3f:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5089 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5090 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5091 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5092 |
float vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5093 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5094 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5095 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5096 |
t3f(c_v); |
1932 | 5097 |
#endif |
5098 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5099 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5100 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5101 |
glxT3i:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5102 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5103 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5104 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5105 |
long vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5106 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5107 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5108 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5109 |
t3i(c_v); |
1932 | 5110 |
#endif |
5111 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5112 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5113 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5114 |
glxT3s:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5115 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5116 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5117 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5118 |
short vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5119 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5120 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5121 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5122 |
t3s(c_v); |
1932 | 5123 |
#endif |
5124 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5125 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5126 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5127 |
glxT4d: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5128 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5129 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5130 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5131 |
double vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5132 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5133 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5134 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5135 |
t4d(c_v); |
1932 | 5136 |
#endif |
5137 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5138 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5139 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5140 |
glxT4f: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5141 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5142 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5143 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5144 |
float vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5145 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5146 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5147 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5148 |
t4f(c_v); |
1932 | 5149 |
#endif |
5150 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5151 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5152 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5153 |
glxT4i: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5154 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5155 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5156 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5157 |
long vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5158 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5159 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5160 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5161 |
t4i(c_v); |
1932 | 5162 |
#endif |
5163 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5164 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5165 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5166 |
glxT4s: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5167 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5168 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5169 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5170 |
short vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5171 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5172 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5173 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5174 |
t4s(c_v); |
1932 | 5175 |
#endif |
5176 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5177 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5178 |
|
294 | 5179 |
!GLXWorkstation methodsFor:'transformations'! |
5180 |
||
5181 |
glxRotate:angle axis:axis in:aGLXWindowId |
|
5182 |
"rotate the current matrix around the axis given by the axis arg, |
|
5183 |
which must be one of the symbols: #x, #y or #z. |
|
5184 |
The angle is in degrees." |
|
5185 |
||
5186 |
%{ /* NOCONTEXT */ |
|
5187 |
||
5188 |
char c_axis; |
|
5189 |
||
5190 |
if (axis == @symbol(x)) |
|
5191 |
c_axis = 'x'; |
|
5192 |
else if (axis == @symbol(y)) |
|
5193 |
c_axis = 'y'; |
|
5194 |
else if (axis == @symbol(z)) |
|
5195 |
c_axis = 'z'; |
|
5196 |
else { |
|
5197 |
RETURN (false); |
|
5198 |
} |
|
5199 |
||
5200 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5201 |
RETURN ( __glx_doRotate(angle, c_axis) ); |
294 | 5202 |
%} |
5203 |
! |
|
5204 |
||
5205 |
glxRotate:arrayOf3Floats in:aGLXWindowId |
|
5206 |
"rotate current matrix, given a 3-element vector (or more). |
|
5207 |
The elements of the array are degrees." |
|
5208 |
||
5209 |
%{ /* NOCONTEXT */ |
|
5210 |
||
5211 |
float vec[3], *v; |
|
5212 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5213 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5214 |
|
5215 |
SETWIN(aGLXWindowId) |
|
1932 | 5216 |
#ifdef OPENGL |
5217 |
#else |
|
294 | 5218 |
rot(v[0], 'x'); |
5219 |
rot(v[1], 'y'); |
|
5220 |
rot(v[2], 'z'); |
|
1932 | 5221 |
#endif |
294 | 5222 |
%} |
5223 |
! |
|
5224 |
||
5225 |
glxRotateI:angle axis:axis in:aGLXWindowId |
|
5226 |
"rotate the current matrix around the axis given by the axis arg, |
|
5227 |
which must be one of the symbols: #x, #y or #z. |
|
5228 |
The angle is an integer specifying tenths of a degree." |
|
5229 |
||
5230 |
%{ /* NOCONTEXT */ |
|
5231 |
||
5232 |
char c_axis; |
|
5233 |
||
5234 |
if (axis == @symbol(x)) |
|
5235 |
c_axis = 'x'; |
|
5236 |
else if (axis == @symbol(y)) |
|
5237 |
c_axis = 'y'; |
|
5238 |
else if (axis == @symbol(z)) |
|
5239 |
c_axis = 'z'; |
|
5240 |
else { |
|
5241 |
RETURN (false); |
|
5242 |
} |
|
5243 |
||
5244 |
if (__isSmallInteger(angle)) { |
|
5245 |
SETWIN(aGLXWindowId) |
|
1932 | 5246 |
#ifdef OPENGL |
5247 |
#else |
|
294 | 5248 |
rotate(__intVal(angle), c_axis); |
1932 | 5249 |
#endif |
294 | 5250 |
} |
5251 |
%} |
|
5252 |
! |
|
5253 |
||
5254 |
glxRotateIX:angle in:aGLXWindowId |
|
5255 |
"rotate the current matrix on x axis. |
|
5256 |
The angle is an integer specifying tenths of a degree." |
|
5257 |
||
5258 |
%{ /* NOCONTEXT */ |
|
5259 |
||
5260 |
if (__isSmallInteger(angle)) { |
|
5261 |
SETWIN(aGLXWindowId) |
|
1932 | 5262 |
#ifdef OPENGL |
5263 |
#else |
|
294 | 5264 |
rotate(__intVal(angle), 'x'); |
1932 | 5265 |
#endif |
294 | 5266 |
} |
5267 |
%} |
|
5268 |
! |
|
5269 |
||
5270 |
glxRotateIX:xAngle y:yAngle z:zAngle in:aGLXWindowId |
|
5271 |
"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
|
5272 |
The values are smallIntegers specifying tenths of a degree." |
294 | 5273 |
|
5274 |
%{ /* NOCONTEXT */ |
|
5275 |
||
5276 |
if (__bothSmallInteger(xAngle, yAngle) |
|
5277 |
&& __isSmallInteger(zAngle)) { |
|
5278 |
SETWIN(aGLXWindowId) |
|
1932 | 5279 |
#ifdef OPENGL |
5280 |
#else |
|
294 | 5281 |
rotate(__intVal(xAngle), 'x'); |
5282 |
rotate(__intVal(yAngle), 'y'); |
|
5283 |
rotate(__intVal(zAngle), 'z'); |
|
1932 | 5284 |
#endif |
294 | 5285 |
} |
5286 |
%} |
|
5287 |
! |
|
5288 |
||
5289 |
glxRotateIY:angle in:aGLXWindowId |
|
5290 |
"rotate the current matrix on x axis. |
|
5291 |
The angle is an integer specifying tenths of a degree." |
|
5292 |
||
5293 |
%{ /* NOCONTEXT */ |
|
5294 |
||
5295 |
if (__isSmallInteger(angle)) { |
|
5296 |
SETWIN(aGLXWindowId) |
|
1932 | 5297 |
#ifdef OPENGL |
5298 |
#else |
|
294 | 5299 |
rotate(__intVal(angle), 'y'); |
1932 | 5300 |
#endif |
294 | 5301 |
} |
5302 |
%} |
|
5303 |
! |
|
5304 |
||
5305 |
glxRotateIZ:angle in:aGLXWindowId |
|
5306 |
"rotate the current matrix on x axis. |
|
5307 |
The angle is an integer specifying tenths of a degree." |
|
5308 |
||
5309 |
%{ /* NOCONTEXT */ |
|
5310 |
||
5311 |
if (__isSmallInteger(angle)) { |
|
5312 |
SETWIN(aGLXWindowId) |
|
1932 | 5313 |
#ifdef OPENGL |
5314 |
#else |
|
294 | 5315 |
rotate(__intVal(angle), 'z'); |
1932 | 5316 |
#endif |
294 | 5317 |
} |
5318 |
%} |
|
5319 |
! |
|
5320 |
||
5321 |
glxRotateX:angle in:aGLXWindowId |
|
5322 |
"rotate the current matrix on x axis. |
|
5323 |
The angle is in degrees." |
|
5324 |
||
5325 |
%{ /* NOCONTEXT */ |
|
5326 |
||
5327 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5328 |
RETURN (__glx_doRotate(angle, 'x')); |
294 | 5329 |
%} |
5330 |
! |
|
5331 |
||
5332 |
glxRotateX:xAngle y:yAngle z:zAngle in:aGLXWindowId |
|
5333 |
"rotate the current matrix on all axes, given individual x, y and z values. |
|
5334 |
The values are in degrees" |
|
5335 |
||
5336 |
%{ /* NOCONTEXT */ |
|
5337 |
||
5338 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5339 |
if ( __glx_doRotate(xAngle, 'x') == true) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5340 |
if ( __glx_doRotate(yAngle, 'y') == true) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5341 |
RETURN (__glx_doRotate(zAngle, 'z')); |
294 | 5342 |
} |
5343 |
} |
|
5344 |
%} |
|
5345 |
! |
|
5346 |
||
5347 |
glxRotateY:angle in:aGLXWindowId |
|
5348 |
"rotate the current matrix on y axis. |
|
5349 |
The angle is in degrees." |
|
5350 |
||
5351 |
%{ /* NOCONTEXT */ |
|
5352 |
||
5353 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5354 |
RETURN (__glx_doRotate(angle, 'y')); |
294 | 5355 |
%} |
5356 |
! |
|
5357 |
||
5358 |
glxRotateZ:angle in:aGLXWindowId |
|
5359 |
"rotate the current matrix on z axis. |
|
5360 |
The angle is in degrees." |
|
5361 |
||
5362 |
%{ /* NOCONTEXT */ |
|
5363 |
||
5364 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5365 |
RETURN (__glx_doRotate(angle, 'z')); |
294 | 5366 |
%} |
5367 |
! |
|
5368 |
||
5369 |
glxScale:arrayOf3Floats in:aGLXWindowId |
|
5370 |
"scale current matrix, given a 3-element vector" |
|
5371 |
||
5372 |
%{ /* NOCONTEXT */ |
|
5373 |
||
5374 |
float vec[3], *v; |
|
5375 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5376 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5377 |
|
5378 |
SETWIN(aGLXWindowId) |
|
1932 | 5379 |
#ifdef OPENGL |
5380 |
#else |
|
294 | 5381 |
scale(v[0], v[1], v[2]); |
1932 | 5382 |
#endif |
294 | 5383 |
%} |
5384 |
! |
|
5385 |
||
5386 |
glxScaleX:x in:aGLXWindowId |
|
5387 |
"scale in x direction" |
|
5388 |
||
5389 |
%{ /* NOCONTEXT */ |
|
5390 |
||
5391 |
float f_x; |
|
5392 |
||
5393 |
_FLOAT_ (x, f_x) |
|
5394 |
SETWIN(aGLXWindowId) |
|
1932 | 5395 |
#ifdef OPENGL |
5396 |
#else |
|
294 | 5397 |
scale(f_x, (float)0, (float)0); |
1932 | 5398 |
#endif |
294 | 5399 |
%} |
5400 |
! |
|
5401 |
||
5402 |
glxScaleX:x y:y z:z in:aGLXWindowId |
|
5403 |
"scale & mirror current matrix, given individual x, y and z values" |
|
5404 |
||
5405 |
%{ /* NOCONTEXT */ |
|
5406 |
||
5407 |
float f_x, f_y, f_z; |
|
5408 |
||
5409 |
_FLOAT_ (x, f_x) |
|
5410 |
_FLOAT_ (y, f_y) |
|
5411 |
_FLOAT_ (z, f_z) |
|
5412 |
SETWIN(aGLXWindowId) |
|
1932 | 5413 |
#ifdef OPENGL |
5414 |
#else |
|
294 | 5415 |
scale(f_x, f_y, f_z); |
1932 | 5416 |
#endif |
294 | 5417 |
%} |
5418 |
! |
|
5419 |
||
5420 |
glxScaleY:y in:aGLXWindowId |
|
5421 |
"scale in y direction" |
|
5422 |
||
5423 |
%{ /* NOCONTEXT */ |
|
5424 |
||
5425 |
float f_y; |
|
5426 |
||
5427 |
_FLOAT_ (y, f_y) |
|
5428 |
SETWIN(aGLXWindowId) |
|
1932 | 5429 |
#ifdef OPENGL |
5430 |
#else |
|
294 | 5431 |
scale((float)0, f_y, (float)0); |
1932 | 5432 |
#endif |
294 | 5433 |
%} |
5434 |
! |
|
5435 |
||
5436 |
glxScaleZ:z in:aGLXWindowId |
|
5437 |
"scale in z direction" |
|
5438 |
||
5439 |
%{ /* NOCONTEXT */ |
|
5440 |
||
5441 |
float f_z; |
|
5442 |
||
5443 |
_FLOAT_ (z, f_z) |
|
5444 |
SETWIN(aGLXWindowId) |
|
1932 | 5445 |
#ifdef OPENGL |
5446 |
#else |
|
294 | 5447 |
scale((float)0, (float)0, f_z); |
1932 | 5448 |
#endif |
294 | 5449 |
%} |
5450 |
! |
|
5451 |
||
5452 |
glxTranslate:arrayOf3Floats in:aGLXWindowId |
|
5453 |
"translate current matrix, given a 3-element vector" |
|
5454 |
||
5455 |
%{ /* NOCONTEXT */ |
|
5456 |
||
5457 |
float vec[3], *v; |
|
5458 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5459 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5460 |
|
5461 |
SETWIN(aGLXWindowId) |
|
1932 | 5462 |
#ifdef OPENGL |
5463 |
#else |
|
294 | 5464 |
translate((Coord)(v[0]), (Coord)(v[1]), (Coord)(v[2])); |
1932 | 5465 |
#endif |
294 | 5466 |
%} |
5467 |
! |
|
5468 |
||
5469 |
glxTranslateX:x in:aGLXWindowId |
|
5470 |
"translate current matrix on X axis" |
|
5471 |
||
5472 |
%{ /* NOCONTEXT */ |
|
5473 |
||
5474 |
Coord c_x; |
|
5475 |
||
5476 |
_COORD_ (x, c_x) |
|
5477 |
SETWIN(aGLXWindowId) |
|
1932 | 5478 |
#ifdef OPENGL |
5479 |
#else |
|
294 | 5480 |
translate(c_x, (Coord)0, (Coord)0); |
1932 | 5481 |
#endif |
294 | 5482 |
%} |
5483 |
! |
|
5484 |
||
5485 |
glxTranslateX:x y:y z:z in:aGLXWindowId |
|
5486 |
"translate current matrix, given individual x, y and z values" |
|
5487 |
||
5488 |
%{ /* NOCONTEXT */ |
|
5489 |
||
5490 |
Coord c_x, c_y, c_z; |
|
5491 |
||
5492 |
_COORD_ (x, c_x) |
|
5493 |
_COORD_ (y, c_y) |
|
5494 |
_COORD_ (z, c_z) |
|
5495 |
SETWIN(aGLXWindowId) |
|
1932 | 5496 |
#ifdef OPENGL |
5497 |
#else |
|
294 | 5498 |
translate(c_x, c_y, c_z); |
1932 | 5499 |
#endif |
294 | 5500 |
%} |
5501 |
! |
|
5502 |
||
5503 |
glxTranslateY:y in:aGLXWindowId |
|
5504 |
"translate current matrix on Y axis" |
|
5505 |
||
5506 |
%{ /* NOCONTEXT */ |
|
5507 |
||
5508 |
Coord c_y; |
|
5509 |
||
5510 |
_COORD_ (y, c_y) |
|
5511 |
SETWIN(aGLXWindowId) |
|
1932 | 5512 |
#ifdef OPENGL |
5513 |
#else |
|
294 | 5514 |
translate((Coord)0, c_y, (Coord)0); |
1932 | 5515 |
#endif |
294 | 5516 |
%} |
5517 |
! |
|
5518 |
||
5519 |
glxTranslateZ:z in:aGLXWindowId |
|
5520 |
"translate current matrix on Z axis" |
|
5521 |
||
5522 |
%{ /* NOCONTEXT */ |
|
5523 |
||
5524 |
Coord c_z; |
|
5525 |
||
5526 |
_COORD_ (z, c_z) |
|
5527 |
SETWIN(aGLXWindowId) |
|
1932 | 5528 |
#ifdef OPENGL |
5529 |
#else |
|
294 | 5530 |
translate((Coord)0, (Coord)0, c_z); |
1932 | 5531 |
#endif |
294 | 5532 |
%} |
5533 |
! ! |
|
5534 |
||
5535 |
!GLXWorkstation methodsFor:'unspecified rest'! |
|
5536 |
||
5537 |
glxAcbufOp:op value:value in:aGLXWindowId |
|
5538 |
||
5539 |
%{ /* NOCONTEXT */ |
|
1932 | 5540 |
SETWIN(aGLXWindowId) |
5541 |
#ifdef GLX |
|
294 | 5542 |
acbuf(__intVal(op), _floatVal(value)); |
1932 | 5543 |
#endif |
5544 |
%} |
|
294 | 5545 |
! |
5546 |
||
5547 |
glxAcsizePlanes: planes in: aGLXWindowId |
|
5548 |
||
5549 |
%{ /* NOCONTEXT */ |
|
1932 | 5550 |
SETWIN(aGLXWindowId) |
5551 |
#ifdef GLX |
|
294 | 5552 |
acsize(__intVal(planes)); |
1932 | 5553 |
#endif |
5554 |
%} |
|
294 | 5555 |
! |
5556 |
||
5557 |
glxAfunctionRef: ref func: func in: aGLXWindowId |
|
5558 |
||
5559 |
%{ /* NOCONTEXT */ |
|
1932 | 5560 |
SETWIN(aGLXWindowId) |
5561 |
#ifdef GLX |
|
294 | 5562 |
afunction(__intVal(ref), __intVal(func)); |
1932 | 5563 |
#endif |
5564 |
%} |
|
294 | 5565 |
! |
5566 |
||
5567 |
glxBbox2Xmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5568 |
||
5569 |
%{ /* NOCONTEXT */ |
|
5570 |
Screencoord c_xmin, c_ymin; |
|
4718 | 5571 |
Coord c_x1, c_y1, c_x2, c_y2; |
294 | 5572 |
|
5573 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5574 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5575 |
_COORD_ (x1, c_x1) |
|
5576 |
_COORD_ (y1, c_y1) |
|
5577 |
_COORD_ (x2, c_x2) |
|
5578 |
_COORD_ (y2, c_y2) |
|
5579 |
SETWIN(aGLXWindowId) |
|
1932 | 5580 |
#ifdef GLX |
294 | 5581 |
bbox2(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5582 |
#endif |
5583 |
%} |
|
294 | 5584 |
! |
5585 |
||
5586 |
glxBbox2iXmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5587 |
||
5588 |
%{ /* NOCONTEXT */ |
|
5589 |
Screencoord c_xmin, c_ymin; |
|
4718 | 5590 |
Icoord c_x1, c_y1, c_x2, c_y2; |
294 | 5591 |
|
5592 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5593 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5594 |
_ICOORD_ (x1, c_x1) |
|
5595 |
_ICOORD_ (y1, c_y1) |
|
5596 |
_ICOORD_ (x2, c_x2) |
|
5597 |
_ICOORD_ (y2, c_y2) |
|
5598 |
SETWIN(aGLXWindowId) |
|
1932 | 5599 |
#ifdef GLX |
294 | 5600 |
bbox2i(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5601 |
#endif |
5602 |
%} |
|
294 | 5603 |
! |
5604 |
||
5605 |
glxBbox2sXmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5606 |
||
5607 |
%{ /* NOCONTEXT */ |
|
5608 |
Screencoord c_xmin, c_ymin; |
|
4718 | 5609 |
Scoord c_x1, c_y1, c_x2, c_y2; |
294 | 5610 |
|
5611 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5612 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5613 |
_SCOORD_ (x1, c_x1) |
|
5614 |
_SCOORD_ (y1, c_y1) |
|
5615 |
_SCOORD_ (x2, c_x2) |
|
5616 |
_SCOORD_ (y2, c_y2) |
|
5617 |
SETWIN(aGLXWindowId) |
|
1932 | 5618 |
#ifdef GLX |
294 | 5619 |
bbox2s(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5620 |
#endif |
5621 |
%} |
|
294 | 5622 |
! |
5623 |
||
5624 |
glxBeginTrimIn: aGLXWindowId |
|
5625 |
||
5626 |
%{ /* NOCONTEXT */ |
|
1932 | 5627 |
SETWIN(aGLXWindowId) |
5628 |
#ifdef GLX |
|
294 | 5629 |
bgntrim(); |
1932 | 5630 |
#endif |
5631 |
%} |
|
294 | 5632 |
! |
5633 |
||
5634 |
glxBlankscreen: b in: aGLXWindowId |
|
5635 |
||
5636 |
%{ /* NOCONTEXT */ |
|
1932 | 5637 |
SETWIN(aGLXWindowId) |
5638 |
#ifdef GLX |
|
294 | 5639 |
blankscreen(_booleanVal(b)); |
1932 | 5640 |
#endif |
5641 |
%} |
|
294 | 5642 |
! |
5643 |
||
5644 |
glxBlanktime: count in: aGLXWindowId |
|
5645 |
||
5646 |
%{ /* NOCONTEXT */ |
|
1932 | 5647 |
SETWIN(aGLXWindowId) |
5648 |
#ifdef GLX |
|
294 | 5649 |
blanktime(__intVal(count)); |
1932 | 5650 |
#endif |
5651 |
%} |
|
294 | 5652 |
! |
5653 |
||
5654 |
glxBlendcolorRed: red green: green blue: blue alpha: alpha in: aGLXWindowId |
|
5655 |
||
5656 |
%{ /* NOCONTEXT */ |
|
1932 | 5657 |
SETWIN(aGLXWindowId) |
294 | 5658 |
#ifdef FULL_GLX |
4718 | 5659 |
blendcolor(_floatVal(red), _floatVal(green), _floatVal(blue), _floatVal(alpha)); |
1932 | 5660 |
#endif |
5661 |
%} |
|
294 | 5662 |
! |
5663 |
||
5664 |
glxBlendfunctionSfactr: sfactr dfactr: dfactr in: aGLXWindowId |
|
5665 |
||
5666 |
%{ /* NOCONTEXT */ |
|
1932 | 5667 |
SETWIN(aGLXWindowId) |
5668 |
#ifdef GLX |
|
294 | 5669 |
blendfunction(__intVal(sfactr), __intVal(dfactr)); |
1932 | 5670 |
#endif |
5671 |
%} |
|
294 | 5672 |
! |
5673 |
||
5674 |
glxBlinkRate: rate i: i red: red green: green blue: blue in: aGLXWindowId |
|
5675 |
||
5676 |
%{ /* NOCONTEXT */ |
|
1932 | 5677 |
SETWIN(aGLXWindowId) |
5678 |
#ifdef GLX |
|
4718 | 5679 |
blink(_shortVal(rate), _colorindexVal(i), |
294 | 5680 |
_shortVal(red), _shortVal(green), _shortVal(blue)); |
1932 | 5681 |
#endif |
5682 |
%} |
|
294 | 5683 |
! |
5684 |
||
5685 |
glxBlkqreadData: data n: n in: aGLXWindowId |
|
5686 |
||
5687 |
%{ /* NOCONTEXT */ |
|
1932 | 5688 |
int rslt = -1; |
5689 |
||
5690 |
SETWIN(aGLXWindowId) |
|
5691 |
#ifdef GLX |
|
5692 |
rslt = blkqread((short *)_indexedArea(data), __intVal(n)); |
|
5693 |
#endif |
|
5694 |
RETURN (__MKSMALLINT(rslt)); |
|
5695 |
%} |
|
294 | 5696 |
! |
5697 |
||
5698 |
glxC3f: v in: aGLXWindowId |
|
5699 |
||
5700 |
%{ /* NOCONTEXT */ |
|
5701 |
float vec[3], *c_v; |
|
5702 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5703 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
294 | 5704 |
SETWIN(aGLXWindowId) |
1932 | 5705 |
#ifdef GLX |
294 | 5706 |
c3f(c_v); |
1932 | 5707 |
#endif |
5708 |
%} |
|
294 | 5709 |
! |
5710 |
||
5711 |
glxC3i: v in: aGLXWindowId |
|
5712 |
||
5713 |
%{ /* NOCONTEXT */ |
|
5714 |
long vec[3], *c_v; |
|
5715 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5716 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
294 | 5717 |
SETWIN(aGLXWindowId) |
1932 | 5718 |
#ifdef GLX |
294 | 5719 |
c3i(c_v); |
1932 | 5720 |
#endif |
5721 |
%} |
|
294 | 5722 |
! |
5723 |
||
5724 |
glxC3s: v in: aGLXWindowId |
|
5725 |
||
5726 |
%{ /* NOCONTEXT */ |
|
5727 |
short vec[3], *c_v; |
|
5728 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5729 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
294 | 5730 |
SETWIN(aGLXWindowId) |
1932 | 5731 |
#ifdef GLX |
294 | 5732 |
c3s(c_v); |
1932 | 5733 |
#endif |
5734 |
%} |
|
294 | 5735 |
! |
5736 |
||
5737 |
glxC4f: v in: aGLXWindowId |
|
5738 |
||
5739 |
%{ /* NOCONTEXT */ |
|
5740 |
float vec[4], *c_v; |
|
5741 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5742 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
294 | 5743 |
SETWIN(aGLXWindowId) |
1932 | 5744 |
#ifdef GLX |
294 | 5745 |
c4f(c_v); |
1932 | 5746 |
#endif |
5747 |
%} |
|
294 | 5748 |
! |
5749 |
||
5750 |
glxC4i: v in: aGLXWindowId |
|
5751 |
||
5752 |
%{ /* NOCONTEXT */ |
|
5753 |
long vec[4], *c_v; |
|
5754 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5755 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
294 | 5756 |
SETWIN(aGLXWindowId) |
1932 | 5757 |
#ifdef GLX |
294 | 5758 |
c4i(c_v); |
1932 | 5759 |
#endif |
5760 |
%} |
|
294 | 5761 |
! |
5762 |
||
5763 |
glxC4s: v in: aGLXWindowId |
|
5764 |
||
5765 |
%{ /* NOCONTEXT */ |
|
5766 |
short vec[4], *c_v; |
|
5767 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5768 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
294 | 5769 |
SETWIN(aGLXWindowId) |
1932 | 5770 |
#ifdef GLX |
294 | 5771 |
c4s(c_v); |
1932 | 5772 |
#endif |
5773 |
%} |
|
294 | 5774 |
! |
5775 |
||
5776 |
glxClearhitcodeIn: aGLXWindowId |
|
5777 |
||
5778 |
%{ /* NOCONTEXT */ |
|
1932 | 5779 |
SETWIN(aGLXWindowId) |
5780 |
#ifdef GLX |
|
294 | 5781 |
clearhitcode(); |
1932 | 5782 |
#endif |
5783 |
%} |
|
294 | 5784 |
! |
5785 |
||
5786 |
glxClipplaneIndex: index mode: mode params: params in: aGLXWindowId |
|
5787 |
||
5788 |
%{ /* NOCONTEXT */ |
|
5789 |
float vec[4], *v; |
|
5790 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5791 |
if (! (v = __glx_getFloatsFromInto(params, vec, 4))) RETURN(false); |
294 | 5792 |
SETWIN(aGLXWindowId) |
1932 | 5793 |
#ifdef GLX |
294 | 5794 |
clipplane(__intVal(index), __intVal(mode), v); |
1932 | 5795 |
#endif |
5796 |
%} |
|
294 | 5797 |
! |
5798 |
||
5799 |
glxCmodeIn: aGLXWindowId |
|
5800 |
||
5801 |
%{ /* NOCONTEXT */ |
|
1932 | 5802 |
SETWIN(aGLXWindowId) |
5803 |
#ifdef GLX |
|
294 | 5804 |
cmode(); |
1932 | 5805 |
#endif |
5806 |
%} |
|
294 | 5807 |
! |
5808 |
||
5809 |
glxColorfIndex: index in: aGLXWindowId |
|
5810 |
||
5811 |
^self glxColor: index in: aGLXWindowId |
|
5812 |
! |
|
5813 |
||
5814 |
glxCuroriginN: n xorigin: xorigin yorigin: yorigin in: aGLXWindowId |
|
5815 |
||
5816 |
%{ /* NOCONTEXT */ |
|
1932 | 5817 |
SETWIN(aGLXWindowId) |
5818 |
#ifdef GLX |
|
294 | 5819 |
curorigin(_shortVal(n), _shortVal(xorigin), _shortVal(yorigin)); |
1932 | 5820 |
#endif |
5821 |
%} |
|
294 | 5822 |
! |
5823 |
||
5824 |
glxCursoffIn: aGLXWindowId |
|
5825 |
||
5826 |
%{ /* NOCONTEXT */ |
|
1932 | 5827 |
SETWIN(aGLXWindowId) |
5828 |
#ifdef GLX |
|
294 | 5829 |
cursoff(); |
1932 | 5830 |
#endif |
5831 |
%} |
|
294 | 5832 |
! |
5833 |
||
5834 |
glxCursonIn: aGLXWindowId |
|
5835 |
||
5836 |
%{ /* NOCONTEXT */ |
|
1932 | 5837 |
SETWIN(aGLXWindowId) |
5838 |
#ifdef GLX |
|
294 | 5839 |
curson(); |
1932 | 5840 |
#endif |
5841 |
%} |
|
294 | 5842 |
! |
5843 |
||
5844 |
glxCurstype: type in: aGLXWindowId |
|
5845 |
||
5846 |
%{ /* NOCONTEXT */ |
|
1932 | 5847 |
SETWIN(aGLXWindowId) |
5848 |
#ifdef GLX |
|
294 | 5849 |
curstype(__intVal(type)); |
1932 | 5850 |
#endif |
5851 |
%} |
|
294 | 5852 |
! |
5853 |
||
5854 |
glxCyclemapDuration: duration map: map nxtmap: nxtmap in: aGLXWindowId |
|
5855 |
||
5856 |
%{ /* NOCONTEXT */ |
|
1932 | 5857 |
SETWIN(aGLXWindowId) |
5858 |
#ifdef GLX |
|
294 | 5859 |
cyclemap(_shortVal(duration), _shortVal(map), _shortVal(nxtmap)); |
1932 | 5860 |
#endif |
5861 |
%} |
|
294 | 5862 |
! |
5863 |
||
5864 |
glxDefpatternN: n size: size mask: mask in: aGLXWindowId |
|
5865 |
||
5866 |
%{ /* NOCONTEXT */ |
|
1932 | 5867 |
SETWIN(aGLXWindowId) |
5868 |
#ifdef GLX |
|
294 | 5869 |
defpattern(_shortVal(n), _shortVal(size), (unsigned short *)_indexedArea(mask)); |
1932 | 5870 |
#endif |
5871 |
%} |
|
294 | 5872 |
! |
5873 |
||
5874 |
glxDeltag: t in: aGLXWindowId |
|
5875 |
||
5876 |
%{ /* NOCONTEXT */ |
|
1932 | 5877 |
SETWIN(aGLXWindowId) |
5878 |
#ifdef GLX |
|
294 | 5879 |
deltag(_tagVal(t)); |
1932 | 5880 |
#endif |
5881 |
%} |
|
294 | 5882 |
! |
5883 |
||
5884 |
glxDepthcueMode: mode in: aGLXWindowId |
|
5885 |
||
5886 |
%{ /* NOCONTEXT */ |
|
1932 | 5887 |
SETWIN(aGLXWindowId) |
5888 |
#ifdef GLX |
|
294 | 5889 |
depthcue(_booleanVal(mode)); |
1932 | 5890 |
#endif |
5891 |
%} |
|
294 | 5892 |
! |
5893 |
||
5894 |
glxDitherMode: mode in: aGLXWindowId |
|
5895 |
||
5896 |
%{ /* NOCONTEXT */ |
|
1932 | 5897 |
SETWIN(aGLXWindowId) |
5898 |
#ifdef GLX |
|
294 | 5899 |
dither(_longVal(mode)); |
1932 | 5900 |
#endif |
5901 |
%} |
|
294 | 5902 |
! |
5903 |
||
5904 |
glxDopup: pup in: aGLXWindowId |
|
5905 |
||
5906 |
%{ /* NOCONTEXT */ |
|
1932 | 5907 |
SETWIN(aGLXWindowId) |
5908 |
#ifdef GLX |
|
294 | 5909 |
dopup(_longVal(pup)); |
1932 | 5910 |
#endif |
5911 |
%} |
|
294 | 5912 |
! |
5913 |
||
5914 |
glxDrawmode: mode in: aGLXWindowId |
|
5915 |
||
5916 |
%{ /* NOCONTEXT */ |
|
1932 | 5917 |
SETWIN(aGLXWindowId) |
5918 |
#ifdef GLX |
|
294 | 5919 |
drawmode(_longVal(mode)); |
1932 | 5920 |
#endif |
5921 |
%} |
|
294 | 5922 |
! |
5923 |
||
5924 |
glxEditobj: obj in: aGLXWindowId |
|
5925 |
||
5926 |
%{ /* NOCONTEXT */ |
|
1932 | 5927 |
SETWIN(aGLXWindowId) |
5928 |
#ifdef GLX |
|
294 | 5929 |
editobj(_objectVal(obj)); |
1932 | 5930 |
#endif |
5931 |
%} |
|
294 | 5932 |
! |
5933 |
||
5934 |
glxEndTrimIn: aGLXWindowId |
|
5935 |
||
5936 |
%{ /* NOCONTEXT */ |
|
1932 | 5937 |
SETWIN(aGLXWindowId) |
5938 |
#ifdef GLX |
|
294 | 5939 |
endtrim(); |
1932 | 5940 |
#endif |
5941 |
%} |
|
294 | 5942 |
! |
5943 |
||
5944 |
glxEndfullscrnIn: aGLXWindowId |
|
5945 |
||
5946 |
%{ /* NOCONTEXT */ |
|
1932 | 5947 |
SETWIN(aGLXWindowId) |
5948 |
#ifdef GLX |
|
294 | 5949 |
endfullscrn(); |
1932 | 5950 |
#endif |
5951 |
%} |
|
294 | 5952 |
! |
5953 |
||
5954 |
glxEndpupmodeIn: aGLXWindowId |
|
5955 |
||
5956 |
%{ /* NOCONTEXT */ |
|
1932 | 5957 |
SETWIN(aGLXWindowId) |
5958 |
#ifdef GLX |
|
294 | 5959 |
endpupmode(); |
1932 | 5960 |
#endif |
5961 |
%} |
|
294 | 5962 |
! |
5963 |
||
5964 |
glxFinishIn: aGLXWindowId |
|
5965 |
||
5966 |
%{ /* NOCONTEXT */ |
|
1932 | 5967 |
SETWIN(aGLXWindowId) |
5968 |
#ifdef GLX |
|
294 | 5969 |
finish(); |
1932 | 5970 |
#endif |
5971 |
%} |
|
294 | 5972 |
! |
5973 |
||
5974 |
glxFont: fntnum in: aGLXWindowId |
|
5975 |
||
5976 |
%{ /* NOCONTEXT */ |
|
5977 |
SETWIN(aGLXWindowId) |
|
1932 | 5978 |
#ifdef GLX |
294 | 5979 |
font(_shortVal(fntnum)); |
1932 | 5980 |
#endif |
294 | 5981 |
%} |
5982 |
! |
|
5983 |
||
5984 |
glxForegroundIn: aGLXWindowId |
|
5985 |
||
5986 |
%{ /* NOCONTEXT */ |
|
5987 |
SETWIN(aGLXWindowId) |
|
1932 | 5988 |
#ifdef OPENGL |
5989 |
#else |
|
294 | 5990 |
foreground(); |
1932 | 5991 |
#endif |
294 | 5992 |
%} |
5993 |
! |
|
5994 |
||
5995 |
glxFreepup: pup in: aGLXWindowId |
|
5996 |
||
5997 |
%{ /* NOCONTEXT */ |
|
1932 | 5998 |
SETWIN(aGLXWindowId) |
5999 |
#ifdef GLX |
|
294 | 6000 |
freepup(_longVal(pup)); |
1932 | 6001 |
#endif |
6002 |
%} |
|
294 | 6003 |
! |
6004 |
||
6005 |
glxFudgeXfudge: xfudge yfudge: yfudge in: aGLXWindowId |
|
6006 |
||
6007 |
%{ /* NOCONTEXT */ |
|
1932 | 6008 |
SETWIN(aGLXWindowId) |
6009 |
#ifdef GLX |
|
294 | 6010 |
fudge(_longVal(xfudge), _longVal(yfudge)); |
1932 | 6011 |
#endif |
6012 |
%} |
|
294 | 6013 |
! |
6014 |
||
6015 |
glxFullscrnIn: aGLXWindowId |
|
6016 |
||
6017 |
%{ /* NOCONTEXT */ |
|
1932 | 6018 |
SETWIN(aGLXWindowId) |
6019 |
#ifdef GLX |
|
294 | 6020 |
fullscrn(); |
1932 | 6021 |
#endif |
6022 |
%} |
|
294 | 6023 |
! |
6024 |
||
6025 |
glxGbeginIn: aGLXWindowId |
|
6026 |
||
6027 |
%{ /* NOCONTEXT */ |
|
1932 | 6028 |
SETWIN(aGLXWindowId) |
6029 |
#ifdef GLX |
|
294 | 6030 |
gbegin(); |
1932 | 6031 |
#endif |
6032 |
%} |
|
294 | 6033 |
! |
6034 |
||
6035 |
glxGentagIn: aGLXWindowId |
|
6036 |
||
6037 |
%{ /* NOCONTEXT */ |
|
1932 | 6038 |
int rslt = -1; |
6039 |
||
6040 |
#ifdef GLX |
|
6041 |
SETWIN(aGLXWindowId) |
|
6042 |
rslt = gentag(); |
|
6043 |
#endif |
|
6044 |
RETURN (__MKSMALLINT(rslt)); |
|
6045 |
%} |
|
294 | 6046 |
! |
6047 |
||
6048 |
glxGetbackfaceIn: aGLXWindowId |
|
6049 |
||
6050 |
%{ /* NOCONTEXT */ |
|
1932 | 6051 |
int rslt = -1; |
6052 |
||
6053 |
#ifdef GLX |
|
6054 |
SETWIN(aGLXWindowId) |
|
6055 |
rslt = getbackface(); |
|
6056 |
#endif |
|
6057 |
RETURN (__MKSMALLINT(rslt)); |
|
6058 |
%} |
|
294 | 6059 |
! |
6060 |
||
6061 |
glxGetbufferIn: aGLXWindowId |
|
6062 |
||
6063 |
%{ /* NOCONTEXT */ |
|
1932 | 6064 |
int rslt = -1; |
6065 |
||
6066 |
#ifdef GLX |
|
6067 |
SETWIN(aGLXWindowId) |
|
6068 |
rslt = getbuffer(); |
|
6069 |
#endif |
|
6070 |
RETURN (__MKSMALLINT(rslt)); |
|
6071 |
%} |
|
294 | 6072 |
! |
6073 |
||
6074 |
glxGetbutton: num in: aGLXWindowId |
|
6075 |
||
6076 |
%{ /* NOCONTEXT */ |
|
1932 | 6077 |
int rslt = -1; |
6078 |
||
6079 |
SETWIN(aGLXWindowId) |
|
6080 |
#ifdef OPENGL |
|
6081 |
#else |
|
6082 |
rslt = getbutton(_deviceVal(num)); |
|
6083 |
#endif |
|
6084 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6085 |
%} |
6086 |
! |
|
6087 |
||
6088 |
glxGetcmmodeIn: aGLXWindowId |
|
6089 |
||
6090 |
%{ /* NOCONTEXT */ |
|
1932 | 6091 |
int rslt = 0; |
6092 |
||
6093 |
SETWIN(aGLXWindowId) |
|
6094 |
#ifdef GLX |
|
6095 |
rslt = getcmmode(); |
|
6096 |
#endif |
|
6097 |
RETURN (__MKBOOLEAN(rslt)); |
|
6098 |
%} |
|
294 | 6099 |
! |
6100 |
||
6101 |
glxGetcolorIn: aGLXWindowId |
|
6102 |
"return the current drawing color" |
|
6103 |
||
6104 |
%{ /* NOCONTEXT */ |
|
1932 | 6105 |
int rslt = -1; |
6106 |
||
6107 |
SETWIN(aGLXWindowId) |
|
6108 |
#ifdef OPENGL |
|
6109 |
#else |
|
6110 |
rslt = getcolor(); |
|
6111 |
#endif |
|
6112 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6113 |
%} |
6114 |
! |
|
6115 |
||
6116 |
glxGetdcmIn: aGLXWindowId |
|
6117 |
||
6118 |
%{ /* NOCONTEXT */ |
|
6119 |
#ifdef GLX |
|
6120 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6121 |
RETURN (__MKBOOLEAN(getdcm())); |
294 | 6122 |
#endif |
6123 |
%} |
|
6124 |
. |
|
6125 |
^ false |
|
6126 |
! |
|
6127 |
||
6128 |
glxGetdescenderIn: aGLXWindowId |
|
6129 |
||
6130 |
%{ /* NOCONTEXT */ |
|
6131 |
#ifdef GLX |
|
6132 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6133 |
RETURN (__MKSMALLINT(getdescender())); |
294 | 6134 |
#endif |
6135 |
%} |
|
6136 |
. |
|
6137 |
^ false |
|
6138 |
! |
|
6139 |
||
6140 |
glxGetdisplaymodeIn: aGLXWindowId |
|
6141 |
||
6142 |
%{ /* NOCONTEXT */ |
|
6143 |
#ifdef GLX |
|
6144 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6145 |
RETURN (__MKSMALLINT(getdisplaymode())); |
294 | 6146 |
#endif |
6147 |
%} |
|
6148 |
. |
|
6149 |
^ false |
|
6150 |
! |
|
6151 |
||
6152 |
glxGetdrawmodeIn: aGLXWindowId |
|
6153 |
||
6154 |
%{ /* NOCONTEXT */ |
|
6155 |
#ifdef GLX |
|
6156 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6157 |
RETURN (__MKSMALLINT(getdrawmode())); |
294 | 6158 |
#endif |
6159 |
%} |
|
6160 |
. |
|
6161 |
^ false |
|
6162 |
! |
|
6163 |
||
6164 |
glxGetfontIn: aGLXWindowId |
|
6165 |
||
6166 |
%{ /* NOCONTEXT */ |
|
6167 |
#ifdef GLX |
|
6168 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6169 |
RETURN (__MKSMALLINT(getfont())); |
294 | 6170 |
#endif |
6171 |
%} |
|
6172 |
. |
|
6173 |
^ false |
|
6174 |
! |
|
6175 |
||
6176 |
glxGetgconfigBuffer: buffer in: aGLXWindowId |
|
6177 |
||
6178 |
%{ /* NOCONTEXT */ |
|
6179 |
#ifdef FULL_GLX |
|
6180 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6181 |
RETURN (__MKSMALLINT(getgconfig(_longVal(buffer)))); |
294 | 6182 |
#endif |
6183 |
%} |
|
6184 |
. |
|
6185 |
^ false |
|
6186 |
! |
|
6187 |
||
6188 |
glxGetgdescInquiry: inquiry in: aGLXWindowId |
|
6189 |
||
6190 |
%{ /* NOCONTEXT */ |
|
1932 | 6191 |
int rslt = 0; |
6192 |
||
6193 |
SETWIN(aGLXWindowId) |
|
6194 |
#ifdef OPENGL |
|
6195 |
#else |
|
6196 |
rslt = getgdesc(_longVal(inquiry)); |
|
6197 |
#endif |
|
6198 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6199 |
%} |
6200 |
! |
|
6201 |
||
6202 |
glxGetheightIn: aGLXWindowId |
|
6203 |
||
6204 |
%{ /* NOCONTEXT */ |
|
1932 | 6205 |
int rslt = 0; |
6206 |
||
6207 |
SETWIN(aGLXWindowId) |
|
6208 |
#ifdef OPENGL |
|
6209 |
#else |
|
6210 |
rslt = getheight(); |
|
6211 |
#endif |
|
6212 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6213 |
%} |
6214 |
! |
|
6215 |
||
6216 |
glxGethitcodeIn: aGLXWindowId |
|
6217 |
||
6218 |
%{ /* NOCONTEXT */ |
|
6219 |
#ifdef GLX |
|
6220 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6221 |
RETURN (__MKSMALLINT(gethitcode())); |
294 | 6222 |
#endif |
6223 |
%} |
|
6224 |
. |
|
6225 |
^ false |
|
6226 |
! |
|
6227 |
||
6228 |
glxGetlsbackupIn: aGLXWindowId |
|
6229 |
||
6230 |
%{ /* NOCONTEXT */ |
|
6231 |
#ifdef GLX |
|
6232 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6233 |
RETURN (__MKBOOLEAN(getlsbackup())); |
294 | 6234 |
#endif |
6235 |
%} |
|
6236 |
. |
|
6237 |
^ false |
|
6238 |
! |
|
6239 |
||
6240 |
glxGetlsrepeatIn: aGLXWindowId |
|
6241 |
||
6242 |
%{ /* NOCONTEXT */ |
|
6243 |
#ifdef GLX |
|
6244 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6245 |
RETURN (__MKSMALLINT(getlsrepeat())); |
294 | 6246 |
#endif |
6247 |
%} |
|
6248 |
. |
|
6249 |
^ false |
|
6250 |
! |
|
6251 |
||
6252 |
glxGetlstyleIn: aGLXWindowId |
|
6253 |
||
6254 |
%{ /* NOCONTEXT */ |
|
6255 |
#ifdef GLX |
|
6256 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6257 |
RETURN (__MKSMALLINT(getlstyle())); |
294 | 6258 |
#endif |
6259 |
%} |
|
6260 |
. |
|
6261 |
^ false |
|
6262 |
! |
|
6263 |
||
6264 |
glxGetlwidthIn: aGLXWindowId |
|
6265 |
||
6266 |
%{ /* NOCONTEXT */ |
|
6267 |
#ifdef GLX |
|
6268 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6269 |
RETURN (__MKSMALLINT(getlwidth())); |
294 | 6270 |
#endif |
6271 |
%} |
|
6272 |
. |
|
6273 |
^ false |
|
6274 |
! |
|
6275 |
||
6276 |
glxGetmapIn: aGLXWindowId |
|
6277 |
||
6278 |
%{ /* NOCONTEXT */ |
|
6279 |
#ifdef GLX |
|
6280 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6281 |
RETURN (__MKSMALLINT(getmap())); |
294 | 6282 |
#endif |
6283 |
%} |
|
6284 |
. |
|
6285 |
^ false |
|
6286 |
! |
|
6287 |
||
6288 |
glxGetmmodeIn: aGLXWindowId |
|
6289 |
||
6290 |
%{ /* NOCONTEXT */ |
|
6291 |
#ifdef GLX |
|
6292 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6293 |
RETURN (__MKSMALLINT(getmmode())); |
294 | 6294 |
#endif |
6295 |
%} |
|
6296 |
. |
|
6297 |
^ false |
|
6298 |
! |
|
6299 |
||
6300 |
glxGetmonitorIn: aGLXWindowId |
|
6301 |
||
6302 |
%{ /* NOCONTEXT */ |
|
6303 |
#ifdef GLX |
|
6304 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6305 |
RETURN (__MKSMALLINT(getmonitor())); |
294 | 6306 |
#endif |
6307 |
%} |
|
6308 |
. |
|
6309 |
^ false |
|
6310 |
! |
|
6311 |
||
6312 |
glxGetmultisampleIn: aGLXWindowId |
|
6313 |
||
6314 |
%{ /* NOCONTEXT */ |
|
6315 |
#ifdef FULL_GLX |
|
6316 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6317 |
RETURN (__MKBOOLEAN(getmultisample())); |
294 | 6318 |
#endif |
6319 |
%} |
|
6320 |
. |
|
6321 |
^ false |
|
6322 |
! |
|
6323 |
||
6324 |
glxGetothermonitorIn: aGLXWindowId |
|
6325 |
||
6326 |
%{ /* NOCONTEXT */ |
|
6327 |
#ifdef GLX |
|
6328 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6329 |
RETURN (__MKSMALLINT(getothermonitor())); |
294 | 6330 |
#endif |
6331 |
%} |
|
6332 |
. |
|
6333 |
^ false |
|
6334 |
! |
|
6335 |
||
6336 |
glxGetpatternIn: aGLXWindowId |
|
6337 |
||
6338 |
%{ /* NOCONTEXT */ |
|
6339 |
#ifdef GLX |
|
6340 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6341 |
RETURN (__MKSMALLINT(getpattern())); |
294 | 6342 |
#endif |
6343 |
%} |
|
6344 |
. |
|
6345 |
^ false |
|
6346 |
! |
|
6347 |
||
6348 |
glxGetresetlsIn: aGLXWindowId |
|
6349 |
||
6350 |
%{ /* NOCONTEXT */ |
|
6351 |
#ifdef GLX |
|
6352 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6353 |
RETURN (__MKBOOLEAN(getresetls())); |
294 | 6354 |
#endif |
6355 |
%} |
|
6356 |
. |
|
6357 |
^ false |
|
6358 |
! |
|
6359 |
||
6360 |
glxGetshadeIn: aGLXWindowId |
|
6361 |
||
6362 |
%{ /* NOCONTEXT */ |
|
6363 |
#ifdef GLX |
|
6364 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6365 |
RETURN (__MKSMALLINT(getshade())); |
294 | 6366 |
#endif |
6367 |
%} |
|
6368 |
. |
|
6369 |
^ false |
|
6370 |
! |
|
6371 |
||
6372 |
glxGetsmIn: aGLXWindowId |
|
6373 |
||
6374 |
%{ /* NOCONTEXT */ |
|
6375 |
#ifdef GLX |
|
6376 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6377 |
RETURN (__MKSMALLINT(getsm())); |
294 | 6378 |
#endif |
6379 |
%} |
|
6380 |
. |
|
6381 |
^ false |
|
6382 |
! |
|
6383 |
||
6384 |
glxGetvaluator: dev in: aGLXWindowId |
|
6385 |
||
6386 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
6387 |
#ifndef OPENGL |
294 | 6388 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6389 |
RETURN (__MKSMALLINT(getvaluator(_deviceVal(dev)))); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
6390 |
#endif |
294 | 6391 |
%} |
6392 |
. |
|
6393 |
^ false |
|
6394 |
! |
|
6395 |
||
6396 |
glxGetvideo: reg in: aGLXWindowId |
|
6397 |
||
6398 |
%{ /* NOCONTEXT */ |
|
6399 |
#ifdef GLX |
|
6400 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6401 |
RETURN (__MKSMALLINT(getvideo(_longVal(reg)))); |
294 | 6402 |
#endif |
6403 |
%} |
|
6404 |
. |
|
6405 |
^ false |
|
6406 |
! |
|
6407 |
||
6408 |
glxGetwritemaskIn: aGLXWindowId |
|
6409 |
||
6410 |
%{ /* NOCONTEXT */ |
|
6411 |
#ifdef GLX |
|
6412 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6413 |
RETURN (__MKSMALLINT(getwritemask())); |
294 | 6414 |
#endif |
6415 |
%} |
|
6416 |
. |
|
6417 |
^ false |
|
6418 |
! |
|
6419 |
||
6420 |
glxGetwscrnIn: aGLXWindowId |
|
6421 |
||
6422 |
%{ /* NOCONTEXT */ |
|
6423 |
#ifdef GLX |
|
6424 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6425 |
RETURN (__MKSMALLINT(getwscrn())); |
294 | 6426 |
#endif |
6427 |
%} |
|
6428 |
. |
|
6429 |
^ false |
|
6430 |
! |
|
6431 |
||
6432 |
glxGetzbufferIn: aGLXWindowId |
|
6433 |
||
6434 |
%{ /* NOCONTEXT */ |
|
6435 |
#ifdef GLX |
|
6436 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6437 |
RETURN (__MKBOOLEAN(getzbuffer())); |
294 | 6438 |
#endif |
6439 |
%} |
|
6440 |
. |
|
6441 |
^ false |
|
6442 |
! |
|
6443 |
||
6444 |
glxGexitIn: aGLXWindowId |
|
6445 |
||
6446 |
%{ /* NOCONTEXT */ |
|
1932 | 6447 |
SETWIN(aGLXWindowId) |
6448 |
#ifdef OPENGL |
|
6449 |
#else |
|
294 | 6450 |
gexit(); |
1932 | 6451 |
#endif |
6452 |
%} |
|
294 | 6453 |
! |
6454 |
||
6455 |
glxGflushIn: aGLXWindowId |
|
6456 |
||
6457 |
%{ /* NOCONTEXT */ |
|
6458 |
#ifdef GLX |
|
6459 |
SETWIN(aGLXWindowId) |
|
6460 |
gflush(); |
|
1932 | 6461 |
#endif |
6462 |
%} |
|
294 | 6463 |
! |
6464 |
||
6465 |
glxGinitIn: aGLXWindowId |
|
6466 |
||
6467 |
%{ /* NOCONTEXT */ |
|
1932 | 6468 |
SETWIN(aGLXWindowId) |
6469 |
#ifdef OPENGL |
|
6470 |
#else |
|
294 | 6471 |
ginit(); |
1932 | 6472 |
#endif |
6473 |
%} |
|
294 | 6474 |
! |
6475 |
||
6476 |
glxGlcompatMode: mode value: value in: aGLXWindowId |
|
6477 |
||
6478 |
%{ /* NOCONTEXT */ |
|
6479 |
#ifdef GLX |
|
6480 |
SETWIN(aGLXWindowId) |
|
6481 |
glcompat(_longVal(mode), _longVal(value)); |
|
1932 | 6482 |
#endif |
6483 |
%} |
|
294 | 6484 |
! |
6485 |
||
6486 |
glxGresetIn: aGLXWindowId |
|
6487 |
||
6488 |
%{ /* NOCONTEXT */ |
|
6489 |
#ifdef GLX |
|
6490 |
SETWIN(aGLXWindowId) |
|
6491 |
greset(); |
|
1932 | 6492 |
#endif |
6493 |
%} |
|
294 | 6494 |
! |
6495 |
||
6496 |
glxGsyncIn: aGLXWindowId |
|
6497 |
||
6498 |
%{ /* NOCONTEXT */ |
|
6499 |
#ifdef GLX |
|
6500 |
SETWIN(aGLXWindowId) |
|
6501 |
gsync(); |
|
1932 | 6502 |
#endif |
6503 |
%} |
|
294 | 6504 |
! |
6505 |
||
6506 |
glxIconsizeX: x y: y in: aGLXWindowId |
|
6507 |
||
6508 |
%{ /* NOCONTEXT */ |
|
6509 |
#ifdef GLX |
|
6510 |
SETWIN(aGLXWindowId) |
|
6511 |
iconsize(_longVal(x), _longVal(y)); |
|
1932 | 6512 |
#endif |
6513 |
%} |
|
294 | 6514 |
! |
6515 |
||
6516 |
glxImakebackgroundIn: aGLXWindowId |
|
6517 |
||
6518 |
%{ /* NOCONTEXT */ |
|
6519 |
#ifdef GLX |
|
6520 |
SETWIN(aGLXWindowId) |
|
6521 |
imakebackground(); |
|
1932 | 6522 |
#endif |
6523 |
%} |
|
294 | 6524 |
! |
6525 |
||
6526 |
glxInitnamesIn: aGLXWindowId |
|
6527 |
||
6528 |
%{ /* NOCONTEXT */ |
|
6529 |
#ifdef GLX |
|
6530 |
SETWIN(aGLXWindowId) |
|
6531 |
initnames(); |
|
1932 | 6532 |
#endif |
6533 |
%} |
|
294 | 6534 |
! |
6535 |
||
6536 |
glxIsqueued: dev in: aGLXWindowId |
|
6537 |
||
6538 |
%{ /* NOCONTEXT */ |
|
6539 |
#ifdef GLX |
|
6540 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6541 |
RETURN (__MKBOOLEAN(isqueued(_deviceVal(dev)))); |
294 | 6542 |
#endif |
6543 |
%} |
|
6544 |
. |
|
6545 |
^ false |
|
6546 |
! |
|
6547 |
||
6548 |
glxIstag: t in: aGLXWindowId |
|
6549 |
||
6550 |
%{ /* NOCONTEXT */ |
|
6551 |
#ifdef GLX |
|
6552 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6553 |
RETURN (__MKBOOLEAN(istag(_tagVal(t)))); |
294 | 6554 |
#endif |
6555 |
%} |
|
6556 |
. |
|
6557 |
^ false |
|
6558 |
! |
|
6559 |
||
6560 |
glxKeepaspectX: x y: y in: aGLXWindowId |
|
6561 |
||
6562 |
%{ /* NOCONTEXT */ |
|
6563 |
#ifdef GLX |
|
6564 |
SETWIN(aGLXWindowId) |
|
6565 |
keepaspect(_longVal(x), _longVal(y)); |
|
6566 |
RETURN (true); |
|
6567 |
#endif |
|
6568 |
%} |
|
6569 |
. |
|
6570 |
^ false |
|
6571 |
! |
|
6572 |
||
6573 |
glxLinesmoothMode: mode in: aGLXWindowId |
|
6574 |
||
6575 |
%{ /* NOCONTEXT */ |
|
6576 |
#ifdef GLX |
|
6577 |
SETWIN(aGLXWindowId) |
|
6578 |
linesmooth((ulong)__intVal(mode)); |
|
6579 |
RETURN (true); |
|
6580 |
#endif |
|
6581 |
%} |
|
6582 |
. |
|
6583 |
^ false |
|
6584 |
! |
|
6585 |
||
6586 |
glxLmcolorMode: mode in: aGLXWindowId |
|
6587 |
||
6588 |
%{ /* NOCONTEXT */ |
|
6589 |
#ifdef GLX |
|
6590 |
SETWIN(aGLXWindowId) |
|
6591 |
lmcolor(_longVal(mode)); |
|
6592 |
RETURN (true); |
|
6593 |
#endif |
|
6594 |
%} |
|
6595 |
. |
|
6596 |
^ false |
|
6597 |
! |
|
6598 |
||
6599 |
glxLoadname: name in: aGLXWindowId |
|
6600 |
||
6601 |
%{ /* NOCONTEXT */ |
|
6602 |
#ifdef GLX |
|
6603 |
SETWIN(aGLXWindowId) |
|
6604 |
loadname(_shortVal(name)); |
|
6605 |
RETURN (true); |
|
6606 |
#endif |
|
6607 |
%} |
|
6608 |
. |
|
6609 |
^ false |
|
6610 |
! |
|
6611 |
||
6612 |
glxLogicop: opcode in: aGLXWindowId |
|
6613 |
||
6614 |
%{ /* NOCONTEXT */ |
|
6615 |
#ifdef GLX |
|
6616 |
SETWIN(aGLXWindowId) |
|
6617 |
logicop(_longVal(opcode)); |
|
6618 |
RETURN (true); |
|
6619 |
#endif |
|
6620 |
%} |
|
6621 |
. |
|
6622 |
^ false |
|
6623 |
! |
|
6624 |
||
6625 |
glxLsbackup: b in: aGLXWindowId |
|
6626 |
||
6627 |
%{ /* NOCONTEXT */ |
|
6628 |
#ifdef GLX |
|
6629 |
SETWIN(aGLXWindowId) |
|
6630 |
lsbackup(_booleanVal(b)); |
|
6631 |
RETURN (true); |
|
6632 |
#endif |
|
6633 |
%} |
|
6634 |
. |
|
6635 |
^ false |
|
6636 |
! |
|
6637 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6638 |
glxLsetdepthNear:znear far:zfar in: aGLXWindowId |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6639 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6640 |
%{ /* NOCONTEXT */ |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6641 |
#ifdef GLX |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6642 |
SETWIN(aGLXWindowId) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6643 |
lsetdepth(_longVal(znear), _longVal(zfar)); |
294 | 6644 |
RETURN (true); |
6645 |
#endif |
|
6646 |
%} |
|
6647 |
. |
|
6648 |
^ false |
|
6649 |
! |
|
6650 |
||
6651 |
glxLshaderangeLowin: lowin hiwin: hiwin znear: znear zfar: zfar in: aGLXWindowId |
|
6652 |
||
6653 |
%{ /* NOCONTEXT */ |
|
6654 |
#ifdef GLX |
|
6655 |
SETWIN(aGLXWindowId) |
|
4718 | 6656 |
lshaderange(_colorindexVal(lowin), _colorindexVal(hiwin), |
294 | 6657 |
_longVal(znear), _longVal(zfar)); |
6658 |
RETURN (true); |
|
6659 |
#endif |
|
6660 |
%} |
|
6661 |
. |
|
6662 |
^ false |
|
6663 |
! |
|
6664 |
||
6665 |
glxLsrepeatFactor: factor in: aGLXWindowId |
|
6666 |
||
6667 |
%{ /* NOCONTEXT */ |
|
6668 |
#ifdef GLX |
|
6669 |
SETWIN(aGLXWindowId) |
|
6670 |
lsrepeat(_longVal(factor)); |
|
6671 |
RETURN (true); |
|
6672 |
#endif |
|
6673 |
%} |
|
6674 |
. |
|
6675 |
^ false |
|
6676 |
! |
|
6677 |
||
6678 |
glxMaketag: t in: aGLXWindowId |
|
6679 |
||
6680 |
%{ /* NOCONTEXT */ |
|
6681 |
#ifdef GLX |
|
6682 |
SETWIN(aGLXWindowId) |
|
6683 |
maketag(_tagVal(t)); |
|
6684 |
RETURN (true); |
|
6685 |
#endif |
|
6686 |
%} |
|
6687 |
. |
|
6688 |
^ false |
|
6689 |
! |
|
6690 |
||
6691 |
glxMaxsizeX: x y: y in: aGLXWindowId |
|
6692 |
||
6693 |
%{ /* NOCONTEXT */ |
|
6694 |
#ifdef GLX |
|
6695 |
SETWIN(aGLXWindowId) |
|
6696 |
maxsize(_longVal(x), _longVal(y)); |
|
6697 |
RETURN (true); |
|
6698 |
#endif |
|
6699 |
%} |
|
6700 |
. |
|
6701 |
^ false |
|
6702 |
! |
|
6703 |
||
6704 |
glxMinsizeX: x y: y in: aGLXWindowId |
|
6705 |
||
6706 |
%{ /* NOCONTEXT */ |
|
6707 |
#ifdef GLX |
|
6708 |
SETWIN(aGLXWindowId) |
|
6709 |
minsize(_longVal(x), _longVal(y)); |
|
6710 |
RETURN (true); |
|
6711 |
#endif |
|
6712 |
%} |
|
6713 |
. |
|
6714 |
^ false |
|
6715 |
! |
|
6716 |
||
6717 |
glxMsalphaMode: mode in: aGLXWindowId |
|
6718 |
||
6719 |
%{ /* NOCONTEXT */ |
|
6720 |
#ifdef FULL_GLX |
|
6721 |
SETWIN(aGLXWindowId) |
|
6722 |
msalpha(_longVal(mode)); |
|
6723 |
RETURN (true); |
|
6724 |
#endif |
|
6725 |
%} |
|
6726 |
. |
|
6727 |
^ false |
|
6728 |
! |
|
6729 |
||
6730 |
glxMsmask: mask inverse: inverse in: aGLXWindowId |
|
6731 |
||
6732 |
%{ /* NOCONTEXT */ |
|
6733 |
#ifdef FULL_GLX |
|
6734 |
SETWIN(aGLXWindowId) |
|
6735 |
msmask(_floatVal(mask), _booleanVal(inverse)); |
|
6736 |
RETURN (true); |
|
6737 |
#endif |
|
6738 |
%} |
|
6739 |
. |
|
6740 |
^ false |
|
6741 |
! |
|
6742 |
||
6743 |
glxMspattern: pattern in: aGLXWindowId |
|
6744 |
||
6745 |
%{ /* NOCONTEXT */ |
|
6746 |
#ifdef FULL_GLX |
|
6747 |
SETWIN(aGLXWindowId) |
|
6748 |
mspattern(_longVal(pattern)); |
|
6749 |
RETURN (true); |
|
6750 |
#endif |
|
6751 |
%} |
|
6752 |
. |
|
6753 |
^ false |
|
6754 |
! |
|
6755 |
||
6756 |
glxMssizeSamples: samples zsize: zsize ssize: ssize in: aGLXWindowId |
|
6757 |
||
6758 |
%{ /* NOCONTEXT */ |
|
6759 |
#ifdef FULL_GLX |
|
6760 |
SETWIN(aGLXWindowId) |
|
6761 |
mssize(_longVal(samples), _longVal(zsize), _longVal(ssize)); |
|
6762 |
RETURN (true); |
|
6763 |
#endif |
|
6764 |
%} |
|
6765 |
. |
|
6766 |
^ false |
|
6767 |
! |
|
6768 |
||
6769 |
glxMswapbuffers: fbuf in: aGLXWindowId |
|
6770 |
||
6771 |
%{ /* NOCONTEXT */ |
|
6772 |
#ifdef GLX |
|
6773 |
SETWIN(aGLXWindowId) |
|
6774 |
mswapbuffers(_longVal(fbuf)); |
|
6775 |
RETURN (true); |
|
6776 |
#endif |
|
6777 |
%} |
|
6778 |
. |
|
6779 |
^ false |
|
6780 |
! |
|
6781 |
||
6782 |
glxMultimapIn: aGLXWindowId |
|
6783 |
||
6784 |
%{ /* NOCONTEXT */ |
|
6785 |
#ifdef GLX |
|
6786 |
SETWIN(aGLXWindowId) |
|
6787 |
multimap(); |
|
6788 |
RETURN (true); |
|
6789 |
#endif |
|
6790 |
%} |
|
6791 |
. |
|
6792 |
^ false |
|
6793 |
! |
|
6794 |
||
6795 |
glxMultisample: bool in: aGLXWindowId |
|
6796 |
||
6797 |
%{ /* NOCONTEXT */ |
|
6798 |
#ifdef FULL_GLX |
|
6799 |
SETWIN(aGLXWindowId) |
|
6800 |
multisample(_booleanVal(bool)); |
|
6801 |
RETURN (true); |
|
6802 |
#endif |
|
6803 |
%} |
|
6804 |
. |
|
6805 |
^ false |
|
6806 |
! |
|
6807 |
||
6808 |
glxNewpupIn: aGLXWindowId |
|
6809 |
||
6810 |
%{ /* NOCONTEXT */ |
|
6811 |
#ifdef GLX |
|
6812 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6813 |
RETURN (__MKSMALLINT(newpup())); |
294 | 6814 |
#endif |
6815 |
%} |
|
6816 |
. |
|
6817 |
^ false |
|
6818 |
! |
|
6819 |
||
6820 |
glxNewtag: newtg oldtg: oldtg offst: offst in: aGLXWindowId |
|
6821 |
||
6822 |
%{ /* NOCONTEXT */ |
|
6823 |
#ifdef GLX |
|
6824 |
SETWIN(aGLXWindowId) |
|
6825 |
newtag(_tagVal(newtg), _tagVal(oldtg), _offsetVal(offst)); |
|
6826 |
RETURN (true); |
|
6827 |
#endif |
|
6828 |
%} |
|
6829 |
. |
|
6830 |
^ false |
|
6831 |
! |
|
6832 |
||
6833 |
glxNoborderIn: aGLXWindowId |
|
6834 |
||
6835 |
%{ /* NOCONTEXT */ |
|
6836 |
#ifdef GLX |
|
6837 |
SETWIN(aGLXWindowId) |
|
6838 |
noborder(); |
|
6839 |
RETURN (true); |
|
6840 |
#endif |
|
6841 |
%} |
|
6842 |
. |
|
6843 |
^ false |
|
6844 |
! |
|
6845 |
||
6846 |
glxNoise: v delta: delta in: aGLXWindowId |
|
6847 |
||
6848 |
%{ /* NOCONTEXT */ |
|
6849 |
#ifdef GLX |
|
6850 |
SETWIN(aGLXWindowId) |
|
6851 |
noise(_deviceVal(v), _shortVal(delta)); |
|
6852 |
RETURN (true); |
|
6853 |
#endif |
|
6854 |
%} |
|
6855 |
. |
|
6856 |
^ false |
|
6857 |
! |
|
6858 |
||
6859 |
glxNoportIn: aGLXWindowId |
|
6860 |
||
6861 |
%{ /* NOCONTEXT */ |
|
6862 |
#ifdef GLX |
|
6863 |
SETWIN(aGLXWindowId) |
|
6864 |
noport(); |
|
6865 |
RETURN (true); |
|
6866 |
#endif |
|
6867 |
%} |
|
6868 |
. |
|
6869 |
^ false |
|
6870 |
! |
|
6871 |
||
6872 |
glxNurbscurveKnotCount: knotCount knotList: knotList |
|
4718 | 6873 |
offset: offset ctlArray: ctlArray |
294 | 6874 |
order: order type: type in: aGLXWindowId |
6875 |
||
6876 |
| ctlPoints i | |
|
6877 |
ctlPoints := DoubleArray new: ctlArray size * (ctlArray first size). |
|
6878 |
i := 1. |
|
6879 |
ctlArray do: [:point | |
|
4718 | 6880 |
point do: [:coord | |
294 | 6881 |
ctlPoints at: i put: coord. |
6882 |
i := i + 1]]. |
|
6883 |
||
6884 |
%{ /* NOCONTEXT */ |
|
6885 |
#ifdef GLX |
|
6886 |
char *knotElements, *ctlElements; |
|
6887 |
OBJ cls; |
|
6888 |
int ninstVars, nInstBytes; |
|
6889 |
||
6890 |
SETWIN(aGLXWindowId) |
|
6891 |
cls = __qClass(ctlPoints); |
|
6892 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
6893 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
|
6894 |
||
6895 |
ctlElements = (char *)(_InstPtr(ctlPoints)) + nInstBytes; |
|
6896 |
knotElements = (char *)(_InstPtr(knotList)) + nInstBytes; |
|
6897 |
||
6898 |
nurbscurve ( |
|
6899 |
_longVal(knotCount), (double *)knotElements, |
|
4718 | 6900 |
_longVal(offset), (double *)ctlElements, |
294 | 6901 |
_longVal(order), _longVal(type)); |
6902 |
RETURN(true); |
|
6903 |
#endif |
|
6904 |
%} |
|
6905 |
. |
|
6906 |
^ false |
|
6907 |
! |
|
6908 |
||
6909 |
glxObjdeleteTag1: tag1 tag2: tag2 in: aGLXWindowId |
|
6910 |
||
6911 |
%{ /* NOCONTEXT */ |
|
6912 |
#ifdef GLX |
|
6913 |
SETWIN(aGLXWindowId) |
|
6914 |
objdelete(_tagVal(tag1), _tagVal(tag2)); |
|
6915 |
RETURN (true); |
|
6916 |
#endif |
|
6917 |
%} |
|
6918 |
. |
|
6919 |
^ false |
|
6920 |
! |
|
6921 |
||
6922 |
glxObjinsert: t in: aGLXWindowId |
|
6923 |
||
6924 |
%{ /* NOCONTEXT */ |
|
6925 |
#ifdef GLX |
|
6926 |
SETWIN(aGLXWindowId) |
|
6927 |
objinsert(_tagVal(t)); |
|
6928 |
RETURN (true); |
|
6929 |
#endif |
|
6930 |
%} |
|
6931 |
. |
|
6932 |
^ false |
|
6933 |
! |
|
6934 |
||
6935 |
glxObjreplace: t in: aGLXWindowId |
|
6936 |
||
6937 |
%{ /* NOCONTEXT */ |
|
6938 |
#ifdef GLX |
|
6939 |
SETWIN(aGLXWindowId) |
|
6940 |
objreplace(_tagVal(t)); |
|
6941 |
RETURN (true); |
|
6942 |
#endif |
|
6943 |
%} |
|
6944 |
. |
|
6945 |
^ false |
|
6946 |
! |
|
6947 |
||
6948 |
glxOnemapIn: aGLXWindowId |
|
6949 |
||
6950 |
%{ /* NOCONTEXT */ |
|
6951 |
#ifdef GLX |
|
6952 |
SETWIN(aGLXWindowId) |
|
6953 |
onemap(); |
|
6954 |
RETURN (true); |
|
6955 |
#endif |
|
6956 |
%} |
|
6957 |
. |
|
6958 |
^ false |
|
6959 |
! |
|
6960 |
||
6961 |
glxPagecolor: pcolor in: aGLXWindowId |
|
6962 |
||
6963 |
%{ /* NOCONTEXT */ |
|
6964 |
#ifdef GLX |
|
6965 |
SETWIN(aGLXWindowId) |
|
6966 |
pagecolor(_colorindexVal(pcolor)); |
|
6967 |
RETURN (true); |
|
6968 |
#endif |
|
6969 |
%} |
|
6970 |
. |
|
6971 |
^ false |
|
6972 |
! |
|
6973 |
||
6974 |
glxPassthroughToken: token in: aGLXWindowId |
|
6975 |
||
6976 |
%{ /* NOCONTEXT */ |
|
6977 |
#ifdef GLX |
|
6978 |
SETWIN(aGLXWindowId) |
|
6979 |
passthrough(_shortVal(token)); |
|
6980 |
RETURN (true); |
|
6981 |
#endif |
|
6982 |
%} |
|
6983 |
. |
|
6984 |
^ false |
|
6985 |
! |
|
6986 |
||
6987 |
glxPclosIn: aGLXWindowId |
|
6988 |
||
6989 |
%{ /* NOCONTEXT */ |
|
6990 |
#ifdef GLX |
|
6991 |
SETWIN(aGLXWindowId) |
|
6992 |
pclos(); |
|
6993 |
RETURN (true); |
|
6994 |
#endif |
|
6995 |
%} |
|
6996 |
. |
|
6997 |
^ false |
|
6998 |
! |
|
6999 |
||
7000 |
glxPicksizeX: x y: y in: aGLXWindowId |
|
7001 |
||
7002 |
%{ /* NOCONTEXT */ |
|
7003 |
#ifdef GLX |
|
7004 |
SETWIN(aGLXWindowId) |
|
7005 |
picksize(_shortVal(x), _shortVal(y)); |
|
7006 |
RETURN (true); |
|
7007 |
#endif |
|
7008 |
%} |
|
7009 |
. |
|
7010 |
^ false |
|
7011 |
! |
|
7012 |
||
7013 |
glxPixmode: mode value: value in: aGLXWindowId |
|
7014 |
||
7015 |
%{ /* NOCONTEXT */ |
|
7016 |
#ifdef GLX |
|
7017 |
SETWIN(aGLXWindowId) |
|
7018 |
pixmode(_longVal(mode), _longVal(value)); |
|
7019 |
RETURN (true); |
|
7020 |
#endif |
|
7021 |
%} |
|
7022 |
. |
|
7023 |
^ false |
|
7024 |
! |
|
7025 |
||
7026 |
glxPntsmoothMode: mode in: aGLXWindowId |
|
7027 |
||
7028 |
%{ /* NOCONTEXT */ |
|
7029 |
#ifdef GLX |
|
7030 |
SETWIN(aGLXWindowId) |
|
7031 |
pntsmooth((ulong)__intVal(mode)); |
|
7032 |
RETURN (true); |
|
7033 |
#endif |
|
7034 |
%} |
|
7035 |
. |
|
7036 |
^ false |
|
7037 |
! |
|
7038 |
||
7039 |
glxPolysmoothMode: mode in: aGLXWindowId |
|
7040 |
||
7041 |
%{ /* NOCONTEXT */ |
|
7042 |
#ifdef GLX |
|
7043 |
SETWIN(aGLXWindowId) |
|
7044 |
polysmooth(_longVal(mode)); |
|
7045 |
RETURN (true); |
|
7046 |
#endif |
|
7047 |
%} |
|
7048 |
. |
|
7049 |
^ false |
|
7050 |
! |
|
7051 |
||
7052 |
glxPopnameIn: aGLXWindowId |
|
7053 |
||
7054 |
%{ /* NOCONTEXT */ |
|
7055 |
#ifdef GLX |
|
7056 |
SETWIN(aGLXWindowId) |
|
7057 |
popname(); |
|
7058 |
RETURN (true); |
|
7059 |
#endif |
|
7060 |
%} |
|
7061 |
. |
|
7062 |
^ false |
|
7063 |
! |
|
7064 |
||
7065 |
glxPrefpositionX1: x1 x2: x2 y1: y1 y2: y2 in: aGLXWindowId |
|
7066 |
||
7067 |
%{ /* NOCONTEXT */ |
|
7068 |
SETWIN(aGLXWindowId) |
|
1932 | 7069 |
#ifdef OPENGL |
7070 |
#else |
|
294 | 7071 |
prefposition(_longVal(x1), _longVal(x2), _longVal(y1), _longVal(y2)); |
1932 | 7072 |
#endif |
294 | 7073 |
RETURN (true); |
7074 |
%} |
|
7075 |
! |
|
7076 |
||
7077 |
glxPrefsizeX: x y: y in: aGLXWindowId |
|
7078 |
||
7079 |
%{ /* NOCONTEXT */ |
|
7080 |
SETWIN(aGLXWindowId) |
|
1932 | 7081 |
#ifdef OPENGL |
7082 |
#else |
|
294 | 7083 |
prefsize(_longVal(x), _longVal(y)); |
1932 | 7084 |
#endif |
294 | 7085 |
RETURN (true); |
7086 |
%} |
|
7087 |
! |
|
7088 |
||
7089 |
glxPupmodeIn: aGLXWindowId |
|
7090 |
||
7091 |
%{ /* NOCONTEXT */ |
|
7092 |
#ifdef GLX |
|
7093 |
SETWIN(aGLXWindowId) |
|
7094 |
pupmode(); |
|
7095 |
RETURN (true); |
|
7096 |
#endif |
|
7097 |
%} |
|
7098 |
. |
|
7099 |
^ false |
|
7100 |
! |
|
7101 |
||
7102 |
glxPushname: name In: aGLXWindowId |
|
7103 |
||
7104 |
%{ /* NOCONTEXT */ |
|
7105 |
#ifdef GLX |
|
7106 |
SETWIN(aGLXWindowId) |
|
7107 |
pushname(_shortVal(name)); |
|
7108 |
RETURN (true); |
|
7109 |
#endif |
|
7110 |
%} |
|
7111 |
. |
|
7112 |
^ false |
|
7113 |
! |
|
7114 |
||
7115 |
glxQdevice: dev in: aGLXWindowId |
|
7116 |
||
7117 |
%{ /* NOCONTEXT */ |
|
1932 | 7118 |
SETWIN(aGLXWindowId) |
7119 |
#ifdef OPENGL |
|
7120 |
#else |
|
294 | 7121 |
qdevice(_deviceVal(dev)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7122 |
#endif |
294 | 7123 |
%} |
7124 |
! |
|
7125 |
||
7126 |
glxQenterDev: dev val: val in: aGLXWindowId |
|
7127 |
||
7128 |
%{ /* NOCONTEXT */ |
|
7129 |
SETWIN(aGLXWindowId) |
|
1932 | 7130 |
#ifdef OPENGL |
7131 |
#else |
|
294 | 7132 |
qenter(_deviceVal(dev), _shortVal(val)); |
1932 | 7133 |
#endif |
294 | 7134 |
%} |
7135 |
! |
|
7136 |
||
7137 |
glxQgetfdIn: aGLXWindowId |
|
7138 |
||
7139 |
%{ /* NOCONTEXT */ |
|
7140 |
#ifdef GLX |
|
7141 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7142 |
RETURN (__MKSMALLINT(qgetfd())); |
294 | 7143 |
#endif |
7144 |
%} |
|
7145 |
. |
|
7146 |
^ false |
|
7147 |
! |
|
7148 |
||
7149 |
glxQreadIn: aGLXWindowId |
|
7150 |
||
7151 |
| dev data | |
|
4718 | 7152 |
%{ |
294 | 7153 |
short c_data; |
7154 |
||
7155 |
SETWIN(aGLXWindowId) |
|
1932 | 7156 |
#ifdef OPENGL |
7157 |
#else |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7158 |
dev = __MKSMALLINT(qread(&c_data)); |
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7159 |
data = __MKSMALLINT(c_data); |
1932 | 7160 |
#endif |
294 | 7161 |
%} |
7162 |
. |
|
7163 |
^ Array with: dev with: data |
|
7164 |
! |
|
7165 |
||
7166 |
glxQresetIn: aGLXWindowId |
|
7167 |
||
7168 |
%{ /* NOCONTEXT */ |
|
7169 |
SETWIN(aGLXWindowId) |
|
1932 | 7170 |
#ifdef OPENGL |
7171 |
#else |
|
294 | 7172 |
qreset(); |
1932 | 7173 |
#endif |
294 | 7174 |
RETURN (true); |
7175 |
%} |
|
7176 |
! |
|
7177 |
||
7178 |
glxQtestIn: aGLXWindowId |
|
7179 |
||
7180 |
%{ /* NOCONTEXT */ |
|
1932 | 7181 |
int rslt = 0; |
7182 |
||
7183 |
SETWIN(aGLXWindowId) |
|
7184 |
#ifdef OPENGL |
|
7185 |
#else |
|
7186 |
rslt = qtest(); |
|
7187 |
#endif |
|
7188 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 7189 |
%} |
7190 |
! |
|
7191 |
||
4718 | 7192 |
glxRGBcursorIndex: index red: red green: green blue: blue |
294 | 7193 |
redm: redm greenm: greenm bluem: bluem in: aGLXWindowId |
7194 |
||
7195 |
%{ /* NOCONTEXT */ |
|
7196 |
#ifdef GLX |
|
7197 |
SETWIN(aGLXWindowId) |
|
4718 | 7198 |
RGBcursor(_shortVal(index), |
7199 |
_shortVal(red), _shortVal(green), _shortVal(blue), |
|
294 | 7200 |
_shortVal(redm), _shortVal(greenm), _shortVal(bluem)); |
7201 |
RETURN (true); |
|
7202 |
#endif |
|
7203 |
%} |
|
7204 |
. |
|
7205 |
^ false |
|
7206 |
! |
|
7207 |
||
7208 |
glxRGBwritemaskRed: red green: green blue: blue in: aGLXWindowId |
|
7209 |
||
7210 |
%{ /* NOCONTEXT */ |
|
7211 |
#ifdef GLX |
|
7212 |
SETWIN(aGLXWindowId) |
|
7213 |
RGBwritemask(_shortVal(red), _shortVal(green), _shortVal(blue)); |
|
7214 |
RETURN (true); |
|
7215 |
#endif |
|
7216 |
%} |
|
7217 |
. |
|
7218 |
^ false |
|
7219 |
! |
|
7220 |
||
7221 |
glxRectzoomX: xfactor y: yfactor in: aGLXWindowId |
|
7222 |
||
7223 |
%{ /* NOCONTEXT */ |
|
7224 |
#ifdef GLX |
|
7225 |
SETWIN(aGLXWindowId) |
|
7226 |
rectzoom(_floatVal(xfactor), _floatVal(yfactor)); |
|
7227 |
RETURN (true); |
|
7228 |
#endif |
|
7229 |
%} |
|
7230 |
. |
|
7231 |
^ false |
|
7232 |
! |
|
7233 |
||
7234 |
glxResetls: b in: aGLXWindowId |
|
7235 |
||
7236 |
%{ /* NOCONTEXT */ |
|
7237 |
#ifdef GLX |
|
7238 |
SETWIN(aGLXWindowId) |
|
7239 |
resetls(_booleanVal(b)); |
|
7240 |
RETURN (true); |
|
7241 |
#endif |
|
7242 |
%} |
|
7243 |
. |
|
7244 |
^ false |
|
7245 |
! |
|
7246 |
||
7247 |
glxRingbellIn: aGLXWindowId |
|
7248 |
||
7249 |
%{ /* NOCONTEXT */ |
|
7250 |
#ifdef GLX |
|
7251 |
SETWIN(aGLXWindowId) |
|
7252 |
ringbell(); |
|
7253 |
RETURN (true); |
|
7254 |
#endif |
|
7255 |
%} |
|
7256 |
. |
|
7257 |
^ false |
|
7258 |
! |
|
7259 |
||
7260 |
glxSboxX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7261 |
||
7262 |
%{ /* NOCONTEXT */ |
|
7263 |
#ifdef GLX |
|
7264 |
SETWIN(aGLXWindowId) |
|
7265 |
sbox(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
7266 |
RETURN (true); |
|
7267 |
#endif |
|
7268 |
%} |
|
7269 |
. |
|
7270 |
^ false |
|
7271 |
! |
|
7272 |
||
7273 |
glxSboxfX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7274 |
||
7275 |
%{ /* NOCONTEXT */ |
|
7276 |
#ifdef GLX |
|
7277 |
SETWIN(aGLXWindowId) |
|
7278 |
sboxf(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
7279 |
RETURN (true); |
|
7280 |
#endif |
|
7281 |
%} |
|
7282 |
. |
|
7283 |
^ false |
|
7284 |
! |
|
7285 |
||
7286 |
glxSboxfiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7287 |
||
7288 |
%{ /* NOCONTEXT */ |
|
7289 |
#ifdef GLX |
|
7290 |
SETWIN(aGLXWindowId) |
|
7291 |
sboxfi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
7292 |
RETURN (true); |
|
7293 |
#endif |
|
7294 |
%} |
|
7295 |
. |
|
7296 |
^ false |
|
7297 |
! |
|
7298 |
||
7299 |
glxSboxfsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7300 |
||
7301 |
%{ /* NOCONTEXT */ |
|
7302 |
#ifdef GLX |
|
7303 |
SETWIN(aGLXWindowId) |
|
7304 |
sboxfs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
7305 |
RETURN (true); |
|
7306 |
#endif |
|
7307 |
%} |
|
7308 |
. |
|
7309 |
^ false |
|
7310 |
! |
|
7311 |
||
7312 |
glxSboxiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7313 |
||
7314 |
%{ /* NOCONTEXT */ |
|
7315 |
#ifdef GLX |
|
7316 |
SETWIN(aGLXWindowId) |
|
7317 |
sboxi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
7318 |
RETURN (true); |
|
7319 |
#endif |
|
7320 |
%} |
|
7321 |
. |
|
7322 |
^ false |
|
7323 |
! |
|
7324 |
||
7325 |
glxSboxsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7326 |
||
7327 |
%{ /* NOCONTEXT */ |
|
7328 |
#ifdef GLX |
|
7329 |
SETWIN(aGLXWindowId) |
|
7330 |
sboxs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
7331 |
RETURN (true); |
|
7332 |
#endif |
|
7333 |
%} |
|
7334 |
. |
|
7335 |
^ false |
|
7336 |
! |
|
7337 |
||
7338 |
glxSclearSval: sval in: aGLXWindowId |
|
7339 |
||
7340 |
%{ /* NOCONTEXT */ |
|
7341 |
#ifdef GLX |
|
7342 |
SETWIN(aGLXWindowId) |
|
7343 |
sclear((ulong)__intVal(sval)); |
|
7344 |
RETURN (true); |
|
7345 |
#endif |
|
7346 |
%} |
|
7347 |
. |
|
7348 |
^ false |
|
7349 |
! |
|
7350 |
||
7351 |
glxScrbox: arg in: aGLXWindowId |
|
7352 |
||
7353 |
%{ /* NOCONTEXT */ |
|
7354 |
#ifdef GLX |
|
7355 |
SETWIN(aGLXWindowId) |
|
7356 |
scrbox(_longVal(arg)); |
|
7357 |
RETURN (true); |
|
7358 |
#endif |
|
7359 |
%} |
|
7360 |
. |
|
7361 |
^ false |
|
7362 |
! |
|
7363 |
||
7364 |
glxScreenspaceIn: aGLXWindowId |
|
7365 |
||
7366 |
%{ /* NOCONTEXT */ |
|
7367 |
#ifdef GLX |
|
7368 |
SETWIN(aGLXWindowId) |
|
7369 |
screenspace(); |
|
7370 |
RETURN (true); |
|
7371 |
#endif |
|
7372 |
%} |
|
7373 |
. |
|
7374 |
^ false |
|
7375 |
! |
|
7376 |
||
7377 |
glxScrmaskLeft: left right: right bottom: bottom top: top in: aGLXWindowId |
|
7378 |
||
7379 |
%{ /* NOCONTEXT */ |
|
7380 |
#ifdef GLX |
|
7381 |
SETWIN(aGLXWindowId) |
|
4718 | 7382 |
scrmask(_screencoordVal(left), _screencoordVal(right), |
294 | 7383 |
_screencoordVal(bottom), _screencoordVal(top)); |
7384 |
RETURN (true); |
|
7385 |
#endif |
|
7386 |
%} |
|
7387 |
. |
|
7388 |
^ false |
|
7389 |
! |
|
7390 |
||
7391 |
glxScrnattach: gsnr in: aGLXWindowId |
|
7392 |
||
7393 |
%{ /* NOCONTEXT */ |
|
7394 |
#ifdef GLX |
|
7395 |
SETWIN(aGLXWindowId) |
|
7396 |
scrnattach(_longVal(gsnr)); |
|
7397 |
RETURN (true); |
|
7398 |
#endif |
|
7399 |
%} |
|
7400 |
. |
|
7401 |
^ false |
|
7402 |
! |
|
7403 |
||
7404 |
glxScrnselect: gsnr in: aGLXWindowId |
|
7405 |
||
7406 |
%{ /* NOCONTEXT */ |
|
7407 |
#ifdef GLX |
|
7408 |
SETWIN(aGLXWindowId) |
|
7409 |
scrnselect(_longVal(gsnr)); |
|
7410 |
RETURN (true); |
|
7411 |
#endif |
|
7412 |
%} |
|
7413 |
. |
|
7414 |
^ false |
|
7415 |
! |
|
7416 |
||
7417 |
glxSetcursorIndex: index color: color wtn: wtn in: aGLXWindowId |
|
7418 |
||
7419 |
%{ /* NOCONTEXT */ |
|
7420 |
#ifdef GLX |
|
7421 |
SETWIN(aGLXWindowId) |
|
7422 |
setcursor(_shortVal(index), _colorindexVal(color), _colorindexVal(wtn)); |
|
7423 |
RETURN (true); |
|
7424 |
#endif |
|
7425 |
%} |
|
7426 |
. |
|
7427 |
^ false |
|
7428 |
! |
|
7429 |
||
7430 |
glxSetdblightsMask: mask in: aGLXWindowId |
|
7431 |
||
7432 |
%{ /* NOCONTEXT */ |
|
7433 |
#ifdef GLX |
|
7434 |
SETWIN(aGLXWindowId) |
|
7435 |
setdblights((ulong)__intVal(mask)); |
|
7436 |
RETURN (true); |
|
7437 |
#endif |
|
7438 |
%} |
|
7439 |
. |
|
7440 |
^ false |
|
7441 |
! |
|
7442 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7443 |
glxSetdepthNear:znear far:zfar in: aGLXWindowId |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7444 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7445 |
%{ /* NOCONTEXT */ |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7446 |
#ifdef GLX |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7447 |
SETWIN(aGLXWindowId) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7448 |
setdepth(_screencoordVal(znear), _screencoordVal(zfar)); |
294 | 7449 |
RETURN (true); |
7450 |
#endif |
|
7451 |
%} |
|
7452 |
. |
|
7453 |
^ false |
|
7454 |
! |
|
7455 |
||
7456 |
glxSetmap: mapnum in: aGLXWindowId |
|
7457 |
||
7458 |
%{ /* NOCONTEXT */ |
|
7459 |
#ifdef GLX |
|
7460 |
SETWIN(aGLXWindowId) |
|
7461 |
setmap(_shortVal(mapnum)); |
|
7462 |
RETURN (true); |
|
7463 |
#endif |
|
7464 |
%} |
|
7465 |
. |
|
7466 |
^ false |
|
7467 |
! |
|
7468 |
||
7469 |
glxSetmonitor: mtype in: aGLXWindowId |
|
7470 |
||
7471 |
%{ /* NOCONTEXT */ |
|
7472 |
#ifdef GLX |
|
7473 |
SETWIN(aGLXWindowId) |
|
7474 |
setmonitor(_shortVal(mtype)); |
|
7475 |
RETURN (true); |
|
7476 |
#endif |
|
7477 |
%} |
|
7478 |
. |
|
7479 |
^ false |
|
7480 |
! |
|
7481 |
||
7482 |
glxSetnurbsproperty: property value: value in: aGLXWindowId |
|
7483 |
||
7484 |
%{ /* NOCONTEXT */ |
|
7485 |
#ifdef GLX |
|
7486 |
SETWIN(aGLXWindowId) |
|
7487 |
setnurbsproperty(_longVal(property), _floatVal(value)); |
|
7488 |
RETURN (true); |
|
7489 |
#endif |
|
7490 |
%} |
|
7491 |
. |
|
7492 |
^ false |
|
7493 |
! |
|
7494 |
||
7495 |
glxSetpattern: index in: aGLXWindowId |
|
7496 |
||
7497 |
%{ /* NOCONTEXT */ |
|
7498 |
#ifdef GLX |
|
7499 |
SETWIN(aGLXWindowId) |
|
7500 |
setpattern(_shortVal(index)); |
|
7501 |
RETURN (true); |
|
7502 |
#endif |
|
7503 |
%} |
|
7504 |
. |
|
7505 |
^ false |
|
7506 |
! |
|
7507 |
||
7508 |
glxSetpup: pup entry: entry mode: mode in: aGLXWindowId |
|
7509 |
||
7510 |
%{ /* NOCONTEXT */ |
|
7511 |
#ifdef GLX |
|
7512 |
SETWIN(aGLXWindowId) |
|
7513 |
setpup(_longVal(pup), _longVal(entry), (ulong)__intVal(mode)); |
|
7514 |
RETURN (true); |
|
7515 |
#endif |
|
7516 |
%} |
|
7517 |
. |
|
7518 |
^ false |
|
7519 |
! |
|
7520 |
||
7521 |
glxSetvaluator: v init: init vmin: vmin vmax: vmax in: aGLXWindowId |
|
7522 |
||
7523 |
%{ /* NOCONTEXT */ |
|
7524 |
#ifdef GLX |
|
7525 |
SETWIN(aGLXWindowId) |
|
7526 |
setvaluator(_deviceVal(v), _shortVal(init), _shortVal(vmin), _shortVal(vmax)); |
|
7527 |
RETURN (true); |
|
7528 |
#endif |
|
7529 |
%} |
|
7530 |
. |
|
7531 |
^ false |
|
7532 |
! |
|
7533 |
||
7534 |
glxSetvideo: reg value: value in: aGLXWindowId |
|
7535 |
||
7536 |
%{ /* NOCONTEXT */ |
|
7537 |
#ifdef GLX |
|
7538 |
SETWIN(aGLXWindowId) |
|
7539 |
setvideo(_longVal(reg), _longVal(value)); |
|
7540 |
RETURN (true); |
|
7541 |
#endif |
|
7542 |
%} |
|
7543 |
. |
|
7544 |
^ false |
|
7545 |
! |
|
7546 |
||
7547 |
glxShademodel: model in: aGLXWindowId |
|
7548 |
||
7549 |
%{ /* NOCONTEXT */ |
|
7550 |
#ifdef GLX |
|
7551 |
SETWIN(aGLXWindowId) |
|
7552 |
shademodel(_longVal(model)); |
|
7553 |
RETURN (true); |
|
7554 |
#endif |
|
7555 |
%} |
|
7556 |
. |
|
7557 |
^ false |
|
7558 |
! |
|
7559 |
||
7560 |
glxShaderangeLowin: lowin hiwin: hiwin z1: z1 z2: z2 in: aGLXWindowId |
|
7561 |
||
7562 |
%{ /* NOCONTEXT */ |
|
7563 |
#ifdef GLX |
|
7564 |
SETWIN(aGLXWindowId) |
|
4718 | 7565 |
shaderange(_colorindexVal(lowin), _colorindexVal(hiwin), |
294 | 7566 |
_screencoordVal(z1), _screencoordVal(z2)); |
7567 |
RETURN (true); |
|
7568 |
#endif |
|
7569 |
%} |
|
7570 |
. |
|
7571 |
^ false |
|
7572 |
! |
|
7573 |
||
7574 |
glxSmoothline: mode in: aGLXWindowId |
|
7575 |
||
7576 |
%{ /* NOCONTEXT */ |
|
7577 |
#ifdef GLX |
|
7578 |
SETWIN(aGLXWindowId) |
|
7579 |
smoothline(_longVal(mode)); |
|
7580 |
RETURN (true); |
|
7581 |
#endif |
|
7582 |
%} |
|
7583 |
. |
|
7584 |
^ false |
|
7585 |
! |
|
7586 |
||
4718 | 7587 |
glxStencilEnable: enable ref: ref func: func mask: mask fail: fail |
294 | 7588 |
pass: pass zpass: zpass in: aGLXWindowId |
7589 |
||
7590 |
%{ /* NOCONTEXT */ |
|
7591 |
#ifdef GLX |
|
7592 |
SETWIN(aGLXWindowId) |
|
4718 | 7593 |
stencil(_longVal(enable), (ulong)__intVal(ref), _longVal(func), |
294 | 7594 |
(ulong)__intVal(mask), _longVal(fail), _longVal(pass), _longVal(zpass)); |
7595 |
RETURN (true); |
|
7596 |
#endif |
|
7597 |
%} |
|
7598 |
. |
|
7599 |
^ false |
|
7600 |
! |
|
7601 |
||
7602 |
glxStensize: planes in: aGLXWindowId |
|
7603 |
||
7604 |
%{ /* NOCONTEXT */ |
|
7605 |
#ifdef GLX |
|
7606 |
SETWIN(aGLXWindowId) |
|
7607 |
stensize(_longVal(planes)); |
|
7608 |
RETURN (true); |
|
7609 |
#endif |
|
7610 |
%} |
|
7611 |
. |
|
7612 |
^ false |
|
7613 |
! |
|
7614 |
||
7615 |
glxStepunitX: x y: y in: aGLXWindowId |
|
7616 |
||
7617 |
%{ /* NOCONTEXT */ |
|
7618 |
#ifdef GLX |
|
7619 |
SETWIN(aGLXWindowId) |
|
7620 |
stepunit(_longVal(x), _longVal(y)); |
|
7621 |
RETURN (true); |
|
7622 |
#endif |
|
7623 |
%} |
|
7624 |
. |
|
7625 |
^ false |
|
7626 |
! |
|
7627 |
||
7628 |
glxSubpixel: b in: aGLXWindowId |
|
7629 |
||
7630 |
%{ /* NOCONTEXT */ |
|
7631 |
#ifdef GLX |
|
7632 |
SETWIN(aGLXWindowId) |
|
7633 |
subpixel(_booleanVal(b)); |
|
7634 |
RETURN (true); |
|
7635 |
#endif |
|
7636 |
%} |
|
7637 |
. |
|
7638 |
^ false |
|
7639 |
! |
|
7640 |
||
7641 |
glxSwapinterval: i in: aGLXWindowId |
|
7642 |
||
7643 |
%{ /* NOCONTEXT */ |
|
7644 |
#ifdef GLX |
|
7645 |
SETWIN(aGLXWindowId) |
|
7646 |
swapinterval(_shortVal(i)); |
|
7647 |
RETURN (true); |
|
7648 |
#endif |
|
7649 |
%} |
|
7650 |
. |
|
7651 |
^ false |
|
7652 |
! |
|
7653 |
||
7654 |
glxSwaptmeshIn: aGLXWindowId |
|
7655 |
||
7656 |
%{ /* NOCONTEXT */ |
|
7657 |
#ifdef GLX |
|
7658 |
SETWIN(aGLXWindowId) |
|
7659 |
swaptmesh(); |
|
7660 |
RETURN (true); |
|
7661 |
#endif |
|
7662 |
%} |
|
7663 |
. |
|
7664 |
^ false |
|
7665 |
! |
|
7666 |
||
7667 |
glxSwinopen: parent in: aGLXWindowId |
|
7668 |
||
7669 |
%{ /* NOCONTEXT */ |
|
7670 |
#ifdef GLX |
|
7671 |
SETWIN(aGLXWindowId) |
|
7672 |
swinopen(_longVal(parent)); |
|
7673 |
RETURN (true); |
|
7674 |
#endif |
|
7675 |
%} |
|
7676 |
. |
|
7677 |
^ false |
|
7678 |
! |
|
7679 |
||
7680 |
glxSwritemask: mask in: aGLXWindowId |
|
7681 |
||
7682 |
%{ /* NOCONTEXT */ |
|
7683 |
#ifdef GLX |
|
7684 |
SETWIN(aGLXWindowId) |
|
7685 |
swritemask((ulong)__intVal(mask)); |
|
7686 |
RETURN (true); |
|
7687 |
#endif |
|
7688 |
%} |
|
7689 |
. |
|
7690 |
^ false |
|
7691 |
! |
|
7692 |
||
7693 |
glxTextinitIn: aGLXWindowId |
|
7694 |
||
7695 |
%{ /* NOCONTEXT */ |
|
7696 |
#ifdef GLX |
|
7697 |
SETWIN(aGLXWindowId) |
|
7698 |
textinit(); |
|
7699 |
RETURN (true); |
|
7700 |
#endif |
|
7701 |
%} |
|
7702 |
. |
|
7703 |
^ false |
|
7704 |
! |
|
7705 |
||
7706 |
glxTextportLeft: left right: right bottom: bottom top: top in: aGLXWindowId |
|
7707 |
||
7708 |
%{ /* NOCONTEXT */ |
|
7709 |
#ifdef GLX |
|
7710 |
SETWIN(aGLXWindowId) |
|
4718 | 7711 |
textport(_screencoordVal(left), _screencoordVal(right), |
294 | 7712 |
_screencoordVal(bottom), _screencoordVal(top)); |
7713 |
RETURN (true); |
|
7714 |
#endif |
|
7715 |
%} |
|
7716 |
. |
|
7717 |
^ false |
|
7718 |
! |
|
7719 |
||
7720 |
glxTieB: b v1: v1 v2: v2 in: aGLXWindowId |
|
7721 |
||
7722 |
%{ /* NOCONTEXT */ |
|
7723 |
#ifdef GLX |
|
7724 |
SETWIN(aGLXWindowId) |
|
7725 |
tie(_deviceVal(b), _deviceVal(v1), _deviceVal(v2)); |
|
7726 |
RETURN (true); |
|
7727 |
#endif |
|
7728 |
%} |
|
7729 |
. |
|
7730 |
^ false |
|
7731 |
! |
|
7732 |
||
7733 |
glxTlutbind: target index: index in: aGLXWindowId |
|
7734 |
||
7735 |
%{ /* NOCONTEXT */ |
|
7736 |
#ifdef FULL_GLX |
|
7737 |
SETWIN(aGLXWindowId) |
|
7738 |
tlutbind(_longVal(target), _longVal(index)); |
|
7739 |
RETURN (true); |
|
7740 |
#endif |
|
7741 |
%} |
|
7742 |
. |
|
7743 |
^ false |
|
7744 |
! |
|
7745 |
||
7746 |
glxTpoffIn: aGLXWindowId |
|
7747 |
||
7748 |
%{ /* NOCONTEXT */ |
|
7749 |
#ifdef GLX |
|
7750 |
SETWIN(aGLXWindowId) |
|
7751 |
tpoff(); |
|
7752 |
RETURN (true); |
|
7753 |
#endif |
|
7754 |
%} |
|
7755 |
. |
|
7756 |
^ false |
|
7757 |
! |
|
7758 |
||
7759 |
glxTponIn: aGLXWindowId |
|
7760 |
||
7761 |
%{ /* NOCONTEXT */ |
|
7762 |
#ifdef GLX |
|
7763 |
SETWIN(aGLXWindowId) |
|
7764 |
tpon(); |
|
7765 |
RETURN (true); |
|
7766 |
#endif |
|
7767 |
%} |
|
7768 |
. |
|
7769 |
^ false |
|
7770 |
! |
|
7771 |
||
7772 |
glxUnqdevice: dev in: aGLXWindowId |
|
7773 |
||
7774 |
%{ /* NOCONTEXT */ |
|
1932 | 7775 |
SETWIN(aGLXWindowId) |
7776 |
#ifdef OPENGL |
|
7777 |
#else |
|
294 | 7778 |
unqdevice(_deviceVal(dev)); |
1932 | 7779 |
#endif |
7780 |
%} |
|
294 | 7781 |
! |
7782 |
||
7783 |
glxWmpack: pack in: aGLXWindowId |
|
7784 |
||
7785 |
%{ /* NOCONTEXT */ |
|
7786 |
#ifdef GLX |
|
7787 |
SETWIN(aGLXWindowId) |
|
7788 |
wmpack((ulong)__intVal(pack)); |
|
7789 |
RETURN (true); |
|
7790 |
#endif |
|
7791 |
%} |
|
7792 |
. |
|
7793 |
^ false |
|
7794 |
! |
|
7795 |
||
7796 |
glxWritemask: wtm in: aGLXWindowId |
|
7797 |
||
7798 |
%{ /* NOCONTEXT */ |
|
7799 |
#ifdef GLX |
|
7800 |
SETWIN(aGLXWindowId) |
|
7801 |
writemask(_colorindexVal(wtm)); |
|
7802 |
RETURN (true); |
|
7803 |
#endif |
|
7804 |
%} |
|
7805 |
. |
|
7806 |
^ false |
|
7807 |
! |
|
7808 |
||
7809 |
glxXfpt2X: x y: y in: aGLXWindowId |
|
7810 |
||
7811 |
%{ /* NOCONTEXT */ |
|
7812 |
#ifdef GLX |
|
7813 |
Coord c_x, c_y; |
|
7814 |
||
7815 |
_COORD_ (x, c_x) |
|
7816 |
_COORD_ (y, c_y) |
|
7817 |
SETWIN(aGLXWindowId) |
|
7818 |
xfpt2(c_x, c_y); |
|
7819 |
RETURN (true); |
|
7820 |
#endif |
|
7821 |
%} |
|
7822 |
. |
|
7823 |
^ false |
|
7824 |
! |
|
7825 |
||
7826 |
glxXfpt2iX: x y: y in: aGLXWindowId |
|
7827 |
||
7828 |
%{ /* NOCONTEXT */ |
|
7829 |
#ifdef GLX |
|
7830 |
Icoord c_x, c_y; |
|
7831 |
||
7832 |
_ICOORD_ (x, c_x) |
|
7833 |
_ICOORD_ (y, c_y) |
|
7834 |
SETWIN(aGLXWindowId) |
|
7835 |
xfpt2i(c_x, c_y); |
|
7836 |
RETURN (true); |
|
7837 |
#endif |
|
7838 |
%} |
|
7839 |
. |
|
7840 |
^ false |
|
7841 |
! |
|
7842 |
||
7843 |
glxXfpt2sX: x y: y in: aGLXWindowId |
|
7844 |
||
7845 |
%{ /* NOCONTEXT */ |
|
7846 |
#ifdef GLX |
|
7847 |
Scoord c_x, c_y; |
|
7848 |
||
7849 |
_SCOORD_ (x, c_x) |
|
7850 |
_SCOORD_ (y, c_y) |
|
7851 |
SETWIN(aGLXWindowId) |
|
7852 |
xfpt2s(c_x, c_y); |
|
7853 |
RETURN (true); |
|
7854 |
#endif |
|
7855 |
%} |
|
7856 |
. |
|
7857 |
^ false |
|
7858 |
! |
|
7859 |
||
7860 |
glxXfpt4X: x y: y z: z w: w in: aGLXWindowId |
|
7861 |
||
7862 |
%{ /* NOCONTEXT */ |
|
7863 |
#ifdef GLX |
|
7864 |
Coord c_x, c_y, c_z, c_w; |
|
7865 |
||
7866 |
_COORD_ (x, c_x) |
|
7867 |
_COORD_ (y, c_y) |
|
7868 |
_COORD_ (z, c_z) |
|
7869 |
_COORD_ (w, c_w) |
|
7870 |
SETWIN(aGLXWindowId) |
|
7871 |
xfpt4(c_x, c_y, c_z, c_w); |
|
7872 |
RETURN (true); |
|
7873 |
#endif |
|
7874 |
%} |
|
7875 |
. |
|
7876 |
^ false |
|
7877 |
! |
|
7878 |
||
7879 |
glxXfpt4iX: x y: y z: z w: w in: aGLXWindowId |
|
7880 |
||
7881 |
%{ /* NOCONTEXT */ |
|
7882 |
#ifdef GLX |
|
7883 |
Icoord c_x, c_y, c_z, c_w; |
|
7884 |
||
7885 |
_ICOORD_ (x, c_x) |
|
7886 |
_ICOORD_ (y, c_y) |
|
7887 |
_ICOORD_ (z, c_z) |
|
7888 |
_ICOORD_ (w, c_w) |
|
7889 |
SETWIN(aGLXWindowId) |
|
7890 |
xfpt4i(c_x, c_y, c_z, c_w); |
|
7891 |
RETURN (true); |
|
7892 |
#endif |
|
7893 |
%} |
|
7894 |
. |
|
7895 |
^ false |
|
7896 |
! |
|
7897 |
||
7898 |
glxXfpt4sX: x y: y z: z w: w in: aGLXWindowId |
|
7899 |
||
7900 |
%{ /* NOCONTEXT */ |
|
7901 |
#ifdef GLX |
|
7902 |
Scoord c_x, c_y, c_z, c_w; |
|
7903 |
||
7904 |
_SCOORD_ (x, c_x) |
|
7905 |
_SCOORD_ (y, c_y) |
|
7906 |
_SCOORD_ (z, c_z) |
|
7907 |
_SCOORD_ (w, c_w) |
|
7908 |
SETWIN(aGLXWindowId) |
|
7909 |
xfpt4s(c_x, c_y, c_z, c_w); |
|
7910 |
RETURN (true); |
|
7911 |
#endif |
|
7912 |
%} |
|
7913 |
. |
|
7914 |
^ false |
|
7915 |
! |
|
7916 |
||
7917 |
glxXfptX: x y: y z: z in: aGLXWindowId |
|
7918 |
||
7919 |
%{ /* NOCONTEXT */ |
|
7920 |
#ifdef GLX |
|
7921 |
Coord c_x, c_y, c_z; |
|
7922 |
||
7923 |
_COORD_ (x, c_x) |
|
7924 |
_COORD_ (y, c_y) |
|
7925 |
_COORD_ (z, c_z) |
|
7926 |
SETWIN(aGLXWindowId) |
|
7927 |
xfpt(c_x, c_y, c_z); |
|
7928 |
RETURN (true); |
|
7929 |
#endif |
|
7930 |
%} |
|
7931 |
. |
|
7932 |
^ false |
|
7933 |
! |
|
7934 |
||
7935 |
glxXfptiX: x y: y z: z in: aGLXWindowId |
|
7936 |
||
7937 |
%{ /* NOCONTEXT */ |
|
7938 |
#ifdef GLX |
|
7939 |
Icoord c_x, c_y, c_z; |
|
7940 |
||
7941 |
_ICOORD_ (x, c_x) |
|
7942 |
_ICOORD_ (y, c_y) |
|
7943 |
_ICOORD_ (z, c_z) |
|
7944 |
SETWIN(aGLXWindowId) |
|
7945 |
xfpti(c_x, c_y, c_z); |
|
7946 |
RETURN (true); |
|
7947 |
#endif |
|
7948 |
%} |
|
7949 |
. |
|
7950 |
^ false |
|
7951 |
! |
|
7952 |
||
7953 |
glxXfptsX: x y: y z: z in: aGLXWindowId |
|
7954 |
||
7955 |
%{ /* NOCONTEXT */ |
|
7956 |
#ifdef GLX |
|
7957 |
Scoord c_x, c_y, c_z; |
|
7958 |
||
7959 |
_SCOORD_ (x, c_x) |
|
7960 |
_SCOORD_ (y, c_y) |
|
7961 |
_SCOORD_ (z, c_z) |
|
7962 |
SETWIN(aGLXWindowId) |
|
7963 |
xfpts(c_x, c_y, c_z); |
|
7964 |
RETURN (true); |
|
7965 |
#endif |
|
7966 |
%} |
|
7967 |
. |
|
7968 |
^ false |
|
7969 |
! ! |
|
7970 |
||
7971 |
!GLXWorkstation methodsFor:'vertex data transfer'! |
|
7972 |
||
7973 |
glxN3f:arrayOf3Floats in:aGLXWindowId |
|
7974 |
"argument must be an array of 3 floats containing the |
|
7975 |
current vertex normal - in real GL only" |
|
7976 |
||
7977 |
%{ /* NOCONTEXT */ |
|
7978 |
#ifdef GLX |
|
7979 |
float vec[3], *v; |
|
7980 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7981 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 7982 |
SETWIN(aGLXWindowId) |
7983 |
n3f(v); |
|
7984 |
RETURN (true); |
|
7985 |
#endif |
|
7986 |
%} |
|
7987 |
. |
|
7988 |
^ false |
|
7989 |
! |
|
7990 |
||
7991 |
glxV2d:v in:aGLXWindowId |
|
7992 |
"pass a vertex; v must be a vector with 2 doubles; z is taken as 0" |
|
7993 |
||
7994 |
%{ /* NOCONTEXT */ |
|
7995 |
double vec[2], *c_v; |
|
7996 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7997 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 2))) RETURN(false); |
294 | 7998 |
SETWIN(aGLXWindowId) |
1932 | 7999 |
#ifdef OPENGL |
8000 |
#else |
|
294 | 8001 |
v2d(c_v); |
1932 | 8002 |
#endif |
294 | 8003 |
RETURN (true); |
8004 |
%} |
|
8005 |
! |
|
8006 |
||
8007 |
glxV2f:v in:aGLXWindowId |
|
8008 |
"pass a vertex; v must be a vector with 2 floats; z is taken as 0" |
|
8009 |
||
8010 |
%{ /* NOCONTEXT */ |
|
8011 |
float vec[2], *c_v; |
|
8012 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8013 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
294 | 8014 |
SETWIN(aGLXWindowId) |
1932 | 8015 |
#ifdef OPENGL |
8016 |
#else |
|
294 | 8017 |
v2f(c_v); |
1932 | 8018 |
#endif |
294 | 8019 |
RETURN (true); |
8020 |
%} |
|
8021 |
! |
|
8022 |
||
8023 |
glxV2fX:x y:y in:aGLXWindowId |
|
8024 |
"pass a vertex from individual x and y values; z is taken as 0.0" |
|
8025 |
||
8026 |
%{ /* NOCONTEXT */ |
|
8027 |
float vec[2]; |
|
8028 |
||
8029 |
_FLOAT_(x, vec[0]) |
|
8030 |
_FLOAT_(y, vec[1]) |
|
8031 |
SETWIN(aGLXWindowId) |
|
1932 | 8032 |
#ifdef OPENGL |
8033 |
#else |
|
294 | 8034 |
v2f(vec); |
1932 | 8035 |
#endif |
294 | 8036 |
RETURN (true); |
8037 |
%} |
|
8038 |
! |
|
8039 |
||
8040 |
glxV2i:v in:aGLXWindowId |
|
8041 |
"pass a vertex; v must be a vector with 2 longs; z is taken as 0" |
|
8042 |
||
8043 |
%{ /* NOCONTEXT */ |
|
8044 |
long vec[2], *c_v; |
|
8045 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8046 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 2))) RETURN(false); |
294 | 8047 |
SETWIN(aGLXWindowId) |
1932 | 8048 |
#ifdef OPENGL |
8049 |
#else |
|
294 | 8050 |
v2i(c_v); |
1932 | 8051 |
#endif |
294 | 8052 |
RETURN (true); |
8053 |
%} |
|
8054 |
! |
|
8055 |
||
8056 |
glxV2s:v in:aGLXWindowId |
|
8057 |
"pass a vertex; v must be a vector with 2 shorts; z is taken as 0" |
|
8058 |
||
8059 |
%{ /* NOCONTEXT */ |
|
8060 |
short vec[2], *c_v; |
|
8061 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8062 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 2))) RETURN(false); |
294 | 8063 |
SETWIN(aGLXWindowId) |
1932 | 8064 |
#ifdef OPENGL |
8065 |
#else |
|
294 | 8066 |
v2s(c_v); |
1932 | 8067 |
#endif |
294 | 8068 |
RETURN (true); |
8069 |
%} |
|
8070 |
! |
|
8071 |
||
8072 |
glxV3d:v in:aGLXWindowId |
|
8073 |
"pass a vertex; v must be a 3-element double-vector" |
|
8074 |
||
8075 |
%{ /* NOCONTEXT */ |
|
8076 |
double vec[3], *c_v; |
|
8077 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8078 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 3))) RETURN(false); |
294 | 8079 |
SETWIN(aGLXWindowId) |
1932 | 8080 |
#ifdef OPENGL |
8081 |
#else |
|
294 | 8082 |
v3d(c_v); |
1932 | 8083 |
#endif |
294 | 8084 |
RETURN (true); |
8085 |
%} |
|
8086 |
. |
|
8087 |
^ false |
|
8088 |
! |
|
8089 |
||
8090 |
glxV3f:v in:aGLXWindowId |
|
8091 |
"pass a vertex; v must be a 3-element float-vector" |
|
8092 |
||
8093 |
%{ /* NOCONTEXT */ |
|
8094 |
float vec[3], *c_v; |
|
8095 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8096 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
294 | 8097 |
SETWIN(aGLXWindowId) |
1932 | 8098 |
#ifdef OPENGL |
8099 |
#else |
|
294 | 8100 |
v3f(c_v); |
1932 | 8101 |
#endif |
294 | 8102 |
RETURN (true); |
8103 |
%} |
|
8104 |
! |
|
8105 |
||
8106 |
glxV3fX:x y:y z:z in: aGLXWindowId |
|
8107 |
"pass a vector from individual x, y and z (float) values" |
|
8108 |
||
8109 |
%{ /* NOCONTEXT */ |
|
8110 |
float vec[3]; |
|
8111 |
||
8112 |
_FLOAT_(x, vec[0]) |
|
8113 |
_FLOAT_(y, vec[1]) |
|
8114 |
_FLOAT_(z, vec[2]) |
|
8115 |
SETWIN(aGLXWindowId) |
|
1932 | 8116 |
#ifdef OPENGL |
8117 |
#else |
|
294 | 8118 |
v3f(vec); |
1932 | 8119 |
#endif |
294 | 8120 |
RETURN (true); |
8121 |
%} |
|
8122 |
! |
|
8123 |
||
8124 |
glxV3i:v in:aGLXWindowId |
|
8125 |
"pass a vertex; v must be a vector with 3 longs" |
|
8126 |
||
8127 |
%{ /* NOCONTEXT */ |
|
8128 |
long vec[3], *c_v; |
|
8129 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8130 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
294 | 8131 |
SETWIN(aGLXWindowId) |
1932 | 8132 |
#ifdef OPENGL |
8133 |
#else |
|
294 | 8134 |
v3i(c_v); |
1932 | 8135 |
#endif |
294 | 8136 |
RETURN (true); |
8137 |
%} |
|
8138 |
! |
|
8139 |
||
8140 |
glxV3s:v in:aGLXWindowId |
|
8141 |
"pass a vertex; v must be a vector with 3 shorts" |
|
8142 |
||
8143 |
%{ /* NOCONTEXT */ |
|
8144 |
short vec[3], *c_v; |
|
8145 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8146 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
294 | 8147 |
SETWIN(aGLXWindowId) |
1932 | 8148 |
#ifdef OPENGL |
8149 |
#else |
|
294 | 8150 |
v3s(c_v); |
1932 | 8151 |
#endif |
294 | 8152 |
RETURN (true); |
8153 |
%} |
|
8154 |
! |
|
8155 |
||
8156 |
glxV4d:v in:aGLXWindowId |
|
8157 |
"pass a vertex; v must be a 4-element double-vector, |
|
8158 |
containing x, y, z and w" |
|
8159 |
||
8160 |
%{ /* NOCONTEXT */ |
|
8161 |
double vec[4], *c_v; |
|
8162 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8163 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 4))) RETURN(false); |
294 | 8164 |
SETWIN(aGLXWindowId) |
1932 | 8165 |
#ifdef OPENGL |
8166 |
#else |
|
294 | 8167 |
v4d(c_v); |
1932 | 8168 |
#endif |
294 | 8169 |
RETURN (true); |
8170 |
%} |
|
8171 |
! |
|
8172 |
||
8173 |
glxV4f:v in:aGLXWindowId |
|
8174 |
"pass a vertex; v must be a 4-element float-vector, |
|
8175 |
containing x, y, z and w" |
|
8176 |
||
8177 |
%{ /* NOCONTEXT */ |
|
8178 |
float vec[4], *c_v; |
|
8179 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8180 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
294 | 8181 |
SETWIN(aGLXWindowId) |
1932 | 8182 |
#ifdef OPENGL |
8183 |
#else |
|
294 | 8184 |
v4f(c_v); |
1932 | 8185 |
#endif |
294 | 8186 |
RETURN (true); |
8187 |
%} |
|
8188 |
! |
|
8189 |
||
8190 |
glxV4i:v in:aGLXWindowId |
|
8191 |
"pass a vertex; v must be a 4-element int-vector, |
|
8192 |
containing x, y, z and w" |
|
8193 |
||
8194 |
%{ /* NOCONTEXT */ |
|
8195 |
long vec[4], *c_v; |
|
8196 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8197 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
294 | 8198 |
SETWIN(aGLXWindowId) |
1932 | 8199 |
#ifdef OPENGL |
8200 |
#else |
|
294 | 8201 |
v4i(c_v); |
1932 | 8202 |
#endif |
294 | 8203 |
RETURN (true); |
8204 |
%} |
|
8205 |
! |
|
8206 |
||
8207 |
glxV4s:v in:aGLXWindowId |
|
8208 |
"pass a vertex; v must be a 4-element short-vector, |
|
8209 |
containing x, y, z and w" |
|
8210 |
||
8211 |
%{ /* NOCONTEXT */ |
|
8212 |
short vec[4], *c_v; |
|
8213 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8214 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
294 | 8215 |
SETWIN(aGLXWindowId) |
1932 | 8216 |
#ifdef OPENGL |
8217 |
#else |
|
294 | 8218 |
v4s(c_v); |
1932 | 8219 |
#endif |
294 | 8220 |
RETURN (true); |
8221 |
%} |
|
8222 |
! |
|
8223 |
||
8224 |
glxVOriginIn:aGLXWindowId |
|
8225 |
"pass a 0.0/0.0/0.0 vector. |
|
8226 |
This is the same as v3f:#(0.0 0.0 0.0), but, since its so |
|
8227 |
common, this somewhat faster method has been provided" |
|
8228 |
||
8229 |
%{ /* NOCONTEXT */ |
|
8230 |
static float vec[3] = {0.0, 0.0, 0.0}; |
|
8231 |
||
8232 |
SETWIN(aGLXWindowId) |
|
1932 | 8233 |
#ifdef OPENGL |
8234 |
#else |
|
294 | 8235 |
v3f(vec); |
1932 | 8236 |
#endif |
294 | 8237 |
RETURN (true); |
8238 |
%} |
|
8239 |
! |
|
8240 |
||
8241 |
glxVUnitXIn:aGLXWindowId |
|
8242 |
"pass a 1.0/0.0/0.0 vector. |
|
8243 |
This is the same as v3f:#(1.0 0.0 0.0), but, since its so |
|
8244 |
common, this somewhat faster method has been provided" |
|
8245 |
||
8246 |
%{ /* NOCONTEXT */ |
|
8247 |
static float vec[3] = {1.0, 0.0, 0.0}; |
|
8248 |
||
8249 |
SETWIN(aGLXWindowId) |
|
1932 | 8250 |
#ifdef OPENGL |
8251 |
#else |
|
294 | 8252 |
v3f(vec); |
1932 | 8253 |
#endif |
294 | 8254 |
RETURN (true); |
8255 |
%} |
|
8256 |
! |
|
8257 |
||
8258 |
glxVUnitYIn:aGLXWindowId |
|
8259 |
"pass a 0.0/1.0/0.0 vector. |
|
8260 |
This is the same as v3f:#(0.0 1.0 0.0), but, since its so |
|
8261 |
common, this somewhat faster method has been provided" |
|
8262 |
||
8263 |
%{ /* NOCONTEXT */ |
|
8264 |
static float vec[3] = {0.0, 1.0, 0.0}; |
|
8265 |
||
8266 |
SETWIN(aGLXWindowId) |
|
1932 | 8267 |
#ifdef OPENGL |
8268 |
#else |
|
294 | 8269 |
v3f(vec); |
1932 | 8270 |
#endif |
294 | 8271 |
RETURN (true); |
8272 |
%} |
|
8273 |
! |
|
8274 |
||
8275 |
glxVUnitZIn:aGLXWindowId |
|
8276 |
"pass a 0.0/0.0/1.0 vector. |
|
8277 |
This is the same as v3f:#(0.0 0.0 1.0), but, since its so |
|
8278 |
common, this somewhat faster method has been provided" |
|
8279 |
||
8280 |
%{ /* NOCONTEXT */ |
|
8281 |
static float vec[3] = {0.0, 0.0, 1.0}; |
|
8282 |
||
8283 |
SETWIN(aGLXWindowId) |
|
1932 | 8284 |
#ifdef OPENGL |
8285 |
#else |
|
294 | 8286 |
v3f(vec); |
1932 | 8287 |
#endif |
294 | 8288 |
RETURN (true); |
8289 |
%} |
|
8290 |
! ! |
|
8291 |
||
8292 |
!GLXWorkstation methodsFor:'video and planes'! |
|
8293 |
||
8294 |
glxOverlayPlanes: planes in: aGLXWindowId |
|
8295 |
||
8296 |
%{ /* NOCONTEXT */ |
|
8297 |
#ifdef GLX |
|
8298 |
SETWIN(aGLXWindowId) |
|
8299 |
overlay(_longVal(planes)); |
|
8300 |
RETURN (true); |
|
8301 |
#endif |
|
8302 |
%} |
|
8303 |
. |
|
8304 |
^ false |
|
8305 |
! |
|
8306 |
||
8307 |
glxStereobufferIn: aGLXWindowId |
|
8308 |
||
8309 |
%{ /* NOCONTEXT */ |
|
8310 |
#ifdef FULL_GLX |
|
8311 |
SETWIN(aGLXWindowId) |
|
8312 |
stereobuffer(); |
|
8313 |
RETURN (true); |
|
8314 |
#endif |
|
8315 |
%} |
|
8316 |
. |
|
8317 |
^ false |
|
8318 |
! |
|
8319 |
||
8320 |
glxUnderlay: planes in: aGLXWindowId |
|
8321 |
||
8322 |
%{ /* NOCONTEXT */ |
|
8323 |
#ifdef GLX |
|
8324 |
SETWIN(aGLXWindowId) |
|
8325 |
underlay(_longVal(planes)); |
|
8326 |
RETURN (true); |
|
8327 |
#endif |
|
8328 |
%} |
|
8329 |
. |
|
8330 |
^ false |
|
8331 |
! |
|
8332 |
||
8333 |
glxVideocmd:cmd in:aGLXWindowId |
|
8334 |
||
8335 |
%{ /* NOCONTEXT */ |
|
8336 |
#ifdef GLX |
|
8337 |
SETWIN(aGLXWindowId) |
|
8338 |
videocmd(_longVal(cmd)); |
|
8339 |
RETURN (true); |
|
8340 |
#endif |
|
8341 |
%} |
|
8342 |
. |
|
8343 |
^ false |
|
8344 |
! ! |
|
8345 |
||
8346 |
!GLXWorkstation methodsFor:'viewing'! |
|
8347 |
||
8348 |
glxLookatVx:vx vy:vy vz:vz px:px py:py pz:pz twist:twist in:aGLXWindowId |
|
8349 |
"define viewing transformation" |
|
8350 |
||
8351 |
%{ /* NOCONTEXT */ |
|
8352 |
||
8353 |
Coord f_vx, f_vy, f_vz, f_px, f_py, f_pz; |
|
8354 |
Angle a_twist; |
|
8355 |
||
8356 |
_COORD_ (vx, f_vx) |
|
8357 |
_COORD_ (vy, f_vy) |
|
8358 |
_COORD_ (vz, f_vz) |
|
8359 |
_COORD_ (px, f_px) |
|
8360 |
_COORD_ (py, f_py) |
|
8361 |
_COORD_ (pz, f_pz) |
|
8362 |
_ANGLE_ (twist, a_twist) |
|
8363 |
SETWIN(aGLXWindowId) |
|
1932 | 8364 |
#ifdef OPENGL |
8365 |
#else |
|
294 | 8366 |
lookat(f_vx, f_vy, f_vz, f_px, f_py, f_pz, a_twist); |
1932 | 8367 |
#endif |
294 | 8368 |
%} |
8369 |
! |
|
8370 |
||
8371 |
glxOrtho2Left: left right: right bottom: bottom top: top in: aGLXWindowId |
|
8372 |
"define 2D orthogonal projection" |
|
8373 |
||
8374 |
%{ /* NOCONTEXT */ |
|
8375 |
float f_left, f_right, f_top, f_bottom; |
|
8376 |
||
8377 |
SETWIN(aGLXWindowId) |
|
8378 |
_FLOAT_(left, f_left) |
|
8379 |
_FLOAT_(right, f_right) |
|
8380 |
_FLOAT_(bottom, f_bottom) |
|
8381 |
_FLOAT_(top, f_top) |
|
1932 | 8382 |
#ifdef OPENGL |
8383 |
#else |
|
294 | 8384 |
ortho2(f_left, f_right, f_bottom, f_top); |
1932 | 8385 |
#endif |
8386 |
%} |
|
294 | 8387 |
! |
8388 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8389 |
glxOrthoLeft: left right: right bottom: bottom top: top near: znear far: zfar in: aGLXWindowId |
294 | 8390 |
"define orthogonal projection" |
8391 |
||
8392 |
%{ /* NOCONTEXT */ |
|
8393 |
float f_left, f_right, f_bottom, f_top, |
|
8394 |
f_near, f_far; |
|
8395 |
||
8396 |
_FLOAT_(left, f_left) |
|
8397 |
_FLOAT_(right, f_right) |
|
8398 |
_FLOAT_(bottom, f_bottom) |
|
8399 |
_FLOAT_(top, f_top) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8400 |
_FLOAT_(znear, f_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8401 |
_FLOAT_(zfar, f_far) |
294 | 8402 |
SETWIN(aGLXWindowId) |
1932 | 8403 |
#ifdef OPENGL |
8404 |
#else |
|
294 | 8405 |
ortho(f_left, f_right, f_bottom, f_top, f_near, f_far); |
1932 | 8406 |
#endif |
294 | 8407 |
%} |
8408 |
! |
|
8409 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8410 |
glxPerspectiveFovy:fovy aspect:aspect near:znear far:zfar in:aGLXWindowId |
294 | 8411 |
"define perspective projection" |
8412 |
||
8413 |
%{ /* NOCONTEXT */ |
|
8414 |
||
8415 |
Angle a_fovy; |
|
8416 |
Coord c_near, c_far; |
|
8417 |
float f_aspect; |
|
8418 |
||
8419 |
_ANGLE_ (fovy, a_fovy) |
|
8420 |
_FLOAT_ (aspect, f_aspect) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8421 |
_COORD_ (znear, c_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8422 |
_COORD_ (zfar, c_far) |
294 | 8423 |
|
8424 |
SETWIN(aGLXWindowId) |
|
1932 | 8425 |
#ifdef OPENGL |
8426 |
#else |
|
294 | 8427 |
perspective(a_fovy, f_aspect, c_near, c_far); |
1932 | 8428 |
#endif |
294 | 8429 |
%} |
8430 |
! |
|
8431 |
||
8432 |
glxPolarviewDist: dist azim: azim inc: inc twist: twist in: aGLXWindowId |
|
8433 |
||
8434 |
%{ /* NOCONTEXT */ |
|
8435 |
Coord c_dist; |
|
8436 |
Angle a_azim, a_inc, a_twist; |
|
8437 |
||
8438 |
_COORD_(dist, c_dist) |
|
8439 |
_ANGLE_(azim, a_azim) |
|
8440 |
_ANGLE_(inc, a_inc) |
|
8441 |
_ANGLE_(twist, a_twist) |
|
8442 |
SETWIN(aGLXWindowId) |
|
1932 | 8443 |
#ifdef OPENGL |
8444 |
#else |
|
294 | 8445 |
polarview(c_dist, a_azim, a_inc, a_twist); |
1932 | 8446 |
#endif |
294 | 8447 |
%} |
8448 |
! |
|
8449 |
||
528 | 8450 |
glxPopviewportIn: aGLXWindowId |
8451 |
"pops the top viewport off the viewport stack" |
|
8452 |
||
8453 |
%{ /* NOCONTEXT */ |
|
8454 |
SETWIN(aGLXWindowId) |
|
1932 | 8455 |
#ifdef OPENGL |
8456 |
#else |
|
528 | 8457 |
popviewport(); |
1932 | 8458 |
#endif |
528 | 8459 |
%} |
8460 |
||
8461 |
"Modified: 19.3.1996 / 18:58:24 / cg" |
|
8462 |
! |
|
8463 |
||
8464 |
glxPushviewportIn: aGLXWindowId |
|
8465 |
"pushes the current viewport on the viewport stack" |
|
8466 |
||
8467 |
%{ /* NOCONTEXT */ |
|
8468 |
SETWIN(aGLXWindowId) |
|
1932 | 8469 |
#ifdef OPENGL |
8470 |
#else |
|
528 | 8471 |
pushviewport(); |
1932 | 8472 |
#endif |
528 | 8473 |
%} |
8474 |
||
8475 |
"Modified: 19.3.1996 / 18:58:02 / cg" |
|
8476 |
! |
|
8477 |
||
294 | 8478 |
glxReshapeViewPortIn: aGLXWindowId |
8479 |
||
8480 |
%{ /* NOCONTEXT */ |
|
8481 |
SETWIN(aGLXWindowId) |
|
1932 | 8482 |
#ifdef OPENGL |
8483 |
#else |
|
294 | 8484 |
reshapeviewport(); |
1932 | 8485 |
#endif |
8486 |
%} |
|
294 | 8487 |
! |
8488 |
||
8489 |
glxViewportLeft:left right:right bottom:bottom top:top in:aGLXWindowId |
|
8490 |
||
8491 |
%{ /* NOCONTEXT */ |
|
8492 |
SETWIN(aGLXWindowId) |
|
1932 | 8493 |
#ifdef OPENGL |
8494 |
#else |
|
4718 | 8495 |
viewport(_screencoordVal(left), _screencoordVal(right), |
294 | 8496 |
_screencoordVal(bottom), _screencoordVal(top)); |
1932 | 8497 |
#endif |
294 | 8498 |
%} |
8499 |
! |
|
8500 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8501 |
glxWindowLeft: left right: right bottom: bottom top: top near: znear far: zfar in: aGLXWindowId |
294 | 8502 |
"this one was added independently by JEFF - kept for his programs ..." |
8503 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8504 |
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
|
8505 |
! |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8506 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8507 |
glxWindowLeft:left right:right top:top bottom:bottom near:znear far:zfar in:aGLXWindowId |
294 | 8508 |
"define perspective viewing pyramid" |
8509 |
||
8510 |
%{ /* NOCONTEXT */ |
|
8511 |
Coord c_left, c_right, c_top, c_bot, c_near, c_far; |
|
8512 |
||
8513 |
_COORD_ (left, c_left) |
|
8514 |
_COORD_ (right, c_right) |
|
8515 |
_COORD_ (top, c_top) |
|
8516 |
_COORD_ (bottom, c_bot) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8517 |
_COORD_ (znear, c_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8518 |
_COORD_ (zfar, c_far) |
294 | 8519 |
SETWIN(aGLXWindowId) |
1932 | 8520 |
#ifdef OPENGL |
8521 |
#else |
|
294 | 8522 |
window(c_left, c_right, c_bot, c_top, c_near, c_far); |
1932 | 8523 |
#endif |
294 | 8524 |
%} |
8525 |
! ! |
|
8526 |
||
8527 |
!GLXWorkstation methodsFor:'window control'! |
|
8528 |
||
2045 | 8529 |
glxResizedView:aGLXWindowId width:width height:height |
2048 | 8530 |
"pass down resize info to the GL - this adjusts the viewport. |
8531 |
This only works with VGL or openGL" |
|
8532 |
||
8533 |
%{ /* NOCONTEXT */ |
|
2074 | 8534 |
SETWIN(aGLXWindowId) |
8535 |
#ifdef VGL |
|
2045 | 8536 |
X11_resized(__intVal(width), __intVal(height)); |
8537 |
RETURN (true); |
|
8538 |
#endif |
|
8539 |
%} |
|
8540 |
. |
|
8541 |
^ false |
|
8542 |
! |
|
8543 |
||
294 | 8544 |
glxWinclose:gwid in:aGLXWindowId |
8545 |
||
8546 |
%{ /* NOCONTEXT */ |
|
8547 |
#ifdef GLX |
|
8548 |
SETWIN(aGLXWindowId) |
|
8549 |
winclose(_longVal(gwid)); |
|
8550 |
RETURN (true); |
|
8551 |
#endif |
|
8552 |
%} |
|
8553 |
. |
|
8554 |
^ false |
|
8555 |
! |
|
8556 |
||
8557 |
glxWinconstraintsIn: aGLXWindowId |
|
8558 |
||
8559 |
%{ /* NOCONTEXT */ |
|
8560 |
#ifdef GLX |
|
8561 |
SETWIN(aGLXWindowId) |
|
8562 |
winconstraints(); |
|
8563 |
RETURN (true); |
|
8564 |
#endif |
|
8565 |
%} |
|
8566 |
. |
|
8567 |
^ false |
|
8568 |
! |
|
8569 |
||
8570 |
glxWindepth: gwid in: aGLXWindowId |
|
8571 |
||
8572 |
%{ /* NOCONTEXT */ |
|
8573 |
#ifdef GLX |
|
8574 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
8575 |
RETURN (__MKSMALLINT(windepth(_longVal(gwid)))); |
294 | 8576 |
#endif |
8577 |
%} |
|
8578 |
. |
|
8579 |
^ false |
|
8580 |
! |
|
8581 |
||
8582 |
glxWingetIn: aGLXWindowId |
|
8583 |
||
8584 |
%{ /* NOCONTEXT */ |
|
8585 |
#ifdef GLX |
|
8586 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
8587 |
RETURN (__MKSMALLINT(winget())); |
294 | 8588 |
#endif |
8589 |
%} |
|
8590 |
. |
|
8591 |
^ false |
|
8592 |
! |
|
8593 |
||
8594 |
glxWinmoveX: x y: y in: aGLXWindowId |
|
8595 |
||
8596 |
%{ /* NOCONTEXT */ |
|
8597 |
#ifdef GLX |
|
8598 |
SETWIN(aGLXWindowId) |
|
8599 |
winmove(_longVal(x), _longVal(y)); |
|
8600 |
RETURN (true); |
|
8601 |
#endif |
|
8602 |
%} |
|
8603 |
. |
|
8604 |
^ false |
|
8605 |
! |
|
8606 |
||
8607 |
glxWinpopIn: aGLXWindowId |
|
8608 |
||
8609 |
%{ /* NOCONTEXT */ |
|
8610 |
#ifdef GLX |
|
8611 |
SETWIN(aGLXWindowId) |
|
8612 |
winpop(); |
|
8613 |
RETURN (true); |
|
8614 |
#endif |
|
8615 |
%} |
|
8616 |
. |
|
8617 |
^ false |
|
8618 |
! |
|
8619 |
||
8620 |
glxWinpositionX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
8621 |
||
8622 |
%{ /* NOCONTEXT */ |
|
8623 |
#ifdef GLX |
|
8624 |
SETWIN(aGLXWindowId) |
|
8625 |
winposition(_longVal(x1), _longVal(y1), _longVal(x2), _longVal(y2)); |
|
8626 |
RETURN (true); |
|
8627 |
#endif |
|
8628 |
%} |
|
8629 |
. |
|
8630 |
^ false |
|
8631 |
! |
|
8632 |
||
8633 |
glxWinpushIn: aGLXWindowId |
|
8634 |
||
8635 |
%{ /* NOCONTEXT */ |
|
8636 |
#ifdef GLX |
|
8637 |
SETWIN(aGLXWindowId) |
|
8638 |
winpush(); |
|
8639 |
RETURN (true); |
|
8640 |
#endif |
|
8641 |
%} |
|
8642 |
. |
|
8643 |
^ false |
|
8644 |
! |
|
8645 |
||
8646 |
glxWinset: gwid in: aGLXWindowId |
|
8647 |
||
8648 |
%{ /* NOCONTEXT */ |
|
8649 |
#ifdef GLX |
|
8650 |
SETWIN(aGLXWindowId) |
|
8651 |
winset(_longVal(gwid)); |
|
8652 |
RETURN (true); |
|
8653 |
#endif |
|
8654 |
%} |
|
8655 |
. |
|
8656 |
^ false |
|
8657 |
! ! |
|
8658 |
||
0 | 8659 |
!GLXWorkstation methodsFor:'window creation'! |
8660 |
||
12 | 8661 |
createGLXWindowFor:aView left:xpos top:ypos width:wwidth height:wheight type:glxType |
157 | 8662 |
|ext wsuperView wsuperViewId windowId| |
0 | 8663 |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
8664 |
glOK ifFalse:[^ nil]. |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
8665 |
|
793 | 8666 |
wsuperView := aView superView view. |
0 | 8667 |
wsuperView notNil ifTrue:[ |
8344 | 8668 |
wsuperViewId := wsuperView drawableId |
0 | 8669 |
]. |
8670 |
||
524 | 8671 |
%{ /* CALLSSTACK: 20000 */ |
0 | 8672 |
Display *dpy = myDpy; |
185 | 8673 |
int screen = __intVal(_INST(screen)); |
0 | 8674 |
Window newWindow, parentWindow; |
12 | 8675 |
int t; |
0 | 8676 |
|
97 | 8677 |
if (__isSmallInteger(xpos) && __isSmallInteger(ypos) |
8678 |
&& __isSmallInteger(wwidth) && __isSmallInteger(wheight)) { |
|
8344 | 8679 |
if (__isExternalAddress(wsuperViewId)) { |
8680 |
parentWindow = _WindowVal(wsuperViewId); |
|
8681 |
} else { |
|
8682 |
parentWindow = RootWindow(dpy, screen); |
|
8683 |
} |
|
8684 |
||
8685 |
if (glxType == @symbol(colorIndexSingleBuffer)) |
|
8686 |
t = GLXcolorIndexSingleBuffer; |
|
8687 |
else if (glxType == @symbol(colorIndexDoubleBuffer)) |
|
8688 |
t = GLXcolorIndexDoubleBuffer; |
|
8689 |
else if (glxType == @symbol(rgbSingleBuffer)) |
|
8690 |
t = GLXrgbSingleBuffer; |
|
8691 |
else if (glxType == @symbol(rgbDoubleBuffer)) |
|
8692 |
t = GLXrgbDoubleBuffer; |
|
8693 |
else { |
|
8694 |
RETURN ( nil ); |
|
8695 |
} |
|
8696 |
||
8697 |
ENTERGLX; |
|
8698 |
newWindow = __GLXCreateWindow(dpy, parentWindow, |
|
8699 |
__intVal(xpos), __intVal(ypos), |
|
8700 |
__intVal(wwidth), __intVal(wheight), |
|
8701 |
0, t); |
|
8702 |
LEAVEGLX; |
|
8703 |
||
8704 |
if (! newWindow) { |
|
8705 |
RETURN ( nil ); |
|
8706 |
} |
|
8707 |
||
8708 |
windowId = __MKOBJ(newWindow); |
|
0 | 8709 |
} |
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
8710 |
%}. |
0 | 8711 |
windowId notNil ifTrue:[ |
8344 | 8712 |
self addKnownView:aView withId:windowId. |
0 | 8713 |
]. |
8714 |
^ windowId |
|
8344 | 8715 |
|
8716 |
"Modified: / 26-04-2018 / 11:03:08 / stefan" |
|
20 | 8717 |
! |
8718 |
||
8719 |
unlinkGLXView:aGLXWindowId |
|
8720 |
"remove X/GLX link" |
|
524 | 8721 |
|
8722 |
%{ /* CALLSSTACK: 20000 */ |
|
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
8723 |
if (__isExternalAddress(aGLXWindowId)) { |
134 | 8724 |
ENTERGLX; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8725 |
__GLXUnlinkWindow(myDpy, _WindowVal(aGLXWindowId)); |
134 | 8726 |
LEAVEGLX; |
8727 |
} |
|
20 | 8728 |
%} |
0 | 8729 |
! ! |
8730 |
||
294 | 8731 |
!GLXWorkstation methodsFor:'zbuffer'! |
8732 |
||
8733 |
glxZbsize: planes in: aGLXWindowId |
|
127 | 8734 |
|
8735 |
%{ /* NOCONTEXT */ |
|
8736 |
#ifdef FULL_GLX |
|
8737 |
SETWIN(aGLXWindowId) |
|
294 | 8738 |
zbsize(_longVal(planes)); |
8739 |
RETURN (true); |
|
8740 |
#endif |
|
8741 |
%} |
|
8742 |
. |
|
8743 |
^ false |
|
8744 |
! |
|
64 | 8745 |
|
8746 |
glxZbuffer:aBoolean in:aGLXWindowId |
|
8747 |
"enable/disable z-buffer operation" |
|
8748 |
||
8749 |
%{ /* NOCONTEXT */ |
|
8750 |
#ifdef GLX |
|
8751 |
SETWIN(aGLXWindowId) |
|
8752 |
zbuffer(aBoolean == false ? FALSE : TRUE); |
|
8753 |
RETURN (true); |
|
8754 |
#endif |
|
8755 |
%} |
|
8756 |
. |
|
8757 |
^ false |
|
294 | 8758 |
! |
64 | 8759 |
|
8760 |
glxZdraw: b in: aGLXWindowId |
|
8761 |
"enable/disable drawing into the z-buffer" |
|
8762 |
||
8763 |
%{ /* NOCONTEXT */ |
|
8764 |
#ifdef GLX |
|
8765 |
SETWIN(aGLXWindowId) |
|
8766 |
zdraw(_booleanVal(b)); |
|
8767 |
RETURN (true); |
|
8768 |
#endif |
|
8769 |
%} |
|
8770 |
. |
|
8771 |
^ false |
|
294 | 8772 |
! |
64 | 8773 |
|
8774 |
glxZfunction: func in: aGLXWindowId |
|
8775 |
"set the z-buffer comparison function. |
|
8776 |
func may be either the numeric value or a symbol (preferred)" |
|
8777 |
||
8778 |
%{ /* NOCONTEXT */ |
|
8779 |
#ifdef GLX |
|
8780 |
long f; |
|
8781 |
||
8782 |
SETWIN(aGLXWindowId) |
|
8783 |
if (func == @symbol(NEVER)) |
|
77 | 8784 |
f = ZF_NEVER; |
64 | 8785 |
else if (func == @symbol(LESS)) |
77 | 8786 |
f = ZF_LESS; |
64 | 8787 |
else if (func == @symbol(EQUAL)) |
77 | 8788 |
f = ZF_EQUAL; |
64 | 8789 |
else if (func == @symbol(LEQUAL)) |
77 | 8790 |
f = ZF_LEQUAL; |
64 | 8791 |
else if (func == @symbol(GREATER)) |
77 | 8792 |
f = ZF_GREATER; |
64 | 8793 |
else if (func == @symbol(NOTEQUAL)) |
77 | 8794 |
f = ZF_NOTEQUAL; |
64 | 8795 |
else if (func == @symbol(GEQUAL)) |
77 | 8796 |
f = ZF_GEQUAL; |
64 | 8797 |
else if (func == @symbol(ALWAYS)) |
77 | 8798 |
f = ZF_ALWAYS; |
64 | 8799 |
else |
77 | 8800 |
f = _longVal(func); |
64 | 8801 |
zfunction(f); |
8802 |
RETURN (true); |
|
8803 |
#endif |
|
8804 |
%} |
|
8805 |
. |
|
8806 |
^ false |
|
294 | 8807 |
! |
64 | 8808 |
|
8809 |
glxZsource: src in: aGLXWindowId |
|
8810 |
||
8811 |
%{ /* NOCONTEXT */ |
|
8812 |
#ifdef GLX |
|
8813 |
SETWIN(aGLXWindowId) |
|
8814 |
zsource(_longVal(src)); |
|
8815 |
RETURN (true); |
|
8816 |
#endif |
|
8817 |
%} |
|
8818 |
. |
|
8819 |
^ false |
|
294 | 8820 |
! |
64 | 8821 |
|
8822 |
glxZwritemask: mask in: aGLXWindowId |
|
8823 |
||
8824 |
%{ /* NOCONTEXT */ |
|
8825 |
#ifdef GLX |
|
8826 |
SETWIN(aGLXWindowId) |
|
185 | 8827 |
zwritemask((ulong)__intVal(mask)); |
64 | 8828 |
RETURN (true); |
8829 |
#endif |
|
8830 |
%} |
|
8831 |
. |
|
8832 |
^ false |
|
8833 |
! ! |
|
8834 |
||
294 | 8835 |
!GLXWorkstation class methodsFor:'documentation'! |
8836 |
||
8837 |
version |
|
6978 | 8838 |
^ '$Header$' |
5479
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
8839 |
! |
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
8840 |
|
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
8841 |
version_CVS |
6978 | 8842 |
^ '$Header$' |
89 | 8843 |
! ! |
7656 | 8844 |