author | Claus Gittinger <cg@exept.de> |
Thu, 18 Jan 2018 17:17:05 +0100 | |
changeset 8259 | 9328dbbffcb9 |
parent 7893 | 3af8d2fd463b |
child 8344 | 7b3549ff623f |
permissions | -rw-r--r-- |
0 | 1 |
" |
614 | 2 |
COPYRIGHT (c) 1993 by Claus Gittinger |
77 | 3 |
All Rights Reserved |
0 | 4 |
|
5 |
This software is furnished under a license and may be used |
|
6 |
only in accordance with the terms of that license and with the |
|
7 |
inclusion of the above copyright notice. This software may not |
|
8 |
be provided or otherwise made available to, or used by, any |
|
9 |
other person. No title to or ownership of the software is |
|
10 |
hereby transferred. |
|
11 |
" |
|
3214 | 12 |
"{ Package: 'stx:libview' }" |
13 |
||
7656 | 14 |
"{ NameSpace: Smalltalk }" |
15 |
||
0 | 16 |
XWorkstation subclass:#GLXWorkstation |
528 | 17 |
instanceVariableNames:'activeWindow hasStereoExtension glOK' |
18 |
classVariableNames:'ForceGL' |
|
19 |
poolDictionaries:'' |
|
20 |
category:'Interface-Graphics' |
|
294 | 21 |
! |
77 | 22 |
|
89 | 23 |
!GLXWorkstation primitiveDefinitions! |
0 | 24 |
%{ |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
25 |
#include "stxOSDefs.h" |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
26 |
|
24 | 27 |
/* |
28 |
* on SGI, this class is compiled with -DGLX, while |
|
29 | 29 |
* for simulation (using vogl), this is compiled with -DVGL |
4718 | 30 |
* |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
31 |
* New note: starting to support openGL (tm) (compile with -DOPENGL) |
1932 | 32 |
* or its simulation (compile with -DMESA) |
24 | 33 |
*/ |
29 | 34 |
|
0 | 35 |
/* |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
36 |
* SAD, SAD: |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
37 |
* 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
|
38 |
* some include the functions below, others dont. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
39 |
* To avoid getting undefined symbol errors when linking, these |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
40 |
* functions are not included by default. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
41 |
* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
42 |
* 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
|
43 |
* the following: |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
44 |
* |
46 | 45 |
* blendcolor getgconfig getmultisample leftbuffer rightbuffer monobuffer |
46 |
* msalpha msmask mspattern mssize multisample stereobuffer |
|
47 |
* t3s t3i t3f t3d t4s t4i t4f t4d tlutbind zbsize |
|
48 |
* |
|
49 |
* these are not available on all gl's |
|
50 |
*/ |
|
51 |
||
1932 | 52 |
#ifdef GLX |
46 | 53 |
/* #define FULL_GLX */ |
1932 | 54 |
#endif |
46 | 55 |
|
56 |
/* |
|
554
34cc776bcc0f
compilable with String/Object definition
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
57 |
* 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
|
58 |
* ... and xlib defines True and False |
554
34cc776bcc0f
compilable with String/Object definition
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
59 |
* It might be a better idea, to completely separate GLX stuff from ST/X |
0 | 60 |
*/ |
1899 | 61 |
#ifdef String |
62 |
# undef String |
|
63 |
#endif |
|
64 |
#define String GLX_String |
|
65 |
||
66 |
#ifdef Object |
|
67 |
# undef Object |
|
68 |
#endif |
|
69 |
#define Object GLX_Object |
|
70 |
||
71 |
#undef True |
|
72 |
#undef False |
|
73 |
||
2768 | 74 |
#ifdef Time |
75 |
# undef Time |
|
76 |
#endif |
|
77 |
#define Time X_Time |
|
78 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
79 |
|
1899 | 80 |
#ifdef __VMS__ |
81 |
# include "vms_Xnames.h" |
|
82 |
#endif |
|
24 | 83 |
|
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
84 |
#ifdef __arm__ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
85 |
// # define _POSIX_C_SOURCE |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
86 |
#endif |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
87 |
|
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
88 |
#ifndef _STDIO_H_INCLUDED_ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
89 |
# include <stdio.h> |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
90 |
# define _STDIO_H_INCLUDED_ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
91 |
#endif |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
92 |
|
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
93 |
#ifdef __arm__ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
94 |
# ifndef _SYS_TYPES_H_INCLUDED_ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
95 |
# include <sys/types.h> |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
96 |
# define _SYS_TYPES_H_INCLUDED_ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
97 |
# endif |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
98 |
# ifndef _SYS_SIGNAL_H_INCLUDED_ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
99 |
# include <sys/signal.h> |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
100 |
# define _SYS_SIGNAL_H_INCLUDED_ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
101 |
# endif |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
102 |
|
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 |
|
6254 | 105 |
#ifdef __osx__ |
106 |
# include <sys/signal.h> |
|
107 |
# define DYNAMICALLY_LOADABLE |
|
108 |
#endif |
|
168 | 109 |
|
1932 | 110 |
#ifndef OPENGL |
111 |
# ifdef MESA |
|
112 |
# define OPENGL |
|
113 |
# endif |
|
114 |
#endif |
|
115 |
||
6978 | 116 |
#ifdef OPENGL /* SGI or other's OPENGL library */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
117 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
118 |
# include "GL/gl.h" |
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 |
# ifdef MESA /* GNU MESA openGL simulation */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
121 |
# include "GL/xmesa.h" |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
122 |
# define OPENGLCONTEXT XMesaContext |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
123 |
# define GLXMAKECURRENT(dpy, draw, con) XMesaMakeCurrent(con) |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
124 |
# else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
125 |
/* 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
|
126 |
# define OPENGLCONTEXT GLXContext |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
127 |
# 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
|
128 |
# endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
129 |
|
24 | 130 |
#else |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
131 |
|
6978 | 132 |
# ifdef GLX /* SGI's native GL library */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
133 |
# include <gl/glws.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
134 |
# include <gl/sphere.h> |
6978 | 135 |
# else /* VOGL GL subset simulation */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
136 |
# undef memset |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
137 |
# include <vogl.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
138 |
# undef move |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
139 |
# include <X11/Xlib.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
140 |
# endif |
24 | 141 |
#endif |
0 | 142 |
|
185 | 143 |
/* |
144 |
* XSGIStereo extension - if available |
|
145 |
*/ |
|
146 |
#ifdef XSGIStereo |
|
147 |
# include <X11/extensions/SGIStereo.h> |
|
148 |
#endif |
|
149 |
||
35 | 150 |
#ifndef NULL |
58 | 151 |
# define NULL (char *)0 /* sigh */ |
35 | 152 |
#endif |
153 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
154 |
|
0 | 155 |
typedef enum { |
156 |
GLXcolorIndexSingleBuffer, |
|
157 |
GLXcolorIndexDoubleBuffer, |
|
158 |
GLXrgbSingleBuffer, |
|
159 |
GLXrgbDoubleBuffer |
|
160 |
} GLXWindowType; |
|
161 |
||
333 | 162 |
# define ENTERGLX __BEGIN_PROTECT_REGISTERS__ |
163 |
# define LEAVEGLX __END_PROTECT_REGISTERS__ |
|
134 | 164 |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
165 |
/* |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
166 |
* 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
|
167 |
*/ |
0 | 168 |
#undef String |
969 | 169 |
#ifdef __DEF_String |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
170 |
# define String __DEF_String |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
171 |
#endif |
969 | 172 |
#undef Object |
173 |
#ifdef __DEF_Object |
|
174 |
# define Object __DEF_Object |
|
175 |
#endif |
|
0 | 176 |
|
177 |
/* |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
178 |
* mhmh - openGL has its separate gl-context, |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
179 |
* which is distinct (?) from the windowID. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
180 |
* We dont want to add another instvar to View - do we ? |
0 | 181 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
182 |
#if defined(OPENGL) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
183 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
184 |
# ifndef MAX_OPENGL_VIEWS |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
185 |
# define MAX_OPENGL_VIEWS 50 |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
186 |
# endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
187 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
188 |
struct windowIDToGLContextMapping { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
189 |
Window win; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
190 |
OPENGLCONTEXT con; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
191 |
}; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
192 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
193 |
static struct windowIDToGLContextMapping windowIDToGLContextMapping[MAX_OPENGL_VIEWS]; |
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 OPENGLCONTEXT |
4718 | 196 |
__glxWindowIdToGLContext(xId) |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
197 |
Window xId; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
198 |
{ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
199 |
int i; |
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 |
for (i=0; i<MAX_OPENGL_VIEWS; i++) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
202 |
if (windowIDToGLContextMapping[i].win == xId) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
203 |
return windowIDToGLContextMapping[i].con; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
204 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
205 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
206 |
return (OPENGLCONTEXT) 0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
207 |
} |
0 | 208 |
|
157 | 209 |
/* |
210 |
* set the GLXWindow for followup drawing |
|
211 |
*/ |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
212 |
#define SETWIN(aGLXWindowId) \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
213 |
{ \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
214 |
OPENGLCONTEXT context; \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
215 |
\ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
216 |
if (_INST(activeWindow) != aGLXWindowId) { \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
217 |
if (! ISCONNECTED ) { \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
218 |
RETURN (false); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
219 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
220 |
if (! __isExternalAddress(aGLXWindowId)) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
221 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
222 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
223 |
context = (OPENGLCONTEXT) __glxWindowIdToGLContext(_WindowVal(aGLXWindowId)); \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
224 |
if (! context) { \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
225 |
RETURN (false); \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
226 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
227 |
GLXMAKECURRENT(myDpy, _WindowVal(aGLXWindowId), context ); \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
228 |
_INST(activeWindow) = aGLXWindowId; \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
229 |
__STORE(self, aGLXWindowId); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
230 |
} else { \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
231 |
if (aGLXWindowId == nil) { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
232 |
RETURN (false); \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
233 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
234 |
} \ |
12 | 235 |
} |
236 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
237 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
238 |
#else /* old GL */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
239 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
240 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
241 |
* set the GLXWindow for followup drawing |
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 |
#define SETWIN(aGLXWindowId) \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
244 |
{ \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
245 |
if (_INST(activeWindow) != aGLXWindowId) { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
246 |
if (! ISCONNECTED ) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
247 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
248 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
249 |
if (! __isExternalAddress(aGLXWindowId)) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
250 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
251 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
252 |
if (GLXwinset(myDpy, _WindowVal(aGLXWindowId)) < 0) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
253 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
254 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
255 |
_INST(activeWindow) = aGLXWindowId; \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
256 |
__STORE(self, aGLXWindowId); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
257 |
} else { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
258 |
if (aGLXWindowId == nil) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
259 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
260 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
261 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
262 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
263 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
264 |
#endif /* old GL */ |
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 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
267 |
* some defines - tired of typing ... |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
268 |
* 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
|
269 |
* put/pack them into corresponding c variables. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
270 |
* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
271 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
272 |
#ifdef OPENGL |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
273 |
# define Boolean int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
274 |
# define TRUE 1 |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
275 |
# define FALSE 0 |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
276 |
# define Coord float |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
277 |
# define Icoord int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
278 |
# define Scoord int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
279 |
# define Colorindex int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
280 |
# define Linestyle int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
281 |
# define Offset int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
282 |
# define Angle int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
283 |
# define Screencoord int |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
284 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
285 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
286 |
#define myDpy (Display *)(__MKCP(_INST(displayId))) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
287 |
#define ISCONNECTED (_INST(displayId) != nil) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
288 |
#define _WindowVal(o) (Window)(__MKCP(o)) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
289 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
290 |
#define __MKBOOLEAN(b) ((b==FALSE) ? false : true) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
291 |
#define _booleanVal(b) ((b==false) ? (Boolean)FALSE : (Boolean)TRUE) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
292 |
#define _coordVal(c) ((__isFloat(c)) ? (Coord)(_floatVal(c)) : (Coord)(__intVal(c))) |
185 | 293 |
#define _icoordVal(c) ((Icoord)(__intVal(c))) |
294 |
#define _scoordVal(c) ((Scoord)(__intVal(c))) |
|
295 |
#define _screencoordVal(c) ((Screencoord)(__intVal(c))) |
|
296 |
#define _colorindexVal(c) ((Colorindex)(__intVal(c))) |
|
297 |
#define _linestyleVal(l) ((Linestyle)(__intVal(l))) |
|
298 |
#define _shortVal(l) ((short)(__intVal(l))) |
|
299 |
#define _longVal(l) ((long)(__intVal(l))) |
|
300 |
#define _deviceVal(l) ((Device)(__intVal(l))) |
|
301 |
#define _tagVal(l) ((Tag)(__intVal(l))) |
|
969 | 302 |
#define _objectVal(l) ((GLX_Object)(__intVal(l))) |
185 | 303 |
#define _offsetVal(l) ((Offset)(__intVal(l))) |
304 |
#define _rgbVal(l) ((RGBvalue)(__intVal(l))) |
|
305 |
#define _angleVal(c) ((Angle)(__intVal(c))) |
|
157 | 306 |
|
29 | 307 |
/* |
308 |
* 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
|
309 |
* ST-object must be true or false. Return from method if invalid. |
29 | 310 |
*/ |
311 |
#define _BOOLEAN_(arg, dst) \ |
|
30 | 312 |
if (arg==true) \ |
77 | 313 |
dst = (Boolean)TRUE; \ |
30 | 314 |
else if (arg==false) \ |
77 | 315 |
dst = (Boolean)FALSE; \ |
29 | 316 |
else { RETURN(false); } |
317 |
||
318 |
/* |
|
319 |
* check for and fetch a coord from ST-arg into C-dst |
|
157 | 320 |
* ST-object must be Float, SmallInteger or Fraction. |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
321 |
* Return from method if invalid. |
29 | 322 |
*/ |
0 | 323 |
#define _COORD_(arg, dst) \ |
97 | 324 |
if (__isFloat(arg)) \ |
77 | 325 |
dst = (Coord)(_floatVal(arg)); \ |
97 | 326 |
else if (__isSmallInteger(arg)) \ |
185 | 327 |
dst = (Coord)(__intVal(arg)); \ |
97 | 328 |
else if (__isFraction(arg) \ |
329 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_numerator) \ |
|
330 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_denominator)) { \ |
|
77 | 331 |
float n, d; \ |
332 |
\ |
|
185 | 333 |
n = (float)(__intVal(_FractionInstPtr(arg)->f_numerator)); \ |
334 |
d = (float)(__intVal(_FractionInstPtr(arg)->f_denominator)); \ |
|
77 | 335 |
dst = (Coord)(n / d); \ |
29 | 336 |
} else { RETURN(false); } |
337 |
||
338 |
/* |
|
339 |
* check for and fetch an icoord from ST-arg into C-dst |
|
4718 | 340 |
* ST-object must be SmallInteger. Return from method if invalid. |
29 | 341 |
*/ |
342 |
#define _ICOORD_(arg, dst) \ |
|
97 | 343 |
if (__isSmallInteger(arg)) \ |
185 | 344 |
dst = (Icoord)(__intVal(arg)); \ |
29 | 345 |
else { RETURN(false); } |
346 |
||
347 |
/* |
|
157 | 348 |
* check for and fetch an scoord from ST-arg into C-dst |
4718 | 349 |
* ST-object must be SmallInteger. Return from method if invalid. |
29 | 350 |
*/ |
351 |
#define _SCOORD_(arg, dst) \ |
|
97 | 352 |
if (__isSmallInteger(arg)) \ |
185 | 353 |
dst = (Scoord)(__intVal(arg)); \ |
29 | 354 |
else { RETURN(false); } |
355 |
||
356 |
#define _SCREENCOORD_(arg, dst) \ |
|
97 | 357 |
if (__isSmallInteger(arg)) \ |
185 | 358 |
dst = (Screencoord)(__intVal(arg)); \ |
29 | 359 |
else { RETURN(false); } |
360 |
||
361 |
#define _COLORINDEX_(arg, dst) \ |
|
97 | 362 |
if (__isSmallInteger(arg)) \ |
185 | 363 |
dst = (Colorindex)(__intVal(arg)); \ |
29 | 364 |
else { RETURN(false); } |
365 |
||
366 |
#define _ANGLE_(arg, dst) \ |
|
97 | 367 |
if (__isSmallInteger(arg)) \ |
185 | 368 |
dst = (Angle)(__intVal(arg)); \ |
29 | 369 |
else { RETURN(false); } |
0 | 370 |
|
371 |
#define _FLOAT_(arg, dst) \ |
|
97 | 372 |
if (__isFloat(arg)) \ |
77 | 373 |
dst = (float)(_floatVal(arg)); \ |
97 | 374 |
else if (__isSmallInteger(arg)) \ |
185 | 375 |
dst = (float)(__intVal(arg)); \ |
97 | 376 |
else if (__isFraction(arg) \ |
377 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_numerator) \ |
|
378 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_denominator)) { \ |
|
77 | 379 |
float n, d; \ |
380 |
\ |
|
185 | 381 |
n = (float)(__intVal(_FractionInstPtr(arg)->f_numerator)); \ |
382 |
d = (float)(__intVal(_FractionInstPtr(arg)->f_denominator)); \ |
|
77 | 383 |
dst = (float)(n / d); \ |
29 | 384 |
} else { RETURN(false); } |
0 | 385 |
|
386 |
#define _INT_(arg, dst) \ |
|
97 | 387 |
if (__isSmallInteger(arg)) \ |
185 | 388 |
dst = (int)(__intVal(arg)); \ |
29 | 389 |
else { RETURN(false); } |
390 |
||
30 | 391 |
#define _indexedArea(object) \ |
392 |
(((char *) (_InstPtr(object))) \ |
|
77 | 393 |
+ OHDR_SIZE \ |
185 | 394 |
+ (__intVal(_ClassInstPtr(__qClass(object))->c_ninstvars)) * sizeof(OBJ)) |
77 | 395 |
%} |
396 |
! ! |
|
397 |
||
168 | 398 |
!GLXWorkstation primitiveVariables! |
399 |
%{ |
|
400 |
/* |
|
401 |
* remembered info from private error handler |
|
402 |
*/ |
|
4164
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
403 |
static char lastErrorMsg[128] = ""; |
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
404 |
static unsigned INT lastRequestCode = 0; |
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
405 |
static unsigned INT lastMinorCode = 0; |
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
406 |
static unsigned INT lastResource = 0; |
168 | 407 |
|
408 |
%} |
|
409 |
! ! |
|
410 |
||
89 | 411 |
!GLXWorkstation primitiveFunctions! |
77 | 412 |
%{ |
151 | 413 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
414 |
#ifdef DYNAMICALLY_LOADABLE |
168 | 415 |
/* |
416 |
* catch X-errors and forward as errorInterrupt:#DisplayError, |
|
4251 | 417 |
* (which itself invokes my handler and optionally raises an exception) |
168 | 418 |
* the implementation below is somewhat wrong: it will |
419 |
* report all errors for Display, even though there could be |
|
420 |
* more than one display connection. (being fixed, new errorInterrupt mechanism |
|
421 |
* allows passing an additional argument, which is the displayID ...) |
|
422 |
* |
|
4251 | 423 |
* this duplicates the functionality as found in XWorkstation; |
168 | 424 |
* the reason is to allow dynamic loading systems to load this module |
425 |
* before XWorkstation (which was not possible otherwise, due to unresolved |
|
426 |
* external references while loading this one) |
|
427 |
*/ |
|
428 |
static |
|
429 |
__XErrorHandler__(dpy, event) |
|
430 |
Display *dpy; |
|
431 |
XErrorEvent *event; |
|
432 |
{ |
|
433 |
XGetErrorText(dpy, event->error_code, lastErrorMsg, 80); |
|
434 |
if (lastErrorMsg[0] == '\0') { |
|
4718 | 435 |
sprintf(lastErrorMsg, "code: %d", event->error_code); |
168 | 436 |
} |
437 |
lastRequestCode = event->request_code; |
|
438 |
lastMinorCode = event->minor_code; |
|
439 |
lastResource = event->resourceid; |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
440 |
if ((event->error_code == BadWindow) && (lastRequestCode == 4) && (lastMinorCode == 0)) { |
4718 | 441 |
/* |
442 |
* this is a BadWindow error for X_DestroyWindow. |
|
443 |
* ignore it here, since it results from the GC freeing windows |
|
444 |
* in non bottom-up window order. |
|
445 |
*/ |
|
446 |
return 0; |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
447 |
} |
168 | 448 |
|
218
10072d9beba5
can now turn off Xlib error messages from the errorHandler
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
449 |
if (@global(ErrorPrinting) == true) { |
4718 | 450 |
console_fprintf(stderr, "GLXWORKSTAT: x-error caught maj=%d (0x%x) min=%d (0x%x) resource=%x\n", |
451 |
event->request_code, event->request_code, |
|
452 |
event->minor_code, event->minor_code, event->resourceid); |
|
453 |
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
|
454 |
} |
168 | 455 |
|
207
9124817bbb03
use new c-pointer wrapper macros (based on externalAddress)
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
456 |
__errorInterruptWithIDAndParameter__(@symbol(DisplayError), __MKOBJ(dpy)); |
168 | 457 |
return 0; |
458 |
} |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
459 |
#else |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
460 |
extern __XErrorHandler__(); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
461 |
#endif |
168 | 462 |
|
4718 | 463 |
/* |
151 | 464 |
* begin moved from GLXsupport.c |
465 |
*/ |
|
466 |
||
467 |
/* |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
468 |
* This provides a helper function "GLXCreateWindow", which does |
4718 | 469 |
* all the necessary magic to create an X window suitable for GL drawing |
470 |
* to take place within. See the definition of GLXCreateWindow for a |
|
151 | 471 |
* description of how to call it. |
472 |
* |
|
473 |
* claus: I really had no time to look into all this, |
|
474 |
* this file has been just copied from a 4Dgifts demo .. |
|
475 |
* (will need more than a day to show more ...) |
|
476 |
*/ |
|
1932 | 477 |
#if !defined(OPENGL) |
151 | 478 |
|
1899 | 479 |
# include <X11/Xlib.h> |
480 |
# include <X11/Xutil.h> |
|
481 |
# ifndef VGL |
|
4718 | 482 |
# include <gl/glws.h> |
1899 | 483 |
# endif |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
484 |
# ifndef _SIGNAL_H_INCLUDED_ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
485 |
# include <signal.h> |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
486 |
# endif |
1899 | 487 |
# include <setjmp.h> |
488 |
# include "stcIntern.h" |
|
151 | 489 |
|
490 |
/* |
|
491 |
* glxhelper.h: |
|
492 |
* |
|
493 |
* List of drawing modes supported by GLXCreateWindow (in glxhelper.c). |
|
4718 | 494 |
* More than this are possible with mixed model, but this is just an |
495 |
* example. You can either expand this list (and the corresponding code in |
|
496 |
* GLXCreateWindow) or call the mixed model calls yourself, using |
|
151 | 497 |
* GLXCreateWindow as an example. |
498 |
*/ |
|
499 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
500 |
static char * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
501 |
typeToName[] = { |
151 | 502 |
"color index single buffer", |
503 |
"color index double buffer", |
|
504 |
"rgb single buffer", |
|
505 |
"rgb double buffer", |
|
506 |
}; |
|
507 |
||
1932 | 508 |
#endif /* GLX || VGL */ |
509 |
||
510 |
#if defined(GLX) && !defined(VGL) |
|
151 | 511 |
/* |
512 |
* Dorky little helper function used to build up a GLXconfig array. |
|
513 |
*/ |
|
514 |
||
4718 | 515 |
static void |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
516 |
set_entry (GLXconfig* ptr, int b, int m, int a) |
151 | 517 |
{ |
518 |
ptr->buffer = b; |
|
519 |
ptr->mode = m; |
|
520 |
ptr->arg = a; |
|
521 |
} |
|
1932 | 522 |
#endif /* GLX & not VGL */ |
151 | 523 |
|
4711 | 524 |
static stx_jmp_buf errorReturn; |
151 | 525 |
|
526 |
static void |
|
527 |
glAbort() { |
|
6002 | 528 |
stx_longjmp(errorReturn, 1); |
151 | 529 |
} |
530 |
||
531 |
/* |
|
532 |
* GLXCreateWindow(dpy, parent, x, y, w, h, boderWidth, type) |
|
533 |
* |
|
534 |
* Return value is the X window id of the newly created window. |
|
535 |
* |
|
536 |
* Arguments are: |
|
537 |
* dpy The X "Display*" returned by XOpenDisplay |
|
538 |
* parent The parent of the newly created window, |
|
539 |
* a typical value for this is |
|
540 |
* RootWindow(dpy, DefaultScreen(dpy)) |
|
541 |
* x,y The location of the window to be created, |
|
542 |
* y coordinate is measured from the top down. |
|
543 |
* w,h size of the new window |
|
544 |
* borderWidth the X border size for this window, should probably |
|
545 |
* be zero. |
|
546 |
* type the GLXWindowType (see glxhelper.h) desribing the |
|
547 |
* typer of GL drawing to be done in this window |
|
548 |
*/ |
|
4718 | 549 |
Window |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
550 |
__GLXCreateWindow(dpy, parent, x, y, w, h, borderWidth, type) |
151 | 551 |
Display* dpy; |
552 |
Window parent; |
|
553 |
GLXWindowType type; |
|
554 |
{ |
|
1932 | 555 |
#if !defined(OPENGL) |
556 |
# ifndef VGL |
|
151 | 557 |
GLXconfig params[50]; |
558 |
GLXconfig* next; |
|
559 |
GLXconfig* retconfig; |
|
560 |
Colormap cmap = DefaultColormap(dpy, DefaultScreen(dpy)); |
|
1932 | 561 |
# endif |
562 |
#endif |
|
563 |
Visual visual; |
|
151 | 564 |
XVisualInfo *vis; |
565 |
XVisualInfo template; |
|
566 |
XColor white; |
|
567 |
XSetWindowAttributes cwa; |
|
568 |
XWindowAttributes pwa; |
|
569 |
int scr, i, nret; |
|
570 |
Window win; |
|
1932 | 571 |
#ifdef HAS_SIGACTION |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
572 |
struct sigaction oldSigSegv, newSigSegv; |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
573 |
#else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
574 |
void *oldSigSegv; |
1932 | 575 |
#endif |
576 |
||
577 |
#if !defined(OPENGL) |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
578 |
__catchExit(1); |
1932 | 579 |
#endif |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
580 |
|
6002 | 581 |
if (stx_setjmp(errorReturn)) { |
4718 | 582 |
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
|
583 |
#ifdef SIGSEGV |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
584 |
# ifdef HAS_SIGACTION |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
585 |
sigaction(SIGSEGV, &oldSigSegv, 0); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
586 |
# else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
587 |
signal(SIGSEGV, oldSigSegv); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
588 |
# endif |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
589 |
#endif |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
590 |
|
1932 | 591 |
#if !defined(OPENGL) |
4718 | 592 |
__catchExit(0); |
593 |
#endif |
|
594 |
return 0; |
|
151 | 595 |
} |
596 |
__CONT__ |
|
597 |
||
1932 | 598 |
if (w <= 0) { |
4718 | 599 |
console_fprintf(stderr, "GL: bad width: %d\n", w); |
600 |
w = 1; |
|
1932 | 601 |
} |
602 |
if (h <= 0) { |
|
4718 | 603 |
console_fprintf(stderr, "GL: bad height: %d\n", h); |
604 |
h = 1; |
|
1932 | 605 |
} |
606 |
||
607 |
#if !defined(OPENGL) |
|
1899 | 608 |
# ifdef VGL |
151 | 609 |
/* |
610 |
* I know what VGL supports; its somewhat unclean to hard code it here |
|
611 |
*/ |
|
612 |
switch (type) { |
|
613 |
case GLXcolorIndexSingleBuffer: |
|
614 |
case GLXcolorIndexDoubleBuffer: |
|
4718 | 615 |
break; |
151 | 616 |
|
617 |
case GLXrgbSingleBuffer: |
|
618 |
case GLXrgbDoubleBuffer: |
|
4718 | 619 |
console_fprintf(stderr, "Sorry, VGL can't support %s type of windows\n", typeToName[type]); |
620 |
__catchExit(0); |
|
621 |
return 0; |
|
151 | 622 |
} |
623 |
||
624 |
scr = DefaultScreen(dpy); |
|
625 |
visual.visualid = CopyFromParent; |
|
626 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
627 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
4718 | 628 |
borderWidth, DisplayPlanes(dpy, scr), |
629 |
InputOutput, &visual, |
|
630 |
CWBorderPixel, &cwa); |
|
151 | 631 |
|
632 |
/* |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
633 |
* on some, seg-violations occur in the GL, if too many |
151 | 634 |
* views are created ... just to make certain, we catch those |
635 |
* in GL too. |
|
636 |
*/ |
|
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
637 |
# ifdef SIGSEGV |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
638 |
# ifdef HAS_SIGACTION |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
639 |
sigaction(SIGSEGV, (struct sigaction *)0, &oldSigSegv); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
640 |
newSigSegv = oldSigSegv; |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
641 |
newSigSegv.sa_handler = glAbort; |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
642 |
sigaction(SIGSEGV, &newSigSegv, (struct sigaction *)0); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
643 |
# else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
644 |
oldSigSegv = signal(SIGSEGV, glAbort); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
645 |
# endif |
1899 | 646 |
# endif |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
647 |
|
151 | 648 |
i = GLXlink(dpy, win); |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
649 |
|
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
650 |
# ifdef SIGSEGV |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
651 |
# ifdef HAS_SIGACTION |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
652 |
sigaction(SIGSEGV, &oldSigSegv, (struct sigaction *)0); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
653 |
# else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
654 |
signal(SIGSEGV, oldSigSegv); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
655 |
# endif |
1899 | 656 |
# endif |
151 | 657 |
|
658 |
if (i < 0) { |
|
4718 | 659 |
console_fprintf(stderr, "GLXlink returned %d\n", i); |
660 |
__catchExit(0); |
|
661 |
return 0; |
|
151 | 662 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
663 |
|
1899 | 664 |
# else /* not VGL */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
665 |
|
151 | 666 |
/* |
667 |
* This builds an array in "params" that describes for GLXgetconfig(3G) |
|
668 |
* the type of GL drawing that will be done. |
|
669 |
*/ |
|
670 |
next = params; |
|
671 |
switch (type) { |
|
672 |
case GLXcolorIndexSingleBuffer: |
|
4718 | 673 |
set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE); |
674 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE); |
|
675 |
break; |
|
151 | 676 |
case GLXcolorIndexDoubleBuffer: |
4718 | 677 |
set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE); |
678 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE); |
|
679 |
break; |
|
151 | 680 |
case GLXrgbSingleBuffer: |
4718 | 681 |
set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE); |
682 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE); |
|
683 |
break; |
|
151 | 684 |
case GLXrgbDoubleBuffer: |
4718 | 685 |
set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE); |
686 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE); |
|
687 |
break; |
|
151 | 688 |
} |
689 |
set_entry(next, 0, 0, 0); /* The input to GLXgetconfig is null terminated */ |
|
690 |
||
691 |
/* |
|
692 |
* Get configuration data for a window based on above parameters |
|
693 |
* First we have to find out which screen the parent window is on, |
|
694 |
* then we can call GXLgetconfig() |
|
695 |
*/ |
|
696 |
XGetWindowAttributes(dpy, parent, &pwa); |
|
697 |
retconfig = GLXgetconfig(dpy, XScreenNumberOfScreen(pwa.screen), params); |
|
698 |
if (retconfig == 0) { |
|
4718 | 699 |
console_fprintf(stderr, "Sorry, can't support %s type of windows\n", typeToName[type]); |
700 |
__catchExit(0); |
|
701 |
return 0; |
|
151 | 702 |
} |
703 |
||
704 |
/* |
|
705 |
* Scan through config info, pulling info needed to create a window |
|
706 |
* that supports the rendering mode. |
|
707 |
*/ |
|
708 |
for (next = retconfig; next->buffer; next++) { |
|
4718 | 709 |
unsigned long buffer = next->buffer; |
710 |
unsigned long mode = next->mode; |
|
711 |
unsigned long value = next->arg; |
|
712 |
switch (mode) { |
|
713 |
case GLX_COLORMAP: |
|
714 |
if (buffer == GLX_NORMAL) { |
|
715 |
cmap = value; |
|
716 |
} |
|
717 |
break; |
|
718 |
case GLX_VISUAL: |
|
719 |
if (buffer == GLX_NORMAL) { |
|
720 |
template.visualid = value; |
|
721 |
template.screen = DefaultScreen(dpy); |
|
722 |
vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask, |
|
723 |
&template, &nret); |
|
724 |
} |
|
725 |
break; |
|
726 |
} |
|
151 | 727 |
} |
728 |
||
729 |
/* |
|
730 |
* Create the window |
|
731 |
*/ |
|
732 |
cwa.colormap = cmap; |
|
733 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
734 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
4718 | 735 |
borderWidth, vis->depth, InputOutput, vis->visual, |
736 |
CWColormap|CWBorderPixel, &cwa); |
|
151 | 737 |
|
738 |
/* |
|
739 |
* Rescan configuration info and find window slot that getconfig |
|
740 |
* provided. Fill it in with the window we just created. |
|
741 |
*/ |
|
742 |
for (next = retconfig; next->buffer; next++) { |
|
4718 | 743 |
if ((next->buffer == GLX_NORMAL) && (next->mode == GLX_WINDOW)) { |
744 |
next->arg = win; |
|
745 |
break; |
|
746 |
} |
|
151 | 747 |
} |
748 |
||
749 |
/* |
|
750 |
* Now "retconfig" contains all the information the GL needs to |
|
751 |
* configure the window and its own internal state. |
|
752 |
*/ |
|
753 |
/* |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
754 |
* on iris, seg-violations occur in the GL, if too many |
151 | 755 |
* views are created ... |
756 |
*/ |
|
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
757 |
# ifdef SIGSEGV |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
758 |
# ifdef HAS_SIGACTION |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
759 |
sigaction(SIGSEGV, (struct sigaction *)0, &oldSigSegv); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
760 |
newSigSegv = oldSigSegv; |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
761 |
newSigSegv.sa_handler = glAbort; |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
762 |
sigaction(SIGSEGV, &newSigSegv, (struct sigaction *)0); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
763 |
# else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
764 |
oldSigSegv = signal(SIGSEGV, glAbort); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
765 |
# endif |
1899 | 766 |
# endif |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
767 |
|
151 | 768 |
i = GLXlink(dpy, retconfig); |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
769 |
|
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
770 |
# ifdef SIGSEGV |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
771 |
# ifdef HAS_SIGACTION |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
772 |
sigaction(SIGSEGV, &oldSigSegv, (struct sigaction *)0); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
773 |
# else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
774 |
signal(SIGSEGV, oldSigSegv); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
775 |
# endif |
1899 | 776 |
# endif |
151 | 777 |
|
778 |
if (i < 0) { |
|
4718 | 779 |
console_fprintf(stderr, "GLXlink returned %d\n", i); |
780 |
__catchExit(0); |
|
781 |
return 0; |
|
151 | 782 |
} |
783 |
||
784 |
/* |
|
785 |
* The GL sets its own X error handlers, which exits - this is not what we want |
|
786 |
*/ |
|
787 |
XSetErrorHandler(__XErrorHandler__); |
|
1899 | 788 |
# endif /* not VGL */ |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
789 |
__catchExit(0); |
1932 | 790 |
|
791 |
#else /* OPENGL | MESA */ |
|
792 |
||
793 |
scr = DefaultScreen(dpy); |
|
794 |
visual.visualid = CopyFromParent; |
|
795 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
796 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
4718 | 797 |
borderWidth, DisplayPlanes(dpy, scr), |
798 |
InputOutput, &visual, |
|
799 |
CWBorderPixel, &cwa); |
|
1932 | 800 |
|
801 |
vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask, &visual, &nret); |
|
4718 | 802 |
console_fprintf(stderr, "vis is %x\n", vis); |
1932 | 803 |
#endif /* GLX || VGL */ |
804 |
||
151 | 805 |
return win; |
806 |
} |
|
807 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
808 |
__GLXUnlinkWindow(dpy, win) |
151 | 809 |
Display* dpy; |
810 |
Window win; |
|
811 |
{ |
|
812 |
/* |
|
813 |
* only needed for VGL - GLX does it automatically |
|
814 |
*/ |
|
1932 | 815 |
#ifdef VGL |
151 | 816 |
GLXunlink(dpy, win); |
1932 | 817 |
#endif |
151 | 818 |
} |
819 |
||
29 | 820 |
/* |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
821 |
* helper for rotation - calls rot() |
29 | 822 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
823 |
OBJ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
824 |
__glx_doRotate(angle, axis) |
29 | 825 |
OBJ angle; |
826 |
char axis; |
|
827 |
{ |
|
828 |
float f_angle; |
|
829 |
||
35 | 830 |
if (__isFloat(angle)) { |
4718 | 831 |
f_angle = (float)(_floatVal(angle)); |
832 |
if (f_angle != 0.0) { |
|
833 |
#ifdef OPENGL |
|
834 |
#else |
|
835 |
rot(f_angle, axis); |
|
836 |
#endif |
|
837 |
} |
|
838 |
return (true); |
|
29 | 839 |
} |
35 | 840 |
if (__isFraction(angle) |
97 | 841 |
&& __isSmallInteger(_FractionInstPtr(angle)->f_numerator) |
842 |
&& __isSmallInteger(_FractionInstPtr(angle)->f_denominator)) { |
|
4718 | 843 |
float n, d; |
844 |
||
845 |
n = (float)(__intVal(_FractionInstPtr(angle)->f_numerator)); |
|
846 |
d = (float)(__intVal(_FractionInstPtr(angle)->f_denominator)); |
|
847 |
f_angle = n / d; |
|
848 |
if (f_angle != 0.0) { |
|
849 |
#ifdef OPENGL |
|
850 |
#else |
|
851 |
rot(f_angle, axis); |
|
852 |
#endif |
|
853 |
} |
|
854 |
return (true); |
|
29 | 855 |
} |
97 | 856 |
if (__isSmallInteger(angle)) { |
4718 | 857 |
f_angle = (float)(__intVal(angle)); |
858 |
if (f_angle != 0.0) { |
|
859 |
#ifdef OPENGL |
|
860 |
#else |
|
861 |
rot(f_angle, axis); |
|
862 |
#endif |
|
863 |
} |
|
864 |
return (true); |
|
29 | 865 |
} |
866 |
return false; |
|
867 |
} |
|
0 | 868 |
|
24 | 869 |
/* |
29 | 870 |
* fetch integers from an st-array (elements must be smallIntegers) |
871 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
872 |
long * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
873 |
__glx_getLongsFromInto(obj, vec, count) |
29 | 874 |
OBJ obj; |
875 |
long *vec; |
|
876 |
{ |
|
877 |
OBJ cls, o; |
|
878 |
int nByte, i, ninstVars, nInstBytes; |
|
879 |
char *pElem; |
|
880 |
||
881 |
if (! _isNonNilObject(obj)) return (long *)NULL; |
|
134 | 882 |
cls = __qClass(obj); |
185 | 883 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 884 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 885 |
nByte = __qSize(obj) - nInstBytes; |
29 | 886 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
887 |
if (nByte < (count * sizeof(OBJ))) return (long *)NULL; |
|
888 |
for (i=0; i<count; i++) { |
|
4718 | 889 |
o = *(OBJ *)pElem; |
890 |
if (! __isSmallInteger(o)) return (long *)NULL; |
|
891 |
vec[i] = (long)__intVal(o); |
|
892 |
pElem += sizeof(OBJ); |
|
29 | 893 |
} |
894 |
return vec; |
|
895 |
} |
|
896 |
||
897 |
/* |
|
898 |
* fetch shorts from an st-array (elements must be smallIntegers) |
|
899 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
900 |
short * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
901 |
__glx_getShortsFromInto(obj, vec, count) |
29 | 902 |
OBJ obj; |
903 |
short *vec; |
|
904 |
{ |
|
905 |
OBJ cls, o; |
|
906 |
int nByte, i, ninstVars, nInstBytes; |
|
907 |
char *pElem; |
|
908 |
||
909 |
if (! _isNonNilObject(obj)) return (short *)NULL; |
|
134 | 910 |
cls = __qClass(obj); |
185 | 911 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 912 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 913 |
nByte = __qSize(obj) - nInstBytes; |
29 | 914 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
915 |
if (nByte < (count * sizeof(OBJ))) return (short *)NULL; |
|
916 |
for (i=0; i<count; i++) { |
|
4718 | 917 |
o = *(OBJ *)pElem; |
918 |
if (! __isSmallInteger(o)) return (short *)NULL; |
|
919 |
vec[i] = (short)__intVal(o); |
|
920 |
pElem += sizeof(OBJ); |
|
29 | 921 |
} |
922 |
return vec; |
|
923 |
} |
|
924 |
||
925 |
/* |
|
4718 | 926 |
* fetch floats from an st-object into a c-float array |
29 | 927 |
* which may be a floatArray, doubleArray or array-of-something, |
928 |
* where something may be a float, fraction or smallInteger, |
|
24 | 929 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
930 |
float * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
931 |
__glx_getFloatsFromInto(obj, vec, count) |
12 | 932 |
OBJ obj; |
933 |
float *vec; |
|
934 |
{ |
|
935 |
OBJ cls; |
|
936 |
int nByte; |
|
937 |
OBJ o; |
|
938 |
int i, ninstVars, nInstBytes; |
|
939 |
char *pElem; |
|
940 |
||
941 |
if (! _isNonNilObject(obj)) return (float *)0; |
|
942 |
||
134 | 943 |
cls = __qClass(obj); |
185 | 944 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
12 | 945 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 946 |
nByte = __qSize(obj) - nInstBytes; |
12 | 947 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
948 |
||
185 | 949 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
12 | 950 |
case FLOATARRAY: |
4718 | 951 |
/* |
952 |
* best speed for float array |
|
953 |
* - the data is already as we want it |
|
954 |
*/ |
|
955 |
if (nByte < (count * sizeof(float))) return (float *)0; |
|
956 |
return (float *)pElem; |
|
12 | 957 |
|
958 |
case DOUBLEARRAY: |
|
4718 | 959 |
/* |
960 |
* for double array, have to copy-and-cast |
|
961 |
*/ |
|
962 |
if (nByte < (count * sizeof(double))) return (float *)0; |
|
963 |
for (i=0; i<count; i++) { |
|
964 |
vec[i] = *((double *)pElem); |
|
965 |
pElem += sizeof(double); |
|
966 |
} |
|
967 |
return vec; |
|
12 | 968 |
|
969 |
case POINTERARRAY: |
|
4718 | 970 |
/* |
971 |
* for other array, have to fetch, check and store |
|
972 |
* the elements can be floats, smallintegers or fractions |
|
973 |
*/ |
|
974 |
if (nByte < (count * sizeof(OBJ))) return (float *)0; |
|
975 |
/* get elements one-by-one */ |
|
976 |
for (i=0; i<count; i++) { |
|
977 |
o = *(OBJ *)pElem; |
|
978 |
if (__isFloat(o)) { |
|
979 |
vec[i] = _floatVal(o); |
|
980 |
} else if (__isSmallInteger(o)) { |
|
981 |
vec[i] = (float)(__intVal(o)); |
|
982 |
} else if (__isFraction(o) |
|
983 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
|
984 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
985 |
float n, d; |
|
986 |
||
987 |
n = (float)(__intVal(_FractionInstPtr(o)->f_numerator)); |
|
988 |
d = (float)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
989 |
vec[i] = n / d; |
|
990 |
} else |
|
991 |
return 0; |
|
992 |
pElem += sizeof(OBJ); |
|
993 |
} |
|
994 |
return vec; |
|
12 | 995 |
} |
996 |
return (float *)0; |
|
997 |
} |
|
998 |
||
29 | 999 |
/* |
4718 | 1000 |
* fetch doubles from an st-object into a c-double array |
29 | 1001 |
* which may be a floatArray, doubleArray or array-of-something, |
1002 |
* where something may be a float, fraction or smallInteger, |
|
1003 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1004 |
double * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1005 |
__glx_getDoublesFromInto(obj, vec, count) |
29 | 1006 |
OBJ obj; |
1007 |
double *vec; |
|
1008 |
{ |
|
1009 |
OBJ cls, o; |
|
1010 |
int nByte, i, ninstVars, nInstBytes; |
|
1011 |
char *pElem; |
|
1012 |
||
1013 |
if (! _isNonNilObject(obj)) return (double *)0; |
|
134 | 1014 |
cls = __qClass(obj); |
185 | 1015 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 1016 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1017 |
nByte = __qSize(obj) - nInstBytes; |
29 | 1018 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1019 |
||
185 | 1020 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
29 | 1021 |
case DOUBLEARRAY: |
4718 | 1022 |
/* best speed for double array - the data is already as we want it */ |
1023 |
if (nByte < (count * sizeof(double))) return (double *)0; |
|
1024 |
return (double *)pElem; |
|
29 | 1025 |
|
1026 |
case FLOATARRAY: |
|
4718 | 1027 |
if (nByte < (count * sizeof(float))) return (double *)0; |
1028 |
for (i=0; i<count; i++) { |
|
1029 |
vec[i] = *((float *)pElem); |
|
1030 |
pElem += sizeof(float); |
|
1031 |
} |
|
1032 |
return vec; |
|
29 | 1033 |
|
1034 |
case POINTERARRAY: |
|
4718 | 1035 |
if (nByte < (count * sizeof(OBJ))) return (double *)0; |
1036 |
/* get elements one-by-one */ |
|
1037 |
for (i=0; i<count; i++) { |
|
1038 |
o = *(OBJ *)pElem; |
|
1039 |
if (__isFloat(o)) |
|
1040 |
vec[i] = _floatVal(o); |
|
1041 |
else if (__isSmallInteger(o)) |
|
1042 |
vec[i] = (double)(__intVal(o)); |
|
1043 |
else if (__isFraction(o) |
|
1044 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
|
1045 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
1046 |
double n, d; |
|
1047 |
||
1048 |
n = (double)(__intVal(_FractionInstPtr(o)->f_numerator)); |
|
1049 |
d = (double)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
1050 |
vec[i] = n / d; |
|
1051 |
||
1052 |
} else |
|
1053 |
return 0; |
|
1054 |
pElem += sizeof(OBJ); |
|
1055 |
} |
|
1056 |
return vec; |
|
29 | 1057 |
} |
1058 |
return (double *)0; |
|
1059 |
} |
|
1060 |
||
1061 |
/* |
|
1062 |
* move from a c-float array into an st-object, |
|
1063 |
* the st-object MUST be either a float- or double array |
|
1064 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1065 |
__glx_putFloatsFromInto(vec, obj, count) |
12 | 1066 |
OBJ obj; |
1067 |
float *vec; |
|
1068 |
{ |
|
1069 |
OBJ cls; |
|
1070 |
int nByte; |
|
1071 |
OBJ o; |
|
1072 |
int i, ninstVars, nInstBytes; |
|
1073 |
char *pElem; |
|
1074 |
||
1075 |
if (! _isNonNilObject(obj)) return 0; |
|
1076 |
||
134 | 1077 |
cls = __qClass(obj); |
185 | 1078 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
12 | 1079 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1080 |
nByte = __qSize(obj) - nInstBytes; |
12 | 1081 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1082 |
||
185 | 1083 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
12 | 1084 |
case FLOATARRAY: |
4718 | 1085 |
if (nByte < (count * sizeof(float))) return 0; |
1086 |
for (i=0; i<count; i++) { |
|
1087 |
*(float *)pElem = vec[i]; |
|
1088 |
pElem += sizeof(float); |
|
1089 |
} |
|
1090 |
return 1; |
|
12 | 1091 |
|
1092 |
case DOUBLEARRAY: |
|
4718 | 1093 |
if (nByte < (count * sizeof(float))) return 0; |
1094 |
for (i=0; i<count; i++) { |
|
1095 |
*(double *)pElem = vec[i]; |
|
1096 |
pElem += sizeof(double); |
|
1097 |
} |
|
1098 |
return 1; |
|
12 | 1099 |
} |
1100 |
/* not implemented for others */ |
|
1101 |
||
1102 |
return 0; |
|
1103 |
} |
|
1104 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1105 |
#ifndef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1106 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1107 |
Matrix * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1108 |
__glx_getFloatsFromMatrixInto(obj, mp) |
12 | 1109 |
OBJ obj; |
1110 |
Matrix *mp; |
|
1111 |
{ |
|
1112 |
OBJ cls; |
|
1113 |
int nByte; |
|
1114 |
OBJ o; |
|
29 | 1115 |
int ninstVars, nInstBytes; |
1116 |
char *pElem; |
|
1117 |
int x = 0; |
|
1118 |
int i,j; |
|
12 | 1119 |
|
1120 |
if (! _isNonNilObject(obj)) return (Matrix *)0; |
|
1121 |
||
134 | 1122 |
cls = __qClass(obj); |
185 | 1123 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 1124 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1125 |
nByte = __qSize(obj) - nInstBytes; |
29 | 1126 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1127 |
||
185 | 1128 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
4718 | 1129 |
case FLOATARRAY: |
1130 |
/* |
|
1131 |
* very easy for FLOATARRAY objects - no copying needed |
|
1132 |
*/ |
|
1133 |
if (nByte < (16 * sizeof(float))) return (Matrix *)0; |
|
1134 |
return (Matrix *) _FloatArrayInstPtr(obj)->f_element; |
|
1135 |
||
1136 |
case DOUBLEARRAY: |
|
1137 |
/* |
|
1138 |
* for DOUBLEARRAY objects copy and cast |
|
1139 |
*/ |
|
1140 |
if (nByte < (16 * sizeof(double))) return (Matrix *)0; |
|
1141 |
for (i=0; i<4; i++) { |
|
1142 |
for (j=0; j<4; j++) { |
|
1143 |
(*mp)[i][j] = _DoubleArrayInstPtr(obj)->d_element[x]; |
|
1144 |
x++; |
|
1145 |
} |
|
1146 |
} |
|
1147 |
return mp; |
|
1148 |
||
1149 |
case POINTERARRAY: |
|
1150 |
if (nByte < (16 * sizeof(OBJ))) return (Matrix *)0; |
|
1151 |
/* |
|
1152 |
* get elements one-by-one |
|
1153 |
*/ |
|
1154 |
for (i=0; i<4; i++) { |
|
1155 |
for (j=0; j<4; j++) { |
|
1156 |
o = _ArrayInstPtr(obj)->a_element[x]; |
|
1157 |
if (__isFloat(o)) { |
|
1158 |
(*mp)[i][j] = _floatVal(o); |
|
1159 |
} else if (__isSmallInteger(o)) { |
|
1160 |
(*mp)[i][j] = (double)__intVal(o); |
|
1161 |
} else if (__isFraction(o) |
|
1162 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
|
1163 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
1164 |
double n, d; |
|
1165 |
||
1166 |
n = (double)(__intVal(_FractionInstPtr(o)->f_numerator)); |
|
1167 |
d = (double)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
1168 |
(*mp)[i][j] = n / d; |
|
1169 |
} else |
|
1170 |
return (Matrix *)0; |
|
1171 |
x++; |
|
1172 |
} |
|
1173 |
} |
|
1174 |
return mp; |
|
12 | 1175 |
} |
1176 |
return (Matrix *)0; |
|
1177 |
} |
|
1178 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1179 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1180 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1181 |
float* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1182 |
__glx_getFloatsFromFloatArrayInto(obj, fp) |
46 | 1183 |
OBJ obj; |
1184 |
float *fp; |
|
1185 |
{ |
|
1186 |
OBJ cls; |
|
1187 |
int ninstVars; |
|
1188 |
||
1189 |
if (! _isNonNilObject(obj)) return (float *)0; |
|
134 | 1190 |
cls = __qClass(obj); |
350 | 1191 |
if (cls == @global(FloatArray)) |
4718 | 1192 |
return _FloatArrayInstPtr(obj)->f_element; |
46 | 1193 |
|
185 | 1194 |
if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) { |
4718 | 1195 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
1196 |
return (float *) &(_InstPtr(obj)->i_instvars[ninstVars]); |
|
46 | 1197 |
} |
1198 |
||
1199 |
/* |
|
1200 |
* need more here (i.e. convert from array-of-floats) |
|
1201 |
*/ |
|
1202 |
return (float *)0; |
|
1203 |
} |
|
1204 |
||
1205 |
%} |
|
1206 |
! ! |
|
0 | 1207 |
|
294 | 1208 |
!GLXWorkstation class methodsFor:'documentation'! |
1209 |
||
1210 |
copyright |
|
1211 |
" |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1212 |
COPYRIGHT (c) 1993 by Claus Gittinger |
294 | 1213 |
All Rights Reserved |
1214 |
||
1215 |
This software is furnished under a license and may be used |
|
1216 |
only in accordance with the terms of that license and with the |
|
1217 |
inclusion of the above copyright notice. This software may not |
|
1218 |
be provided or otherwise made available to, or used by, any |
|
1219 |
other person. No title to or ownership of the software is |
|
1220 |
hereby transferred. |
|
1221 |
" |
|
1222 |
! |
|
1223 |
||
1224 |
documentation |
|
1225 |
" |
|
1226 |
this class was originally written as a demo on how an interface to |
|
1227 |
a c graphics library could be implemented. In the mean time, it has become |
|
1228 |
quite complete ... |
|
1229 |
||
1230 |
It provides an interface to either a real GL (on SGI workstations) |
|
1231 |
or a simulated VGL (i.e. GL-light; low nicotine). |
|
1232 |
The GL simulation is derived from the PD vogl library, with slight |
|
1233 |
modifictions to support multiple GL views. |
|
1234 |
||
1235 |
Most of the hard work was done by Jeff (thanks indeed) ... |
|
1236 |
||
1237 |
||
1238 |
Some notes: |
|
1239 |
||
1240 |
I do not really know what most of these functions do - for more |
|
1241 |
detail, see the GL man pages (on SGI) or the doc provided with VGL. |
|
1242 |
||
1243 |
The interface offered here provides a very very low level (i.e one-to-one) |
|
1244 |
interface to GL functions. More high-level stuff is required, to make |
|
4718 | 1245 |
3D drawing be more object-oriented. |
294 | 1246 |
(see a bit of this in 'clients/IRIS-specials') |
1247 |
||
1248 |
Some functions are duplicated, Jeff and I developed those in parallel - |
|
1249 |
for now, both will remain - finally they will be merged and duplicates removed ... |
|
1250 |
(examples are makeobj and makeObject). |
|
1251 |
||
1252 |
Also, in a hurry to implement all those methods, many do no or only |
|
1253 |
limited argument checking - make certain, that you pass the correct |
|
1254 |
arguments. |
|
1255 |
||
1256 |
There might be some confusion in the v3[sifd] functions: basically they |
|
1257 |
all do the same, and could be mapped onto one st-method (such as vertex3). |
|
7657 | 1258 |
However, the C-functions expect different argument types - I don't know if |
294 | 1259 |
one or another of these functions suffers from any performance penalties. |
1260 |
Therefore, I leave the direct 1-to-1 mapping; GL experts might know more |
|
1261 |
about this (I use v3f in all of my code). |
|
1262 |
||
1263 |
written june 93 by claus |
|
1264 |
VGL stuff dec 93 |
|
1265 |
many many additions jan 94 by Jeff McAffer <jeff@is.s.u-tokyo.ac.jp> |
|
1266 |
||
4718 | 1267 |
Since this is a demo (consider it a free add-on goody) there is |
294 | 1268 |
*** NO WARRANTY ** for this. |
1269 |
||
1270 |
Notice: this should be rewritten to use the openGL library functions |
|
1271 |
(actually, to not loose the VGL interface, another OpenGLWorkstation |
|
1272 |
class should be written) |
|
614 | 1273 |
|
1274 |
[author:] |
|
7657 | 1275 |
Claus Gittinger |
1276 |
Jeff McAffer |
|
294 | 1277 |
" |
1278 |
! ! |
|
1279 |
||
168 | 1280 |
!GLXWorkstation class methodsFor:'error handling'! |
1281 |
||
294 | 1282 |
errorStringOfLastError |
1283 |
%{ |
|
4251 | 1284 |
#ifdef DYNAMICALLY_LOADABLE |
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1285 |
RETURN ( __MKSTRING(lastErrorMsg) ); |
4251 | 1286 |
#endif |
1287 |
%}. |
|
1288 |
||
1289 |
^ super errorStringOfLastError. |
|
1290 |
! |
|
1291 |
||
1292 |
minorCodeOfLastError |
|
1293 |
%{ /* NOCONTEXT */ |
|
1294 |
#ifdef DYNAMICALLY_LOADABLE |
|
1295 |
RETURN ( __MKSMALLINT(lastMinorCode) ); |
|
1296 |
#endif |
|
1297 |
%}. |
|
1298 |
||
1299 |
^ super minorCodeOfLastError. |
|
1300 |
! |
|
1301 |
||
1302 |
requestCodeOfLastError |
|
1303 |
%{ /* NOCONTEXT */ |
|
1304 |
#ifdef DYNAMICALLY_LOADABLE |
|
1305 |
RETURN ( __MKSMALLINT(lastRequestCode) ); |
|
1306 |
#endif |
|
1307 |
%}. |
|
1308 |
||
1309 |
^ super requestCodeOfLastError. |
|
1310 |
! |
|
1311 |
||
1312 |
resourceIdOfLastError |
|
1313 |
%{ /* NOCONTEXT */ |
|
1314 |
#ifdef DYNAMICALLY_LOADABLE |
|
1315 |
if (lastResource != 0) { |
|
1316 |
RETURN ( __MKEXTERNALADDRESS(lastResource) ); |
|
1317 |
} |
|
1318 |
RETURN ( nil ); |
|
1319 |
#endif |
|
1320 |
%}. |
|
1321 |
||
1322 |
^ super resourceIdOfLastError. |
|
1323 |
! ! |
|
1324 |
||
1325 |
!GLXWorkstation class methodsFor:'misc'! |
|
168 | 1326 |
|
528 | 1327 |
forceGL:aBoolean |
1328 |
ForceGL := aBoolean. |
|
1329 |
AllScreens notNil ifTrue:[ |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1330 |
AllScreens do:[:screen | screen initializeScreenProperties] |
528 | 1331 |
]. |
294 | 1332 |
! ! |
1333 |
||
1334 |
!GLXWorkstation methodsFor:'arcs and circles'! |
|
1335 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1336 |
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
|
1337 |
"draw an arc at a given location. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1338 |
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
|
1339 |
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
|
1340 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1341 |
%{ /* NOCONTEXT */ |
294 | 1342 |
Coord c_x, c_y, c_radius; |
1343 |
Angle a_startang, a_endang; |
|
1344 |
||
1345 |
_COORD_(x, c_x) |
|
1346 |
_COORD_(y, c_y) |
|
1347 |
_COORD_(radius, c_radius) |
|
1348 |
_ANGLE_(startang, a_startang) |
|
1349 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1350 |
|
294 | 1351 |
SETWIN(aGLXWindowId) |
1932 | 1352 |
#ifdef OPENGL |
1353 |
#else |
|
294 | 1354 |
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
|
1355 |
#endif |
294 | 1356 |
%} |
528 | 1357 |
|
1358 |
"Modified: 19.3.1996 / 18:43:52 / cg" |
|
294 | 1359 |
! |
1360 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1361 |
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
|
1362 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1363 |
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
|
1364 |
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
|
1365 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1366 |
%{ /* NOCONTEXT */ |
294 | 1367 |
Coord c_x, c_y, c_radius; |
1368 |
Angle a_startang, a_endang; |
|
1369 |
||
1370 |
_COORD_(x, c_x) |
|
1371 |
_COORD_(y, c_y) |
|
1372 |
_COORD_(radius, c_radius) |
|
1373 |
_ANGLE_(startang, a_startang) |
|
1374 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1375 |
|
294 | 1376 |
SETWIN(aGLXWindowId) |
1932 | 1377 |
#ifdef OPENGL |
1378 |
#else |
|
294 | 1379 |
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
|
1380 |
#endif |
294 | 1381 |
%} |
1382 |
! |
|
1383 |
||
1384 |
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
|
1385 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1386 |
All arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1387 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1388 |
%{ /* NOCONTEXT */ |
294 | 1389 |
Icoord c_x, c_y, c_radius; |
1390 |
Angle a_startang, a_endang; |
|
1391 |
||
1392 |
_ICOORD_(x, c_x) |
|
1393 |
_ICOORD_(y, c_y) |
|
1394 |
_ICOORD_(radius, c_radius) |
|
1395 |
_ANGLE_(startang, a_startang); |
|
1396 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1397 |
|
294 | 1398 |
SETWIN(aGLXWindowId) |
1932 | 1399 |
#ifdef OPENGL |
1400 |
#else |
|
294 | 1401 |
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
|
1402 |
#endif |
294 | 1403 |
%} |
1404 |
! |
|
1405 |
||
1406 |
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
|
1407 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1408 |
All arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1409 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1410 |
%{ /* NOCONTEXT */ |
294 | 1411 |
Scoord c_x, c_y, c_radius; |
1412 |
Angle a_startang, a_endang; |
|
1413 |
||
1414 |
_SCOORD_(x, c_x) |
|
1415 |
_SCOORD_(y, c_y) |
|
1416 |
_SCOORD_(radius, c_radius) |
|
1417 |
_ANGLE_(startang, a_startang) |
|
1418 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1419 |
|
294 | 1420 |
SETWIN(aGLXWindowId) |
1932 | 1421 |
#ifdef OPENGL |
1422 |
#else |
|
294 | 1423 |
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
|
1424 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1425 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1426 |
! |
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 |
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
|
1429 |
"draw an (unfilled) arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1430 |
All arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1431 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1432 |
%{ /* NOCONTEXT */ |
294 | 1433 |
Icoord c_x, c_y, c_radius; |
1434 |
Angle a_startang, a_endang; |
|
1435 |
||
1436 |
_ICOORD_(x, c_x) |
|
1437 |
_ICOORD_(y, c_y) |
|
1438 |
_ICOORD_(radius, c_radius) |
|
1439 |
_ANGLE_(startang, a_startang) |
|
1440 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1441 |
|
294 | 1442 |
SETWIN(aGLXWindowId) |
1932 | 1443 |
#ifdef OPENGL |
1444 |
#else |
|
294 | 1445 |
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
|
1446 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1447 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1448 |
! |
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 |
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
|
1451 |
"draw an (unfilled) arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1452 |
All arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1453 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1454 |
%{ /* NOCONTEXT */ |
1932 | 1455 |
Scoord c_x, c_y, c_radius; |
1456 |
Angle a_startang, a_endang; |
|
1457 |
||
1458 |
_SCOORD_(x, c_x) |
|
1459 |
_SCOORD_(y, c_y) |
|
1460 |
_SCOORD_(radius, c_radius) |
|
1461 |
_ANGLE_(startang, a_startang) |
|
1462 |
_ANGLE_(endang, a_endang) |
|
1463 |
||
1464 |
SETWIN(aGLXWindowId) |
|
1465 |
#ifdef OPENGL |
|
1466 |
#else |
|
1467 |
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
|
1468 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1469 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1470 |
! |
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 |
glxCircX:x y:y radius: radius in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1473 |
"draw a circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1474 |
x/y/radius may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1475 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1476 |
%{ /* NOCONTEXT */ |
1932 | 1477 |
Coord c_x, c_y, c_radius; |
1478 |
||
1479 |
_COORD_ (x, c_x) |
|
1480 |
_COORD_ (y, c_y) |
|
1481 |
_COORD_ (radius, c_radius) |
|
1482 |
||
1483 |
SETWIN(aGLXWindowId) |
|
1484 |
#ifdef OPENGL |
|
1485 |
#else |
|
1486 |
circ(c_x, c_y, c_radius); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1487 |
#endif |
294 | 1488 |
%} |
1489 |
! |
|
1490 |
||
1491 |
glxCircfX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1492 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1493 |
x/y/radius may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1494 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1495 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1496 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1497 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1498 |
Coord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1499 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1500 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1501 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1502 |
_COORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1503 |
|
1932 | 1504 |
#ifdef OPENGL |
1505 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1506 |
circf(c_x, c_y, c_radius); |
1932 | 1507 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1508 |
} |
294 | 1509 |
%} |
1510 |
! |
|
1511 |
||
1512 |
glxCircfiX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1513 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1514 |
x/y/radius must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1515 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1516 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1517 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1518 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1519 |
Icoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1520 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1521 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1522 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1523 |
_ICOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1524 |
|
1932 | 1525 |
#ifdef OPENGL |
1526 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1527 |
circfi(c_x, c_y, c_radius); |
1932 | 1528 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1529 |
} |
294 | 1530 |
%} |
1531 |
! |
|
1532 |
||
1533 |
glxCircfsX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1534 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1535 |
x/y/radius must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1536 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1537 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1538 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1539 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1540 |
Scoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1541 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1542 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1543 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1544 |
_SCOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1545 |
|
1932 | 1546 |
#ifdef OPENGL |
1547 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1548 |
circfs(c_x, c_y, c_radius); |
1932 | 1549 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1550 |
} |
294 | 1551 |
%} |
1552 |
! |
|
1553 |
||
1554 |
glxCirciX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1555 |
"draw a circle (unfilled). |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1556 |
x/y/radius must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1557 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1558 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1559 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1560 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1561 |
Icoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1562 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1563 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1564 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1565 |
_ICOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1566 |
|
1932 | 1567 |
#ifdef OPENGL |
1568 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1569 |
circi(c_x, c_y, c_radius); |
1932 | 1570 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1571 |
} |
294 | 1572 |
%} |
1573 |
! |
|
1574 |
||
1575 |
glxCircsX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1576 |
"draw a circle (unfilled) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1577 |
x/y/radius must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1578 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1579 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1580 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1581 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1582 |
Scoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1583 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1584 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1585 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1586 |
_SCOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1587 |
|
1932 | 1588 |
#ifdef OPENGL |
1589 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1590 |
circs(c_x, c_y, c_radius); |
1932 | 1591 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1592 |
} |
294 | 1593 |
%} |
1594 |
! ! |
|
1595 |
||
528 | 1596 |
!GLXWorkstation methodsFor:'attribute stack'! |
1597 |
||
1598 |
glxPopattributesIn: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1599 |
"pop (and forget) the top entry on the attribute stack" |
528 | 1600 |
|
1601 |
%{ /* NOCONTEXT */ |
|
1602 |
SETWIN(aGLXWindowId) |
|
1932 | 1603 |
#ifndef OPENGL |
528 | 1604 |
popattributes(); |
1932 | 1605 |
#endif |
528 | 1606 |
%} |
1607 |
||
1608 |
"Modified: 19.3.1996 / 18:42:53 / cg" |
|
1609 |
! |
|
1610 |
||
1611 |
glxPushattributesIn: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1612 |
"save the current attributes on the attribute stack" |
528 | 1613 |
|
1614 |
%{ /* NOCONTEXT */ |
|
1615 |
SETWIN(aGLXWindowId) |
|
1932 | 1616 |
#ifndef OPENGL |
528 | 1617 |
pushattributes(); |
1932 | 1618 |
#endif |
528 | 1619 |
%} |
1620 |
||
1621 |
"Modified: 19.3.1996 / 18:43:04 / cg" |
|
1622 |
! ! |
|
1623 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1624 |
!GLXWorkstation methodsFor:'character position'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1625 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1626 |
glxCmov2X: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1627 |
"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
|
1628 |
The arguments may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1629 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1630 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1631 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1632 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1633 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1634 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1635 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1636 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1637 |
|
1932 | 1638 |
#ifdef OPENGL |
1639 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1640 |
cmov2(c_x, c_y); |
1932 | 1641 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1642 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1643 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1644 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1645 |
"Modified: 22.3.1996 / 18:17:38 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1646 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1647 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1648 |
glxCmov2iX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1649 |
"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
|
1650 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1651 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1652 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1653 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1654 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1655 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1656 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1657 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1658 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1659 |
|
1932 | 1660 |
#ifdef OPENGL |
1661 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1662 |
cmov2i(c_x, c_y); |
1932 | 1663 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1664 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1665 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1666 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1667 |
"Modified: 22.3.1996 / 18:17:43 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1670 |
glxCmov2sX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1671 |
"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
|
1672 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1673 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1674 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1675 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1676 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1677 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1678 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1679 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1680 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1681 |
|
1932 | 1682 |
#ifdef OPENGL |
1683 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1684 |
cmov2s(c_x, c_y); |
1932 | 1685 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1686 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1687 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1688 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1689 |
"Modified: 22.3.1996 / 18:17:47 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1690 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1691 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1692 |
glxCmovX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1693 |
"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
|
1694 |
The arguments may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1695 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1696 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1697 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1698 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1699 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1700 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1701 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1702 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1703 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1704 |
|
1932 | 1705 |
#ifdef OPENGL |
1706 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1707 |
cmov(c_x, c_y, c_z); |
1932 | 1708 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1709 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1710 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1711 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1712 |
"Modified: 22.3.1996 / 18:17:22 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1715 |
glxCmoviX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1716 |
"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
|
1717 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1718 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1719 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1720 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1721 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1722 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1723 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1724 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1725 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1726 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1727 |
|
1932 | 1728 |
#ifdef OPENGL |
1729 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1730 |
cmovi(c_x, c_y, c_z); |
1932 | 1731 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1732 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1733 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1734 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1735 |
"Modified: 22.3.1996 / 18:17:55 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1738 |
glxCmovsX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1739 |
"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
|
1740 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1741 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1742 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1743 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1744 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1745 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1746 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1747 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1748 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1749 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1750 |
|
1932 | 1751 |
#ifdef OPENGL |
1752 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1753 |
cmovs(c_x, c_y, c_z); |
1932 | 1754 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1755 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1756 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1757 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1758 |
"Modified: 22.3.1996 / 18:17:59 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1761 |
glxGetcposIn: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1762 |
"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
|
1763 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1764 |
| x y | |
4718 | 1765 |
%{ |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1766 |
short s_x, s_y; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1767 |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1768 |
SETWIN(aGLXWindowId) |
1932 | 1769 |
#ifdef OPENGL |
1770 |
#else |
|
1771 |
# ifdef GLX |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1772 |
getcpos(&s_x, &s_y); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1773 |
x = __MKSMALLINT(s_x); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1774 |
y = __MKSMALLINT(s_y); |
1932 | 1775 |
# endif |
1776 |
#endif |
|
1777 |
%}. |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1778 |
^x @ y |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1779 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1780 |
|
294 | 1781 |
!GLXWorkstation methodsFor:'clearing'! |
1782 |
||
1783 |
glxClearIn:aGLXWindowId |
|
1784 |
"clear to current color" |
|
1785 |
||
1786 |
%{ /* NOCONTEXT */ |
|
1787 |
SETWIN(aGLXWindowId) |
|
1932 | 1788 |
#ifdef OPENGL |
1789 |
#else |
|
294 | 1790 |
clear(); |
1932 | 1791 |
#endif |
294 | 1792 |
%} |
1793 |
! |
|
1794 |
||
1795 |
glxCzclearCval:cval zval:zval in:aGLXWindowId |
|
1796 |
"clear to a color (cval) and clear z buffer to zval simultaniously" |
|
1797 |
||
1798 |
%{ /* NOCONTEXT */ |
|
1932 | 1799 |
SETWIN(aGLXWindowId) |
1800 |
#ifdef OPENGL |
|
1801 |
#else |
|
1802 |
# ifdef GLX |
|
294 | 1803 |
czclear((ulong)__intVal(cval), __intVal(zval)); |
1932 | 1804 |
# endif |
1805 |
#endif |
|
1806 |
%} |
|
294 | 1807 |
! |
1808 |
||
1809 |
glxZClearIn:aGLXWindowId |
|
1810 |
"clear z buffer" |
|
1811 |
||
1812 |
%{ /* NOCONTEXT */ |
|
1932 | 1813 |
SETWIN(aGLXWindowId) |
1814 |
#ifdef OPENGL |
|
1815 |
#else |
|
1816 |
# ifdef GLX |
|
294 | 1817 |
zclear(); |
1932 | 1818 |
# endif |
1819 |
#endif |
|
1820 |
%} |
|
294 | 1821 |
! ! |
1822 |
||
1823 |
!GLXWorkstation methodsFor:'color'! |
|
1824 |
||
1825 |
glxColor:index in:aGLXWindowId |
|
4718 | 1826 |
"set the drawing color; |
7656 | 1827 |
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
|
1828 |
otherwise, better results are expected with float values." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1829 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1830 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1831 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1832 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1833 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1834 |
#else |
294 | 1835 |
if (__isSmallInteger(index)) { |
7656 | 1836 |
color((Colorindex)(__intVal(index))); |
1837 |
RETURN (self); |
|
294 | 1838 |
} |
1839 |
if (__isFloat(index)) { |
|
7656 | 1840 |
colorf((float)(_floatVal(index))); |
1841 |
RETURN (self); |
|
294 | 1842 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1843 |
#endif |
1932 | 1844 |
%} |
294 | 1845 |
! |
1846 |
||
1847 |
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
|
1848 |
"set the drawing color, including alpha value. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1849 |
The args must be integer values within 0..255" |
294 | 1850 |
|
1851 |
%{ /* NOCONTEXT */ |
|
1852 |
short s_r, s_g, s_b, s_a; |
|
1853 |
||
1854 |
_INT_(r, s_r); |
|
1855 |
_INT_(g, s_g); |
|
1856 |
_INT_(b, s_b); |
|
1857 |
_INT_(a, s_a); |
|
1858 |
SETWIN(aGLXWindowId) |
|
1932 | 1859 |
#ifdef GLX |
294 | 1860 |
cpack((((((s_a<<8) | s_b) << 8) | s_g) << 8) | s_r); |
1932 | 1861 |
#endif |
1862 |
%} |
|
294 | 1863 |
! |
1864 |
||
1865 |
glxColorRed:r green:g blue:b in:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1866 |
"set the drawing color. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1867 |
The args must be integer values in 0..255" |
294 | 1868 |
|
1869 |
%{ /* NOCONTEXT */ |
|
1870 |
short s_r, s_g, s_b; |
|
1871 |
||
1872 |
_INT_(r, s_r); |
|
1873 |
_INT_(g, s_g); |
|
1874 |
_INT_(b, s_b); |
|
1875 |
SETWIN(aGLXWindowId) |
|
1932 | 1876 |
#ifdef GLX |
294 | 1877 |
RGBcolor(s_r, s_g, s_b); |
1932 | 1878 |
#endif |
1879 |
%} |
|
294 | 1880 |
! |
1881 |
||
528 | 1882 |
glxLrgbrangeRmin: rmin gmin: gmin bmin: bmin rmax: rmax gmax: gmax bmax: bmax |
1883 |
znear: znear zfar: zfar in: aGLXWindowId |
|
1884 |
||
1885 |
%{ /* NOCONTEXT */ |
|
1932 | 1886 |
SETWIN(aGLXWindowId) |
1887 |
#ifdef GLX |
|
4718 | 1888 |
lRGBrange(_shortVal(rmin), _shortVal(gmin), _shortVal(bmin), |
1889 |
_shortVal(rmax), _shortVal(gmax), _shortVal(bmax), |
|
528 | 1890 |
_longVal(znear), _longVal(zfar)); |
1932 | 1891 |
#endif |
1892 |
%} |
|
528 | 1893 |
! |
1894 |
||
1895 |
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
|
1896 |
"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
|
1897 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1898 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1899 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1900 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1901 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1902 |
#else |
528 | 1903 |
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
|
1904 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1905 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1906 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1907 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1908 |
glxTextcolor:tcolor in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1909 |
"change the color used for text drawing" |
294 | 1910 |
|
1911 |
%{ /* NOCONTEXT */ |
|
1932 | 1912 |
SETWIN(aGLXWindowId) |
1913 |
#ifdef GLX |
|
294 | 1914 |
textcolor(_colorindexVal(tcolor)); |
1932 | 1915 |
#endif |
1916 |
%} |
|
294 | 1917 |
! ! |
1918 |
||
528 | 1919 |
!GLXWorkstation methodsFor:'curves'! |
1920 |
||
1921 |
glxCurvebasis: basid in: aGLXWindowId |
|
1922 |
"sets the basis type of curves" |
|
1923 |
||
1924 |
%{ /* NOCONTEXT */ |
|
1925 |
SETWIN(aGLXWindowId) |
|
1932 | 1926 |
#ifdef GLX |
528 | 1927 |
curvebasis(_shortVal(basid)); |
1932 | 1928 |
#endif |
528 | 1929 |
%} |
1930 |
||
1931 |
"Modified: 19.3.1996 / 18:47:09 / cg" |
|
1932 |
! |
|
1933 |
||
1934 |
glxCurveit: iterationcount in: aGLXWindowId |
|
1935 |
"Iterates the top matrix on the stack as a forward difference |
|
1936 |
matrix, drawing as it goes along." |
|
1937 |
||
1938 |
%{ /* NOCONTEXT */ |
|
1939 |
SETWIN(aGLXWindowId) |
|
1932 | 1940 |
#ifdef GLX |
528 | 1941 |
curveit(_shortVal(iterationcount)); |
1932 | 1942 |
#endif |
528 | 1943 |
%} |
1944 |
||
1945 |
"Modified: 19.3.1996 / 18:48:57 / cg" |
|
1946 |
! |
|
1947 |
||
1948 |
glxCurveprecision: nsegments in: aGLXWindowId |
|
1949 |
"sets the number of line segments that make up a curve segment" |
|
1950 |
||
1951 |
%{ /* NOCONTEXT */ |
|
1952 |
SETWIN(aGLXWindowId) |
|
1932 | 1953 |
#ifdef GLX |
528 | 1954 |
curveprecision(_shortVal(nsegments)); |
1932 | 1955 |
#endif |
528 | 1956 |
%} |
1957 |
||
1958 |
"Modified: 19.3.1996 / 18:47:43 / cg" |
|
1959 |
! ! |
|
1960 |
||
294 | 1961 |
!GLXWorkstation methodsFor:'double buffering'! |
1962 |
||
1963 |
glxBackBufferIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1964 |
"switch to back buffer drawing - turning frontbuffer drawing off" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1965 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1966 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1967 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1968 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1969 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1970 |
# ifdef GLX |
294 | 1971 |
frontbuffer(FALSE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1972 |
# endif |
294 | 1973 |
backbuffer(TRUE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1974 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1975 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1976 |
! |
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 |
glxBackbuffer:b in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1979 |
"turn backBuffer drawing on/off. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1980 |
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
|
1981 |
... enabling the backbuffer automatically disables frontbuffer drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1982 |
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
|
1983 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1984 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1985 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1986 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1987 |
#else |
294 | 1988 |
backbuffer(_booleanVal(b)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1989 |
#endif |
294 | 1990 |
%} |
528 | 1991 |
|
1992 |
"Modified: 19.3.1996 / 18:45:05 / cg" |
|
294 | 1993 |
! |
1994 |
||
1995 |
glxDoubleBufferIn:aGLXWindowId |
|
1996 |
"set double buffer mode" |
|
1997 |
||
1998 |
%{ /* NOCONTEXT */ |
|
1999 |
SETWIN(aGLXWindowId) |
|
1932 | 2000 |
#ifdef OPENGL |
2001 |
#else |
|
294 | 2002 |
doublebuffer(); |
1932 | 2003 |
#endif |
294 | 2004 |
%} |
2005 |
! |
|
2006 |
||
2007 |
glxFrontBufferIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2008 |
"switch to front buffer drawing - turning backbuffer drawing off" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2009 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2010 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2011 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2012 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2013 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2014 |
# ifdef GLX |
294 | 2015 |
backbuffer(FALSE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2016 |
# endif |
294 | 2017 |
frontbuffer(TRUE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2018 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2019 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2020 |
! |
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 |
glxFrontbuffer:b in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2023 |
"turn on/off frontbuffer drawing. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2024 |
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
|
2025 |
... enabling the backbuffer automatically disables frontbuffer drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2026 |
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
|
2027 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2028 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2029 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2030 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2031 |
#else |
294 | 2032 |
frontbuffer(_booleanVal(b)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2033 |
#endif |
294 | 2034 |
%} |
528 | 2035 |
|
2036 |
"Modified: 19.3.1996 / 18:45:31 / cg" |
|
294 | 2037 |
! |
2038 |
||
2039 |
glxSingleBufferIn: aGLXWindowId |
|
2040 |
"set single buffer mode" |
|
2041 |
||
2042 |
%{ /* NOCONTEXT */ |
|
2043 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2044 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2045 |
#else |
294 | 2046 |
singlebuffer(); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2047 |
#endif |
294 | 2048 |
%} |
2049 |
! |
|
2050 |
||
2051 |
glxSwapBuffersIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2052 |
"swap the back and front buffers. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2053 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2054 |
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
|
2055 |
displayed and swap them for every frame." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2056 |
|
1903 | 2057 |
%{ /* UNLIMITEDSTACK */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2058 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2059 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2060 |
#else |
294 | 2061 |
swapbuffers(); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2062 |
#endif |
294 | 2063 |
%} |
528 | 2064 |
|
2065 |
"Modified: 19.3.1996 / 18:45:47 / cg" |
|
294 | 2066 |
! ! |
2067 |
||
2068 |
!GLXWorkstation methodsFor:'flat drawing'! |
|
2069 |
||
2070 |
glxBeginClosedLineIn:aGLXWindowId |
|
2071 |
"start a closed line" |
|
2072 |
||
2073 |
%{ /* NOCONTEXT */ |
|
1932 | 2074 |
#ifdef OPENGL |
2075 |
#else |
|
294 | 2076 |
SETWIN(aGLXWindowId) |
2077 |
bgnclosedline(); |
|
1932 | 2078 |
#endif |
294 | 2079 |
%} |
2080 |
! |
|
2081 |
||
2082 |
glxBeginLineIn:aGLXWindowId |
|
2083 |
"start a line group" |
|
2084 |
||
2075 | 2085 |
%{ /* NOCONTEXT STACK:32000 */ |
1932 | 2086 |
#ifdef OPENGL |
2087 |
#else |
|
294 | 2088 |
SETWIN(aGLXWindowId) |
2089 |
bgnline(); |
|
1932 | 2090 |
#endif |
294 | 2091 |
%} |
2092 |
! |
|
2093 |
||
2094 |
glxBeginPointIn:aGLXWindowId |
|
2095 |
"start a point-group" |
|
2096 |
||
2097 |
%{ /* NOCONTEXT */ |
|
1932 | 2098 |
#ifdef OPENGL |
2099 |
#else |
|
294 | 2100 |
SETWIN(aGLXWindowId) |
2101 |
bgnpoint(); |
|
1932 | 2102 |
#endif |
294 | 2103 |
%} |
2104 |
! |
|
2105 |
||
2106 |
glxBeginPolygonIn:aGLXWindowId |
|
2107 |
"start a polygon" |
|
2108 |
||
2109 |
%{ /* NOCONTEXT */ |
|
1932 | 2110 |
#ifdef OPENGL |
2111 |
#else |
|
294 | 2112 |
SETWIN(aGLXWindowId) |
2113 |
bgnpolygon(); |
|
1932 | 2114 |
#endif |
294 | 2115 |
%} |
2116 |
! |
|
2117 |
||
2118 |
glxBeginQuadrilateralStripIn:aGLXWindowId |
|
2119 |
"start a quadrilateral strip" |
|
2120 |
||
2121 |
%{ /* NOCONTEXT */ |
|
1932 | 2122 |
#ifdef OPENGL |
2123 |
#else |
|
294 | 2124 |
SETWIN(aGLXWindowId) |
2125 |
bgnqstrip(); |
|
1932 | 2126 |
#endif |
294 | 2127 |
%} |
2128 |
! |
|
2129 |
||
2130 |
glxBeginTriangleMeshIn:aGLXWindowId |
|
2131 |
"start a triangle mesh" |
|
2132 |
||
2133 |
%{ /* NOCONTEXT */ |
|
1932 | 2134 |
#ifdef OPENGL |
2135 |
#else |
|
294 | 2136 |
SETWIN(aGLXWindowId) |
2137 |
bgntmesh(); |
|
1932 | 2138 |
#endif |
294 | 2139 |
%} |
2140 |
! |
|
2141 |
||
2142 |
glxEndClosedLineIn:aGLXWindowId |
|
2143 |
"end a closed line" |
|
2144 |
||
2145 |
%{ /* NOCONTEXT */ |
|
1932 | 2146 |
#ifdef OPENGL |
2147 |
#else |
|
294 | 2148 |
SETWIN(aGLXWindowId) |
2149 |
endclosedline(); |
|
1932 | 2150 |
#endif |
294 | 2151 |
%} |
2152 |
! |
|
2153 |
||
2154 |
glxEndLineIn:aGLXWindowId |
|
2155 |
"end a line group" |
|
2156 |
||
2075 | 2157 |
%{ /* NOCONTEXT STACK:32000 */ |
1932 | 2158 |
#ifdef OPENGL |
2159 |
#else |
|
294 | 2160 |
SETWIN(aGLXWindowId) |
2161 |
endline(); |
|
1932 | 2162 |
#endif |
294 | 2163 |
%} |
2164 |
! |
|
2165 |
||
2166 |
glxEndPointIn:aGLXWindowId |
|
2167 |
"end a point group" |
|
2168 |
||
2169 |
%{ /* NOCONTEXT */ |
|
1932 | 2170 |
#ifdef OPENGL |
2171 |
#else |
|
294 | 2172 |
SETWIN(aGLXWindowId) |
2173 |
endpoint(); |
|
1932 | 2174 |
#endif |
294 | 2175 |
%} |
2176 |
! |
|
2177 |
||
2178 |
glxEndPolygonIn:aGLXWindowId |
|
2179 |
"end a polygon" |
|
2180 |
||
2181 |
%{ /* NOCONTEXT */ |
|
1932 | 2182 |
#ifdef OPENGL |
2183 |
#else |
|
294 | 2184 |
SETWIN(aGLXWindowId) |
2185 |
endpolygon(); |
|
1932 | 2186 |
#endif |
294 | 2187 |
%} |
2188 |
! |
|
2189 |
||
2190 |
glxEndQuadrilateralStripIn:aGLXWindowId |
|
2191 |
"end a quadrilateral strip" |
|
2192 |
||
2193 |
%{ /* NOCONTEXT */ |
|
1932 | 2194 |
#ifdef OPENGL |
2195 |
#else |
|
294 | 2196 |
SETWIN(aGLXWindowId) |
2197 |
endqstrip(); |
|
1932 | 2198 |
#endif |
294 | 2199 |
%} |
2200 |
! |
|
2201 |
||
2202 |
glxEndTriangleMeshIn:aGLXWindowId |
|
2203 |
"end a triangle mesh" |
|
2204 |
||
2205 |
%{ /* NOCONTEXT */ |
|
1932 | 2206 |
#ifdef OPENGL |
2207 |
#else |
|
294 | 2208 |
SETWIN(aGLXWindowId) |
2209 |
endtmesh(); |
|
1932 | 2210 |
#endif |
168 | 2211 |
%} |
2212 |
! ! |
|
2213 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2214 |
!GLXWorkstation methodsFor:'graphics position'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2215 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2216 |
glxMove2:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2217 |
"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
|
2218 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2219 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2220 |
float vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2221 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2222 |
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
|
2223 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2224 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2225 |
#else |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2226 |
move2((Coord)(c_v[0]), (Coord)(c_v[1])); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2227 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2228 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2229 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2230 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2231 |
"Modified: 22.3.1996 / 18:15:23 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2234 |
glxMove2X: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2235 |
"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
|
2236 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2237 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2238 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2239 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2240 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2241 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2242 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2243 |
SETWIN(aGLXWindowId) |
1932 | 2244 |
#ifdef OPENGL |
2245 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2246 |
move2(c_x, c_y); |
1932 | 2247 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2248 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2249 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2250 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2251 |
"Modified: 22.3.1996 / 18:15:02 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2252 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2253 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2254 |
glxMove2iX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2255 |
"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
|
2256 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2257 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2258 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2259 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2260 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2261 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2262 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2263 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2264 |
SETWIN(aGLXWindowId) |
1932 | 2265 |
#ifdef OPENGL |
2266 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2267 |
move2i(c_x, c_y); |
1932 | 2268 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2269 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2270 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2271 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2272 |
"Modified: 22.3.1996 / 18:15:08 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2273 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2274 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2275 |
glxMove2sX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2276 |
"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
|
2277 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2278 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2279 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2280 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2281 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2282 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2283 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2284 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2285 |
SETWIN(aGLXWindowId) |
1932 | 2286 |
#ifdef OPENGL |
2287 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2288 |
move2s(c_x, c_y); |
1932 | 2289 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2290 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2291 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2292 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2293 |
"Modified: 22.3.1996 / 18:15:13 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2296 |
glxMove:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2297 |
"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
|
2298 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2299 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2300 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2301 |
float vec[3], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2302 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2303 |
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
|
2304 |
SETWIN(aGLXWindowId) |
1932 | 2305 |
#ifdef OPENGL |
2306 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2307 |
move((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
1932 | 2308 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2309 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2310 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2311 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2312 |
"Modified: 22.3.1996 / 18:14:29 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2315 |
glxMoveX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2316 |
"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
|
2317 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2318 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2319 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2320 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2321 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2322 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2323 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2324 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2325 |
SETWIN(aGLXWindowId) |
1932 | 2326 |
#ifdef OPENGL |
2327 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2328 |
move(c_x, c_y, c_z); |
1932 | 2329 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2330 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2331 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2332 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2333 |
"Modified: 22.3.1996 / 18:14:38 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2334 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2335 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2336 |
glxMoveiX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2337 |
"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
|
2338 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2339 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2340 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2341 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2342 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2343 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2344 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2345 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2346 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2347 |
SETWIN(aGLXWindowId) |
1932 | 2348 |
#ifdef OPENGL |
2349 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2350 |
movei(c_x, c_y, c_z); |
1932 | 2351 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2352 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2353 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2354 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2355 |
"Modified: 22.3.1996 / 18:14:44 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2358 |
glxMovesX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2359 |
"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
|
2360 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2361 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2362 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2363 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2364 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2365 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2366 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2367 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2368 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2369 |
SETWIN(aGLXWindowId) |
1932 | 2370 |
#ifdef OPENGL |
2371 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2372 |
moves(c_x, c_y, c_z); |
1932 | 2373 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2374 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2375 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2376 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2377 |
"Modified: 22.3.1996 / 18:14:48 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2380 |
glxRmv2:v in: aGLXWindowId |
4718 | 2381 |
"change the graphics position to a 2D point, |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2382 |
the relative distance is passed in vector v" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2383 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2384 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2385 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2386 |
float vec[2], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2387 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2388 |
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
|
2389 |
SETWIN(aGLXWindowId) |
1932 | 2390 |
#ifdef OPENGL |
2391 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2392 |
rmv2((Coord)(c_v[0]), (Coord)(c_v[1])); |
1932 | 2393 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2394 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2395 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2396 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2397 |
"Modified: 22.3.1996 / 18:15:57 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2400 |
glxRmv2X: x y: y in: aGLXWindowId |
4718 | 2401 |
"change the graphics position to a 2D point, |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2402 |
the relative distance is passed in x/y" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2403 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2404 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2405 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2406 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2407 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2408 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2409 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2410 |
SETWIN(aGLXWindowId) |
1932 | 2411 |
#ifdef OPENGL |
2412 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2413 |
rmv2(c_x, c_y); |
1932 | 2414 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2415 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2416 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2417 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2418 |
"Modified: 22.3.1996 / 18:16:42 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2419 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2420 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2421 |
glxRmv2iX: x y: y in: aGLXWindowId |
4718 | 2422 |
"change the graphics position to a 2D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2423 |
the relative distance is passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2424 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2425 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2426 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2427 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2428 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2429 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2430 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2431 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2432 |
SETWIN(aGLXWindowId) |
1932 | 2433 |
#ifdef OPENGL |
2434 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2435 |
rmv2i(c_x, c_y); |
1932 | 2436 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2437 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2438 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2439 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2440 |
"Modified: 22.3.1996 / 18:16:39 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2441 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2442 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2443 |
glxRmv2sX: x y: y in: aGLXWindowId |
4718 | 2444 |
"change the graphics position to a 2D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2445 |
the relative distance is passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2446 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2447 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2448 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2449 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2450 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2451 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2452 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2453 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2454 |
SETWIN(aGLXWindowId) |
1932 | 2455 |
#ifdef OPENGL |
2456 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2457 |
rmv2s(c_x, c_y); |
1932 | 2458 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2459 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2460 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2461 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2462 |
"Modified: 22.3.1996 / 18:16:33 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2465 |
glxRmv:v in: aGLXWindowId |
4718 | 2466 |
"change the graphics position to a 3D point, |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2467 |
the relative distance is passed in vector v" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2468 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2469 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2470 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2471 |
float vec[3], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2472 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2473 |
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
|
2474 |
SETWIN(aGLXWindowId) |
1932 | 2475 |
#ifdef OPENGL |
2476 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2477 |
rmv((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
1932 | 2478 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2479 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2480 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2481 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2482 |
"Modified: 22.3.1996 / 18:16:08 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2485 |
glxRmvX: x y: y z: z in: aGLXWindowId |
4718 | 2486 |
"change the graphics position to a 3D point, |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2487 |
the relative distance is passed in x/y/z" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2488 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2489 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2490 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2491 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2492 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2493 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2494 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2495 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2496 |
SETWIN(aGLXWindowId) |
1932 | 2497 |
#ifdef OPENGL |
2498 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2499 |
rmv(c_x, c_y, c_z); |
1932 | 2500 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2501 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2502 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2503 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2504 |
"Modified: 22.3.1996 / 18:16:16 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2507 |
glxRmviX: x y: y z: z in: aGLXWindowId |
4718 | 2508 |
"change the graphics position to a 3D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2509 |
the relative distance is passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2510 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2511 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2512 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2513 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2514 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2515 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2516 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2517 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2518 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2519 |
SETWIN(aGLXWindowId) |
1932 | 2520 |
#ifdef OPENGL |
2521 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2522 |
rmvi(c_x, c_y, c_z); |
1932 | 2523 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2524 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2525 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2526 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2527 |
"Modified: 22.3.1996 / 18:16:21 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2530 |
glxRmvsX: x y: y z: z in: aGLXWindowId |
4718 | 2531 |
"change the graphics position to a 3D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2532 |
the relative distance is passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2533 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2534 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2535 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2536 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2537 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2538 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2539 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2540 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2541 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2542 |
SETWIN(aGLXWindowId) |
1932 | 2543 |
#ifdef OPENGL |
2544 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2545 |
rmvs(c_x, c_y, c_z); |
1932 | 2546 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2547 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2548 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2549 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2550 |
"Modified: 22.3.1996 / 18:16:25 / cg" |
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 |
|
168 | 2553 |
!GLXWorkstation methodsFor:'initialization'! |
2554 |
||
2555 |
initializeFor:aDisplayName |
|
169 | 2556 |
(super initializeFor:aDisplayName) isNil ifTrue:[^ nil]. |
168 | 2557 |
%{ |
2558 |
if (_INST(displayId) != nil) { |
|
185 | 2559 |
XSetErrorHandler(__XErrorHandler__); |
2560 |
} |
|
2561 |
%} |
|
2562 |
! |
|
2563 |
||
2564 |
initializeScreenProperties |
|
2565 |
super initializeScreenProperties. |
|
2566 |
||
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2567 |
"/ 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
|
2568 |
"/ 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
|
2569 |
"/ 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
|
2570 |
"/ 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
|
2571 |
"/ 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
|
2572 |
"/ 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
|
2573 |
"/ 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
|
2574 |
"/ have no documentation). |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2575 |
"/ Late note: setting the ForceGL classVar overrides above behavior. |
4718 | 2576 |
"/ it may be set from a startupScript with: 'GLXWorkstation forceGL:true' |
2577 |
"/ 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
|
2578 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2579 |
(self isTrueGL and:[ForceGL ~~ true]) ifTrue:[ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2580 |
glOK := (displayName = ':0') or:[displayName = ':0.0']. |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2581 |
] ifFalse:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2582 |
glOK := true. |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2583 |
]. |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2584 |
|
185 | 2585 |
%{ |
2586 |
Display *dpy = myDpy; |
|
2587 |
int dummy; |
|
2588 |
||
2589 |
if (ISCONNECTED) { |
|
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2590 |
_INST(hasStereoExtension) = false; |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2591 |
|
1932 | 2592 |
#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
|
2593 |
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
|
2594 |
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
|
2595 |
_INST(hasStereoExtension) = true; |
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2596 |
} |
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2597 |
#endif |
168 | 2598 |
} |
2599 |
%} |
|
2600 |
! ! |
|
2601 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2602 |
!GLXWorkstation methodsFor:'lines'! |
528 | 2603 |
|
2604 |
glxDeflinestyleN: n ls: ls in: aGLXWindowId |
|
2605 |
"define a line style" |
|
2606 |
||
2607 |
%{ /* NOCONTEXT */ |
|
1932 | 2608 |
SETWIN(aGLXWindowId) |
2609 |
#ifdef OPENGL |
|
2610 |
#else |
|
528 | 2611 |
deflinestyle(_shortVal(n), _linestyleVal(ls)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2612 |
#endif |
528 | 2613 |
%} |
2614 |
! |
|
2615 |
||
2616 |
glxDraw2:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2617 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2618 |
to a new 2D position, passed in vector v." |
528 | 2619 |
|
2620 |
%{ /* NOCONTEXT */ |
|
2621 |
float vec[2], *c_v; |
|
2622 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2623 |
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
|
2624 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2625 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2626 |
#else |
528 | 2627 |
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
|
2628 |
#endif |
528 | 2629 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2630 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2631 |
"Modified: 22.3.1996 / 18:03:29 / cg" |
528 | 2632 |
! |
2633 |
||
2634 |
glxDraw2X: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2635 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2636 |
to a new 2D position, passed in x/y." |
528 | 2637 |
|
2638 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2639 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2640 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2641 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2642 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2643 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2644 |
SETWIN(aGLXWindowId) |
1932 | 2645 |
#ifdef OPENGL |
2646 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2647 |
draw2(c_x, c_y); |
1932 | 2648 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2649 |
} |
528 | 2650 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2651 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2652 |
"Modified: 22.3.1996 / 18:03:50 / cg" |
528 | 2653 |
! |
2654 |
||
2655 |
glxDraw2iX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2656 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2657 |
to a new 2D position, passed in x/y." |
528 | 2658 |
|
2659 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2660 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2661 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2662 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2663 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2664 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2665 |
SETWIN(aGLXWindowId) |
1932 | 2666 |
#ifdef OPENGL |
2667 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2668 |
draw2i(c_x, c_y); |
1932 | 2669 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2670 |
} |
528 | 2671 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2672 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2673 |
"Modified: 22.3.1996 / 18:04:07 / cg" |
528 | 2674 |
! |
2675 |
||
2676 |
glxDraw2sX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2677 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2678 |
to a new 2D position, passed in x/y." |
528 | 2679 |
|
2680 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2681 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2682 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2683 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2684 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2685 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2686 |
SETWIN(aGLXWindowId) |
1932 | 2687 |
#ifdef OPENGL |
2688 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2689 |
draw2s(c_x, c_y); |
1932 | 2690 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2691 |
} |
528 | 2692 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2693 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2694 |
"Modified: 22.3.1996 / 18:04:19 / cg" |
528 | 2695 |
! |
2696 |
||
2697 |
glxDraw:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2698 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2699 |
to a new 3D position, passed in vector v." |
528 | 2700 |
|
2701 |
%{ /* NOCONTEXT */ |
|
2702 |
float vec[3], *c_v; |
|
2703 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2704 |
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
|
2705 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2706 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2707 |
#else |
528 | 2708 |
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
|
2709 |
#endif |
528 | 2710 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2711 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2712 |
"Modified: 22.3.1996 / 18:04:34 / cg" |
528 | 2713 |
! |
2714 |
||
2715 |
glxDrawX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2716 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2717 |
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
|
2718 |
The arguments may be floats, fractions or smallIntegers" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2719 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2720 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2721 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2722 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2723 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2724 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2725 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2726 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2727 |
SETWIN(aGLXWindowId) |
1932 | 2728 |
#ifdef OPENGL |
2729 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2730 |
draw(c_x, c_y, c_z); |
1932 | 2731 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2732 |
} |
528 | 2733 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2734 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2735 |
"Modified: 22.3.1996 / 18:04:46 / cg" |
528 | 2736 |
! |
2737 |
||
2738 |
glxDrawiX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2739 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2740 |
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
|
2741 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2742 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2743 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2744 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2745 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2746 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2747 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2748 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2749 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2750 |
SETWIN(aGLXWindowId) |
1932 | 2751 |
#ifdef OPENGL |
2752 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2753 |
drawi(c_x, c_y, c_z); |
1932 | 2754 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2755 |
} |
528 | 2756 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2757 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2758 |
"Modified: 22.3.1996 / 18:04:54 / cg" |
528 | 2759 |
! |
2760 |
||
2761 |
glxDrawsX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2762 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2763 |
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
|
2764 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2765 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2766 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2767 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2768 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2769 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2770 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2771 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2772 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2773 |
SETWIN(aGLXWindowId) |
1932 | 2774 |
#ifdef OPENGL |
2775 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2776 |
draws(c_x, c_y, c_z); |
1932 | 2777 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2778 |
} |
528 | 2779 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2780 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2781 |
"Modified: 22.3.1996 / 18:05:01 / cg" |
528 | 2782 |
! |
2783 |
||
2784 |
glxLinewidth: n in: aGLXWindowId |
|
2785 |
"set the linewidth" |
|
2786 |
||
2787 |
%{ /* NOCONTEXT */ |
|
2788 |
SETWIN(aGLXWindowId) |
|
1932 | 2789 |
#ifdef OPENGL |
2790 |
#else |
|
528 | 2791 |
linewidth(_shortVal(n)); |
1932 | 2792 |
#endif |
528 | 2793 |
%} |
2794 |
! |
|
2795 |
||
2796 |
glxLinewidthf: n in: aGLXWindowId |
|
2797 |
"set the linewidth" |
|
2798 |
||
2799 |
%{ /* NOCONTEXT */ |
|
2800 |
SETWIN(aGLXWindowId) |
|
1932 | 2801 |
#ifdef OPENGL |
2802 |
#else |
|
528 | 2803 |
linewidthf(_floatVal(n)); |
1932 | 2804 |
#endif |
528 | 2805 |
RETURN (true); |
2806 |
%} |
|
2807 |
! |
|
2808 |
||
2809 |
glxRdr2:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2810 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2811 |
to a new 2D position, passing the relative distance in the vector v." |
528 | 2812 |
|
2813 |
%{ /* NOCONTEXT */ |
|
2814 |
float vec[2], *c_v; |
|
2815 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2816 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
528 | 2817 |
SETWIN(aGLXWindowId) |
1932 | 2818 |
#ifdef OPENGL |
2819 |
#else |
|
528 | 2820 |
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
|
2821 |
#endif |
528 | 2822 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2823 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2824 |
"Modified: 22.3.1996 / 18:05:54 / cg" |
528 | 2825 |
! |
2826 |
||
2827 |
glxRdr2X: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2828 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2829 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2830 |
|
2831 |
%{ /* NOCONTEXT */ |
|
2832 |
Coord c_x, c_y; |
|
2833 |
||
2834 |
_COORD_ (x, c_x) |
|
2835 |
_COORD_ (y, c_y) |
|
2836 |
SETWIN(aGLXWindowId) |
|
1932 | 2837 |
#ifdef OPENGL |
2838 |
#else |
|
528 | 2839 |
rdr2(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2840 |
#endif |
528 | 2841 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2842 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2843 |
"Modified: 22.3.1996 / 18:06:20 / cg" |
528 | 2844 |
! |
2845 |
||
2846 |
glxRdr2iX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2847 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2848 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2849 |
|
2850 |
%{ /* NOCONTEXT */ |
|
2851 |
Icoord c_x, c_y; |
|
2852 |
||
2853 |
_ICOORD_ (x, c_x) |
|
2854 |
_ICOORD_ (y, c_y) |
|
2855 |
SETWIN(aGLXWindowId) |
|
1932 | 2856 |
#ifdef OPENGL |
2857 |
#else |
|
528 | 2858 |
rdr2i(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2859 |
#endif |
528 | 2860 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2861 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2862 |
"Modified: 22.3.1996 / 18:06:28 / cg" |
528 | 2863 |
! |
2864 |
||
2865 |
glxRdr2sX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2866 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2867 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2868 |
|
2869 |
%{ /* NOCONTEXT */ |
|
2870 |
Scoord c_x, c_y; |
|
2871 |
||
2872 |
_SCOORD_ (x, c_x) |
|
2873 |
_SCOORD_ (y, c_y) |
|
2874 |
SETWIN(aGLXWindowId) |
|
1932 | 2875 |
#ifdef OPENGL |
2876 |
#else |
|
528 | 2877 |
rdr2s(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2878 |
#endif |
528 | 2879 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2880 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2881 |
"Modified: 22.3.1996 / 18:06:34 / cg" |
528 | 2882 |
! |
2883 |
||
2884 |
glxRdr:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2885 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2886 |
to a new 3D position, passing the relative distance in the vector v." |
528 | 2887 |
|
2888 |
%{ /* NOCONTEXT */ |
|
2889 |
float vec[3], *c_v; |
|
2890 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2891 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
528 | 2892 |
SETWIN(aGLXWindowId) |
1932 | 2893 |
#ifdef OPENGL |
2894 |
#else |
|
528 | 2895 |
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
|
2896 |
#endif |
528 | 2897 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2898 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2899 |
"Modified: 22.3.1996 / 18:06:07 / cg" |
528 | 2900 |
! |
2901 |
||
2902 |
glxRdrX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2903 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2904 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2905 |
|
2906 |
%{ /* NOCONTEXT */ |
|
2907 |
Coord c_x, c_y, c_z; |
|
2908 |
||
2909 |
_COORD_ (x, c_x) |
|
2910 |
_COORD_ (y, c_y) |
|
2911 |
_COORD_ (z, c_z) |
|
2912 |
SETWIN(aGLXWindowId) |
|
1932 | 2913 |
#ifdef OPENGL |
2914 |
#else |
|
528 | 2915 |
rdr(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2916 |
#endif |
528 | 2917 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2918 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2919 |
"Modified: 22.3.1996 / 18:06:44 / cg" |
528 | 2920 |
! |
2921 |
||
2922 |
glxRdriX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2923 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2924 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2925 |
|
2926 |
%{ /* NOCONTEXT */ |
|
2927 |
Icoord c_x, c_y, c_z; |
|
2928 |
||
2929 |
_ICOORD_ (x, c_x) |
|
2930 |
_ICOORD_ (y, c_y) |
|
2931 |
_ICOORD_ (z, c_z) |
|
2932 |
SETWIN(aGLXWindowId) |
|
1932 | 2933 |
#ifdef OPENGL |
2934 |
#else |
|
528 | 2935 |
rdri(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2936 |
#endif |
528 | 2937 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2938 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2939 |
"Modified: 22.3.1996 / 18:06:51 / cg" |
528 | 2940 |
! |
2941 |
||
2942 |
glxRdrsX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2943 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2944 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2945 |
|
2946 |
%{ /* NOCONTEXT */ |
|
2947 |
Scoord c_x, c_y, c_z; |
|
2948 |
||
2949 |
_SCOORD_ (x, c_x) |
|
2950 |
_SCOORD_ (y, c_y) |
|
2951 |
_SCOORD_ (z, c_z) |
|
2952 |
SETWIN(aGLXWindowId) |
|
1932 | 2953 |
#ifdef OPENGL |
2954 |
#else |
|
528 | 2955 |
rdrs(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2956 |
#endif |
528 | 2957 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2958 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2959 |
"Modified: 22.3.1996 / 18:06:55 / cg" |
528 | 2960 |
! |
2961 |
||
2962 |
glxSetlinestyle: index in: aGLXWindowId |
|
2963 |
"set the linestyle" |
|
2964 |
||
2965 |
%{ /* NOCONTEXT */ |
|
2966 |
SETWIN(aGLXWindowId) |
|
1932 | 2967 |
#ifdef OPENGL |
2968 |
#else |
|
528 | 2969 |
setlinestyle(_shortVal(index)); |
1932 | 2970 |
#endif |
2971 |
%} |
|
528 | 2972 |
! ! |
2973 |
||
294 | 2974 |
!GLXWorkstation methodsFor:'materials & lights'! |
2975 |
||
2976 |
glxLmbind:target index:index in:aGLXWindowId |
|
2977 |
"select a material, light or lighting model. |
|
2978 |
target must be a symbol from: #material, #backMaterial, |
|
2979 |
#light0-light7 or #lightModel." |
|
2980 |
||
2981 |
%{ /* NOCONTEXT */ |
|
2982 |
#ifdef GLX |
|
2983 |
short defType; |
|
2984 |
short i_index; |
|
2985 |
||
2986 |
if (target == @symbol(material)) |
|
2987 |
defType = MATERIAL; |
|
2988 |
else if (target == @symbol(backMaterial)) |
|
2989 |
defType = BACKMATERIAL; |
|
2990 |
else if (target == @symbol(light0)) |
|
2991 |
defType = LIGHT0; |
|
2992 |
else if (target == @symbol(light1)) |
|
2993 |
defType = LIGHT1; |
|
2994 |
else if (target == @symbol(light2)) |
|
2995 |
defType = LIGHT2; |
|
2996 |
else if (target == @symbol(light3)) |
|
2997 |
defType = LIGHT3; |
|
2998 |
else if (target == @symbol(light4)) |
|
2999 |
defType = LIGHT4; |
|
3000 |
else if (target == @symbol(light5)) |
|
3001 |
defType = LIGHT5; |
|
3002 |
else if (target == @symbol(light6)) |
|
3003 |
defType = LIGHT6; |
|
3004 |
else if (target == @symbol(light7)) |
|
3005 |
defType = LIGHT7; |
|
3006 |
else if (target == @symbol(lightModel)) |
|
3007 |
defType = LMODEL; |
|
4718 | 3008 |
else { |
3009 |
RETURN (nil); |
|
294 | 3010 |
} |
3011 |
||
3012 |
_INT_ (index, i_index); |
|
3013 |
SETWIN(aGLXWindowId) |
|
3014 |
lmbind(defType, i_index); |
|
1932 | 3015 |
#endif |
3016 |
%} |
|
294 | 3017 |
! |
3018 |
||
3019 |
glxLmdef:what index:index np:np props:props in:aGLXWindowId |
|
3020 |
"define a material, light source or lighting model; |
|
3021 |
what must be one of #material, #light or #lightModel. |
|
3022 |
props must be a FloatArray or a subclass of FloatArray" |
|
3023 |
||
3024 |
%{ /* NOCONTEXT */ |
|
3025 |
#ifdef GLX |
|
3026 |
short defType; |
|
3027 |
short i_index, i_np; |
|
3028 |
float *fp; |
|
3029 |
OBJ cls; |
|
3030 |
int ninstVars, nInstBytes; |
|
3031 |
||
3032 |
if (what == @symbol(material)) |
|
3033 |
defType = DEFMATERIAL; |
|
3034 |
else if (what == @symbol(light)) |
|
3035 |
defType = DEFLIGHT; |
|
3036 |
else if (what == @symbol(lightModel)) |
|
3037 |
defType = DEFLMODEL; |
|
3038 |
else { |
|
1932 | 3039 |
RETURN (nil); |
294 | 3040 |
} |
3041 |
||
3042 |
_INT_ (index, i_index); |
|
3043 |
_INT_ (np, i_np); |
|
3044 |
||
3045 |
if (! _isNonNilObject(props)) fp = NULL; |
|
3046 |
else { |
|
3047 |
cls = __qClass(props); |
|
350 | 3048 |
if (cls == @global(FloatArray)) |
294 | 3049 |
fp = _FloatArrayInstPtr(props)->f_element; |
3050 |
else { |
|
3051 |
if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) { |
|
3052 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
3053 |
fp = (float *) &(_InstPtr(props)->i_instvars[ninstVars]); |
|
3054 |
} else { |
|
1932 | 3055 |
RETURN (nil); |
294 | 3056 |
} |
4718 | 3057 |
} |
294 | 3058 |
} |
3059 |
SETWIN(aGLXWindowId) |
|
3060 |
lmdef(defType, i_index, i_np, fp); |
|
1932 | 3061 |
#endif |
3062 |
%} |
|
294 | 3063 |
! |
3064 |
||
3065 |
glxTevbind:target index:index in:aGLXWindowId |
|
3066 |
"bind a texture environment; target must be 0 |
|
3067 |
or the symbol #env0." |
|
3068 |
||
3069 |
%{ /* NOCONTEXT */ |
|
3070 |
#ifdef GLX |
|
3071 |
long t; |
|
3072 |
||
3073 |
if (__isSmallInteger(target)) { |
|
3074 |
t = __intVal(target); |
|
3075 |
} else { |
|
3076 |
if (target == @symbol(env0)) { |
|
3077 |
t = TV_ENV0; |
|
3078 |
} else { |
|
1932 | 3079 |
RETURN (nil); |
294 | 3080 |
} |
3081 |
} |
|
3082 |
SETWIN(aGLXWindowId) |
|
3083 |
tevbind(t, __intVal(index)); |
|
1932 | 3084 |
#endif |
3085 |
%} |
|
294 | 3086 |
! |
3087 |
||
3088 |
glxTevdef:index np:np props:props in:aGLXWindowId |
|
3089 |
||
3090 |
%{ /* NOCONTEXT */ |
|
3091 |
#ifdef GLX |
|
3092 |
const float *fp; |
|
3093 |
float fbuff[30]; |
|
3094 |
||
3095 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3096 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
294 | 3097 |
tevdef(__intVal(index), __intVal(np), fp); |
1932 | 3098 |
#endif |
3099 |
%} |
|
294 | 3100 |
! |
3101 |
||
3102 |
glxTexDef2d:index nc:nc width:w height:h bits:image np:np props:props in:aGLXWindowId |
|
3103 |
"define a 2D texture. index is the 'name' of the texture; |
|
3104 |
nc is the number of components (1-4) per pixel; |
|
3105 |
w/h define the size of the texture; bits is a byteArray containing the |
|
3106 |
long-word aligned pixel data; np is the number of props found in |
|
3107 |
the floatArray props. Props must be delimited by a 0.0 entry." |
|
3108 |
||
3109 |
%{ /* NOCONTEXT */ |
|
6254 | 3110 |
#ifdef GLX |
294 | 3111 |
unsigned char *cp; |
3112 |
const float *fp; |
|
3113 |
OBJ cls; |
|
3114 |
float fbuff[30]; |
|
3115 |
||
5479
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3116 |
if (__isByteArrayLike(image)) { |
6254 | 3117 |
cp = _ByteArrayInstPtr(image)->ba_element; |
3118 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
|
3119 |
||
3120 |
SETWIN(aGLXWindowId) |
|
3121 |
texdef2d(__intVal(index), __intVal(nc), __intVal(w), __intVal(h), |
|
3122 |
(const unsigned long *)cp, __intVal(np), fp); |
|
294 | 3123 |
} |
3124 |
#endif |
|
3125 |
%} |
|
3126 |
! |
|
3127 |
||
3128 |
glxTexDef3d:index nc:nc width:w height:h depth:d bits:image np:np props:props in:aGLXWindowId |
|
3129 |
"define a 3D texture. index is the 'name' of the texture; |
|
3130 |
nc is the number of components (1-4) per pixel; |
|
3131 |
w/h/d define the size of the texture; bits is a byteArray containing the |
|
3132 |
long-word aligned pixel data; np is the number of props found in |
|
3133 |
the floatArray props. Props must be delimited by a 0.0 entry." |
|
3134 |
||
3135 |
%{ /* NOCONTEXT */ |
|
3136 |
#ifdef GLX |
|
3137 |
unsigned char *cp; |
|
3138 |
const float *fp; |
|
3139 |
OBJ cls; |
|
3140 |
float fbuff[30]; |
|
3141 |
||
5479
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3142 |
if (__isByteArrayLike(image)) { |
6254 | 3143 |
cp = _ByteArrayInstPtr(image)->ba_element; |
3144 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
|
3145 |
||
3146 |
SETWIN(aGLXWindowId) |
|
3147 |
texdef3d(__intVal(index), __intVal(nc), __intVal(w), __intVal(h), |
|
3148 |
__intVal(d), |
|
3149 |
(const unsigned long *)cp, __intVal(np), fp); |
|
294 | 3150 |
} |
3151 |
#endif |
|
3152 |
%} |
|
3153 |
! |
|
3154 |
||
3155 |
glxTexbind:target index:index in:aGLXWindowId |
|
3156 |
"bind a texture; target must be an integer or one |
|
3157 |
of the symbols #texture0, #textureDetail or #textureIdle." |
|
3158 |
||
3159 |
%{ /* NOCONTEXT */ |
|
3160 |
#ifdef GLX |
|
3161 |
long t; |
|
3162 |
||
3163 |
if (__isSmallInteger(target)) { |
|
3164 |
t = __intVal(target); |
|
3165 |
} else { |
|
3166 |
if (target == @symbol(texture0)) { |
|
3167 |
t = TX_TEXTURE_0; |
|
3168 |
} else if (target == @symbol(textureDetail)) { |
|
3169 |
t = TX_TEXTURE_DETAIL; |
|
3170 |
} else if (target == @symbol(textureIdle)) { |
|
3171 |
t = TX_TEXTURE_IDLE; |
|
3172 |
} else { |
|
1932 | 3173 |
RETURN (nil); |
294 | 3174 |
} |
3175 |
} |
|
3176 |
SETWIN(aGLXWindowId) |
|
3177 |
texbind(t, __intVal(index)); |
|
1932 | 3178 |
#endif |
3179 |
%} |
|
294 | 3180 |
! ! |
3181 |
||
3182 |
!GLXWorkstation methodsFor:'matrix stack'! |
|
3183 |
||
3184 |
glxGetMatrix:arrayOf16Floats in:aGLXWindowId |
|
3185 |
"argument must be an array (a matrix) of 16 floats. The current matrix |
|
3186 |
will be stored into that." |
|
3187 |
||
3188 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3189 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3190 |
#else |
294 | 3191 |
Matrix matrix; |
3192 |
||
3193 |
SETWIN(aGLXWindowId) |
|
3194 |
getmatrix(matrix); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3195 |
if (! __glx_putFloatsFromInto(matrix, arrayOf16Floats, 16)) RETURN(false); |
1932 | 3196 |
#endif |
3197 |
%} |
|
294 | 3198 |
! |
3199 |
||
3200 |
glxLoadMatrix:arrayOf16Floats in:aGLXWindowId |
|
3201 |
"argument must be an array(a matrix) of 16 floats. The current matrix |
|
3202 |
will be loaded from that." |
|
3203 |
||
3204 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3205 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3206 |
#else |
294 | 3207 |
Matrix matrix; |
3208 |
Matrix *m; |
|
3209 |
||
2814 | 3210 |
if (! (m = __glx_getFloatsFromMatrixInto(arrayOf16Floats, matrix))) RETURN (false); |
294 | 3211 |
SETWIN(aGLXWindowId) |
3212 |
loadmatrix(*m); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3213 |
#endif |
294 | 3214 |
%} |
3215 |
! |
|
3216 |
||
3217 |
glxMultMatrix:arrayOf16Floats in:aGLXWindowId |
|
3218 |
"argument must be an array(a matrix) of 16 floats containing a |
|
3219 |
matrix to multiply into the current matrix." |
|
3220 |
||
3221 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3222 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3223 |
#else |
294 | 3224 |
Matrix matrix; |
3225 |
Matrix *m; |
|
3226 |
||
2814 | 3227 |
if (! (m = __glx_getFloatsFromMatrixInto(arrayOf16Floats, matrix))) RETURN (false); |
294 | 3228 |
SETWIN(aGLXWindowId) |
3229 |
multmatrix(*m); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3230 |
#endif |
294 | 3231 |
%} |
3232 |
! |
|
3233 |
||
3234 |
glxPopmatrixIn:aGLXWindowId |
|
3235 |
"pop transformation stack" |
|
3236 |
||
3237 |
%{ /* NOCONTEXT */ |
|
3238 |
SETWIN(aGLXWindowId) |
|
1932 | 3239 |
#ifdef OPENGL |
3240 |
#else |
|
294 | 3241 |
popmatrix(); |
1932 | 3242 |
#endif |
294 | 3243 |
%} |
3244 |
! |
|
3245 |
||
3246 |
glxPushmatrixIn:aGLXWindowId |
|
3247 |
"push down transformation stack" |
|
3248 |
||
3249 |
%{ /* NOCONTEXT */ |
|
3250 |
SETWIN(aGLXWindowId) |
|
1932 | 3251 |
#ifdef OPENGL |
3252 |
#else |
|
294 | 3253 |
pushmatrix(); |
1932 | 3254 |
#endif |
294 | 3255 |
%} |
3256 |
! ! |
|
3257 |
||
3258 |
!GLXWorkstation methodsFor:'misc'! |
|
3259 |
||
3260 |
glxGconfigIn:aGLXWindowId |
|
3261 |
"must be sent after RGBmode, doubleBuffer etc. to have these |
|
3262 |
changes really take effect. See GLX manual. |
|
7656 | 3263 |
(Actually, it seems to be not allowed - I don't really know)" |
294 | 3264 |
|
3265 |
%{ /* NOCONTEXT */ |
|
3266 |
SETWIN(aGLXWindowId) |
|
1932 | 3267 |
#ifdef OPENGL |
3268 |
#else |
|
294 | 3269 |
gconfig(); |
1932 | 3270 |
#endif |
294 | 3271 |
%} |
3272 |
! |
|
3273 |
||
3274 |
glxMmode:aSymbol in:aGLXWindowId |
|
3275 |
"set matrix mode: #single, #viewing, #projection or #texture" |
|
3276 |
||
3277 |
%{ /* NOCONTEXT */ |
|
3278 |
#ifdef GLX |
|
3279 |
if (aSymbol == @symbol(single)) { |
|
3280 |
mmode(MSINGLE); |
|
3281 |
RETURN (true); |
|
3282 |
} |
|
3283 |
if (aSymbol == @symbol(viewing)) { |
|
3284 |
mmode(MVIEWING); |
|
3285 |
RETURN (true); |
|
3286 |
} |
|
3287 |
if (aSymbol == @symbol(projection)) { |
|
3288 |
mmode(MPROJECTION); |
|
3289 |
RETURN (true); |
|
3290 |
} |
|
3291 |
if (aSymbol == @symbol(texture)) { |
|
3292 |
mmode(MTEXTURE); |
|
3293 |
RETURN (true); |
|
3294 |
} |
|
3295 |
#endif |
|
3296 |
%} |
|
3297 |
. |
|
3298 |
^ false |
|
3299 |
! |
|
3300 |
||
3301 |
glxNmode:aSymbol in:aGLXWindowId |
|
3302 |
"set normalize mode: #auto, #normalize" |
|
3303 |
||
3304 |
%{ /* NOCONTEXT */ |
|
3305 |
#ifdef GLX |
|
3306 |
if (aSymbol == @symbol(auto)) { |
|
3307 |
nmode(NAUTO); |
|
3308 |
RETURN (true); |
|
3309 |
} |
|
3310 |
if (aSymbol == @symbol(normalize)) { |
|
3311 |
nmode(NNORMALIZE); |
|
3312 |
RETURN (true); |
|
3313 |
} |
|
3314 |
#endif |
|
3315 |
%} |
|
3316 |
. |
|
3317 |
^ false |
|
3318 |
! |
|
3319 |
||
3320 |
glxRGBmodeIn:aGLXWindowId |
|
3321 |
"set true color mode (no colormap)" |
|
3322 |
||
3323 |
%{ /* NOCONTEXT */ |
|
3324 |
#ifdef GLX |
|
3325 |
SETWIN(aGLXWindowId) |
|
3326 |
RGBmode(); |
|
3327 |
RETURN (true); |
|
3328 |
#endif |
|
3329 |
%} |
|
3330 |
. |
|
3331 |
^ false |
|
3332 |
! ! |
|
3333 |
||
3334 |
!GLXWorkstation methodsFor:'objects'! |
|
3335 |
||
3336 |
glxCallObject:obj in:aGLXWindowId |
|
3337 |
"perform the commands of an object (macro)." |
|
3338 |
||
2075 | 3339 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3340 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3341 |
#else |
294 | 3342 |
if (__isSmallInteger(obj)) { |
3343 |
SETWIN(aGLXWindowId) |
|
3344 |
callobj(_objectVal(obj)); |
|
3345 |
RETURN (true); |
|
3346 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3347 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3348 |
%}. |
294 | 3349 |
^ false |
3350 |
! |
|
3351 |
||
3352 |
glxCloseObjectIn:aGLXWindowId |
|
3353 |
"end object defnition" |
|
3354 |
||
2075 | 3355 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3356 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3357 |
#else |
294 | 3358 |
SETWIN(aGLXWindowId) |
3359 |
closeobj(); |
|
3360 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3361 |
#endif |
294 | 3362 |
%} |
3363 |
! |
|
3364 |
||
3365 |
glxDeleteObject:obj in:aGLXWindowId |
|
3366 |
||
2075 | 3367 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3368 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3369 |
#else |
1882 | 3370 |
if (__isSmallInteger(obj)) { |
4718 | 3371 |
SETWIN(aGLXWindowId) |
3372 |
delobj(_objectVal(obj)); |
|
3373 |
RETURN (true); |
|
1882 | 3374 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3375 |
#endif |
294 | 3376 |
%} |
3377 |
! |
|
3378 |
||
3379 |
glxGenObjectIn:aGLXWindowId |
|
3380 |
"return a new (free & unused) object id for use |
|
3381 |
with makeObj" |
|
3382 |
||
3383 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3384 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3385 |
#else |
294 | 3386 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3387 |
RETURN (__MKSMALLINT(genobj())); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3388 |
#endif |
294 | 3389 |
%} |
3390 |
! |
|
3391 |
||
3392 |
glxGetopenobjIn:aGLXWindowId |
|
3393 |
"return the currently open objects id; -1 if none is open" |
|
3394 |
||
3395 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3396 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3397 |
#else |
294 | 3398 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3399 |
RETURN (__MKSMALLINT(getopenobj())); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3400 |
#endif |
294 | 3401 |
%} |
3402 |
! |
|
3403 |
||
3404 |
glxIsobj:obj in:aGLXWindowId |
|
3405 |
"return true, if obj is a valid object id" |
|
3406 |
||
3407 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3408 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3409 |
#else |
294 | 3410 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3411 |
RETURN (__MKBOOLEAN(isobj(_objectVal(obj)))); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3412 |
#endif |
294 | 3413 |
%} |
3414 |
! |
|
3415 |
||
3416 |
glxMakeObject:id in:aGLXWindowId |
|
3417 |
"start object definition - |
|
3418 |
another name conflict" |
|
3419 |
||
2075 | 3420 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3421 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3422 |
#else |
294 | 3423 |
if (__isSmallInteger(id)) { |
3424 |
SETWIN(aGLXWindowId) |
|
3425 |
makeobj(_objectVal(id)); |
|
3426 |
RETURN (true); |
|
3427 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3428 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3429 |
%}. |
294 | 3430 |
^ false |
3431 |
! ! |
|
3432 |
||
3433 |
!GLXWorkstation methodsFor:'patches & surfaces'! |
|
3434 |
||
3435 |
glxBeginCurveIn:aGLXWindowId |
|
3436 |
"start a NURBS curve def - in real GL only" |
|
3437 |
||
3438 |
%{ /* NOCONTEXT */ |
|
1932 | 3439 |
SETWIN(aGLXWindowId) |
3440 |
#ifdef GLX |
|
294 | 3441 |
bgncurve(); |
1932 | 3442 |
#endif |
3443 |
%} |
|
294 | 3444 |
! |
3445 |
||
3446 |
glxBeginSurfaceIn:aGLXWindowId |
|
3447 |
"start a NURBS surface def - in real GL only" |
|
3448 |
||
3449 |
%{ /* NOCONTEXT */ |
|
1932 | 3450 |
SETWIN(aGLXWindowId) |
3451 |
#ifdef GLX |
|
294 | 3452 |
bgnsurface(); |
1932 | 3453 |
#endif |
3454 |
%} |
|
294 | 3455 |
! |
3456 |
||
3457 |
glxDefBasis:id mat:aMatrix in:aGLXWindowId |
|
528 | 3458 |
"define the basis matrix for a patch or curve" |
294 | 3459 |
|
3460 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3461 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3462 |
#else |
294 | 3463 |
Matrix matrix; |
3464 |
Matrix *m; |
|
3465 |
||
2814 | 3466 |
if (! (m = __glx_getFloatsFromMatrixInto(aMatrix, matrix))) RETURN (false); |
294 | 3467 |
if (__isSmallInteger(id)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3468 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3469 |
defbasis((short)(__intVal(id)), *m); |
294 | 3470 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3471 |
#endif |
1932 | 3472 |
%} |
528 | 3473 |
|
3474 |
"Modified: 19.3.1996 / 18:52:56 / cg" |
|
294 | 3475 |
! |
3476 |
||
3477 |
glxEndCurveIn:aGLXWindowId |
|
3478 |
"end a NURBS curve def - in real GL only" |
|
3479 |
||
3480 |
%{ /* NOCONTEXT */ |
|
1932 | 3481 |
SETWIN(aGLXWindowId) |
3482 |
#ifdef GLX |
|
294 | 3483 |
endcurve(); |
1932 | 3484 |
#endif |
3485 |
%} |
|
294 | 3486 |
! |
3487 |
||
3488 |
glxEndSurfaceIn:aGLXWindowId |
|
3489 |
"end a NURBS surface def - in real GL only" |
|
3490 |
||
3491 |
%{ /* NOCONTEXT */ |
|
1932 | 3492 |
SETWIN(aGLXWindowId) |
3493 |
#ifdef GLX |
|
294 | 3494 |
endsurface(); |
1932 | 3495 |
#endif |
3496 |
%} |
|
294 | 3497 |
! |
3498 |
||
4718 | 3499 |
glxNurbsSurfaceUKnotCount: uKnotCount uKnot: uKnot |
294 | 3500 |
vKnotCount: vKnotCount vKnot: vKnot |
4718 | 3501 |
uOffset: uOffset vOffset: vOffset |
3502 |
ctlArray: ctlArray |
|
3503 |
uOrder: uOrder vOrder: vOrder |
|
294 | 3504 |
type: type in: aGLXWindowId |
3505 |
||
3506 |
| ctlPoints i | |
|
3507 |
ctlPoints := DoubleArray new: ctlArray size * (ctlArray first size). |
|
3508 |
i := 1. |
|
3509 |
ctlArray do: [:point | |
|
4718 | 3510 |
point do: [:coord | |
294 | 3511 |
ctlPoints at: i put: coord. |
3512 |
i := i + 1]]. |
|
3513 |
||
3514 |
%{ /* NOCONTEXT */ |
|
3515 |
#ifdef GLX |
|
3516 |
char *uKnotElements, *vKnotElements, *ctlElements; |
|
3517 |
OBJ cls; |
|
3518 |
int ninstVars, nInstBytes; |
|
3519 |
||
3520 |
SETWIN(aGLXWindowId) |
|
3521 |
cls = __qClass(ctlPoints); |
|
3522 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
3523 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
|
3524 |
||
3525 |
ctlElements = (char *)(_InstPtr(ctlPoints)) + nInstBytes; |
|
3526 |
uKnotElements = (char *)(_InstPtr(uKnot)) + nInstBytes; |
|
3527 |
vKnotElements = (char *)(_InstPtr(vKnot)) + nInstBytes; |
|
3528 |
||
3529 |
nurbssurface ( |
|
3530 |
__intVal(uKnotCount), (double *)uKnotElements, |
|
3531 |
__intVal(vKnotCount), (double *)vKnotElements, |
|
3532 |
__intVal(uOffset), __intVal(vOffset), |
|
4718 | 3533 |
(double *)ctlElements, |
294 | 3534 |
__intVal(uOrder), __intVal(vOrder), __intVal(type)); |
3535 |
RETURN(true); |
|
3536 |
#endif |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3537 |
%}. |
294 | 3538 |
^ false |
3539 |
! |
|
3540 |
||
3541 |
glxPatchBasisU:u v:v in:aGLXWindowId |
|
528 | 3542 |
"set the two basis matrices for a patch" |
294 | 3543 |
|
3544 |
%{ /* NOCONTEXT */ |
|
3545 |
if (__bothSmallInteger(u, v)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3546 |
SETWIN(aGLXWindowId) |
1932 | 3547 |
#ifdef OPENGL |
3548 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3549 |
patchbasis((long)__intVal(u), (long)__intVal(v)); |
1932 | 3550 |
#endif |
294 | 3551 |
} |
1932 | 3552 |
%} |
528 | 3553 |
|
3554 |
"Modified: 19.3.1996 / 18:53:18 / cg" |
|
294 | 3555 |
! |
3556 |
||
3557 |
glxPatchCurvesU:u v:v in:aGLXWindowId |
|
528 | 3558 |
"set the number of curves to be drawn in each direction on a patch" |
294 | 3559 |
|
3560 |
%{ /* NOCONTEXT */ |
|
3561 |
if (__bothSmallInteger(u, v)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3562 |
SETWIN(aGLXWindowId) |
1932 | 3563 |
#ifdef OPENGL |
3564 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3565 |
patchcurves((long)__intVal(u), (long)__intVal(v)); |
1932 | 3566 |
#endif |
294 | 3567 |
} |
1932 | 3568 |
%} |
528 | 3569 |
|
3570 |
"Modified: 19.3.1996 / 18:53:34 / cg" |
|
294 | 3571 |
! |
3572 |
||
3573 |
glxPatchPrecisionU:u v:v in:aGLXWindowId |
|
3574 |
"set the patch precision" |
|
3575 |
||
3576 |
%{ /* NOCONTEXT */ |
|
3577 |
if (__bothSmallInteger(u, v)) { |
|
3578 |
SETWIN(aGLXWindowId) |
|
1932 | 3579 |
#ifdef OPENGL |
3580 |
#else |
|
294 | 3581 |
patchprecision((long)__intVal(u), (long)__intVal(v)); |
1932 | 3582 |
#endif |
294 | 3583 |
} |
1932 | 3584 |
%} |
294 | 3585 |
! |
3586 |
||
3587 |
glxPatchX:arrayOf16XFloats y:arrayOf16YFloats z:arrayOf16ZFloats in:aGLXWindowId |
|
528 | 3588 |
"Draws a bicubic patch. |
3589 |
arguments must be arrays of 16 floats containing the patch" |
|
294 | 3590 |
|
3591 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3592 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3593 |
#else |
294 | 3594 |
Matrix matrixX, matrixY, matrixZ; |
3595 |
Matrix *mX, *mY, *mZ; |
|
3596 |
||
4718 | 3597 |
if (! (mX = __glx_getFloatsFromMatrixInto(arrayOf16XFloats, matrixX))) |
1932 | 3598 |
RETURN (nil); |
4718 | 3599 |
if (! (mY = __glx_getFloatsFromMatrixInto(arrayOf16YFloats, matrixY))) |
1932 | 3600 |
RETURN (nil); |
4718 | 3601 |
if (! (mZ = __glx_getFloatsFromMatrixInto(arrayOf16ZFloats, matrixZ))) |
1932 | 3602 |
RETURN (nil); |
294 | 3603 |
SETWIN(aGLXWindowId) |
3604 |
patch(*mX, *mY, *mZ); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3605 |
#endif |
294 | 3606 |
%} |
528 | 3607 |
|
3608 |
"Modified: 19.3.1996 / 18:54:02 / cg" |
|
3609 |
! |
|
3610 |
||
3611 |
glxRpatchX:arrayOf16XFloats y:arrayOf16YFloats z:arrayOf16ZFloats w:arrayOf16WFloats in:aGLXWindowId |
|
3612 |
"Draws a rational bicubic patch. |
|
3613 |
arguments must be arrays of 16 floats containing the patch" |
|
3614 |
||
3615 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3616 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3617 |
#else |
529 | 3618 |
Matrix matrixX, matrixY, matrixZ, matrixW; |
3619 |
Matrix *mX, *mY, *mZ, *mW; |
|
528 | 3620 |
|
4718 | 3621 |
if (! (mX = __glx_getFloatsFromMatrixInto(arrayOf16XFloats, matrixX))) |
1932 | 3622 |
RETURN (nil); |
4718 | 3623 |
if (! (mY = __glx_getFloatsFromMatrixInto(arrayOf16YFloats, matrixY))) |
1932 | 3624 |
RETURN (nil); |
4718 | 3625 |
if (! (mZ = __glx_getFloatsFromMatrixInto(arrayOf16ZFloats, matrixZ))) |
1932 | 3626 |
RETURN (nil); |
4718 | 3627 |
if (! (mW = __glx_getFloatsFromMatrixInto(arrayOf16WFloats, matrixW))) |
1932 | 3628 |
RETURN (nil); |
529 | 3629 |
SETWIN(aGLXWindowId) |
3630 |
rpatch(*mX, *mY, *mZ, *mW); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3631 |
#endif |
528 | 3632 |
%} |
3633 |
||
3634 |
"Modified: 19.3.1996 / 18:54:02 / cg" |
|
3635 |
"Created: 19.3.1996 / 18:56:34 / cg" |
|
3636 |
! ! |
|
3637 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3638 |
!GLXWorkstation methodsFor:'pixel copy'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3639 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3640 |
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
|
3641 |
"copy a rectangular area in the view. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3642 |
For now, this is only supported with a true GL. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3643 |
readsource specifies which plane/buffer is affected by this operation." |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3644 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3645 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3646 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3647 |
SETWIN(aGLXWindowId) |
4718 | 3648 |
rectcopy(_screencoordVal(x1), _screencoordVal(y1), |
3649 |
_screencoordVal(x2), _screencoordVal(y2), |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3650 |
_screencoordVal(newx), _screencoordVal(newy)); |
1932 | 3651 |
#endif |
3652 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3653 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3654 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3655 |
!GLXWorkstation methodsFor:'pixel reading'! |
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 |
glxReadpixelsTo:dest in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3658 |
"read pixels from the view. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3659 |
Dest must be an array and gets pixel values assigned, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3660 |
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
|
3661 |
For now, pixel-reading is only supported with a true GL. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3662 |
Caveat: the number of pixels is limited to 256. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3663 |
In double buffer mode, the backBuffer is read." |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3664 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3665 |
|n| |
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 := dest size. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3668 |
n > 256 ifTrue:[^ 0]. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3669 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3670 |
%{ /* STACK:1024 */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3671 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3672 |
Colorindex buffer[256]; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3673 |
int i, nRead; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3674 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3675 |
if (__isArray(dest)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3676 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3677 |
nRead = readpixels(__intVal(n), buffer); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3678 |
for (i=0; i<nRead;i++) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3679 |
__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
|
3680 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3681 |
RETURN (__MKSMALLINT(nRead)); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3682 |
} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3683 |
#endif |
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 |
^ 0 |
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 |
"Modified: 22.3.1996 / 18:08:00 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3690 |
glxReadsource: src in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3691 |
"specify what is read with folowing readPixels requests. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3692 |
For now, pixel-reading is only supported with a true GL" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3693 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3694 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3695 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3696 |
OBJ s = src; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3697 |
int what; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3698 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3699 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3700 |
if (s == @symbol(auto)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3701 |
what = SRC_AUTO; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3702 |
} else if (s == @symbol(front)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3703 |
what = SRC_FRONT; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3704 |
} else if (s == @symbol(back)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3705 |
what = SRC_BACK; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3706 |
} else if (s == @symbol(zBuffer)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3707 |
what = SRC_ZBUFFER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3708 |
} else if (s == @symbol(frameGrabber)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3709 |
what = SRC_FRAMEGRABBER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3710 |
} else if (s == @symbol(over)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3711 |
what = SRC_OVER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3712 |
} else if (s == @symbol(under)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3713 |
what = SRC_UNDER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3714 |
} else if (s == @symbol(popUp)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3715 |
what = SRC_PUP; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3716 |
} else { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3717 |
what = _longVal(src); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3718 |
} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3719 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3720 |
readsource(what); |
1932 | 3721 |
#endif |
3722 |
%} |
|
538 | 3723 |
! |
3724 |
||
541 | 3725 |
glxRectreadX1:x1 y1:y1 x2:x2 y2:y2 h:viewHeight to:dest in:aGLXWindowId |
538 | 3726 |
"read pixels from a rectanglular area. |
3727 |
Dest must be an array and gets pixel values assigned, |
|
3728 |
reading n*m pixels. |
|
3729 |
For now, pixel-reading is only supported with a true GL. |
|
3730 |
Caveat: the number of pixels is limited to 256. |
|
3731 |
In double buffer mode, the backBuffer is read." |
|
3732 |
||
541 | 3733 |
|n idx sy1 sy2| |
3734 |
||
3735 |
"/ GLX's y coordinates go bottom to top ... |
|
3736 |
||
3737 |
sy1 := viewHeight - y1. |
|
3738 |
sy2 := viewHeight - y2. |
|
538 | 3739 |
|
3740 |
n := (x2 - x1 + 1) * (y2 - y1 + 1). |
|
3741 |
n > 256 ifTrue:[^ 0]. |
|
3742 |
dest size < n ifTrue:[^ 0]. |
|
3743 |
||
3744 |
%{ /* STACK:1024 */ |
|
3745 |
#ifdef GLX |
|
3746 |
Colorindex buffer[256]; |
|
3747 |
int i, nRead; |
|
3748 |
||
3749 |
if (__isArray(dest) |
|
3750 |
&& __isSmallInteger(x1) && __isSmallInteger(x2) |
|
541 | 3751 |
&& __isSmallInteger(sy1) && __isSmallInteger(sy2) |
538 | 3752 |
) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3753 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3754 |
nRead = rectread(__intVal(x1), __intVal(sy1), |
4718 | 3755 |
__intVal(x2), __intVal(sy2), |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3756 |
buffer); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3757 |
for (i=0; i<nRead;i++) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3758 |
__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
|
3759 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3760 |
RETURN (__MKSMALLINT(nRead)); |
538 | 3761 |
} |
3762 |
#endif |
|
3763 |
%}. |
|
3764 |
"/ |
|
3765 |
"/ ok, this is not a GL - use XWorkstations pixel read method |
|
3766 |
"/ and convert |
|
3767 |
"/ |
|
3768 |
idx := 1. |
|
3769 |
y1 to:y2 do:[:y | |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3770 |
x1 to:x2 do:[:x | |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3771 |
|pix| |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3772 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3773 |
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
|
3774 |
dest at:idx put:pix |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3775 |
] |
538 | 3776 |
]. |
3777 |
^ n |
|
3778 |
||
3779 |
"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
|
3780 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3781 |
! |
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 |
glxXColorToGLColor:pixel |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3784 |
"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
|
3785 |
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
|
3786 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3787 |
%{ /* NOCONTEXT */ |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3788 |
#ifdef VGL |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3789 |
if (__isSmallInteger(pixel)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3790 |
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
|
3791 |
} |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3792 |
#endif |
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 |
^ pixel |
543
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3795 |
! |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3796 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3797 |
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
|
3798 |
"special for VGL" |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3799 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3800 |
%{ |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3801 |
#ifdef VGL |
1932 | 3802 |
if (__bothSmallInteger(x, y)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3803 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3804 |
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
|
3805 |
} |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3806 |
#endif |
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 |
^ 0 |
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 |
"Modified: 22.3.1996 / 18:08:00 / cg" |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3811 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3812 |
|
528 | 3813 |
!GLXWorkstation methodsFor:'points'! |
3814 |
||
3815 |
glxPnt2X: x y: y in: aGLXWindowId |
|
3816 |
"plot a point in x, y, 0." |
|
3817 |
||
3818 |
%{ /* NOCONTEXT */ |
|
3819 |
Coord c_x, c_y; |
|
3820 |
||
3821 |
_COORD_ (x, c_x) |
|
3822 |
_COORD_ (y, c_y) |
|
3823 |
SETWIN(aGLXWindowId) |
|
1932 | 3824 |
#ifdef OPENGL |
3825 |
#else |
|
528 | 3826 |
pnt2(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3827 |
#endif |
528 | 3828 |
%} |
3829 |
||
3830 |
"Modified: 19.3.1996 / 18:35:55 / cg" |
|
3831 |
! |
|
3832 |
||
3833 |
glxPnt2iX: x y: y in: aGLXWindowId |
|
3834 |
"plot a point in x, y, 0." |
|
3835 |
||
3836 |
%{ /* NOCONTEXT */ |
|
3837 |
Icoord c_x, c_y; |
|
3838 |
||
3839 |
_ICOORD_ (x, c_x) |
|
3840 |
_ICOORD_ (y, c_y) |
|
3841 |
SETWIN(aGLXWindowId) |
|
1932 | 3842 |
#ifdef OPENGL |
3843 |
#else |
|
528 | 3844 |
pnt2i(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3845 |
#endif |
528 | 3846 |
%} |
3847 |
||
3848 |
"Modified: 19.3.1996 / 18:35:59 / cg" |
|
3849 |
! |
|
3850 |
||
3851 |
glxPnt2sX: x y: y in: aGLXWindowId |
|
3852 |
"plot a point in x, y, 0." |
|
3853 |
||
3854 |
%{ /* NOCONTEXT */ |
|
3855 |
Scoord c_x, c_y; |
|
3856 |
||
3857 |
_SCOORD_ (x, c_x) |
|
3858 |
_SCOORD_ (y, c_y) |
|
3859 |
SETWIN(aGLXWindowId) |
|
1932 | 3860 |
#ifdef OPENGL |
3861 |
#else |
|
528 | 3862 |
pnt2s(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3863 |
#endif |
528 | 3864 |
%} |
3865 |
||
3866 |
"Modified: 19.3.1996 / 18:36:03 / cg" |
|
3867 |
! |
|
3868 |
||
3869 |
glxPntX: x y: y z: z in: aGLXWindowId |
|
3870 |
"plot a point in x, y, z." |
|
3871 |
||
3872 |
%{ /* NOCONTEXT */ |
|
3873 |
Coord c_x, c_y, c_z; |
|
3874 |
||
3875 |
_COORD_ (x, c_x) |
|
3876 |
_COORD_ (y, c_y) |
|
3877 |
_COORD_ (z, c_z) |
|
3878 |
SETWIN(aGLXWindowId) |
|
1932 | 3879 |
#ifdef OPENGL |
3880 |
#else |
|
528 | 3881 |
pnt(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3882 |
#endif |
528 | 3883 |
%} |
3884 |
||
3885 |
"Modified: 19.3.1996 / 18:36:08 / cg" |
|
3886 |
! |
|
3887 |
||
3888 |
glxPntiX: x y: y z: z in: aGLXWindowId |
|
3889 |
"plot a point in x, y, z." |
|
3890 |
||
3891 |
%{ /* NOCONTEXT */ |
|
3892 |
Icoord c_x, c_y, c_z; |
|
3893 |
||
3894 |
_ICOORD_ (x, c_x) |
|
3895 |
_ICOORD_ (y, c_y) |
|
3896 |
_ICOORD_ (z, c_z) |
|
3897 |
SETWIN(aGLXWindowId) |
|
1932 | 3898 |
#ifdef OPENGL |
3899 |
#else |
|
528 | 3900 |
pnti(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3901 |
#endif |
528 | 3902 |
%} |
3903 |
||
3904 |
"Modified: 19.3.1996 / 18:36:14 / cg" |
|
3905 |
! |
|
3906 |
||
3907 |
glxPntsX: x y: y z: z in: aGLXWindowId |
|
3908 |
"plot a point in x, y, z." |
|
3909 |
||
3910 |
%{ /* NOCONTEXT */ |
|
3911 |
Scoord c_x, c_y, c_z; |
|
3912 |
||
3913 |
_SCOORD_ (x, c_x) |
|
3914 |
_SCOORD_ (y, c_y) |
|
3915 |
_SCOORD_ (z, c_z) |
|
3916 |
SETWIN(aGLXWindowId) |
|
1932 | 3917 |
#ifdef OPENGL |
3918 |
#else |
|
528 | 3919 |
pnts(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3920 |
#endif |
528 | 3921 |
%} |
3922 |
||
3923 |
"Modified: 19.3.1996 / 18:36:17 / cg" |
|
3924 |
! |
|
3925 |
||
3926 |
glxPntsize: n in: aGLXWindowId |
|
3927 |
||
3928 |
%{ /* NOCONTEXT */ |
|
1932 | 3929 |
SETWIN(aGLXWindowId) |
3930 |
#ifdef GLX |
|
528 | 3931 |
pntsize(_shortVal(n)); |
1932 | 3932 |
#endif |
3933 |
%} |
|
528 | 3934 |
! |
3935 |
||
3936 |
glxPntsizef: n in: aGLXWindowId |
|
3937 |
||
3938 |
%{ /* NOCONTEXT */ |
|
1932 | 3939 |
SETWIN(aGLXWindowId) |
3940 |
#ifdef GLX |
|
528 | 3941 |
pntsizef(_floatVal(n)); |
1932 | 3942 |
#endif |
3943 |
%} |
|
528 | 3944 |
! ! |
3945 |
||
3946 |
!GLXWorkstation methodsFor:'polygons'! |
|
3947 |
||
3948 |
glxBackface: b in: aGLXWindowId |
|
4718 | 3949 |
"enable/disable culling of backfacing polygons (suppress its drawing). |
528 | 3950 |
A polygon is backfacing if it's orientation in *screen* coords is clockwise" |
3951 |
||
3952 |
%{ /* NOCONTEXT */ |
|
3953 |
SETWIN(aGLXWindowId) |
|
1932 | 3954 |
#ifdef OPENGL |
3955 |
#else |
|
528 | 3956 |
backface(_booleanVal(b)); |
1932 | 3957 |
#endif |
528 | 3958 |
%} |
3959 |
||
3960 |
"Modified: 19.3.1996 / 18:26:50 / cg" |
|
3961 |
! |
|
3962 |
||
3963 |
glxConcave: b in: aGLXWindowId |
|
7829 | 3964 |
"signal whether or not polygons are concave" |
528 | 3965 |
|
3966 |
%{ /* NOCONTEXT */ |
|
3967 |
SETWIN(aGLXWindowId) |
|
1932 | 3968 |
#ifdef OPENGL |
3969 |
#else |
|
528 | 3970 |
concave(_booleanVal(b)); |
1932 | 3971 |
#endif |
528 | 3972 |
%} |
3973 |
! |
|
3974 |
||
3975 |
glxFrontface: b in: aGLXWindowId |
|
4718 | 3976 |
"enable/disable culling of frontfacing polygons (suppress its drawing). |
3977 |
A polygon is frontfacing if it's orientation in *screen* coords is |
|
528 | 3978 |
anti-clockwise" |
3979 |
||
3980 |
||
3981 |
%{ /* NOCONTEXT */ |
|
3982 |
SETWIN(aGLXWindowId) |
|
1932 | 3983 |
#ifdef OPENGL |
3984 |
#else |
|
528 | 3985 |
frontface(_booleanVal(b)); |
1932 | 3986 |
#endif |
3987 |
%} |
|
528 | 3988 |
! |
3989 |
||
3990 |
glxPdr2X: x y: y in: aGLXWindowId |
|
3991 |
"add another vertex to the polygon" |
|
3992 |
||
3993 |
%{ /* NOCONTEXT */ |
|
3994 |
Coord c_x, c_y; |
|
3995 |
||
3996 |
_COORD_ (x, c_x) |
|
3997 |
_COORD_ (y, c_y) |
|
3998 |
SETWIN(aGLXWindowId) |
|
1932 | 3999 |
#ifdef OPENGL |
4000 |
#else |
|
528 | 4001 |
pdr2(c_x, c_y); |
1932 | 4002 |
#endif |
4003 |
%} |
|
528 | 4004 |
! |
4005 |
||
4006 |
glxPdr2iX: x y: y in: aGLXWindowId |
|
4007 |
"add another vertex to the polygon" |
|
4008 |
||
4009 |
%{ /* NOCONTEXT */ |
|
4010 |
Icoord c_x, c_y; |
|
4011 |
||
4012 |
_ICOORD_ (x, c_x) |
|
4013 |
_ICOORD_ (y, c_y) |
|
4014 |
SETWIN(aGLXWindowId) |
|
1932 | 4015 |
#ifdef OPENGL |
4016 |
#else |
|
528 | 4017 |
pdr2i(c_x, c_y); |
1932 | 4018 |
#endif |
528 | 4019 |
%} |
4020 |
||
4021 |
"Modified: 19.3.1996 / 18:33:28 / cg" |
|
4022 |
! |
|
4023 |
||
4024 |
glxPdr2sX: x y: y in: aGLXWindowId |
|
4025 |
"add another vertex to the polygon" |
|
4026 |
||
4027 |
%{ /* NOCONTEXT */ |
|
4028 |
Scoord c_x, c_y; |
|
4029 |
||
4030 |
_SCOORD_ (x, c_x) |
|
4031 |
_SCOORD_ (y, c_y) |
|
4032 |
SETWIN(aGLXWindowId) |
|
1932 | 4033 |
#ifdef OPENGL |
4034 |
#else |
|
528 | 4035 |
pdr2s(c_x, c_y); |
1932 | 4036 |
#endif |
528 | 4037 |
%} |
4038 |
||
4039 |
"Modified: 19.3.1996 / 18:34:03 / cg" |
|
4040 |
! |
|
4041 |
||
4042 |
glxPdrX: x y: y z: z in: aGLXWindowId |
|
4043 |
"add another vertex to the polygon" |
|
4044 |
||
4045 |
%{ /* NOCONTEXT */ |
|
4046 |
Coord c_x, c_y, c_z; |
|
4047 |
||
4048 |
_COORD_ (x, c_x) |
|
4049 |
_COORD_ (y, c_y) |
|
4050 |
_COORD_ (z, c_z) |
|
4051 |
SETWIN(aGLXWindowId) |
|
1932 | 4052 |
#ifdef OPENGL |
4053 |
#else |
|
528 | 4054 |
pdr(c_x, c_y, c_z); |
1932 | 4055 |
#endif |
528 | 4056 |
%} |
4057 |
||
4058 |
"Modified: 19.3.1996 / 18:34:06 / cg" |
|
4059 |
! |
|
4060 |
||
4061 |
glxPdriX: x y: y z: z in: aGLXWindowId |
|
4062 |
"add another vertex to the polygon" |
|
4063 |
||
4064 |
%{ /* NOCONTEXT */ |
|
4065 |
Icoord c_x, c_y, c_z; |
|
4066 |
||
4067 |
_ICOORD_ (x, c_x) |
|
4068 |
_ICOORD_ (y, c_y) |
|
4069 |
_ICOORD_ (z, c_z) |
|
4070 |
SETWIN(aGLXWindowId) |
|
1932 | 4071 |
#ifdef OPENGL |
4072 |
#else |
|
528 | 4073 |
pdri(c_x, c_y, c_z); |
1932 | 4074 |
#endif |
528 | 4075 |
%} |
4076 |
||
4077 |
"Modified: 19.3.1996 / 18:34:11 / cg" |
|
4078 |
! |
|
4079 |
||
4080 |
glxPdrsX: x y: y z: z in: aGLXWindowId |
|
4081 |
"add another vertex to the polygon" |
|
4082 |
||
4083 |
%{ /* NOCONTEXT */ |
|
4084 |
Scoord c_x, c_y, c_z; |
|
4085 |
||
4086 |
_SCOORD_ (x, c_x) |
|
4087 |
_SCOORD_ (y, c_y) |
|
4088 |
_SCOORD_ (z, c_z) |
|
4089 |
SETWIN(aGLXWindowId) |
|
1932 | 4090 |
#ifdef OPENGL |
4091 |
#else |
|
528 | 4092 |
pdrs(c_x, c_y, c_z); |
1932 | 4093 |
#endif |
528 | 4094 |
%} |
4095 |
||
4096 |
"Modified: 19.3.1996 / 18:34:14 / cg" |
|
4097 |
! |
|
4098 |
||
4099 |
glxPmv2X: x y: y in: aGLXWindowId |
|
4100 |
"set the start position of a polygon" |
|
4101 |
||
4102 |
%{ /* NOCONTEXT */ |
|
4103 |
Coord c_x, c_y; |
|
4104 |
||
4105 |
_COORD_ (x, c_x) |
|
4106 |
_COORD_ (y, c_y) |
|
4107 |
SETWIN(aGLXWindowId) |
|
1932 | 4108 |
#ifdef OPENGL |
4109 |
#else |
|
528 | 4110 |
pmv2(c_x, c_y); |
1932 | 4111 |
#endif |
528 | 4112 |
%} |
4113 |
||
4114 |
"Modified: 19.3.1996 / 18:32:45 / cg" |
|
4115 |
! |
|
4116 |
||
4117 |
glxPmv2iX: x y: y in: aGLXWindowId |
|
4118 |
"set the start position of a polygon" |
|
4119 |
||
4120 |
%{ /* NOCONTEXT */ |
|
4121 |
Icoord c_x, c_y; |
|
4122 |
||
4123 |
_ICOORD_ (x, c_x) |
|
4124 |
_ICOORD_ (y, c_y) |
|
4125 |
SETWIN(aGLXWindowId) |
|
1932 | 4126 |
#ifdef OPENGL |
4127 |
#else |
|
528 | 4128 |
pmv2i(c_x, c_y); |
1932 | 4129 |
#endif |
528 | 4130 |
%} |
4131 |
||
4132 |
"Modified: 19.3.1996 / 18:32:42 / cg" |
|
4133 |
! |
|
4134 |
||
4135 |
glxPmv2sX: x y: y in: aGLXWindowId |
|
4136 |
"set the start position of a polygon" |
|
4137 |
||
4138 |
%{ /* NOCONTEXT */ |
|
4139 |
Scoord c_x, c_y; |
|
4140 |
||
4141 |
_SCOORD_ (x, c_x) |
|
4142 |
_SCOORD_ (y, c_y) |
|
4143 |
SETWIN(aGLXWindowId) |
|
1932 | 4144 |
#ifdef OPENGL |
4145 |
#else |
|
528 | 4146 |
pmv2s(c_x, c_y); |
1932 | 4147 |
#endif |
528 | 4148 |
%} |
4149 |
||
4150 |
"Modified: 19.3.1996 / 18:32:38 / cg" |
|
4151 |
! |
|
4152 |
||
4153 |
glxPmvX: x y: y z: z in: aGLXWindowId |
|
4154 |
"set the start position of a polygon" |
|
4155 |
||
4156 |
%{ /* NOCONTEXT */ |
|
4157 |
Coord c_x, c_y, c_z; |
|
4158 |
||
4159 |
_COORD_ (x, c_x) |
|
4160 |
_COORD_ (y, c_y) |
|
4161 |
_COORD_ (z, c_z) |
|
4162 |
SETWIN(aGLXWindowId) |
|
1932 | 4163 |
#ifdef OPENGL |
4164 |
#else |
|
528 | 4165 |
pmv(c_x, c_y, c_z); |
1932 | 4166 |
#endif |
528 | 4167 |
%} |
4168 |
||
4169 |
"Modified: 19.3.1996 / 18:31:52 / cg" |
|
4170 |
! |
|
4171 |
||
4172 |
glxPmviX: x y: y z: z in: aGLXWindowId |
|
4173 |
"set the start position of a polygon" |
|
4174 |
||
4175 |
%{ /* NOCONTEXT */ |
|
4176 |
Icoord c_x, c_y, c_z; |
|
4177 |
||
4178 |
_ICOORD_ (x, c_x) |
|
4179 |
_ICOORD_ (y, c_y) |
|
4180 |
_ICOORD_ (z, c_z) |
|
4181 |
SETWIN(aGLXWindowId) |
|
1932 | 4182 |
#ifdef OPENGL |
4183 |
#else |
|
528 | 4184 |
pmvi(c_x, c_y, c_z); |
1932 | 4185 |
#endif |
528 | 4186 |
%} |
4187 |
||
4188 |
"Modified: 19.3.1996 / 18:31:59 / cg" |
|
4189 |
! |
|
4190 |
||
4191 |
glxPmvsX: x y: y z: z in: aGLXWindowId |
|
4192 |
"set the start position of a polygon" |
|
4193 |
||
4194 |
%{ /* NOCONTEXT */ |
|
4195 |
Scoord c_x, c_y, c_z; |
|
4196 |
||
4197 |
_SCOORD_ (x, c_x) |
|
4198 |
_SCOORD_ (y, c_y) |
|
4199 |
_SCOORD_ (z, c_z) |
|
4200 |
SETWIN(aGLXWindowId) |
|
1932 | 4201 |
#ifdef OPENGL |
4202 |
#else |
|
528 | 4203 |
pmvs(c_x, c_y, c_z); |
1932 | 4204 |
#endif |
528 | 4205 |
%} |
4206 |
||
4207 |
"Modified: 19.3.1996 / 18:32:03 / cg" |
|
4208 |
! |
|
4209 |
||
4210 |
glxPolymode: mode in: aGLXWindowId |
|
4211 |
"Sets the polygon filling mode - only filled (1) or outlined (0) |
|
4212 |
are supported" |
|
4213 |
||
4214 |
%{ /* NOCONTEXT */ |
|
4215 |
SETWIN(aGLXWindowId) |
|
1932 | 4216 |
#ifdef OPENGL |
4217 |
#else |
|
528 | 4218 |
polymode(_longVal(mode)); |
1932 | 4219 |
#endif |
528 | 4220 |
%} |
4221 |
||
4222 |
"Modified: 19.3.1996 / 18:29:32 / cg" |
|
4223 |
! |
|
4224 |
||
4225 |
glxRpdr2X: x y: y in: aGLXWindowId |
|
4226 |
"add another relative vertex to the polygon" |
|
4227 |
||
4228 |
%{ /* NOCONTEXT */ |
|
4229 |
Coord c_x, c_y; |
|
4230 |
||
4231 |
_COORD_ (x, c_x) |
|
4232 |
_COORD_ (y, c_y) |
|
4233 |
SETWIN(aGLXWindowId) |
|
1932 | 4234 |
#ifdef OPENGL |
4235 |
#else |
|
528 | 4236 |
rpdr2(c_x, c_y); |
1932 | 4237 |
#endif |
528 | 4238 |
%} |
4239 |
||
4240 |
"Modified: 19.3.1996 / 18:34:31 / cg" |
|
4241 |
! |
|
4242 |
||
4243 |
glxRpdr2iX: x y: y in: aGLXWindowId |
|
4244 |
"add another relative vertex to the polygon" |
|
4245 |
||
4246 |
%{ /* NOCONTEXT */ |
|
4247 |
Icoord c_x, c_y; |
|
4248 |
||
4249 |
_ICOORD_ (x, c_x) |
|
4250 |
_ICOORD_ (y, c_y) |
|
4251 |
SETWIN(aGLXWindowId) |
|
1932 | 4252 |
#ifdef OPENGL |
4253 |
#else |
|
528 | 4254 |
rpdr2i(c_x, c_y); |
1932 | 4255 |
#endif |
528 | 4256 |
%} |
4257 |
||
4258 |
"Modified: 19.3.1996 / 18:34:36 / cg" |
|
4259 |
! |
|
4260 |
||
4261 |
glxRpdr2sX: x y: y in: aGLXWindowId |
|
4262 |
"add another relative vertex to the polygon" |
|
4263 |
||
4264 |
%{ /* NOCONTEXT */ |
|
4265 |
Scoord c_x, c_y; |
|
4266 |
||
4267 |
_SCOORD_ (x, c_x) |
|
4268 |
_SCOORD_ (y, c_y) |
|
4269 |
SETWIN(aGLXWindowId) |
|
1932 | 4270 |
#ifdef OPENGL |
4271 |
#else |
|
528 | 4272 |
rpdr2s(c_x, c_y); |
1932 | 4273 |
#endif |
528 | 4274 |
%} |
4275 |
||
4276 |
"Modified: 19.3.1996 / 18:34:40 / cg" |
|
4277 |
! |
|
4278 |
||
4279 |
glxRpdrX: x y: y z: z in: aGLXWindowId |
|
4280 |
"add another relative vertex to the polygon" |
|
4281 |
||
4282 |
%{ /* NOCONTEXT */ |
|
4283 |
Coord c_x, c_y, c_z; |
|
4284 |
||
4285 |
_COORD_ (x, c_x) |
|
4286 |
_COORD_ (y, c_y) |
|
4287 |
_COORD_ (z, c_z) |
|
4288 |
SETWIN(aGLXWindowId) |
|
1932 | 4289 |
#ifdef OPENGL |
4290 |
#else |
|
528 | 4291 |
rpdr(c_x, c_y, c_z); |
1932 | 4292 |
#endif |
528 | 4293 |
%} |
4294 |
||
4295 |
"Modified: 19.3.1996 / 18:34:48 / cg" |
|
4296 |
! |
|
4297 |
||
4298 |
glxRpdriX: x y: y z: z in: aGLXWindowId |
|
4299 |
"add another relative vertex to the polygon" |
|
4300 |
||
4301 |
%{ /* NOCONTEXT */ |
|
4302 |
Icoord c_x, c_y, c_z; |
|
4303 |
||
4304 |
_ICOORD_ (x, c_x) |
|
4305 |
_ICOORD_ (y, c_y) |
|
4306 |
_ICOORD_ (z, c_z) |
|
4307 |
SETWIN(aGLXWindowId) |
|
1932 | 4308 |
#ifdef OPENGL |
4309 |
#else |
|
528 | 4310 |
rpdri(c_x, c_y, c_z); |
1932 | 4311 |
#endif |
528 | 4312 |
%} |
4313 |
||
4314 |
"Modified: 19.3.1996 / 18:34:51 / cg" |
|
4315 |
! |
|
4316 |
||
4317 |
glxRpdrsX: x y: y z: z in: aGLXWindowId |
|
4318 |
"add another relative vertex to the polygon" |
|
4319 |
||
4320 |
%{ /* NOCONTEXT */ |
|
4321 |
Scoord c_x, c_y, c_z; |
|
4322 |
||
4323 |
_SCOORD_ (x, c_x) |
|
4324 |
_SCOORD_ (y, c_y) |
|
4325 |
_SCOORD_ (z, c_z) |
|
4326 |
SETWIN(aGLXWindowId) |
|
1932 | 4327 |
#ifdef OPENGL |
4328 |
#else |
|
528 | 4329 |
rpdrs(c_x, c_y, c_z); |
1932 | 4330 |
#endif |
528 | 4331 |
%} |
4332 |
||
4333 |
"Modified: 19.3.1996 / 18:34:55 / cg" |
|
4334 |
! |
|
4335 |
||
4336 |
glxRpmv2X: x y: y in: aGLXWindowId |
|
4337 |
"set the start position of a polygon" |
|
4338 |
||
4339 |
%{ /* NOCONTEXT */ |
|
4340 |
Coord c_x, c_y; |
|
4341 |
||
4342 |
_COORD_ (x, c_x) |
|
4343 |
_COORD_ (y, c_y) |
|
4344 |
SETWIN(aGLXWindowId) |
|
1932 | 4345 |
#ifdef OPENGL |
4346 |
#else |
|
528 | 4347 |
rpmv2(c_x, c_y); |
1932 | 4348 |
#endif |
528 | 4349 |
%} |
4350 |
||
4351 |
"Modified: 19.3.1996 / 18:37:15 / cg" |
|
4352 |
! |
|
4353 |
||
4354 |
glxRpmv2iX: x y: y in: aGLXWindowId |
|
4355 |
"set the start position of a polygon" |
|
4356 |
||
4357 |
%{ /* NOCONTEXT */ |
|
4358 |
Icoord c_x, c_y; |
|
4359 |
||
4360 |
_ICOORD_ (x, c_x) |
|
4361 |
_ICOORD_ (y, c_y) |
|
4362 |
SETWIN(aGLXWindowId) |
|
1932 | 4363 |
#ifdef OPENGL |
4364 |
#else |
|
528 | 4365 |
rpmv2i(c_x, c_y); |
1932 | 4366 |
#endif |
528 | 4367 |
%} |
4368 |
||
4369 |
"Modified: 19.3.1996 / 18:37:20 / cg" |
|
4370 |
! |
|
4371 |
||
4372 |
glxRpmv2sX: x y: y in: aGLXWindowId |
|
4373 |
"set the relative start position of a polygon" |
|
4374 |
||
4375 |
%{ /* NOCONTEXT */ |
|
4376 |
Scoord c_x, c_y; |
|
4377 |
||
4378 |
_SCOORD_ (x, c_x) |
|
4379 |
_SCOORD_ (y, c_y) |
|
4380 |
SETWIN(aGLXWindowId) |
|
1932 | 4381 |
#ifdef OPENGL |
4382 |
#else |
|
528 | 4383 |
rpmv2s(c_x, c_y); |
1932 | 4384 |
#endif |
528 | 4385 |
%} |
4386 |
||
4387 |
"Modified: 19.3.1996 / 18:38:06 / cg" |
|
4388 |
! |
|
4389 |
||
4390 |
glxRpmvX: x y: y z: z in: aGLXWindowId |
|
4391 |
"set the relative start position of a polygon" |
|
4392 |
||
4393 |
%{ /* NOCONTEXT */ |
|
4394 |
Coord c_x, c_y, c_z; |
|
4395 |
||
4396 |
_COORD_ (x, c_x) |
|
4397 |
_COORD_ (y, c_y) |
|
4398 |
_COORD_ (z, c_z) |
|
4399 |
SETWIN(aGLXWindowId) |
|
1932 | 4400 |
#ifdef OPENGL |
4401 |
#else |
|
528 | 4402 |
rpmv(c_x, c_y, c_z); |
1932 | 4403 |
#endif |
528 | 4404 |
%} |
4405 |
||
4406 |
"Modified: 19.3.1996 / 18:38:03 / cg" |
|
4407 |
! |
|
4408 |
||
4409 |
glxRpmviX: x y: y z: z in: aGLXWindowId |
|
4410 |
"set the relative start position of a polygon" |
|
4411 |
||
4412 |
%{ /* NOCONTEXT */ |
|
4413 |
Icoord c_x, c_y, c_z; |
|
4414 |
||
4415 |
_ICOORD_ (x, c_x) |
|
4416 |
_ICOORD_ (y, c_y) |
|
4417 |
_ICOORD_ (z, c_z) |
|
4418 |
SETWIN(aGLXWindowId) |
|
1932 | 4419 |
#ifdef OPENGL |
4420 |
#else |
|
528 | 4421 |
rpmvi(c_x, c_y, c_z); |
1932 | 4422 |
#endif |
528 | 4423 |
%} |
4424 |
||
4425 |
"Modified: 19.3.1996 / 18:37:53 / cg" |
|
4426 |
! |
|
4427 |
||
4428 |
glxRpmvsX: x y: y z: z in: aGLXWindowId |
|
4429 |
"set the relative start position of a polygon" |
|
4430 |
||
4431 |
%{ /* NOCONTEXT */ |
|
4432 |
Scoord c_x, c_y, c_z; |
|
4433 |
||
4434 |
_SCOORD_ (x, c_x) |
|
4435 |
_SCOORD_ (y, c_y) |
|
4436 |
_SCOORD_ (z, c_z) |
|
4437 |
SETWIN(aGLXWindowId) |
|
1932 | 4438 |
#ifdef OPENGL |
4439 |
#else |
|
528 | 4440 |
rpmvs(c_x, c_y, c_z); |
1932 | 4441 |
#endif |
528 | 4442 |
%} |
4443 |
||
4444 |
"Modified: 19.3.1996 / 18:37:58 / cg" |
|
294 | 4445 |
! ! |
4446 |
||
24 | 4447 |
!GLXWorkstation methodsFor:'queries'! |
4448 |
||
159 | 4449 |
glVersion |
4450 |
"return a string describing the GL version. |
|
4451 |
For informative use only; portable applications do not depend |
|
4452 |
on the returned string." |
|
4453 |
||
4454 |
%{ /* NOCONTEXT */ |
|
4455 |
#ifdef VGL |
|
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
4456 |
RETURN (__MKSTRING("vogl")); |
159 | 4457 |
#else |
1932 | 4458 |
# ifdef GLX |
159 | 4459 |
char buffer[128]; |
4460 |
||
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4461 |
if (_INST(glOK) == true) { |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4462 |
gversion(buffer); |
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
4463 |
RETURN (__MKSTRING(buffer)); |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4464 |
} |
1932 | 4465 |
RETURN (nil); |
4466 |
# else |
|
4467 |
RETURN (nil); |
|
4468 |
# endif |
|
159 | 4469 |
#endif |
4470 |
%} |
|
4471 |
||
4472 |
" |
|
4718 | 4473 |
Display glVersion |
159 | 4474 |
" |
4475 |
! |
|
4476 |
||
528 | 4477 |
glxGetplanesIn: aGLXWindowId |
4478 |
"Returns the number if bit planes available on the device." |
|
4479 |
||
4480 |
%{ /* NOCONTEXT */ |
|
1932 | 4481 |
SETWIN(aGLXWindowId) |
4482 |
#ifdef OPENGL |
|
4483 |
#else |
|
528 | 4484 |
RETURN (__MKSMALLINT(getplanes())); |
4485 |
#endif |
|
1932 | 4486 |
%}. |
4487 |
^ 0 |
|
528 | 4488 |
|
4489 |
"Modified: 19.3.1996 / 18:50:44 / cg" |
|
4490 |
! |
|
4491 |
||
294 | 4492 |
hasStereoExtension |
4493 |
"return true, if this workstation supports stereo GL drawing. |
|
4494 |
Both the server must support it, and the feature must have been |
|
4495 |
enabled in the smalltalk system, for true to be returned." |
|
4496 |
||
4497 |
^ hasStereoExtension |
|
4498 |
||
4499 |
" |
|
4718 | 4500 |
Display hasStereoExtension |
294 | 4501 |
" |
4502 |
! |
|
4503 |
||
3214 | 4504 |
isOpenGL |
4505 |
"return true, if this is an openGL (as opposed to a GL)" |
|
4506 |
||
4507 |
%{ /* NOCONTEXT */ |
|
4508 |
#ifdef OPENGL |
|
4509 |
RETURN ( true ); |
|
4510 |
#else |
|
4511 |
RETURN ( false ); |
|
4512 |
#endif |
|
4513 |
%} |
|
4514 |
! |
|
4515 |
||
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4516 |
isTrueGL |
1932 | 4517 |
"return true, if this is a true GL (as opposed to a simulated VOGL). |
4518 |
Returns false for all openGL systems." |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4519 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4520 |
%{ /* NOCONTEXT */ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4521 |
#ifdef VGL |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4522 |
RETURN ( false ); |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4523 |
#else |
1932 | 4524 |
# ifdef GLX |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4525 |
RETURN ( true ); |
1932 | 4526 |
# endif |
4527 |
#endif |
|
3214 | 4528 |
%}. |
4529 |
^ false |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4530 |
! |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4531 |
|
294 | 4532 |
maxZValue |
4533 |
"return the max. Z value (only valid if z-buffer is supported)" |
|
4718 | 4534 |
%{ |
1932 | 4535 |
#ifndef OPENGL |
4536 |
# ifdef GD_ZMAX |
|
294 | 4537 |
long zMax; |
4538 |
||
4539 |
if (_INST(glOK) == true) { |
|
4540 |
zMax = getgdesc(GD_ZMAX); |
|
4541 |
||
4542 |
if ((zMax >= _MIN_INT) && (zMax <= _MAX_INT)) { |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4543 |
RETURN ( __MKSMALLINT(zMax) ); |
294 | 4544 |
} |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4545 |
RETURN ( __MKLARGEINT(zMax) ); |
294 | 4546 |
} |
1932 | 4547 |
# endif |
294 | 4548 |
#endif |
4549 |
%}. |
|
4550 |
^ nil |
|
4551 |
! |
|
4552 |
||
4553 |
supportsDoubleBuffer |
|
4554 |
"return true, if this gl workstation supports double buffering. |
|
157 | 4555 |
For portable applications, always combine this with a query |
4556 |
if the display supports GL drawing at all." |
|
24 | 4557 |
|
4558 |
%{ /* NOCONTEXT */ |
|
294 | 4559 |
|
1932 | 4560 |
#ifndef OPENGL |
4561 |
# ifdef VGL |
|
4562 |
RETURN (true); |
|
4563 |
# else |
|
4564 |
# ifdef GD_BITS_NORM_DBL_RED |
|
294 | 4565 |
if (getgdesc(GD_BITS_NORM_DBL_RED) != 0) { |
4566 |
RETURN ( _INST(glOK) ); |
|
4567 |
} |
|
1932 | 4568 |
# endif |
4569 |
# endif |
|
24 | 4570 |
#endif |
89 | 4571 |
%}. |
4572 |
^ false |
|
4573 |
||
4574 |
" |
|
4718 | 4575 |
Display supportsDoubleBuffer |
294 | 4576 |
" |
4577 |
! |
|
4578 |
||
4579 |
supportsGLDrawing |
|
4580 |
"return true, if this device supports 3D GL drawing." |
|
4581 |
||
4582 |
^ glOK |
|
4583 |
||
4584 |
" |
|
4718 | 4585 |
Display supportsGLDrawing |
89 | 4586 |
" |
64 | 4587 |
! |
4588 |
||
4589 |
supportsLight |
|
157 | 4590 |
"return true, if this gl workstation supports light sources |
7893 | 4591 |
(i.e. if it's a real GL). |
157 | 4592 |
For portable applications, always combine this with a query |
4593 |
if the display supports GL drawing at all." |
|
89 | 4594 |
|
4595 |
%{ /* NOCONTEXT */ |
|
64 | 4596 |
#ifdef GLX |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4597 |
RETURN ( _INST(glOK) ); |
64 | 4598 |
#endif |
89 | 4599 |
%}. |
4600 |
^ false |
|
4601 |
||
4602 |
" |
|
4718 | 4603 |
Display supportsLight |
89 | 4604 |
" |
7893 | 4605 |
|
4606 |
"Modified (comment): / 13-02-2017 / 20:19:29 / cg" |
|
89 | 4607 |
! |
4608 |
||
294 | 4609 |
supportsRGB |
4610 |
"return true, if this gl workstation supports rgb |
|
4611 |
(in addition to indexed) colors. Actually, we return true |
|
4612 |
for a real GL engine, false for the simulator here. |
|
4613 |
For portable applications, always combine this with a query |
|
4614 |
if the display supports GL drawing at all." |
|
4615 |
||
4616 |
%{ /* NOCONTEXT */ |
|
4617 |
#ifdef GLX |
|
4618 |
RETURN ( _INST(glOK) ); |
|
4619 |
#endif |
|
4620 |
%}. |
|
4621 |
^ false |
|
4622 |
||
4623 |
" |
|
4718 | 4624 |
Display supportsRGB |
294 | 4625 |
" |
4626 |
! |
|
4627 |
||
89 | 4628 |
supportsTextures |
4629 |
"return true, if this gl workstation supports texture mapping |
|
7893 | 4630 |
(i.e. if it's a real GL). |
157 | 4631 |
For portable applications, always combine this with a query |
4632 |
if the display supports GL drawing at all." |
|
89 | 4633 |
|
4634 |
%{ /* NOCONTEXT */ |
|
1932 | 4635 |
#ifndef OPENGL |
4636 |
# ifdef GD_TEXTURE |
|
89 | 4637 |
if (getgdesc(GD_TEXTURE) != 0) { |
7893 | 4638 |
RETURN ( _INST(glOK) ); |
89 | 4639 |
} |
1932 | 4640 |
# endif |
89 | 4641 |
#endif |
4642 |
%}. |
|
4643 |
^ false |
|
4644 |
||
4645 |
" |
|
4718 | 4646 |
Display supportsTextures |
89 | 4647 |
" |
7893 | 4648 |
|
4649 |
"Modified: / 13-02-2017 / 20:19:40 / cg" |
|
89 | 4650 |
! |
4651 |
||
4652 |
supportsZBuffer |
|
157 | 4653 |
"return true, if this gl workstation has z buffer support. |
4654 |
For portable applications, always combine this with a query |
|
4655 |
if the display supports GL drawing at all." |
|
4656 |
||
89 | 4657 |
%{ /* NOCONTEXT */ |
4658 |
||
1932 | 4659 |
#ifndef OPENGL |
4660 |
# ifdef GD_BITS_NORM_ZBUFFER |
|
89 | 4661 |
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
|
4662 |
RETURN ( _INST(glOK) ); |
89 | 4663 |
} |
1932 | 4664 |
# endif |
89 | 4665 |
#endif |
4666 |
%}. |
|
4667 |
^ false |
|
4668 |
||
4669 |
" |
|
4718 | 4670 |
Display supportsZBuffer |
89 | 4671 |
" |
294 | 4672 |
! ! |
4673 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4674 |
!GLXWorkstation methodsFor:'rectangles'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4675 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4676 |
glxRectX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
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 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4679 |
SETWIN(aGLXWindowId) |
1932 | 4680 |
#ifdef OPENGL |
4681 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4682 |
rect(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
1932 | 4683 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4684 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4685 |
! |
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 |
glxRectfX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
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 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4690 |
SETWIN(aGLXWindowId) |
1932 | 4691 |
#ifdef OPENGL |
4692 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4693 |
rectf(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
1932 | 4694 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4695 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4696 |
! |
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 |
glxRectfiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
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 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4701 |
SETWIN(aGLXWindowId) |
1932 | 4702 |
#ifdef OPENGL |
4703 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4704 |
rectfi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
1932 | 4705 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4706 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4707 |
! |
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 |
glxRectfsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
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 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4712 |
SETWIN(aGLXWindowId) |
1932 | 4713 |
#ifdef OPENGL |
4714 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4715 |
rectfs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
1932 | 4716 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4717 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4718 |
! |
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 |
glxRectiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
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 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4723 |
SETWIN(aGLXWindowId) |
1932 | 4724 |
#ifdef OPENGL |
4725 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4726 |
recti(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
1932 | 4727 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4728 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4729 |
! |
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 |
glxRectsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
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 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4734 |
SETWIN(aGLXWindowId) |
1932 | 4735 |
#ifdef OPENGL |
4736 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4737 |
rects(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
1932 | 4738 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4739 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4740 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4741 |
|
528 | 4742 |
!GLXWorkstation methodsFor:'spheres'! |
294 | 4743 |
|
4744 |
glxSphDraw:arrayOf4Floats in:aGLXWindowId |
|
4745 |
"argument must be an array(a matrix) of 4 floats containing the |
|
4746 |
sphere - in real GL only" |
|
4747 |
||
4748 |
%{ /* NOCONTEXT */ |
|
4749 |
#ifdef GLX |
|
4750 |
float vec[4], *v; |
|
4751 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4752 |
if (! (v = __glx_getFloatsFromInto(arrayOf4Floats, vec, 4))) RETURN(false); |
294 | 4753 |
SETWIN(aGLXWindowId) |
4754 |
sphdraw(v); |
|
1932 | 4755 |
#endif |
4756 |
%} |
|
294 | 4757 |
! |
4758 |
||
4759 |
glxSphDrawX:x y:y z:z radius:r in:aGLXWindowId |
|
4760 |
"arguments must be convertable to floats - in real GL only" |
|
4761 |
||
4762 |
%{ /* NOCONTEXT */ |
|
4763 |
#ifdef GLX |
|
4764 |
float vec[4]; |
|
4765 |
||
4766 |
_FLOAT_(x, vec[0]) |
|
4767 |
_FLOAT_(y, vec[1]) |
|
4768 |
_FLOAT_(z, vec[2]) |
|
4769 |
_FLOAT_(r, vec[3]) |
|
4770 |
SETWIN(aGLXWindowId) |
|
4771 |
sphdraw(vec); |
|
1932 | 4772 |
#endif |
4773 |
%} |
|
294 | 4774 |
! |
4775 |
||
4776 |
glxSphfreeIn: aGLXWindowId |
|
4777 |
||
4778 |
%{ /* NOCONTEXT */ |
|
4779 |
#ifdef GLX |
|
4780 |
SETWIN(aGLXWindowId) |
|
4781 |
sphfree(); |
|
1932 | 4782 |
#endif |
4783 |
%} |
|
294 | 4784 |
! |
4785 |
||
4786 |
glxSphgnpolysIn: aGLXWindowId |
|
4787 |
||
4788 |
%{ /* NOCONTEXT */ |
|
4789 |
#ifdef GLX |
|
4790 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4791 |
RETURN (__MKSMALLINT(sphgnpolys())); |
294 | 4792 |
#endif |
4793 |
%} |
|
4794 |
! |
|
4795 |
||
4796 |
glxSphmode: attribute value: value in: aGLXWindowId |
|
4797 |
||
4798 |
%{ /* NOCONTEXT */ |
|
4799 |
#ifdef GLX |
|
4800 |
SETWIN(aGLXWindowId) |
|
4801 |
sphmode(__intVal(attribute), __intVal(value)); |
|
1932 | 4802 |
#endif |
4803 |
%} |
|
294 | 4804 |
! |
4805 |
||
4806 |
glxSphobj: objid in: aGLXWindowId |
|
4807 |
||
4808 |
%{ /* NOCONTEXT */ |
|
4809 |
#ifdef GLX |
|
4810 |
SETWIN(aGLXWindowId) |
|
4811 |
sphobj(_objectVal(objid)); |
|
1932 | 4812 |
#endif |
4813 |
%} |
|
294 | 4814 |
! |
4815 |
||
4816 |
glxSphrotmatrix: mat in: aGLXWindowId |
|
4817 |
||
4818 |
%{ /* NOCONTEXT */ |
|
4819 |
#ifdef GLX |
|
4820 |
Matrix matrix, *m; |
|
4821 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4822 |
if (! (m = __glx_getFloatsFromMatrixInto(mat, &matrix))) RETURN (false); |
294 | 4823 |
SETWIN(aGLXWindowId) |
4824 |
sphrotmatrix(*m); |
|
1932 | 4825 |
#endif |
4826 |
%} |
|
294 | 4827 |
! ! |
4828 |
||
4829 |
!GLXWorkstation methodsFor:'stereo extension'! |
|
4830 |
||
528 | 4831 |
glxLeftbuffer: bool in: aGLXWindowId |
4832 |
||
4833 |
%{ /* NOCONTEXT */ |
|
4834 |
#ifdef FULL_GLX |
|
4835 |
SETWIN(aGLXWindowId) |
|
4836 |
leftbuffer(_booleanVal(bool)); |
|
1932 | 4837 |
#endif |
4838 |
%} |
|
528 | 4839 |
! |
4840 |
||
4841 |
glxMonobufferIn: aGLXWindowId |
|
4842 |
||
4843 |
%{ /* NOCONTEXT */ |
|
4844 |
#ifdef FULL_GLX |
|
4845 |
SETWIN(aGLXWindowId) |
|
4846 |
monobuffer(); |
|
1932 | 4847 |
#endif |
4848 |
%} |
|
528 | 4849 |
! |
4850 |
||
4851 |
glxRightbuffer: bool in: aGLXWindowId |
|
4852 |
||
4853 |
%{ /* NOCONTEXT */ |
|
4854 |
#ifdef FULL_GLX |
|
4855 |
SETWIN(aGLXWindowId) |
|
4856 |
rightbuffer(_booleanVal(bool)); |
|
1932 | 4857 |
#endif |
4858 |
%} |
|
528 | 4859 |
! |
4860 |
||
294 | 4861 |
stereoExtensionBuffer:aBufferSymbol for:aWindowId |
4862 |
"set the current stereo buffer; the argument may be one of: |
|
4863 |
#left -> STEREO_BUFFER_LEFT |
|
4864 |
#right -> STEREO_BUFFER_RIGHT |
|
4865 |
" |
|
4866 |
||
4867 |
%{ /* NOCONTEXT */ |
|
4868 |
#if defined(XSGIStereo) && defined(GLX) |
|
4869 |
Status status; |
|
4870 |
int buffer; |
|
4871 |
Window win; |
|
4872 |
||
4718 | 4873 |
if (ISCONNECTED |
294 | 4874 |
&& __isExternalAddress(aWindowId)) { |
4875 |
win = _WindowVal(aWindowId); |
|
4876 |
if (aBufferSymbol == @symbol(left)) { |
|
4877 |
buffer = STEREO_BUFFER_LEFT; |
|
4878 |
} else { |
|
4879 |
if (aBufferSymbol == @symbol(right)) { |
|
4880 |
buffer = STEREO_BUFFER_RIGHT; |
|
4881 |
} else { |
|
4882 |
goto bad; |
|
4883 |
} |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4884 |
} |
294 | 4885 |
status = XSGISetStereoBuffer(myDpy, win, buffer); |
4886 |
RETURN ( status ? true : false); |
|
4887 |
} |
|
4888 |
bad: ; |
|
4889 |
#endif |
|
4890 |
%}. |
|
4891 |
self primitiveFailed |
|
4892 |
||
4893 |
" |
|
4894 |
|t v| |
|
4895 |
||
4896 |
t := StandardSystemView new. |
|
4897 |
t extent:300@300. |
|
4898 |
v := GLXView origin:0.0@0.0 corner:1.0@1.0 in:t. |
|
4899 |
t openAndWait. |
|
4900 |
||
4718 | 4901 |
v device stereoExtensionBuffer:#left for:(v id). |
294 | 4902 |
(Delay forSeconds:10) wait. |
4718 | 4903 |
v device stereoExtensionBuffer:#right for:(v id). |
294 | 4904 |
" |
4905 |
! |
|
4906 |
||
4907 |
stereoExtensionMode:aModeSymbol height:h offset:o for:aWindowId |
|
4908 |
"set the current stereo mode; the argument may be one of: |
|
4909 |
nil/false #off -> turn it off |
|
4910 |
#bottom -> STEREO_BOTTOM |
|
4911 |
#top -> STEREO_TOP |
|
4912 |
" |
|
4913 |
||
4914 |
%{ /* NOCONTEXT */ |
|
4915 |
#if defined(XSGIStereo) && defined(GLX) |
|
4916 |
Status status; |
|
4917 |
int mode; |
|
4918 |
unsigned short us_h, us_o; |
|
4919 |
Window win; |
|
4920 |
||
4718 | 4921 |
if (ISCONNECTED |
294 | 4922 |
&& __bothSmallInteger(h, o) |
4923 |
&& __isExternalAddress(aWindowId)) { |
|
4924 |
win = _WindowVal(aWindowId); |
|
4925 |
if ((aModeSymbol == nil) |
|
4926 |
|| (aModeSymbol == false) |
|
4927 |
|| (aModeSymbol == @symbol(off))) { |
|
4928 |
mode = STEREO_OFF; |
|
4929 |
} else { |
|
4930 |
if (aModeSymbol == @symbol(bottom)) { |
|
4931 |
mode = STEREO_BOTTOM; |
|
4932 |
} else { |
|
4933 |
if (aModeSymbol == @symbol(top)) { |
|
4934 |
mode = STEREO_TOP; |
|
4935 |
} else { |
|
4936 |
goto bad; |
|
4937 |
} |
|
4938 |
} |
|
4939 |
} |
|
4940 |
us_h = __intVal(h); |
|
4941 |
us_o = __intVal(o); |
|
4942 |
status = XSGISetStereoMode(myDpy, win, us_h, us_o, mode); |
|
4943 |
RETURN ( status ? true : false); |
|
4944 |
} |
|
4945 |
bad: ; |
|
4946 |
#endif |
|
4947 |
%}. |
|
4948 |
self primitiveFailed |
|
4949 |
||
4950 |
" |
|
4718 | 4951 |
Display stereoExtensionMode:#top height:492 offset:532 for:(Display rootWindowId). |
294 | 4952 |
(Delay forSeconds:10) wait. |
4718 | 4953 |
Display stereoExtensionMode:#off height:0 offset:0 for:(Display rootWindowId). |
294 | 4954 |
" |
4955 |
! |
|
4956 |
||
4957 |
stereoExtensionModeIn:aWindowId |
|
4958 |
"return the current stereo mode for some window" |
|
4959 |
||
4960 |
%{ /* NOCONTEXT */ |
|
4961 |
#if defined(XSGIStereo) && defined(GLX) |
|
4962 |
int mode; |
|
4963 |
Window win; |
|
4964 |
||
4965 |
if (ISCONNECTED && __isExternalAddress(aWindowId)) { |
|
4966 |
win = _WindowVal(aWindowId); |
|
4967 |
mode = XSGIQueryStereoMode(myDpy, win); |
|
4968 |
switch (mode) { |
|
4969 |
case STEREO_OFF: |
|
4970 |
RETURN ( @symbol(off) ); |
|
4971 |
case STEREO_BOTTOM: |
|
4972 |
RETURN ( @symbol(bottom) ); |
|
4973 |
case STEREO_TOP: |
|
4974 |
RETURN ( @symbol(top) ); |
|
4975 |
} |
|
4976 |
RETURN ( @symbol(unsupported) ); |
|
4977 |
} |
|
4978 |
#endif |
|
4979 |
%}. |
|
4980 |
self primitiveFailed |
|
4981 |
||
4982 |
" |
|
4983 |
|v| |
|
4984 |
||
4985 |
v := StandardSystemView new. |
|
4986 |
v extent:300@300. |
|
4987 |
v openAndWait. |
|
4988 |
v device stereoExtensionModeIn:(v id) |
|
4989 |
||
4718 | 4990 |
Display stereoExtensionModeIn:Display rootWindowId |
294 | 4991 |
" |
4992 |
! |
|
4993 |
||
4994 |
stereoExtensionVersion |
|
4995 |
"return the stereo extensions version as an array consisting of |
|
4996 |
major and minor numbers." |
|
4997 |
||
4998 |
%{ /* NOCONTEXT */ |
|
4999 |
#if defined(XSGIStereo) && defined(GLX) |
|
5000 |
Status status; |
|
5001 |
Display *dpy = myDpy; |
|
5002 |
int major, minor; |
|
5003 |
||
5004 |
if (ISCONNECTED) { |
|
5005 |
status = XSGIStereoQueryVersion(myDpy, &major, &minor); |
|
5006 |
if (status == True) { |
|
5007 |
RETURN ( __ARRAY_WITH2(__MKSMALLINT(major), __MKSMALLINT(minor))); |
|
5008 |
} |
|
89 | 5009 |
} |
5010 |
#endif |
|
5011 |
%}. |
|
294 | 5012 |
self primitiveFailed |
185 | 5013 |
|
5014 |
" |
|
294 | 5015 |
Display stereoExtensionVersion |
185 | 5016 |
" |
24 | 5017 |
! ! |
5018 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5019 |
!GLXWorkstation methodsFor:'texture data transfer'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5020 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5021 |
glxT2d: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5022 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5023 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5024 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5025 |
double vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5026 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5027 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5028 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5029 |
t2d(c_v); |
1932 | 5030 |
#endif |
5031 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5032 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5033 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5034 |
glxT2f: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5035 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5036 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5037 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5038 |
float vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5039 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5040 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5041 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5042 |
t2f(c_v); |
1932 | 5043 |
#endif |
5044 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5045 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5046 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5047 |
glxT2i: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5048 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5049 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5050 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5051 |
long vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5052 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5053 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5054 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5055 |
t2i(c_v); |
1932 | 5056 |
#endif |
5057 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5058 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5059 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5060 |
glxT2s: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5061 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5062 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5063 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5064 |
short vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5065 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5066 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5067 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5068 |
t2s(c_v); |
1932 | 5069 |
#endif |
5070 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5071 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5072 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5073 |
glxT3d:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5074 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5075 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5076 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5077 |
double vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5078 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5079 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5080 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5081 |
t3d(c_v); |
1932 | 5082 |
#endif |
5083 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5084 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5085 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5086 |
glxT3f:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5087 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5088 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5089 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5090 |
float vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5091 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5092 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5093 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5094 |
t3f(c_v); |
1932 | 5095 |
#endif |
5096 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5097 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5098 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5099 |
glxT3i:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5100 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5101 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5102 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5103 |
long vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5104 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5105 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5106 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5107 |
t3i(c_v); |
1932 | 5108 |
#endif |
5109 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5110 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5111 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5112 |
glxT3s:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5113 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5114 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5115 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5116 |
short vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5117 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5118 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5119 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5120 |
t3s(c_v); |
1932 | 5121 |
#endif |
5122 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5123 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5124 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5125 |
glxT4d: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5126 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5127 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5128 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5129 |
double vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5130 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5131 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5132 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5133 |
t4d(c_v); |
1932 | 5134 |
#endif |
5135 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5136 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5137 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5138 |
glxT4f: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5139 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5140 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5141 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5142 |
float vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5143 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5144 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5145 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5146 |
t4f(c_v); |
1932 | 5147 |
#endif |
5148 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5149 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5150 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5151 |
glxT4i: v in: aGLXWindowId |
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 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5154 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5155 |
long vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5156 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5157 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5158 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5159 |
t4i(c_v); |
1932 | 5160 |
#endif |
5161 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5162 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5163 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5164 |
glxT4s: v in: aGLXWindowId |
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 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5167 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5168 |
short vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5169 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5170 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5171 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5172 |
t4s(c_v); |
1932 | 5173 |
#endif |
5174 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5175 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5176 |
|
294 | 5177 |
!GLXWorkstation methodsFor:'transformations'! |
5178 |
||
5179 |
glxRotate:angle axis:axis in:aGLXWindowId |
|
5180 |
"rotate the current matrix around the axis given by the axis arg, |
|
5181 |
which must be one of the symbols: #x, #y or #z. |
|
5182 |
The angle is in degrees." |
|
5183 |
||
5184 |
%{ /* NOCONTEXT */ |
|
5185 |
||
5186 |
char c_axis; |
|
5187 |
||
5188 |
if (axis == @symbol(x)) |
|
5189 |
c_axis = 'x'; |
|
5190 |
else if (axis == @symbol(y)) |
|
5191 |
c_axis = 'y'; |
|
5192 |
else if (axis == @symbol(z)) |
|
5193 |
c_axis = 'z'; |
|
5194 |
else { |
|
5195 |
RETURN (false); |
|
5196 |
} |
|
5197 |
||
5198 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5199 |
RETURN ( __glx_doRotate(angle, c_axis) ); |
294 | 5200 |
%} |
5201 |
! |
|
5202 |
||
5203 |
glxRotate:arrayOf3Floats in:aGLXWindowId |
|
5204 |
"rotate current matrix, given a 3-element vector (or more). |
|
5205 |
The elements of the array are degrees." |
|
5206 |
||
5207 |
%{ /* NOCONTEXT */ |
|
5208 |
||
5209 |
float vec[3], *v; |
|
5210 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5211 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5212 |
|
5213 |
SETWIN(aGLXWindowId) |
|
1932 | 5214 |
#ifdef OPENGL |
5215 |
#else |
|
294 | 5216 |
rot(v[0], 'x'); |
5217 |
rot(v[1], 'y'); |
|
5218 |
rot(v[2], 'z'); |
|
1932 | 5219 |
#endif |
294 | 5220 |
%} |
5221 |
! |
|
5222 |
||
5223 |
glxRotateI:angle axis:axis in:aGLXWindowId |
|
5224 |
"rotate the current matrix around the axis given by the axis arg, |
|
5225 |
which must be one of the symbols: #x, #y or #z. |
|
5226 |
The angle is an integer specifying tenths of a degree." |
|
5227 |
||
5228 |
%{ /* NOCONTEXT */ |
|
5229 |
||
5230 |
char c_axis; |
|
5231 |
||
5232 |
if (axis == @symbol(x)) |
|
5233 |
c_axis = 'x'; |
|
5234 |
else if (axis == @symbol(y)) |
|
5235 |
c_axis = 'y'; |
|
5236 |
else if (axis == @symbol(z)) |
|
5237 |
c_axis = 'z'; |
|
5238 |
else { |
|
5239 |
RETURN (false); |
|
5240 |
} |
|
5241 |
||
5242 |
if (__isSmallInteger(angle)) { |
|
5243 |
SETWIN(aGLXWindowId) |
|
1932 | 5244 |
#ifdef OPENGL |
5245 |
#else |
|
294 | 5246 |
rotate(__intVal(angle), c_axis); |
1932 | 5247 |
#endif |
294 | 5248 |
} |
5249 |
%} |
|
5250 |
! |
|
5251 |
||
5252 |
glxRotateIX:angle in:aGLXWindowId |
|
5253 |
"rotate the current matrix on x axis. |
|
5254 |
The angle is an integer specifying tenths of a degree." |
|
5255 |
||
5256 |
%{ /* NOCONTEXT */ |
|
5257 |
||
5258 |
if (__isSmallInteger(angle)) { |
|
5259 |
SETWIN(aGLXWindowId) |
|
1932 | 5260 |
#ifdef OPENGL |
5261 |
#else |
|
294 | 5262 |
rotate(__intVal(angle), 'x'); |
1932 | 5263 |
#endif |
294 | 5264 |
} |
5265 |
%} |
|
5266 |
! |
|
5267 |
||
5268 |
glxRotateIX:xAngle y:yAngle z:zAngle in:aGLXWindowId |
|
5269 |
"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
|
5270 |
The values are smallIntegers specifying tenths of a degree." |
294 | 5271 |
|
5272 |
%{ /* NOCONTEXT */ |
|
5273 |
||
5274 |
if (__bothSmallInteger(xAngle, yAngle) |
|
5275 |
&& __isSmallInteger(zAngle)) { |
|
5276 |
SETWIN(aGLXWindowId) |
|
1932 | 5277 |
#ifdef OPENGL |
5278 |
#else |
|
294 | 5279 |
rotate(__intVal(xAngle), 'x'); |
5280 |
rotate(__intVal(yAngle), 'y'); |
|
5281 |
rotate(__intVal(zAngle), 'z'); |
|
1932 | 5282 |
#endif |
294 | 5283 |
} |
5284 |
%} |
|
5285 |
! |
|
5286 |
||
5287 |
glxRotateIY:angle in:aGLXWindowId |
|
5288 |
"rotate the current matrix on x axis. |
|
5289 |
The angle is an integer specifying tenths of a degree." |
|
5290 |
||
5291 |
%{ /* NOCONTEXT */ |
|
5292 |
||
5293 |
if (__isSmallInteger(angle)) { |
|
5294 |
SETWIN(aGLXWindowId) |
|
1932 | 5295 |
#ifdef OPENGL |
5296 |
#else |
|
294 | 5297 |
rotate(__intVal(angle), 'y'); |
1932 | 5298 |
#endif |
294 | 5299 |
} |
5300 |
%} |
|
5301 |
! |
|
5302 |
||
5303 |
glxRotateIZ:angle in:aGLXWindowId |
|
5304 |
"rotate the current matrix on x axis. |
|
5305 |
The angle is an integer specifying tenths of a degree." |
|
5306 |
||
5307 |
%{ /* NOCONTEXT */ |
|
5308 |
||
5309 |
if (__isSmallInteger(angle)) { |
|
5310 |
SETWIN(aGLXWindowId) |
|
1932 | 5311 |
#ifdef OPENGL |
5312 |
#else |
|
294 | 5313 |
rotate(__intVal(angle), 'z'); |
1932 | 5314 |
#endif |
294 | 5315 |
} |
5316 |
%} |
|
5317 |
! |
|
5318 |
||
5319 |
glxRotateX:angle in:aGLXWindowId |
|
5320 |
"rotate the current matrix on x axis. |
|
5321 |
The angle is in degrees." |
|
5322 |
||
5323 |
%{ /* NOCONTEXT */ |
|
5324 |
||
5325 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5326 |
RETURN (__glx_doRotate(angle, 'x')); |
294 | 5327 |
%} |
5328 |
! |
|
5329 |
||
5330 |
glxRotateX:xAngle y:yAngle z:zAngle in:aGLXWindowId |
|
5331 |
"rotate the current matrix on all axes, given individual x, y and z values. |
|
5332 |
The values are in degrees" |
|
5333 |
||
5334 |
%{ /* NOCONTEXT */ |
|
5335 |
||
5336 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5337 |
if ( __glx_doRotate(xAngle, 'x') == true) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5338 |
if ( __glx_doRotate(yAngle, 'y') == true) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5339 |
RETURN (__glx_doRotate(zAngle, 'z')); |
294 | 5340 |
} |
5341 |
} |
|
5342 |
%} |
|
5343 |
! |
|
5344 |
||
5345 |
glxRotateY:angle in:aGLXWindowId |
|
5346 |
"rotate the current matrix on y axis. |
|
5347 |
The angle is in degrees." |
|
5348 |
||
5349 |
%{ /* NOCONTEXT */ |
|
5350 |
||
5351 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5352 |
RETURN (__glx_doRotate(angle, 'y')); |
294 | 5353 |
%} |
5354 |
! |
|
5355 |
||
5356 |
glxRotateZ:angle in:aGLXWindowId |
|
5357 |
"rotate the current matrix on z axis. |
|
5358 |
The angle is in degrees." |
|
5359 |
||
5360 |
%{ /* NOCONTEXT */ |
|
5361 |
||
5362 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5363 |
RETURN (__glx_doRotate(angle, 'z')); |
294 | 5364 |
%} |
5365 |
! |
|
5366 |
||
5367 |
glxScale:arrayOf3Floats in:aGLXWindowId |
|
5368 |
"scale current matrix, given a 3-element vector" |
|
5369 |
||
5370 |
%{ /* NOCONTEXT */ |
|
5371 |
||
5372 |
float vec[3], *v; |
|
5373 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5374 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5375 |
|
5376 |
SETWIN(aGLXWindowId) |
|
1932 | 5377 |
#ifdef OPENGL |
5378 |
#else |
|
294 | 5379 |
scale(v[0], v[1], v[2]); |
1932 | 5380 |
#endif |
294 | 5381 |
%} |
5382 |
! |
|
5383 |
||
5384 |
glxScaleX:x in:aGLXWindowId |
|
5385 |
"scale in x direction" |
|
5386 |
||
5387 |
%{ /* NOCONTEXT */ |
|
5388 |
||
5389 |
float f_x; |
|
5390 |
||
5391 |
_FLOAT_ (x, f_x) |
|
5392 |
SETWIN(aGLXWindowId) |
|
1932 | 5393 |
#ifdef OPENGL |
5394 |
#else |
|
294 | 5395 |
scale(f_x, (float)0, (float)0); |
1932 | 5396 |
#endif |
294 | 5397 |
%} |
5398 |
! |
|
5399 |
||
5400 |
glxScaleX:x y:y z:z in:aGLXWindowId |
|
5401 |
"scale & mirror current matrix, given individual x, y and z values" |
|
5402 |
||
5403 |
%{ /* NOCONTEXT */ |
|
5404 |
||
5405 |
float f_x, f_y, f_z; |
|
5406 |
||
5407 |
_FLOAT_ (x, f_x) |
|
5408 |
_FLOAT_ (y, f_y) |
|
5409 |
_FLOAT_ (z, f_z) |
|
5410 |
SETWIN(aGLXWindowId) |
|
1932 | 5411 |
#ifdef OPENGL |
5412 |
#else |
|
294 | 5413 |
scale(f_x, f_y, f_z); |
1932 | 5414 |
#endif |
294 | 5415 |
%} |
5416 |
! |
|
5417 |
||
5418 |
glxScaleY:y in:aGLXWindowId |
|
5419 |
"scale in y direction" |
|
5420 |
||
5421 |
%{ /* NOCONTEXT */ |
|
5422 |
||
5423 |
float f_y; |
|
5424 |
||
5425 |
_FLOAT_ (y, f_y) |
|
5426 |
SETWIN(aGLXWindowId) |
|
1932 | 5427 |
#ifdef OPENGL |
5428 |
#else |
|
294 | 5429 |
scale((float)0, f_y, (float)0); |
1932 | 5430 |
#endif |
294 | 5431 |
%} |
5432 |
! |
|
5433 |
||
5434 |
glxScaleZ:z in:aGLXWindowId |
|
5435 |
"scale in z direction" |
|
5436 |
||
5437 |
%{ /* NOCONTEXT */ |
|
5438 |
||
5439 |
float f_z; |
|
5440 |
||
5441 |
_FLOAT_ (z, f_z) |
|
5442 |
SETWIN(aGLXWindowId) |
|
1932 | 5443 |
#ifdef OPENGL |
5444 |
#else |
|
294 | 5445 |
scale((float)0, (float)0, f_z); |
1932 | 5446 |
#endif |
294 | 5447 |
%} |
5448 |
! |
|
5449 |
||
5450 |
glxTranslate:arrayOf3Floats in:aGLXWindowId |
|
5451 |
"translate current matrix, given a 3-element vector" |
|
5452 |
||
5453 |
%{ /* NOCONTEXT */ |
|
5454 |
||
5455 |
float vec[3], *v; |
|
5456 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5457 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5458 |
|
5459 |
SETWIN(aGLXWindowId) |
|
1932 | 5460 |
#ifdef OPENGL |
5461 |
#else |
|
294 | 5462 |
translate((Coord)(v[0]), (Coord)(v[1]), (Coord)(v[2])); |
1932 | 5463 |
#endif |
294 | 5464 |
%} |
5465 |
! |
|
5466 |
||
5467 |
glxTranslateX:x in:aGLXWindowId |
|
5468 |
"translate current matrix on X axis" |
|
5469 |
||
5470 |
%{ /* NOCONTEXT */ |
|
5471 |
||
5472 |
Coord c_x; |
|
5473 |
||
5474 |
_COORD_ (x, c_x) |
|
5475 |
SETWIN(aGLXWindowId) |
|
1932 | 5476 |
#ifdef OPENGL |
5477 |
#else |
|
294 | 5478 |
translate(c_x, (Coord)0, (Coord)0); |
1932 | 5479 |
#endif |
294 | 5480 |
%} |
5481 |
! |
|
5482 |
||
5483 |
glxTranslateX:x y:y z:z in:aGLXWindowId |
|
5484 |
"translate current matrix, given individual x, y and z values" |
|
5485 |
||
5486 |
%{ /* NOCONTEXT */ |
|
5487 |
||
5488 |
Coord c_x, c_y, c_z; |
|
5489 |
||
5490 |
_COORD_ (x, c_x) |
|
5491 |
_COORD_ (y, c_y) |
|
5492 |
_COORD_ (z, c_z) |
|
5493 |
SETWIN(aGLXWindowId) |
|
1932 | 5494 |
#ifdef OPENGL |
5495 |
#else |
|
294 | 5496 |
translate(c_x, c_y, c_z); |
1932 | 5497 |
#endif |
294 | 5498 |
%} |
5499 |
! |
|
5500 |
||
5501 |
glxTranslateY:y in:aGLXWindowId |
|
5502 |
"translate current matrix on Y axis" |
|
5503 |
||
5504 |
%{ /* NOCONTEXT */ |
|
5505 |
||
5506 |
Coord c_y; |
|
5507 |
||
5508 |
_COORD_ (y, c_y) |
|
5509 |
SETWIN(aGLXWindowId) |
|
1932 | 5510 |
#ifdef OPENGL |
5511 |
#else |
|
294 | 5512 |
translate((Coord)0, c_y, (Coord)0); |
1932 | 5513 |
#endif |
294 | 5514 |
%} |
5515 |
! |
|
5516 |
||
5517 |
glxTranslateZ:z in:aGLXWindowId |
|
5518 |
"translate current matrix on Z axis" |
|
5519 |
||
5520 |
%{ /* NOCONTEXT */ |
|
5521 |
||
5522 |
Coord c_z; |
|
5523 |
||
5524 |
_COORD_ (z, c_z) |
|
5525 |
SETWIN(aGLXWindowId) |
|
1932 | 5526 |
#ifdef OPENGL |
5527 |
#else |
|
294 | 5528 |
translate((Coord)0, (Coord)0, c_z); |
1932 | 5529 |
#endif |
294 | 5530 |
%} |
5531 |
! ! |
|
5532 |
||
5533 |
!GLXWorkstation methodsFor:'unspecified rest'! |
|
5534 |
||
5535 |
glxAcbufOp:op value:value in:aGLXWindowId |
|
5536 |
||
5537 |
%{ /* NOCONTEXT */ |
|
1932 | 5538 |
SETWIN(aGLXWindowId) |
5539 |
#ifdef GLX |
|
294 | 5540 |
acbuf(__intVal(op), _floatVal(value)); |
1932 | 5541 |
#endif |
5542 |
%} |
|
294 | 5543 |
! |
5544 |
||
5545 |
glxAcsizePlanes: planes in: aGLXWindowId |
|
5546 |
||
5547 |
%{ /* NOCONTEXT */ |
|
1932 | 5548 |
SETWIN(aGLXWindowId) |
5549 |
#ifdef GLX |
|
294 | 5550 |
acsize(__intVal(planes)); |
1932 | 5551 |
#endif |
5552 |
%} |
|
294 | 5553 |
! |
5554 |
||
5555 |
glxAfunctionRef: ref func: func in: aGLXWindowId |
|
5556 |
||
5557 |
%{ /* NOCONTEXT */ |
|
1932 | 5558 |
SETWIN(aGLXWindowId) |
5559 |
#ifdef GLX |
|
294 | 5560 |
afunction(__intVal(ref), __intVal(func)); |
1932 | 5561 |
#endif |
5562 |
%} |
|
294 | 5563 |
! |
5564 |
||
5565 |
glxBbox2Xmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5566 |
||
5567 |
%{ /* NOCONTEXT */ |
|
5568 |
Screencoord c_xmin, c_ymin; |
|
4718 | 5569 |
Coord c_x1, c_y1, c_x2, c_y2; |
294 | 5570 |
|
5571 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5572 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5573 |
_COORD_ (x1, c_x1) |
|
5574 |
_COORD_ (y1, c_y1) |
|
5575 |
_COORD_ (x2, c_x2) |
|
5576 |
_COORD_ (y2, c_y2) |
|
5577 |
SETWIN(aGLXWindowId) |
|
1932 | 5578 |
#ifdef GLX |
294 | 5579 |
bbox2(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5580 |
#endif |
5581 |
%} |
|
294 | 5582 |
! |
5583 |
||
5584 |
glxBbox2iXmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5585 |
||
5586 |
%{ /* NOCONTEXT */ |
|
5587 |
Screencoord c_xmin, c_ymin; |
|
4718 | 5588 |
Icoord c_x1, c_y1, c_x2, c_y2; |
294 | 5589 |
|
5590 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5591 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5592 |
_ICOORD_ (x1, c_x1) |
|
5593 |
_ICOORD_ (y1, c_y1) |
|
5594 |
_ICOORD_ (x2, c_x2) |
|
5595 |
_ICOORD_ (y2, c_y2) |
|
5596 |
SETWIN(aGLXWindowId) |
|
1932 | 5597 |
#ifdef GLX |
294 | 5598 |
bbox2i(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5599 |
#endif |
5600 |
%} |
|
294 | 5601 |
! |
5602 |
||
5603 |
glxBbox2sXmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5604 |
||
5605 |
%{ /* NOCONTEXT */ |
|
5606 |
Screencoord c_xmin, c_ymin; |
|
4718 | 5607 |
Scoord c_x1, c_y1, c_x2, c_y2; |
294 | 5608 |
|
5609 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5610 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5611 |
_SCOORD_ (x1, c_x1) |
|
5612 |
_SCOORD_ (y1, c_y1) |
|
5613 |
_SCOORD_ (x2, c_x2) |
|
5614 |
_SCOORD_ (y2, c_y2) |
|
5615 |
SETWIN(aGLXWindowId) |
|
1932 | 5616 |
#ifdef GLX |
294 | 5617 |
bbox2s(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5618 |
#endif |
5619 |
%} |
|
294 | 5620 |
! |
5621 |
||
5622 |
glxBeginTrimIn: aGLXWindowId |
|
5623 |
||
5624 |
%{ /* NOCONTEXT */ |
|
1932 | 5625 |
SETWIN(aGLXWindowId) |
5626 |
#ifdef GLX |
|
294 | 5627 |
bgntrim(); |
1932 | 5628 |
#endif |
5629 |
%} |
|
294 | 5630 |
! |
5631 |
||
5632 |
glxBlankscreen: b in: aGLXWindowId |
|
5633 |
||
5634 |
%{ /* NOCONTEXT */ |
|
1932 | 5635 |
SETWIN(aGLXWindowId) |
5636 |
#ifdef GLX |
|
294 | 5637 |
blankscreen(_booleanVal(b)); |
1932 | 5638 |
#endif |
5639 |
%} |
|
294 | 5640 |
! |
5641 |
||
5642 |
glxBlanktime: count in: aGLXWindowId |
|
5643 |
||
5644 |
%{ /* NOCONTEXT */ |
|
1932 | 5645 |
SETWIN(aGLXWindowId) |
5646 |
#ifdef GLX |
|
294 | 5647 |
blanktime(__intVal(count)); |
1932 | 5648 |
#endif |
5649 |
%} |
|
294 | 5650 |
! |
5651 |
||
5652 |
glxBlendcolorRed: red green: green blue: blue alpha: alpha in: aGLXWindowId |
|
5653 |
||
5654 |
%{ /* NOCONTEXT */ |
|
1932 | 5655 |
SETWIN(aGLXWindowId) |
294 | 5656 |
#ifdef FULL_GLX |
4718 | 5657 |
blendcolor(_floatVal(red), _floatVal(green), _floatVal(blue), _floatVal(alpha)); |
1932 | 5658 |
#endif |
5659 |
%} |
|
294 | 5660 |
! |
5661 |
||
5662 |
glxBlendfunctionSfactr: sfactr dfactr: dfactr in: aGLXWindowId |
|
5663 |
||
5664 |
%{ /* NOCONTEXT */ |
|
1932 | 5665 |
SETWIN(aGLXWindowId) |
5666 |
#ifdef GLX |
|
294 | 5667 |
blendfunction(__intVal(sfactr), __intVal(dfactr)); |
1932 | 5668 |
#endif |
5669 |
%} |
|
294 | 5670 |
! |
5671 |
||
5672 |
glxBlinkRate: rate i: i red: red green: green blue: blue in: aGLXWindowId |
|
5673 |
||
5674 |
%{ /* NOCONTEXT */ |
|
1932 | 5675 |
SETWIN(aGLXWindowId) |
5676 |
#ifdef GLX |
|
4718 | 5677 |
blink(_shortVal(rate), _colorindexVal(i), |
294 | 5678 |
_shortVal(red), _shortVal(green), _shortVal(blue)); |
1932 | 5679 |
#endif |
5680 |
%} |
|
294 | 5681 |
! |
5682 |
||
5683 |
glxBlkqreadData: data n: n in: aGLXWindowId |
|
5684 |
||
5685 |
%{ /* NOCONTEXT */ |
|
1932 | 5686 |
int rslt = -1; |
5687 |
||
5688 |
SETWIN(aGLXWindowId) |
|
5689 |
#ifdef GLX |
|
5690 |
rslt = blkqread((short *)_indexedArea(data), __intVal(n)); |
|
5691 |
#endif |
|
5692 |
RETURN (__MKSMALLINT(rslt)); |
|
5693 |
%} |
|
294 | 5694 |
! |
5695 |
||
5696 |
glxC3f: v in: aGLXWindowId |
|
5697 |
||
5698 |
%{ /* NOCONTEXT */ |
|
5699 |
float vec[3], *c_v; |
|
5700 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5701 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
294 | 5702 |
SETWIN(aGLXWindowId) |
1932 | 5703 |
#ifdef GLX |
294 | 5704 |
c3f(c_v); |
1932 | 5705 |
#endif |
5706 |
%} |
|
294 | 5707 |
! |
5708 |
||
5709 |
glxC3i: v in: aGLXWindowId |
|
5710 |
||
5711 |
%{ /* NOCONTEXT */ |
|
5712 |
long vec[3], *c_v; |
|
5713 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5714 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
294 | 5715 |
SETWIN(aGLXWindowId) |
1932 | 5716 |
#ifdef GLX |
294 | 5717 |
c3i(c_v); |
1932 | 5718 |
#endif |
5719 |
%} |
|
294 | 5720 |
! |
5721 |
||
5722 |
glxC3s: v in: aGLXWindowId |
|
5723 |
||
5724 |
%{ /* NOCONTEXT */ |
|
5725 |
short vec[3], *c_v; |
|
5726 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5727 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
294 | 5728 |
SETWIN(aGLXWindowId) |
1932 | 5729 |
#ifdef GLX |
294 | 5730 |
c3s(c_v); |
1932 | 5731 |
#endif |
5732 |
%} |
|
294 | 5733 |
! |
5734 |
||
5735 |
glxC4f: v in: aGLXWindowId |
|
5736 |
||
5737 |
%{ /* NOCONTEXT */ |
|
5738 |
float vec[4], *c_v; |
|
5739 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5740 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
294 | 5741 |
SETWIN(aGLXWindowId) |
1932 | 5742 |
#ifdef GLX |
294 | 5743 |
c4f(c_v); |
1932 | 5744 |
#endif |
5745 |
%} |
|
294 | 5746 |
! |
5747 |
||
5748 |
glxC4i: v in: aGLXWindowId |
|
5749 |
||
5750 |
%{ /* NOCONTEXT */ |
|
5751 |
long vec[4], *c_v; |
|
5752 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5753 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
294 | 5754 |
SETWIN(aGLXWindowId) |
1932 | 5755 |
#ifdef GLX |
294 | 5756 |
c4i(c_v); |
1932 | 5757 |
#endif |
5758 |
%} |
|
294 | 5759 |
! |
5760 |
||
5761 |
glxC4s: v in: aGLXWindowId |
|
5762 |
||
5763 |
%{ /* NOCONTEXT */ |
|
5764 |
short vec[4], *c_v; |
|
5765 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5766 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
294 | 5767 |
SETWIN(aGLXWindowId) |
1932 | 5768 |
#ifdef GLX |
294 | 5769 |
c4s(c_v); |
1932 | 5770 |
#endif |
5771 |
%} |
|
294 | 5772 |
! |
5773 |
||
5774 |
glxClearhitcodeIn: aGLXWindowId |
|
5775 |
||
5776 |
%{ /* NOCONTEXT */ |
|
1932 | 5777 |
SETWIN(aGLXWindowId) |
5778 |
#ifdef GLX |
|
294 | 5779 |
clearhitcode(); |
1932 | 5780 |
#endif |
5781 |
%} |
|
294 | 5782 |
! |
5783 |
||
5784 |
glxClipplaneIndex: index mode: mode params: params in: aGLXWindowId |
|
5785 |
||
5786 |
%{ /* NOCONTEXT */ |
|
5787 |
float vec[4], *v; |
|
5788 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5789 |
if (! (v = __glx_getFloatsFromInto(params, vec, 4))) RETURN(false); |
294 | 5790 |
SETWIN(aGLXWindowId) |
1932 | 5791 |
#ifdef GLX |
294 | 5792 |
clipplane(__intVal(index), __intVal(mode), v); |
1932 | 5793 |
#endif |
5794 |
%} |
|
294 | 5795 |
! |
5796 |
||
5797 |
glxCmodeIn: aGLXWindowId |
|
5798 |
||
5799 |
%{ /* NOCONTEXT */ |
|
1932 | 5800 |
SETWIN(aGLXWindowId) |
5801 |
#ifdef GLX |
|
294 | 5802 |
cmode(); |
1932 | 5803 |
#endif |
5804 |
%} |
|
294 | 5805 |
! |
5806 |
||
5807 |
glxColorfIndex: index in: aGLXWindowId |
|
5808 |
||
5809 |
^self glxColor: index in: aGLXWindowId |
|
5810 |
! |
|
5811 |
||
5812 |
glxCuroriginN: n xorigin: xorigin yorigin: yorigin in: aGLXWindowId |
|
5813 |
||
5814 |
%{ /* NOCONTEXT */ |
|
1932 | 5815 |
SETWIN(aGLXWindowId) |
5816 |
#ifdef GLX |
|
294 | 5817 |
curorigin(_shortVal(n), _shortVal(xorigin), _shortVal(yorigin)); |
1932 | 5818 |
#endif |
5819 |
%} |
|
294 | 5820 |
! |
5821 |
||
5822 |
glxCursoffIn: aGLXWindowId |
|
5823 |
||
5824 |
%{ /* NOCONTEXT */ |
|
1932 | 5825 |
SETWIN(aGLXWindowId) |
5826 |
#ifdef GLX |
|
294 | 5827 |
cursoff(); |
1932 | 5828 |
#endif |
5829 |
%} |
|
294 | 5830 |
! |
5831 |
||
5832 |
glxCursonIn: aGLXWindowId |
|
5833 |
||
5834 |
%{ /* NOCONTEXT */ |
|
1932 | 5835 |
SETWIN(aGLXWindowId) |
5836 |
#ifdef GLX |
|
294 | 5837 |
curson(); |
1932 | 5838 |
#endif |
5839 |
%} |
|
294 | 5840 |
! |
5841 |
||
5842 |
glxCurstype: type in: aGLXWindowId |
|
5843 |
||
5844 |
%{ /* NOCONTEXT */ |
|
1932 | 5845 |
SETWIN(aGLXWindowId) |
5846 |
#ifdef GLX |
|
294 | 5847 |
curstype(__intVal(type)); |
1932 | 5848 |
#endif |
5849 |
%} |
|
294 | 5850 |
! |
5851 |
||
5852 |
glxCyclemapDuration: duration map: map nxtmap: nxtmap in: aGLXWindowId |
|
5853 |
||
5854 |
%{ /* NOCONTEXT */ |
|
1932 | 5855 |
SETWIN(aGLXWindowId) |
5856 |
#ifdef GLX |
|
294 | 5857 |
cyclemap(_shortVal(duration), _shortVal(map), _shortVal(nxtmap)); |
1932 | 5858 |
#endif |
5859 |
%} |
|
294 | 5860 |
! |
5861 |
||
5862 |
glxDefpatternN: n size: size mask: mask in: aGLXWindowId |
|
5863 |
||
5864 |
%{ /* NOCONTEXT */ |
|
1932 | 5865 |
SETWIN(aGLXWindowId) |
5866 |
#ifdef GLX |
|
294 | 5867 |
defpattern(_shortVal(n), _shortVal(size), (unsigned short *)_indexedArea(mask)); |
1932 | 5868 |
#endif |
5869 |
%} |
|
294 | 5870 |
! |
5871 |
||
5872 |
glxDeltag: t in: aGLXWindowId |
|
5873 |
||
5874 |
%{ /* NOCONTEXT */ |
|
1932 | 5875 |
SETWIN(aGLXWindowId) |
5876 |
#ifdef GLX |
|
294 | 5877 |
deltag(_tagVal(t)); |
1932 | 5878 |
#endif |
5879 |
%} |
|
294 | 5880 |
! |
5881 |
||
5882 |
glxDepthcueMode: mode in: aGLXWindowId |
|
5883 |
||
5884 |
%{ /* NOCONTEXT */ |
|
1932 | 5885 |
SETWIN(aGLXWindowId) |
5886 |
#ifdef GLX |
|
294 | 5887 |
depthcue(_booleanVal(mode)); |
1932 | 5888 |
#endif |
5889 |
%} |
|
294 | 5890 |
! |
5891 |
||
5892 |
glxDitherMode: mode in: aGLXWindowId |
|
5893 |
||
5894 |
%{ /* NOCONTEXT */ |
|
1932 | 5895 |
SETWIN(aGLXWindowId) |
5896 |
#ifdef GLX |
|
294 | 5897 |
dither(_longVal(mode)); |
1932 | 5898 |
#endif |
5899 |
%} |
|
294 | 5900 |
! |
5901 |
||
5902 |
glxDopup: pup in: aGLXWindowId |
|
5903 |
||
5904 |
%{ /* NOCONTEXT */ |
|
1932 | 5905 |
SETWIN(aGLXWindowId) |
5906 |
#ifdef GLX |
|
294 | 5907 |
dopup(_longVal(pup)); |
1932 | 5908 |
#endif |
5909 |
%} |
|
294 | 5910 |
! |
5911 |
||
5912 |
glxDrawmode: mode in: aGLXWindowId |
|
5913 |
||
5914 |
%{ /* NOCONTEXT */ |
|
1932 | 5915 |
SETWIN(aGLXWindowId) |
5916 |
#ifdef GLX |
|
294 | 5917 |
drawmode(_longVal(mode)); |
1932 | 5918 |
#endif |
5919 |
%} |
|
294 | 5920 |
! |
5921 |
||
5922 |
glxEditobj: obj in: aGLXWindowId |
|
5923 |
||
5924 |
%{ /* NOCONTEXT */ |
|
1932 | 5925 |
SETWIN(aGLXWindowId) |
5926 |
#ifdef GLX |
|
294 | 5927 |
editobj(_objectVal(obj)); |
1932 | 5928 |
#endif |
5929 |
%} |
|
294 | 5930 |
! |
5931 |
||
5932 |
glxEndTrimIn: aGLXWindowId |
|
5933 |
||
5934 |
%{ /* NOCONTEXT */ |
|
1932 | 5935 |
SETWIN(aGLXWindowId) |
5936 |
#ifdef GLX |
|
294 | 5937 |
endtrim(); |
1932 | 5938 |
#endif |
5939 |
%} |
|
294 | 5940 |
! |
5941 |
||
5942 |
glxEndfullscrnIn: aGLXWindowId |
|
5943 |
||
5944 |
%{ /* NOCONTEXT */ |
|
1932 | 5945 |
SETWIN(aGLXWindowId) |
5946 |
#ifdef GLX |
|
294 | 5947 |
endfullscrn(); |
1932 | 5948 |
#endif |
5949 |
%} |
|
294 | 5950 |
! |
5951 |
||
5952 |
glxEndpupmodeIn: aGLXWindowId |
|
5953 |
||
5954 |
%{ /* NOCONTEXT */ |
|
1932 | 5955 |
SETWIN(aGLXWindowId) |
5956 |
#ifdef GLX |
|
294 | 5957 |
endpupmode(); |
1932 | 5958 |
#endif |
5959 |
%} |
|
294 | 5960 |
! |
5961 |
||
5962 |
glxFinishIn: aGLXWindowId |
|
5963 |
||
5964 |
%{ /* NOCONTEXT */ |
|
1932 | 5965 |
SETWIN(aGLXWindowId) |
5966 |
#ifdef GLX |
|
294 | 5967 |
finish(); |
1932 | 5968 |
#endif |
5969 |
%} |
|
294 | 5970 |
! |
5971 |
||
5972 |
glxFont: fntnum in: aGLXWindowId |
|
5973 |
||
5974 |
%{ /* NOCONTEXT */ |
|
5975 |
SETWIN(aGLXWindowId) |
|
1932 | 5976 |
#ifdef GLX |
294 | 5977 |
font(_shortVal(fntnum)); |
1932 | 5978 |
#endif |
294 | 5979 |
%} |
5980 |
! |
|
5981 |
||
5982 |
glxForegroundIn: aGLXWindowId |
|
5983 |
||
5984 |
%{ /* NOCONTEXT */ |
|
5985 |
SETWIN(aGLXWindowId) |
|
1932 | 5986 |
#ifdef OPENGL |
5987 |
#else |
|
294 | 5988 |
foreground(); |
1932 | 5989 |
#endif |
294 | 5990 |
%} |
5991 |
! |
|
5992 |
||
5993 |
glxFreepup: pup in: aGLXWindowId |
|
5994 |
||
5995 |
%{ /* NOCONTEXT */ |
|
1932 | 5996 |
SETWIN(aGLXWindowId) |
5997 |
#ifdef GLX |
|
294 | 5998 |
freepup(_longVal(pup)); |
1932 | 5999 |
#endif |
6000 |
%} |
|
294 | 6001 |
! |
6002 |
||
6003 |
glxFudgeXfudge: xfudge yfudge: yfudge in: aGLXWindowId |
|
6004 |
||
6005 |
%{ /* NOCONTEXT */ |
|
1932 | 6006 |
SETWIN(aGLXWindowId) |
6007 |
#ifdef GLX |
|
294 | 6008 |
fudge(_longVal(xfudge), _longVal(yfudge)); |
1932 | 6009 |
#endif |
6010 |
%} |
|
294 | 6011 |
! |
6012 |
||
6013 |
glxFullscrnIn: aGLXWindowId |
|
6014 |
||
6015 |
%{ /* NOCONTEXT */ |
|
1932 | 6016 |
SETWIN(aGLXWindowId) |
6017 |
#ifdef GLX |
|
294 | 6018 |
fullscrn(); |
1932 | 6019 |
#endif |
6020 |
%} |
|
294 | 6021 |
! |
6022 |
||
6023 |
glxGbeginIn: aGLXWindowId |
|
6024 |
||
6025 |
%{ /* NOCONTEXT */ |
|
1932 | 6026 |
SETWIN(aGLXWindowId) |
6027 |
#ifdef GLX |
|
294 | 6028 |
gbegin(); |
1932 | 6029 |
#endif |
6030 |
%} |
|
294 | 6031 |
! |
6032 |
||
6033 |
glxGentagIn: aGLXWindowId |
|
6034 |
||
6035 |
%{ /* NOCONTEXT */ |
|
1932 | 6036 |
int rslt = -1; |
6037 |
||
6038 |
#ifdef GLX |
|
6039 |
SETWIN(aGLXWindowId) |
|
6040 |
rslt = gentag(); |
|
6041 |
#endif |
|
6042 |
RETURN (__MKSMALLINT(rslt)); |
|
6043 |
%} |
|
294 | 6044 |
! |
6045 |
||
6046 |
glxGetbackfaceIn: aGLXWindowId |
|
6047 |
||
6048 |
%{ /* NOCONTEXT */ |
|
1932 | 6049 |
int rslt = -1; |
6050 |
||
6051 |
#ifdef GLX |
|
6052 |
SETWIN(aGLXWindowId) |
|
6053 |
rslt = getbackface(); |
|
6054 |
#endif |
|
6055 |
RETURN (__MKSMALLINT(rslt)); |
|
6056 |
%} |
|
294 | 6057 |
! |
6058 |
||
6059 |
glxGetbufferIn: aGLXWindowId |
|
6060 |
||
6061 |
%{ /* NOCONTEXT */ |
|
1932 | 6062 |
int rslt = -1; |
6063 |
||
6064 |
#ifdef GLX |
|
6065 |
SETWIN(aGLXWindowId) |
|
6066 |
rslt = getbuffer(); |
|
6067 |
#endif |
|
6068 |
RETURN (__MKSMALLINT(rslt)); |
|
6069 |
%} |
|
294 | 6070 |
! |
6071 |
||
6072 |
glxGetbutton: num in: aGLXWindowId |
|
6073 |
||
6074 |
%{ /* NOCONTEXT */ |
|
1932 | 6075 |
int rslt = -1; |
6076 |
||
6077 |
SETWIN(aGLXWindowId) |
|
6078 |
#ifdef OPENGL |
|
6079 |
#else |
|
6080 |
rslt = getbutton(_deviceVal(num)); |
|
6081 |
#endif |
|
6082 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6083 |
%} |
6084 |
! |
|
6085 |
||
6086 |
glxGetcmmodeIn: aGLXWindowId |
|
6087 |
||
6088 |
%{ /* NOCONTEXT */ |
|
1932 | 6089 |
int rslt = 0; |
6090 |
||
6091 |
SETWIN(aGLXWindowId) |
|
6092 |
#ifdef GLX |
|
6093 |
rslt = getcmmode(); |
|
6094 |
#endif |
|
6095 |
RETURN (__MKBOOLEAN(rslt)); |
|
6096 |
%} |
|
294 | 6097 |
! |
6098 |
||
6099 |
glxGetcolorIn: aGLXWindowId |
|
6100 |
"return the current drawing color" |
|
6101 |
||
6102 |
%{ /* NOCONTEXT */ |
|
1932 | 6103 |
int rslt = -1; |
6104 |
||
6105 |
SETWIN(aGLXWindowId) |
|
6106 |
#ifdef OPENGL |
|
6107 |
#else |
|
6108 |
rslt = getcolor(); |
|
6109 |
#endif |
|
6110 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6111 |
%} |
6112 |
! |
|
6113 |
||
6114 |
glxGetdcmIn: aGLXWindowId |
|
6115 |
||
6116 |
%{ /* NOCONTEXT */ |
|
6117 |
#ifdef GLX |
|
6118 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6119 |
RETURN (__MKBOOLEAN(getdcm())); |
294 | 6120 |
#endif |
6121 |
%} |
|
6122 |
. |
|
6123 |
^ false |
|
6124 |
! |
|
6125 |
||
6126 |
glxGetdescenderIn: aGLXWindowId |
|
6127 |
||
6128 |
%{ /* NOCONTEXT */ |
|
6129 |
#ifdef GLX |
|
6130 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6131 |
RETURN (__MKSMALLINT(getdescender())); |
294 | 6132 |
#endif |
6133 |
%} |
|
6134 |
. |
|
6135 |
^ false |
|
6136 |
! |
|
6137 |
||
6138 |
glxGetdisplaymodeIn: aGLXWindowId |
|
6139 |
||
6140 |
%{ /* NOCONTEXT */ |
|
6141 |
#ifdef GLX |
|
6142 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6143 |
RETURN (__MKSMALLINT(getdisplaymode())); |
294 | 6144 |
#endif |
6145 |
%} |
|
6146 |
. |
|
6147 |
^ false |
|
6148 |
! |
|
6149 |
||
6150 |
glxGetdrawmodeIn: aGLXWindowId |
|
6151 |
||
6152 |
%{ /* NOCONTEXT */ |
|
6153 |
#ifdef GLX |
|
6154 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6155 |
RETURN (__MKSMALLINT(getdrawmode())); |
294 | 6156 |
#endif |
6157 |
%} |
|
6158 |
. |
|
6159 |
^ false |
|
6160 |
! |
|
6161 |
||
6162 |
glxGetfontIn: aGLXWindowId |
|
6163 |
||
6164 |
%{ /* NOCONTEXT */ |
|
6165 |
#ifdef GLX |
|
6166 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6167 |
RETURN (__MKSMALLINT(getfont())); |
294 | 6168 |
#endif |
6169 |
%} |
|
6170 |
. |
|
6171 |
^ false |
|
6172 |
! |
|
6173 |
||
6174 |
glxGetgconfigBuffer: buffer in: aGLXWindowId |
|
6175 |
||
6176 |
%{ /* NOCONTEXT */ |
|
6177 |
#ifdef FULL_GLX |
|
6178 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6179 |
RETURN (__MKSMALLINT(getgconfig(_longVal(buffer)))); |
294 | 6180 |
#endif |
6181 |
%} |
|
6182 |
. |
|
6183 |
^ false |
|
6184 |
! |
|
6185 |
||
6186 |
glxGetgdescInquiry: inquiry in: aGLXWindowId |
|
6187 |
||
6188 |
%{ /* NOCONTEXT */ |
|
1932 | 6189 |
int rslt = 0; |
6190 |
||
6191 |
SETWIN(aGLXWindowId) |
|
6192 |
#ifdef OPENGL |
|
6193 |
#else |
|
6194 |
rslt = getgdesc(_longVal(inquiry)); |
|
6195 |
#endif |
|
6196 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6197 |
%} |
6198 |
! |
|
6199 |
||
6200 |
glxGetheightIn: aGLXWindowId |
|
6201 |
||
6202 |
%{ /* NOCONTEXT */ |
|
1932 | 6203 |
int rslt = 0; |
6204 |
||
6205 |
SETWIN(aGLXWindowId) |
|
6206 |
#ifdef OPENGL |
|
6207 |
#else |
|
6208 |
rslt = getheight(); |
|
6209 |
#endif |
|
6210 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6211 |
%} |
6212 |
! |
|
6213 |
||
6214 |
glxGethitcodeIn: aGLXWindowId |
|
6215 |
||
6216 |
%{ /* NOCONTEXT */ |
|
6217 |
#ifdef GLX |
|
6218 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6219 |
RETURN (__MKSMALLINT(gethitcode())); |
294 | 6220 |
#endif |
6221 |
%} |
|
6222 |
. |
|
6223 |
^ false |
|
6224 |
! |
|
6225 |
||
6226 |
glxGetlsbackupIn: aGLXWindowId |
|
6227 |
||
6228 |
%{ /* NOCONTEXT */ |
|
6229 |
#ifdef GLX |
|
6230 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6231 |
RETURN (__MKBOOLEAN(getlsbackup())); |
294 | 6232 |
#endif |
6233 |
%} |
|
6234 |
. |
|
6235 |
^ false |
|
6236 |
! |
|
6237 |
||
6238 |
glxGetlsrepeatIn: aGLXWindowId |
|
6239 |
||
6240 |
%{ /* NOCONTEXT */ |
|
6241 |
#ifdef GLX |
|
6242 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6243 |
RETURN (__MKSMALLINT(getlsrepeat())); |
294 | 6244 |
#endif |
6245 |
%} |
|
6246 |
. |
|
6247 |
^ false |
|
6248 |
! |
|
6249 |
||
6250 |
glxGetlstyleIn: aGLXWindowId |
|
6251 |
||
6252 |
%{ /* NOCONTEXT */ |
|
6253 |
#ifdef GLX |
|
6254 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6255 |
RETURN (__MKSMALLINT(getlstyle())); |
294 | 6256 |
#endif |
6257 |
%} |
|
6258 |
. |
|
6259 |
^ false |
|
6260 |
! |
|
6261 |
||
6262 |
glxGetlwidthIn: aGLXWindowId |
|
6263 |
||
6264 |
%{ /* NOCONTEXT */ |
|
6265 |
#ifdef GLX |
|
6266 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6267 |
RETURN (__MKSMALLINT(getlwidth())); |
294 | 6268 |
#endif |
6269 |
%} |
|
6270 |
. |
|
6271 |
^ false |
|
6272 |
! |
|
6273 |
||
6274 |
glxGetmapIn: aGLXWindowId |
|
6275 |
||
6276 |
%{ /* NOCONTEXT */ |
|
6277 |
#ifdef GLX |
|
6278 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6279 |
RETURN (__MKSMALLINT(getmap())); |
294 | 6280 |
#endif |
6281 |
%} |
|
6282 |
. |
|
6283 |
^ false |
|
6284 |
! |
|
6285 |
||
6286 |
glxGetmmodeIn: aGLXWindowId |
|
6287 |
||
6288 |
%{ /* NOCONTEXT */ |
|
6289 |
#ifdef GLX |
|
6290 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6291 |
RETURN (__MKSMALLINT(getmmode())); |
294 | 6292 |
#endif |
6293 |
%} |
|
6294 |
. |
|
6295 |
^ false |
|
6296 |
! |
|
6297 |
||
6298 |
glxGetmonitorIn: aGLXWindowId |
|
6299 |
||
6300 |
%{ /* NOCONTEXT */ |
|
6301 |
#ifdef GLX |
|
6302 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6303 |
RETURN (__MKSMALLINT(getmonitor())); |
294 | 6304 |
#endif |
6305 |
%} |
|
6306 |
. |
|
6307 |
^ false |
|
6308 |
! |
|
6309 |
||
6310 |
glxGetmultisampleIn: aGLXWindowId |
|
6311 |
||
6312 |
%{ /* NOCONTEXT */ |
|
6313 |
#ifdef FULL_GLX |
|
6314 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6315 |
RETURN (__MKBOOLEAN(getmultisample())); |
294 | 6316 |
#endif |
6317 |
%} |
|
6318 |
. |
|
6319 |
^ false |
|
6320 |
! |
|
6321 |
||
6322 |
glxGetothermonitorIn: aGLXWindowId |
|
6323 |
||
6324 |
%{ /* NOCONTEXT */ |
|
6325 |
#ifdef GLX |
|
6326 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6327 |
RETURN (__MKSMALLINT(getothermonitor())); |
294 | 6328 |
#endif |
6329 |
%} |
|
6330 |
. |
|
6331 |
^ false |
|
6332 |
! |
|
6333 |
||
6334 |
glxGetpatternIn: aGLXWindowId |
|
6335 |
||
6336 |
%{ /* NOCONTEXT */ |
|
6337 |
#ifdef GLX |
|
6338 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6339 |
RETURN (__MKSMALLINT(getpattern())); |
294 | 6340 |
#endif |
6341 |
%} |
|
6342 |
. |
|
6343 |
^ false |
|
6344 |
! |
|
6345 |
||
6346 |
glxGetresetlsIn: aGLXWindowId |
|
6347 |
||
6348 |
%{ /* NOCONTEXT */ |
|
6349 |
#ifdef GLX |
|
6350 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6351 |
RETURN (__MKBOOLEAN(getresetls())); |
294 | 6352 |
#endif |
6353 |
%} |
|
6354 |
. |
|
6355 |
^ false |
|
6356 |
! |
|
6357 |
||
6358 |
glxGetshadeIn: aGLXWindowId |
|
6359 |
||
6360 |
%{ /* NOCONTEXT */ |
|
6361 |
#ifdef GLX |
|
6362 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6363 |
RETURN (__MKSMALLINT(getshade())); |
294 | 6364 |
#endif |
6365 |
%} |
|
6366 |
. |
|
6367 |
^ false |
|
6368 |
! |
|
6369 |
||
6370 |
glxGetsmIn: aGLXWindowId |
|
6371 |
||
6372 |
%{ /* NOCONTEXT */ |
|
6373 |
#ifdef GLX |
|
6374 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6375 |
RETURN (__MKSMALLINT(getsm())); |
294 | 6376 |
#endif |
6377 |
%} |
|
6378 |
. |
|
6379 |
^ false |
|
6380 |
! |
|
6381 |
||
6382 |
glxGetvaluator: dev in: aGLXWindowId |
|
6383 |
||
6384 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
6385 |
#ifndef OPENGL |
294 | 6386 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6387 |
RETURN (__MKSMALLINT(getvaluator(_deviceVal(dev)))); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
6388 |
#endif |
294 | 6389 |
%} |
6390 |
. |
|
6391 |
^ false |
|
6392 |
! |
|
6393 |
||
6394 |
glxGetvideo: reg in: aGLXWindowId |
|
6395 |
||
6396 |
%{ /* NOCONTEXT */ |
|
6397 |
#ifdef GLX |
|
6398 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6399 |
RETURN (__MKSMALLINT(getvideo(_longVal(reg)))); |
294 | 6400 |
#endif |
6401 |
%} |
|
6402 |
. |
|
6403 |
^ false |
|
6404 |
! |
|
6405 |
||
6406 |
glxGetwritemaskIn: aGLXWindowId |
|
6407 |
||
6408 |
%{ /* NOCONTEXT */ |
|
6409 |
#ifdef GLX |
|
6410 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6411 |
RETURN (__MKSMALLINT(getwritemask())); |
294 | 6412 |
#endif |
6413 |
%} |
|
6414 |
. |
|
6415 |
^ false |
|
6416 |
! |
|
6417 |
||
6418 |
glxGetwscrnIn: aGLXWindowId |
|
6419 |
||
6420 |
%{ /* NOCONTEXT */ |
|
6421 |
#ifdef GLX |
|
6422 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6423 |
RETURN (__MKSMALLINT(getwscrn())); |
294 | 6424 |
#endif |
6425 |
%} |
|
6426 |
. |
|
6427 |
^ false |
|
6428 |
! |
|
6429 |
||
6430 |
glxGetzbufferIn: aGLXWindowId |
|
6431 |
||
6432 |
%{ /* NOCONTEXT */ |
|
6433 |
#ifdef GLX |
|
6434 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6435 |
RETURN (__MKBOOLEAN(getzbuffer())); |
294 | 6436 |
#endif |
6437 |
%} |
|
6438 |
. |
|
6439 |
^ false |
|
6440 |
! |
|
6441 |
||
6442 |
glxGexitIn: aGLXWindowId |
|
6443 |
||
6444 |
%{ /* NOCONTEXT */ |
|
1932 | 6445 |
SETWIN(aGLXWindowId) |
6446 |
#ifdef OPENGL |
|
6447 |
#else |
|
294 | 6448 |
gexit(); |
1932 | 6449 |
#endif |
6450 |
%} |
|
294 | 6451 |
! |
6452 |
||
6453 |
glxGflushIn: aGLXWindowId |
|
6454 |
||
6455 |
%{ /* NOCONTEXT */ |
|
6456 |
#ifdef GLX |
|
6457 |
SETWIN(aGLXWindowId) |
|
6458 |
gflush(); |
|
1932 | 6459 |
#endif |
6460 |
%} |
|
294 | 6461 |
! |
6462 |
||
6463 |
glxGinitIn: aGLXWindowId |
|
6464 |
||
6465 |
%{ /* NOCONTEXT */ |
|
1932 | 6466 |
SETWIN(aGLXWindowId) |
6467 |
#ifdef OPENGL |
|
6468 |
#else |
|
294 | 6469 |
ginit(); |
1932 | 6470 |
#endif |
6471 |
%} |
|
294 | 6472 |
! |
6473 |
||
6474 |
glxGlcompatMode: mode value: value in: aGLXWindowId |
|
6475 |
||
6476 |
%{ /* NOCONTEXT */ |
|
6477 |
#ifdef GLX |
|
6478 |
SETWIN(aGLXWindowId) |
|
6479 |
glcompat(_longVal(mode), _longVal(value)); |
|
1932 | 6480 |
#endif |
6481 |
%} |
|
294 | 6482 |
! |
6483 |
||
6484 |
glxGresetIn: aGLXWindowId |
|
6485 |
||
6486 |
%{ /* NOCONTEXT */ |
|
6487 |
#ifdef GLX |
|
6488 |
SETWIN(aGLXWindowId) |
|
6489 |
greset(); |
|
1932 | 6490 |
#endif |
6491 |
%} |
|
294 | 6492 |
! |
6493 |
||
6494 |
glxGsyncIn: aGLXWindowId |
|
6495 |
||
6496 |
%{ /* NOCONTEXT */ |
|
6497 |
#ifdef GLX |
|
6498 |
SETWIN(aGLXWindowId) |
|
6499 |
gsync(); |
|
1932 | 6500 |
#endif |
6501 |
%} |
|
294 | 6502 |
! |
6503 |
||
6504 |
glxIconsizeX: x y: y in: aGLXWindowId |
|
6505 |
||
6506 |
%{ /* NOCONTEXT */ |
|
6507 |
#ifdef GLX |
|
6508 |
SETWIN(aGLXWindowId) |
|
6509 |
iconsize(_longVal(x), _longVal(y)); |
|
1932 | 6510 |
#endif |
6511 |
%} |
|
294 | 6512 |
! |
6513 |
||
6514 |
glxImakebackgroundIn: aGLXWindowId |
|
6515 |
||
6516 |
%{ /* NOCONTEXT */ |
|
6517 |
#ifdef GLX |
|
6518 |
SETWIN(aGLXWindowId) |
|
6519 |
imakebackground(); |
|
1932 | 6520 |
#endif |
6521 |
%} |
|
294 | 6522 |
! |
6523 |
||
6524 |
glxInitnamesIn: aGLXWindowId |
|
6525 |
||
6526 |
%{ /* NOCONTEXT */ |
|
6527 |
#ifdef GLX |
|
6528 |
SETWIN(aGLXWindowId) |
|
6529 |
initnames(); |
|
1932 | 6530 |
#endif |
6531 |
%} |
|
294 | 6532 |
! |
6533 |
||
6534 |
glxIsqueued: dev in: aGLXWindowId |
|
6535 |
||
6536 |
%{ /* NOCONTEXT */ |
|
6537 |
#ifdef GLX |
|
6538 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6539 |
RETURN (__MKBOOLEAN(isqueued(_deviceVal(dev)))); |
294 | 6540 |
#endif |
6541 |
%} |
|
6542 |
. |
|
6543 |
^ false |
|
6544 |
! |
|
6545 |
||
6546 |
glxIstag: t in: aGLXWindowId |
|
6547 |
||
6548 |
%{ /* NOCONTEXT */ |
|
6549 |
#ifdef GLX |
|
6550 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6551 |
RETURN (__MKBOOLEAN(istag(_tagVal(t)))); |
294 | 6552 |
#endif |
6553 |
%} |
|
6554 |
. |
|
6555 |
^ false |
|
6556 |
! |
|
6557 |
||
6558 |
glxKeepaspectX: x y: y in: aGLXWindowId |
|
6559 |
||
6560 |
%{ /* NOCONTEXT */ |
|
6561 |
#ifdef GLX |
|
6562 |
SETWIN(aGLXWindowId) |
|
6563 |
keepaspect(_longVal(x), _longVal(y)); |
|
6564 |
RETURN (true); |
|
6565 |
#endif |
|
6566 |
%} |
|
6567 |
. |
|
6568 |
^ false |
|
6569 |
! |
|
6570 |
||
6571 |
glxLinesmoothMode: mode in: aGLXWindowId |
|
6572 |
||
6573 |
%{ /* NOCONTEXT */ |
|
6574 |
#ifdef GLX |
|
6575 |
SETWIN(aGLXWindowId) |
|
6576 |
linesmooth((ulong)__intVal(mode)); |
|
6577 |
RETURN (true); |
|
6578 |
#endif |
|
6579 |
%} |
|
6580 |
. |
|
6581 |
^ false |
|
6582 |
! |
|
6583 |
||
6584 |
glxLmcolorMode: mode in: aGLXWindowId |
|
6585 |
||
6586 |
%{ /* NOCONTEXT */ |
|
6587 |
#ifdef GLX |
|
6588 |
SETWIN(aGLXWindowId) |
|
6589 |
lmcolor(_longVal(mode)); |
|
6590 |
RETURN (true); |
|
6591 |
#endif |
|
6592 |
%} |
|
6593 |
. |
|
6594 |
^ false |
|
6595 |
! |
|
6596 |
||
6597 |
glxLoadname: name in: aGLXWindowId |
|
6598 |
||
6599 |
%{ /* NOCONTEXT */ |
|
6600 |
#ifdef GLX |
|
6601 |
SETWIN(aGLXWindowId) |
|
6602 |
loadname(_shortVal(name)); |
|
6603 |
RETURN (true); |
|
6604 |
#endif |
|
6605 |
%} |
|
6606 |
. |
|
6607 |
^ false |
|
6608 |
! |
|
6609 |
||
6610 |
glxLogicop: opcode in: aGLXWindowId |
|
6611 |
||
6612 |
%{ /* NOCONTEXT */ |
|
6613 |
#ifdef GLX |
|
6614 |
SETWIN(aGLXWindowId) |
|
6615 |
logicop(_longVal(opcode)); |
|
6616 |
RETURN (true); |
|
6617 |
#endif |
|
6618 |
%} |
|
6619 |
. |
|
6620 |
^ false |
|
6621 |
! |
|
6622 |
||
6623 |
glxLsbackup: b in: aGLXWindowId |
|
6624 |
||
6625 |
%{ /* NOCONTEXT */ |
|
6626 |
#ifdef GLX |
|
6627 |
SETWIN(aGLXWindowId) |
|
6628 |
lsbackup(_booleanVal(b)); |
|
6629 |
RETURN (true); |
|
6630 |
#endif |
|
6631 |
%} |
|
6632 |
. |
|
6633 |
^ false |
|
6634 |
! |
|
6635 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6636 |
glxLsetdepthNear:znear far:zfar in: aGLXWindowId |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6637 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6638 |
%{ /* NOCONTEXT */ |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6639 |
#ifdef GLX |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6640 |
SETWIN(aGLXWindowId) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6641 |
lsetdepth(_longVal(znear), _longVal(zfar)); |
294 | 6642 |
RETURN (true); |
6643 |
#endif |
|
6644 |
%} |
|
6645 |
. |
|
6646 |
^ false |
|
6647 |
! |
|
6648 |
||
6649 |
glxLshaderangeLowin: lowin hiwin: hiwin znear: znear zfar: zfar in: aGLXWindowId |
|
6650 |
||
6651 |
%{ /* NOCONTEXT */ |
|
6652 |
#ifdef GLX |
|
6653 |
SETWIN(aGLXWindowId) |
|
4718 | 6654 |
lshaderange(_colorindexVal(lowin), _colorindexVal(hiwin), |
294 | 6655 |
_longVal(znear), _longVal(zfar)); |
6656 |
RETURN (true); |
|
6657 |
#endif |
|
6658 |
%} |
|
6659 |
. |
|
6660 |
^ false |
|
6661 |
! |
|
6662 |
||
6663 |
glxLsrepeatFactor: factor in: aGLXWindowId |
|
6664 |
||
6665 |
%{ /* NOCONTEXT */ |
|
6666 |
#ifdef GLX |
|
6667 |
SETWIN(aGLXWindowId) |
|
6668 |
lsrepeat(_longVal(factor)); |
|
6669 |
RETURN (true); |
|
6670 |
#endif |
|
6671 |
%} |
|
6672 |
. |
|
6673 |
^ false |
|
6674 |
! |
|
6675 |
||
6676 |
glxMaketag: t in: aGLXWindowId |
|
6677 |
||
6678 |
%{ /* NOCONTEXT */ |
|
6679 |
#ifdef GLX |
|
6680 |
SETWIN(aGLXWindowId) |
|
6681 |
maketag(_tagVal(t)); |
|
6682 |
RETURN (true); |
|
6683 |
#endif |
|
6684 |
%} |
|
6685 |
. |
|
6686 |
^ false |
|
6687 |
! |
|
6688 |
||
6689 |
glxMaxsizeX: x y: y in: aGLXWindowId |
|
6690 |
||
6691 |
%{ /* NOCONTEXT */ |
|
6692 |
#ifdef GLX |
|
6693 |
SETWIN(aGLXWindowId) |
|
6694 |
maxsize(_longVal(x), _longVal(y)); |
|
6695 |
RETURN (true); |
|
6696 |
#endif |
|
6697 |
%} |
|
6698 |
. |
|
6699 |
^ false |
|
6700 |
! |
|
6701 |
||
6702 |
glxMinsizeX: x y: y in: aGLXWindowId |
|
6703 |
||
6704 |
%{ /* NOCONTEXT */ |
|
6705 |
#ifdef GLX |
|
6706 |
SETWIN(aGLXWindowId) |
|
6707 |
minsize(_longVal(x), _longVal(y)); |
|
6708 |
RETURN (true); |
|
6709 |
#endif |
|
6710 |
%} |
|
6711 |
. |
|
6712 |
^ false |
|
6713 |
! |
|
6714 |
||
6715 |
glxMsalphaMode: mode in: aGLXWindowId |
|
6716 |
||
6717 |
%{ /* NOCONTEXT */ |
|
6718 |
#ifdef FULL_GLX |
|
6719 |
SETWIN(aGLXWindowId) |
|
6720 |
msalpha(_longVal(mode)); |
|
6721 |
RETURN (true); |
|
6722 |
#endif |
|
6723 |
%} |
|
6724 |
. |
|
6725 |
^ false |
|
6726 |
! |
|
6727 |
||
6728 |
glxMsmask: mask inverse: inverse in: aGLXWindowId |
|
6729 |
||
6730 |
%{ /* NOCONTEXT */ |
|
6731 |
#ifdef FULL_GLX |
|
6732 |
SETWIN(aGLXWindowId) |
|
6733 |
msmask(_floatVal(mask), _booleanVal(inverse)); |
|
6734 |
RETURN (true); |
|
6735 |
#endif |
|
6736 |
%} |
|
6737 |
. |
|
6738 |
^ false |
|
6739 |
! |
|
6740 |
||
6741 |
glxMspattern: pattern in: aGLXWindowId |
|
6742 |
||
6743 |
%{ /* NOCONTEXT */ |
|
6744 |
#ifdef FULL_GLX |
|
6745 |
SETWIN(aGLXWindowId) |
|
6746 |
mspattern(_longVal(pattern)); |
|
6747 |
RETURN (true); |
|
6748 |
#endif |
|
6749 |
%} |
|
6750 |
. |
|
6751 |
^ false |
|
6752 |
! |
|
6753 |
||
6754 |
glxMssizeSamples: samples zsize: zsize ssize: ssize in: aGLXWindowId |
|
6755 |
||
6756 |
%{ /* NOCONTEXT */ |
|
6757 |
#ifdef FULL_GLX |
|
6758 |
SETWIN(aGLXWindowId) |
|
6759 |
mssize(_longVal(samples), _longVal(zsize), _longVal(ssize)); |
|
6760 |
RETURN (true); |
|
6761 |
#endif |
|
6762 |
%} |
|
6763 |
. |
|
6764 |
^ false |
|
6765 |
! |
|
6766 |
||
6767 |
glxMswapbuffers: fbuf in: aGLXWindowId |
|
6768 |
||
6769 |
%{ /* NOCONTEXT */ |
|
6770 |
#ifdef GLX |
|
6771 |
SETWIN(aGLXWindowId) |
|
6772 |
mswapbuffers(_longVal(fbuf)); |
|
6773 |
RETURN (true); |
|
6774 |
#endif |
|
6775 |
%} |
|
6776 |
. |
|
6777 |
^ false |
|
6778 |
! |
|
6779 |
||
6780 |
glxMultimapIn: aGLXWindowId |
|
6781 |
||
6782 |
%{ /* NOCONTEXT */ |
|
6783 |
#ifdef GLX |
|
6784 |
SETWIN(aGLXWindowId) |
|
6785 |
multimap(); |
|
6786 |
RETURN (true); |
|
6787 |
#endif |
|
6788 |
%} |
|
6789 |
. |
|
6790 |
^ false |
|
6791 |
! |
|
6792 |
||
6793 |
glxMultisample: bool in: aGLXWindowId |
|
6794 |
||
6795 |
%{ /* NOCONTEXT */ |
|
6796 |
#ifdef FULL_GLX |
|
6797 |
SETWIN(aGLXWindowId) |
|
6798 |
multisample(_booleanVal(bool)); |
|
6799 |
RETURN (true); |
|
6800 |
#endif |
|
6801 |
%} |
|
6802 |
. |
|
6803 |
^ false |
|
6804 |
! |
|
6805 |
||
6806 |
glxNewpupIn: aGLXWindowId |
|
6807 |
||
6808 |
%{ /* NOCONTEXT */ |
|
6809 |
#ifdef GLX |
|
6810 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6811 |
RETURN (__MKSMALLINT(newpup())); |
294 | 6812 |
#endif |
6813 |
%} |
|
6814 |
. |
|
6815 |
^ false |
|
6816 |
! |
|
6817 |
||
6818 |
glxNewtag: newtg oldtg: oldtg offst: offst in: aGLXWindowId |
|
6819 |
||
6820 |
%{ /* NOCONTEXT */ |
|
6821 |
#ifdef GLX |
|
6822 |
SETWIN(aGLXWindowId) |
|
6823 |
newtag(_tagVal(newtg), _tagVal(oldtg), _offsetVal(offst)); |
|
6824 |
RETURN (true); |
|
6825 |
#endif |
|
6826 |
%} |
|
6827 |
. |
|
6828 |
^ false |
|
6829 |
! |
|
6830 |
||
6831 |
glxNoborderIn: aGLXWindowId |
|
6832 |
||
6833 |
%{ /* NOCONTEXT */ |
|
6834 |
#ifdef GLX |
|
6835 |
SETWIN(aGLXWindowId) |
|
6836 |
noborder(); |
|
6837 |
RETURN (true); |
|
6838 |
#endif |
|
6839 |
%} |
|
6840 |
. |
|
6841 |
^ false |
|
6842 |
! |
|
6843 |
||
6844 |
glxNoise: v delta: delta in: aGLXWindowId |
|
6845 |
||
6846 |
%{ /* NOCONTEXT */ |
|
6847 |
#ifdef GLX |
|
6848 |
SETWIN(aGLXWindowId) |
|
6849 |
noise(_deviceVal(v), _shortVal(delta)); |
|
6850 |
RETURN (true); |
|
6851 |
#endif |
|
6852 |
%} |
|
6853 |
. |
|
6854 |
^ false |
|
6855 |
! |
|
6856 |
||
6857 |
glxNoportIn: aGLXWindowId |
|
6858 |
||
6859 |
%{ /* NOCONTEXT */ |
|
6860 |
#ifdef GLX |
|
6861 |
SETWIN(aGLXWindowId) |
|
6862 |
noport(); |
|
6863 |
RETURN (true); |
|
6864 |
#endif |
|
6865 |
%} |
|
6866 |
. |
|
6867 |
^ false |
|
6868 |
! |
|
6869 |
||
6870 |
glxNurbscurveKnotCount: knotCount knotList: knotList |
|
4718 | 6871 |
offset: offset ctlArray: ctlArray |
294 | 6872 |
order: order type: type in: aGLXWindowId |
6873 |
||
6874 |
| ctlPoints i | |
|
6875 |
ctlPoints := DoubleArray new: ctlArray size * (ctlArray first size). |
|
6876 |
i := 1. |
|
6877 |
ctlArray do: [:point | |
|
4718 | 6878 |
point do: [:coord | |
294 | 6879 |
ctlPoints at: i put: coord. |
6880 |
i := i + 1]]. |
|
6881 |
||
6882 |
%{ /* NOCONTEXT */ |
|
6883 |
#ifdef GLX |
|
6884 |
char *knotElements, *ctlElements; |
|
6885 |
OBJ cls; |
|
6886 |
int ninstVars, nInstBytes; |
|
6887 |
||
6888 |
SETWIN(aGLXWindowId) |
|
6889 |
cls = __qClass(ctlPoints); |
|
6890 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
6891 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
|
6892 |
||
6893 |
ctlElements = (char *)(_InstPtr(ctlPoints)) + nInstBytes; |
|
6894 |
knotElements = (char *)(_InstPtr(knotList)) + nInstBytes; |
|
6895 |
||
6896 |
nurbscurve ( |
|
6897 |
_longVal(knotCount), (double *)knotElements, |
|
4718 | 6898 |
_longVal(offset), (double *)ctlElements, |
294 | 6899 |
_longVal(order), _longVal(type)); |
6900 |
RETURN(true); |
|
6901 |
#endif |
|
6902 |
%} |
|
6903 |
. |
|
6904 |
^ false |
|
6905 |
! |
|
6906 |
||
6907 |
glxObjdeleteTag1: tag1 tag2: tag2 in: aGLXWindowId |
|
6908 |
||
6909 |
%{ /* NOCONTEXT */ |
|
6910 |
#ifdef GLX |
|
6911 |
SETWIN(aGLXWindowId) |
|
6912 |
objdelete(_tagVal(tag1), _tagVal(tag2)); |
|
6913 |
RETURN (true); |
|
6914 |
#endif |
|
6915 |
%} |
|
6916 |
. |
|
6917 |
^ false |
|
6918 |
! |
|
6919 |
||
6920 |
glxObjinsert: t in: aGLXWindowId |
|
6921 |
||
6922 |
%{ /* NOCONTEXT */ |
|
6923 |
#ifdef GLX |
|
6924 |
SETWIN(aGLXWindowId) |
|
6925 |
objinsert(_tagVal(t)); |
|
6926 |
RETURN (true); |
|
6927 |
#endif |
|
6928 |
%} |
|
6929 |
. |
|
6930 |
^ false |
|
6931 |
! |
|
6932 |
||
6933 |
glxObjreplace: t in: aGLXWindowId |
|
6934 |
||
6935 |
%{ /* NOCONTEXT */ |
|
6936 |
#ifdef GLX |
|
6937 |
SETWIN(aGLXWindowId) |
|
6938 |
objreplace(_tagVal(t)); |
|
6939 |
RETURN (true); |
|
6940 |
#endif |
|
6941 |
%} |
|
6942 |
. |
|
6943 |
^ false |
|
6944 |
! |
|
6945 |
||
6946 |
glxOnemapIn: aGLXWindowId |
|
6947 |
||
6948 |
%{ /* NOCONTEXT */ |
|
6949 |
#ifdef GLX |
|
6950 |
SETWIN(aGLXWindowId) |
|
6951 |
onemap(); |
|
6952 |
RETURN (true); |
|
6953 |
#endif |
|
6954 |
%} |
|
6955 |
. |
|
6956 |
^ false |
|
6957 |
! |
|
6958 |
||
6959 |
glxPagecolor: pcolor in: aGLXWindowId |
|
6960 |
||
6961 |
%{ /* NOCONTEXT */ |
|
6962 |
#ifdef GLX |
|
6963 |
SETWIN(aGLXWindowId) |
|
6964 |
pagecolor(_colorindexVal(pcolor)); |
|
6965 |
RETURN (true); |
|
6966 |
#endif |
|
6967 |
%} |
|
6968 |
. |
|
6969 |
^ false |
|
6970 |
! |
|
6971 |
||
6972 |
glxPassthroughToken: token in: aGLXWindowId |
|
6973 |
||
6974 |
%{ /* NOCONTEXT */ |
|
6975 |
#ifdef GLX |
|
6976 |
SETWIN(aGLXWindowId) |
|
6977 |
passthrough(_shortVal(token)); |
|
6978 |
RETURN (true); |
|
6979 |
#endif |
|
6980 |
%} |
|
6981 |
. |
|
6982 |
^ false |
|
6983 |
! |
|
6984 |
||
6985 |
glxPclosIn: aGLXWindowId |
|
6986 |
||
6987 |
%{ /* NOCONTEXT */ |
|
6988 |
#ifdef GLX |
|
6989 |
SETWIN(aGLXWindowId) |
|
6990 |
pclos(); |
|
6991 |
RETURN (true); |
|
6992 |
#endif |
|
6993 |
%} |
|
6994 |
. |
|
6995 |
^ false |
|
6996 |
! |
|
6997 |
||
6998 |
glxPicksizeX: x y: y in: aGLXWindowId |
|
6999 |
||
7000 |
%{ /* NOCONTEXT */ |
|
7001 |
#ifdef GLX |
|
7002 |
SETWIN(aGLXWindowId) |
|
7003 |
picksize(_shortVal(x), _shortVal(y)); |
|
7004 |
RETURN (true); |
|
7005 |
#endif |
|
7006 |
%} |
|
7007 |
. |
|
7008 |
^ false |
|
7009 |
! |
|
7010 |
||
7011 |
glxPixmode: mode value: value in: aGLXWindowId |
|
7012 |
||
7013 |
%{ /* NOCONTEXT */ |
|
7014 |
#ifdef GLX |
|
7015 |
SETWIN(aGLXWindowId) |
|
7016 |
pixmode(_longVal(mode), _longVal(value)); |
|
7017 |
RETURN (true); |
|
7018 |
#endif |
|
7019 |
%} |
|
7020 |
. |
|
7021 |
^ false |
|
7022 |
! |
|
7023 |
||
7024 |
glxPntsmoothMode: mode in: aGLXWindowId |
|
7025 |
||
7026 |
%{ /* NOCONTEXT */ |
|
7027 |
#ifdef GLX |
|
7028 |
SETWIN(aGLXWindowId) |
|
7029 |
pntsmooth((ulong)__intVal(mode)); |
|
7030 |
RETURN (true); |
|
7031 |
#endif |
|
7032 |
%} |
|
7033 |
. |
|
7034 |
^ false |
|
7035 |
! |
|
7036 |
||
7037 |
glxPolysmoothMode: mode in: aGLXWindowId |
|
7038 |
||
7039 |
%{ /* NOCONTEXT */ |
|
7040 |
#ifdef GLX |
|
7041 |
SETWIN(aGLXWindowId) |
|
7042 |
polysmooth(_longVal(mode)); |
|
7043 |
RETURN (true); |
|
7044 |
#endif |
|
7045 |
%} |
|
7046 |
. |
|
7047 |
^ false |
|
7048 |
! |
|
7049 |
||
7050 |
glxPopnameIn: aGLXWindowId |
|
7051 |
||
7052 |
%{ /* NOCONTEXT */ |
|
7053 |
#ifdef GLX |
|
7054 |
SETWIN(aGLXWindowId) |
|
7055 |
popname(); |
|
7056 |
RETURN (true); |
|
7057 |
#endif |
|
7058 |
%} |
|
7059 |
. |
|
7060 |
^ false |
|
7061 |
! |
|
7062 |
||
7063 |
glxPrefpositionX1: x1 x2: x2 y1: y1 y2: y2 in: aGLXWindowId |
|
7064 |
||
7065 |
%{ /* NOCONTEXT */ |
|
7066 |
SETWIN(aGLXWindowId) |
|
1932 | 7067 |
#ifdef OPENGL |
7068 |
#else |
|
294 | 7069 |
prefposition(_longVal(x1), _longVal(x2), _longVal(y1), _longVal(y2)); |
1932 | 7070 |
#endif |
294 | 7071 |
RETURN (true); |
7072 |
%} |
|
7073 |
! |
|
7074 |
||
7075 |
glxPrefsizeX: x y: y in: aGLXWindowId |
|
7076 |
||
7077 |
%{ /* NOCONTEXT */ |
|
7078 |
SETWIN(aGLXWindowId) |
|
1932 | 7079 |
#ifdef OPENGL |
7080 |
#else |
|
294 | 7081 |
prefsize(_longVal(x), _longVal(y)); |
1932 | 7082 |
#endif |
294 | 7083 |
RETURN (true); |
7084 |
%} |
|
7085 |
! |
|
7086 |
||
7087 |
glxPupmodeIn: aGLXWindowId |
|
7088 |
||
7089 |
%{ /* NOCONTEXT */ |
|
7090 |
#ifdef GLX |
|
7091 |
SETWIN(aGLXWindowId) |
|
7092 |
pupmode(); |
|
7093 |
RETURN (true); |
|
7094 |
#endif |
|
7095 |
%} |
|
7096 |
. |
|
7097 |
^ false |
|
7098 |
! |
|
7099 |
||
7100 |
glxPushname: name In: aGLXWindowId |
|
7101 |
||
7102 |
%{ /* NOCONTEXT */ |
|
7103 |
#ifdef GLX |
|
7104 |
SETWIN(aGLXWindowId) |
|
7105 |
pushname(_shortVal(name)); |
|
7106 |
RETURN (true); |
|
7107 |
#endif |
|
7108 |
%} |
|
7109 |
. |
|
7110 |
^ false |
|
7111 |
! |
|
7112 |
||
7113 |
glxQdevice: dev in: aGLXWindowId |
|
7114 |
||
7115 |
%{ /* NOCONTEXT */ |
|
1932 | 7116 |
SETWIN(aGLXWindowId) |
7117 |
#ifdef OPENGL |
|
7118 |
#else |
|
294 | 7119 |
qdevice(_deviceVal(dev)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7120 |
#endif |
294 | 7121 |
%} |
7122 |
! |
|
7123 |
||
7124 |
glxQenterDev: dev val: val in: aGLXWindowId |
|
7125 |
||
7126 |
%{ /* NOCONTEXT */ |
|
7127 |
SETWIN(aGLXWindowId) |
|
1932 | 7128 |
#ifdef OPENGL |
7129 |
#else |
|
294 | 7130 |
qenter(_deviceVal(dev), _shortVal(val)); |
1932 | 7131 |
#endif |
294 | 7132 |
%} |
7133 |
! |
|
7134 |
||
7135 |
glxQgetfdIn: aGLXWindowId |
|
7136 |
||
7137 |
%{ /* NOCONTEXT */ |
|
7138 |
#ifdef GLX |
|
7139 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7140 |
RETURN (__MKSMALLINT(qgetfd())); |
294 | 7141 |
#endif |
7142 |
%} |
|
7143 |
. |
|
7144 |
^ false |
|
7145 |
! |
|
7146 |
||
7147 |
glxQreadIn: aGLXWindowId |
|
7148 |
||
7149 |
| dev data | |
|
4718 | 7150 |
%{ |
294 | 7151 |
short c_data; |
7152 |
||
7153 |
SETWIN(aGLXWindowId) |
|
1932 | 7154 |
#ifdef OPENGL |
7155 |
#else |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7156 |
dev = __MKSMALLINT(qread(&c_data)); |
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7157 |
data = __MKSMALLINT(c_data); |
1932 | 7158 |
#endif |
294 | 7159 |
%} |
7160 |
. |
|
7161 |
^ Array with: dev with: data |
|
7162 |
! |
|
7163 |
||
7164 |
glxQresetIn: aGLXWindowId |
|
7165 |
||
7166 |
%{ /* NOCONTEXT */ |
|
7167 |
SETWIN(aGLXWindowId) |
|
1932 | 7168 |
#ifdef OPENGL |
7169 |
#else |
|
294 | 7170 |
qreset(); |
1932 | 7171 |
#endif |
294 | 7172 |
RETURN (true); |
7173 |
%} |
|
7174 |
! |
|
7175 |
||
7176 |
glxQtestIn: aGLXWindowId |
|
7177 |
||
7178 |
%{ /* NOCONTEXT */ |
|
1932 | 7179 |
int rslt = 0; |
7180 |
||
7181 |
SETWIN(aGLXWindowId) |
|
7182 |
#ifdef OPENGL |
|
7183 |
#else |
|
7184 |
rslt = qtest(); |
|
7185 |
#endif |
|
7186 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 7187 |
%} |
7188 |
! |
|
7189 |
||
4718 | 7190 |
glxRGBcursorIndex: index red: red green: green blue: blue |
294 | 7191 |
redm: redm greenm: greenm bluem: bluem in: aGLXWindowId |
7192 |
||
7193 |
%{ /* NOCONTEXT */ |
|
7194 |
#ifdef GLX |
|
7195 |
SETWIN(aGLXWindowId) |
|
4718 | 7196 |
RGBcursor(_shortVal(index), |
7197 |
_shortVal(red), _shortVal(green), _shortVal(blue), |
|
294 | 7198 |
_shortVal(redm), _shortVal(greenm), _shortVal(bluem)); |
7199 |
RETURN (true); |
|
7200 |
#endif |
|
7201 |
%} |
|
7202 |
. |
|
7203 |
^ false |
|
7204 |
! |
|
7205 |
||
7206 |
glxRGBwritemaskRed: red green: green blue: blue in: aGLXWindowId |
|
7207 |
||
7208 |
%{ /* NOCONTEXT */ |
|
7209 |
#ifdef GLX |
|
7210 |
SETWIN(aGLXWindowId) |
|
7211 |
RGBwritemask(_shortVal(red), _shortVal(green), _shortVal(blue)); |
|
7212 |
RETURN (true); |
|
7213 |
#endif |
|
7214 |
%} |
|
7215 |
. |
|
7216 |
^ false |
|
7217 |
! |
|
7218 |
||
7219 |
glxRectzoomX: xfactor y: yfactor in: aGLXWindowId |
|
7220 |
||
7221 |
%{ /* NOCONTEXT */ |
|
7222 |
#ifdef GLX |
|
7223 |
SETWIN(aGLXWindowId) |
|
7224 |
rectzoom(_floatVal(xfactor), _floatVal(yfactor)); |
|
7225 |
RETURN (true); |
|
7226 |
#endif |
|
7227 |
%} |
|
7228 |
. |
|
7229 |
^ false |
|
7230 |
! |
|
7231 |
||
7232 |
glxResetls: b in: aGLXWindowId |
|
7233 |
||
7234 |
%{ /* NOCONTEXT */ |
|
7235 |
#ifdef GLX |
|
7236 |
SETWIN(aGLXWindowId) |
|
7237 |
resetls(_booleanVal(b)); |
|
7238 |
RETURN (true); |
|
7239 |
#endif |
|
7240 |
%} |
|
7241 |
. |
|
7242 |
^ false |
|
7243 |
! |
|
7244 |
||
7245 |
glxRingbellIn: aGLXWindowId |
|
7246 |
||
7247 |
%{ /* NOCONTEXT */ |
|
7248 |
#ifdef GLX |
|
7249 |
SETWIN(aGLXWindowId) |
|
7250 |
ringbell(); |
|
7251 |
RETURN (true); |
|
7252 |
#endif |
|
7253 |
%} |
|
7254 |
. |
|
7255 |
^ false |
|
7256 |
! |
|
7257 |
||
7258 |
glxSboxX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7259 |
||
7260 |
%{ /* NOCONTEXT */ |
|
7261 |
#ifdef GLX |
|
7262 |
SETWIN(aGLXWindowId) |
|
7263 |
sbox(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
7264 |
RETURN (true); |
|
7265 |
#endif |
|
7266 |
%} |
|
7267 |
. |
|
7268 |
^ false |
|
7269 |
! |
|
7270 |
||
7271 |
glxSboxfX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7272 |
||
7273 |
%{ /* NOCONTEXT */ |
|
7274 |
#ifdef GLX |
|
7275 |
SETWIN(aGLXWindowId) |
|
7276 |
sboxf(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
7277 |
RETURN (true); |
|
7278 |
#endif |
|
7279 |
%} |
|
7280 |
. |
|
7281 |
^ false |
|
7282 |
! |
|
7283 |
||
7284 |
glxSboxfiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7285 |
||
7286 |
%{ /* NOCONTEXT */ |
|
7287 |
#ifdef GLX |
|
7288 |
SETWIN(aGLXWindowId) |
|
7289 |
sboxfi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
7290 |
RETURN (true); |
|
7291 |
#endif |
|
7292 |
%} |
|
7293 |
. |
|
7294 |
^ false |
|
7295 |
! |
|
7296 |
||
7297 |
glxSboxfsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7298 |
||
7299 |
%{ /* NOCONTEXT */ |
|
7300 |
#ifdef GLX |
|
7301 |
SETWIN(aGLXWindowId) |
|
7302 |
sboxfs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
7303 |
RETURN (true); |
|
7304 |
#endif |
|
7305 |
%} |
|
7306 |
. |
|
7307 |
^ false |
|
7308 |
! |
|
7309 |
||
7310 |
glxSboxiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7311 |
||
7312 |
%{ /* NOCONTEXT */ |
|
7313 |
#ifdef GLX |
|
7314 |
SETWIN(aGLXWindowId) |
|
7315 |
sboxi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
7316 |
RETURN (true); |
|
7317 |
#endif |
|
7318 |
%} |
|
7319 |
. |
|
7320 |
^ false |
|
7321 |
! |
|
7322 |
||
7323 |
glxSboxsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7324 |
||
7325 |
%{ /* NOCONTEXT */ |
|
7326 |
#ifdef GLX |
|
7327 |
SETWIN(aGLXWindowId) |
|
7328 |
sboxs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
7329 |
RETURN (true); |
|
7330 |
#endif |
|
7331 |
%} |
|
7332 |
. |
|
7333 |
^ false |
|
7334 |
! |
|
7335 |
||
7336 |
glxSclearSval: sval in: aGLXWindowId |
|
7337 |
||
7338 |
%{ /* NOCONTEXT */ |
|
7339 |
#ifdef GLX |
|
7340 |
SETWIN(aGLXWindowId) |
|
7341 |
sclear((ulong)__intVal(sval)); |
|
7342 |
RETURN (true); |
|
7343 |
#endif |
|
7344 |
%} |
|
7345 |
. |
|
7346 |
^ false |
|
7347 |
! |
|
7348 |
||
7349 |
glxScrbox: arg in: aGLXWindowId |
|
7350 |
||
7351 |
%{ /* NOCONTEXT */ |
|
7352 |
#ifdef GLX |
|
7353 |
SETWIN(aGLXWindowId) |
|
7354 |
scrbox(_longVal(arg)); |
|
7355 |
RETURN (true); |
|
7356 |
#endif |
|
7357 |
%} |
|
7358 |
. |
|
7359 |
^ false |
|
7360 |
! |
|
7361 |
||
7362 |
glxScreenspaceIn: aGLXWindowId |
|
7363 |
||
7364 |
%{ /* NOCONTEXT */ |
|
7365 |
#ifdef GLX |
|
7366 |
SETWIN(aGLXWindowId) |
|
7367 |
screenspace(); |
|
7368 |
RETURN (true); |
|
7369 |
#endif |
|
7370 |
%} |
|
7371 |
. |
|
7372 |
^ false |
|
7373 |
! |
|
7374 |
||
7375 |
glxScrmaskLeft: left right: right bottom: bottom top: top in: aGLXWindowId |
|
7376 |
||
7377 |
%{ /* NOCONTEXT */ |
|
7378 |
#ifdef GLX |
|
7379 |
SETWIN(aGLXWindowId) |
|
4718 | 7380 |
scrmask(_screencoordVal(left), _screencoordVal(right), |
294 | 7381 |
_screencoordVal(bottom), _screencoordVal(top)); |
7382 |
RETURN (true); |
|
7383 |
#endif |
|
7384 |
%} |
|
7385 |
. |
|
7386 |
^ false |
|
7387 |
! |
|
7388 |
||
7389 |
glxScrnattach: gsnr in: aGLXWindowId |
|
7390 |
||
7391 |
%{ /* NOCONTEXT */ |
|
7392 |
#ifdef GLX |
|
7393 |
SETWIN(aGLXWindowId) |
|
7394 |
scrnattach(_longVal(gsnr)); |
|
7395 |
RETURN (true); |
|
7396 |
#endif |
|
7397 |
%} |
|
7398 |
. |
|
7399 |
^ false |
|
7400 |
! |
|
7401 |
||
7402 |
glxScrnselect: gsnr in: aGLXWindowId |
|
7403 |
||
7404 |
%{ /* NOCONTEXT */ |
|
7405 |
#ifdef GLX |
|
7406 |
SETWIN(aGLXWindowId) |
|
7407 |
scrnselect(_longVal(gsnr)); |
|
7408 |
RETURN (true); |
|
7409 |
#endif |
|
7410 |
%} |
|
7411 |
. |
|
7412 |
^ false |
|
7413 |
! |
|
7414 |
||
7415 |
glxSetcursorIndex: index color: color wtn: wtn in: aGLXWindowId |
|
7416 |
||
7417 |
%{ /* NOCONTEXT */ |
|
7418 |
#ifdef GLX |
|
7419 |
SETWIN(aGLXWindowId) |
|
7420 |
setcursor(_shortVal(index), _colorindexVal(color), _colorindexVal(wtn)); |
|
7421 |
RETURN (true); |
|
7422 |
#endif |
|
7423 |
%} |
|
7424 |
. |
|
7425 |
^ false |
|
7426 |
! |
|
7427 |
||
7428 |
glxSetdblightsMask: mask in: aGLXWindowId |
|
7429 |
||
7430 |
%{ /* NOCONTEXT */ |
|
7431 |
#ifdef GLX |
|
7432 |
SETWIN(aGLXWindowId) |
|
7433 |
setdblights((ulong)__intVal(mask)); |
|
7434 |
RETURN (true); |
|
7435 |
#endif |
|
7436 |
%} |
|
7437 |
. |
|
7438 |
^ false |
|
7439 |
! |
|
7440 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7441 |
glxSetdepthNear:znear far:zfar in: aGLXWindowId |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7442 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7443 |
%{ /* NOCONTEXT */ |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7444 |
#ifdef GLX |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7445 |
SETWIN(aGLXWindowId) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7446 |
setdepth(_screencoordVal(znear), _screencoordVal(zfar)); |
294 | 7447 |
RETURN (true); |
7448 |
#endif |
|
7449 |
%} |
|
7450 |
. |
|
7451 |
^ false |
|
7452 |
! |
|
7453 |
||
7454 |
glxSetmap: mapnum in: aGLXWindowId |
|
7455 |
||
7456 |
%{ /* NOCONTEXT */ |
|
7457 |
#ifdef GLX |
|
7458 |
SETWIN(aGLXWindowId) |
|
7459 |
setmap(_shortVal(mapnum)); |
|
7460 |
RETURN (true); |
|
7461 |
#endif |
|
7462 |
%} |
|
7463 |
. |
|
7464 |
^ false |
|
7465 |
! |
|
7466 |
||
7467 |
glxSetmonitor: mtype in: aGLXWindowId |
|
7468 |
||
7469 |
%{ /* NOCONTEXT */ |
|
7470 |
#ifdef GLX |
|
7471 |
SETWIN(aGLXWindowId) |
|
7472 |
setmonitor(_shortVal(mtype)); |
|
7473 |
RETURN (true); |
|
7474 |
#endif |
|
7475 |
%} |
|
7476 |
. |
|
7477 |
^ false |
|
7478 |
! |
|
7479 |
||
7480 |
glxSetnurbsproperty: property value: value in: aGLXWindowId |
|
7481 |
||
7482 |
%{ /* NOCONTEXT */ |
|
7483 |
#ifdef GLX |
|
7484 |
SETWIN(aGLXWindowId) |
|
7485 |
setnurbsproperty(_longVal(property), _floatVal(value)); |
|
7486 |
RETURN (true); |
|
7487 |
#endif |
|
7488 |
%} |
|
7489 |
. |
|
7490 |
^ false |
|
7491 |
! |
|
7492 |
||
7493 |
glxSetpattern: index in: aGLXWindowId |
|
7494 |
||
7495 |
%{ /* NOCONTEXT */ |
|
7496 |
#ifdef GLX |
|
7497 |
SETWIN(aGLXWindowId) |
|
7498 |
setpattern(_shortVal(index)); |
|
7499 |
RETURN (true); |
|
7500 |
#endif |
|
7501 |
%} |
|
7502 |
. |
|
7503 |
^ false |
|
7504 |
! |
|
7505 |
||
7506 |
glxSetpup: pup entry: entry mode: mode in: aGLXWindowId |
|
7507 |
||
7508 |
%{ /* NOCONTEXT */ |
|
7509 |
#ifdef GLX |
|
7510 |
SETWIN(aGLXWindowId) |
|
7511 |
setpup(_longVal(pup), _longVal(entry), (ulong)__intVal(mode)); |
|
7512 |
RETURN (true); |
|
7513 |
#endif |
|
7514 |
%} |
|
7515 |
. |
|
7516 |
^ false |
|
7517 |
! |
|
7518 |
||
7519 |
glxSetvaluator: v init: init vmin: vmin vmax: vmax in: aGLXWindowId |
|
7520 |
||
7521 |
%{ /* NOCONTEXT */ |
|
7522 |
#ifdef GLX |
|
7523 |
SETWIN(aGLXWindowId) |
|
7524 |
setvaluator(_deviceVal(v), _shortVal(init), _shortVal(vmin), _shortVal(vmax)); |
|
7525 |
RETURN (true); |
|
7526 |
#endif |
|
7527 |
%} |
|
7528 |
. |
|
7529 |
^ false |
|
7530 |
! |
|
7531 |
||
7532 |
glxSetvideo: reg value: value in: aGLXWindowId |
|
7533 |
||
7534 |
%{ /* NOCONTEXT */ |
|
7535 |
#ifdef GLX |
|
7536 |
SETWIN(aGLXWindowId) |
|
7537 |
setvideo(_longVal(reg), _longVal(value)); |
|
7538 |
RETURN (true); |
|
7539 |
#endif |
|
7540 |
%} |
|
7541 |
. |
|
7542 |
^ false |
|
7543 |
! |
|
7544 |
||
7545 |
glxShademodel: model in: aGLXWindowId |
|
7546 |
||
7547 |
%{ /* NOCONTEXT */ |
|
7548 |
#ifdef GLX |
|
7549 |
SETWIN(aGLXWindowId) |
|
7550 |
shademodel(_longVal(model)); |
|
7551 |
RETURN (true); |
|
7552 |
#endif |
|
7553 |
%} |
|
7554 |
. |
|
7555 |
^ false |
|
7556 |
! |
|
7557 |
||
7558 |
glxShaderangeLowin: lowin hiwin: hiwin z1: z1 z2: z2 in: aGLXWindowId |
|
7559 |
||
7560 |
%{ /* NOCONTEXT */ |
|
7561 |
#ifdef GLX |
|
7562 |
SETWIN(aGLXWindowId) |
|
4718 | 7563 |
shaderange(_colorindexVal(lowin), _colorindexVal(hiwin), |
294 | 7564 |
_screencoordVal(z1), _screencoordVal(z2)); |
7565 |
RETURN (true); |
|
7566 |
#endif |
|
7567 |
%} |
|
7568 |
. |
|
7569 |
^ false |
|
7570 |
! |
|
7571 |
||
7572 |
glxSmoothline: mode in: aGLXWindowId |
|
7573 |
||
7574 |
%{ /* NOCONTEXT */ |
|
7575 |
#ifdef GLX |
|
7576 |
SETWIN(aGLXWindowId) |
|
7577 |
smoothline(_longVal(mode)); |
|
7578 |
RETURN (true); |
|
7579 |
#endif |
|
7580 |
%} |
|
7581 |
. |
|
7582 |
^ false |
|
7583 |
! |
|
7584 |
||
4718 | 7585 |
glxStencilEnable: enable ref: ref func: func mask: mask fail: fail |
294 | 7586 |
pass: pass zpass: zpass in: aGLXWindowId |
7587 |
||
7588 |
%{ /* NOCONTEXT */ |
|
7589 |
#ifdef GLX |
|
7590 |
SETWIN(aGLXWindowId) |
|
4718 | 7591 |
stencil(_longVal(enable), (ulong)__intVal(ref), _longVal(func), |
294 | 7592 |
(ulong)__intVal(mask), _longVal(fail), _longVal(pass), _longVal(zpass)); |
7593 |
RETURN (true); |
|
7594 |
#endif |
|
7595 |
%} |
|
7596 |
. |
|
7597 |
^ false |
|
7598 |
! |
|
7599 |
||
7600 |
glxStensize: planes in: aGLXWindowId |
|
7601 |
||
7602 |
%{ /* NOCONTEXT */ |
|
7603 |
#ifdef GLX |
|
7604 |
SETWIN(aGLXWindowId) |
|
7605 |
stensize(_longVal(planes)); |
|
7606 |
RETURN (true); |
|
7607 |
#endif |
|
7608 |
%} |
|
7609 |
. |
|
7610 |
^ false |
|
7611 |
! |
|
7612 |
||
7613 |
glxStepunitX: x y: y in: aGLXWindowId |
|
7614 |
||
7615 |
%{ /* NOCONTEXT */ |
|
7616 |
#ifdef GLX |
|
7617 |
SETWIN(aGLXWindowId) |
|
7618 |
stepunit(_longVal(x), _longVal(y)); |
|
7619 |
RETURN (true); |
|
7620 |
#endif |
|
7621 |
%} |
|
7622 |
. |
|
7623 |
^ false |
|
7624 |
! |
|
7625 |
||
7626 |
glxSubpixel: b in: aGLXWindowId |
|
7627 |
||
7628 |
%{ /* NOCONTEXT */ |
|
7629 |
#ifdef GLX |
|
7630 |
SETWIN(aGLXWindowId) |
|
7631 |
subpixel(_booleanVal(b)); |
|
7632 |
RETURN (true); |
|
7633 |
#endif |
|
7634 |
%} |
|
7635 |
. |
|
7636 |
^ false |
|
7637 |
! |
|
7638 |
||
7639 |
glxSwapinterval: i in: aGLXWindowId |
|
7640 |
||
7641 |
%{ /* NOCONTEXT */ |
|
7642 |
#ifdef GLX |
|
7643 |
SETWIN(aGLXWindowId) |
|
7644 |
swapinterval(_shortVal(i)); |
|
7645 |
RETURN (true); |
|
7646 |
#endif |
|
7647 |
%} |
|
7648 |
. |
|
7649 |
^ false |
|
7650 |
! |
|
7651 |
||
7652 |
glxSwaptmeshIn: aGLXWindowId |
|
7653 |
||
7654 |
%{ /* NOCONTEXT */ |
|
7655 |
#ifdef GLX |
|
7656 |
SETWIN(aGLXWindowId) |
|
7657 |
swaptmesh(); |
|
7658 |
RETURN (true); |
|
7659 |
#endif |
|
7660 |
%} |
|
7661 |
. |
|
7662 |
^ false |
|
7663 |
! |
|
7664 |
||
7665 |
glxSwinopen: parent in: aGLXWindowId |
|
7666 |
||
7667 |
%{ /* NOCONTEXT */ |
|
7668 |
#ifdef GLX |
|
7669 |
SETWIN(aGLXWindowId) |
|
7670 |
swinopen(_longVal(parent)); |
|
7671 |
RETURN (true); |
|
7672 |
#endif |
|
7673 |
%} |
|
7674 |
. |
|
7675 |
^ false |
|
7676 |
! |
|
7677 |
||
7678 |
glxSwritemask: mask in: aGLXWindowId |
|
7679 |
||
7680 |
%{ /* NOCONTEXT */ |
|
7681 |
#ifdef GLX |
|
7682 |
SETWIN(aGLXWindowId) |
|
7683 |
swritemask((ulong)__intVal(mask)); |
|
7684 |
RETURN (true); |
|
7685 |
#endif |
|
7686 |
%} |
|
7687 |
. |
|
7688 |
^ false |
|
7689 |
! |
|
7690 |
||
7691 |
glxTextinitIn: aGLXWindowId |
|
7692 |
||
7693 |
%{ /* NOCONTEXT */ |
|
7694 |
#ifdef GLX |
|
7695 |
SETWIN(aGLXWindowId) |
|
7696 |
textinit(); |
|
7697 |
RETURN (true); |
|
7698 |
#endif |
|
7699 |
%} |
|
7700 |
. |
|
7701 |
^ false |
|
7702 |
! |
|
7703 |
||
7704 |
glxTextportLeft: left right: right bottom: bottom top: top in: aGLXWindowId |
|
7705 |
||
7706 |
%{ /* NOCONTEXT */ |
|
7707 |
#ifdef GLX |
|
7708 |
SETWIN(aGLXWindowId) |
|
4718 | 7709 |
textport(_screencoordVal(left), _screencoordVal(right), |
294 | 7710 |
_screencoordVal(bottom), _screencoordVal(top)); |
7711 |
RETURN (true); |
|
7712 |
#endif |
|
7713 |
%} |
|
7714 |
. |
|
7715 |
^ false |
|
7716 |
! |
|
7717 |
||
7718 |
glxTieB: b v1: v1 v2: v2 in: aGLXWindowId |
|
7719 |
||
7720 |
%{ /* NOCONTEXT */ |
|
7721 |
#ifdef GLX |
|
7722 |
SETWIN(aGLXWindowId) |
|
7723 |
tie(_deviceVal(b), _deviceVal(v1), _deviceVal(v2)); |
|
7724 |
RETURN (true); |
|
7725 |
#endif |
|
7726 |
%} |
|
7727 |
. |
|
7728 |
^ false |
|
7729 |
! |
|
7730 |
||
7731 |
glxTlutbind: target index: index in: aGLXWindowId |
|
7732 |
||
7733 |
%{ /* NOCONTEXT */ |
|
7734 |
#ifdef FULL_GLX |
|
7735 |
SETWIN(aGLXWindowId) |
|
7736 |
tlutbind(_longVal(target), _longVal(index)); |
|
7737 |
RETURN (true); |
|
7738 |
#endif |
|
7739 |
%} |
|
7740 |
. |
|
7741 |
^ false |
|
7742 |
! |
|
7743 |
||
7744 |
glxTpoffIn: aGLXWindowId |
|
7745 |
||
7746 |
%{ /* NOCONTEXT */ |
|
7747 |
#ifdef GLX |
|
7748 |
SETWIN(aGLXWindowId) |
|
7749 |
tpoff(); |
|
7750 |
RETURN (true); |
|
7751 |
#endif |
|
7752 |
%} |
|
7753 |
. |
|
7754 |
^ false |
|
7755 |
! |
|
7756 |
||
7757 |
glxTponIn: aGLXWindowId |
|
7758 |
||
7759 |
%{ /* NOCONTEXT */ |
|
7760 |
#ifdef GLX |
|
7761 |
SETWIN(aGLXWindowId) |
|
7762 |
tpon(); |
|
7763 |
RETURN (true); |
|
7764 |
#endif |
|
7765 |
%} |
|
7766 |
. |
|
7767 |
^ false |
|
7768 |
! |
|
7769 |
||
7770 |
glxUnqdevice: dev in: aGLXWindowId |
|
7771 |
||
7772 |
%{ /* NOCONTEXT */ |
|
1932 | 7773 |
SETWIN(aGLXWindowId) |
7774 |
#ifdef OPENGL |
|
7775 |
#else |
|
294 | 7776 |
unqdevice(_deviceVal(dev)); |
1932 | 7777 |
#endif |
7778 |
%} |
|
294 | 7779 |
! |
7780 |
||
7781 |
glxWmpack: pack in: aGLXWindowId |
|
7782 |
||
7783 |
%{ /* NOCONTEXT */ |
|
7784 |
#ifdef GLX |
|
7785 |
SETWIN(aGLXWindowId) |
|
7786 |
wmpack((ulong)__intVal(pack)); |
|
7787 |
RETURN (true); |
|
7788 |
#endif |
|
7789 |
%} |
|
7790 |
. |
|
7791 |
^ false |
|
7792 |
! |
|
7793 |
||
7794 |
glxWritemask: wtm in: aGLXWindowId |
|
7795 |
||
7796 |
%{ /* NOCONTEXT */ |
|
7797 |
#ifdef GLX |
|
7798 |
SETWIN(aGLXWindowId) |
|
7799 |
writemask(_colorindexVal(wtm)); |
|
7800 |
RETURN (true); |
|
7801 |
#endif |
|
7802 |
%} |
|
7803 |
. |
|
7804 |
^ false |
|
7805 |
! |
|
7806 |
||
7807 |
glxXfpt2X: x y: y in: aGLXWindowId |
|
7808 |
||
7809 |
%{ /* NOCONTEXT */ |
|
7810 |
#ifdef GLX |
|
7811 |
Coord c_x, c_y; |
|
7812 |
||
7813 |
_COORD_ (x, c_x) |
|
7814 |
_COORD_ (y, c_y) |
|
7815 |
SETWIN(aGLXWindowId) |
|
7816 |
xfpt2(c_x, c_y); |
|
7817 |
RETURN (true); |
|
7818 |
#endif |
|
7819 |
%} |
|
7820 |
. |
|
7821 |
^ false |
|
7822 |
! |
|
7823 |
||
7824 |
glxXfpt2iX: x y: y in: aGLXWindowId |
|
7825 |
||
7826 |
%{ /* NOCONTEXT */ |
|
7827 |
#ifdef GLX |
|
7828 |
Icoord c_x, c_y; |
|
7829 |
||
7830 |
_ICOORD_ (x, c_x) |
|
7831 |
_ICOORD_ (y, c_y) |
|
7832 |
SETWIN(aGLXWindowId) |
|
7833 |
xfpt2i(c_x, c_y); |
|
7834 |
RETURN (true); |
|
7835 |
#endif |
|
7836 |
%} |
|
7837 |
. |
|
7838 |
^ false |
|
7839 |
! |
|
7840 |
||
7841 |
glxXfpt2sX: x y: y in: aGLXWindowId |
|
7842 |
||
7843 |
%{ /* NOCONTEXT */ |
|
7844 |
#ifdef GLX |
|
7845 |
Scoord c_x, c_y; |
|
7846 |
||
7847 |
_SCOORD_ (x, c_x) |
|
7848 |
_SCOORD_ (y, c_y) |
|
7849 |
SETWIN(aGLXWindowId) |
|
7850 |
xfpt2s(c_x, c_y); |
|
7851 |
RETURN (true); |
|
7852 |
#endif |
|
7853 |
%} |
|
7854 |
. |
|
7855 |
^ false |
|
7856 |
! |
|
7857 |
||
7858 |
glxXfpt4X: x y: y z: z w: w in: aGLXWindowId |
|
7859 |
||
7860 |
%{ /* NOCONTEXT */ |
|
7861 |
#ifdef GLX |
|
7862 |
Coord c_x, c_y, c_z, c_w; |
|
7863 |
||
7864 |
_COORD_ (x, c_x) |
|
7865 |
_COORD_ (y, c_y) |
|
7866 |
_COORD_ (z, c_z) |
|
7867 |
_COORD_ (w, c_w) |
|
7868 |
SETWIN(aGLXWindowId) |
|
7869 |
xfpt4(c_x, c_y, c_z, c_w); |
|
7870 |
RETURN (true); |
|
7871 |
#endif |
|
7872 |
%} |
|
7873 |
. |
|
7874 |
^ false |
|
7875 |
! |
|
7876 |
||
7877 |
glxXfpt4iX: x y: y z: z w: w in: aGLXWindowId |
|
7878 |
||
7879 |
%{ /* NOCONTEXT */ |
|
7880 |
#ifdef GLX |
|
7881 |
Icoord c_x, c_y, c_z, c_w; |
|
7882 |
||
7883 |
_ICOORD_ (x, c_x) |
|
7884 |
_ICOORD_ (y, c_y) |
|
7885 |
_ICOORD_ (z, c_z) |
|
7886 |
_ICOORD_ (w, c_w) |
|
7887 |
SETWIN(aGLXWindowId) |
|
7888 |
xfpt4i(c_x, c_y, c_z, c_w); |
|
7889 |
RETURN (true); |
|
7890 |
#endif |
|
7891 |
%} |
|
7892 |
. |
|
7893 |
^ false |
|
7894 |
! |
|
7895 |
||
7896 |
glxXfpt4sX: x y: y z: z w: w in: aGLXWindowId |
|
7897 |
||
7898 |
%{ /* NOCONTEXT */ |
|
7899 |
#ifdef GLX |
|
7900 |
Scoord c_x, c_y, c_z, c_w; |
|
7901 |
||
7902 |
_SCOORD_ (x, c_x) |
|
7903 |
_SCOORD_ (y, c_y) |
|
7904 |
_SCOORD_ (z, c_z) |
|
7905 |
_SCOORD_ (w, c_w) |
|
7906 |
SETWIN(aGLXWindowId) |
|
7907 |
xfpt4s(c_x, c_y, c_z, c_w); |
|
7908 |
RETURN (true); |
|
7909 |
#endif |
|
7910 |
%} |
|
7911 |
. |
|
7912 |
^ false |
|
7913 |
! |
|
7914 |
||
7915 |
glxXfptX: x y: y z: z in: aGLXWindowId |
|
7916 |
||
7917 |
%{ /* NOCONTEXT */ |
|
7918 |
#ifdef GLX |
|
7919 |
Coord c_x, c_y, c_z; |
|
7920 |
||
7921 |
_COORD_ (x, c_x) |
|
7922 |
_COORD_ (y, c_y) |
|
7923 |
_COORD_ (z, c_z) |
|
7924 |
SETWIN(aGLXWindowId) |
|
7925 |
xfpt(c_x, c_y, c_z); |
|
7926 |
RETURN (true); |
|
7927 |
#endif |
|
7928 |
%} |
|
7929 |
. |
|
7930 |
^ false |
|
7931 |
! |
|
7932 |
||
7933 |
glxXfptiX: x y: y z: z in: aGLXWindowId |
|
7934 |
||
7935 |
%{ /* NOCONTEXT */ |
|
7936 |
#ifdef GLX |
|
7937 |
Icoord c_x, c_y, c_z; |
|
7938 |
||
7939 |
_ICOORD_ (x, c_x) |
|
7940 |
_ICOORD_ (y, c_y) |
|
7941 |
_ICOORD_ (z, c_z) |
|
7942 |
SETWIN(aGLXWindowId) |
|
7943 |
xfpti(c_x, c_y, c_z); |
|
7944 |
RETURN (true); |
|
7945 |
#endif |
|
7946 |
%} |
|
7947 |
. |
|
7948 |
^ false |
|
7949 |
! |
|
7950 |
||
7951 |
glxXfptsX: x y: y z: z in: aGLXWindowId |
|
7952 |
||
7953 |
%{ /* NOCONTEXT */ |
|
7954 |
#ifdef GLX |
|
7955 |
Scoord c_x, c_y, c_z; |
|
7956 |
||
7957 |
_SCOORD_ (x, c_x) |
|
7958 |
_SCOORD_ (y, c_y) |
|
7959 |
_SCOORD_ (z, c_z) |
|
7960 |
SETWIN(aGLXWindowId) |
|
7961 |
xfpts(c_x, c_y, c_z); |
|
7962 |
RETURN (true); |
|
7963 |
#endif |
|
7964 |
%} |
|
7965 |
. |
|
7966 |
^ false |
|
7967 |
! ! |
|
7968 |
||
7969 |
!GLXWorkstation methodsFor:'vertex data transfer'! |
|
7970 |
||
7971 |
glxN3f:arrayOf3Floats in:aGLXWindowId |
|
7972 |
"argument must be an array of 3 floats containing the |
|
7973 |
current vertex normal - in real GL only" |
|
7974 |
||
7975 |
%{ /* NOCONTEXT */ |
|
7976 |
#ifdef GLX |
|
7977 |
float vec[3], *v; |
|
7978 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7979 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 7980 |
SETWIN(aGLXWindowId) |
7981 |
n3f(v); |
|
7982 |
RETURN (true); |
|
7983 |
#endif |
|
7984 |
%} |
|
7985 |
. |
|
7986 |
^ false |
|
7987 |
! |
|
7988 |
||
7989 |
glxV2d:v in:aGLXWindowId |
|
7990 |
"pass a vertex; v must be a vector with 2 doubles; z is taken as 0" |
|
7991 |
||
7992 |
%{ /* NOCONTEXT */ |
|
7993 |
double vec[2], *c_v; |
|
7994 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7995 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 2))) RETURN(false); |
294 | 7996 |
SETWIN(aGLXWindowId) |
1932 | 7997 |
#ifdef OPENGL |
7998 |
#else |
|
294 | 7999 |
v2d(c_v); |
1932 | 8000 |
#endif |
294 | 8001 |
RETURN (true); |
8002 |
%} |
|
8003 |
! |
|
8004 |
||
8005 |
glxV2f:v in:aGLXWindowId |
|
8006 |
"pass a vertex; v must be a vector with 2 floats; z is taken as 0" |
|
8007 |
||
8008 |
%{ /* NOCONTEXT */ |
|
8009 |
float vec[2], *c_v; |
|
8010 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8011 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
294 | 8012 |
SETWIN(aGLXWindowId) |
1932 | 8013 |
#ifdef OPENGL |
8014 |
#else |
|
294 | 8015 |
v2f(c_v); |
1932 | 8016 |
#endif |
294 | 8017 |
RETURN (true); |
8018 |
%} |
|
8019 |
! |
|
8020 |
||
8021 |
glxV2fX:x y:y in:aGLXWindowId |
|
8022 |
"pass a vertex from individual x and y values; z is taken as 0.0" |
|
8023 |
||
8024 |
%{ /* NOCONTEXT */ |
|
8025 |
float vec[2]; |
|
8026 |
||
8027 |
_FLOAT_(x, vec[0]) |
|
8028 |
_FLOAT_(y, vec[1]) |
|
8029 |
SETWIN(aGLXWindowId) |
|
1932 | 8030 |
#ifdef OPENGL |
8031 |
#else |
|
294 | 8032 |
v2f(vec); |
1932 | 8033 |
#endif |
294 | 8034 |
RETURN (true); |
8035 |
%} |
|
8036 |
! |
|
8037 |
||
8038 |
glxV2i:v in:aGLXWindowId |
|
8039 |
"pass a vertex; v must be a vector with 2 longs; z is taken as 0" |
|
8040 |
||
8041 |
%{ /* NOCONTEXT */ |
|
8042 |
long vec[2], *c_v; |
|
8043 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8044 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 2))) RETURN(false); |
294 | 8045 |
SETWIN(aGLXWindowId) |
1932 | 8046 |
#ifdef OPENGL |
8047 |
#else |
|
294 | 8048 |
v2i(c_v); |
1932 | 8049 |
#endif |
294 | 8050 |
RETURN (true); |
8051 |
%} |
|
8052 |
! |
|
8053 |
||
8054 |
glxV2s:v in:aGLXWindowId |
|
8055 |
"pass a vertex; v must be a vector with 2 shorts; z is taken as 0" |
|
8056 |
||
8057 |
%{ /* NOCONTEXT */ |
|
8058 |
short vec[2], *c_v; |
|
8059 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8060 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 2))) RETURN(false); |
294 | 8061 |
SETWIN(aGLXWindowId) |
1932 | 8062 |
#ifdef OPENGL |
8063 |
#else |
|
294 | 8064 |
v2s(c_v); |
1932 | 8065 |
#endif |
294 | 8066 |
RETURN (true); |
8067 |
%} |
|
8068 |
! |
|
8069 |
||
8070 |
glxV3d:v in:aGLXWindowId |
|
8071 |
"pass a vertex; v must be a 3-element double-vector" |
|
8072 |
||
8073 |
%{ /* NOCONTEXT */ |
|
8074 |
double vec[3], *c_v; |
|
8075 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8076 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 3))) RETURN(false); |
294 | 8077 |
SETWIN(aGLXWindowId) |
1932 | 8078 |
#ifdef OPENGL |
8079 |
#else |
|
294 | 8080 |
v3d(c_v); |
1932 | 8081 |
#endif |
294 | 8082 |
RETURN (true); |
8083 |
%} |
|
8084 |
. |
|
8085 |
^ false |
|
8086 |
! |
|
8087 |
||
8088 |
glxV3f:v in:aGLXWindowId |
|
8089 |
"pass a vertex; v must be a 3-element float-vector" |
|
8090 |
||
8091 |
%{ /* NOCONTEXT */ |
|
8092 |
float vec[3], *c_v; |
|
8093 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8094 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
294 | 8095 |
SETWIN(aGLXWindowId) |
1932 | 8096 |
#ifdef OPENGL |
8097 |
#else |
|
294 | 8098 |
v3f(c_v); |
1932 | 8099 |
#endif |
294 | 8100 |
RETURN (true); |
8101 |
%} |
|
8102 |
! |
|
8103 |
||
8104 |
glxV3fX:x y:y z:z in: aGLXWindowId |
|
8105 |
"pass a vector from individual x, y and z (float) values" |
|
8106 |
||
8107 |
%{ /* NOCONTEXT */ |
|
8108 |
float vec[3]; |
|
8109 |
||
8110 |
_FLOAT_(x, vec[0]) |
|
8111 |
_FLOAT_(y, vec[1]) |
|
8112 |
_FLOAT_(z, vec[2]) |
|
8113 |
SETWIN(aGLXWindowId) |
|
1932 | 8114 |
#ifdef OPENGL |
8115 |
#else |
|
294 | 8116 |
v3f(vec); |
1932 | 8117 |
#endif |
294 | 8118 |
RETURN (true); |
8119 |
%} |
|
8120 |
! |
|
8121 |
||
8122 |
glxV3i:v in:aGLXWindowId |
|
8123 |
"pass a vertex; v must be a vector with 3 longs" |
|
8124 |
||
8125 |
%{ /* NOCONTEXT */ |
|
8126 |
long vec[3], *c_v; |
|
8127 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8128 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
294 | 8129 |
SETWIN(aGLXWindowId) |
1932 | 8130 |
#ifdef OPENGL |
8131 |
#else |
|
294 | 8132 |
v3i(c_v); |
1932 | 8133 |
#endif |
294 | 8134 |
RETURN (true); |
8135 |
%} |
|
8136 |
! |
|
8137 |
||
8138 |
glxV3s:v in:aGLXWindowId |
|
8139 |
"pass a vertex; v must be a vector with 3 shorts" |
|
8140 |
||
8141 |
%{ /* NOCONTEXT */ |
|
8142 |
short vec[3], *c_v; |
|
8143 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8144 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
294 | 8145 |
SETWIN(aGLXWindowId) |
1932 | 8146 |
#ifdef OPENGL |
8147 |
#else |
|
294 | 8148 |
v3s(c_v); |
1932 | 8149 |
#endif |
294 | 8150 |
RETURN (true); |
8151 |
%} |
|
8152 |
! |
|
8153 |
||
8154 |
glxV4d:v in:aGLXWindowId |
|
8155 |
"pass a vertex; v must be a 4-element double-vector, |
|
8156 |
containing x, y, z and w" |
|
8157 |
||
8158 |
%{ /* NOCONTEXT */ |
|
8159 |
double vec[4], *c_v; |
|
8160 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8161 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 4))) RETURN(false); |
294 | 8162 |
SETWIN(aGLXWindowId) |
1932 | 8163 |
#ifdef OPENGL |
8164 |
#else |
|
294 | 8165 |
v4d(c_v); |
1932 | 8166 |
#endif |
294 | 8167 |
RETURN (true); |
8168 |
%} |
|
8169 |
! |
|
8170 |
||
8171 |
glxV4f:v in:aGLXWindowId |
|
8172 |
"pass a vertex; v must be a 4-element float-vector, |
|
8173 |
containing x, y, z and w" |
|
8174 |
||
8175 |
%{ /* NOCONTEXT */ |
|
8176 |
float vec[4], *c_v; |
|
8177 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8178 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
294 | 8179 |
SETWIN(aGLXWindowId) |
1932 | 8180 |
#ifdef OPENGL |
8181 |
#else |
|
294 | 8182 |
v4f(c_v); |
1932 | 8183 |
#endif |
294 | 8184 |
RETURN (true); |
8185 |
%} |
|
8186 |
! |
|
8187 |
||
8188 |
glxV4i:v in:aGLXWindowId |
|
8189 |
"pass a vertex; v must be a 4-element int-vector, |
|
8190 |
containing x, y, z and w" |
|
8191 |
||
8192 |
%{ /* NOCONTEXT */ |
|
8193 |
long vec[4], *c_v; |
|
8194 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8195 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
294 | 8196 |
SETWIN(aGLXWindowId) |
1932 | 8197 |
#ifdef OPENGL |
8198 |
#else |
|
294 | 8199 |
v4i(c_v); |
1932 | 8200 |
#endif |
294 | 8201 |
RETURN (true); |
8202 |
%} |
|
8203 |
! |
|
8204 |
||
8205 |
glxV4s:v in:aGLXWindowId |
|
8206 |
"pass a vertex; v must be a 4-element short-vector, |
|
8207 |
containing x, y, z and w" |
|
8208 |
||
8209 |
%{ /* NOCONTEXT */ |
|
8210 |
short vec[4], *c_v; |
|
8211 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8212 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
294 | 8213 |
SETWIN(aGLXWindowId) |
1932 | 8214 |
#ifdef OPENGL |
8215 |
#else |
|
294 | 8216 |
v4s(c_v); |
1932 | 8217 |
#endif |
294 | 8218 |
RETURN (true); |
8219 |
%} |
|
8220 |
! |
|
8221 |
||
8222 |
glxVOriginIn:aGLXWindowId |
|
8223 |
"pass a 0.0/0.0/0.0 vector. |
|
8224 |
This is the same as v3f:#(0.0 0.0 0.0), but, since its so |
|
8225 |
common, this somewhat faster method has been provided" |
|
8226 |
||
8227 |
%{ /* NOCONTEXT */ |
|
8228 |
static float vec[3] = {0.0, 0.0, 0.0}; |
|
8229 |
||
8230 |
SETWIN(aGLXWindowId) |
|
1932 | 8231 |
#ifdef OPENGL |
8232 |
#else |
|
294 | 8233 |
v3f(vec); |
1932 | 8234 |
#endif |
294 | 8235 |
RETURN (true); |
8236 |
%} |
|
8237 |
! |
|
8238 |
||
8239 |
glxVUnitXIn:aGLXWindowId |
|
8240 |
"pass a 1.0/0.0/0.0 vector. |
|
8241 |
This is the same as v3f:#(1.0 0.0 0.0), but, since its so |
|
8242 |
common, this somewhat faster method has been provided" |
|
8243 |
||
8244 |
%{ /* NOCONTEXT */ |
|
8245 |
static float vec[3] = {1.0, 0.0, 0.0}; |
|
8246 |
||
8247 |
SETWIN(aGLXWindowId) |
|
1932 | 8248 |
#ifdef OPENGL |
8249 |
#else |
|
294 | 8250 |
v3f(vec); |
1932 | 8251 |
#endif |
294 | 8252 |
RETURN (true); |
8253 |
%} |
|
8254 |
! |
|
8255 |
||
8256 |
glxVUnitYIn:aGLXWindowId |
|
8257 |
"pass a 0.0/1.0/0.0 vector. |
|
8258 |
This is the same as v3f:#(0.0 1.0 0.0), but, since its so |
|
8259 |
common, this somewhat faster method has been provided" |
|
8260 |
||
8261 |
%{ /* NOCONTEXT */ |
|
8262 |
static float vec[3] = {0.0, 1.0, 0.0}; |
|
8263 |
||
8264 |
SETWIN(aGLXWindowId) |
|
1932 | 8265 |
#ifdef OPENGL |
8266 |
#else |
|
294 | 8267 |
v3f(vec); |
1932 | 8268 |
#endif |
294 | 8269 |
RETURN (true); |
8270 |
%} |
|
8271 |
! |
|
8272 |
||
8273 |
glxVUnitZIn:aGLXWindowId |
|
8274 |
"pass a 0.0/0.0/1.0 vector. |
|
8275 |
This is the same as v3f:#(0.0 0.0 1.0), but, since its so |
|
8276 |
common, this somewhat faster method has been provided" |
|
8277 |
||
8278 |
%{ /* NOCONTEXT */ |
|
8279 |
static float vec[3] = {0.0, 0.0, 1.0}; |
|
8280 |
||
8281 |
SETWIN(aGLXWindowId) |
|
1932 | 8282 |
#ifdef OPENGL |
8283 |
#else |
|
294 | 8284 |
v3f(vec); |
1932 | 8285 |
#endif |
294 | 8286 |
RETURN (true); |
8287 |
%} |
|
8288 |
! ! |
|
8289 |
||
8290 |
!GLXWorkstation methodsFor:'video and planes'! |
|
8291 |
||
8292 |
glxOverlayPlanes: planes in: aGLXWindowId |
|
8293 |
||
8294 |
%{ /* NOCONTEXT */ |
|
8295 |
#ifdef GLX |
|
8296 |
SETWIN(aGLXWindowId) |
|
8297 |
overlay(_longVal(planes)); |
|
8298 |
RETURN (true); |
|
8299 |
#endif |
|
8300 |
%} |
|
8301 |
. |
|
8302 |
^ false |
|
8303 |
! |
|
8304 |
||
8305 |
glxStereobufferIn: aGLXWindowId |
|
8306 |
||
8307 |
%{ /* NOCONTEXT */ |
|
8308 |
#ifdef FULL_GLX |
|
8309 |
SETWIN(aGLXWindowId) |
|
8310 |
stereobuffer(); |
|
8311 |
RETURN (true); |
|
8312 |
#endif |
|
8313 |
%} |
|
8314 |
. |
|
8315 |
^ false |
|
8316 |
! |
|
8317 |
||
8318 |
glxUnderlay: planes in: aGLXWindowId |
|
8319 |
||
8320 |
%{ /* NOCONTEXT */ |
|
8321 |
#ifdef GLX |
|
8322 |
SETWIN(aGLXWindowId) |
|
8323 |
underlay(_longVal(planes)); |
|
8324 |
RETURN (true); |
|
8325 |
#endif |
|
8326 |
%} |
|
8327 |
. |
|
8328 |
^ false |
|
8329 |
! |
|
8330 |
||
8331 |
glxVideocmd:cmd in:aGLXWindowId |
|
8332 |
||
8333 |
%{ /* NOCONTEXT */ |
|
8334 |
#ifdef GLX |
|
8335 |
SETWIN(aGLXWindowId) |
|
8336 |
videocmd(_longVal(cmd)); |
|
8337 |
RETURN (true); |
|
8338 |
#endif |
|
8339 |
%} |
|
8340 |
. |
|
8341 |
^ false |
|
8342 |
! ! |
|
8343 |
||
8344 |
!GLXWorkstation methodsFor:'viewing'! |
|
8345 |
||
8346 |
glxLookatVx:vx vy:vy vz:vz px:px py:py pz:pz twist:twist in:aGLXWindowId |
|
8347 |
"define viewing transformation" |
|
8348 |
||
8349 |
%{ /* NOCONTEXT */ |
|
8350 |
||
8351 |
Coord f_vx, f_vy, f_vz, f_px, f_py, f_pz; |
|
8352 |
Angle a_twist; |
|
8353 |
||
8354 |
_COORD_ (vx, f_vx) |
|
8355 |
_COORD_ (vy, f_vy) |
|
8356 |
_COORD_ (vz, f_vz) |
|
8357 |
_COORD_ (px, f_px) |
|
8358 |
_COORD_ (py, f_py) |
|
8359 |
_COORD_ (pz, f_pz) |
|
8360 |
_ANGLE_ (twist, a_twist) |
|
8361 |
SETWIN(aGLXWindowId) |
|
1932 | 8362 |
#ifdef OPENGL |
8363 |
#else |
|
294 | 8364 |
lookat(f_vx, f_vy, f_vz, f_px, f_py, f_pz, a_twist); |
1932 | 8365 |
#endif |
294 | 8366 |
%} |
8367 |
! |
|
8368 |
||
8369 |
glxOrtho2Left: left right: right bottom: bottom top: top in: aGLXWindowId |
|
8370 |
"define 2D orthogonal projection" |
|
8371 |
||
8372 |
%{ /* NOCONTEXT */ |
|
8373 |
float f_left, f_right, f_top, f_bottom; |
|
8374 |
||
8375 |
SETWIN(aGLXWindowId) |
|
8376 |
_FLOAT_(left, f_left) |
|
8377 |
_FLOAT_(right, f_right) |
|
8378 |
_FLOAT_(bottom, f_bottom) |
|
8379 |
_FLOAT_(top, f_top) |
|
1932 | 8380 |
#ifdef OPENGL |
8381 |
#else |
|
294 | 8382 |
ortho2(f_left, f_right, f_bottom, f_top); |
1932 | 8383 |
#endif |
8384 |
%} |
|
294 | 8385 |
! |
8386 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8387 |
glxOrthoLeft: left right: right bottom: bottom top: top near: znear far: zfar in: aGLXWindowId |
294 | 8388 |
"define orthogonal projection" |
8389 |
||
8390 |
%{ /* NOCONTEXT */ |
|
8391 |
float f_left, f_right, f_bottom, f_top, |
|
8392 |
f_near, f_far; |
|
8393 |
||
8394 |
_FLOAT_(left, f_left) |
|
8395 |
_FLOAT_(right, f_right) |
|
8396 |
_FLOAT_(bottom, f_bottom) |
|
8397 |
_FLOAT_(top, f_top) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8398 |
_FLOAT_(znear, f_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8399 |
_FLOAT_(zfar, f_far) |
294 | 8400 |
SETWIN(aGLXWindowId) |
1932 | 8401 |
#ifdef OPENGL |
8402 |
#else |
|
294 | 8403 |
ortho(f_left, f_right, f_bottom, f_top, f_near, f_far); |
1932 | 8404 |
#endif |
294 | 8405 |
%} |
8406 |
! |
|
8407 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8408 |
glxPerspectiveFovy:fovy aspect:aspect near:znear far:zfar in:aGLXWindowId |
294 | 8409 |
"define perspective projection" |
8410 |
||
8411 |
%{ /* NOCONTEXT */ |
|
8412 |
||
8413 |
Angle a_fovy; |
|
8414 |
Coord c_near, c_far; |
|
8415 |
float f_aspect; |
|
8416 |
||
8417 |
_ANGLE_ (fovy, a_fovy) |
|
8418 |
_FLOAT_ (aspect, f_aspect) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8419 |
_COORD_ (znear, c_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8420 |
_COORD_ (zfar, c_far) |
294 | 8421 |
|
8422 |
SETWIN(aGLXWindowId) |
|
1932 | 8423 |
#ifdef OPENGL |
8424 |
#else |
|
294 | 8425 |
perspective(a_fovy, f_aspect, c_near, c_far); |
1932 | 8426 |
#endif |
294 | 8427 |
%} |
8428 |
! |
|
8429 |
||
8430 |
glxPolarviewDist: dist azim: azim inc: inc twist: twist in: aGLXWindowId |
|
8431 |
||
8432 |
%{ /* NOCONTEXT */ |
|
8433 |
Coord c_dist; |
|
8434 |
Angle a_azim, a_inc, a_twist; |
|
8435 |
||
8436 |
_COORD_(dist, c_dist) |
|
8437 |
_ANGLE_(azim, a_azim) |
|
8438 |
_ANGLE_(inc, a_inc) |
|
8439 |
_ANGLE_(twist, a_twist) |
|
8440 |
SETWIN(aGLXWindowId) |
|
1932 | 8441 |
#ifdef OPENGL |
8442 |
#else |
|
294 | 8443 |
polarview(c_dist, a_azim, a_inc, a_twist); |
1932 | 8444 |
#endif |
294 | 8445 |
%} |
8446 |
! |
|
8447 |
||
528 | 8448 |
glxPopviewportIn: aGLXWindowId |
8449 |
"pops the top viewport off the viewport stack" |
|
8450 |
||
8451 |
%{ /* NOCONTEXT */ |
|
8452 |
SETWIN(aGLXWindowId) |
|
1932 | 8453 |
#ifdef OPENGL |
8454 |
#else |
|
528 | 8455 |
popviewport(); |
1932 | 8456 |
#endif |
528 | 8457 |
%} |
8458 |
||
8459 |
"Modified: 19.3.1996 / 18:58:24 / cg" |
|
8460 |
! |
|
8461 |
||
8462 |
glxPushviewportIn: aGLXWindowId |
|
8463 |
"pushes the current viewport on the viewport stack" |
|
8464 |
||
8465 |
%{ /* NOCONTEXT */ |
|
8466 |
SETWIN(aGLXWindowId) |
|
1932 | 8467 |
#ifdef OPENGL |
8468 |
#else |
|
528 | 8469 |
pushviewport(); |
1932 | 8470 |
#endif |
528 | 8471 |
%} |
8472 |
||
8473 |
"Modified: 19.3.1996 / 18:58:02 / cg" |
|
8474 |
! |
|
8475 |
||
294 | 8476 |
glxReshapeViewPortIn: aGLXWindowId |
8477 |
||
8478 |
%{ /* NOCONTEXT */ |
|
8479 |
SETWIN(aGLXWindowId) |
|
1932 | 8480 |
#ifdef OPENGL |
8481 |
#else |
|
294 | 8482 |
reshapeviewport(); |
1932 | 8483 |
#endif |
8484 |
%} |
|
294 | 8485 |
! |
8486 |
||
8487 |
glxViewportLeft:left right:right bottom:bottom top:top in:aGLXWindowId |
|
8488 |
||
8489 |
%{ /* NOCONTEXT */ |
|
8490 |
SETWIN(aGLXWindowId) |
|
1932 | 8491 |
#ifdef OPENGL |
8492 |
#else |
|
4718 | 8493 |
viewport(_screencoordVal(left), _screencoordVal(right), |
294 | 8494 |
_screencoordVal(bottom), _screencoordVal(top)); |
1932 | 8495 |
#endif |
294 | 8496 |
%} |
8497 |
! |
|
8498 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8499 |
glxWindowLeft: left right: right bottom: bottom top: top near: znear far: zfar in: aGLXWindowId |
294 | 8500 |
"this one was added independently by JEFF - kept for his programs ..." |
8501 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8502 |
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
|
8503 |
! |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8504 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8505 |
glxWindowLeft:left right:right top:top bottom:bottom near:znear far:zfar in:aGLXWindowId |
294 | 8506 |
"define perspective viewing pyramid" |
8507 |
||
8508 |
%{ /* NOCONTEXT */ |
|
8509 |
Coord c_left, c_right, c_top, c_bot, c_near, c_far; |
|
8510 |
||
8511 |
_COORD_ (left, c_left) |
|
8512 |
_COORD_ (right, c_right) |
|
8513 |
_COORD_ (top, c_top) |
|
8514 |
_COORD_ (bottom, c_bot) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8515 |
_COORD_ (znear, c_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8516 |
_COORD_ (zfar, c_far) |
294 | 8517 |
SETWIN(aGLXWindowId) |
1932 | 8518 |
#ifdef OPENGL |
8519 |
#else |
|
294 | 8520 |
window(c_left, c_right, c_bot, c_top, c_near, c_far); |
1932 | 8521 |
#endif |
294 | 8522 |
%} |
8523 |
! ! |
|
8524 |
||
8525 |
!GLXWorkstation methodsFor:'window control'! |
|
8526 |
||
2045 | 8527 |
glxResizedView:aGLXWindowId width:width height:height |
2048 | 8528 |
"pass down resize info to the GL - this adjusts the viewport. |
8529 |
This only works with VGL or openGL" |
|
8530 |
||
8531 |
%{ /* NOCONTEXT */ |
|
2074 | 8532 |
SETWIN(aGLXWindowId) |
8533 |
#ifdef VGL |
|
2045 | 8534 |
X11_resized(__intVal(width), __intVal(height)); |
8535 |
RETURN (true); |
|
8536 |
#endif |
|
8537 |
%} |
|
8538 |
. |
|
8539 |
^ false |
|
8540 |
! |
|
8541 |
||
294 | 8542 |
glxWinclose:gwid in:aGLXWindowId |
8543 |
||
8544 |
%{ /* NOCONTEXT */ |
|
8545 |
#ifdef GLX |
|
8546 |
SETWIN(aGLXWindowId) |
|
8547 |
winclose(_longVal(gwid)); |
|
8548 |
RETURN (true); |
|
8549 |
#endif |
|
8550 |
%} |
|
8551 |
. |
|
8552 |
^ false |
|
8553 |
! |
|
8554 |
||
8555 |
glxWinconstraintsIn: aGLXWindowId |
|
8556 |
||
8557 |
%{ /* NOCONTEXT */ |
|
8558 |
#ifdef GLX |
|
8559 |
SETWIN(aGLXWindowId) |
|
8560 |
winconstraints(); |
|
8561 |
RETURN (true); |
|
8562 |
#endif |
|
8563 |
%} |
|
8564 |
. |
|
8565 |
^ false |
|
8566 |
! |
|
8567 |
||
8568 |
glxWindepth: gwid in: aGLXWindowId |
|
8569 |
||
8570 |
%{ /* NOCONTEXT */ |
|
8571 |
#ifdef GLX |
|
8572 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
8573 |
RETURN (__MKSMALLINT(windepth(_longVal(gwid)))); |
294 | 8574 |
#endif |
8575 |
%} |
|
8576 |
. |
|
8577 |
^ false |
|
8578 |
! |
|
8579 |
||
8580 |
glxWingetIn: aGLXWindowId |
|
8581 |
||
8582 |
%{ /* NOCONTEXT */ |
|
8583 |
#ifdef GLX |
|
8584 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
8585 |
RETURN (__MKSMALLINT(winget())); |
294 | 8586 |
#endif |
8587 |
%} |
|
8588 |
. |
|
8589 |
^ false |
|
8590 |
! |
|
8591 |
||
8592 |
glxWinmoveX: x y: y in: aGLXWindowId |
|
8593 |
||
8594 |
%{ /* NOCONTEXT */ |
|
8595 |
#ifdef GLX |
|
8596 |
SETWIN(aGLXWindowId) |
|
8597 |
winmove(_longVal(x), _longVal(y)); |
|
8598 |
RETURN (true); |
|
8599 |
#endif |
|
8600 |
%} |
|
8601 |
. |
|
8602 |
^ false |
|
8603 |
! |
|
8604 |
||
8605 |
glxWinpopIn: aGLXWindowId |
|
8606 |
||
8607 |
%{ /* NOCONTEXT */ |
|
8608 |
#ifdef GLX |
|
8609 |
SETWIN(aGLXWindowId) |
|
8610 |
winpop(); |
|
8611 |
RETURN (true); |
|
8612 |
#endif |
|
8613 |
%} |
|
8614 |
. |
|
8615 |
^ false |
|
8616 |
! |
|
8617 |
||
8618 |
glxWinpositionX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
8619 |
||
8620 |
%{ /* NOCONTEXT */ |
|
8621 |
#ifdef GLX |
|
8622 |
SETWIN(aGLXWindowId) |
|
8623 |
winposition(_longVal(x1), _longVal(y1), _longVal(x2), _longVal(y2)); |
|
8624 |
RETURN (true); |
|
8625 |
#endif |
|
8626 |
%} |
|
8627 |
. |
|
8628 |
^ false |
|
8629 |
! |
|
8630 |
||
8631 |
glxWinpushIn: aGLXWindowId |
|
8632 |
||
8633 |
%{ /* NOCONTEXT */ |
|
8634 |
#ifdef GLX |
|
8635 |
SETWIN(aGLXWindowId) |
|
8636 |
winpush(); |
|
8637 |
RETURN (true); |
|
8638 |
#endif |
|
8639 |
%} |
|
8640 |
. |
|
8641 |
^ false |
|
8642 |
! |
|
8643 |
||
8644 |
glxWinset: gwid in: aGLXWindowId |
|
8645 |
||
8646 |
%{ /* NOCONTEXT */ |
|
8647 |
#ifdef GLX |
|
8648 |
SETWIN(aGLXWindowId) |
|
8649 |
winset(_longVal(gwid)); |
|
8650 |
RETURN (true); |
|
8651 |
#endif |
|
8652 |
%} |
|
8653 |
. |
|
8654 |
^ false |
|
8655 |
! ! |
|
8656 |
||
0 | 8657 |
!GLXWorkstation methodsFor:'window creation'! |
8658 |
||
12 | 8659 |
createGLXWindowFor:aView left:xpos top:ypos width:wwidth height:wheight type:glxType |
157 | 8660 |
|ext wsuperView wsuperViewId windowId| |
0 | 8661 |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
8662 |
glOK ifFalse:[^ nil]. |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
8663 |
|
793 | 8664 |
wsuperView := aView superView view. |
0 | 8665 |
wsuperView notNil ifTrue:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8666 |
wsuperViewId := wsuperView id |
0 | 8667 |
]. |
8668 |
||
524 | 8669 |
%{ /* CALLSSTACK: 20000 */ |
0 | 8670 |
Display *dpy = myDpy; |
185 | 8671 |
int screen = __intVal(_INST(screen)); |
0 | 8672 |
Window newWindow, parentWindow; |
12 | 8673 |
int t; |
0 | 8674 |
|
97 | 8675 |
if (__isSmallInteger(xpos) && __isSmallInteger(ypos) |
8676 |
&& __isSmallInteger(wwidth) && __isSmallInteger(wheight)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8677 |
if (__isExternalAddress(wsuperViewId)) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8678 |
parentWindow = _WindowVal(wsuperViewId); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8679 |
} else { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8680 |
parentWindow = RootWindow(dpy, screen); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8681 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8682 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8683 |
if (glxType == @symbol(colorIndexSingleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8684 |
t = GLXcolorIndexSingleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8685 |
else if (glxType == @symbol(colorIndexDoubleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8686 |
t = GLXcolorIndexDoubleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8687 |
else if (glxType == @symbol(rgbSingleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8688 |
t = GLXrgbSingleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8689 |
else if (glxType == @symbol(rgbDoubleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8690 |
t = GLXrgbDoubleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8691 |
else { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8692 |
RETURN ( nil ); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8693 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8694 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8695 |
ENTERGLX; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8696 |
newWindow = __GLXCreateWindow(dpy, parentWindow, |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8697 |
__intVal(xpos), __intVal(ypos), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8698 |
__intVal(wwidth), __intVal(wheight), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8699 |
0, t); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8700 |
LEAVEGLX; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8701 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8702 |
if (! newWindow) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8703 |
RETURN ( nil ); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8704 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8705 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8706 |
windowId = __MKOBJ(newWindow); |
0 | 8707 |
} |
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
8708 |
%}. |
0 | 8709 |
windowId notNil ifTrue:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8710 |
self addKnownView:aView withId:windowId. |
0 | 8711 |
]. |
8712 |
^ windowId |
|
20 | 8713 |
! |
8714 |
||
8715 |
unlinkGLXView:aGLXWindowId |
|
8716 |
"remove X/GLX link" |
|
524 | 8717 |
|
8718 |
%{ /* CALLSSTACK: 20000 */ |
|
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
8719 |
if (__isExternalAddress(aGLXWindowId)) { |
134 | 8720 |
ENTERGLX; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8721 |
__GLXUnlinkWindow(myDpy, _WindowVal(aGLXWindowId)); |
134 | 8722 |
LEAVEGLX; |
8723 |
} |
|
20 | 8724 |
%} |
0 | 8725 |
! ! |
8726 |
||
294 | 8727 |
!GLXWorkstation methodsFor:'zbuffer'! |
8728 |
||
8729 |
glxZbsize: planes in: aGLXWindowId |
|
127 | 8730 |
|
8731 |
%{ /* NOCONTEXT */ |
|
8732 |
#ifdef FULL_GLX |
|
8733 |
SETWIN(aGLXWindowId) |
|
294 | 8734 |
zbsize(_longVal(planes)); |
8735 |
RETURN (true); |
|
8736 |
#endif |
|
8737 |
%} |
|
8738 |
. |
|
8739 |
^ false |
|
8740 |
! |
|
64 | 8741 |
|
8742 |
glxZbuffer:aBoolean in:aGLXWindowId |
|
8743 |
"enable/disable z-buffer operation" |
|
8744 |
||
8745 |
%{ /* NOCONTEXT */ |
|
8746 |
#ifdef GLX |
|
8747 |
SETWIN(aGLXWindowId) |
|
8748 |
zbuffer(aBoolean == false ? FALSE : TRUE); |
|
8749 |
RETURN (true); |
|
8750 |
#endif |
|
8751 |
%} |
|
8752 |
. |
|
8753 |
^ false |
|
294 | 8754 |
! |
64 | 8755 |
|
8756 |
glxZdraw: b in: aGLXWindowId |
|
8757 |
"enable/disable drawing into the z-buffer" |
|
8758 |
||
8759 |
%{ /* NOCONTEXT */ |
|
8760 |
#ifdef GLX |
|
8761 |
SETWIN(aGLXWindowId) |
|
8762 |
zdraw(_booleanVal(b)); |
|
8763 |
RETURN (true); |
|
8764 |
#endif |
|
8765 |
%} |
|
8766 |
. |
|
8767 |
^ false |
|
294 | 8768 |
! |
64 | 8769 |
|
8770 |
glxZfunction: func in: aGLXWindowId |
|
8771 |
"set the z-buffer comparison function. |
|
8772 |
func may be either the numeric value or a symbol (preferred)" |
|
8773 |
||
8774 |
%{ /* NOCONTEXT */ |
|
8775 |
#ifdef GLX |
|
8776 |
long f; |
|
8777 |
||
8778 |
SETWIN(aGLXWindowId) |
|
8779 |
if (func == @symbol(NEVER)) |
|
77 | 8780 |
f = ZF_NEVER; |
64 | 8781 |
else if (func == @symbol(LESS)) |
77 | 8782 |
f = ZF_LESS; |
64 | 8783 |
else if (func == @symbol(EQUAL)) |
77 | 8784 |
f = ZF_EQUAL; |
64 | 8785 |
else if (func == @symbol(LEQUAL)) |
77 | 8786 |
f = ZF_LEQUAL; |
64 | 8787 |
else if (func == @symbol(GREATER)) |
77 | 8788 |
f = ZF_GREATER; |
64 | 8789 |
else if (func == @symbol(NOTEQUAL)) |
77 | 8790 |
f = ZF_NOTEQUAL; |
64 | 8791 |
else if (func == @symbol(GEQUAL)) |
77 | 8792 |
f = ZF_GEQUAL; |
64 | 8793 |
else if (func == @symbol(ALWAYS)) |
77 | 8794 |
f = ZF_ALWAYS; |
64 | 8795 |
else |
77 | 8796 |
f = _longVal(func); |
64 | 8797 |
zfunction(f); |
8798 |
RETURN (true); |
|
8799 |
#endif |
|
8800 |
%} |
|
8801 |
. |
|
8802 |
^ false |
|
294 | 8803 |
! |
64 | 8804 |
|
8805 |
glxZsource: src in: aGLXWindowId |
|
8806 |
||
8807 |
%{ /* NOCONTEXT */ |
|
8808 |
#ifdef GLX |
|
8809 |
SETWIN(aGLXWindowId) |
|
8810 |
zsource(_longVal(src)); |
|
8811 |
RETURN (true); |
|
8812 |
#endif |
|
8813 |
%} |
|
8814 |
. |
|
8815 |
^ false |
|
294 | 8816 |
! |
64 | 8817 |
|
8818 |
glxZwritemask: mask in: aGLXWindowId |
|
8819 |
||
8820 |
%{ /* NOCONTEXT */ |
|
8821 |
#ifdef GLX |
|
8822 |
SETWIN(aGLXWindowId) |
|
185 | 8823 |
zwritemask((ulong)__intVal(mask)); |
64 | 8824 |
RETURN (true); |
8825 |
#endif |
|
8826 |
%} |
|
8827 |
. |
|
8828 |
^ false |
|
8829 |
! ! |
|
8830 |
||
294 | 8831 |
!GLXWorkstation class methodsFor:'documentation'! |
8832 |
||
8833 |
version |
|
6978 | 8834 |
^ '$Header$' |
5479
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
8835 |
! |
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
8836 |
|
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
8837 |
version_CVS |
6978 | 8838 |
^ '$Header$' |
89 | 8839 |
! ! |
7656 | 8840 |