author | Jan Vrany <jan.vrany@fit.cvut.cz> |
Wed, 06 Sep 2017 11:13:09 +0200 | |
branch | jv |
changeset 8181 | 7cd36eb4b09c |
parent 7657 | 75bf1ca54216 |
child 8183 | e1c6a2aa41b6 |
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 |
|
8181
7cd36eb4b09c
X11: fixed `GLXWorkstation` to compile with OpenGL
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7657
diff
changeset
|
110 |
#ifdef __linux__ |
7cd36eb4b09c
X11: fixed `GLXWorkstation` to compile with OpenGL
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7657
diff
changeset
|
111 |
# include <signal.h> |
7cd36eb4b09c
X11: fixed `GLXWorkstation` to compile with OpenGL
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7657
diff
changeset
|
112 |
#endif |
7cd36eb4b09c
X11: fixed `GLXWorkstation` to compile with OpenGL
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7657
diff
changeset
|
113 |
|
1932 | 114 |
#ifndef OPENGL |
115 |
# ifdef MESA |
|
116 |
# define OPENGL |
|
117 |
# endif |
|
118 |
#endif |
|
119 |
||
8181
7cd36eb4b09c
X11: fixed `GLXWorkstation` to compile with OpenGL
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7657
diff
changeset
|
120 |
#ifdef OPENGL /* SGI or other OPENGL library */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
121 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
122 |
# include "GL/gl.h" |
8181
7cd36eb4b09c
X11: fixed `GLXWorkstation` to compile with OpenGL
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7657
diff
changeset
|
123 |
# include "GL/glx.h" |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
124 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
125 |
# ifdef MESA /* GNU MESA openGL simulation */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
126 |
# include "GL/xmesa.h" |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
127 |
# define OPENGLCONTEXT XMesaContext |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
128 |
# define GLXMAKECURRENT(dpy, draw, con) XMesaMakeCurrent(con) |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
129 |
# else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
130 |
/* 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
|
131 |
# define OPENGLCONTEXT GLXContext |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
132 |
# 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
|
133 |
# endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
134 |
|
24 | 135 |
#else |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
136 |
|
8181
7cd36eb4b09c
X11: fixed `GLXWorkstation` to compile with OpenGL
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7657
diff
changeset
|
137 |
# ifdef GLX /* SGI native GL library */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
138 |
# include <gl/glws.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
139 |
# include <gl/sphere.h> |
6978 | 140 |
# else /* VOGL GL subset simulation */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
141 |
# undef memset |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
142 |
# include <vogl.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
143 |
# undef move |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
144 |
# include <X11/Xlib.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
145 |
# endif |
24 | 146 |
#endif |
0 | 147 |
|
185 | 148 |
/* |
149 |
* XSGIStereo extension - if available |
|
150 |
*/ |
|
151 |
#ifdef XSGIStereo |
|
152 |
# include <X11/extensions/SGIStereo.h> |
|
153 |
#endif |
|
154 |
||
35 | 155 |
#ifndef NULL |
58 | 156 |
# define NULL (char *)0 /* sigh */ |
35 | 157 |
#endif |
158 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
159 |
|
0 | 160 |
typedef enum { |
161 |
GLXcolorIndexSingleBuffer, |
|
162 |
GLXcolorIndexDoubleBuffer, |
|
163 |
GLXrgbSingleBuffer, |
|
164 |
GLXrgbDoubleBuffer |
|
165 |
} GLXWindowType; |
|
166 |
||
333 | 167 |
# define ENTERGLX __BEGIN_PROTECT_REGISTERS__ |
168 |
# define LEAVEGLX __END_PROTECT_REGISTERS__ |
|
134 | 169 |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
170 |
/* |
8181
7cd36eb4b09c
X11: fixed `GLXWorkstation` to compile with OpenGL
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
7657
diff
changeset
|
171 |
* stupid again - from now on, we need ST/Xs String again |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
172 |
*/ |
0 | 173 |
#undef String |
969 | 174 |
#ifdef __DEF_String |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
175 |
# define String __DEF_String |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
176 |
#endif |
969 | 177 |
#undef Object |
178 |
#ifdef __DEF_Object |
|
179 |
# define Object __DEF_Object |
|
180 |
#endif |
|
0 | 181 |
|
182 |
/* |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
183 |
* mhmh - openGL has its separate gl-context, |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
184 |
* which is distinct (?) from the windowID. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
185 |
* We dont want to add another instvar to View - do we ? |
0 | 186 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
187 |
#if defined(OPENGL) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
188 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
189 |
# ifndef MAX_OPENGL_VIEWS |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
190 |
# define MAX_OPENGL_VIEWS 50 |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
191 |
# endif |
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 |
struct windowIDToGLContextMapping { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
194 |
Window win; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
195 |
OPENGLCONTEXT con; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
196 |
}; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
197 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
198 |
static struct windowIDToGLContextMapping windowIDToGLContextMapping[MAX_OPENGL_VIEWS]; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
199 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
200 |
static OPENGLCONTEXT |
4718 | 201 |
__glxWindowIdToGLContext(xId) |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
202 |
Window xId; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
203 |
{ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
204 |
int i; |
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 |
for (i=0; i<MAX_OPENGL_VIEWS; i++) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
207 |
if (windowIDToGLContextMapping[i].win == xId) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
208 |
return windowIDToGLContextMapping[i].con; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
209 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
210 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
211 |
return (OPENGLCONTEXT) 0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
212 |
} |
0 | 213 |
|
157 | 214 |
/* |
215 |
* set the GLXWindow for followup drawing |
|
216 |
*/ |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
217 |
#define SETWIN(aGLXWindowId) \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
218 |
{ \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
219 |
OPENGLCONTEXT context; \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
220 |
\ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
221 |
if (_INST(activeWindow) != aGLXWindowId) { \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
222 |
if (! ISCONNECTED ) { \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
223 |
RETURN (false); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
224 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
225 |
if (! __isExternalAddress(aGLXWindowId)) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
226 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
227 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
228 |
context = (OPENGLCONTEXT) __glxWindowIdToGLContext(_WindowVal(aGLXWindowId)); \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
229 |
if (! context) { \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
230 |
RETURN (false); \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
231 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
232 |
GLXMAKECURRENT(myDpy, _WindowVal(aGLXWindowId), context ); \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
233 |
_INST(activeWindow) = aGLXWindowId; \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
234 |
__STORE(self, aGLXWindowId); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
235 |
} else { \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
236 |
if (aGLXWindowId == nil) { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
237 |
RETURN (false); \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
238 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
239 |
} \ |
12 | 240 |
} |
241 |
||
553
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 |
#else /* old GL */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
244 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
245 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
246 |
* set the GLXWindow for followup drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
247 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
248 |
#define SETWIN(aGLXWindowId) \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
249 |
{ \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
250 |
if (_INST(activeWindow) != aGLXWindowId) { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
251 |
if (! ISCONNECTED ) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
252 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
253 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
254 |
if (! __isExternalAddress(aGLXWindowId)) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
255 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
256 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
257 |
if (GLXwinset(myDpy, _WindowVal(aGLXWindowId)) < 0) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
258 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
259 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
260 |
_INST(activeWindow) = aGLXWindowId; \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
261 |
__STORE(self, aGLXWindowId); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
262 |
} else { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
263 |
if (aGLXWindowId == nil) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
264 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
265 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
266 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
267 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
268 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
269 |
#endif /* old GL */ |
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 |
* some defines - tired of typing ... |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
273 |
* 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
|
274 |
* put/pack them into corresponding c variables. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
275 |
* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
276 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
277 |
#ifdef OPENGL |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
278 |
# define Boolean int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
279 |
# define TRUE 1 |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
280 |
# define FALSE 0 |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
281 |
# define Coord float |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
282 |
# define Icoord int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
283 |
# define Scoord int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
284 |
# define Colorindex int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
285 |
# define Linestyle int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
286 |
# define Offset int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
287 |
# define Angle int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
288 |
# define Screencoord int |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
289 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
290 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
291 |
#define myDpy (Display *)(__MKCP(_INST(displayId))) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
292 |
#define ISCONNECTED (_INST(displayId) != nil) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
293 |
#define _WindowVal(o) (Window)(__MKCP(o)) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
294 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
295 |
#define __MKBOOLEAN(b) ((b==FALSE) ? false : true) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
296 |
#define _booleanVal(b) ((b==false) ? (Boolean)FALSE : (Boolean)TRUE) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
297 |
#define _coordVal(c) ((__isFloat(c)) ? (Coord)(_floatVal(c)) : (Coord)(__intVal(c))) |
185 | 298 |
#define _icoordVal(c) ((Icoord)(__intVal(c))) |
299 |
#define _scoordVal(c) ((Scoord)(__intVal(c))) |
|
300 |
#define _screencoordVal(c) ((Screencoord)(__intVal(c))) |
|
301 |
#define _colorindexVal(c) ((Colorindex)(__intVal(c))) |
|
302 |
#define _linestyleVal(l) ((Linestyle)(__intVal(l))) |
|
303 |
#define _shortVal(l) ((short)(__intVal(l))) |
|
304 |
#define _longVal(l) ((long)(__intVal(l))) |
|
305 |
#define _deviceVal(l) ((Device)(__intVal(l))) |
|
306 |
#define _tagVal(l) ((Tag)(__intVal(l))) |
|
969 | 307 |
#define _objectVal(l) ((GLX_Object)(__intVal(l))) |
185 | 308 |
#define _offsetVal(l) ((Offset)(__intVal(l))) |
309 |
#define _rgbVal(l) ((RGBvalue)(__intVal(l))) |
|
310 |
#define _angleVal(c) ((Angle)(__intVal(c))) |
|
157 | 311 |
|
29 | 312 |
/* |
313 |
* 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
|
314 |
* ST-object must be true or false. Return from method if invalid. |
29 | 315 |
*/ |
316 |
#define _BOOLEAN_(arg, dst) \ |
|
30 | 317 |
if (arg==true) \ |
77 | 318 |
dst = (Boolean)TRUE; \ |
30 | 319 |
else if (arg==false) \ |
77 | 320 |
dst = (Boolean)FALSE; \ |
29 | 321 |
else { RETURN(false); } |
322 |
||
323 |
/* |
|
324 |
* check for and fetch a coord from ST-arg into C-dst |
|
157 | 325 |
* ST-object must be Float, SmallInteger or Fraction. |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
326 |
* Return from method if invalid. |
29 | 327 |
*/ |
0 | 328 |
#define _COORD_(arg, dst) \ |
97 | 329 |
if (__isFloat(arg)) \ |
77 | 330 |
dst = (Coord)(_floatVal(arg)); \ |
97 | 331 |
else if (__isSmallInteger(arg)) \ |
185 | 332 |
dst = (Coord)(__intVal(arg)); \ |
97 | 333 |
else if (__isFraction(arg) \ |
334 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_numerator) \ |
|
335 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_denominator)) { \ |
|
77 | 336 |
float n, d; \ |
337 |
\ |
|
185 | 338 |
n = (float)(__intVal(_FractionInstPtr(arg)->f_numerator)); \ |
339 |
d = (float)(__intVal(_FractionInstPtr(arg)->f_denominator)); \ |
|
77 | 340 |
dst = (Coord)(n / d); \ |
29 | 341 |
} else { RETURN(false); } |
342 |
||
343 |
/* |
|
344 |
* check for and fetch an icoord from ST-arg into C-dst |
|
4718 | 345 |
* ST-object must be SmallInteger. Return from method if invalid. |
29 | 346 |
*/ |
347 |
#define _ICOORD_(arg, dst) \ |
|
97 | 348 |
if (__isSmallInteger(arg)) \ |
185 | 349 |
dst = (Icoord)(__intVal(arg)); \ |
29 | 350 |
else { RETURN(false); } |
351 |
||
352 |
/* |
|
157 | 353 |
* check for and fetch an scoord from ST-arg into C-dst |
4718 | 354 |
* ST-object must be SmallInteger. Return from method if invalid. |
29 | 355 |
*/ |
356 |
#define _SCOORD_(arg, dst) \ |
|
97 | 357 |
if (__isSmallInteger(arg)) \ |
185 | 358 |
dst = (Scoord)(__intVal(arg)); \ |
29 | 359 |
else { RETURN(false); } |
360 |
||
361 |
#define _SCREENCOORD_(arg, dst) \ |
|
97 | 362 |
if (__isSmallInteger(arg)) \ |
185 | 363 |
dst = (Screencoord)(__intVal(arg)); \ |
29 | 364 |
else { RETURN(false); } |
365 |
||
366 |
#define _COLORINDEX_(arg, dst) \ |
|
97 | 367 |
if (__isSmallInteger(arg)) \ |
185 | 368 |
dst = (Colorindex)(__intVal(arg)); \ |
29 | 369 |
else { RETURN(false); } |
370 |
||
371 |
#define _ANGLE_(arg, dst) \ |
|
97 | 372 |
if (__isSmallInteger(arg)) \ |
185 | 373 |
dst = (Angle)(__intVal(arg)); \ |
29 | 374 |
else { RETURN(false); } |
0 | 375 |
|
376 |
#define _FLOAT_(arg, dst) \ |
|
97 | 377 |
if (__isFloat(arg)) \ |
77 | 378 |
dst = (float)(_floatVal(arg)); \ |
97 | 379 |
else if (__isSmallInteger(arg)) \ |
185 | 380 |
dst = (float)(__intVal(arg)); \ |
97 | 381 |
else if (__isFraction(arg) \ |
382 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_numerator) \ |
|
383 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_denominator)) { \ |
|
77 | 384 |
float n, d; \ |
385 |
\ |
|
185 | 386 |
n = (float)(__intVal(_FractionInstPtr(arg)->f_numerator)); \ |
387 |
d = (float)(__intVal(_FractionInstPtr(arg)->f_denominator)); \ |
|
77 | 388 |
dst = (float)(n / d); \ |
29 | 389 |
} else { RETURN(false); } |
0 | 390 |
|
391 |
#define _INT_(arg, dst) \ |
|
97 | 392 |
if (__isSmallInteger(arg)) \ |
185 | 393 |
dst = (int)(__intVal(arg)); \ |
29 | 394 |
else { RETURN(false); } |
395 |
||
30 | 396 |
#define _indexedArea(object) \ |
397 |
(((char *) (_InstPtr(object))) \ |
|
77 | 398 |
+ OHDR_SIZE \ |
185 | 399 |
+ (__intVal(_ClassInstPtr(__qClass(object))->c_ninstvars)) * sizeof(OBJ)) |
77 | 400 |
%} |
401 |
! ! |
|
402 |
||
168 | 403 |
!GLXWorkstation primitiveVariables! |
404 |
%{ |
|
405 |
/* |
|
406 |
* remembered info from private error handler |
|
407 |
*/ |
|
4164
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
408 |
static char lastErrorMsg[128] = ""; |
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
409 |
static unsigned INT lastRequestCode = 0; |
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
410 |
static unsigned INT lastMinorCode = 0; |
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
411 |
static unsigned INT lastResource = 0; |
168 | 412 |
|
413 |
%} |
|
414 |
! ! |
|
415 |
||
89 | 416 |
!GLXWorkstation primitiveFunctions! |
77 | 417 |
%{ |
151 | 418 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
419 |
#ifdef DYNAMICALLY_LOADABLE |
168 | 420 |
/* |
421 |
* catch X-errors and forward as errorInterrupt:#DisplayError, |
|
4251 | 422 |
* (which itself invokes my handler and optionally raises an exception) |
168 | 423 |
* the implementation below is somewhat wrong: it will |
424 |
* report all errors for Display, even though there could be |
|
425 |
* more than one display connection. (being fixed, new errorInterrupt mechanism |
|
426 |
* allows passing an additional argument, which is the displayID ...) |
|
427 |
* |
|
4251 | 428 |
* this duplicates the functionality as found in XWorkstation; |
168 | 429 |
* the reason is to allow dynamic loading systems to load this module |
430 |
* before XWorkstation (which was not possible otherwise, due to unresolved |
|
431 |
* external references while loading this one) |
|
432 |
*/ |
|
433 |
static |
|
434 |
__XErrorHandler__(dpy, event) |
|
435 |
Display *dpy; |
|
436 |
XErrorEvent *event; |
|
437 |
{ |
|
438 |
XGetErrorText(dpy, event->error_code, lastErrorMsg, 80); |
|
439 |
if (lastErrorMsg[0] == '\0') { |
|
4718 | 440 |
sprintf(lastErrorMsg, "code: %d", event->error_code); |
168 | 441 |
} |
442 |
lastRequestCode = event->request_code; |
|
443 |
lastMinorCode = event->minor_code; |
|
444 |
lastResource = event->resourceid; |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
445 |
if ((event->error_code == BadWindow) && (lastRequestCode == 4) && (lastMinorCode == 0)) { |
4718 | 446 |
/* |
447 |
* this is a BadWindow error for X_DestroyWindow. |
|
448 |
* ignore it here, since it results from the GC freeing windows |
|
449 |
* in non bottom-up window order. |
|
450 |
*/ |
|
451 |
return 0; |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
452 |
} |
168 | 453 |
|
218
10072d9beba5
can now turn off Xlib error messages from the errorHandler
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
454 |
if (@global(ErrorPrinting) == true) { |
4718 | 455 |
console_fprintf(stderr, "GLXWORKSTAT: x-error caught maj=%d (0x%x) min=%d (0x%x) resource=%x\n", |
456 |
event->request_code, event->request_code, |
|
457 |
event->minor_code, event->minor_code, event->resourceid); |
|
458 |
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
|
459 |
} |
168 | 460 |
|
207
9124817bbb03
use new c-pointer wrapper macros (based on externalAddress)
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
461 |
__errorInterruptWithIDAndParameter__(@symbol(DisplayError), __MKOBJ(dpy)); |
168 | 462 |
return 0; |
463 |
} |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
464 |
#else |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
465 |
extern __XErrorHandler__(); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
466 |
#endif |
168 | 467 |
|
4718 | 468 |
/* |
151 | 469 |
* begin moved from GLXsupport.c |
470 |
*/ |
|
471 |
||
472 |
/* |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
473 |
* This provides a helper function "GLXCreateWindow", which does |
4718 | 474 |
* all the necessary magic to create an X window suitable for GL drawing |
475 |
* to take place within. See the definition of GLXCreateWindow for a |
|
151 | 476 |
* description of how to call it. |
477 |
* |
|
478 |
* claus: I really had no time to look into all this, |
|
479 |
* this file has been just copied from a 4Dgifts demo .. |
|
480 |
* (will need more than a day to show more ...) |
|
481 |
*/ |
|
1932 | 482 |
#if !defined(OPENGL) |
151 | 483 |
|
1899 | 484 |
# include <X11/Xlib.h> |
485 |
# include <X11/Xutil.h> |
|
486 |
# ifndef VGL |
|
4718 | 487 |
# include <gl/glws.h> |
1899 | 488 |
# endif |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
489 |
# ifndef _SIGNAL_H_INCLUDED_ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
490 |
# include <signal.h> |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
491 |
# endif |
1899 | 492 |
# include <setjmp.h> |
493 |
# include "stcIntern.h" |
|
151 | 494 |
|
495 |
/* |
|
496 |
* glxhelper.h: |
|
497 |
* |
|
498 |
* List of drawing modes supported by GLXCreateWindow (in glxhelper.c). |
|
4718 | 499 |
* More than this are possible with mixed model, but this is just an |
500 |
* example. You can either expand this list (and the corresponding code in |
|
501 |
* GLXCreateWindow) or call the mixed model calls yourself, using |
|
151 | 502 |
* GLXCreateWindow as an example. |
503 |
*/ |
|
504 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
505 |
static char * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
506 |
typeToName[] = { |
151 | 507 |
"color index single buffer", |
508 |
"color index double buffer", |
|
509 |
"rgb single buffer", |
|
510 |
"rgb double buffer", |
|
511 |
}; |
|
512 |
||
1932 | 513 |
#endif /* GLX || VGL */ |
514 |
||
515 |
#if defined(GLX) && !defined(VGL) |
|
151 | 516 |
/* |
517 |
* Dorky little helper function used to build up a GLXconfig array. |
|
518 |
*/ |
|
519 |
||
4718 | 520 |
static void |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
521 |
set_entry (GLXconfig* ptr, int b, int m, int a) |
151 | 522 |
{ |
523 |
ptr->buffer = b; |
|
524 |
ptr->mode = m; |
|
525 |
ptr->arg = a; |
|
526 |
} |
|
1932 | 527 |
#endif /* GLX & not VGL */ |
151 | 528 |
|
4711 | 529 |
static stx_jmp_buf errorReturn; |
151 | 530 |
|
531 |
static void |
|
532 |
glAbort() { |
|
6002 | 533 |
stx_longjmp(errorReturn, 1); |
151 | 534 |
} |
535 |
||
536 |
/* |
|
537 |
* GLXCreateWindow(dpy, parent, x, y, w, h, boderWidth, type) |
|
538 |
* |
|
539 |
* Return value is the X window id of the newly created window. |
|
540 |
* |
|
541 |
* Arguments are: |
|
542 |
* dpy The X "Display*" returned by XOpenDisplay |
|
543 |
* parent The parent of the newly created window, |
|
544 |
* a typical value for this is |
|
545 |
* RootWindow(dpy, DefaultScreen(dpy)) |
|
546 |
* x,y The location of the window to be created, |
|
547 |
* y coordinate is measured from the top down. |
|
548 |
* w,h size of the new window |
|
549 |
* borderWidth the X border size for this window, should probably |
|
550 |
* be zero. |
|
551 |
* type the GLXWindowType (see glxhelper.h) desribing the |
|
552 |
* typer of GL drawing to be done in this window |
|
553 |
*/ |
|
4718 | 554 |
Window |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
555 |
__GLXCreateWindow(dpy, parent, x, y, w, h, borderWidth, type) |
151 | 556 |
Display* dpy; |
557 |
Window parent; |
|
558 |
GLXWindowType type; |
|
559 |
{ |
|
1932 | 560 |
#if !defined(OPENGL) |
561 |
# ifndef VGL |
|
151 | 562 |
GLXconfig params[50]; |
563 |
GLXconfig* next; |
|
564 |
GLXconfig* retconfig; |
|
565 |
Colormap cmap = DefaultColormap(dpy, DefaultScreen(dpy)); |
|
1932 | 566 |
# endif |
567 |
#endif |
|
568 |
Visual visual; |
|
151 | 569 |
XVisualInfo *vis; |
570 |
XVisualInfo template; |
|
571 |
XColor white; |
|
572 |
XSetWindowAttributes cwa; |
|
573 |
XWindowAttributes pwa; |
|
574 |
int scr, i, nret; |
|
575 |
Window win; |
|
1932 | 576 |
#ifdef HAS_SIGACTION |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
577 |
struct sigaction oldSigSegv, newSigSegv; |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
578 |
#else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
579 |
void *oldSigSegv; |
1932 | 580 |
#endif |
581 |
||
582 |
#if !defined(OPENGL) |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
583 |
__catchExit(1); |
1932 | 584 |
#endif |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
585 |
|
6002 | 586 |
if (stx_setjmp(errorReturn)) { |
4718 | 587 |
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
|
588 |
#ifdef SIGSEGV |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
589 |
# ifdef HAS_SIGACTION |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
590 |
sigaction(SIGSEGV, &oldSigSegv, 0); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
591 |
# else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
592 |
signal(SIGSEGV, oldSigSegv); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
593 |
# endif |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
594 |
#endif |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
595 |
|
1932 | 596 |
#if !defined(OPENGL) |
4718 | 597 |
__catchExit(0); |
598 |
#endif |
|
599 |
return 0; |
|
151 | 600 |
} |
601 |
__CONT__ |
|
602 |
||
1932 | 603 |
if (w <= 0) { |
4718 | 604 |
console_fprintf(stderr, "GL: bad width: %d\n", w); |
605 |
w = 1; |
|
1932 | 606 |
} |
607 |
if (h <= 0) { |
|
4718 | 608 |
console_fprintf(stderr, "GL: bad height: %d\n", h); |
609 |
h = 1; |
|
1932 | 610 |
} |
611 |
||
612 |
#if !defined(OPENGL) |
|
1899 | 613 |
# ifdef VGL |
151 | 614 |
/* |
615 |
* I know what VGL supports; its somewhat unclean to hard code it here |
|
616 |
*/ |
|
617 |
switch (type) { |
|
618 |
case GLXcolorIndexSingleBuffer: |
|
619 |
case GLXcolorIndexDoubleBuffer: |
|
4718 | 620 |
break; |
151 | 621 |
|
622 |
case GLXrgbSingleBuffer: |
|
623 |
case GLXrgbDoubleBuffer: |
|
4718 | 624 |
console_fprintf(stderr, "Sorry, VGL can't support %s type of windows\n", typeToName[type]); |
625 |
__catchExit(0); |
|
626 |
return 0; |
|
151 | 627 |
} |
628 |
||
629 |
scr = DefaultScreen(dpy); |
|
630 |
visual.visualid = CopyFromParent; |
|
631 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
632 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
4718 | 633 |
borderWidth, DisplayPlanes(dpy, scr), |
634 |
InputOutput, &visual, |
|
635 |
CWBorderPixel, &cwa); |
|
151 | 636 |
|
637 |
/* |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
638 |
* on some, seg-violations occur in the GL, if too many |
151 | 639 |
* views are created ... just to make certain, we catch those |
640 |
* in GL too. |
|
641 |
*/ |
|
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
642 |
# ifdef SIGSEGV |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
643 |
# ifdef HAS_SIGACTION |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
644 |
sigaction(SIGSEGV, (struct sigaction *)0, &oldSigSegv); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
645 |
newSigSegv = oldSigSegv; |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
646 |
newSigSegv.sa_handler = glAbort; |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
647 |
sigaction(SIGSEGV, &newSigSegv, (struct sigaction *)0); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
648 |
# else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
649 |
oldSigSegv = signal(SIGSEGV, glAbort); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
650 |
# endif |
1899 | 651 |
# endif |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
652 |
|
151 | 653 |
i = GLXlink(dpy, win); |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
654 |
|
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
655 |
# ifdef SIGSEGV |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
656 |
# ifdef HAS_SIGACTION |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
657 |
sigaction(SIGSEGV, &oldSigSegv, (struct sigaction *)0); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
658 |
# else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
659 |
signal(SIGSEGV, oldSigSegv); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
660 |
# endif |
1899 | 661 |
# endif |
151 | 662 |
|
663 |
if (i < 0) { |
|
4718 | 664 |
console_fprintf(stderr, "GLXlink returned %d\n", i); |
665 |
__catchExit(0); |
|
666 |
return 0; |
|
151 | 667 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
668 |
|
1899 | 669 |
# else /* not VGL */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
670 |
|
151 | 671 |
/* |
672 |
* This builds an array in "params" that describes for GLXgetconfig(3G) |
|
673 |
* the type of GL drawing that will be done. |
|
674 |
*/ |
|
675 |
next = params; |
|
676 |
switch (type) { |
|
677 |
case GLXcolorIndexSingleBuffer: |
|
4718 | 678 |
set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE); |
679 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE); |
|
680 |
break; |
|
151 | 681 |
case GLXcolorIndexDoubleBuffer: |
4718 | 682 |
set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE); |
683 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE); |
|
684 |
break; |
|
151 | 685 |
case GLXrgbSingleBuffer: |
4718 | 686 |
set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE); |
687 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE); |
|
688 |
break; |
|
151 | 689 |
case GLXrgbDoubleBuffer: |
4718 | 690 |
set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE); |
691 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE); |
|
692 |
break; |
|
151 | 693 |
} |
694 |
set_entry(next, 0, 0, 0); /* The input to GLXgetconfig is null terminated */ |
|
695 |
||
696 |
/* |
|
697 |
* Get configuration data for a window based on above parameters |
|
698 |
* First we have to find out which screen the parent window is on, |
|
699 |
* then we can call GXLgetconfig() |
|
700 |
*/ |
|
701 |
XGetWindowAttributes(dpy, parent, &pwa); |
|
702 |
retconfig = GLXgetconfig(dpy, XScreenNumberOfScreen(pwa.screen), params); |
|
703 |
if (retconfig == 0) { |
|
4718 | 704 |
console_fprintf(stderr, "Sorry, can't support %s type of windows\n", typeToName[type]); |
705 |
__catchExit(0); |
|
706 |
return 0; |
|
151 | 707 |
} |
708 |
||
709 |
/* |
|
710 |
* Scan through config info, pulling info needed to create a window |
|
711 |
* that supports the rendering mode. |
|
712 |
*/ |
|
713 |
for (next = retconfig; next->buffer; next++) { |
|
4718 | 714 |
unsigned long buffer = next->buffer; |
715 |
unsigned long mode = next->mode; |
|
716 |
unsigned long value = next->arg; |
|
717 |
switch (mode) { |
|
718 |
case GLX_COLORMAP: |
|
719 |
if (buffer == GLX_NORMAL) { |
|
720 |
cmap = value; |
|
721 |
} |
|
722 |
break; |
|
723 |
case GLX_VISUAL: |
|
724 |
if (buffer == GLX_NORMAL) { |
|
725 |
template.visualid = value; |
|
726 |
template.screen = DefaultScreen(dpy); |
|
727 |
vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask, |
|
728 |
&template, &nret); |
|
729 |
} |
|
730 |
break; |
|
731 |
} |
|
151 | 732 |
} |
733 |
||
734 |
/* |
|
735 |
* Create the window |
|
736 |
*/ |
|
737 |
cwa.colormap = cmap; |
|
738 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
739 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
4718 | 740 |
borderWidth, vis->depth, InputOutput, vis->visual, |
741 |
CWColormap|CWBorderPixel, &cwa); |
|
151 | 742 |
|
743 |
/* |
|
744 |
* Rescan configuration info and find window slot that getconfig |
|
745 |
* provided. Fill it in with the window we just created. |
|
746 |
*/ |
|
747 |
for (next = retconfig; next->buffer; next++) { |
|
4718 | 748 |
if ((next->buffer == GLX_NORMAL) && (next->mode == GLX_WINDOW)) { |
749 |
next->arg = win; |
|
750 |
break; |
|
751 |
} |
|
151 | 752 |
} |
753 |
||
754 |
/* |
|
755 |
* Now "retconfig" contains all the information the GL needs to |
|
756 |
* configure the window and its own internal state. |
|
757 |
*/ |
|
758 |
/* |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
759 |
* on iris, seg-violations occur in the GL, if too many |
151 | 760 |
* views are created ... |
761 |
*/ |
|
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
762 |
# ifdef SIGSEGV |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
763 |
# ifdef HAS_SIGACTION |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
764 |
sigaction(SIGSEGV, (struct sigaction *)0, &oldSigSegv); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
765 |
newSigSegv = oldSigSegv; |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
766 |
newSigSegv.sa_handler = glAbort; |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
767 |
sigaction(SIGSEGV, &newSigSegv, (struct sigaction *)0); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
768 |
# else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
769 |
oldSigSegv = signal(SIGSEGV, glAbort); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
770 |
# endif |
1899 | 771 |
# endif |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
772 |
|
151 | 773 |
i = GLXlink(dpy, retconfig); |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
774 |
|
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
775 |
# ifdef SIGSEGV |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
776 |
# ifdef HAS_SIGACTION |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
777 |
sigaction(SIGSEGV, &oldSigSegv, (struct sigaction *)0); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
778 |
# else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
779 |
signal(SIGSEGV, oldSigSegv); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
780 |
# endif |
1899 | 781 |
# endif |
151 | 782 |
|
783 |
if (i < 0) { |
|
4718 | 784 |
console_fprintf(stderr, "GLXlink returned %d\n", i); |
785 |
__catchExit(0); |
|
786 |
return 0; |
|
151 | 787 |
} |
788 |
||
789 |
/* |
|
790 |
* The GL sets its own X error handlers, which exits - this is not what we want |
|
791 |
*/ |
|
792 |
XSetErrorHandler(__XErrorHandler__); |
|
1899 | 793 |
# endif /* not VGL */ |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
794 |
__catchExit(0); |
1932 | 795 |
|
796 |
#else /* OPENGL | MESA */ |
|
797 |
||
798 |
scr = DefaultScreen(dpy); |
|
799 |
visual.visualid = CopyFromParent; |
|
800 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
801 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
4718 | 802 |
borderWidth, DisplayPlanes(dpy, scr), |
803 |
InputOutput, &visual, |
|
804 |
CWBorderPixel, &cwa); |
|
1932 | 805 |
|
806 |
vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask, &visual, &nret); |
|
4718 | 807 |
console_fprintf(stderr, "vis is %x\n", vis); |
1932 | 808 |
#endif /* GLX || VGL */ |
809 |
||
151 | 810 |
return win; |
811 |
} |
|
812 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
813 |
__GLXUnlinkWindow(dpy, win) |
151 | 814 |
Display* dpy; |
815 |
Window win; |
|
816 |
{ |
|
817 |
/* |
|
818 |
* only needed for VGL - GLX does it automatically |
|
819 |
*/ |
|
1932 | 820 |
#ifdef VGL |
151 | 821 |
GLXunlink(dpy, win); |
1932 | 822 |
#endif |
151 | 823 |
} |
824 |
||
29 | 825 |
/* |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
826 |
* helper for rotation - calls rot() |
29 | 827 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
828 |
OBJ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
829 |
__glx_doRotate(angle, axis) |
29 | 830 |
OBJ angle; |
831 |
char axis; |
|
832 |
{ |
|
833 |
float f_angle; |
|
834 |
||
35 | 835 |
if (__isFloat(angle)) { |
4718 | 836 |
f_angle = (float)(_floatVal(angle)); |
837 |
if (f_angle != 0.0) { |
|
838 |
#ifdef OPENGL |
|
839 |
#else |
|
840 |
rot(f_angle, axis); |
|
841 |
#endif |
|
842 |
} |
|
843 |
return (true); |
|
29 | 844 |
} |
35 | 845 |
if (__isFraction(angle) |
97 | 846 |
&& __isSmallInteger(_FractionInstPtr(angle)->f_numerator) |
847 |
&& __isSmallInteger(_FractionInstPtr(angle)->f_denominator)) { |
|
4718 | 848 |
float n, d; |
849 |
||
850 |
n = (float)(__intVal(_FractionInstPtr(angle)->f_numerator)); |
|
851 |
d = (float)(__intVal(_FractionInstPtr(angle)->f_denominator)); |
|
852 |
f_angle = n / d; |
|
853 |
if (f_angle != 0.0) { |
|
854 |
#ifdef OPENGL |
|
855 |
#else |
|
856 |
rot(f_angle, axis); |
|
857 |
#endif |
|
858 |
} |
|
859 |
return (true); |
|
29 | 860 |
} |
97 | 861 |
if (__isSmallInteger(angle)) { |
4718 | 862 |
f_angle = (float)(__intVal(angle)); |
863 |
if (f_angle != 0.0) { |
|
864 |
#ifdef OPENGL |
|
865 |
#else |
|
866 |
rot(f_angle, axis); |
|
867 |
#endif |
|
868 |
} |
|
869 |
return (true); |
|
29 | 870 |
} |
871 |
return false; |
|
872 |
} |
|
0 | 873 |
|
24 | 874 |
/* |
29 | 875 |
* fetch integers from an st-array (elements must be smallIntegers) |
876 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
877 |
long * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
878 |
__glx_getLongsFromInto(obj, vec, count) |
29 | 879 |
OBJ obj; |
880 |
long *vec; |
|
881 |
{ |
|
882 |
OBJ cls, o; |
|
883 |
int nByte, i, ninstVars, nInstBytes; |
|
884 |
char *pElem; |
|
885 |
||
886 |
if (! _isNonNilObject(obj)) return (long *)NULL; |
|
134 | 887 |
cls = __qClass(obj); |
185 | 888 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 889 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 890 |
nByte = __qSize(obj) - nInstBytes; |
29 | 891 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
892 |
if (nByte < (count * sizeof(OBJ))) return (long *)NULL; |
|
893 |
for (i=0; i<count; i++) { |
|
4718 | 894 |
o = *(OBJ *)pElem; |
895 |
if (! __isSmallInteger(o)) return (long *)NULL; |
|
896 |
vec[i] = (long)__intVal(o); |
|
897 |
pElem += sizeof(OBJ); |
|
29 | 898 |
} |
899 |
return vec; |
|
900 |
} |
|
901 |
||
902 |
/* |
|
903 |
* fetch shorts from an st-array (elements must be smallIntegers) |
|
904 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
905 |
short * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
906 |
__glx_getShortsFromInto(obj, vec, count) |
29 | 907 |
OBJ obj; |
908 |
short *vec; |
|
909 |
{ |
|
910 |
OBJ cls, o; |
|
911 |
int nByte, i, ninstVars, nInstBytes; |
|
912 |
char *pElem; |
|
913 |
||
914 |
if (! _isNonNilObject(obj)) return (short *)NULL; |
|
134 | 915 |
cls = __qClass(obj); |
185 | 916 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 917 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 918 |
nByte = __qSize(obj) - nInstBytes; |
29 | 919 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
920 |
if (nByte < (count * sizeof(OBJ))) return (short *)NULL; |
|
921 |
for (i=0; i<count; i++) { |
|
4718 | 922 |
o = *(OBJ *)pElem; |
923 |
if (! __isSmallInteger(o)) return (short *)NULL; |
|
924 |
vec[i] = (short)__intVal(o); |
|
925 |
pElem += sizeof(OBJ); |
|
29 | 926 |
} |
927 |
return vec; |
|
928 |
} |
|
929 |
||
930 |
/* |
|
4718 | 931 |
* fetch floats from an st-object into a c-float array |
29 | 932 |
* which may be a floatArray, doubleArray or array-of-something, |
933 |
* where something may be a float, fraction or smallInteger, |
|
24 | 934 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
935 |
float * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
936 |
__glx_getFloatsFromInto(obj, vec, count) |
12 | 937 |
OBJ obj; |
938 |
float *vec; |
|
939 |
{ |
|
940 |
OBJ cls; |
|
941 |
int nByte; |
|
942 |
OBJ o; |
|
943 |
int i, ninstVars, nInstBytes; |
|
944 |
char *pElem; |
|
945 |
||
946 |
if (! _isNonNilObject(obj)) return (float *)0; |
|
947 |
||
134 | 948 |
cls = __qClass(obj); |
185 | 949 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
12 | 950 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 951 |
nByte = __qSize(obj) - nInstBytes; |
12 | 952 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
953 |
||
185 | 954 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
12 | 955 |
case FLOATARRAY: |
4718 | 956 |
/* |
957 |
* best speed for float array |
|
958 |
* - the data is already as we want it |
|
959 |
*/ |
|
960 |
if (nByte < (count * sizeof(float))) return (float *)0; |
|
961 |
return (float *)pElem; |
|
12 | 962 |
|
963 |
case DOUBLEARRAY: |
|
4718 | 964 |
/* |
965 |
* for double array, have to copy-and-cast |
|
966 |
*/ |
|
967 |
if (nByte < (count * sizeof(double))) return (float *)0; |
|
968 |
for (i=0; i<count; i++) { |
|
969 |
vec[i] = *((double *)pElem); |
|
970 |
pElem += sizeof(double); |
|
971 |
} |
|
972 |
return vec; |
|
12 | 973 |
|
974 |
case POINTERARRAY: |
|
4718 | 975 |
/* |
976 |
* for other array, have to fetch, check and store |
|
977 |
* the elements can be floats, smallintegers or fractions |
|
978 |
*/ |
|
979 |
if (nByte < (count * sizeof(OBJ))) return (float *)0; |
|
980 |
/* get elements one-by-one */ |
|
981 |
for (i=0; i<count; i++) { |
|
982 |
o = *(OBJ *)pElem; |
|
983 |
if (__isFloat(o)) { |
|
984 |
vec[i] = _floatVal(o); |
|
985 |
} else if (__isSmallInteger(o)) { |
|
986 |
vec[i] = (float)(__intVal(o)); |
|
987 |
} else if (__isFraction(o) |
|
988 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
|
989 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
990 |
float n, d; |
|
991 |
||
992 |
n = (float)(__intVal(_FractionInstPtr(o)->f_numerator)); |
|
993 |
d = (float)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
994 |
vec[i] = n / d; |
|
995 |
} else |
|
996 |
return 0; |
|
997 |
pElem += sizeof(OBJ); |
|
998 |
} |
|
999 |
return vec; |
|
12 | 1000 |
} |
1001 |
return (float *)0; |
|
1002 |
} |
|
1003 |
||
29 | 1004 |
/* |
4718 | 1005 |
* fetch doubles from an st-object into a c-double array |
29 | 1006 |
* which may be a floatArray, doubleArray or array-of-something, |
1007 |
* where something may be a float, fraction or smallInteger, |
|
1008 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1009 |
double * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1010 |
__glx_getDoublesFromInto(obj, vec, count) |
29 | 1011 |
OBJ obj; |
1012 |
double *vec; |
|
1013 |
{ |
|
1014 |
OBJ cls, o; |
|
1015 |
int nByte, i, ninstVars, nInstBytes; |
|
1016 |
char *pElem; |
|
1017 |
||
1018 |
if (! _isNonNilObject(obj)) return (double *)0; |
|
134 | 1019 |
cls = __qClass(obj); |
185 | 1020 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 1021 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1022 |
nByte = __qSize(obj) - nInstBytes; |
29 | 1023 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1024 |
||
185 | 1025 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
29 | 1026 |
case DOUBLEARRAY: |
4718 | 1027 |
/* best speed for double array - the data is already as we want it */ |
1028 |
if (nByte < (count * sizeof(double))) return (double *)0; |
|
1029 |
return (double *)pElem; |
|
29 | 1030 |
|
1031 |
case FLOATARRAY: |
|
4718 | 1032 |
if (nByte < (count * sizeof(float))) return (double *)0; |
1033 |
for (i=0; i<count; i++) { |
|
1034 |
vec[i] = *((float *)pElem); |
|
1035 |
pElem += sizeof(float); |
|
1036 |
} |
|
1037 |
return vec; |
|
29 | 1038 |
|
1039 |
case POINTERARRAY: |
|
4718 | 1040 |
if (nByte < (count * sizeof(OBJ))) return (double *)0; |
1041 |
/* get elements one-by-one */ |
|
1042 |
for (i=0; i<count; i++) { |
|
1043 |
o = *(OBJ *)pElem; |
|
1044 |
if (__isFloat(o)) |
|
1045 |
vec[i] = _floatVal(o); |
|
1046 |
else if (__isSmallInteger(o)) |
|
1047 |
vec[i] = (double)(__intVal(o)); |
|
1048 |
else if (__isFraction(o) |
|
1049 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
|
1050 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
1051 |
double n, d; |
|
1052 |
||
1053 |
n = (double)(__intVal(_FractionInstPtr(o)->f_numerator)); |
|
1054 |
d = (double)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
1055 |
vec[i] = n / d; |
|
1056 |
||
1057 |
} else |
|
1058 |
return 0; |
|
1059 |
pElem += sizeof(OBJ); |
|
1060 |
} |
|
1061 |
return vec; |
|
29 | 1062 |
} |
1063 |
return (double *)0; |
|
1064 |
} |
|
1065 |
||
1066 |
/* |
|
1067 |
* move from a c-float array into an st-object, |
|
1068 |
* the st-object MUST be either a float- or double array |
|
1069 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1070 |
__glx_putFloatsFromInto(vec, obj, count) |
12 | 1071 |
OBJ obj; |
1072 |
float *vec; |
|
1073 |
{ |
|
1074 |
OBJ cls; |
|
1075 |
int nByte; |
|
1076 |
OBJ o; |
|
1077 |
int i, ninstVars, nInstBytes; |
|
1078 |
char *pElem; |
|
1079 |
||
1080 |
if (! _isNonNilObject(obj)) return 0; |
|
1081 |
||
134 | 1082 |
cls = __qClass(obj); |
185 | 1083 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
12 | 1084 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1085 |
nByte = __qSize(obj) - nInstBytes; |
12 | 1086 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1087 |
||
185 | 1088 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
12 | 1089 |
case FLOATARRAY: |
4718 | 1090 |
if (nByte < (count * sizeof(float))) return 0; |
1091 |
for (i=0; i<count; i++) { |
|
1092 |
*(float *)pElem = vec[i]; |
|
1093 |
pElem += sizeof(float); |
|
1094 |
} |
|
1095 |
return 1; |
|
12 | 1096 |
|
1097 |
case DOUBLEARRAY: |
|
4718 | 1098 |
if (nByte < (count * sizeof(float))) return 0; |
1099 |
for (i=0; i<count; i++) { |
|
1100 |
*(double *)pElem = vec[i]; |
|
1101 |
pElem += sizeof(double); |
|
1102 |
} |
|
1103 |
return 1; |
|
12 | 1104 |
} |
1105 |
/* not implemented for others */ |
|
1106 |
||
1107 |
return 0; |
|
1108 |
} |
|
1109 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1110 |
#ifndef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1111 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1112 |
Matrix * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1113 |
__glx_getFloatsFromMatrixInto(obj, mp) |
12 | 1114 |
OBJ obj; |
1115 |
Matrix *mp; |
|
1116 |
{ |
|
1117 |
OBJ cls; |
|
1118 |
int nByte; |
|
1119 |
OBJ o; |
|
29 | 1120 |
int ninstVars, nInstBytes; |
1121 |
char *pElem; |
|
1122 |
int x = 0; |
|
1123 |
int i,j; |
|
12 | 1124 |
|
1125 |
if (! _isNonNilObject(obj)) return (Matrix *)0; |
|
1126 |
||
134 | 1127 |
cls = __qClass(obj); |
185 | 1128 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 1129 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1130 |
nByte = __qSize(obj) - nInstBytes; |
29 | 1131 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1132 |
||
185 | 1133 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
4718 | 1134 |
case FLOATARRAY: |
1135 |
/* |
|
1136 |
* very easy for FLOATARRAY objects - no copying needed |
|
1137 |
*/ |
|
1138 |
if (nByte < (16 * sizeof(float))) return (Matrix *)0; |
|
1139 |
return (Matrix *) _FloatArrayInstPtr(obj)->f_element; |
|
1140 |
||
1141 |
case DOUBLEARRAY: |
|
1142 |
/* |
|
1143 |
* for DOUBLEARRAY objects copy and cast |
|
1144 |
*/ |
|
1145 |
if (nByte < (16 * sizeof(double))) return (Matrix *)0; |
|
1146 |
for (i=0; i<4; i++) { |
|
1147 |
for (j=0; j<4; j++) { |
|
1148 |
(*mp)[i][j] = _DoubleArrayInstPtr(obj)->d_element[x]; |
|
1149 |
x++; |
|
1150 |
} |
|
1151 |
} |
|
1152 |
return mp; |
|
1153 |
||
1154 |
case POINTERARRAY: |
|
1155 |
if (nByte < (16 * sizeof(OBJ))) return (Matrix *)0; |
|
1156 |
/* |
|
1157 |
* get elements one-by-one |
|
1158 |
*/ |
|
1159 |
for (i=0; i<4; i++) { |
|
1160 |
for (j=0; j<4; j++) { |
|
1161 |
o = _ArrayInstPtr(obj)->a_element[x]; |
|
1162 |
if (__isFloat(o)) { |
|
1163 |
(*mp)[i][j] = _floatVal(o); |
|
1164 |
} else if (__isSmallInteger(o)) { |
|
1165 |
(*mp)[i][j] = (double)__intVal(o); |
|
1166 |
} else if (__isFraction(o) |
|
1167 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
|
1168 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
1169 |
double n, d; |
|
1170 |
||
1171 |
n = (double)(__intVal(_FractionInstPtr(o)->f_numerator)); |
|
1172 |
d = (double)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
1173 |
(*mp)[i][j] = n / d; |
|
1174 |
} else |
|
1175 |
return (Matrix *)0; |
|
1176 |
x++; |
|
1177 |
} |
|
1178 |
} |
|
1179 |
return mp; |
|
12 | 1180 |
} |
1181 |
return (Matrix *)0; |
|
1182 |
} |
|
1183 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1184 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1185 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1186 |
float* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1187 |
__glx_getFloatsFromFloatArrayInto(obj, fp) |
46 | 1188 |
OBJ obj; |
1189 |
float *fp; |
|
1190 |
{ |
|
1191 |
OBJ cls; |
|
1192 |
int ninstVars; |
|
1193 |
||
1194 |
if (! _isNonNilObject(obj)) return (float *)0; |
|
134 | 1195 |
cls = __qClass(obj); |
350 | 1196 |
if (cls == @global(FloatArray)) |
4718 | 1197 |
return _FloatArrayInstPtr(obj)->f_element; |
46 | 1198 |
|
185 | 1199 |
if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) { |
4718 | 1200 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
1201 |
return (float *) &(_InstPtr(obj)->i_instvars[ninstVars]); |
|
46 | 1202 |
} |
1203 |
||
1204 |
/* |
|
1205 |
* need more here (i.e. convert from array-of-floats) |
|
1206 |
*/ |
|
1207 |
return (float *)0; |
|
1208 |
} |
|
1209 |
||
1210 |
%} |
|
1211 |
! ! |
|
0 | 1212 |
|
294 | 1213 |
!GLXWorkstation class methodsFor:'documentation'! |
1214 |
||
1215 |
copyright |
|
1216 |
" |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1217 |
COPYRIGHT (c) 1993 by Claus Gittinger |
294 | 1218 |
All Rights Reserved |
1219 |
||
1220 |
This software is furnished under a license and may be used |
|
1221 |
only in accordance with the terms of that license and with the |
|
1222 |
inclusion of the above copyright notice. This software may not |
|
1223 |
be provided or otherwise made available to, or used by, any |
|
1224 |
other person. No title to or ownership of the software is |
|
1225 |
hereby transferred. |
|
1226 |
" |
|
1227 |
! |
|
1228 |
||
1229 |
documentation |
|
1230 |
" |
|
1231 |
this class was originally written as a demo on how an interface to |
|
1232 |
a c graphics library could be implemented. In the mean time, it has become |
|
1233 |
quite complete ... |
|
1234 |
||
1235 |
It provides an interface to either a real GL (on SGI workstations) |
|
1236 |
or a simulated VGL (i.e. GL-light; low nicotine). |
|
1237 |
The GL simulation is derived from the PD vogl library, with slight |
|
1238 |
modifictions to support multiple GL views. |
|
1239 |
||
1240 |
Most of the hard work was done by Jeff (thanks indeed) ... |
|
1241 |
||
1242 |
||
1243 |
Some notes: |
|
1244 |
||
1245 |
I do not really know what most of these functions do - for more |
|
1246 |
detail, see the GL man pages (on SGI) or the doc provided with VGL. |
|
1247 |
||
1248 |
The interface offered here provides a very very low level (i.e one-to-one) |
|
1249 |
interface to GL functions. More high-level stuff is required, to make |
|
4718 | 1250 |
3D drawing be more object-oriented. |
294 | 1251 |
(see a bit of this in 'clients/IRIS-specials') |
1252 |
||
1253 |
Some functions are duplicated, Jeff and I developed those in parallel - |
|
1254 |
for now, both will remain - finally they will be merged and duplicates removed ... |
|
1255 |
(examples are makeobj and makeObject). |
|
1256 |
||
1257 |
Also, in a hurry to implement all those methods, many do no or only |
|
1258 |
limited argument checking - make certain, that you pass the correct |
|
1259 |
arguments. |
|
1260 |
||
1261 |
There might be some confusion in the v3[sifd] functions: basically they |
|
1262 |
all do the same, and could be mapped onto one st-method (such as vertex3). |
|
7657 | 1263 |
However, the C-functions expect different argument types - I don't know if |
294 | 1264 |
one or another of these functions suffers from any performance penalties. |
1265 |
Therefore, I leave the direct 1-to-1 mapping; GL experts might know more |
|
1266 |
about this (I use v3f in all of my code). |
|
1267 |
||
1268 |
written june 93 by claus |
|
1269 |
VGL stuff dec 93 |
|
1270 |
many many additions jan 94 by Jeff McAffer <jeff@is.s.u-tokyo.ac.jp> |
|
1271 |
||
4718 | 1272 |
Since this is a demo (consider it a free add-on goody) there is |
294 | 1273 |
*** NO WARRANTY ** for this. |
1274 |
||
1275 |
Notice: this should be rewritten to use the openGL library functions |
|
1276 |
(actually, to not loose the VGL interface, another OpenGLWorkstation |
|
1277 |
class should be written) |
|
614 | 1278 |
|
1279 |
[author:] |
|
7657 | 1280 |
Claus Gittinger |
1281 |
Jeff McAffer |
|
294 | 1282 |
" |
1283 |
! ! |
|
1284 |
||
168 | 1285 |
!GLXWorkstation class methodsFor:'error handling'! |
1286 |
||
294 | 1287 |
errorStringOfLastError |
1288 |
%{ |
|
4251 | 1289 |
#ifdef DYNAMICALLY_LOADABLE |
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1290 |
RETURN ( __MKSTRING(lastErrorMsg) ); |
4251 | 1291 |
#endif |
1292 |
%}. |
|
1293 |
||
1294 |
^ super errorStringOfLastError. |
|
1295 |
! |
|
1296 |
||
1297 |
minorCodeOfLastError |
|
1298 |
%{ /* NOCONTEXT */ |
|
1299 |
#ifdef DYNAMICALLY_LOADABLE |
|
1300 |
RETURN ( __MKSMALLINT(lastMinorCode) ); |
|
1301 |
#endif |
|
1302 |
%}. |
|
1303 |
||
1304 |
^ super minorCodeOfLastError. |
|
1305 |
! |
|
1306 |
||
1307 |
requestCodeOfLastError |
|
1308 |
%{ /* NOCONTEXT */ |
|
1309 |
#ifdef DYNAMICALLY_LOADABLE |
|
1310 |
RETURN ( __MKSMALLINT(lastRequestCode) ); |
|
1311 |
#endif |
|
1312 |
%}. |
|
1313 |
||
1314 |
^ super requestCodeOfLastError. |
|
1315 |
! |
|
1316 |
||
1317 |
resourceIdOfLastError |
|
1318 |
%{ /* NOCONTEXT */ |
|
1319 |
#ifdef DYNAMICALLY_LOADABLE |
|
1320 |
if (lastResource != 0) { |
|
1321 |
RETURN ( __MKEXTERNALADDRESS(lastResource) ); |
|
1322 |
} |
|
1323 |
RETURN ( nil ); |
|
1324 |
#endif |
|
1325 |
%}. |
|
1326 |
||
1327 |
^ super resourceIdOfLastError. |
|
1328 |
! ! |
|
1329 |
||
1330 |
!GLXWorkstation class methodsFor:'misc'! |
|
168 | 1331 |
|
528 | 1332 |
forceGL:aBoolean |
1333 |
ForceGL := aBoolean. |
|
1334 |
AllScreens notNil ifTrue:[ |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1335 |
AllScreens do:[:screen | screen initializeScreenProperties] |
528 | 1336 |
]. |
294 | 1337 |
! ! |
1338 |
||
1339 |
!GLXWorkstation methodsFor:'arcs and circles'! |
|
1340 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1341 |
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
|
1342 |
"draw an arc at a given location. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1343 |
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
|
1344 |
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
|
1345 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1346 |
%{ /* NOCONTEXT */ |
294 | 1347 |
Coord c_x, c_y, c_radius; |
1348 |
Angle a_startang, a_endang; |
|
1349 |
||
1350 |
_COORD_(x, c_x) |
|
1351 |
_COORD_(y, c_y) |
|
1352 |
_COORD_(radius, c_radius) |
|
1353 |
_ANGLE_(startang, a_startang) |
|
1354 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1355 |
|
294 | 1356 |
SETWIN(aGLXWindowId) |
1932 | 1357 |
#ifdef OPENGL |
1358 |
#else |
|
294 | 1359 |
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
|
1360 |
#endif |
294 | 1361 |
%} |
528 | 1362 |
|
1363 |
"Modified: 19.3.1996 / 18:43:52 / cg" |
|
294 | 1364 |
! |
1365 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1366 |
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
|
1367 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1368 |
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
|
1369 |
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
|
1370 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1371 |
%{ /* NOCONTEXT */ |
294 | 1372 |
Coord c_x, c_y, c_radius; |
1373 |
Angle a_startang, a_endang; |
|
1374 |
||
1375 |
_COORD_(x, c_x) |
|
1376 |
_COORD_(y, c_y) |
|
1377 |
_COORD_(radius, c_radius) |
|
1378 |
_ANGLE_(startang, a_startang) |
|
1379 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1380 |
|
294 | 1381 |
SETWIN(aGLXWindowId) |
1932 | 1382 |
#ifdef OPENGL |
1383 |
#else |
|
294 | 1384 |
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
|
1385 |
#endif |
294 | 1386 |
%} |
1387 |
! |
|
1388 |
||
1389 |
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
|
1390 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1391 |
All arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1392 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1393 |
%{ /* NOCONTEXT */ |
294 | 1394 |
Icoord c_x, c_y, c_radius; |
1395 |
Angle a_startang, a_endang; |
|
1396 |
||
1397 |
_ICOORD_(x, c_x) |
|
1398 |
_ICOORD_(y, c_y) |
|
1399 |
_ICOORD_(radius, c_radius) |
|
1400 |
_ANGLE_(startang, a_startang); |
|
1401 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1402 |
|
294 | 1403 |
SETWIN(aGLXWindowId) |
1932 | 1404 |
#ifdef OPENGL |
1405 |
#else |
|
294 | 1406 |
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
|
1407 |
#endif |
294 | 1408 |
%} |
1409 |
! |
|
1410 |
||
1411 |
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
|
1412 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1413 |
All arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1414 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1415 |
%{ /* NOCONTEXT */ |
294 | 1416 |
Scoord c_x, c_y, c_radius; |
1417 |
Angle a_startang, a_endang; |
|
1418 |
||
1419 |
_SCOORD_(x, c_x) |
|
1420 |
_SCOORD_(y, c_y) |
|
1421 |
_SCOORD_(radius, c_radius) |
|
1422 |
_ANGLE_(startang, a_startang) |
|
1423 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1424 |
|
294 | 1425 |
SETWIN(aGLXWindowId) |
1932 | 1426 |
#ifdef OPENGL |
1427 |
#else |
|
294 | 1428 |
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
|
1429 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1430 |
%} |
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 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1433 |
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
|
1434 |
"draw an (unfilled) arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1435 |
All arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1436 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1437 |
%{ /* NOCONTEXT */ |
294 | 1438 |
Icoord c_x, c_y, c_radius; |
1439 |
Angle a_startang, a_endang; |
|
1440 |
||
1441 |
_ICOORD_(x, c_x) |
|
1442 |
_ICOORD_(y, c_y) |
|
1443 |
_ICOORD_(radius, c_radius) |
|
1444 |
_ANGLE_(startang, a_startang) |
|
1445 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1446 |
|
294 | 1447 |
SETWIN(aGLXWindowId) |
1932 | 1448 |
#ifdef OPENGL |
1449 |
#else |
|
294 | 1450 |
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
|
1451 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1452 |
%} |
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 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1455 |
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
|
1456 |
"draw an (unfilled) arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1457 |
All arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1458 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1459 |
%{ /* NOCONTEXT */ |
1932 | 1460 |
Scoord c_x, c_y, c_radius; |
1461 |
Angle a_startang, a_endang; |
|
1462 |
||
1463 |
_SCOORD_(x, c_x) |
|
1464 |
_SCOORD_(y, c_y) |
|
1465 |
_SCOORD_(radius, c_radius) |
|
1466 |
_ANGLE_(startang, a_startang) |
|
1467 |
_ANGLE_(endang, a_endang) |
|
1468 |
||
1469 |
SETWIN(aGLXWindowId) |
|
1470 |
#ifdef OPENGL |
|
1471 |
#else |
|
1472 |
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
|
1473 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1474 |
%} |
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 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1477 |
glxCircX:x y:y radius: radius in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1478 |
"draw a circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1479 |
x/y/radius may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1480 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1481 |
%{ /* NOCONTEXT */ |
1932 | 1482 |
Coord c_x, c_y, c_radius; |
1483 |
||
1484 |
_COORD_ (x, c_x) |
|
1485 |
_COORD_ (y, c_y) |
|
1486 |
_COORD_ (radius, c_radius) |
|
1487 |
||
1488 |
SETWIN(aGLXWindowId) |
|
1489 |
#ifdef OPENGL |
|
1490 |
#else |
|
1491 |
circ(c_x, c_y, c_radius); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1492 |
#endif |
294 | 1493 |
%} |
1494 |
! |
|
1495 |
||
1496 |
glxCircfX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1497 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1498 |
x/y/radius may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1499 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1500 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1501 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1502 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1503 |
Coord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1504 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1505 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1506 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1507 |
_COORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1508 |
|
1932 | 1509 |
#ifdef OPENGL |
1510 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1511 |
circf(c_x, c_y, c_radius); |
1932 | 1512 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1513 |
} |
294 | 1514 |
%} |
1515 |
! |
|
1516 |
||
1517 |
glxCircfiX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1518 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1519 |
x/y/radius must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1520 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1521 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1522 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1523 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1524 |
Icoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1525 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1526 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1527 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1528 |
_ICOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1529 |
|
1932 | 1530 |
#ifdef OPENGL |
1531 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1532 |
circfi(c_x, c_y, c_radius); |
1932 | 1533 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1534 |
} |
294 | 1535 |
%} |
1536 |
! |
|
1537 |
||
1538 |
glxCircfsX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1539 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1540 |
x/y/radius must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1541 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1542 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1543 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1544 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1545 |
Scoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1546 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1547 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1548 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1549 |
_SCOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1550 |
|
1932 | 1551 |
#ifdef OPENGL |
1552 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1553 |
circfs(c_x, c_y, c_radius); |
1932 | 1554 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1555 |
} |
294 | 1556 |
%} |
1557 |
! |
|
1558 |
||
1559 |
glxCirciX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1560 |
"draw a circle (unfilled). |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1561 |
x/y/radius must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1562 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1563 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1564 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1565 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1566 |
Icoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1567 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1568 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1569 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1570 |
_ICOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1571 |
|
1932 | 1572 |
#ifdef OPENGL |
1573 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1574 |
circi(c_x, c_y, c_radius); |
1932 | 1575 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1576 |
} |
294 | 1577 |
%} |
1578 |
! |
|
1579 |
||
1580 |
glxCircsX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1581 |
"draw a circle (unfilled) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1582 |
x/y/radius must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1583 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1584 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1585 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1586 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1587 |
Scoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1588 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1589 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1590 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1591 |
_SCOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1592 |
|
1932 | 1593 |
#ifdef OPENGL |
1594 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1595 |
circs(c_x, c_y, c_radius); |
1932 | 1596 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1597 |
} |
294 | 1598 |
%} |
1599 |
! ! |
|
1600 |
||
528 | 1601 |
!GLXWorkstation methodsFor:'attribute stack'! |
1602 |
||
1603 |
glxPopattributesIn: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1604 |
"pop (and forget) the top entry on the attribute stack" |
528 | 1605 |
|
1606 |
%{ /* NOCONTEXT */ |
|
1607 |
SETWIN(aGLXWindowId) |
|
1932 | 1608 |
#ifndef OPENGL |
528 | 1609 |
popattributes(); |
1932 | 1610 |
#endif |
528 | 1611 |
%} |
1612 |
||
1613 |
"Modified: 19.3.1996 / 18:42:53 / cg" |
|
1614 |
! |
|
1615 |
||
1616 |
glxPushattributesIn: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1617 |
"save the current attributes on the attribute stack" |
528 | 1618 |
|
1619 |
%{ /* NOCONTEXT */ |
|
1620 |
SETWIN(aGLXWindowId) |
|
1932 | 1621 |
#ifndef OPENGL |
528 | 1622 |
pushattributes(); |
1932 | 1623 |
#endif |
528 | 1624 |
%} |
1625 |
||
1626 |
"Modified: 19.3.1996 / 18:43:04 / cg" |
|
1627 |
! ! |
|
1628 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1629 |
!GLXWorkstation methodsFor:'character position'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1630 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1631 |
glxCmov2X: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1632 |
"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
|
1633 |
The arguments may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1634 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1635 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1636 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1637 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1638 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1639 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1640 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1641 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1642 |
|
1932 | 1643 |
#ifdef OPENGL |
1644 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1645 |
cmov2(c_x, c_y); |
1932 | 1646 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1647 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1648 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1649 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1650 |
"Modified: 22.3.1996 / 18:17:38 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1651 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1652 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1653 |
glxCmov2iX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1654 |
"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
|
1655 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1656 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1657 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1658 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1659 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1660 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1661 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1662 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1663 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1664 |
|
1932 | 1665 |
#ifdef OPENGL |
1666 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1667 |
cmov2i(c_x, c_y); |
1932 | 1668 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1669 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1670 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1671 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1672 |
"Modified: 22.3.1996 / 18:17:43 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1673 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1674 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1675 |
glxCmov2sX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1676 |
"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
|
1677 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1678 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1679 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1680 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1681 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1682 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1683 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1684 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1685 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1686 |
|
1932 | 1687 |
#ifdef OPENGL |
1688 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1689 |
cmov2s(c_x, c_y); |
1932 | 1690 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1691 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1692 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1693 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1694 |
"Modified: 22.3.1996 / 18:17:47 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1695 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1696 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1697 |
glxCmovX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1698 |
"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
|
1699 |
The arguments may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1700 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1701 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1702 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1703 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1704 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1705 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1706 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1707 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1708 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1709 |
|
1932 | 1710 |
#ifdef OPENGL |
1711 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1712 |
cmov(c_x, c_y, c_z); |
1932 | 1713 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1714 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1715 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1716 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1717 |
"Modified: 22.3.1996 / 18:17:22 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1718 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1719 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1720 |
glxCmoviX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1721 |
"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
|
1722 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1723 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1724 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1725 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1726 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1727 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1728 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1729 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1730 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1731 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1732 |
|
1932 | 1733 |
#ifdef OPENGL |
1734 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1735 |
cmovi(c_x, c_y, c_z); |
1932 | 1736 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1737 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1738 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1739 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1740 |
"Modified: 22.3.1996 / 18:17:55 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1741 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1742 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1743 |
glxCmovsX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1744 |
"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
|
1745 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1746 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1747 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1748 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1749 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1750 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1751 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1752 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1753 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1754 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1755 |
|
1932 | 1756 |
#ifdef OPENGL |
1757 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1758 |
cmovs(c_x, c_y, c_z); |
1932 | 1759 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1760 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1761 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1762 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1763 |
"Modified: 22.3.1996 / 18:17:59 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1764 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1765 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1766 |
glxGetcposIn: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1767 |
"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
|
1768 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1769 |
| x y | |
4718 | 1770 |
%{ |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1771 |
short s_x, s_y; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1772 |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1773 |
SETWIN(aGLXWindowId) |
1932 | 1774 |
#ifdef OPENGL |
1775 |
#else |
|
1776 |
# ifdef GLX |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1777 |
getcpos(&s_x, &s_y); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1778 |
x = __MKSMALLINT(s_x); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1779 |
y = __MKSMALLINT(s_y); |
1932 | 1780 |
# endif |
1781 |
#endif |
|
1782 |
%}. |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1783 |
^x @ y |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1784 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1785 |
|
294 | 1786 |
!GLXWorkstation methodsFor:'clearing'! |
1787 |
||
1788 |
glxClearIn:aGLXWindowId |
|
1789 |
"clear to current color" |
|
1790 |
||
1791 |
%{ /* NOCONTEXT */ |
|
1792 |
SETWIN(aGLXWindowId) |
|
1932 | 1793 |
#ifdef OPENGL |
1794 |
#else |
|
294 | 1795 |
clear(); |
1932 | 1796 |
#endif |
294 | 1797 |
%} |
1798 |
! |
|
1799 |
||
1800 |
glxCzclearCval:cval zval:zval in:aGLXWindowId |
|
1801 |
"clear to a color (cval) and clear z buffer to zval simultaniously" |
|
1802 |
||
1803 |
%{ /* NOCONTEXT */ |
|
1932 | 1804 |
SETWIN(aGLXWindowId) |
1805 |
#ifdef OPENGL |
|
1806 |
#else |
|
1807 |
# ifdef GLX |
|
294 | 1808 |
czclear((ulong)__intVal(cval), __intVal(zval)); |
1932 | 1809 |
# endif |
1810 |
#endif |
|
1811 |
%} |
|
294 | 1812 |
! |
1813 |
||
1814 |
glxZClearIn:aGLXWindowId |
|
1815 |
"clear z buffer" |
|
1816 |
||
1817 |
%{ /* NOCONTEXT */ |
|
1932 | 1818 |
SETWIN(aGLXWindowId) |
1819 |
#ifdef OPENGL |
|
1820 |
#else |
|
1821 |
# ifdef GLX |
|
294 | 1822 |
zclear(); |
1932 | 1823 |
# endif |
1824 |
#endif |
|
1825 |
%} |
|
294 | 1826 |
! ! |
1827 |
||
1828 |
!GLXWorkstation methodsFor:'color'! |
|
1829 |
||
1830 |
glxColor:index in:aGLXWindowId |
|
4718 | 1831 |
"set the drawing color; |
7656 | 1832 |
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
|
1833 |
otherwise, better results are expected with float values." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1834 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1835 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1836 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1837 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1838 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1839 |
#else |
294 | 1840 |
if (__isSmallInteger(index)) { |
7656 | 1841 |
color((Colorindex)(__intVal(index))); |
1842 |
RETURN (self); |
|
294 | 1843 |
} |
1844 |
if (__isFloat(index)) { |
|
7656 | 1845 |
colorf((float)(_floatVal(index))); |
1846 |
RETURN (self); |
|
294 | 1847 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1848 |
#endif |
1932 | 1849 |
%} |
294 | 1850 |
! |
1851 |
||
1852 |
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
|
1853 |
"set the drawing color, including alpha value. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1854 |
The args must be integer values within 0..255" |
294 | 1855 |
|
1856 |
%{ /* NOCONTEXT */ |
|
1857 |
short s_r, s_g, s_b, s_a; |
|
1858 |
||
1859 |
_INT_(r, s_r); |
|
1860 |
_INT_(g, s_g); |
|
1861 |
_INT_(b, s_b); |
|
1862 |
_INT_(a, s_a); |
|
1863 |
SETWIN(aGLXWindowId) |
|
1932 | 1864 |
#ifdef GLX |
294 | 1865 |
cpack((((((s_a<<8) | s_b) << 8) | s_g) << 8) | s_r); |
1932 | 1866 |
#endif |
1867 |
%} |
|
294 | 1868 |
! |
1869 |
||
1870 |
glxColorRed:r green:g blue:b in:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1871 |
"set the drawing color. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1872 |
The args must be integer values in 0..255" |
294 | 1873 |
|
1874 |
%{ /* NOCONTEXT */ |
|
1875 |
short s_r, s_g, s_b; |
|
1876 |
||
1877 |
_INT_(r, s_r); |
|
1878 |
_INT_(g, s_g); |
|
1879 |
_INT_(b, s_b); |
|
1880 |
SETWIN(aGLXWindowId) |
|
1932 | 1881 |
#ifdef GLX |
294 | 1882 |
RGBcolor(s_r, s_g, s_b); |
1932 | 1883 |
#endif |
1884 |
%} |
|
294 | 1885 |
! |
1886 |
||
528 | 1887 |
glxLrgbrangeRmin: rmin gmin: gmin bmin: bmin rmax: rmax gmax: gmax bmax: bmax |
1888 |
znear: znear zfar: zfar in: aGLXWindowId |
|
1889 |
||
1890 |
%{ /* NOCONTEXT */ |
|
1932 | 1891 |
SETWIN(aGLXWindowId) |
1892 |
#ifdef GLX |
|
4718 | 1893 |
lRGBrange(_shortVal(rmin), _shortVal(gmin), _shortVal(bmin), |
1894 |
_shortVal(rmax), _shortVal(gmax), _shortVal(bmax), |
|
528 | 1895 |
_longVal(znear), _longVal(zfar)); |
1932 | 1896 |
#endif |
1897 |
%} |
|
528 | 1898 |
! |
1899 |
||
1900 |
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
|
1901 |
"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
|
1902 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1903 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1904 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1905 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1906 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1907 |
#else |
528 | 1908 |
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
|
1909 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1910 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1911 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1912 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1913 |
glxTextcolor:tcolor in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1914 |
"change the color used for text drawing" |
294 | 1915 |
|
1916 |
%{ /* NOCONTEXT */ |
|
1932 | 1917 |
SETWIN(aGLXWindowId) |
1918 |
#ifdef GLX |
|
294 | 1919 |
textcolor(_colorindexVal(tcolor)); |
1932 | 1920 |
#endif |
1921 |
%} |
|
294 | 1922 |
! ! |
1923 |
||
528 | 1924 |
!GLXWorkstation methodsFor:'curves'! |
1925 |
||
1926 |
glxCurvebasis: basid in: aGLXWindowId |
|
1927 |
"sets the basis type of curves" |
|
1928 |
||
1929 |
%{ /* NOCONTEXT */ |
|
1930 |
SETWIN(aGLXWindowId) |
|
1932 | 1931 |
#ifdef GLX |
528 | 1932 |
curvebasis(_shortVal(basid)); |
1932 | 1933 |
#endif |
528 | 1934 |
%} |
1935 |
||
1936 |
"Modified: 19.3.1996 / 18:47:09 / cg" |
|
1937 |
! |
|
1938 |
||
1939 |
glxCurveit: iterationcount in: aGLXWindowId |
|
1940 |
"Iterates the top matrix on the stack as a forward difference |
|
1941 |
matrix, drawing as it goes along." |
|
1942 |
||
1943 |
%{ /* NOCONTEXT */ |
|
1944 |
SETWIN(aGLXWindowId) |
|
1932 | 1945 |
#ifdef GLX |
528 | 1946 |
curveit(_shortVal(iterationcount)); |
1932 | 1947 |
#endif |
528 | 1948 |
%} |
1949 |
||
1950 |
"Modified: 19.3.1996 / 18:48:57 / cg" |
|
1951 |
! |
|
1952 |
||
1953 |
glxCurveprecision: nsegments in: aGLXWindowId |
|
1954 |
"sets the number of line segments that make up a curve segment" |
|
1955 |
||
1956 |
%{ /* NOCONTEXT */ |
|
1957 |
SETWIN(aGLXWindowId) |
|
1932 | 1958 |
#ifdef GLX |
528 | 1959 |
curveprecision(_shortVal(nsegments)); |
1932 | 1960 |
#endif |
528 | 1961 |
%} |
1962 |
||
1963 |
"Modified: 19.3.1996 / 18:47:43 / cg" |
|
1964 |
! ! |
|
1965 |
||
294 | 1966 |
!GLXWorkstation methodsFor:'double buffering'! |
1967 |
||
1968 |
glxBackBufferIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1969 |
"switch to back buffer drawing - turning frontbuffer drawing off" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1970 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1971 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1972 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1973 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1974 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1975 |
# ifdef GLX |
294 | 1976 |
frontbuffer(FALSE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1977 |
# endif |
294 | 1978 |
backbuffer(TRUE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1979 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1980 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1981 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1982 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1983 |
glxBackbuffer:b in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1984 |
"turn backBuffer drawing on/off. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1985 |
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
|
1986 |
... enabling the backbuffer automatically disables frontbuffer drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1987 |
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
|
1988 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1989 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1990 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1991 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1992 |
#else |
294 | 1993 |
backbuffer(_booleanVal(b)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1994 |
#endif |
294 | 1995 |
%} |
528 | 1996 |
|
1997 |
"Modified: 19.3.1996 / 18:45:05 / cg" |
|
294 | 1998 |
! |
1999 |
||
2000 |
glxDoubleBufferIn:aGLXWindowId |
|
2001 |
"set double buffer mode" |
|
2002 |
||
2003 |
%{ /* NOCONTEXT */ |
|
2004 |
SETWIN(aGLXWindowId) |
|
1932 | 2005 |
#ifdef OPENGL |
2006 |
#else |
|
294 | 2007 |
doublebuffer(); |
1932 | 2008 |
#endif |
294 | 2009 |
%} |
2010 |
! |
|
2011 |
||
2012 |
glxFrontBufferIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2013 |
"switch to front buffer drawing - turning backbuffer drawing off" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2014 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2015 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2016 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2017 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2018 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2019 |
# ifdef GLX |
294 | 2020 |
backbuffer(FALSE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2021 |
# endif |
294 | 2022 |
frontbuffer(TRUE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2023 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2024 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2025 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2026 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2027 |
glxFrontbuffer:b in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2028 |
"turn on/off frontbuffer drawing. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2029 |
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
|
2030 |
... enabling the backbuffer automatically disables frontbuffer drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2031 |
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
|
2032 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2033 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2034 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2035 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2036 |
#else |
294 | 2037 |
frontbuffer(_booleanVal(b)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2038 |
#endif |
294 | 2039 |
%} |
528 | 2040 |
|
2041 |
"Modified: 19.3.1996 / 18:45:31 / cg" |
|
294 | 2042 |
! |
2043 |
||
2044 |
glxSingleBufferIn: aGLXWindowId |
|
2045 |
"set single buffer mode" |
|
2046 |
||
2047 |
%{ /* NOCONTEXT */ |
|
2048 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2049 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2050 |
#else |
294 | 2051 |
singlebuffer(); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2052 |
#endif |
294 | 2053 |
%} |
2054 |
! |
|
2055 |
||
2056 |
glxSwapBuffersIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2057 |
"swap the back and front buffers. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2058 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2059 |
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
|
2060 |
displayed and swap them for every frame." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2061 |
|
1903 | 2062 |
%{ /* UNLIMITEDSTACK */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2063 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2064 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2065 |
#else |
294 | 2066 |
swapbuffers(); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2067 |
#endif |
294 | 2068 |
%} |
528 | 2069 |
|
2070 |
"Modified: 19.3.1996 / 18:45:47 / cg" |
|
294 | 2071 |
! ! |
2072 |
||
2073 |
!GLXWorkstation methodsFor:'flat drawing'! |
|
2074 |
||
2075 |
glxBeginClosedLineIn:aGLXWindowId |
|
2076 |
"start a closed line" |
|
2077 |
||
2078 |
%{ /* NOCONTEXT */ |
|
1932 | 2079 |
#ifdef OPENGL |
2080 |
#else |
|
294 | 2081 |
SETWIN(aGLXWindowId) |
2082 |
bgnclosedline(); |
|
1932 | 2083 |
#endif |
294 | 2084 |
%} |
2085 |
! |
|
2086 |
||
2087 |
glxBeginLineIn:aGLXWindowId |
|
2088 |
"start a line group" |
|
2089 |
||
2075 | 2090 |
%{ /* NOCONTEXT STACK:32000 */ |
1932 | 2091 |
#ifdef OPENGL |
2092 |
#else |
|
294 | 2093 |
SETWIN(aGLXWindowId) |
2094 |
bgnline(); |
|
1932 | 2095 |
#endif |
294 | 2096 |
%} |
2097 |
! |
|
2098 |
||
2099 |
glxBeginPointIn:aGLXWindowId |
|
2100 |
"start a point-group" |
|
2101 |
||
2102 |
%{ /* NOCONTEXT */ |
|
1932 | 2103 |
#ifdef OPENGL |
2104 |
#else |
|
294 | 2105 |
SETWIN(aGLXWindowId) |
2106 |
bgnpoint(); |
|
1932 | 2107 |
#endif |
294 | 2108 |
%} |
2109 |
! |
|
2110 |
||
2111 |
glxBeginPolygonIn:aGLXWindowId |
|
2112 |
"start a polygon" |
|
2113 |
||
2114 |
%{ /* NOCONTEXT */ |
|
1932 | 2115 |
#ifdef OPENGL |
2116 |
#else |
|
294 | 2117 |
SETWIN(aGLXWindowId) |
2118 |
bgnpolygon(); |
|
1932 | 2119 |
#endif |
294 | 2120 |
%} |
2121 |
! |
|
2122 |
||
2123 |
glxBeginQuadrilateralStripIn:aGLXWindowId |
|
2124 |
"start a quadrilateral strip" |
|
2125 |
||
2126 |
%{ /* NOCONTEXT */ |
|
1932 | 2127 |
#ifdef OPENGL |
2128 |
#else |
|
294 | 2129 |
SETWIN(aGLXWindowId) |
2130 |
bgnqstrip(); |
|
1932 | 2131 |
#endif |
294 | 2132 |
%} |
2133 |
! |
|
2134 |
||
2135 |
glxBeginTriangleMeshIn:aGLXWindowId |
|
2136 |
"start a triangle mesh" |
|
2137 |
||
2138 |
%{ /* NOCONTEXT */ |
|
1932 | 2139 |
#ifdef OPENGL |
2140 |
#else |
|
294 | 2141 |
SETWIN(aGLXWindowId) |
2142 |
bgntmesh(); |
|
1932 | 2143 |
#endif |
294 | 2144 |
%} |
2145 |
! |
|
2146 |
||
2147 |
glxEndClosedLineIn:aGLXWindowId |
|
2148 |
"end a closed line" |
|
2149 |
||
2150 |
%{ /* NOCONTEXT */ |
|
1932 | 2151 |
#ifdef OPENGL |
2152 |
#else |
|
294 | 2153 |
SETWIN(aGLXWindowId) |
2154 |
endclosedline(); |
|
1932 | 2155 |
#endif |
294 | 2156 |
%} |
2157 |
! |
|
2158 |
||
2159 |
glxEndLineIn:aGLXWindowId |
|
2160 |
"end a line group" |
|
2161 |
||
2075 | 2162 |
%{ /* NOCONTEXT STACK:32000 */ |
1932 | 2163 |
#ifdef OPENGL |
2164 |
#else |
|
294 | 2165 |
SETWIN(aGLXWindowId) |
2166 |
endline(); |
|
1932 | 2167 |
#endif |
294 | 2168 |
%} |
2169 |
! |
|
2170 |
||
2171 |
glxEndPointIn:aGLXWindowId |
|
2172 |
"end a point group" |
|
2173 |
||
2174 |
%{ /* NOCONTEXT */ |
|
1932 | 2175 |
#ifdef OPENGL |
2176 |
#else |
|
294 | 2177 |
SETWIN(aGLXWindowId) |
2178 |
endpoint(); |
|
1932 | 2179 |
#endif |
294 | 2180 |
%} |
2181 |
! |
|
2182 |
||
2183 |
glxEndPolygonIn:aGLXWindowId |
|
2184 |
"end a polygon" |
|
2185 |
||
2186 |
%{ /* NOCONTEXT */ |
|
1932 | 2187 |
#ifdef OPENGL |
2188 |
#else |
|
294 | 2189 |
SETWIN(aGLXWindowId) |
2190 |
endpolygon(); |
|
1932 | 2191 |
#endif |
294 | 2192 |
%} |
2193 |
! |
|
2194 |
||
2195 |
glxEndQuadrilateralStripIn:aGLXWindowId |
|
2196 |
"end a quadrilateral strip" |
|
2197 |
||
2198 |
%{ /* NOCONTEXT */ |
|
1932 | 2199 |
#ifdef OPENGL |
2200 |
#else |
|
294 | 2201 |
SETWIN(aGLXWindowId) |
2202 |
endqstrip(); |
|
1932 | 2203 |
#endif |
294 | 2204 |
%} |
2205 |
! |
|
2206 |
||
2207 |
glxEndTriangleMeshIn:aGLXWindowId |
|
2208 |
"end a triangle mesh" |
|
2209 |
||
2210 |
%{ /* NOCONTEXT */ |
|
1932 | 2211 |
#ifdef OPENGL |
2212 |
#else |
|
294 | 2213 |
SETWIN(aGLXWindowId) |
2214 |
endtmesh(); |
|
1932 | 2215 |
#endif |
168 | 2216 |
%} |
2217 |
! ! |
|
2218 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2219 |
!GLXWorkstation methodsFor:'graphics position'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2220 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2221 |
glxMove2:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2222 |
"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
|
2223 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2224 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2225 |
float vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2226 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2227 |
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
|
2228 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2229 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2230 |
#else |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2231 |
move2((Coord)(c_v[0]), (Coord)(c_v[1])); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2232 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2233 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2234 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2235 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2236 |
"Modified: 22.3.1996 / 18:15:23 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2237 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2238 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2239 |
glxMove2X: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2240 |
"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
|
2241 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2242 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2243 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2244 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2245 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2246 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2247 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2248 |
SETWIN(aGLXWindowId) |
1932 | 2249 |
#ifdef OPENGL |
2250 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2251 |
move2(c_x, c_y); |
1932 | 2252 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2253 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2254 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2255 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2256 |
"Modified: 22.3.1996 / 18:15:02 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2257 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2258 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2259 |
glxMove2iX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2260 |
"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
|
2261 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2262 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2263 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2264 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2265 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2266 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2267 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2268 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2269 |
SETWIN(aGLXWindowId) |
1932 | 2270 |
#ifdef OPENGL |
2271 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2272 |
move2i(c_x, c_y); |
1932 | 2273 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2274 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2275 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2276 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2277 |
"Modified: 22.3.1996 / 18:15:08 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2278 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2279 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2280 |
glxMove2sX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2281 |
"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
|
2282 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2283 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2284 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2285 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2286 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2287 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2288 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2289 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2290 |
SETWIN(aGLXWindowId) |
1932 | 2291 |
#ifdef OPENGL |
2292 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2293 |
move2s(c_x, c_y); |
1932 | 2294 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2295 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2296 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2297 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2298 |
"Modified: 22.3.1996 / 18:15:13 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2299 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2300 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2301 |
glxMove:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2302 |
"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
|
2303 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2304 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2305 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2306 |
float vec[3], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2307 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2308 |
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
|
2309 |
SETWIN(aGLXWindowId) |
1932 | 2310 |
#ifdef OPENGL |
2311 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2312 |
move((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
1932 | 2313 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2314 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2315 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2316 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2317 |
"Modified: 22.3.1996 / 18:14:29 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2318 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2319 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2320 |
glxMoveX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2321 |
"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
|
2322 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2323 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2324 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2325 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2326 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2327 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2328 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2329 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2330 |
SETWIN(aGLXWindowId) |
1932 | 2331 |
#ifdef OPENGL |
2332 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2333 |
move(c_x, c_y, c_z); |
1932 | 2334 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2335 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2336 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2337 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2338 |
"Modified: 22.3.1996 / 18:14:38 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2339 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2340 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2341 |
glxMoveiX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2342 |
"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
|
2343 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2344 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2345 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2346 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2347 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2348 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2349 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2350 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2351 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2352 |
SETWIN(aGLXWindowId) |
1932 | 2353 |
#ifdef OPENGL |
2354 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2355 |
movei(c_x, c_y, c_z); |
1932 | 2356 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2357 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2358 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2359 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2360 |
"Modified: 22.3.1996 / 18:14:44 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2361 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2362 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2363 |
glxMovesX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2364 |
"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
|
2365 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2366 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2367 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2368 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2369 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2370 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2371 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2372 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2373 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2374 |
SETWIN(aGLXWindowId) |
1932 | 2375 |
#ifdef OPENGL |
2376 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2377 |
moves(c_x, c_y, c_z); |
1932 | 2378 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2379 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2380 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2381 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2382 |
"Modified: 22.3.1996 / 18:14:48 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2383 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2384 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2385 |
glxRmv2:v in: aGLXWindowId |
4718 | 2386 |
"change the graphics position to a 2D point, |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2387 |
the relative distance is passed in vector v" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2388 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2389 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2390 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2391 |
float vec[2], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2392 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2393 |
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
|
2394 |
SETWIN(aGLXWindowId) |
1932 | 2395 |
#ifdef OPENGL |
2396 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2397 |
rmv2((Coord)(c_v[0]), (Coord)(c_v[1])); |
1932 | 2398 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2399 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2400 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2401 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2402 |
"Modified: 22.3.1996 / 18:15:57 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2405 |
glxRmv2X: x y: y in: aGLXWindowId |
4718 | 2406 |
"change the graphics position to a 2D point, |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2407 |
the relative distance is passed in x/y" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2408 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2409 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2410 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2411 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2412 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2413 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2414 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2415 |
SETWIN(aGLXWindowId) |
1932 | 2416 |
#ifdef OPENGL |
2417 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2418 |
rmv2(c_x, c_y); |
1932 | 2419 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2420 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2421 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2422 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2423 |
"Modified: 22.3.1996 / 18:16:42 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2424 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2425 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2426 |
glxRmv2iX: x y: y in: aGLXWindowId |
4718 | 2427 |
"change the graphics position to a 2D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2428 |
the relative distance is passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2429 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2430 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2431 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2432 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2433 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2434 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2435 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2436 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2437 |
SETWIN(aGLXWindowId) |
1932 | 2438 |
#ifdef OPENGL |
2439 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2440 |
rmv2i(c_x, c_y); |
1932 | 2441 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2442 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2443 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2444 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2445 |
"Modified: 22.3.1996 / 18:16:39 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2446 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2447 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2448 |
glxRmv2sX: x y: y in: aGLXWindowId |
4718 | 2449 |
"change the graphics position to a 2D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2450 |
the relative distance is passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2451 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2452 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2453 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2454 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2455 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2456 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2457 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2458 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2459 |
SETWIN(aGLXWindowId) |
1932 | 2460 |
#ifdef OPENGL |
2461 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2462 |
rmv2s(c_x, c_y); |
1932 | 2463 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2464 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2465 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2466 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2467 |
"Modified: 22.3.1996 / 18:16:33 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2470 |
glxRmv:v in: aGLXWindowId |
4718 | 2471 |
"change the graphics position to a 3D point, |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2472 |
the relative distance is passed in vector v" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2473 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2474 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2475 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2476 |
float vec[3], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2477 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2478 |
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
|
2479 |
SETWIN(aGLXWindowId) |
1932 | 2480 |
#ifdef OPENGL |
2481 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2482 |
rmv((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
1932 | 2483 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2484 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2485 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2486 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2487 |
"Modified: 22.3.1996 / 18:16:08 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2490 |
glxRmvX: x y: y z: z in: aGLXWindowId |
4718 | 2491 |
"change the graphics position to a 3D point, |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2492 |
the relative distance is passed in x/y/z" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2493 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2494 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2495 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2496 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2497 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2498 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2499 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2500 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2501 |
SETWIN(aGLXWindowId) |
1932 | 2502 |
#ifdef OPENGL |
2503 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2504 |
rmv(c_x, c_y, c_z); |
1932 | 2505 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2506 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2507 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2508 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2509 |
"Modified: 22.3.1996 / 18:16:16 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2510 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2511 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2512 |
glxRmviX: x y: y z: z in: aGLXWindowId |
4718 | 2513 |
"change the graphics position to a 3D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2514 |
the relative distance is passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2515 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2516 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2517 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2518 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2519 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2520 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2521 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2522 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2523 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2524 |
SETWIN(aGLXWindowId) |
1932 | 2525 |
#ifdef OPENGL |
2526 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2527 |
rmvi(c_x, c_y, c_z); |
1932 | 2528 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2529 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2530 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2531 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2532 |
"Modified: 22.3.1996 / 18:16:21 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2533 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2534 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2535 |
glxRmvsX: x y: y z: z in: aGLXWindowId |
4718 | 2536 |
"change the graphics position to a 3D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2537 |
the relative distance is passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2538 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2539 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2540 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2541 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2542 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2543 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2544 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2545 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2546 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2547 |
SETWIN(aGLXWindowId) |
1932 | 2548 |
#ifdef OPENGL |
2549 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2550 |
rmvs(c_x, c_y, c_z); |
1932 | 2551 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2552 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2553 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2554 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2555 |
"Modified: 22.3.1996 / 18:16:25 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2556 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2557 |
|
168 | 2558 |
!GLXWorkstation methodsFor:'initialization'! |
2559 |
||
2560 |
initializeFor:aDisplayName |
|
169 | 2561 |
(super initializeFor:aDisplayName) isNil ifTrue:[^ nil]. |
168 | 2562 |
%{ |
2563 |
if (_INST(displayId) != nil) { |
|
185 | 2564 |
XSetErrorHandler(__XErrorHandler__); |
2565 |
} |
|
2566 |
%} |
|
2567 |
! |
|
2568 |
||
2569 |
initializeScreenProperties |
|
2570 |
super initializeScreenProperties. |
|
2571 |
||
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2572 |
"/ 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
|
2573 |
"/ 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
|
2574 |
"/ 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
|
2575 |
"/ 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
|
2576 |
"/ 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
|
2577 |
"/ 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
|
2578 |
"/ 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
|
2579 |
"/ have no documentation). |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2580 |
"/ Late note: setting the ForceGL classVar overrides above behavior. |
4718 | 2581 |
"/ it may be set from a startupScript with: 'GLXWorkstation forceGL:true' |
2582 |
"/ 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
|
2583 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2584 |
(self isTrueGL and:[ForceGL ~~ true]) ifTrue:[ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2585 |
glOK := (displayName = ':0') or:[displayName = ':0.0']. |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2586 |
] ifFalse:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2587 |
glOK := true. |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2588 |
]. |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2589 |
|
185 | 2590 |
%{ |
2591 |
Display *dpy = myDpy; |
|
2592 |
int dummy; |
|
2593 |
||
2594 |
if (ISCONNECTED) { |
|
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2595 |
_INST(hasStereoExtension) = false; |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2596 |
|
1932 | 2597 |
#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
|
2598 |
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
|
2599 |
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
|
2600 |
_INST(hasStereoExtension) = true; |
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2601 |
} |
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2602 |
#endif |
168 | 2603 |
} |
2604 |
%} |
|
2605 |
! ! |
|
2606 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2607 |
!GLXWorkstation methodsFor:'lines'! |
528 | 2608 |
|
2609 |
glxDeflinestyleN: n ls: ls in: aGLXWindowId |
|
2610 |
"define a line style" |
|
2611 |
||
2612 |
%{ /* NOCONTEXT */ |
|
1932 | 2613 |
SETWIN(aGLXWindowId) |
2614 |
#ifdef OPENGL |
|
2615 |
#else |
|
528 | 2616 |
deflinestyle(_shortVal(n), _linestyleVal(ls)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2617 |
#endif |
528 | 2618 |
%} |
2619 |
! |
|
2620 |
||
2621 |
glxDraw2:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2622 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2623 |
to a new 2D position, passed in vector v." |
528 | 2624 |
|
2625 |
%{ /* NOCONTEXT */ |
|
2626 |
float vec[2], *c_v; |
|
2627 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2628 |
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
|
2629 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2630 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2631 |
#else |
528 | 2632 |
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
|
2633 |
#endif |
528 | 2634 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2635 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2636 |
"Modified: 22.3.1996 / 18:03:29 / cg" |
528 | 2637 |
! |
2638 |
||
2639 |
glxDraw2X: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2640 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2641 |
to a new 2D position, passed in x/y." |
528 | 2642 |
|
2643 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2644 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2645 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2646 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2647 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2648 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2649 |
SETWIN(aGLXWindowId) |
1932 | 2650 |
#ifdef OPENGL |
2651 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2652 |
draw2(c_x, c_y); |
1932 | 2653 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2654 |
} |
528 | 2655 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2656 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2657 |
"Modified: 22.3.1996 / 18:03:50 / cg" |
528 | 2658 |
! |
2659 |
||
2660 |
glxDraw2iX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2661 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2662 |
to a new 2D position, passed in x/y." |
528 | 2663 |
|
2664 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2665 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2666 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2667 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2668 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2669 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2670 |
SETWIN(aGLXWindowId) |
1932 | 2671 |
#ifdef OPENGL |
2672 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2673 |
draw2i(c_x, c_y); |
1932 | 2674 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2675 |
} |
528 | 2676 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2677 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2678 |
"Modified: 22.3.1996 / 18:04:07 / cg" |
528 | 2679 |
! |
2680 |
||
2681 |
glxDraw2sX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2682 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2683 |
to a new 2D position, passed in x/y." |
528 | 2684 |
|
2685 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2686 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2687 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2688 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2689 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2690 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2691 |
SETWIN(aGLXWindowId) |
1932 | 2692 |
#ifdef OPENGL |
2693 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2694 |
draw2s(c_x, c_y); |
1932 | 2695 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2696 |
} |
528 | 2697 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2698 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2699 |
"Modified: 22.3.1996 / 18:04:19 / cg" |
528 | 2700 |
! |
2701 |
||
2702 |
glxDraw:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2703 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2704 |
to a new 3D position, passed in vector v." |
528 | 2705 |
|
2706 |
%{ /* NOCONTEXT */ |
|
2707 |
float vec[3], *c_v; |
|
2708 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2709 |
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
|
2710 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2711 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2712 |
#else |
528 | 2713 |
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
|
2714 |
#endif |
528 | 2715 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2716 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2717 |
"Modified: 22.3.1996 / 18:04:34 / cg" |
528 | 2718 |
! |
2719 |
||
2720 |
glxDrawX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2721 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2722 |
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
|
2723 |
The arguments may be floats, fractions or smallIntegers" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2724 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2725 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2726 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2727 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2728 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2729 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2730 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2731 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2732 |
SETWIN(aGLXWindowId) |
1932 | 2733 |
#ifdef OPENGL |
2734 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2735 |
draw(c_x, c_y, c_z); |
1932 | 2736 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2737 |
} |
528 | 2738 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2739 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2740 |
"Modified: 22.3.1996 / 18:04:46 / cg" |
528 | 2741 |
! |
2742 |
||
2743 |
glxDrawiX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2744 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2745 |
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
|
2746 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2747 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2748 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2749 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2750 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2751 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2752 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2753 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2754 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2755 |
SETWIN(aGLXWindowId) |
1932 | 2756 |
#ifdef OPENGL |
2757 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2758 |
drawi(c_x, c_y, c_z); |
1932 | 2759 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2760 |
} |
528 | 2761 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2762 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2763 |
"Modified: 22.3.1996 / 18:04:54 / cg" |
528 | 2764 |
! |
2765 |
||
2766 |
glxDrawsX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2767 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2768 |
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
|
2769 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2770 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2771 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2772 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2773 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2774 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2775 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2776 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2777 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2778 |
SETWIN(aGLXWindowId) |
1932 | 2779 |
#ifdef OPENGL |
2780 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2781 |
draws(c_x, c_y, c_z); |
1932 | 2782 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2783 |
} |
528 | 2784 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2785 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2786 |
"Modified: 22.3.1996 / 18:05:01 / cg" |
528 | 2787 |
! |
2788 |
||
2789 |
glxLinewidth: n in: aGLXWindowId |
|
2790 |
"set the linewidth" |
|
2791 |
||
2792 |
%{ /* NOCONTEXT */ |
|
2793 |
SETWIN(aGLXWindowId) |
|
1932 | 2794 |
#ifdef OPENGL |
2795 |
#else |
|
528 | 2796 |
linewidth(_shortVal(n)); |
1932 | 2797 |
#endif |
528 | 2798 |
%} |
2799 |
! |
|
2800 |
||
2801 |
glxLinewidthf: n in: aGLXWindowId |
|
2802 |
"set the linewidth" |
|
2803 |
||
2804 |
%{ /* NOCONTEXT */ |
|
2805 |
SETWIN(aGLXWindowId) |
|
1932 | 2806 |
#ifdef OPENGL |
2807 |
#else |
|
528 | 2808 |
linewidthf(_floatVal(n)); |
1932 | 2809 |
#endif |
528 | 2810 |
RETURN (true); |
2811 |
%} |
|
2812 |
! |
|
2813 |
||
2814 |
glxRdr2:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2815 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2816 |
to a new 2D position, passing the relative distance in the vector v." |
528 | 2817 |
|
2818 |
%{ /* NOCONTEXT */ |
|
2819 |
float vec[2], *c_v; |
|
2820 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2821 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
528 | 2822 |
SETWIN(aGLXWindowId) |
1932 | 2823 |
#ifdef OPENGL |
2824 |
#else |
|
528 | 2825 |
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
|
2826 |
#endif |
528 | 2827 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2828 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2829 |
"Modified: 22.3.1996 / 18:05:54 / cg" |
528 | 2830 |
! |
2831 |
||
2832 |
glxRdr2X: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2833 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2834 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2835 |
|
2836 |
%{ /* NOCONTEXT */ |
|
2837 |
Coord c_x, c_y; |
|
2838 |
||
2839 |
_COORD_ (x, c_x) |
|
2840 |
_COORD_ (y, c_y) |
|
2841 |
SETWIN(aGLXWindowId) |
|
1932 | 2842 |
#ifdef OPENGL |
2843 |
#else |
|
528 | 2844 |
rdr2(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2845 |
#endif |
528 | 2846 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2847 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2848 |
"Modified: 22.3.1996 / 18:06:20 / cg" |
528 | 2849 |
! |
2850 |
||
2851 |
glxRdr2iX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2852 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2853 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2854 |
|
2855 |
%{ /* NOCONTEXT */ |
|
2856 |
Icoord c_x, c_y; |
|
2857 |
||
2858 |
_ICOORD_ (x, c_x) |
|
2859 |
_ICOORD_ (y, c_y) |
|
2860 |
SETWIN(aGLXWindowId) |
|
1932 | 2861 |
#ifdef OPENGL |
2862 |
#else |
|
528 | 2863 |
rdr2i(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2864 |
#endif |
528 | 2865 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2866 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2867 |
"Modified: 22.3.1996 / 18:06:28 / cg" |
528 | 2868 |
! |
2869 |
||
2870 |
glxRdr2sX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2871 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2872 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2873 |
|
2874 |
%{ /* NOCONTEXT */ |
|
2875 |
Scoord c_x, c_y; |
|
2876 |
||
2877 |
_SCOORD_ (x, c_x) |
|
2878 |
_SCOORD_ (y, c_y) |
|
2879 |
SETWIN(aGLXWindowId) |
|
1932 | 2880 |
#ifdef OPENGL |
2881 |
#else |
|
528 | 2882 |
rdr2s(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2883 |
#endif |
528 | 2884 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2885 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2886 |
"Modified: 22.3.1996 / 18:06:34 / cg" |
528 | 2887 |
! |
2888 |
||
2889 |
glxRdr:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2890 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2891 |
to a new 3D position, passing the relative distance in the vector v." |
528 | 2892 |
|
2893 |
%{ /* NOCONTEXT */ |
|
2894 |
float vec[3], *c_v; |
|
2895 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2896 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
528 | 2897 |
SETWIN(aGLXWindowId) |
1932 | 2898 |
#ifdef OPENGL |
2899 |
#else |
|
528 | 2900 |
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
|
2901 |
#endif |
528 | 2902 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2903 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2904 |
"Modified: 22.3.1996 / 18:06:07 / cg" |
528 | 2905 |
! |
2906 |
||
2907 |
glxRdrX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2908 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2909 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2910 |
|
2911 |
%{ /* NOCONTEXT */ |
|
2912 |
Coord c_x, c_y, c_z; |
|
2913 |
||
2914 |
_COORD_ (x, c_x) |
|
2915 |
_COORD_ (y, c_y) |
|
2916 |
_COORD_ (z, c_z) |
|
2917 |
SETWIN(aGLXWindowId) |
|
1932 | 2918 |
#ifdef OPENGL |
2919 |
#else |
|
528 | 2920 |
rdr(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2921 |
#endif |
528 | 2922 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2923 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2924 |
"Modified: 22.3.1996 / 18:06:44 / cg" |
528 | 2925 |
! |
2926 |
||
2927 |
glxRdriX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2928 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2929 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2930 |
|
2931 |
%{ /* NOCONTEXT */ |
|
2932 |
Icoord c_x, c_y, c_z; |
|
2933 |
||
2934 |
_ICOORD_ (x, c_x) |
|
2935 |
_ICOORD_ (y, c_y) |
|
2936 |
_ICOORD_ (z, c_z) |
|
2937 |
SETWIN(aGLXWindowId) |
|
1932 | 2938 |
#ifdef OPENGL |
2939 |
#else |
|
528 | 2940 |
rdri(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2941 |
#endif |
528 | 2942 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2943 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2944 |
"Modified: 22.3.1996 / 18:06:51 / cg" |
528 | 2945 |
! |
2946 |
||
2947 |
glxRdrsX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2948 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2949 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2950 |
|
2951 |
%{ /* NOCONTEXT */ |
|
2952 |
Scoord c_x, c_y, c_z; |
|
2953 |
||
2954 |
_SCOORD_ (x, c_x) |
|
2955 |
_SCOORD_ (y, c_y) |
|
2956 |
_SCOORD_ (z, c_z) |
|
2957 |
SETWIN(aGLXWindowId) |
|
1932 | 2958 |
#ifdef OPENGL |
2959 |
#else |
|
528 | 2960 |
rdrs(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2961 |
#endif |
528 | 2962 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2963 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2964 |
"Modified: 22.3.1996 / 18:06:55 / cg" |
528 | 2965 |
! |
2966 |
||
2967 |
glxSetlinestyle: index in: aGLXWindowId |
|
2968 |
"set the linestyle" |
|
2969 |
||
2970 |
%{ /* NOCONTEXT */ |
|
2971 |
SETWIN(aGLXWindowId) |
|
1932 | 2972 |
#ifdef OPENGL |
2973 |
#else |
|
528 | 2974 |
setlinestyle(_shortVal(index)); |
1932 | 2975 |
#endif |
2976 |
%} |
|
528 | 2977 |
! ! |
2978 |
||
294 | 2979 |
!GLXWorkstation methodsFor:'materials & lights'! |
2980 |
||
2981 |
glxLmbind:target index:index in:aGLXWindowId |
|
2982 |
"select a material, light or lighting model. |
|
2983 |
target must be a symbol from: #material, #backMaterial, |
|
2984 |
#light0-light7 or #lightModel." |
|
2985 |
||
2986 |
%{ /* NOCONTEXT */ |
|
2987 |
#ifdef GLX |
|
2988 |
short defType; |
|
2989 |
short i_index; |
|
2990 |
||
2991 |
if (target == @symbol(material)) |
|
2992 |
defType = MATERIAL; |
|
2993 |
else if (target == @symbol(backMaterial)) |
|
2994 |
defType = BACKMATERIAL; |
|
2995 |
else if (target == @symbol(light0)) |
|
2996 |
defType = LIGHT0; |
|
2997 |
else if (target == @symbol(light1)) |
|
2998 |
defType = LIGHT1; |
|
2999 |
else if (target == @symbol(light2)) |
|
3000 |
defType = LIGHT2; |
|
3001 |
else if (target == @symbol(light3)) |
|
3002 |
defType = LIGHT3; |
|
3003 |
else if (target == @symbol(light4)) |
|
3004 |
defType = LIGHT4; |
|
3005 |
else if (target == @symbol(light5)) |
|
3006 |
defType = LIGHT5; |
|
3007 |
else if (target == @symbol(light6)) |
|
3008 |
defType = LIGHT6; |
|
3009 |
else if (target == @symbol(light7)) |
|
3010 |
defType = LIGHT7; |
|
3011 |
else if (target == @symbol(lightModel)) |
|
3012 |
defType = LMODEL; |
|
4718 | 3013 |
else { |
3014 |
RETURN (nil); |
|
294 | 3015 |
} |
3016 |
||
3017 |
_INT_ (index, i_index); |
|
3018 |
SETWIN(aGLXWindowId) |
|
3019 |
lmbind(defType, i_index); |
|
1932 | 3020 |
#endif |
3021 |
%} |
|
294 | 3022 |
! |
3023 |
||
3024 |
glxLmdef:what index:index np:np props:props in:aGLXWindowId |
|
3025 |
"define a material, light source or lighting model; |
|
3026 |
what must be one of #material, #light or #lightModel. |
|
3027 |
props must be a FloatArray or a subclass of FloatArray" |
|
3028 |
||
3029 |
%{ /* NOCONTEXT */ |
|
3030 |
#ifdef GLX |
|
3031 |
short defType; |
|
3032 |
short i_index, i_np; |
|
3033 |
float *fp; |
|
3034 |
OBJ cls; |
|
3035 |
int ninstVars, nInstBytes; |
|
3036 |
||
3037 |
if (what == @symbol(material)) |
|
3038 |
defType = DEFMATERIAL; |
|
3039 |
else if (what == @symbol(light)) |
|
3040 |
defType = DEFLIGHT; |
|
3041 |
else if (what == @symbol(lightModel)) |
|
3042 |
defType = DEFLMODEL; |
|
3043 |
else { |
|
1932 | 3044 |
RETURN (nil); |
294 | 3045 |
} |
3046 |
||
3047 |
_INT_ (index, i_index); |
|
3048 |
_INT_ (np, i_np); |
|
3049 |
||
3050 |
if (! _isNonNilObject(props)) fp = NULL; |
|
3051 |
else { |
|
3052 |
cls = __qClass(props); |
|
350 | 3053 |
if (cls == @global(FloatArray)) |
294 | 3054 |
fp = _FloatArrayInstPtr(props)->f_element; |
3055 |
else { |
|
3056 |
if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) { |
|
3057 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
3058 |
fp = (float *) &(_InstPtr(props)->i_instvars[ninstVars]); |
|
3059 |
} else { |
|
1932 | 3060 |
RETURN (nil); |
294 | 3061 |
} |
4718 | 3062 |
} |
294 | 3063 |
} |
3064 |
SETWIN(aGLXWindowId) |
|
3065 |
lmdef(defType, i_index, i_np, fp); |
|
1932 | 3066 |
#endif |
3067 |
%} |
|
294 | 3068 |
! |
3069 |
||
3070 |
glxTevbind:target index:index in:aGLXWindowId |
|
3071 |
"bind a texture environment; target must be 0 |
|
3072 |
or the symbol #env0." |
|
3073 |
||
3074 |
%{ /* NOCONTEXT */ |
|
3075 |
#ifdef GLX |
|
3076 |
long t; |
|
3077 |
||
3078 |
if (__isSmallInteger(target)) { |
|
3079 |
t = __intVal(target); |
|
3080 |
} else { |
|
3081 |
if (target == @symbol(env0)) { |
|
3082 |
t = TV_ENV0; |
|
3083 |
} else { |
|
1932 | 3084 |
RETURN (nil); |
294 | 3085 |
} |
3086 |
} |
|
3087 |
SETWIN(aGLXWindowId) |
|
3088 |
tevbind(t, __intVal(index)); |
|
1932 | 3089 |
#endif |
3090 |
%} |
|
294 | 3091 |
! |
3092 |
||
3093 |
glxTevdef:index np:np props:props in:aGLXWindowId |
|
3094 |
||
3095 |
%{ /* NOCONTEXT */ |
|
3096 |
#ifdef GLX |
|
3097 |
const float *fp; |
|
3098 |
float fbuff[30]; |
|
3099 |
||
3100 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3101 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
294 | 3102 |
tevdef(__intVal(index), __intVal(np), fp); |
1932 | 3103 |
#endif |
3104 |
%} |
|
294 | 3105 |
! |
3106 |
||
3107 |
glxTexDef2d:index nc:nc width:w height:h bits:image np:np props:props in:aGLXWindowId |
|
3108 |
"define a 2D texture. index is the 'name' of the texture; |
|
3109 |
nc is the number of components (1-4) per pixel; |
|
3110 |
w/h define the size of the texture; bits is a byteArray containing the |
|
3111 |
long-word aligned pixel data; np is the number of props found in |
|
3112 |
the floatArray props. Props must be delimited by a 0.0 entry." |
|
3113 |
||
3114 |
%{ /* NOCONTEXT */ |
|
6254 | 3115 |
#ifdef GLX |
294 | 3116 |
unsigned char *cp; |
3117 |
const float *fp; |
|
3118 |
OBJ cls; |
|
3119 |
float fbuff[30]; |
|
3120 |
||
5479
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3121 |
if (__isByteArrayLike(image)) { |
6254 | 3122 |
cp = _ByteArrayInstPtr(image)->ba_element; |
3123 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
|
3124 |
||
3125 |
SETWIN(aGLXWindowId) |
|
3126 |
texdef2d(__intVal(index), __intVal(nc), __intVal(w), __intVal(h), |
|
3127 |
(const unsigned long *)cp, __intVal(np), fp); |
|
294 | 3128 |
} |
3129 |
#endif |
|
3130 |
%} |
|
3131 |
! |
|
3132 |
||
3133 |
glxTexDef3d:index nc:nc width:w height:h depth:d bits:image np:np props:props in:aGLXWindowId |
|
3134 |
"define a 3D texture. index is the 'name' of the texture; |
|
3135 |
nc is the number of components (1-4) per pixel; |
|
3136 |
w/h/d define the size of the texture; bits is a byteArray containing the |
|
3137 |
long-word aligned pixel data; np is the number of props found in |
|
3138 |
the floatArray props. Props must be delimited by a 0.0 entry." |
|
3139 |
||
3140 |
%{ /* NOCONTEXT */ |
|
3141 |
#ifdef GLX |
|
3142 |
unsigned char *cp; |
|
3143 |
const float *fp; |
|
3144 |
OBJ cls; |
|
3145 |
float fbuff[30]; |
|
3146 |
||
5479
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3147 |
if (__isByteArrayLike(image)) { |
6254 | 3148 |
cp = _ByteArrayInstPtr(image)->ba_element; |
3149 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
|
3150 |
||
3151 |
SETWIN(aGLXWindowId) |
|
3152 |
texdef3d(__intVal(index), __intVal(nc), __intVal(w), __intVal(h), |
|
3153 |
__intVal(d), |
|
3154 |
(const unsigned long *)cp, __intVal(np), fp); |
|
294 | 3155 |
} |
3156 |
#endif |
|
3157 |
%} |
|
3158 |
! |
|
3159 |
||
3160 |
glxTexbind:target index:index in:aGLXWindowId |
|
3161 |
"bind a texture; target must be an integer or one |
|
3162 |
of the symbols #texture0, #textureDetail or #textureIdle." |
|
3163 |
||
3164 |
%{ /* NOCONTEXT */ |
|
3165 |
#ifdef GLX |
|
3166 |
long t; |
|
3167 |
||
3168 |
if (__isSmallInteger(target)) { |
|
3169 |
t = __intVal(target); |
|
3170 |
} else { |
|
3171 |
if (target == @symbol(texture0)) { |
|
3172 |
t = TX_TEXTURE_0; |
|
3173 |
} else if (target == @symbol(textureDetail)) { |
|
3174 |
t = TX_TEXTURE_DETAIL; |
|
3175 |
} else if (target == @symbol(textureIdle)) { |
|
3176 |
t = TX_TEXTURE_IDLE; |
|
3177 |
} else { |
|
1932 | 3178 |
RETURN (nil); |
294 | 3179 |
} |
3180 |
} |
|
3181 |
SETWIN(aGLXWindowId) |
|
3182 |
texbind(t, __intVal(index)); |
|
1932 | 3183 |
#endif |
3184 |
%} |
|
294 | 3185 |
! ! |
3186 |
||
3187 |
!GLXWorkstation methodsFor:'matrix stack'! |
|
3188 |
||
3189 |
glxGetMatrix:arrayOf16Floats in:aGLXWindowId |
|
3190 |
"argument must be an array (a matrix) of 16 floats. The current matrix |
|
3191 |
will be stored into that." |
|
3192 |
||
3193 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3194 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3195 |
#else |
294 | 3196 |
Matrix matrix; |
3197 |
||
3198 |
SETWIN(aGLXWindowId) |
|
3199 |
getmatrix(matrix); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3200 |
if (! __glx_putFloatsFromInto(matrix, arrayOf16Floats, 16)) RETURN(false); |
1932 | 3201 |
#endif |
3202 |
%} |
|
294 | 3203 |
! |
3204 |
||
3205 |
glxLoadMatrix:arrayOf16Floats in:aGLXWindowId |
|
3206 |
"argument must be an array(a matrix) of 16 floats. The current matrix |
|
3207 |
will be loaded from that." |
|
3208 |
||
3209 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3210 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3211 |
#else |
294 | 3212 |
Matrix matrix; |
3213 |
Matrix *m; |
|
3214 |
||
2814 | 3215 |
if (! (m = __glx_getFloatsFromMatrixInto(arrayOf16Floats, matrix))) RETURN (false); |
294 | 3216 |
SETWIN(aGLXWindowId) |
3217 |
loadmatrix(*m); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3218 |
#endif |
294 | 3219 |
%} |
3220 |
! |
|
3221 |
||
3222 |
glxMultMatrix:arrayOf16Floats in:aGLXWindowId |
|
3223 |
"argument must be an array(a matrix) of 16 floats containing a |
|
3224 |
matrix to multiply into the current matrix." |
|
3225 |
||
3226 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3227 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3228 |
#else |
294 | 3229 |
Matrix matrix; |
3230 |
Matrix *m; |
|
3231 |
||
2814 | 3232 |
if (! (m = __glx_getFloatsFromMatrixInto(arrayOf16Floats, matrix))) RETURN (false); |
294 | 3233 |
SETWIN(aGLXWindowId) |
3234 |
multmatrix(*m); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3235 |
#endif |
294 | 3236 |
%} |
3237 |
! |
|
3238 |
||
3239 |
glxPopmatrixIn:aGLXWindowId |
|
3240 |
"pop transformation stack" |
|
3241 |
||
3242 |
%{ /* NOCONTEXT */ |
|
3243 |
SETWIN(aGLXWindowId) |
|
1932 | 3244 |
#ifdef OPENGL |
3245 |
#else |
|
294 | 3246 |
popmatrix(); |
1932 | 3247 |
#endif |
294 | 3248 |
%} |
3249 |
! |
|
3250 |
||
3251 |
glxPushmatrixIn:aGLXWindowId |
|
3252 |
"push down transformation stack" |
|
3253 |
||
3254 |
%{ /* NOCONTEXT */ |
|
3255 |
SETWIN(aGLXWindowId) |
|
1932 | 3256 |
#ifdef OPENGL |
3257 |
#else |
|
294 | 3258 |
pushmatrix(); |
1932 | 3259 |
#endif |
294 | 3260 |
%} |
3261 |
! ! |
|
3262 |
||
3263 |
!GLXWorkstation methodsFor:'misc'! |
|
3264 |
||
3265 |
glxGconfigIn:aGLXWindowId |
|
3266 |
"must be sent after RGBmode, doubleBuffer etc. to have these |
|
3267 |
changes really take effect. See GLX manual. |
|
7656 | 3268 |
(Actually, it seems to be not allowed - I don't really know)" |
294 | 3269 |
|
3270 |
%{ /* NOCONTEXT */ |
|
3271 |
SETWIN(aGLXWindowId) |
|
1932 | 3272 |
#ifdef OPENGL |
3273 |
#else |
|
294 | 3274 |
gconfig(); |
1932 | 3275 |
#endif |
294 | 3276 |
%} |
3277 |
! |
|
3278 |
||
3279 |
glxMmode:aSymbol in:aGLXWindowId |
|
3280 |
"set matrix mode: #single, #viewing, #projection or #texture" |
|
3281 |
||
3282 |
%{ /* NOCONTEXT */ |
|
3283 |
#ifdef GLX |
|
3284 |
if (aSymbol == @symbol(single)) { |
|
3285 |
mmode(MSINGLE); |
|
3286 |
RETURN (true); |
|
3287 |
} |
|
3288 |
if (aSymbol == @symbol(viewing)) { |
|
3289 |
mmode(MVIEWING); |
|
3290 |
RETURN (true); |
|
3291 |
} |
|
3292 |
if (aSymbol == @symbol(projection)) { |
|
3293 |
mmode(MPROJECTION); |
|
3294 |
RETURN (true); |
|
3295 |
} |
|
3296 |
if (aSymbol == @symbol(texture)) { |
|
3297 |
mmode(MTEXTURE); |
|
3298 |
RETURN (true); |
|
3299 |
} |
|
3300 |
#endif |
|
3301 |
%} |
|
3302 |
. |
|
3303 |
^ false |
|
3304 |
! |
|
3305 |
||
3306 |
glxNmode:aSymbol in:aGLXWindowId |
|
3307 |
"set normalize mode: #auto, #normalize" |
|
3308 |
||
3309 |
%{ /* NOCONTEXT */ |
|
3310 |
#ifdef GLX |
|
3311 |
if (aSymbol == @symbol(auto)) { |
|
3312 |
nmode(NAUTO); |
|
3313 |
RETURN (true); |
|
3314 |
} |
|
3315 |
if (aSymbol == @symbol(normalize)) { |
|
3316 |
nmode(NNORMALIZE); |
|
3317 |
RETURN (true); |
|
3318 |
} |
|
3319 |
#endif |
|
3320 |
%} |
|
3321 |
. |
|
3322 |
^ false |
|
3323 |
! |
|
3324 |
||
3325 |
glxRGBmodeIn:aGLXWindowId |
|
3326 |
"set true color mode (no colormap)" |
|
3327 |
||
3328 |
%{ /* NOCONTEXT */ |
|
3329 |
#ifdef GLX |
|
3330 |
SETWIN(aGLXWindowId) |
|
3331 |
RGBmode(); |
|
3332 |
RETURN (true); |
|
3333 |
#endif |
|
3334 |
%} |
|
3335 |
. |
|
3336 |
^ false |
|
3337 |
! ! |
|
3338 |
||
3339 |
!GLXWorkstation methodsFor:'objects'! |
|
3340 |
||
3341 |
glxCallObject:obj in:aGLXWindowId |
|
3342 |
"perform the commands of an object (macro)." |
|
3343 |
||
2075 | 3344 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3345 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3346 |
#else |
294 | 3347 |
if (__isSmallInteger(obj)) { |
3348 |
SETWIN(aGLXWindowId) |
|
3349 |
callobj(_objectVal(obj)); |
|
3350 |
RETURN (true); |
|
3351 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3352 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3353 |
%}. |
294 | 3354 |
^ false |
3355 |
! |
|
3356 |
||
3357 |
glxCloseObjectIn:aGLXWindowId |
|
3358 |
"end object defnition" |
|
3359 |
||
2075 | 3360 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3361 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3362 |
#else |
294 | 3363 |
SETWIN(aGLXWindowId) |
3364 |
closeobj(); |
|
3365 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3366 |
#endif |
294 | 3367 |
%} |
3368 |
! |
|
3369 |
||
3370 |
glxDeleteObject:obj in:aGLXWindowId |
|
3371 |
||
2075 | 3372 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3373 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3374 |
#else |
1882 | 3375 |
if (__isSmallInteger(obj)) { |
4718 | 3376 |
SETWIN(aGLXWindowId) |
3377 |
delobj(_objectVal(obj)); |
|
3378 |
RETURN (true); |
|
1882 | 3379 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3380 |
#endif |
294 | 3381 |
%} |
3382 |
! |
|
3383 |
||
3384 |
glxGenObjectIn:aGLXWindowId |
|
3385 |
"return a new (free & unused) object id for use |
|
3386 |
with makeObj" |
|
3387 |
||
3388 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3389 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3390 |
#else |
294 | 3391 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3392 |
RETURN (__MKSMALLINT(genobj())); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3393 |
#endif |
294 | 3394 |
%} |
3395 |
! |
|
3396 |
||
3397 |
glxGetopenobjIn:aGLXWindowId |
|
3398 |
"return the currently open objects id; -1 if none is open" |
|
3399 |
||
3400 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3401 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3402 |
#else |
294 | 3403 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3404 |
RETURN (__MKSMALLINT(getopenobj())); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3405 |
#endif |
294 | 3406 |
%} |
3407 |
! |
|
3408 |
||
3409 |
glxIsobj:obj in:aGLXWindowId |
|
3410 |
"return true, if obj is a valid object id" |
|
3411 |
||
3412 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3413 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3414 |
#else |
294 | 3415 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3416 |
RETURN (__MKBOOLEAN(isobj(_objectVal(obj)))); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3417 |
#endif |
294 | 3418 |
%} |
3419 |
! |
|
3420 |
||
3421 |
glxMakeObject:id in:aGLXWindowId |
|
3422 |
"start object definition - |
|
3423 |
another name conflict" |
|
3424 |
||
2075 | 3425 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3426 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3427 |
#else |
294 | 3428 |
if (__isSmallInteger(id)) { |
3429 |
SETWIN(aGLXWindowId) |
|
3430 |
makeobj(_objectVal(id)); |
|
3431 |
RETURN (true); |
|
3432 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3433 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3434 |
%}. |
294 | 3435 |
^ false |
3436 |
! ! |
|
3437 |
||
3438 |
!GLXWorkstation methodsFor:'patches & surfaces'! |
|
3439 |
||
3440 |
glxBeginCurveIn:aGLXWindowId |
|
3441 |
"start a NURBS curve def - in real GL only" |
|
3442 |
||
3443 |
%{ /* NOCONTEXT */ |
|
1932 | 3444 |
SETWIN(aGLXWindowId) |
3445 |
#ifdef GLX |
|
294 | 3446 |
bgncurve(); |
1932 | 3447 |
#endif |
3448 |
%} |
|
294 | 3449 |
! |
3450 |
||
3451 |
glxBeginSurfaceIn:aGLXWindowId |
|
3452 |
"start a NURBS surface def - in real GL only" |
|
3453 |
||
3454 |
%{ /* NOCONTEXT */ |
|
1932 | 3455 |
SETWIN(aGLXWindowId) |
3456 |
#ifdef GLX |
|
294 | 3457 |
bgnsurface(); |
1932 | 3458 |
#endif |
3459 |
%} |
|
294 | 3460 |
! |
3461 |
||
3462 |
glxDefBasis:id mat:aMatrix in:aGLXWindowId |
|
528 | 3463 |
"define the basis matrix for a patch or curve" |
294 | 3464 |
|
3465 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3466 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3467 |
#else |
294 | 3468 |
Matrix matrix; |
3469 |
Matrix *m; |
|
3470 |
||
2814 | 3471 |
if (! (m = __glx_getFloatsFromMatrixInto(aMatrix, matrix))) RETURN (false); |
294 | 3472 |
if (__isSmallInteger(id)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3473 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3474 |
defbasis((short)(__intVal(id)), *m); |
294 | 3475 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3476 |
#endif |
1932 | 3477 |
%} |
528 | 3478 |
|
3479 |
"Modified: 19.3.1996 / 18:52:56 / cg" |
|
294 | 3480 |
! |
3481 |
||
3482 |
glxEndCurveIn:aGLXWindowId |
|
3483 |
"end a NURBS curve def - in real GL only" |
|
3484 |
||
3485 |
%{ /* NOCONTEXT */ |
|
1932 | 3486 |
SETWIN(aGLXWindowId) |
3487 |
#ifdef GLX |
|
294 | 3488 |
endcurve(); |
1932 | 3489 |
#endif |
3490 |
%} |
|
294 | 3491 |
! |
3492 |
||
3493 |
glxEndSurfaceIn:aGLXWindowId |
|
3494 |
"end a NURBS surface def - in real GL only" |
|
3495 |
||
3496 |
%{ /* NOCONTEXT */ |
|
1932 | 3497 |
SETWIN(aGLXWindowId) |
3498 |
#ifdef GLX |
|
294 | 3499 |
endsurface(); |
1932 | 3500 |
#endif |
3501 |
%} |
|
294 | 3502 |
! |
3503 |
||
4718 | 3504 |
glxNurbsSurfaceUKnotCount: uKnotCount uKnot: uKnot |
294 | 3505 |
vKnotCount: vKnotCount vKnot: vKnot |
4718 | 3506 |
uOffset: uOffset vOffset: vOffset |
3507 |
ctlArray: ctlArray |
|
3508 |
uOrder: uOrder vOrder: vOrder |
|
294 | 3509 |
type: type in: aGLXWindowId |
3510 |
||
3511 |
| ctlPoints i | |
|
3512 |
ctlPoints := DoubleArray new: ctlArray size * (ctlArray first size). |
|
3513 |
i := 1. |
|
3514 |
ctlArray do: [:point | |
|
4718 | 3515 |
point do: [:coord | |
294 | 3516 |
ctlPoints at: i put: coord. |
3517 |
i := i + 1]]. |
|
3518 |
||
3519 |
%{ /* NOCONTEXT */ |
|
3520 |
#ifdef GLX |
|
3521 |
char *uKnotElements, *vKnotElements, *ctlElements; |
|
3522 |
OBJ cls; |
|
3523 |
int ninstVars, nInstBytes; |
|
3524 |
||
3525 |
SETWIN(aGLXWindowId) |
|
3526 |
cls = __qClass(ctlPoints); |
|
3527 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
3528 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
|
3529 |
||
3530 |
ctlElements = (char *)(_InstPtr(ctlPoints)) + nInstBytes; |
|
3531 |
uKnotElements = (char *)(_InstPtr(uKnot)) + nInstBytes; |
|
3532 |
vKnotElements = (char *)(_InstPtr(vKnot)) + nInstBytes; |
|
3533 |
||
3534 |
nurbssurface ( |
|
3535 |
__intVal(uKnotCount), (double *)uKnotElements, |
|
3536 |
__intVal(vKnotCount), (double *)vKnotElements, |
|
3537 |
__intVal(uOffset), __intVal(vOffset), |
|
4718 | 3538 |
(double *)ctlElements, |
294 | 3539 |
__intVal(uOrder), __intVal(vOrder), __intVal(type)); |
3540 |
RETURN(true); |
|
3541 |
#endif |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3542 |
%}. |
294 | 3543 |
^ false |
3544 |
! |
|
3545 |
||
3546 |
glxPatchBasisU:u v:v in:aGLXWindowId |
|
528 | 3547 |
"set the two basis matrices for a patch" |
294 | 3548 |
|
3549 |
%{ /* NOCONTEXT */ |
|
3550 |
if (__bothSmallInteger(u, v)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3551 |
SETWIN(aGLXWindowId) |
1932 | 3552 |
#ifdef OPENGL |
3553 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3554 |
patchbasis((long)__intVal(u), (long)__intVal(v)); |
1932 | 3555 |
#endif |
294 | 3556 |
} |
1932 | 3557 |
%} |
528 | 3558 |
|
3559 |
"Modified: 19.3.1996 / 18:53:18 / cg" |
|
294 | 3560 |
! |
3561 |
||
3562 |
glxPatchCurvesU:u v:v in:aGLXWindowId |
|
528 | 3563 |
"set the number of curves to be drawn in each direction on a patch" |
294 | 3564 |
|
3565 |
%{ /* NOCONTEXT */ |
|
3566 |
if (__bothSmallInteger(u, v)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3567 |
SETWIN(aGLXWindowId) |
1932 | 3568 |
#ifdef OPENGL |
3569 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3570 |
patchcurves((long)__intVal(u), (long)__intVal(v)); |
1932 | 3571 |
#endif |
294 | 3572 |
} |
1932 | 3573 |
%} |
528 | 3574 |
|
3575 |
"Modified: 19.3.1996 / 18:53:34 / cg" |
|
294 | 3576 |
! |
3577 |
||
3578 |
glxPatchPrecisionU:u v:v in:aGLXWindowId |
|
3579 |
"set the patch precision" |
|
3580 |
||
3581 |
%{ /* NOCONTEXT */ |
|
3582 |
if (__bothSmallInteger(u, v)) { |
|
3583 |
SETWIN(aGLXWindowId) |
|
1932 | 3584 |
#ifdef OPENGL |
3585 |
#else |
|
294 | 3586 |
patchprecision((long)__intVal(u), (long)__intVal(v)); |
1932 | 3587 |
#endif |
294 | 3588 |
} |
1932 | 3589 |
%} |
294 | 3590 |
! |
3591 |
||
3592 |
glxPatchX:arrayOf16XFloats y:arrayOf16YFloats z:arrayOf16ZFloats in:aGLXWindowId |
|
528 | 3593 |
"Draws a bicubic patch. |
3594 |
arguments must be arrays of 16 floats containing the patch" |
|
294 | 3595 |
|
3596 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3597 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3598 |
#else |
294 | 3599 |
Matrix matrixX, matrixY, matrixZ; |
3600 |
Matrix *mX, *mY, *mZ; |
|
3601 |
||
4718 | 3602 |
if (! (mX = __glx_getFloatsFromMatrixInto(arrayOf16XFloats, matrixX))) |
1932 | 3603 |
RETURN (nil); |
4718 | 3604 |
if (! (mY = __glx_getFloatsFromMatrixInto(arrayOf16YFloats, matrixY))) |
1932 | 3605 |
RETURN (nil); |
4718 | 3606 |
if (! (mZ = __glx_getFloatsFromMatrixInto(arrayOf16ZFloats, matrixZ))) |
1932 | 3607 |
RETURN (nil); |
294 | 3608 |
SETWIN(aGLXWindowId) |
3609 |
patch(*mX, *mY, *mZ); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3610 |
#endif |
294 | 3611 |
%} |
528 | 3612 |
|
3613 |
"Modified: 19.3.1996 / 18:54:02 / cg" |
|
3614 |
! |
|
3615 |
||
3616 |
glxRpatchX:arrayOf16XFloats y:arrayOf16YFloats z:arrayOf16ZFloats w:arrayOf16WFloats in:aGLXWindowId |
|
3617 |
"Draws a rational bicubic patch. |
|
3618 |
arguments must be arrays of 16 floats containing the patch" |
|
3619 |
||
3620 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3621 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3622 |
#else |
529 | 3623 |
Matrix matrixX, matrixY, matrixZ, matrixW; |
3624 |
Matrix *mX, *mY, *mZ, *mW; |
|
528 | 3625 |
|
4718 | 3626 |
if (! (mX = __glx_getFloatsFromMatrixInto(arrayOf16XFloats, matrixX))) |
1932 | 3627 |
RETURN (nil); |
4718 | 3628 |
if (! (mY = __glx_getFloatsFromMatrixInto(arrayOf16YFloats, matrixY))) |
1932 | 3629 |
RETURN (nil); |
4718 | 3630 |
if (! (mZ = __glx_getFloatsFromMatrixInto(arrayOf16ZFloats, matrixZ))) |
1932 | 3631 |
RETURN (nil); |
4718 | 3632 |
if (! (mW = __glx_getFloatsFromMatrixInto(arrayOf16WFloats, matrixW))) |
1932 | 3633 |
RETURN (nil); |
529 | 3634 |
SETWIN(aGLXWindowId) |
3635 |
rpatch(*mX, *mY, *mZ, *mW); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3636 |
#endif |
528 | 3637 |
%} |
3638 |
||
3639 |
"Modified: 19.3.1996 / 18:54:02 / cg" |
|
3640 |
"Created: 19.3.1996 / 18:56:34 / cg" |
|
3641 |
! ! |
|
3642 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3643 |
!GLXWorkstation methodsFor:'pixel copy'! |
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 |
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
|
3646 |
"copy a rectangular area in the view. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3647 |
For now, this is only supported with a true GL. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3648 |
readsource specifies which plane/buffer is affected by this operation." |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3649 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3650 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3651 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3652 |
SETWIN(aGLXWindowId) |
4718 | 3653 |
rectcopy(_screencoordVal(x1), _screencoordVal(y1), |
3654 |
_screencoordVal(x2), _screencoordVal(y2), |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3655 |
_screencoordVal(newx), _screencoordVal(newy)); |
1932 | 3656 |
#endif |
3657 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3658 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3659 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3660 |
!GLXWorkstation methodsFor:'pixel reading'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3661 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3662 |
glxReadpixelsTo:dest in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3663 |
"read pixels from the view. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3664 |
Dest must be an array and gets pixel values assigned, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3665 |
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
|
3666 |
For now, pixel-reading is only supported with a true GL. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3667 |
Caveat: the number of pixels is limited to 256. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3668 |
In double buffer mode, the backBuffer is read." |
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 |
|n| |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3671 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3672 |
n := dest size. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3673 |
n > 256 ifTrue:[^ 0]. |
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 |
%{ /* STACK:1024 */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3676 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3677 |
Colorindex buffer[256]; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3678 |
int i, nRead; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3679 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3680 |
if (__isArray(dest)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3681 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3682 |
nRead = readpixels(__intVal(n), buffer); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3683 |
for (i=0; i<nRead;i++) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3684 |
__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
|
3685 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3686 |
RETURN (__MKSMALLINT(nRead)); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3687 |
} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3688 |
#endif |
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 |
^ 0 |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3691 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3692 |
"Modified: 22.3.1996 / 18:08:00 / cg" |
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3695 |
glxReadsource: src in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3696 |
"specify what is read with folowing readPixels requests. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3697 |
For now, pixel-reading is only supported with a true GL" |
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 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3700 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3701 |
OBJ s = src; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3702 |
int what; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3703 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3704 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3705 |
if (s == @symbol(auto)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3706 |
what = SRC_AUTO; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3707 |
} else if (s == @symbol(front)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3708 |
what = SRC_FRONT; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3709 |
} else if (s == @symbol(back)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3710 |
what = SRC_BACK; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3711 |
} else if (s == @symbol(zBuffer)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3712 |
what = SRC_ZBUFFER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3713 |
} else if (s == @symbol(frameGrabber)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3714 |
what = SRC_FRAMEGRABBER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3715 |
} else if (s == @symbol(over)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3716 |
what = SRC_OVER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3717 |
} else if (s == @symbol(under)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3718 |
what = SRC_UNDER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3719 |
} else if (s == @symbol(popUp)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3720 |
what = SRC_PUP; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3721 |
} else { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3722 |
what = _longVal(src); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3723 |
} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3724 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3725 |
readsource(what); |
1932 | 3726 |
#endif |
3727 |
%} |
|
538 | 3728 |
! |
3729 |
||
541 | 3730 |
glxRectreadX1:x1 y1:y1 x2:x2 y2:y2 h:viewHeight to:dest in:aGLXWindowId |
538 | 3731 |
"read pixels from a rectanglular area. |
3732 |
Dest must be an array and gets pixel values assigned, |
|
3733 |
reading n*m pixels. |
|
3734 |
For now, pixel-reading is only supported with a true GL. |
|
3735 |
Caveat: the number of pixels is limited to 256. |
|
3736 |
In double buffer mode, the backBuffer is read." |
|
3737 |
||
541 | 3738 |
|n idx sy1 sy2| |
3739 |
||
3740 |
"/ GLX's y coordinates go bottom to top ... |
|
3741 |
||
3742 |
sy1 := viewHeight - y1. |
|
3743 |
sy2 := viewHeight - y2. |
|
538 | 3744 |
|
3745 |
n := (x2 - x1 + 1) * (y2 - y1 + 1). |
|
3746 |
n > 256 ifTrue:[^ 0]. |
|
3747 |
dest size < n ifTrue:[^ 0]. |
|
3748 |
||
3749 |
%{ /* STACK:1024 */ |
|
3750 |
#ifdef GLX |
|
3751 |
Colorindex buffer[256]; |
|
3752 |
int i, nRead; |
|
3753 |
||
3754 |
if (__isArray(dest) |
|
3755 |
&& __isSmallInteger(x1) && __isSmallInteger(x2) |
|
541 | 3756 |
&& __isSmallInteger(sy1) && __isSmallInteger(sy2) |
538 | 3757 |
) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3758 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3759 |
nRead = rectread(__intVal(x1), __intVal(sy1), |
4718 | 3760 |
__intVal(x2), __intVal(sy2), |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3761 |
buffer); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3762 |
for (i=0; i<nRead;i++) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3763 |
__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
|
3764 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3765 |
RETURN (__MKSMALLINT(nRead)); |
538 | 3766 |
} |
3767 |
#endif |
|
3768 |
%}. |
|
3769 |
"/ |
|
3770 |
"/ ok, this is not a GL - use XWorkstations pixel read method |
|
3771 |
"/ and convert |
|
3772 |
"/ |
|
3773 |
idx := 1. |
|
3774 |
y1 to:y2 do:[:y | |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3775 |
x1 to:x2 do:[:x | |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3776 |
|pix| |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3777 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3778 |
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
|
3779 |
dest at:idx put:pix |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3780 |
] |
538 | 3781 |
]. |
3782 |
^ n |
|
3783 |
||
3784 |
"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
|
3785 |
|
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 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3788 |
glxXColorToGLColor:pixel |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3789 |
"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
|
3790 |
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
|
3791 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3792 |
%{ /* NOCONTEXT */ |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3793 |
#ifdef VGL |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3794 |
if (__isSmallInteger(pixel)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3795 |
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
|
3796 |
} |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3797 |
#endif |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3798 |
%}. |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3799 |
^ pixel |
543
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 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3802 |
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
|
3803 |
"special for VGL" |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3804 |
|
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 |
#ifdef VGL |
1932 | 3807 |
if (__bothSmallInteger(x, y)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3808 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3809 |
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
|
3810 |
} |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3811 |
#endif |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3812 |
%}. |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3813 |
^ 0 |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3814 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3815 |
"Modified: 22.3.1996 / 18:08:00 / cg" |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3816 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3817 |
|
528 | 3818 |
!GLXWorkstation methodsFor:'points'! |
3819 |
||
3820 |
glxPnt2X: x y: y in: aGLXWindowId |
|
3821 |
"plot a point in x, y, 0." |
|
3822 |
||
3823 |
%{ /* NOCONTEXT */ |
|
3824 |
Coord c_x, c_y; |
|
3825 |
||
3826 |
_COORD_ (x, c_x) |
|
3827 |
_COORD_ (y, c_y) |
|
3828 |
SETWIN(aGLXWindowId) |
|
1932 | 3829 |
#ifdef OPENGL |
3830 |
#else |
|
528 | 3831 |
pnt2(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3832 |
#endif |
528 | 3833 |
%} |
3834 |
||
3835 |
"Modified: 19.3.1996 / 18:35:55 / cg" |
|
3836 |
! |
|
3837 |
||
3838 |
glxPnt2iX: x y: y in: aGLXWindowId |
|
3839 |
"plot a point in x, y, 0." |
|
3840 |
||
3841 |
%{ /* NOCONTEXT */ |
|
3842 |
Icoord c_x, c_y; |
|
3843 |
||
3844 |
_ICOORD_ (x, c_x) |
|
3845 |
_ICOORD_ (y, c_y) |
|
3846 |
SETWIN(aGLXWindowId) |
|
1932 | 3847 |
#ifdef OPENGL |
3848 |
#else |
|
528 | 3849 |
pnt2i(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3850 |
#endif |
528 | 3851 |
%} |
3852 |
||
3853 |
"Modified: 19.3.1996 / 18:35:59 / cg" |
|
3854 |
! |
|
3855 |
||
3856 |
glxPnt2sX: x y: y in: aGLXWindowId |
|
3857 |
"plot a point in x, y, 0." |
|
3858 |
||
3859 |
%{ /* NOCONTEXT */ |
|
3860 |
Scoord c_x, c_y; |
|
3861 |
||
3862 |
_SCOORD_ (x, c_x) |
|
3863 |
_SCOORD_ (y, c_y) |
|
3864 |
SETWIN(aGLXWindowId) |
|
1932 | 3865 |
#ifdef OPENGL |
3866 |
#else |
|
528 | 3867 |
pnt2s(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3868 |
#endif |
528 | 3869 |
%} |
3870 |
||
3871 |
"Modified: 19.3.1996 / 18:36:03 / cg" |
|
3872 |
! |
|
3873 |
||
3874 |
glxPntX: x y: y z: z in: aGLXWindowId |
|
3875 |
"plot a point in x, y, z." |
|
3876 |
||
3877 |
%{ /* NOCONTEXT */ |
|
3878 |
Coord c_x, c_y, c_z; |
|
3879 |
||
3880 |
_COORD_ (x, c_x) |
|
3881 |
_COORD_ (y, c_y) |
|
3882 |
_COORD_ (z, c_z) |
|
3883 |
SETWIN(aGLXWindowId) |
|
1932 | 3884 |
#ifdef OPENGL |
3885 |
#else |
|
528 | 3886 |
pnt(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3887 |
#endif |
528 | 3888 |
%} |
3889 |
||
3890 |
"Modified: 19.3.1996 / 18:36:08 / cg" |
|
3891 |
! |
|
3892 |
||
3893 |
glxPntiX: x y: y z: z in: aGLXWindowId |
|
3894 |
"plot a point in x, y, z." |
|
3895 |
||
3896 |
%{ /* NOCONTEXT */ |
|
3897 |
Icoord c_x, c_y, c_z; |
|
3898 |
||
3899 |
_ICOORD_ (x, c_x) |
|
3900 |
_ICOORD_ (y, c_y) |
|
3901 |
_ICOORD_ (z, c_z) |
|
3902 |
SETWIN(aGLXWindowId) |
|
1932 | 3903 |
#ifdef OPENGL |
3904 |
#else |
|
528 | 3905 |
pnti(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3906 |
#endif |
528 | 3907 |
%} |
3908 |
||
3909 |
"Modified: 19.3.1996 / 18:36:14 / cg" |
|
3910 |
! |
|
3911 |
||
3912 |
glxPntsX: x y: y z: z in: aGLXWindowId |
|
3913 |
"plot a point in x, y, z." |
|
3914 |
||
3915 |
%{ /* NOCONTEXT */ |
|
3916 |
Scoord c_x, c_y, c_z; |
|
3917 |
||
3918 |
_SCOORD_ (x, c_x) |
|
3919 |
_SCOORD_ (y, c_y) |
|
3920 |
_SCOORD_ (z, c_z) |
|
3921 |
SETWIN(aGLXWindowId) |
|
1932 | 3922 |
#ifdef OPENGL |
3923 |
#else |
|
528 | 3924 |
pnts(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3925 |
#endif |
528 | 3926 |
%} |
3927 |
||
3928 |
"Modified: 19.3.1996 / 18:36:17 / cg" |
|
3929 |
! |
|
3930 |
||
3931 |
glxPntsize: n in: aGLXWindowId |
|
3932 |
||
3933 |
%{ /* NOCONTEXT */ |
|
1932 | 3934 |
SETWIN(aGLXWindowId) |
3935 |
#ifdef GLX |
|
528 | 3936 |
pntsize(_shortVal(n)); |
1932 | 3937 |
#endif |
3938 |
%} |
|
528 | 3939 |
! |
3940 |
||
3941 |
glxPntsizef: n in: aGLXWindowId |
|
3942 |
||
3943 |
%{ /* NOCONTEXT */ |
|
1932 | 3944 |
SETWIN(aGLXWindowId) |
3945 |
#ifdef GLX |
|
528 | 3946 |
pntsizef(_floatVal(n)); |
1932 | 3947 |
#endif |
3948 |
%} |
|
528 | 3949 |
! ! |
3950 |
||
3951 |
!GLXWorkstation methodsFor:'polygons'! |
|
3952 |
||
3953 |
glxBackface: b in: aGLXWindowId |
|
4718 | 3954 |
"enable/disable culling of backfacing polygons (suppress its drawing). |
528 | 3955 |
A polygon is backfacing if it's orientation in *screen* coords is clockwise" |
3956 |
||
3957 |
%{ /* NOCONTEXT */ |
|
3958 |
SETWIN(aGLXWindowId) |
|
1932 | 3959 |
#ifdef OPENGL |
3960 |
#else |
|
528 | 3961 |
backface(_booleanVal(b)); |
1932 | 3962 |
#endif |
528 | 3963 |
%} |
3964 |
||
3965 |
"Modified: 19.3.1996 / 18:26:50 / cg" |
|
3966 |
! |
|
3967 |
||
3968 |
glxConcave: b in: aGLXWindowId |
|
3969 |
"signal wether or not polygons are concave" |
|
3970 |
||
3971 |
%{ /* NOCONTEXT */ |
|
3972 |
SETWIN(aGLXWindowId) |
|
1932 | 3973 |
#ifdef OPENGL |
3974 |
#else |
|
528 | 3975 |
concave(_booleanVal(b)); |
1932 | 3976 |
#endif |
528 | 3977 |
%} |
3978 |
! |
|
3979 |
||
3980 |
glxFrontface: b in: aGLXWindowId |
|
4718 | 3981 |
"enable/disable culling of frontfacing polygons (suppress its drawing). |
3982 |
A polygon is frontfacing if it's orientation in *screen* coords is |
|
528 | 3983 |
anti-clockwise" |
3984 |
||
3985 |
||
3986 |
%{ /* NOCONTEXT */ |
|
3987 |
SETWIN(aGLXWindowId) |
|
1932 | 3988 |
#ifdef OPENGL |
3989 |
#else |
|
528 | 3990 |
frontface(_booleanVal(b)); |
1932 | 3991 |
#endif |
3992 |
%} |
|
528 | 3993 |
! |
3994 |
||
3995 |
glxPdr2X: x y: y in: aGLXWindowId |
|
3996 |
"add another vertex to the polygon" |
|
3997 |
||
3998 |
%{ /* NOCONTEXT */ |
|
3999 |
Coord c_x, c_y; |
|
4000 |
||
4001 |
_COORD_ (x, c_x) |
|
4002 |
_COORD_ (y, c_y) |
|
4003 |
SETWIN(aGLXWindowId) |
|
1932 | 4004 |
#ifdef OPENGL |
4005 |
#else |
|
528 | 4006 |
pdr2(c_x, c_y); |
1932 | 4007 |
#endif |
4008 |
%} |
|
528 | 4009 |
! |
4010 |
||
4011 |
glxPdr2iX: x y: y in: aGLXWindowId |
|
4012 |
"add another vertex to the polygon" |
|
4013 |
||
4014 |
%{ /* NOCONTEXT */ |
|
4015 |
Icoord c_x, c_y; |
|
4016 |
||
4017 |
_ICOORD_ (x, c_x) |
|
4018 |
_ICOORD_ (y, c_y) |
|
4019 |
SETWIN(aGLXWindowId) |
|
1932 | 4020 |
#ifdef OPENGL |
4021 |
#else |
|
528 | 4022 |
pdr2i(c_x, c_y); |
1932 | 4023 |
#endif |
528 | 4024 |
%} |
4025 |
||
4026 |
"Modified: 19.3.1996 / 18:33:28 / cg" |
|
4027 |
! |
|
4028 |
||
4029 |
glxPdr2sX: x y: y in: aGLXWindowId |
|
4030 |
"add another vertex to the polygon" |
|
4031 |
||
4032 |
%{ /* NOCONTEXT */ |
|
4033 |
Scoord c_x, c_y; |
|
4034 |
||
4035 |
_SCOORD_ (x, c_x) |
|
4036 |
_SCOORD_ (y, c_y) |
|
4037 |
SETWIN(aGLXWindowId) |
|
1932 | 4038 |
#ifdef OPENGL |
4039 |
#else |
|
528 | 4040 |
pdr2s(c_x, c_y); |
1932 | 4041 |
#endif |
528 | 4042 |
%} |
4043 |
||
4044 |
"Modified: 19.3.1996 / 18:34:03 / cg" |
|
4045 |
! |
|
4046 |
||
4047 |
glxPdrX: x y: y z: z in: aGLXWindowId |
|
4048 |
"add another vertex to the polygon" |
|
4049 |
||
4050 |
%{ /* NOCONTEXT */ |
|
4051 |
Coord c_x, c_y, c_z; |
|
4052 |
||
4053 |
_COORD_ (x, c_x) |
|
4054 |
_COORD_ (y, c_y) |
|
4055 |
_COORD_ (z, c_z) |
|
4056 |
SETWIN(aGLXWindowId) |
|
1932 | 4057 |
#ifdef OPENGL |
4058 |
#else |
|
528 | 4059 |
pdr(c_x, c_y, c_z); |
1932 | 4060 |
#endif |
528 | 4061 |
%} |
4062 |
||
4063 |
"Modified: 19.3.1996 / 18:34:06 / cg" |
|
4064 |
! |
|
4065 |
||
4066 |
glxPdriX: x y: y z: z in: aGLXWindowId |
|
4067 |
"add another vertex to the polygon" |
|
4068 |
||
4069 |
%{ /* NOCONTEXT */ |
|
4070 |
Icoord c_x, c_y, c_z; |
|
4071 |
||
4072 |
_ICOORD_ (x, c_x) |
|
4073 |
_ICOORD_ (y, c_y) |
|
4074 |
_ICOORD_ (z, c_z) |
|
4075 |
SETWIN(aGLXWindowId) |
|
1932 | 4076 |
#ifdef OPENGL |
4077 |
#else |
|
528 | 4078 |
pdri(c_x, c_y, c_z); |
1932 | 4079 |
#endif |
528 | 4080 |
%} |
4081 |
||
4082 |
"Modified: 19.3.1996 / 18:34:11 / cg" |
|
4083 |
! |
|
4084 |
||
4085 |
glxPdrsX: x y: y z: z in: aGLXWindowId |
|
4086 |
"add another vertex to the polygon" |
|
4087 |
||
4088 |
%{ /* NOCONTEXT */ |
|
4089 |
Scoord c_x, c_y, c_z; |
|
4090 |
||
4091 |
_SCOORD_ (x, c_x) |
|
4092 |
_SCOORD_ (y, c_y) |
|
4093 |
_SCOORD_ (z, c_z) |
|
4094 |
SETWIN(aGLXWindowId) |
|
1932 | 4095 |
#ifdef OPENGL |
4096 |
#else |
|
528 | 4097 |
pdrs(c_x, c_y, c_z); |
1932 | 4098 |
#endif |
528 | 4099 |
%} |
4100 |
||
4101 |
"Modified: 19.3.1996 / 18:34:14 / cg" |
|
4102 |
! |
|
4103 |
||
4104 |
glxPmv2X: x y: y in: aGLXWindowId |
|
4105 |
"set the start position of a polygon" |
|
4106 |
||
4107 |
%{ /* NOCONTEXT */ |
|
4108 |
Coord c_x, c_y; |
|
4109 |
||
4110 |
_COORD_ (x, c_x) |
|
4111 |
_COORD_ (y, c_y) |
|
4112 |
SETWIN(aGLXWindowId) |
|
1932 | 4113 |
#ifdef OPENGL |
4114 |
#else |
|
528 | 4115 |
pmv2(c_x, c_y); |
1932 | 4116 |
#endif |
528 | 4117 |
%} |
4118 |
||
4119 |
"Modified: 19.3.1996 / 18:32:45 / cg" |
|
4120 |
! |
|
4121 |
||
4122 |
glxPmv2iX: x y: y in: aGLXWindowId |
|
4123 |
"set the start position of a polygon" |
|
4124 |
||
4125 |
%{ /* NOCONTEXT */ |
|
4126 |
Icoord c_x, c_y; |
|
4127 |
||
4128 |
_ICOORD_ (x, c_x) |
|
4129 |
_ICOORD_ (y, c_y) |
|
4130 |
SETWIN(aGLXWindowId) |
|
1932 | 4131 |
#ifdef OPENGL |
4132 |
#else |
|
528 | 4133 |
pmv2i(c_x, c_y); |
1932 | 4134 |
#endif |
528 | 4135 |
%} |
4136 |
||
4137 |
"Modified: 19.3.1996 / 18:32:42 / cg" |
|
4138 |
! |
|
4139 |
||
4140 |
glxPmv2sX: x y: y in: aGLXWindowId |
|
4141 |
"set the start position of a polygon" |
|
4142 |
||
4143 |
%{ /* NOCONTEXT */ |
|
4144 |
Scoord c_x, c_y; |
|
4145 |
||
4146 |
_SCOORD_ (x, c_x) |
|
4147 |
_SCOORD_ (y, c_y) |
|
4148 |
SETWIN(aGLXWindowId) |
|
1932 | 4149 |
#ifdef OPENGL |
4150 |
#else |
|
528 | 4151 |
pmv2s(c_x, c_y); |
1932 | 4152 |
#endif |
528 | 4153 |
%} |
4154 |
||
4155 |
"Modified: 19.3.1996 / 18:32:38 / cg" |
|
4156 |
! |
|
4157 |
||
4158 |
glxPmvX: x y: y z: z in: aGLXWindowId |
|
4159 |
"set the start position of a polygon" |
|
4160 |
||
4161 |
%{ /* NOCONTEXT */ |
|
4162 |
Coord c_x, c_y, c_z; |
|
4163 |
||
4164 |
_COORD_ (x, c_x) |
|
4165 |
_COORD_ (y, c_y) |
|
4166 |
_COORD_ (z, c_z) |
|
4167 |
SETWIN(aGLXWindowId) |
|
1932 | 4168 |
#ifdef OPENGL |
4169 |
#else |
|
528 | 4170 |
pmv(c_x, c_y, c_z); |
1932 | 4171 |
#endif |
528 | 4172 |
%} |
4173 |
||
4174 |
"Modified: 19.3.1996 / 18:31:52 / cg" |
|
4175 |
! |
|
4176 |
||
4177 |
glxPmviX: x y: y z: z in: aGLXWindowId |
|
4178 |
"set the start position of a polygon" |
|
4179 |
||
4180 |
%{ /* NOCONTEXT */ |
|
4181 |
Icoord c_x, c_y, c_z; |
|
4182 |
||
4183 |
_ICOORD_ (x, c_x) |
|
4184 |
_ICOORD_ (y, c_y) |
|
4185 |
_ICOORD_ (z, c_z) |
|
4186 |
SETWIN(aGLXWindowId) |
|
1932 | 4187 |
#ifdef OPENGL |
4188 |
#else |
|
528 | 4189 |
pmvi(c_x, c_y, c_z); |
1932 | 4190 |
#endif |
528 | 4191 |
%} |
4192 |
||
4193 |
"Modified: 19.3.1996 / 18:31:59 / cg" |
|
4194 |
! |
|
4195 |
||
4196 |
glxPmvsX: x y: y z: z in: aGLXWindowId |
|
4197 |
"set the start position of a polygon" |
|
4198 |
||
4199 |
%{ /* NOCONTEXT */ |
|
4200 |
Scoord c_x, c_y, c_z; |
|
4201 |
||
4202 |
_SCOORD_ (x, c_x) |
|
4203 |
_SCOORD_ (y, c_y) |
|
4204 |
_SCOORD_ (z, c_z) |
|
4205 |
SETWIN(aGLXWindowId) |
|
1932 | 4206 |
#ifdef OPENGL |
4207 |
#else |
|
528 | 4208 |
pmvs(c_x, c_y, c_z); |
1932 | 4209 |
#endif |
528 | 4210 |
%} |
4211 |
||
4212 |
"Modified: 19.3.1996 / 18:32:03 / cg" |
|
4213 |
! |
|
4214 |
||
4215 |
glxPolymode: mode in: aGLXWindowId |
|
4216 |
"Sets the polygon filling mode - only filled (1) or outlined (0) |
|
4217 |
are supported" |
|
4218 |
||
4219 |
%{ /* NOCONTEXT */ |
|
4220 |
SETWIN(aGLXWindowId) |
|
1932 | 4221 |
#ifdef OPENGL |
4222 |
#else |
|
528 | 4223 |
polymode(_longVal(mode)); |
1932 | 4224 |
#endif |
528 | 4225 |
%} |
4226 |
||
4227 |
"Modified: 19.3.1996 / 18:29:32 / cg" |
|
4228 |
! |
|
4229 |
||
4230 |
glxRpdr2X: x y: y in: aGLXWindowId |
|
4231 |
"add another relative vertex to the polygon" |
|
4232 |
||
4233 |
%{ /* NOCONTEXT */ |
|
4234 |
Coord c_x, c_y; |
|
4235 |
||
4236 |
_COORD_ (x, c_x) |
|
4237 |
_COORD_ (y, c_y) |
|
4238 |
SETWIN(aGLXWindowId) |
|
1932 | 4239 |
#ifdef OPENGL |
4240 |
#else |
|
528 | 4241 |
rpdr2(c_x, c_y); |
1932 | 4242 |
#endif |
528 | 4243 |
%} |
4244 |
||
4245 |
"Modified: 19.3.1996 / 18:34:31 / cg" |
|
4246 |
! |
|
4247 |
||
4248 |
glxRpdr2iX: x y: y in: aGLXWindowId |
|
4249 |
"add another relative vertex to the polygon" |
|
4250 |
||
4251 |
%{ /* NOCONTEXT */ |
|
4252 |
Icoord c_x, c_y; |
|
4253 |
||
4254 |
_ICOORD_ (x, c_x) |
|
4255 |
_ICOORD_ (y, c_y) |
|
4256 |
SETWIN(aGLXWindowId) |
|
1932 | 4257 |
#ifdef OPENGL |
4258 |
#else |
|
528 | 4259 |
rpdr2i(c_x, c_y); |
1932 | 4260 |
#endif |
528 | 4261 |
%} |
4262 |
||
4263 |
"Modified: 19.3.1996 / 18:34:36 / cg" |
|
4264 |
! |
|
4265 |
||
4266 |
glxRpdr2sX: x y: y in: aGLXWindowId |
|
4267 |
"add another relative vertex to the polygon" |
|
4268 |
||
4269 |
%{ /* NOCONTEXT */ |
|
4270 |
Scoord c_x, c_y; |
|
4271 |
||
4272 |
_SCOORD_ (x, c_x) |
|
4273 |
_SCOORD_ (y, c_y) |
|
4274 |
SETWIN(aGLXWindowId) |
|
1932 | 4275 |
#ifdef OPENGL |
4276 |
#else |
|
528 | 4277 |
rpdr2s(c_x, c_y); |
1932 | 4278 |
#endif |
528 | 4279 |
%} |
4280 |
||
4281 |
"Modified: 19.3.1996 / 18:34:40 / cg" |
|
4282 |
! |
|
4283 |
||
4284 |
glxRpdrX: x y: y z: z in: aGLXWindowId |
|
4285 |
"add another relative vertex to the polygon" |
|
4286 |
||
4287 |
%{ /* NOCONTEXT */ |
|
4288 |
Coord c_x, c_y, c_z; |
|
4289 |
||
4290 |
_COORD_ (x, c_x) |
|
4291 |
_COORD_ (y, c_y) |
|
4292 |
_COORD_ (z, c_z) |
|
4293 |
SETWIN(aGLXWindowId) |
|
1932 | 4294 |
#ifdef OPENGL |
4295 |
#else |
|
528 | 4296 |
rpdr(c_x, c_y, c_z); |
1932 | 4297 |
#endif |
528 | 4298 |
%} |
4299 |
||
4300 |
"Modified: 19.3.1996 / 18:34:48 / cg" |
|
4301 |
! |
|
4302 |
||
4303 |
glxRpdriX: x y: y z: z in: aGLXWindowId |
|
4304 |
"add another relative vertex to the polygon" |
|
4305 |
||
4306 |
%{ /* NOCONTEXT */ |
|
4307 |
Icoord c_x, c_y, c_z; |
|
4308 |
||
4309 |
_ICOORD_ (x, c_x) |
|
4310 |
_ICOORD_ (y, c_y) |
|
4311 |
_ICOORD_ (z, c_z) |
|
4312 |
SETWIN(aGLXWindowId) |
|
1932 | 4313 |
#ifdef OPENGL |
4314 |
#else |
|
528 | 4315 |
rpdri(c_x, c_y, c_z); |
1932 | 4316 |
#endif |
528 | 4317 |
%} |
4318 |
||
4319 |
"Modified: 19.3.1996 / 18:34:51 / cg" |
|
4320 |
! |
|
4321 |
||
4322 |
glxRpdrsX: x y: y z: z in: aGLXWindowId |
|
4323 |
"add another relative vertex to the polygon" |
|
4324 |
||
4325 |
%{ /* NOCONTEXT */ |
|
4326 |
Scoord c_x, c_y, c_z; |
|
4327 |
||
4328 |
_SCOORD_ (x, c_x) |
|
4329 |
_SCOORD_ (y, c_y) |
|
4330 |
_SCOORD_ (z, c_z) |
|
4331 |
SETWIN(aGLXWindowId) |
|
1932 | 4332 |
#ifdef OPENGL |
4333 |
#else |
|
528 | 4334 |
rpdrs(c_x, c_y, c_z); |
1932 | 4335 |
#endif |
528 | 4336 |
%} |
4337 |
||
4338 |
"Modified: 19.3.1996 / 18:34:55 / cg" |
|
4339 |
! |
|
4340 |
||
4341 |
glxRpmv2X: x y: y in: aGLXWindowId |
|
4342 |
"set the start position of a polygon" |
|
4343 |
||
4344 |
%{ /* NOCONTEXT */ |
|
4345 |
Coord c_x, c_y; |
|
4346 |
||
4347 |
_COORD_ (x, c_x) |
|
4348 |
_COORD_ (y, c_y) |
|
4349 |
SETWIN(aGLXWindowId) |
|
1932 | 4350 |
#ifdef OPENGL |
4351 |
#else |
|
528 | 4352 |
rpmv2(c_x, c_y); |
1932 | 4353 |
#endif |
528 | 4354 |
%} |
4355 |
||
4356 |
"Modified: 19.3.1996 / 18:37:15 / cg" |
|
4357 |
! |
|
4358 |
||
4359 |
glxRpmv2iX: x y: y in: aGLXWindowId |
|
4360 |
"set the start position of a polygon" |
|
4361 |
||
4362 |
%{ /* NOCONTEXT */ |
|
4363 |
Icoord c_x, c_y; |
|
4364 |
||
4365 |
_ICOORD_ (x, c_x) |
|
4366 |
_ICOORD_ (y, c_y) |
|
4367 |
SETWIN(aGLXWindowId) |
|
1932 | 4368 |
#ifdef OPENGL |
4369 |
#else |
|
528 | 4370 |
rpmv2i(c_x, c_y); |
1932 | 4371 |
#endif |
528 | 4372 |
%} |
4373 |
||
4374 |
"Modified: 19.3.1996 / 18:37:20 / cg" |
|
4375 |
! |
|
4376 |
||
4377 |
glxRpmv2sX: x y: y in: aGLXWindowId |
|
4378 |
"set the relative start position of a polygon" |
|
4379 |
||
4380 |
%{ /* NOCONTEXT */ |
|
4381 |
Scoord c_x, c_y; |
|
4382 |
||
4383 |
_SCOORD_ (x, c_x) |
|
4384 |
_SCOORD_ (y, c_y) |
|
4385 |
SETWIN(aGLXWindowId) |
|
1932 | 4386 |
#ifdef OPENGL |
4387 |
#else |
|
528 | 4388 |
rpmv2s(c_x, c_y); |
1932 | 4389 |
#endif |
528 | 4390 |
%} |
4391 |
||
4392 |
"Modified: 19.3.1996 / 18:38:06 / cg" |
|
4393 |
! |
|
4394 |
||
4395 |
glxRpmvX: x y: y z: z in: aGLXWindowId |
|
4396 |
"set the relative start position of a polygon" |
|
4397 |
||
4398 |
%{ /* NOCONTEXT */ |
|
4399 |
Coord c_x, c_y, c_z; |
|
4400 |
||
4401 |
_COORD_ (x, c_x) |
|
4402 |
_COORD_ (y, c_y) |
|
4403 |
_COORD_ (z, c_z) |
|
4404 |
SETWIN(aGLXWindowId) |
|
1932 | 4405 |
#ifdef OPENGL |
4406 |
#else |
|
528 | 4407 |
rpmv(c_x, c_y, c_z); |
1932 | 4408 |
#endif |
528 | 4409 |
%} |
4410 |
||
4411 |
"Modified: 19.3.1996 / 18:38:03 / cg" |
|
4412 |
! |
|
4413 |
||
4414 |
glxRpmviX: x y: y z: z in: aGLXWindowId |
|
4415 |
"set the relative start position of a polygon" |
|
4416 |
||
4417 |
%{ /* NOCONTEXT */ |
|
4418 |
Icoord c_x, c_y, c_z; |
|
4419 |
||
4420 |
_ICOORD_ (x, c_x) |
|
4421 |
_ICOORD_ (y, c_y) |
|
4422 |
_ICOORD_ (z, c_z) |
|
4423 |
SETWIN(aGLXWindowId) |
|
1932 | 4424 |
#ifdef OPENGL |
4425 |
#else |
|
528 | 4426 |
rpmvi(c_x, c_y, c_z); |
1932 | 4427 |
#endif |
528 | 4428 |
%} |
4429 |
||
4430 |
"Modified: 19.3.1996 / 18:37:53 / cg" |
|
4431 |
! |
|
4432 |
||
4433 |
glxRpmvsX: x y: y z: z in: aGLXWindowId |
|
4434 |
"set the relative start position of a polygon" |
|
4435 |
||
4436 |
%{ /* NOCONTEXT */ |
|
4437 |
Scoord c_x, c_y, c_z; |
|
4438 |
||
4439 |
_SCOORD_ (x, c_x) |
|
4440 |
_SCOORD_ (y, c_y) |
|
4441 |
_SCOORD_ (z, c_z) |
|
4442 |
SETWIN(aGLXWindowId) |
|
1932 | 4443 |
#ifdef OPENGL |
4444 |
#else |
|
528 | 4445 |
rpmvs(c_x, c_y, c_z); |
1932 | 4446 |
#endif |
528 | 4447 |
%} |
4448 |
||
4449 |
"Modified: 19.3.1996 / 18:37:58 / cg" |
|
294 | 4450 |
! ! |
4451 |
||
24 | 4452 |
!GLXWorkstation methodsFor:'queries'! |
4453 |
||
159 | 4454 |
glVersion |
4455 |
"return a string describing the GL version. |
|
4456 |
For informative use only; portable applications do not depend |
|
4457 |
on the returned string." |
|
4458 |
||
4459 |
%{ /* NOCONTEXT */ |
|
4460 |
#ifdef VGL |
|
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
4461 |
RETURN (__MKSTRING("vogl")); |
159 | 4462 |
#else |
1932 | 4463 |
# ifdef GLX |
159 | 4464 |
char buffer[128]; |
4465 |
||
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4466 |
if (_INST(glOK) == true) { |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4467 |
gversion(buffer); |
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
4468 |
RETURN (__MKSTRING(buffer)); |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4469 |
} |
1932 | 4470 |
RETURN (nil); |
4471 |
# else |
|
4472 |
RETURN (nil); |
|
4473 |
# endif |
|
159 | 4474 |
#endif |
4475 |
%} |
|
4476 |
||
4477 |
" |
|
4718 | 4478 |
Display glVersion |
159 | 4479 |
" |
4480 |
! |
|
4481 |
||
528 | 4482 |
glxGetplanesIn: aGLXWindowId |
4483 |
"Returns the number if bit planes available on the device." |
|
4484 |
||
4485 |
%{ /* NOCONTEXT */ |
|
1932 | 4486 |
SETWIN(aGLXWindowId) |
4487 |
#ifdef OPENGL |
|
4488 |
#else |
|
528 | 4489 |
RETURN (__MKSMALLINT(getplanes())); |
4490 |
#endif |
|
1932 | 4491 |
%}. |
4492 |
^ 0 |
|
528 | 4493 |
|
4494 |
"Modified: 19.3.1996 / 18:50:44 / cg" |
|
4495 |
! |
|
4496 |
||
294 | 4497 |
hasStereoExtension |
4498 |
"return true, if this workstation supports stereo GL drawing. |
|
4499 |
Both the server must support it, and the feature must have been |
|
4500 |
enabled in the smalltalk system, for true to be returned." |
|
4501 |
||
4502 |
^ hasStereoExtension |
|
4503 |
||
4504 |
" |
|
4718 | 4505 |
Display hasStereoExtension |
294 | 4506 |
" |
4507 |
! |
|
4508 |
||
3214 | 4509 |
isOpenGL |
4510 |
"return true, if this is an openGL (as opposed to a GL)" |
|
4511 |
||
4512 |
%{ /* NOCONTEXT */ |
|
4513 |
#ifdef OPENGL |
|
4514 |
RETURN ( true ); |
|
4515 |
#else |
|
4516 |
RETURN ( false ); |
|
4517 |
#endif |
|
4518 |
%} |
|
4519 |
! |
|
4520 |
||
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4521 |
isTrueGL |
1932 | 4522 |
"return true, if this is a true GL (as opposed to a simulated VOGL). |
4523 |
Returns false for all openGL systems." |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4524 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4525 |
%{ /* NOCONTEXT */ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4526 |
#ifdef VGL |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4527 |
RETURN ( false ); |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4528 |
#else |
1932 | 4529 |
# ifdef GLX |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4530 |
RETURN ( true ); |
1932 | 4531 |
# endif |
4532 |
#endif |
|
3214 | 4533 |
%}. |
4534 |
^ false |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4535 |
! |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4536 |
|
294 | 4537 |
maxZValue |
4538 |
"return the max. Z value (only valid if z-buffer is supported)" |
|
4718 | 4539 |
%{ |
1932 | 4540 |
#ifndef OPENGL |
4541 |
# ifdef GD_ZMAX |
|
294 | 4542 |
long zMax; |
4543 |
||
4544 |
if (_INST(glOK) == true) { |
|
4545 |
zMax = getgdesc(GD_ZMAX); |
|
4546 |
||
4547 |
if ((zMax >= _MIN_INT) && (zMax <= _MAX_INT)) { |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4548 |
RETURN ( __MKSMALLINT(zMax) ); |
294 | 4549 |
} |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4550 |
RETURN ( __MKLARGEINT(zMax) ); |
294 | 4551 |
} |
1932 | 4552 |
# endif |
294 | 4553 |
#endif |
4554 |
%}. |
|
4555 |
^ nil |
|
4556 |
! |
|
4557 |
||
4558 |
supportsDoubleBuffer |
|
4559 |
"return true, if this gl workstation supports double buffering. |
|
157 | 4560 |
For portable applications, always combine this with a query |
4561 |
if the display supports GL drawing at all." |
|
24 | 4562 |
|
4563 |
%{ /* NOCONTEXT */ |
|
294 | 4564 |
|
1932 | 4565 |
#ifndef OPENGL |
4566 |
# ifdef VGL |
|
4567 |
RETURN (true); |
|
4568 |
# else |
|
4569 |
# ifdef GD_BITS_NORM_DBL_RED |
|
294 | 4570 |
if (getgdesc(GD_BITS_NORM_DBL_RED) != 0) { |
4571 |
RETURN ( _INST(glOK) ); |
|
4572 |
} |
|
1932 | 4573 |
# endif |
4574 |
# endif |
|
24 | 4575 |
#endif |
89 | 4576 |
%}. |
4577 |
^ false |
|
4578 |
||
4579 |
" |
|
4718 | 4580 |
Display supportsDoubleBuffer |
294 | 4581 |
" |
4582 |
! |
|
4583 |
||
4584 |
supportsGLDrawing |
|
4585 |
"return true, if this device supports 3D GL drawing." |
|
4586 |
||
4587 |
^ glOK |
|
4588 |
||
4589 |
" |
|
4718 | 4590 |
Display supportsGLDrawing |
89 | 4591 |
" |
64 | 4592 |
! |
4593 |
||
4594 |
supportsLight |
|
157 | 4595 |
"return true, if this gl workstation supports light sources |
4596 |
(i.e. if its a real GL). |
|
4597 |
For portable applications, always combine this with a query |
|
4598 |
if the display supports GL drawing at all." |
|
89 | 4599 |
|
4600 |
%{ /* NOCONTEXT */ |
|
64 | 4601 |
#ifdef GLX |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4602 |
RETURN ( _INST(glOK) ); |
64 | 4603 |
#endif |
89 | 4604 |
%}. |
4605 |
^ false |
|
4606 |
||
4607 |
" |
|
4718 | 4608 |
Display supportsLight |
89 | 4609 |
" |
4610 |
! |
|
4611 |
||
294 | 4612 |
supportsRGB |
4613 |
"return true, if this gl workstation supports rgb |
|
4614 |
(in addition to indexed) colors. Actually, we return true |
|
4615 |
for a real GL engine, false for the simulator here. |
|
4616 |
For portable applications, always combine this with a query |
|
4617 |
if the display supports GL drawing at all." |
|
4618 |
||
4619 |
%{ /* NOCONTEXT */ |
|
4620 |
#ifdef GLX |
|
4621 |
RETURN ( _INST(glOK) ); |
|
4622 |
#endif |
|
4623 |
%}. |
|
4624 |
^ false |
|
4625 |
||
4626 |
" |
|
4718 | 4627 |
Display supportsRGB |
294 | 4628 |
" |
4629 |
! |
|
4630 |
||
89 | 4631 |
supportsTextures |
4632 |
"return true, if this gl workstation supports texture mapping |
|
157 | 4633 |
(i.e. if its a real GL). |
4634 |
For portable applications, always combine this with a query |
|
4635 |
if the display supports GL drawing at all." |
|
89 | 4636 |
|
4637 |
%{ /* NOCONTEXT */ |
|
1932 | 4638 |
#ifndef OPENGL |
4639 |
# ifdef GD_TEXTURE |
|
89 | 4640 |
if (getgdesc(GD_TEXTURE) != 0) { |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4641 |
RETURN ( _INST(glOK) ); |
89 | 4642 |
} |
1932 | 4643 |
# endif |
89 | 4644 |
#endif |
4645 |
%}. |
|
4646 |
^ false |
|
4647 |
||
4648 |
" |
|
4718 | 4649 |
Display supportsTextures |
89 | 4650 |
" |
4651 |
! |
|
4652 |
||
4653 |
supportsZBuffer |
|
157 | 4654 |
"return true, if this gl workstation has z buffer support. |
4655 |
For portable applications, always combine this with a query |
|
4656 |
if the display supports GL drawing at all." |
|
4657 |
||
89 | 4658 |
%{ /* NOCONTEXT */ |
4659 |
||
1932 | 4660 |
#ifndef OPENGL |
4661 |
# ifdef GD_BITS_NORM_ZBUFFER |
|
89 | 4662 |
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
|
4663 |
RETURN ( _INST(glOK) ); |
89 | 4664 |
} |
1932 | 4665 |
# endif |
89 | 4666 |
#endif |
4667 |
%}. |
|
4668 |
^ false |
|
4669 |
||
4670 |
" |
|
4718 | 4671 |
Display supportsZBuffer |
89 | 4672 |
" |
294 | 4673 |
! ! |
4674 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4675 |
!GLXWorkstation methodsFor:'rectangles'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4676 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4677 |
glxRectX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4678 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4679 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4680 |
SETWIN(aGLXWindowId) |
1932 | 4681 |
#ifdef OPENGL |
4682 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4683 |
rect(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
1932 | 4684 |
#endif |
537
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4688 |
glxRectfX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4689 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4690 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4691 |
SETWIN(aGLXWindowId) |
1932 | 4692 |
#ifdef OPENGL |
4693 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4694 |
rectf(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
1932 | 4695 |
#endif |
537
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4699 |
glxRectfiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4700 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4701 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4702 |
SETWIN(aGLXWindowId) |
1932 | 4703 |
#ifdef OPENGL |
4704 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4705 |
rectfi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
1932 | 4706 |
#endif |
537
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4710 |
glxRectfsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4711 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4712 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4713 |
SETWIN(aGLXWindowId) |
1932 | 4714 |
#ifdef OPENGL |
4715 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4716 |
rectfs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
1932 | 4717 |
#endif |
537
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4721 |
glxRectiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4722 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4723 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4724 |
SETWIN(aGLXWindowId) |
1932 | 4725 |
#ifdef OPENGL |
4726 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4727 |
recti(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
1932 | 4728 |
#endif |
537
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4732 |
glxRectsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4733 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4734 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4735 |
SETWIN(aGLXWindowId) |
1932 | 4736 |
#ifdef OPENGL |
4737 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4738 |
rects(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
1932 | 4739 |
#endif |
537
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 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4742 |
|
528 | 4743 |
!GLXWorkstation methodsFor:'spheres'! |
294 | 4744 |
|
4745 |
glxSphDraw:arrayOf4Floats in:aGLXWindowId |
|
4746 |
"argument must be an array(a matrix) of 4 floats containing the |
|
4747 |
sphere - in real GL only" |
|
4748 |
||
4749 |
%{ /* NOCONTEXT */ |
|
4750 |
#ifdef GLX |
|
4751 |
float vec[4], *v; |
|
4752 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4753 |
if (! (v = __glx_getFloatsFromInto(arrayOf4Floats, vec, 4))) RETURN(false); |
294 | 4754 |
SETWIN(aGLXWindowId) |
4755 |
sphdraw(v); |
|
1932 | 4756 |
#endif |
4757 |
%} |
|
294 | 4758 |
! |
4759 |
||
4760 |
glxSphDrawX:x y:y z:z radius:r in:aGLXWindowId |
|
4761 |
"arguments must be convertable to floats - in real GL only" |
|
4762 |
||
4763 |
%{ /* NOCONTEXT */ |
|
4764 |
#ifdef GLX |
|
4765 |
float vec[4]; |
|
4766 |
||
4767 |
_FLOAT_(x, vec[0]) |
|
4768 |
_FLOAT_(y, vec[1]) |
|
4769 |
_FLOAT_(z, vec[2]) |
|
4770 |
_FLOAT_(r, vec[3]) |
|
4771 |
SETWIN(aGLXWindowId) |
|
4772 |
sphdraw(vec); |
|
1932 | 4773 |
#endif |
4774 |
%} |
|
294 | 4775 |
! |
4776 |
||
4777 |
glxSphfreeIn: aGLXWindowId |
|
4778 |
||
4779 |
%{ /* NOCONTEXT */ |
|
4780 |
#ifdef GLX |
|
4781 |
SETWIN(aGLXWindowId) |
|
4782 |
sphfree(); |
|
1932 | 4783 |
#endif |
4784 |
%} |
|
294 | 4785 |
! |
4786 |
||
4787 |
glxSphgnpolysIn: aGLXWindowId |
|
4788 |
||
4789 |
%{ /* NOCONTEXT */ |
|
4790 |
#ifdef GLX |
|
4791 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4792 |
RETURN (__MKSMALLINT(sphgnpolys())); |
294 | 4793 |
#endif |
4794 |
%} |
|
4795 |
! |
|
4796 |
||
4797 |
glxSphmode: attribute value: value in: aGLXWindowId |
|
4798 |
||
4799 |
%{ /* NOCONTEXT */ |
|
4800 |
#ifdef GLX |
|
4801 |
SETWIN(aGLXWindowId) |
|
4802 |
sphmode(__intVal(attribute), __intVal(value)); |
|
1932 | 4803 |
#endif |
4804 |
%} |
|
294 | 4805 |
! |
4806 |
||
4807 |
glxSphobj: objid in: aGLXWindowId |
|
4808 |
||
4809 |
%{ /* NOCONTEXT */ |
|
4810 |
#ifdef GLX |
|
4811 |
SETWIN(aGLXWindowId) |
|
4812 |
sphobj(_objectVal(objid)); |
|
1932 | 4813 |
#endif |
4814 |
%} |
|
294 | 4815 |
! |
4816 |
||
4817 |
glxSphrotmatrix: mat in: aGLXWindowId |
|
4818 |
||
4819 |
%{ /* NOCONTEXT */ |
|
4820 |
#ifdef GLX |
|
4821 |
Matrix matrix, *m; |
|
4822 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4823 |
if (! (m = __glx_getFloatsFromMatrixInto(mat, &matrix))) RETURN (false); |
294 | 4824 |
SETWIN(aGLXWindowId) |
4825 |
sphrotmatrix(*m); |
|
1932 | 4826 |
#endif |
4827 |
%} |
|
294 | 4828 |
! ! |
4829 |
||
4830 |
!GLXWorkstation methodsFor:'stereo extension'! |
|
4831 |
||
528 | 4832 |
glxLeftbuffer: bool in: aGLXWindowId |
4833 |
||
4834 |
%{ /* NOCONTEXT */ |
|
4835 |
#ifdef FULL_GLX |
|
4836 |
SETWIN(aGLXWindowId) |
|
4837 |
leftbuffer(_booleanVal(bool)); |
|
1932 | 4838 |
#endif |
4839 |
%} |
|
528 | 4840 |
! |
4841 |
||
4842 |
glxMonobufferIn: aGLXWindowId |
|
4843 |
||
4844 |
%{ /* NOCONTEXT */ |
|
4845 |
#ifdef FULL_GLX |
|
4846 |
SETWIN(aGLXWindowId) |
|
4847 |
monobuffer(); |
|
1932 | 4848 |
#endif |
4849 |
%} |
|
528 | 4850 |
! |
4851 |
||
4852 |
glxRightbuffer: bool in: aGLXWindowId |
|
4853 |
||
4854 |
%{ /* NOCONTEXT */ |
|
4855 |
#ifdef FULL_GLX |
|
4856 |
SETWIN(aGLXWindowId) |
|
4857 |
rightbuffer(_booleanVal(bool)); |
|
1932 | 4858 |
#endif |
4859 |
%} |
|
528 | 4860 |
! |
4861 |
||
294 | 4862 |
stereoExtensionBuffer:aBufferSymbol for:aWindowId |
4863 |
"set the current stereo buffer; the argument may be one of: |
|
4864 |
#left -> STEREO_BUFFER_LEFT |
|
4865 |
#right -> STEREO_BUFFER_RIGHT |
|
4866 |
" |
|
4867 |
||
4868 |
%{ /* NOCONTEXT */ |
|
4869 |
#if defined(XSGIStereo) && defined(GLX) |
|
4870 |
Status status; |
|
4871 |
int buffer; |
|
4872 |
Window win; |
|
4873 |
||
4718 | 4874 |
if (ISCONNECTED |
294 | 4875 |
&& __isExternalAddress(aWindowId)) { |
4876 |
win = _WindowVal(aWindowId); |
|
4877 |
if (aBufferSymbol == @symbol(left)) { |
|
4878 |
buffer = STEREO_BUFFER_LEFT; |
|
4879 |
} else { |
|
4880 |
if (aBufferSymbol == @symbol(right)) { |
|
4881 |
buffer = STEREO_BUFFER_RIGHT; |
|
4882 |
} else { |
|
4883 |
goto bad; |
|
4884 |
} |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4885 |
} |
294 | 4886 |
status = XSGISetStereoBuffer(myDpy, win, buffer); |
4887 |
RETURN ( status ? true : false); |
|
4888 |
} |
|
4889 |
bad: ; |
|
4890 |
#endif |
|
4891 |
%}. |
|
4892 |
self primitiveFailed |
|
4893 |
||
4894 |
" |
|
4895 |
|t v| |
|
4896 |
||
4897 |
t := StandardSystemView new. |
|
4898 |
t extent:300@300. |
|
4899 |
v := GLXView origin:0.0@0.0 corner:1.0@1.0 in:t. |
|
4900 |
t openAndWait. |
|
4901 |
||
4718 | 4902 |
v device stereoExtensionBuffer:#left for:(v id). |
294 | 4903 |
(Delay forSeconds:10) wait. |
4718 | 4904 |
v device stereoExtensionBuffer:#right for:(v id). |
294 | 4905 |
" |
4906 |
! |
|
4907 |
||
4908 |
stereoExtensionMode:aModeSymbol height:h offset:o for:aWindowId |
|
4909 |
"set the current stereo mode; the argument may be one of: |
|
4910 |
nil/false #off -> turn it off |
|
4911 |
#bottom -> STEREO_BOTTOM |
|
4912 |
#top -> STEREO_TOP |
|
4913 |
" |
|
4914 |
||
4915 |
%{ /* NOCONTEXT */ |
|
4916 |
#if defined(XSGIStereo) && defined(GLX) |
|
4917 |
Status status; |
|
4918 |
int mode; |
|
4919 |
unsigned short us_h, us_o; |
|
4920 |
Window win; |
|
4921 |
||
4718 | 4922 |
if (ISCONNECTED |
294 | 4923 |
&& __bothSmallInteger(h, o) |
4924 |
&& __isExternalAddress(aWindowId)) { |
|
4925 |
win = _WindowVal(aWindowId); |
|
4926 |
if ((aModeSymbol == nil) |
|
4927 |
|| (aModeSymbol == false) |
|
4928 |
|| (aModeSymbol == @symbol(off))) { |
|
4929 |
mode = STEREO_OFF; |
|
4930 |
} else { |
|
4931 |
if (aModeSymbol == @symbol(bottom)) { |
|
4932 |
mode = STEREO_BOTTOM; |
|
4933 |
} else { |
|
4934 |
if (aModeSymbol == @symbol(top)) { |
|
4935 |
mode = STEREO_TOP; |
|
4936 |
} else { |
|
4937 |
goto bad; |
|
4938 |
} |
|
4939 |
} |
|
4940 |
} |
|
4941 |
us_h = __intVal(h); |
|
4942 |
us_o = __intVal(o); |
|
4943 |
status = XSGISetStereoMode(myDpy, win, us_h, us_o, mode); |
|
4944 |
RETURN ( status ? true : false); |
|
4945 |
} |
|
4946 |
bad: ; |
|
4947 |
#endif |
|
4948 |
%}. |
|
4949 |
self primitiveFailed |
|
4950 |
||
4951 |
" |
|
4718 | 4952 |
Display stereoExtensionMode:#top height:492 offset:532 for:(Display rootWindowId). |
294 | 4953 |
(Delay forSeconds:10) wait. |
4718 | 4954 |
Display stereoExtensionMode:#off height:0 offset:0 for:(Display rootWindowId). |
294 | 4955 |
" |
4956 |
! |
|
4957 |
||
4958 |
stereoExtensionModeIn:aWindowId |
|
4959 |
"return the current stereo mode for some window" |
|
4960 |
||
4961 |
%{ /* NOCONTEXT */ |
|
4962 |
#if defined(XSGIStereo) && defined(GLX) |
|
4963 |
int mode; |
|
4964 |
Window win; |
|
4965 |
||
4966 |
if (ISCONNECTED && __isExternalAddress(aWindowId)) { |
|
4967 |
win = _WindowVal(aWindowId); |
|
4968 |
mode = XSGIQueryStereoMode(myDpy, win); |
|
4969 |
switch (mode) { |
|
4970 |
case STEREO_OFF: |
|
4971 |
RETURN ( @symbol(off) ); |
|
4972 |
case STEREO_BOTTOM: |
|
4973 |
RETURN ( @symbol(bottom) ); |
|
4974 |
case STEREO_TOP: |
|
4975 |
RETURN ( @symbol(top) ); |
|
4976 |
} |
|
4977 |
RETURN ( @symbol(unsupported) ); |
|
4978 |
} |
|
4979 |
#endif |
|
4980 |
%}. |
|
4981 |
self primitiveFailed |
|
4982 |
||
4983 |
" |
|
4984 |
|v| |
|
4985 |
||
4986 |
v := StandardSystemView new. |
|
4987 |
v extent:300@300. |
|
4988 |
v openAndWait. |
|
4989 |
v device stereoExtensionModeIn:(v id) |
|
4990 |
||
4718 | 4991 |
Display stereoExtensionModeIn:Display rootWindowId |
294 | 4992 |
" |
4993 |
! |
|
4994 |
||
4995 |
stereoExtensionVersion |
|
4996 |
"return the stereo extensions version as an array consisting of |
|
4997 |
major and minor numbers." |
|
4998 |
||
4999 |
%{ /* NOCONTEXT */ |
|
5000 |
#if defined(XSGIStereo) && defined(GLX) |
|
5001 |
Status status; |
|
5002 |
Display *dpy = myDpy; |
|
5003 |
int major, minor; |
|
5004 |
||
5005 |
if (ISCONNECTED) { |
|
5006 |
status = XSGIStereoQueryVersion(myDpy, &major, &minor); |
|
5007 |
if (status == True) { |
|
5008 |
RETURN ( __ARRAY_WITH2(__MKSMALLINT(major), __MKSMALLINT(minor))); |
|
5009 |
} |
|
89 | 5010 |
} |
5011 |
#endif |
|
5012 |
%}. |
|
294 | 5013 |
self primitiveFailed |
185 | 5014 |
|
5015 |
" |
|
294 | 5016 |
Display stereoExtensionVersion |
185 | 5017 |
" |
24 | 5018 |
! ! |
5019 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5020 |
!GLXWorkstation methodsFor:'texture data transfer'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5021 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5022 |
glxT2d: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5023 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5024 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5025 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5026 |
double vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5027 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5028 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5029 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5030 |
t2d(c_v); |
1932 | 5031 |
#endif |
5032 |
%} |
|
537
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5035 |
glxT2f: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5036 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5037 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5038 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5039 |
float vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5040 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5041 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5042 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5043 |
t2f(c_v); |
1932 | 5044 |
#endif |
5045 |
%} |
|
537
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5048 |
glxT2i: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5049 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5050 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5051 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5052 |
long vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5053 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5054 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5055 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5056 |
t2i(c_v); |
1932 | 5057 |
#endif |
5058 |
%} |
|
537
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5061 |
glxT2s: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5062 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5063 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5064 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5065 |
short vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5066 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5067 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5068 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5069 |
t2s(c_v); |
1932 | 5070 |
#endif |
5071 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5072 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5073 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5074 |
glxT3d:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5075 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5076 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5077 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5078 |
double vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5079 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5080 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5081 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5082 |
t3d(c_v); |
1932 | 5083 |
#endif |
5084 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5085 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5086 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5087 |
glxT3f:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5088 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5089 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5090 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5091 |
float vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5092 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5093 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5094 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5095 |
t3f(c_v); |
1932 | 5096 |
#endif |
5097 |
%} |
|
537
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5100 |
glxT3i:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5101 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5102 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5103 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5104 |
long vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5105 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5106 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5107 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5108 |
t3i(c_v); |
1932 | 5109 |
#endif |
5110 |
%} |
|
537
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5113 |
glxT3s:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5114 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5115 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5116 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5117 |
short vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5118 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5119 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5120 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5121 |
t3s(c_v); |
1932 | 5122 |
#endif |
5123 |
%} |
|
537
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5126 |
glxT4d: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5127 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5128 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5129 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5130 |
double vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5131 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5132 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5133 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5134 |
t4d(c_v); |
1932 | 5135 |
#endif |
5136 |
%} |
|
537
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5139 |
glxT4f: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5140 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5141 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5142 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5143 |
float vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5144 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5145 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5146 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5147 |
t4f(c_v); |
1932 | 5148 |
#endif |
5149 |
%} |
|
537
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5152 |
glxT4i: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5153 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5154 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5155 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5156 |
long vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5157 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5158 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5159 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5160 |
t4i(c_v); |
1932 | 5161 |
#endif |
5162 |
%} |
|
537
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 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5165 |
glxT4s: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5166 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5167 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5168 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5169 |
short vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5170 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5171 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5172 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5173 |
t4s(c_v); |
1932 | 5174 |
#endif |
5175 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5176 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5177 |
|
294 | 5178 |
!GLXWorkstation methodsFor:'transformations'! |
5179 |
||
5180 |
glxRotate:angle axis:axis in:aGLXWindowId |
|
5181 |
"rotate the current matrix around the axis given by the axis arg, |
|
5182 |
which must be one of the symbols: #x, #y or #z. |
|
5183 |
The angle is in degrees." |
|
5184 |
||
5185 |
%{ /* NOCONTEXT */ |
|
5186 |
||
5187 |
char c_axis; |
|
5188 |
||
5189 |
if (axis == @symbol(x)) |
|
5190 |
c_axis = 'x'; |
|
5191 |
else if (axis == @symbol(y)) |
|
5192 |
c_axis = 'y'; |
|
5193 |
else if (axis == @symbol(z)) |
|
5194 |
c_axis = 'z'; |
|
5195 |
else { |
|
5196 |
RETURN (false); |
|
5197 |
} |
|
5198 |
||
5199 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5200 |
RETURN ( __glx_doRotate(angle, c_axis) ); |
294 | 5201 |
%} |
5202 |
! |
|
5203 |
||
5204 |
glxRotate:arrayOf3Floats in:aGLXWindowId |
|
5205 |
"rotate current matrix, given a 3-element vector (or more). |
|
5206 |
The elements of the array are degrees." |
|
5207 |
||
5208 |
%{ /* NOCONTEXT */ |
|
5209 |
||
5210 |
float vec[3], *v; |
|
5211 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5212 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5213 |
|
5214 |
SETWIN(aGLXWindowId) |
|
1932 | 5215 |
#ifdef OPENGL |
5216 |
#else |
|
294 | 5217 |
rot(v[0], 'x'); |
5218 |
rot(v[1], 'y'); |
|
5219 |
rot(v[2], 'z'); |
|
1932 | 5220 |
#endif |
294 | 5221 |
%} |
5222 |
! |
|
5223 |
||
5224 |
glxRotateI:angle axis:axis in:aGLXWindowId |
|
5225 |
"rotate the current matrix around the axis given by the axis arg, |
|
5226 |
which must be one of the symbols: #x, #y or #z. |
|
5227 |
The angle is an integer specifying tenths of a degree." |
|
5228 |
||
5229 |
%{ /* NOCONTEXT */ |
|
5230 |
||
5231 |
char c_axis; |
|
5232 |
||
5233 |
if (axis == @symbol(x)) |
|
5234 |
c_axis = 'x'; |
|
5235 |
else if (axis == @symbol(y)) |
|
5236 |
c_axis = 'y'; |
|
5237 |
else if (axis == @symbol(z)) |
|
5238 |
c_axis = 'z'; |
|
5239 |
else { |
|
5240 |
RETURN (false); |
|
5241 |
} |
|
5242 |
||
5243 |
if (__isSmallInteger(angle)) { |
|
5244 |
SETWIN(aGLXWindowId) |
|
1932 | 5245 |
#ifdef OPENGL |
5246 |
#else |
|
294 | 5247 |
rotate(__intVal(angle), c_axis); |
1932 | 5248 |
#endif |
294 | 5249 |
} |
5250 |
%} |
|
5251 |
! |
|
5252 |
||
5253 |
glxRotateIX:angle in:aGLXWindowId |
|
5254 |
"rotate the current matrix on x axis. |
|
5255 |
The angle is an integer specifying tenths of a degree." |
|
5256 |
||
5257 |
%{ /* NOCONTEXT */ |
|
5258 |
||
5259 |
if (__isSmallInteger(angle)) { |
|
5260 |
SETWIN(aGLXWindowId) |
|
1932 | 5261 |
#ifdef OPENGL |
5262 |
#else |
|
294 | 5263 |
rotate(__intVal(angle), 'x'); |
1932 | 5264 |
#endif |
294 | 5265 |
} |
5266 |
%} |
|
5267 |
! |
|
5268 |
||
5269 |
glxRotateIX:xAngle y:yAngle z:zAngle in:aGLXWindowId |
|
5270 |
"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
|
5271 |
The values are smallIntegers specifying tenths of a degree." |
294 | 5272 |
|
5273 |
%{ /* NOCONTEXT */ |
|
5274 |
||
5275 |
if (__bothSmallInteger(xAngle, yAngle) |
|
5276 |
&& __isSmallInteger(zAngle)) { |
|
5277 |
SETWIN(aGLXWindowId) |
|
1932 | 5278 |
#ifdef OPENGL |
5279 |
#else |
|
294 | 5280 |
rotate(__intVal(xAngle), 'x'); |
5281 |
rotate(__intVal(yAngle), 'y'); |
|
5282 |
rotate(__intVal(zAngle), 'z'); |
|
1932 | 5283 |
#endif |
294 | 5284 |
} |
5285 |
%} |
|
5286 |
! |
|
5287 |
||
5288 |
glxRotateIY:angle in:aGLXWindowId |
|
5289 |
"rotate the current matrix on x axis. |
|
5290 |
The angle is an integer specifying tenths of a degree." |
|
5291 |
||
5292 |
%{ /* NOCONTEXT */ |
|
5293 |
||
5294 |
if (__isSmallInteger(angle)) { |
|
5295 |
SETWIN(aGLXWindowId) |
|
1932 | 5296 |
#ifdef OPENGL |
5297 |
#else |
|
294 | 5298 |
rotate(__intVal(angle), 'y'); |
1932 | 5299 |
#endif |
294 | 5300 |
} |
5301 |
%} |
|
5302 |
! |
|
5303 |
||
5304 |
glxRotateIZ:angle in:aGLXWindowId |
|
5305 |
"rotate the current matrix on x axis. |
|
5306 |
The angle is an integer specifying tenths of a degree." |
|
5307 |
||
5308 |
%{ /* NOCONTEXT */ |
|
5309 |
||
5310 |
if (__isSmallInteger(angle)) { |
|
5311 |
SETWIN(aGLXWindowId) |
|
1932 | 5312 |
#ifdef OPENGL |
5313 |
#else |
|
294 | 5314 |
rotate(__intVal(angle), 'z'); |
1932 | 5315 |
#endif |
294 | 5316 |
} |
5317 |
%} |
|
5318 |
! |
|
5319 |
||
5320 |
glxRotateX:angle in:aGLXWindowId |
|
5321 |
"rotate the current matrix on x axis. |
|
5322 |
The angle is in degrees." |
|
5323 |
||
5324 |
%{ /* NOCONTEXT */ |
|
5325 |
||
5326 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5327 |
RETURN (__glx_doRotate(angle, 'x')); |
294 | 5328 |
%} |
5329 |
! |
|
5330 |
||
5331 |
glxRotateX:xAngle y:yAngle z:zAngle in:aGLXWindowId |
|
5332 |
"rotate the current matrix on all axes, given individual x, y and z values. |
|
5333 |
The values are in degrees" |
|
5334 |
||
5335 |
%{ /* NOCONTEXT */ |
|
5336 |
||
5337 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5338 |
if ( __glx_doRotate(xAngle, 'x') == true) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5339 |
if ( __glx_doRotate(yAngle, 'y') == true) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5340 |
RETURN (__glx_doRotate(zAngle, 'z')); |
294 | 5341 |
} |
5342 |
} |
|
5343 |
%} |
|
5344 |
! |
|
5345 |
||
5346 |
glxRotateY:angle in:aGLXWindowId |
|
5347 |
"rotate the current matrix on y axis. |
|
5348 |
The angle is in degrees." |
|
5349 |
||
5350 |
%{ /* NOCONTEXT */ |
|
5351 |
||
5352 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5353 |
RETURN (__glx_doRotate(angle, 'y')); |
294 | 5354 |
%} |
5355 |
! |
|
5356 |
||
5357 |
glxRotateZ:angle in:aGLXWindowId |
|
5358 |
"rotate the current matrix on z axis. |
|
5359 |
The angle is in degrees." |
|
5360 |
||
5361 |
%{ /* NOCONTEXT */ |
|
5362 |
||
5363 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5364 |
RETURN (__glx_doRotate(angle, 'z')); |
294 | 5365 |
%} |
5366 |
! |
|
5367 |
||
5368 |
glxScale:arrayOf3Floats in:aGLXWindowId |
|
5369 |
"scale current matrix, given a 3-element vector" |
|
5370 |
||
5371 |
%{ /* NOCONTEXT */ |
|
5372 |
||
5373 |
float vec[3], *v; |
|
5374 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5375 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5376 |
|
5377 |
SETWIN(aGLXWindowId) |
|
1932 | 5378 |
#ifdef OPENGL |
5379 |
#else |
|
294 | 5380 |
scale(v[0], v[1], v[2]); |
1932 | 5381 |
#endif |
294 | 5382 |
%} |
5383 |
! |
|
5384 |
||
5385 |
glxScaleX:x in:aGLXWindowId |
|
5386 |
"scale in x direction" |
|
5387 |
||
5388 |
%{ /* NOCONTEXT */ |
|
5389 |
||
5390 |
float f_x; |
|
5391 |
||
5392 |
_FLOAT_ (x, f_x) |
|
5393 |
SETWIN(aGLXWindowId) |
|
1932 | 5394 |
#ifdef OPENGL |
5395 |
#else |
|
294 | 5396 |
scale(f_x, (float)0, (float)0); |
1932 | 5397 |
#endif |
294 | 5398 |
%} |
5399 |
! |
|
5400 |
||
5401 |
glxScaleX:x y:y z:z in:aGLXWindowId |
|
5402 |
"scale & mirror current matrix, given individual x, y and z values" |
|
5403 |
||
5404 |
%{ /* NOCONTEXT */ |
|
5405 |
||
5406 |
float f_x, f_y, f_z; |
|
5407 |
||
5408 |
_FLOAT_ (x, f_x) |
|
5409 |
_FLOAT_ (y, f_y) |
|
5410 |
_FLOAT_ (z, f_z) |
|
5411 |
SETWIN(aGLXWindowId) |
|
1932 | 5412 |
#ifdef OPENGL |
5413 |
#else |
|
294 | 5414 |
scale(f_x, f_y, f_z); |
1932 | 5415 |
#endif |
294 | 5416 |
%} |
5417 |
! |
|
5418 |
||
5419 |
glxScaleY:y in:aGLXWindowId |
|
5420 |
"scale in y direction" |
|
5421 |
||
5422 |
%{ /* NOCONTEXT */ |
|
5423 |
||
5424 |
float f_y; |
|
5425 |
||
5426 |
_FLOAT_ (y, f_y) |
|
5427 |
SETWIN(aGLXWindowId) |
|
1932 | 5428 |
#ifdef OPENGL |
5429 |
#else |
|
294 | 5430 |
scale((float)0, f_y, (float)0); |
1932 | 5431 |
#endif |
294 | 5432 |
%} |
5433 |
! |
|
5434 |
||
5435 |
glxScaleZ:z in:aGLXWindowId |
|
5436 |
"scale in z direction" |
|
5437 |
||
5438 |
%{ /* NOCONTEXT */ |
|
5439 |
||
5440 |
float f_z; |
|
5441 |
||
5442 |
_FLOAT_ (z, f_z) |
|
5443 |
SETWIN(aGLXWindowId) |
|
1932 | 5444 |
#ifdef OPENGL |
5445 |
#else |
|
294 | 5446 |
scale((float)0, (float)0, f_z); |
1932 | 5447 |
#endif |
294 | 5448 |
%} |
5449 |
! |
|
5450 |
||
5451 |
glxTranslate:arrayOf3Floats in:aGLXWindowId |
|
5452 |
"translate current matrix, given a 3-element vector" |
|
5453 |
||
5454 |
%{ /* NOCONTEXT */ |
|
5455 |
||
5456 |
float vec[3], *v; |
|
5457 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5458 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5459 |
|
5460 |
SETWIN(aGLXWindowId) |
|
1932 | 5461 |
#ifdef OPENGL |
5462 |
#else |
|
294 | 5463 |
translate((Coord)(v[0]), (Coord)(v[1]), (Coord)(v[2])); |
1932 | 5464 |
#endif |
294 | 5465 |
%} |
5466 |
! |
|
5467 |
||
5468 |
glxTranslateX:x in:aGLXWindowId |
|
5469 |
"translate current matrix on X axis" |
|
5470 |
||
5471 |
%{ /* NOCONTEXT */ |
|
5472 |
||
5473 |
Coord c_x; |
|
5474 |
||
5475 |
_COORD_ (x, c_x) |
|
5476 |
SETWIN(aGLXWindowId) |
|
1932 | 5477 |
#ifdef OPENGL |
5478 |
#else |
|
294 | 5479 |
translate(c_x, (Coord)0, (Coord)0); |
1932 | 5480 |
#endif |
294 | 5481 |
%} |
5482 |
! |
|
5483 |
||
5484 |
glxTranslateX:x y:y z:z in:aGLXWindowId |
|
5485 |
"translate current matrix, given individual x, y and z values" |
|
5486 |
||
5487 |
%{ /* NOCONTEXT */ |
|
5488 |
||
5489 |
Coord c_x, c_y, c_z; |
|
5490 |
||
5491 |
_COORD_ (x, c_x) |
|
5492 |
_COORD_ (y, c_y) |
|
5493 |
_COORD_ (z, c_z) |
|
5494 |
SETWIN(aGLXWindowId) |
|
1932 | 5495 |
#ifdef OPENGL |
5496 |
#else |
|
294 | 5497 |
translate(c_x, c_y, c_z); |
1932 | 5498 |
#endif |
294 | 5499 |
%} |
5500 |
! |
|
5501 |
||
5502 |
glxTranslateY:y in:aGLXWindowId |
|
5503 |
"translate current matrix on Y axis" |
|
5504 |
||
5505 |
%{ /* NOCONTEXT */ |
|
5506 |
||
5507 |
Coord c_y; |
|
5508 |
||
5509 |
_COORD_ (y, c_y) |
|
5510 |
SETWIN(aGLXWindowId) |
|
1932 | 5511 |
#ifdef OPENGL |
5512 |
#else |
|
294 | 5513 |
translate((Coord)0, c_y, (Coord)0); |
1932 | 5514 |
#endif |
294 | 5515 |
%} |
5516 |
! |
|
5517 |
||
5518 |
glxTranslateZ:z in:aGLXWindowId |
|
5519 |
"translate current matrix on Z axis" |
|
5520 |
||
5521 |
%{ /* NOCONTEXT */ |
|
5522 |
||
5523 |
Coord c_z; |
|
5524 |
||
5525 |
_COORD_ (z, c_z) |
|
5526 |
SETWIN(aGLXWindowId) |
|
1932 | 5527 |
#ifdef OPENGL |
5528 |
#else |
|
294 | 5529 |
translate((Coord)0, (Coord)0, c_z); |
1932 | 5530 |
#endif |
294 | 5531 |
%} |
5532 |
! ! |
|
5533 |
||
5534 |
!GLXWorkstation methodsFor:'unspecified rest'! |
|
5535 |
||
5536 |
glxAcbufOp:op value:value in:aGLXWindowId |
|
5537 |
||
5538 |
%{ /* NOCONTEXT */ |
|
1932 | 5539 |
SETWIN(aGLXWindowId) |
5540 |
#ifdef GLX |
|
294 | 5541 |
acbuf(__intVal(op), _floatVal(value)); |
1932 | 5542 |
#endif |
5543 |
%} |
|
294 | 5544 |
! |
5545 |
||
5546 |
glxAcsizePlanes: planes in: aGLXWindowId |
|
5547 |
||
5548 |
%{ /* NOCONTEXT */ |
|
1932 | 5549 |
SETWIN(aGLXWindowId) |
5550 |
#ifdef GLX |
|
294 | 5551 |
acsize(__intVal(planes)); |
1932 | 5552 |
#endif |
5553 |
%} |
|
294 | 5554 |
! |
5555 |
||
5556 |
glxAfunctionRef: ref func: func in: aGLXWindowId |
|
5557 |
||
5558 |
%{ /* NOCONTEXT */ |
|
1932 | 5559 |
SETWIN(aGLXWindowId) |
5560 |
#ifdef GLX |
|
294 | 5561 |
afunction(__intVal(ref), __intVal(func)); |
1932 | 5562 |
#endif |
5563 |
%} |
|
294 | 5564 |
! |
5565 |
||
5566 |
glxBbox2Xmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5567 |
||
5568 |
%{ /* NOCONTEXT */ |
|
5569 |
Screencoord c_xmin, c_ymin; |
|
4718 | 5570 |
Coord c_x1, c_y1, c_x2, c_y2; |
294 | 5571 |
|
5572 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5573 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5574 |
_COORD_ (x1, c_x1) |
|
5575 |
_COORD_ (y1, c_y1) |
|
5576 |
_COORD_ (x2, c_x2) |
|
5577 |
_COORD_ (y2, c_y2) |
|
5578 |
SETWIN(aGLXWindowId) |
|
1932 | 5579 |
#ifdef GLX |
294 | 5580 |
bbox2(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5581 |
#endif |
5582 |
%} |
|
294 | 5583 |
! |
5584 |
||
5585 |
glxBbox2iXmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5586 |
||
5587 |
%{ /* NOCONTEXT */ |
|
5588 |
Screencoord c_xmin, c_ymin; |
|
4718 | 5589 |
Icoord c_x1, c_y1, c_x2, c_y2; |
294 | 5590 |
|
5591 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5592 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5593 |
_ICOORD_ (x1, c_x1) |
|
5594 |
_ICOORD_ (y1, c_y1) |
|
5595 |
_ICOORD_ (x2, c_x2) |
|
5596 |
_ICOORD_ (y2, c_y2) |
|
5597 |
SETWIN(aGLXWindowId) |
|
1932 | 5598 |
#ifdef GLX |
294 | 5599 |
bbox2i(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5600 |
#endif |
5601 |
%} |
|
294 | 5602 |
! |
5603 |
||
5604 |
glxBbox2sXmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5605 |
||
5606 |
%{ /* NOCONTEXT */ |
|
5607 |
Screencoord c_xmin, c_ymin; |
|
4718 | 5608 |
Scoord c_x1, c_y1, c_x2, c_y2; |
294 | 5609 |
|
5610 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5611 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5612 |
_SCOORD_ (x1, c_x1) |
|
5613 |
_SCOORD_ (y1, c_y1) |
|
5614 |
_SCOORD_ (x2, c_x2) |
|
5615 |
_SCOORD_ (y2, c_y2) |
|
5616 |
SETWIN(aGLXWindowId) |
|
1932 | 5617 |
#ifdef GLX |
294 | 5618 |
bbox2s(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5619 |
#endif |
5620 |
%} |
|
294 | 5621 |
! |
5622 |
||
5623 |
glxBeginTrimIn: aGLXWindowId |
|
5624 |
||
5625 |
%{ /* NOCONTEXT */ |
|
1932 | 5626 |
SETWIN(aGLXWindowId) |
5627 |
#ifdef GLX |
|
294 | 5628 |
bgntrim(); |
1932 | 5629 |
#endif |
5630 |
%} |
|
294 | 5631 |
! |
5632 |
||
5633 |
glxBlankscreen: b in: aGLXWindowId |
|
5634 |
||
5635 |
%{ /* NOCONTEXT */ |
|
1932 | 5636 |
SETWIN(aGLXWindowId) |
5637 |
#ifdef GLX |
|
294 | 5638 |
blankscreen(_booleanVal(b)); |
1932 | 5639 |
#endif |
5640 |
%} |
|
294 | 5641 |
! |
5642 |
||
5643 |
glxBlanktime: count in: aGLXWindowId |
|
5644 |
||
5645 |
%{ /* NOCONTEXT */ |
|
1932 | 5646 |
SETWIN(aGLXWindowId) |
5647 |
#ifdef GLX |
|
294 | 5648 |
blanktime(__intVal(count)); |
1932 | 5649 |
#endif |
5650 |
%} |
|
294 | 5651 |
! |
5652 |
||
5653 |
glxBlendcolorRed: red green: green blue: blue alpha: alpha in: aGLXWindowId |
|
5654 |
||
5655 |
%{ /* NOCONTEXT */ |
|
1932 | 5656 |
SETWIN(aGLXWindowId) |
294 | 5657 |
#ifdef FULL_GLX |
4718 | 5658 |
blendcolor(_floatVal(red), _floatVal(green), _floatVal(blue), _floatVal(alpha)); |
1932 | 5659 |
#endif |
5660 |
%} |
|
294 | 5661 |
! |
5662 |
||
5663 |
glxBlendfunctionSfactr: sfactr dfactr: dfactr in: aGLXWindowId |
|
5664 |
||
5665 |
%{ /* NOCONTEXT */ |
|
1932 | 5666 |
SETWIN(aGLXWindowId) |
5667 |
#ifdef GLX |
|
294 | 5668 |
blendfunction(__intVal(sfactr), __intVal(dfactr)); |
1932 | 5669 |
#endif |
5670 |
%} |
|
294 | 5671 |
! |
5672 |
||
5673 |
glxBlinkRate: rate i: i red: red green: green blue: blue in: aGLXWindowId |
|
5674 |
||
5675 |
%{ /* NOCONTEXT */ |
|
1932 | 5676 |
SETWIN(aGLXWindowId) |
5677 |
#ifdef GLX |
|
4718 | 5678 |
blink(_shortVal(rate), _colorindexVal(i), |
294 | 5679 |
_shortVal(red), _shortVal(green), _shortVal(blue)); |
1932 | 5680 |
#endif |
5681 |
%} |
|
294 | 5682 |
! |
5683 |
||
5684 |
glxBlkqreadData: data n: n in: aGLXWindowId |
|
5685 |
||
5686 |
%{ /* NOCONTEXT */ |
|
1932 | 5687 |
int rslt = -1; |
5688 |
||
5689 |
SETWIN(aGLXWindowId) |
|
5690 |
#ifdef GLX |
|
5691 |
rslt = blkqread((short *)_indexedArea(data), __intVal(n)); |
|
5692 |
#endif |
|
5693 |
RETURN (__MKSMALLINT(rslt)); |
|
5694 |
%} |
|
294 | 5695 |
! |
5696 |
||
5697 |
glxC3f: v in: aGLXWindowId |
|
5698 |
||
5699 |
%{ /* NOCONTEXT */ |
|
5700 |
float vec[3], *c_v; |
|
5701 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5702 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
294 | 5703 |
SETWIN(aGLXWindowId) |
1932 | 5704 |
#ifdef GLX |
294 | 5705 |
c3f(c_v); |
1932 | 5706 |
#endif |
5707 |
%} |
|
294 | 5708 |
! |
5709 |
||
5710 |
glxC3i: v in: aGLXWindowId |
|
5711 |
||
5712 |
%{ /* NOCONTEXT */ |
|
5713 |
long vec[3], *c_v; |
|
5714 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5715 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
294 | 5716 |
SETWIN(aGLXWindowId) |
1932 | 5717 |
#ifdef GLX |
294 | 5718 |
c3i(c_v); |
1932 | 5719 |
#endif |
5720 |
%} |
|
294 | 5721 |
! |
5722 |
||
5723 |
glxC3s: v in: aGLXWindowId |
|
5724 |
||
5725 |
%{ /* NOCONTEXT */ |
|
5726 |
short vec[3], *c_v; |
|
5727 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5728 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
294 | 5729 |
SETWIN(aGLXWindowId) |
1932 | 5730 |
#ifdef GLX |
294 | 5731 |
c3s(c_v); |
1932 | 5732 |
#endif |
5733 |
%} |
|
294 | 5734 |
! |
5735 |
||
5736 |
glxC4f: v in: aGLXWindowId |
|
5737 |
||
5738 |
%{ /* NOCONTEXT */ |
|
5739 |
float vec[4], *c_v; |
|
5740 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5741 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
294 | 5742 |
SETWIN(aGLXWindowId) |
1932 | 5743 |
#ifdef GLX |
294 | 5744 |
c4f(c_v); |
1932 | 5745 |
#endif |
5746 |
%} |
|
294 | 5747 |
! |
5748 |
||
5749 |
glxC4i: v in: aGLXWindowId |
|
5750 |
||
5751 |
%{ /* NOCONTEXT */ |
|
5752 |
long vec[4], *c_v; |
|
5753 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5754 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
294 | 5755 |
SETWIN(aGLXWindowId) |
1932 | 5756 |
#ifdef GLX |
294 | 5757 |
c4i(c_v); |
1932 | 5758 |
#endif |
5759 |
%} |
|
294 | 5760 |
! |
5761 |
||
5762 |
glxC4s: v in: aGLXWindowId |
|
5763 |
||
5764 |
%{ /* NOCONTEXT */ |
|
5765 |
short vec[4], *c_v; |
|
5766 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5767 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
294 | 5768 |
SETWIN(aGLXWindowId) |
1932 | 5769 |
#ifdef GLX |
294 | 5770 |
c4s(c_v); |
1932 | 5771 |
#endif |
5772 |
%} |
|
294 | 5773 |
! |
5774 |
||
5775 |
glxClearhitcodeIn: aGLXWindowId |
|
5776 |
||
5777 |
%{ /* NOCONTEXT */ |
|
1932 | 5778 |
SETWIN(aGLXWindowId) |
5779 |
#ifdef GLX |
|
294 | 5780 |
clearhitcode(); |
1932 | 5781 |
#endif |
5782 |
%} |
|
294 | 5783 |
! |
5784 |
||
5785 |
glxClipplaneIndex: index mode: mode params: params in: aGLXWindowId |
|
5786 |
||
5787 |
%{ /* NOCONTEXT */ |
|
5788 |
float vec[4], *v; |
|
5789 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5790 |
if (! (v = __glx_getFloatsFromInto(params, vec, 4))) RETURN(false); |
294 | 5791 |
SETWIN(aGLXWindowId) |
1932 | 5792 |
#ifdef GLX |
294 | 5793 |
clipplane(__intVal(index), __intVal(mode), v); |
1932 | 5794 |
#endif |
5795 |
%} |
|
294 | 5796 |
! |
5797 |
||
5798 |
glxCmodeIn: aGLXWindowId |
|
5799 |
||
5800 |
%{ /* NOCONTEXT */ |
|
1932 | 5801 |
SETWIN(aGLXWindowId) |
5802 |
#ifdef GLX |
|
294 | 5803 |
cmode(); |
1932 | 5804 |
#endif |
5805 |
%} |
|
294 | 5806 |
! |
5807 |
||
5808 |
glxColorfIndex: index in: aGLXWindowId |
|
5809 |
||
5810 |
^self glxColor: index in: aGLXWindowId |
|
5811 |
! |
|
5812 |
||
5813 |
glxCuroriginN: n xorigin: xorigin yorigin: yorigin in: aGLXWindowId |
|
5814 |
||
5815 |
%{ /* NOCONTEXT */ |
|
1932 | 5816 |
SETWIN(aGLXWindowId) |
5817 |
#ifdef GLX |
|
294 | 5818 |
curorigin(_shortVal(n), _shortVal(xorigin), _shortVal(yorigin)); |
1932 | 5819 |
#endif |
5820 |
%} |
|
294 | 5821 |
! |
5822 |
||
5823 |
glxCursoffIn: aGLXWindowId |
|
5824 |
||
5825 |
%{ /* NOCONTEXT */ |
|
1932 | 5826 |
SETWIN(aGLXWindowId) |
5827 |
#ifdef GLX |
|
294 | 5828 |
cursoff(); |
1932 | 5829 |
#endif |
5830 |
%} |
|
294 | 5831 |
! |
5832 |
||
5833 |
glxCursonIn: aGLXWindowId |
|
5834 |
||
5835 |
%{ /* NOCONTEXT */ |
|
1932 | 5836 |
SETWIN(aGLXWindowId) |
5837 |
#ifdef GLX |
|
294 | 5838 |
curson(); |
1932 | 5839 |
#endif |
5840 |
%} |
|
294 | 5841 |
! |
5842 |
||
5843 |
glxCurstype: type in: aGLXWindowId |
|
5844 |
||
5845 |
%{ /* NOCONTEXT */ |
|
1932 | 5846 |
SETWIN(aGLXWindowId) |
5847 |
#ifdef GLX |
|
294 | 5848 |
curstype(__intVal(type)); |
1932 | 5849 |
#endif |
5850 |
%} |
|
294 | 5851 |
! |
5852 |
||
5853 |
glxCyclemapDuration: duration map: map nxtmap: nxtmap in: aGLXWindowId |
|
5854 |
||
5855 |
%{ /* NOCONTEXT */ |
|
1932 | 5856 |
SETWIN(aGLXWindowId) |
5857 |
#ifdef GLX |
|
294 | 5858 |
cyclemap(_shortVal(duration), _shortVal(map), _shortVal(nxtmap)); |
1932 | 5859 |
#endif |
5860 |
%} |
|
294 | 5861 |
! |
5862 |
||
5863 |
glxDefpatternN: n size: size mask: mask in: aGLXWindowId |
|
5864 |
||
5865 |
%{ /* NOCONTEXT */ |
|
1932 | 5866 |
SETWIN(aGLXWindowId) |
5867 |
#ifdef GLX |
|
294 | 5868 |
defpattern(_shortVal(n), _shortVal(size), (unsigned short *)_indexedArea(mask)); |
1932 | 5869 |
#endif |
5870 |
%} |
|
294 | 5871 |
! |
5872 |
||
5873 |
glxDeltag: t in: aGLXWindowId |
|
5874 |
||
5875 |
%{ /* NOCONTEXT */ |
|
1932 | 5876 |
SETWIN(aGLXWindowId) |
5877 |
#ifdef GLX |
|
294 | 5878 |
deltag(_tagVal(t)); |
1932 | 5879 |
#endif |
5880 |
%} |
|
294 | 5881 |
! |
5882 |
||
5883 |
glxDepthcueMode: mode in: aGLXWindowId |
|
5884 |
||
5885 |
%{ /* NOCONTEXT */ |
|
1932 | 5886 |
SETWIN(aGLXWindowId) |
5887 |
#ifdef GLX |
|
294 | 5888 |
depthcue(_booleanVal(mode)); |
1932 | 5889 |
#endif |
5890 |
%} |
|
294 | 5891 |
! |
5892 |
||
5893 |
glxDitherMode: mode in: aGLXWindowId |
|
5894 |
||
5895 |
%{ /* NOCONTEXT */ |
|
1932 | 5896 |
SETWIN(aGLXWindowId) |
5897 |
#ifdef GLX |
|
294 | 5898 |
dither(_longVal(mode)); |
1932 | 5899 |
#endif |
5900 |
%} |
|
294 | 5901 |
! |
5902 |
||
5903 |
glxDopup: pup in: aGLXWindowId |
|
5904 |
||
5905 |
%{ /* NOCONTEXT */ |
|
1932 | 5906 |
SETWIN(aGLXWindowId) |
5907 |
#ifdef GLX |
|
294 | 5908 |
dopup(_longVal(pup)); |
1932 | 5909 |
#endif |
5910 |
%} |
|
294 | 5911 |
! |
5912 |
||
5913 |
glxDrawmode: mode in: aGLXWindowId |
|
5914 |
||
5915 |
%{ /* NOCONTEXT */ |
|
1932 | 5916 |
SETWIN(aGLXWindowId) |
5917 |
#ifdef GLX |
|
294 | 5918 |
drawmode(_longVal(mode)); |
1932 | 5919 |
#endif |
5920 |
%} |
|
294 | 5921 |
! |
5922 |
||
5923 |
glxEditobj: obj in: aGLXWindowId |
|
5924 |
||
5925 |
%{ /* NOCONTEXT */ |
|
1932 | 5926 |
SETWIN(aGLXWindowId) |
5927 |
#ifdef GLX |
|
294 | 5928 |
editobj(_objectVal(obj)); |
1932 | 5929 |
#endif |
5930 |
%} |
|
294 | 5931 |
! |
5932 |
||
5933 |
glxEndTrimIn: aGLXWindowId |
|
5934 |
||
5935 |
%{ /* NOCONTEXT */ |
|
1932 | 5936 |
SETWIN(aGLXWindowId) |
5937 |
#ifdef GLX |
|
294 | 5938 |
endtrim(); |
1932 | 5939 |
#endif |
5940 |
%} |
|
294 | 5941 |
! |
5942 |
||
5943 |
glxEndfullscrnIn: aGLXWindowId |
|
5944 |
||
5945 |
%{ /* NOCONTEXT */ |
|
1932 | 5946 |
SETWIN(aGLXWindowId) |
5947 |
#ifdef GLX |
|
294 | 5948 |
endfullscrn(); |
1932 | 5949 |
#endif |
5950 |
%} |
|
294 | 5951 |
! |
5952 |
||
5953 |
glxEndpupmodeIn: aGLXWindowId |
|
5954 |
||
5955 |
%{ /* NOCONTEXT */ |
|
1932 | 5956 |
SETWIN(aGLXWindowId) |
5957 |
#ifdef GLX |
|
294 | 5958 |
endpupmode(); |
1932 | 5959 |
#endif |
5960 |
%} |
|
294 | 5961 |
! |
5962 |
||
5963 |
glxFinishIn: aGLXWindowId |
|
5964 |
||
5965 |
%{ /* NOCONTEXT */ |
|
1932 | 5966 |
SETWIN(aGLXWindowId) |
5967 |
#ifdef GLX |
|
294 | 5968 |
finish(); |
1932 | 5969 |
#endif |
5970 |
%} |
|
294 | 5971 |
! |
5972 |
||
5973 |
glxFont: fntnum in: aGLXWindowId |
|
5974 |
||
5975 |
%{ /* NOCONTEXT */ |
|
5976 |
SETWIN(aGLXWindowId) |
|
1932 | 5977 |
#ifdef GLX |
294 | 5978 |
font(_shortVal(fntnum)); |
1932 | 5979 |
#endif |
294 | 5980 |
%} |
5981 |
! |
|
5982 |
||
5983 |
glxForegroundIn: aGLXWindowId |
|
5984 |
||
5985 |
%{ /* NOCONTEXT */ |
|
5986 |
SETWIN(aGLXWindowId) |
|
1932 | 5987 |
#ifdef OPENGL |
5988 |
#else |
|
294 | 5989 |
foreground(); |
1932 | 5990 |
#endif |
294 | 5991 |
%} |
5992 |
! |
|
5993 |
||
5994 |
glxFreepup: pup in: aGLXWindowId |
|
5995 |
||
5996 |
%{ /* NOCONTEXT */ |
|
1932 | 5997 |
SETWIN(aGLXWindowId) |
5998 |
#ifdef GLX |
|
294 | 5999 |
freepup(_longVal(pup)); |
1932 | 6000 |
#endif |
6001 |
%} |
|
294 | 6002 |
! |
6003 |
||
6004 |
glxFudgeXfudge: xfudge yfudge: yfudge in: aGLXWindowId |
|
6005 |
||
6006 |
%{ /* NOCONTEXT */ |
|
1932 | 6007 |
SETWIN(aGLXWindowId) |
6008 |
#ifdef GLX |
|
294 | 6009 |
fudge(_longVal(xfudge), _longVal(yfudge)); |
1932 | 6010 |
#endif |
6011 |
%} |
|
294 | 6012 |
! |
6013 |
||
6014 |
glxFullscrnIn: aGLXWindowId |
|
6015 |
||
6016 |
%{ /* NOCONTEXT */ |
|
1932 | 6017 |
SETWIN(aGLXWindowId) |
6018 |
#ifdef GLX |
|
294 | 6019 |
fullscrn(); |
1932 | 6020 |
#endif |
6021 |
%} |
|
294 | 6022 |
! |
6023 |
||
6024 |
glxGbeginIn: aGLXWindowId |
|
6025 |
||
6026 |
%{ /* NOCONTEXT */ |
|
1932 | 6027 |
SETWIN(aGLXWindowId) |
6028 |
#ifdef GLX |
|
294 | 6029 |
gbegin(); |
1932 | 6030 |
#endif |
6031 |
%} |
|
294 | 6032 |
! |
6033 |
||
6034 |
glxGentagIn: aGLXWindowId |
|
6035 |
||
6036 |
%{ /* NOCONTEXT */ |
|
1932 | 6037 |
int rslt = -1; |
6038 |
||
6039 |
#ifdef GLX |
|
6040 |
SETWIN(aGLXWindowId) |
|
6041 |
rslt = gentag(); |
|
6042 |
#endif |
|
6043 |
RETURN (__MKSMALLINT(rslt)); |
|
6044 |
%} |
|
294 | 6045 |
! |
6046 |
||
6047 |
glxGetbackfaceIn: aGLXWindowId |
|
6048 |
||
6049 |
%{ /* NOCONTEXT */ |
|
1932 | 6050 |
int rslt = -1; |
6051 |
||
6052 |
#ifdef GLX |
|
6053 |
SETWIN(aGLXWindowId) |
|
6054 |
rslt = getbackface(); |
|
6055 |
#endif |
|
6056 |
RETURN (__MKSMALLINT(rslt)); |
|
6057 |
%} |
|
294 | 6058 |
! |
6059 |
||
6060 |
glxGetbufferIn: aGLXWindowId |
|
6061 |
||
6062 |
%{ /* NOCONTEXT */ |
|
1932 | 6063 |
int rslt = -1; |
6064 |
||
6065 |
#ifdef GLX |
|
6066 |
SETWIN(aGLXWindowId) |
|
6067 |
rslt = getbuffer(); |
|
6068 |
#endif |
|
6069 |
RETURN (__MKSMALLINT(rslt)); |
|
6070 |
%} |
|
294 | 6071 |
! |
6072 |
||
6073 |
glxGetbutton: num in: aGLXWindowId |
|
6074 |
||
6075 |
%{ /* NOCONTEXT */ |
|
1932 | 6076 |
int rslt = -1; |
6077 |
||
6078 |
SETWIN(aGLXWindowId) |
|
6079 |
#ifdef OPENGL |
|
6080 |
#else |
|
6081 |
rslt = getbutton(_deviceVal(num)); |
|
6082 |
#endif |
|
6083 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6084 |
%} |
6085 |
! |
|
6086 |
||
6087 |
glxGetcmmodeIn: aGLXWindowId |
|
6088 |
||
6089 |
%{ /* NOCONTEXT */ |
|
1932 | 6090 |
int rslt = 0; |
6091 |
||
6092 |
SETWIN(aGLXWindowId) |
|
6093 |
#ifdef GLX |
|
6094 |
rslt = getcmmode(); |
|
6095 |
#endif |
|
6096 |
RETURN (__MKBOOLEAN(rslt)); |
|
6097 |
%} |
|
294 | 6098 |
! |
6099 |
||
6100 |
glxGetcolorIn: aGLXWindowId |
|
6101 |
"return the current drawing color" |
|
6102 |
||
6103 |
%{ /* NOCONTEXT */ |
|
1932 | 6104 |
int rslt = -1; |
6105 |
||
6106 |
SETWIN(aGLXWindowId) |
|
6107 |
#ifdef OPENGL |
|
6108 |
#else |
|
6109 |
rslt = getcolor(); |
|
6110 |
#endif |
|
6111 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6112 |
%} |
6113 |
! |
|
6114 |
||
6115 |
glxGetdcmIn: aGLXWindowId |
|
6116 |
||
6117 |
%{ /* NOCONTEXT */ |
|
6118 |
#ifdef GLX |
|
6119 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6120 |
RETURN (__MKBOOLEAN(getdcm())); |
294 | 6121 |
#endif |
6122 |
%} |
|
6123 |
. |
|
6124 |
^ false |
|
6125 |
! |
|
6126 |
||
6127 |
glxGetdescenderIn: aGLXWindowId |
|
6128 |
||
6129 |
%{ /* NOCONTEXT */ |
|
6130 |
#ifdef GLX |
|
6131 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6132 |
RETURN (__MKSMALLINT(getdescender())); |
294 | 6133 |
#endif |
6134 |
%} |
|
6135 |
. |
|
6136 |
^ false |
|
6137 |
! |
|
6138 |
||
6139 |
glxGetdisplaymodeIn: aGLXWindowId |
|
6140 |
||
6141 |
%{ /* NOCONTEXT */ |
|
6142 |
#ifdef GLX |
|
6143 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6144 |
RETURN (__MKSMALLINT(getdisplaymode())); |
294 | 6145 |
#endif |
6146 |
%} |
|
6147 |
. |
|
6148 |
^ false |
|
6149 |
! |
|
6150 |
||
6151 |
glxGetdrawmodeIn: aGLXWindowId |
|
6152 |
||
6153 |
%{ /* NOCONTEXT */ |
|
6154 |
#ifdef GLX |
|
6155 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6156 |
RETURN (__MKSMALLINT(getdrawmode())); |
294 | 6157 |
#endif |
6158 |
%} |
|
6159 |
. |
|
6160 |
^ false |
|
6161 |
! |
|
6162 |
||
6163 |
glxGetfontIn: aGLXWindowId |
|
6164 |
||
6165 |
%{ /* NOCONTEXT */ |
|
6166 |
#ifdef GLX |
|
6167 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6168 |
RETURN (__MKSMALLINT(getfont())); |
294 | 6169 |
#endif |
6170 |
%} |
|
6171 |
. |
|
6172 |
^ false |
|
6173 |
! |
|
6174 |
||
6175 |
glxGetgconfigBuffer: buffer in: aGLXWindowId |
|
6176 |
||
6177 |
%{ /* NOCONTEXT */ |
|
6178 |
#ifdef FULL_GLX |
|
6179 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6180 |
RETURN (__MKSMALLINT(getgconfig(_longVal(buffer)))); |
294 | 6181 |
#endif |
6182 |
%} |
|
6183 |
. |
|
6184 |
^ false |
|
6185 |
! |
|
6186 |
||
6187 |
glxGetgdescInquiry: inquiry in: aGLXWindowId |
|
6188 |
||
6189 |
%{ /* NOCONTEXT */ |
|
1932 | 6190 |
int rslt = 0; |
6191 |
||
6192 |
SETWIN(aGLXWindowId) |
|
6193 |
#ifdef OPENGL |
|
6194 |
#else |
|
6195 |
rslt = getgdesc(_longVal(inquiry)); |
|
6196 |
#endif |
|
6197 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6198 |
%} |
6199 |
! |
|
6200 |
||
6201 |
glxGetheightIn: aGLXWindowId |
|
6202 |
||
6203 |
%{ /* NOCONTEXT */ |
|
1932 | 6204 |
int rslt = 0; |
6205 |
||
6206 |
SETWIN(aGLXWindowId) |
|
6207 |
#ifdef OPENGL |
|
6208 |
#else |
|
6209 |
rslt = getheight(); |
|
6210 |
#endif |
|
6211 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6212 |
%} |
6213 |
! |
|
6214 |
||
6215 |
glxGethitcodeIn: aGLXWindowId |
|
6216 |
||
6217 |
%{ /* NOCONTEXT */ |
|
6218 |
#ifdef GLX |
|
6219 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6220 |
RETURN (__MKSMALLINT(gethitcode())); |
294 | 6221 |
#endif |
6222 |
%} |
|
6223 |
. |
|
6224 |
^ false |
|
6225 |
! |
|
6226 |
||
6227 |
glxGetlsbackupIn: aGLXWindowId |
|
6228 |
||
6229 |
%{ /* NOCONTEXT */ |
|
6230 |
#ifdef GLX |
|
6231 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6232 |
RETURN (__MKBOOLEAN(getlsbackup())); |
294 | 6233 |
#endif |
6234 |
%} |
|
6235 |
. |
|
6236 |
^ false |
|
6237 |
! |
|
6238 |
||
6239 |
glxGetlsrepeatIn: aGLXWindowId |
|
6240 |
||
6241 |
%{ /* NOCONTEXT */ |
|
6242 |
#ifdef GLX |
|
6243 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6244 |
RETURN (__MKSMALLINT(getlsrepeat())); |
294 | 6245 |
#endif |
6246 |
%} |
|
6247 |
. |
|
6248 |
^ false |
|
6249 |
! |
|
6250 |
||
6251 |
glxGetlstyleIn: aGLXWindowId |
|
6252 |
||
6253 |
%{ /* NOCONTEXT */ |
|
6254 |
#ifdef GLX |
|
6255 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6256 |
RETURN (__MKSMALLINT(getlstyle())); |
294 | 6257 |
#endif |
6258 |
%} |
|
6259 |
. |
|
6260 |
^ false |
|
6261 |
! |
|
6262 |
||
6263 |
glxGetlwidthIn: aGLXWindowId |
|
6264 |
||
6265 |
%{ /* NOCONTEXT */ |
|
6266 |
#ifdef GLX |
|
6267 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6268 |
RETURN (__MKSMALLINT(getlwidth())); |
294 | 6269 |
#endif |
6270 |
%} |
|
6271 |
. |
|
6272 |
^ false |
|
6273 |
! |
|
6274 |
||
6275 |
glxGetmapIn: aGLXWindowId |
|
6276 |
||
6277 |
%{ /* NOCONTEXT */ |
|
6278 |
#ifdef GLX |
|
6279 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6280 |
RETURN (__MKSMALLINT(getmap())); |
294 | 6281 |
#endif |
6282 |
%} |
|
6283 |
. |
|
6284 |
^ false |
|
6285 |
! |
|
6286 |
||
6287 |
glxGetmmodeIn: aGLXWindowId |
|
6288 |
||
6289 |
%{ /* NOCONTEXT */ |
|
6290 |
#ifdef GLX |
|
6291 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6292 |
RETURN (__MKSMALLINT(getmmode())); |
294 | 6293 |
#endif |
6294 |
%} |
|
6295 |
. |
|
6296 |
^ false |
|
6297 |
! |
|
6298 |
||
6299 |
glxGetmonitorIn: aGLXWindowId |
|
6300 |
||
6301 |
%{ /* NOCONTEXT */ |
|
6302 |
#ifdef GLX |
|
6303 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6304 |
RETURN (__MKSMALLINT(getmonitor())); |
294 | 6305 |
#endif |
6306 |
%} |
|
6307 |
. |
|
6308 |
^ false |
|
6309 |
! |
|
6310 |
||
6311 |
glxGetmultisampleIn: aGLXWindowId |
|
6312 |
||
6313 |
%{ /* NOCONTEXT */ |
|
6314 |
#ifdef FULL_GLX |
|
6315 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6316 |
RETURN (__MKBOOLEAN(getmultisample())); |
294 | 6317 |
#endif |
6318 |
%} |
|
6319 |
. |
|
6320 |
^ false |
|
6321 |
! |
|
6322 |
||
6323 |
glxGetothermonitorIn: aGLXWindowId |
|
6324 |
||
6325 |
%{ /* NOCONTEXT */ |
|
6326 |
#ifdef GLX |
|
6327 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6328 |
RETURN (__MKSMALLINT(getothermonitor())); |
294 | 6329 |
#endif |
6330 |
%} |
|
6331 |
. |
|
6332 |
^ false |
|
6333 |
! |
|
6334 |
||
6335 |
glxGetpatternIn: aGLXWindowId |
|
6336 |
||
6337 |
%{ /* NOCONTEXT */ |
|
6338 |
#ifdef GLX |
|
6339 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6340 |
RETURN (__MKSMALLINT(getpattern())); |
294 | 6341 |
#endif |
6342 |
%} |
|
6343 |
. |
|
6344 |
^ false |
|
6345 |
! |
|
6346 |
||
6347 |
glxGetresetlsIn: aGLXWindowId |
|
6348 |
||
6349 |
%{ /* NOCONTEXT */ |
|
6350 |
#ifdef GLX |
|
6351 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6352 |
RETURN (__MKBOOLEAN(getresetls())); |
294 | 6353 |
#endif |
6354 |
%} |
|
6355 |
. |
|
6356 |
^ false |
|
6357 |
! |
|
6358 |
||
6359 |
glxGetshadeIn: aGLXWindowId |
|
6360 |
||
6361 |
%{ /* NOCONTEXT */ |
|
6362 |
#ifdef GLX |
|
6363 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6364 |
RETURN (__MKSMALLINT(getshade())); |
294 | 6365 |
#endif |
6366 |
%} |
|
6367 |
. |
|
6368 |
^ false |
|
6369 |
! |
|
6370 |
||
6371 |
glxGetsmIn: aGLXWindowId |
|
6372 |
||
6373 |
%{ /* NOCONTEXT */ |
|
6374 |
#ifdef GLX |
|
6375 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6376 |
RETURN (__MKSMALLINT(getsm())); |
294 | 6377 |
#endif |
6378 |
%} |
|
6379 |
. |
|
6380 |
^ false |
|
6381 |
! |
|
6382 |
||
6383 |
glxGetvaluator: dev in: aGLXWindowId |
|
6384 |
||
6385 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
6386 |
#ifndef OPENGL |
294 | 6387 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6388 |
RETURN (__MKSMALLINT(getvaluator(_deviceVal(dev)))); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
6389 |
#endif |
294 | 6390 |
%} |
6391 |
. |
|
6392 |
^ false |
|
6393 |
! |
|
6394 |
||
6395 |
glxGetvideo: reg in: aGLXWindowId |
|
6396 |
||
6397 |
%{ /* NOCONTEXT */ |
|
6398 |
#ifdef GLX |
|
6399 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6400 |
RETURN (__MKSMALLINT(getvideo(_longVal(reg)))); |
294 | 6401 |
#endif |
6402 |
%} |
|
6403 |
. |
|
6404 |
^ false |
|
6405 |
! |
|
6406 |
||
6407 |
glxGetwritemaskIn: aGLXWindowId |
|
6408 |
||
6409 |
%{ /* NOCONTEXT */ |
|
6410 |
#ifdef GLX |
|
6411 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6412 |
RETURN (__MKSMALLINT(getwritemask())); |
294 | 6413 |
#endif |
6414 |
%} |
|
6415 |
. |
|
6416 |
^ false |
|
6417 |
! |
|
6418 |
||
6419 |
glxGetwscrnIn: aGLXWindowId |
|
6420 |
||
6421 |
%{ /* NOCONTEXT */ |
|
6422 |
#ifdef GLX |
|
6423 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6424 |
RETURN (__MKSMALLINT(getwscrn())); |
294 | 6425 |
#endif |
6426 |
%} |
|
6427 |
. |
|
6428 |
^ false |
|
6429 |
! |
|
6430 |
||
6431 |
glxGetzbufferIn: aGLXWindowId |
|
6432 |
||
6433 |
%{ /* NOCONTEXT */ |
|
6434 |
#ifdef GLX |
|
6435 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6436 |
RETURN (__MKBOOLEAN(getzbuffer())); |
294 | 6437 |
#endif |
6438 |
%} |
|
6439 |
. |
|
6440 |
^ false |
|
6441 |
! |
|
6442 |
||
6443 |
glxGexitIn: aGLXWindowId |
|
6444 |
||
6445 |
%{ /* NOCONTEXT */ |
|
1932 | 6446 |
SETWIN(aGLXWindowId) |
6447 |
#ifdef OPENGL |
|
6448 |
#else |
|
294 | 6449 |
gexit(); |
1932 | 6450 |
#endif |
6451 |
%} |
|
294 | 6452 |
! |
6453 |
||
6454 |
glxGflushIn: aGLXWindowId |
|
6455 |
||
6456 |
%{ /* NOCONTEXT */ |
|
6457 |
#ifdef GLX |
|
6458 |
SETWIN(aGLXWindowId) |
|
6459 |
gflush(); |
|
1932 | 6460 |
#endif |
6461 |
%} |
|
294 | 6462 |
! |
6463 |
||
6464 |
glxGinitIn: aGLXWindowId |
|
6465 |
||
6466 |
%{ /* NOCONTEXT */ |
|
1932 | 6467 |
SETWIN(aGLXWindowId) |
6468 |
#ifdef OPENGL |
|
6469 |
#else |
|
294 | 6470 |
ginit(); |
1932 | 6471 |
#endif |
6472 |
%} |
|
294 | 6473 |
! |
6474 |
||
6475 |
glxGlcompatMode: mode value: value in: aGLXWindowId |
|
6476 |
||
6477 |
%{ /* NOCONTEXT */ |
|
6478 |
#ifdef GLX |
|
6479 |
SETWIN(aGLXWindowId) |
|
6480 |
glcompat(_longVal(mode), _longVal(value)); |
|
1932 | 6481 |
#endif |
6482 |
%} |
|
294 | 6483 |
! |
6484 |
||
6485 |
glxGresetIn: aGLXWindowId |
|
6486 |
||
6487 |
%{ /* NOCONTEXT */ |
|
6488 |
#ifdef GLX |
|
6489 |
SETWIN(aGLXWindowId) |
|
6490 |
greset(); |
|
1932 | 6491 |
#endif |
6492 |
%} |
|
294 | 6493 |
! |
6494 |
||
6495 |
glxGsyncIn: aGLXWindowId |
|
6496 |
||
6497 |
%{ /* NOCONTEXT */ |
|
6498 |
#ifdef GLX |
|
6499 |
SETWIN(aGLXWindowId) |
|
6500 |
gsync(); |
|
1932 | 6501 |
#endif |
6502 |
%} |
|
294 | 6503 |
! |
6504 |
||
6505 |
glxIconsizeX: x y: y in: aGLXWindowId |
|
6506 |
||
6507 |
%{ /* NOCONTEXT */ |
|
6508 |
#ifdef GLX |
|
6509 |
SETWIN(aGLXWindowId) |
|
6510 |
iconsize(_longVal(x), _longVal(y)); |
|
1932 | 6511 |
#endif |
6512 |
%} |
|
294 | 6513 |
! |
6514 |
||
6515 |
glxImakebackgroundIn: aGLXWindowId |
|
6516 |
||
6517 |
%{ /* NOCONTEXT */ |
|
6518 |
#ifdef GLX |
|
6519 |
SETWIN(aGLXWindowId) |
|
6520 |
imakebackground(); |
|
1932 | 6521 |
#endif |
6522 |
%} |
|
294 | 6523 |
! |
6524 |
||
6525 |
glxInitnamesIn: aGLXWindowId |
|
6526 |
||
6527 |
%{ /* NOCONTEXT */ |
|
6528 |
#ifdef GLX |
|
6529 |
SETWIN(aGLXWindowId) |
|
6530 |
initnames(); |
|
1932 | 6531 |
#endif |
6532 |
%} |
|
294 | 6533 |
! |
6534 |
||
6535 |
glxIsqueued: dev in: aGLXWindowId |
|
6536 |
||
6537 |
%{ /* NOCONTEXT */ |
|
6538 |
#ifdef GLX |
|
6539 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6540 |
RETURN (__MKBOOLEAN(isqueued(_deviceVal(dev)))); |
294 | 6541 |
#endif |
6542 |
%} |
|
6543 |
. |
|
6544 |
^ false |
|
6545 |
! |
|
6546 |
||
6547 |
glxIstag: t in: aGLXWindowId |
|
6548 |
||
6549 |
%{ /* NOCONTEXT */ |
|
6550 |
#ifdef GLX |
|
6551 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6552 |
RETURN (__MKBOOLEAN(istag(_tagVal(t)))); |
294 | 6553 |
#endif |
6554 |
%} |
|
6555 |
. |
|
6556 |
^ false |
|
6557 |
! |
|
6558 |
||
6559 |
glxKeepaspectX: x y: y in: aGLXWindowId |
|
6560 |
||
6561 |
%{ /* NOCONTEXT */ |
|
6562 |
#ifdef GLX |
|
6563 |
SETWIN(aGLXWindowId) |
|
6564 |
keepaspect(_longVal(x), _longVal(y)); |
|
6565 |
RETURN (true); |
|
6566 |
#endif |
|
6567 |
%} |
|
6568 |
. |
|
6569 |
^ false |
|
6570 |
! |
|
6571 |
||
6572 |
glxLinesmoothMode: mode in: aGLXWindowId |
|
6573 |
||
6574 |
%{ /* NOCONTEXT */ |
|
6575 |
#ifdef GLX |
|
6576 |
SETWIN(aGLXWindowId) |
|
6577 |
linesmooth((ulong)__intVal(mode)); |
|
6578 |
RETURN (true); |
|
6579 |
#endif |
|
6580 |
%} |
|
6581 |
. |
|
6582 |
^ false |
|
6583 |
! |
|
6584 |
||
6585 |
glxLmcolorMode: mode in: aGLXWindowId |
|
6586 |
||
6587 |
%{ /* NOCONTEXT */ |
|
6588 |
#ifdef GLX |
|
6589 |
SETWIN(aGLXWindowId) |
|
6590 |
lmcolor(_longVal(mode)); |
|
6591 |
RETURN (true); |
|
6592 |
#endif |
|
6593 |
%} |
|
6594 |
. |
|
6595 |
^ false |
|
6596 |
! |
|
6597 |
||
6598 |
glxLoadname: name in: aGLXWindowId |
|
6599 |
||
6600 |
%{ /* NOCONTEXT */ |
|
6601 |
#ifdef GLX |
|
6602 |
SETWIN(aGLXWindowId) |
|
6603 |
loadname(_shortVal(name)); |
|
6604 |
RETURN (true); |
|
6605 |
#endif |
|
6606 |
%} |
|
6607 |
. |
|
6608 |
^ false |
|
6609 |
! |
|
6610 |
||
6611 |
glxLogicop: opcode in: aGLXWindowId |
|
6612 |
||
6613 |
%{ /* NOCONTEXT */ |
|
6614 |
#ifdef GLX |
|
6615 |
SETWIN(aGLXWindowId) |
|
6616 |
logicop(_longVal(opcode)); |
|
6617 |
RETURN (true); |
|
6618 |
#endif |
|
6619 |
%} |
|
6620 |
. |
|
6621 |
^ false |
|
6622 |
! |
|
6623 |
||
6624 |
glxLsbackup: b in: aGLXWindowId |
|
6625 |
||
6626 |
%{ /* NOCONTEXT */ |
|
6627 |
#ifdef GLX |
|
6628 |
SETWIN(aGLXWindowId) |
|
6629 |
lsbackup(_booleanVal(b)); |
|
6630 |
RETURN (true); |
|
6631 |
#endif |
|
6632 |
%} |
|
6633 |
. |
|
6634 |
^ false |
|
6635 |
! |
|
6636 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6637 |
glxLsetdepthNear:znear far:zfar in: aGLXWindowId |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6638 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6639 |
%{ /* NOCONTEXT */ |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6640 |
#ifdef GLX |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6641 |
SETWIN(aGLXWindowId) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6642 |
lsetdepth(_longVal(znear), _longVal(zfar)); |
294 | 6643 |
RETURN (true); |
6644 |
#endif |
|
6645 |
%} |
|
6646 |
. |
|
6647 |
^ false |
|
6648 |
! |
|
6649 |
||
6650 |
glxLshaderangeLowin: lowin hiwin: hiwin znear: znear zfar: zfar in: aGLXWindowId |
|
6651 |
||
6652 |
%{ /* NOCONTEXT */ |
|
6653 |
#ifdef GLX |
|
6654 |
SETWIN(aGLXWindowId) |
|
4718 | 6655 |
lshaderange(_colorindexVal(lowin), _colorindexVal(hiwin), |
294 | 6656 |
_longVal(znear), _longVal(zfar)); |
6657 |
RETURN (true); |
|
6658 |
#endif |
|
6659 |
%} |
|
6660 |
. |
|
6661 |
^ false |
|
6662 |
! |
|
6663 |
||
6664 |
glxLsrepeatFactor: factor in: aGLXWindowId |
|
6665 |
||
6666 |
%{ /* NOCONTEXT */ |
|
6667 |
#ifdef GLX |
|
6668 |
SETWIN(aGLXWindowId) |
|
6669 |
lsrepeat(_longVal(factor)); |
|
6670 |
RETURN (true); |
|
6671 |
#endif |
|
6672 |
%} |
|
6673 |
. |
|
6674 |
^ false |
|
6675 |
! |
|
6676 |
||
6677 |
glxMaketag: t in: aGLXWindowId |
|
6678 |
||
6679 |
%{ /* NOCONTEXT */ |
|
6680 |
#ifdef GLX |
|
6681 |
SETWIN(aGLXWindowId) |
|
6682 |
maketag(_tagVal(t)); |
|
6683 |
RETURN (true); |
|
6684 |
#endif |
|
6685 |
%} |
|
6686 |
. |
|
6687 |
^ false |
|
6688 |
! |
|
6689 |
||
6690 |
glxMaxsizeX: x y: y in: aGLXWindowId |
|
6691 |
||
6692 |
%{ /* NOCONTEXT */ |
|
6693 |
#ifdef GLX |
|
6694 |
SETWIN(aGLXWindowId) |
|
6695 |
maxsize(_longVal(x), _longVal(y)); |
|
6696 |
RETURN (true); |
|
6697 |
#endif |
|
6698 |
%} |
|
6699 |
. |
|
6700 |
^ false |
|
6701 |
! |
|
6702 |
||
6703 |
glxMinsizeX: x y: y in: aGLXWindowId |
|
6704 |
||
6705 |
%{ /* NOCONTEXT */ |
|
6706 |
#ifdef GLX |
|
6707 |
SETWIN(aGLXWindowId) |
|
6708 |
minsize(_longVal(x), _longVal(y)); |
|
6709 |
RETURN (true); |
|
6710 |
#endif |
|
6711 |
%} |
|
6712 |
. |
|
6713 |
^ false |
|
6714 |
! |
|
6715 |
||
6716 |
glxMsalphaMode: mode in: aGLXWindowId |
|
6717 |
||
6718 |
%{ /* NOCONTEXT */ |
|
6719 |
#ifdef FULL_GLX |
|
6720 |
SETWIN(aGLXWindowId) |
|
6721 |
msalpha(_longVal(mode)); |
|
6722 |
RETURN (true); |
|
6723 |
#endif |
|
6724 |
%} |
|
6725 |
. |
|
6726 |
^ false |
|
6727 |
! |
|
6728 |
||
6729 |
glxMsmask: mask inverse: inverse in: aGLXWindowId |
|
6730 |
||
6731 |
%{ /* NOCONTEXT */ |
|
6732 |
#ifdef FULL_GLX |
|
6733 |
SETWIN(aGLXWindowId) |
|
6734 |
msmask(_floatVal(mask), _booleanVal(inverse)); |
|
6735 |
RETURN (true); |
|
6736 |
#endif |
|
6737 |
%} |
|
6738 |
. |
|
6739 |
^ false |
|
6740 |
! |
|
6741 |
||
6742 |
glxMspattern: pattern in: aGLXWindowId |
|
6743 |
||
6744 |
%{ /* NOCONTEXT */ |
|
6745 |
#ifdef FULL_GLX |
|
6746 |
SETWIN(aGLXWindowId) |
|
6747 |
mspattern(_longVal(pattern)); |
|
6748 |
RETURN (true); |
|
6749 |
#endif |
|
6750 |
%} |
|
6751 |
. |
|
6752 |
^ false |
|
6753 |
! |
|
6754 |
||
6755 |
glxMssizeSamples: samples zsize: zsize ssize: ssize in: aGLXWindowId |
|
6756 |
||
6757 |
%{ /* NOCONTEXT */ |
|
6758 |
#ifdef FULL_GLX |
|
6759 |
SETWIN(aGLXWindowId) |
|
6760 |
mssize(_longVal(samples), _longVal(zsize), _longVal(ssize)); |
|
6761 |
RETURN (true); |
|
6762 |
#endif |
|
6763 |
%} |
|
6764 |
. |
|
6765 |
^ false |
|
6766 |
! |
|
6767 |
||
6768 |
glxMswapbuffers: fbuf in: aGLXWindowId |
|
6769 |
||
6770 |
%{ /* NOCONTEXT */ |
|
6771 |
#ifdef GLX |
|
6772 |
SETWIN(aGLXWindowId) |
|
6773 |
mswapbuffers(_longVal(fbuf)); |
|
6774 |
RETURN (true); |
|
6775 |
#endif |
|
6776 |
%} |
|
6777 |
. |
|
6778 |
^ false |
|
6779 |
! |
|
6780 |
||
6781 |
glxMultimapIn: aGLXWindowId |
|
6782 |
||
6783 |
%{ /* NOCONTEXT */ |
|
6784 |
#ifdef GLX |
|
6785 |
SETWIN(aGLXWindowId) |
|
6786 |
multimap(); |
|
6787 |
RETURN (true); |
|
6788 |
#endif |
|
6789 |
%} |
|
6790 |
. |
|
6791 |
^ false |
|
6792 |
! |
|
6793 |
||
6794 |
glxMultisample: bool in: aGLXWindowId |
|
6795 |
||
6796 |
%{ /* NOCONTEXT */ |
|
6797 |
#ifdef FULL_GLX |
|
6798 |
SETWIN(aGLXWindowId) |
|
6799 |
multisample(_booleanVal(bool)); |
|
6800 |
RETURN (true); |
|
6801 |
#endif |
|
6802 |
%} |
|
6803 |
. |
|
6804 |
^ false |
|
6805 |
! |
|
6806 |
||
6807 |
glxNewpupIn: aGLXWindowId |
|
6808 |
||
6809 |
%{ /* NOCONTEXT */ |
|
6810 |
#ifdef GLX |
|
6811 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6812 |
RETURN (__MKSMALLINT(newpup())); |
294 | 6813 |
#endif |
6814 |
%} |
|
6815 |
. |
|
6816 |
^ false |
|
6817 |
! |
|
6818 |
||
6819 |
glxNewtag: newtg oldtg: oldtg offst: offst in: aGLXWindowId |
|
6820 |
||
6821 |
%{ /* NOCONTEXT */ |
|
6822 |
#ifdef GLX |
|
6823 |
SETWIN(aGLXWindowId) |
|
6824 |
newtag(_tagVal(newtg), _tagVal(oldtg), _offsetVal(offst)); |
|
6825 |
RETURN (true); |
|
6826 |
#endif |
|
6827 |
%} |
|
6828 |
. |
|
6829 |
^ false |
|
6830 |
! |
|
6831 |
||
6832 |
glxNoborderIn: aGLXWindowId |
|
6833 |
||
6834 |
%{ /* NOCONTEXT */ |
|
6835 |
#ifdef GLX |
|
6836 |
SETWIN(aGLXWindowId) |
|
6837 |
noborder(); |
|
6838 |
RETURN (true); |
|
6839 |
#endif |
|
6840 |
%} |
|
6841 |
. |
|
6842 |
^ false |
|
6843 |
! |
|
6844 |
||
6845 |
glxNoise: v delta: delta in: aGLXWindowId |
|
6846 |
||
6847 |
%{ /* NOCONTEXT */ |
|
6848 |
#ifdef GLX |
|
6849 |
SETWIN(aGLXWindowId) |
|
6850 |
noise(_deviceVal(v), _shortVal(delta)); |
|
6851 |
RETURN (true); |
|
6852 |
#endif |
|
6853 |
%} |
|
6854 |
. |
|
6855 |
^ false |
|
6856 |
! |
|
6857 |
||
6858 |
glxNoportIn: aGLXWindowId |
|
6859 |
||
6860 |
%{ /* NOCONTEXT */ |
|
6861 |
#ifdef GLX |
|
6862 |
SETWIN(aGLXWindowId) |
|
6863 |
noport(); |
|
6864 |
RETURN (true); |
|
6865 |
#endif |
|
6866 |
%} |
|
6867 |
. |
|
6868 |
^ false |
|
6869 |
! |
|
6870 |
||
6871 |
glxNurbscurveKnotCount: knotCount knotList: knotList |
|
4718 | 6872 |
offset: offset ctlArray: ctlArray |
294 | 6873 |
order: order type: type in: aGLXWindowId |
6874 |
||
6875 |
| ctlPoints i | |
|
6876 |
ctlPoints := DoubleArray new: ctlArray size * (ctlArray first size). |
|
6877 |
i := 1. |
|
6878 |
ctlArray do: [:point | |
|
4718 | 6879 |
point do: [:coord | |
294 | 6880 |
ctlPoints at: i put: coord. |
6881 |
i := i + 1]]. |
|
6882 |
||
6883 |
%{ /* NOCONTEXT */ |
|
6884 |
#ifdef GLX |
|
6885 |
char *knotElements, *ctlElements; |
|
6886 |
OBJ cls; |
|
6887 |
int ninstVars, nInstBytes; |
|
6888 |
||
6889 |
SETWIN(aGLXWindowId) |
|
6890 |
cls = __qClass(ctlPoints); |
|
6891 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
6892 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
|
6893 |
||
6894 |
ctlElements = (char *)(_InstPtr(ctlPoints)) + nInstBytes; |
|
6895 |
knotElements = (char *)(_InstPtr(knotList)) + nInstBytes; |
|
6896 |
||
6897 |
nurbscurve ( |
|
6898 |
_longVal(knotCount), (double *)knotElements, |
|
4718 | 6899 |
_longVal(offset), (double *)ctlElements, |
294 | 6900 |
_longVal(order), _longVal(type)); |
6901 |
RETURN(true); |
|
6902 |
#endif |
|
6903 |
%} |
|
6904 |
. |
|
6905 |
^ false |
|
6906 |
! |
|
6907 |
||
6908 |
glxObjdeleteTag1: tag1 tag2: tag2 in: aGLXWindowId |
|
6909 |
||
6910 |
%{ /* NOCONTEXT */ |
|
6911 |
#ifdef GLX |
|
6912 |
SETWIN(aGLXWindowId) |
|
6913 |
objdelete(_tagVal(tag1), _tagVal(tag2)); |
|
6914 |
RETURN (true); |
|
6915 |
#endif |
|
6916 |
%} |
|
6917 |
. |
|
6918 |
^ false |
|
6919 |
! |
|
6920 |
||
6921 |
glxObjinsert: t in: aGLXWindowId |
|
6922 |
||
6923 |
%{ /* NOCONTEXT */ |
|
6924 |
#ifdef GLX |
|
6925 |
SETWIN(aGLXWindowId) |
|
6926 |
objinsert(_tagVal(t)); |
|
6927 |
RETURN (true); |
|
6928 |
#endif |
|
6929 |
%} |
|
6930 |
. |
|
6931 |
^ false |
|
6932 |
! |
|
6933 |
||
6934 |
glxObjreplace: t in: aGLXWindowId |
|
6935 |
||
6936 |
%{ /* NOCONTEXT */ |
|
6937 |
#ifdef GLX |
|
6938 |
SETWIN(aGLXWindowId) |
|
6939 |
objreplace(_tagVal(t)); |
|
6940 |
RETURN (true); |
|
6941 |
#endif |
|
6942 |
%} |
|
6943 |
. |
|
6944 |
^ false |
|
6945 |
! |
|
6946 |
||
6947 |
glxOnemapIn: aGLXWindowId |
|
6948 |
||
6949 |
%{ /* NOCONTEXT */ |
|
6950 |
#ifdef GLX |
|
6951 |
SETWIN(aGLXWindowId) |
|
6952 |
onemap(); |
|
6953 |
RETURN (true); |
|
6954 |
#endif |
|
6955 |
%} |
|
6956 |
. |
|
6957 |
^ false |
|
6958 |
! |
|
6959 |
||
6960 |
glxPagecolor: pcolor in: aGLXWindowId |
|
6961 |
||
6962 |
%{ /* NOCONTEXT */ |
|
6963 |
#ifdef GLX |
|
6964 |
SETWIN(aGLXWindowId) |
|
6965 |
pagecolor(_colorindexVal(pcolor)); |
|
6966 |
RETURN (true); |
|
6967 |
#endif |
|
6968 |
%} |
|
6969 |
. |
|
6970 |
^ false |
|
6971 |
! |
|
6972 |
||
6973 |
glxPassthroughToken: token in: aGLXWindowId |
|
6974 |
||
6975 |
%{ /* NOCONTEXT */ |
|
6976 |
#ifdef GLX |
|
6977 |
SETWIN(aGLXWindowId) |
|
6978 |
passthrough(_shortVal(token)); |
|
6979 |
RETURN (true); |
|
6980 |
#endif |
|
6981 |
%} |
|
6982 |
. |
|
6983 |
^ false |
|
6984 |
! |
|
6985 |
||
6986 |
glxPclosIn: aGLXWindowId |
|
6987 |
||
6988 |
%{ /* NOCONTEXT */ |
|
6989 |
#ifdef GLX |
|
6990 |
SETWIN(aGLXWindowId) |
|
6991 |
pclos(); |
|
6992 |
RETURN (true); |
|
6993 |
#endif |
|
6994 |
%} |
|
6995 |
. |
|
6996 |
^ false |
|
6997 |
! |
|
6998 |
||
6999 |
glxPicksizeX: x y: y in: aGLXWindowId |
|
7000 |
||
7001 |
%{ /* NOCONTEXT */ |
|
7002 |
#ifdef GLX |
|
7003 |
SETWIN(aGLXWindowId) |
|
7004 |
picksize(_shortVal(x), _shortVal(y)); |
|
7005 |
RETURN (true); |
|
7006 |
#endif |
|
7007 |
%} |
|
7008 |
. |
|
7009 |
^ false |
|
7010 |
! |
|
7011 |
||
7012 |
glxPixmode: mode value: value in: aGLXWindowId |
|
7013 |
||
7014 |
%{ /* NOCONTEXT */ |
|
7015 |
#ifdef GLX |
|
7016 |
SETWIN(aGLXWindowId) |
|
7017 |
pixmode(_longVal(mode), _longVal(value)); |
|
7018 |
RETURN (true); |
|
7019 |
#endif |
|
7020 |
%} |
|
7021 |
. |
|
7022 |
^ false |
|
7023 |
! |
|
7024 |
||
7025 |
glxPntsmoothMode: mode in: aGLXWindowId |
|
7026 |
||
7027 |
%{ /* NOCONTEXT */ |
|
7028 |
#ifdef GLX |
|
7029 |
SETWIN(aGLXWindowId) |
|
7030 |
pntsmooth((ulong)__intVal(mode)); |
|
7031 |
RETURN (true); |
|
7032 |
#endif |
|
7033 |
%} |
|
7034 |
. |
|
7035 |
^ false |
|
7036 |
! |
|
7037 |
||
7038 |
glxPolysmoothMode: mode in: aGLXWindowId |
|
7039 |
||
7040 |
%{ /* NOCONTEXT */ |
|
7041 |
#ifdef GLX |
|
7042 |
SETWIN(aGLXWindowId) |
|
7043 |
polysmooth(_longVal(mode)); |
|
7044 |
RETURN (true); |
|
7045 |
#endif |
|
7046 |
%} |
|
7047 |
. |
|
7048 |
^ false |
|
7049 |
! |
|
7050 |
||
7051 |
glxPopnameIn: aGLXWindowId |
|
7052 |
||
7053 |
%{ /* NOCONTEXT */ |
|
7054 |
#ifdef GLX |
|
7055 |
SETWIN(aGLXWindowId) |
|
7056 |
popname(); |
|
7057 |
RETURN (true); |
|
7058 |
#endif |
|
7059 |
%} |
|
7060 |
. |
|
7061 |
^ false |
|
7062 |
! |
|
7063 |
||
7064 |
glxPrefpositionX1: x1 x2: x2 y1: y1 y2: y2 in: aGLXWindowId |
|
7065 |
||
7066 |
%{ /* NOCONTEXT */ |
|
7067 |
SETWIN(aGLXWindowId) |
|
1932 | 7068 |
#ifdef OPENGL |
7069 |
#else |
|
294 | 7070 |
prefposition(_longVal(x1), _longVal(x2), _longVal(y1), _longVal(y2)); |
1932 | 7071 |
#endif |
294 | 7072 |
RETURN (true); |
7073 |
%} |
|
7074 |
! |
|
7075 |
||
7076 |
glxPrefsizeX: x y: y in: aGLXWindowId |
|
7077 |
||
7078 |
%{ /* NOCONTEXT */ |
|
7079 |
SETWIN(aGLXWindowId) |
|
1932 | 7080 |
#ifdef OPENGL |
7081 |
#else |
|
294 | 7082 |
prefsize(_longVal(x), _longVal(y)); |
1932 | 7083 |
#endif |
294 | 7084 |
RETURN (true); |
7085 |
%} |
|
7086 |
! |
|
7087 |
||
7088 |
glxPupmodeIn: aGLXWindowId |
|
7089 |
||
7090 |
%{ /* NOCONTEXT */ |
|
7091 |
#ifdef GLX |
|
7092 |
SETWIN(aGLXWindowId) |
|
7093 |
pupmode(); |
|
7094 |
RETURN (true); |
|
7095 |
#endif |
|
7096 |
%} |
|
7097 |
. |
|
7098 |
^ false |
|
7099 |
! |
|
7100 |
||
7101 |
glxPushname: name In: aGLXWindowId |
|
7102 |
||
7103 |
%{ /* NOCONTEXT */ |
|
7104 |
#ifdef GLX |
|
7105 |
SETWIN(aGLXWindowId) |
|
7106 |
pushname(_shortVal(name)); |
|
7107 |
RETURN (true); |
|
7108 |
#endif |
|
7109 |
%} |
|
7110 |
. |
|
7111 |
^ false |
|
7112 |
! |
|
7113 |
||
7114 |
glxQdevice: dev in: aGLXWindowId |
|
7115 |
||
7116 |
%{ /* NOCONTEXT */ |
|
1932 | 7117 |
SETWIN(aGLXWindowId) |
7118 |
#ifdef OPENGL |
|
7119 |
#else |
|
294 | 7120 |
qdevice(_deviceVal(dev)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7121 |
#endif |
294 | 7122 |
%} |
7123 |
! |
|
7124 |
||
7125 |
glxQenterDev: dev val: val in: aGLXWindowId |
|
7126 |
||
7127 |
%{ /* NOCONTEXT */ |
|
7128 |
SETWIN(aGLXWindowId) |
|
1932 | 7129 |
#ifdef OPENGL |
7130 |
#else |
|
294 | 7131 |
qenter(_deviceVal(dev), _shortVal(val)); |
1932 | 7132 |
#endif |
294 | 7133 |
%} |
7134 |
! |
|
7135 |
||
7136 |
glxQgetfdIn: aGLXWindowId |
|
7137 |
||
7138 |
%{ /* NOCONTEXT */ |
|
7139 |
#ifdef GLX |
|
7140 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7141 |
RETURN (__MKSMALLINT(qgetfd())); |
294 | 7142 |
#endif |
7143 |
%} |
|
7144 |
. |
|
7145 |
^ false |
|
7146 |
! |
|
7147 |
||
7148 |
glxQreadIn: aGLXWindowId |
|
7149 |
||
7150 |
| dev data | |
|
4718 | 7151 |
%{ |
294 | 7152 |
short c_data; |
7153 |
||
7154 |
SETWIN(aGLXWindowId) |
|
1932 | 7155 |
#ifdef OPENGL |
7156 |
#else |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7157 |
dev = __MKSMALLINT(qread(&c_data)); |
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7158 |
data = __MKSMALLINT(c_data); |
1932 | 7159 |
#endif |
294 | 7160 |
%} |
7161 |
. |
|
7162 |
^ Array with: dev with: data |
|
7163 |
! |
|
7164 |
||
7165 |
glxQresetIn: aGLXWindowId |
|
7166 |
||
7167 |
%{ /* NOCONTEXT */ |
|
7168 |
SETWIN(aGLXWindowId) |
|
1932 | 7169 |
#ifdef OPENGL |
7170 |
#else |
|
294 | 7171 |
qreset(); |
1932 | 7172 |
#endif |
294 | 7173 |
RETURN (true); |
7174 |
%} |
|
7175 |
! |
|
7176 |
||
7177 |
glxQtestIn: aGLXWindowId |
|
7178 |
||
7179 |
%{ /* NOCONTEXT */ |
|
1932 | 7180 |
int rslt = 0; |
7181 |
||
7182 |
SETWIN(aGLXWindowId) |
|
7183 |
#ifdef OPENGL |
|
7184 |
#else |
|
7185 |
rslt = qtest(); |
|
7186 |
#endif |
|
7187 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 7188 |
%} |
7189 |
! |
|
7190 |
||
4718 | 7191 |
glxRGBcursorIndex: index red: red green: green blue: blue |
294 | 7192 |
redm: redm greenm: greenm bluem: bluem in: aGLXWindowId |
7193 |
||
7194 |
%{ /* NOCONTEXT */ |
|
7195 |
#ifdef GLX |
|
7196 |
SETWIN(aGLXWindowId) |
|
4718 | 7197 |
RGBcursor(_shortVal(index), |
7198 |
_shortVal(red), _shortVal(green), _shortVal(blue), |
|
294 | 7199 |
_shortVal(redm), _shortVal(greenm), _shortVal(bluem)); |
7200 |
RETURN (true); |
|
7201 |
#endif |
|
7202 |
%} |
|
7203 |
. |
|
7204 |
^ false |
|
7205 |
! |
|
7206 |
||
7207 |
glxRGBwritemaskRed: red green: green blue: blue in: aGLXWindowId |
|
7208 |
||
7209 |
%{ /* NOCONTEXT */ |
|
7210 |
#ifdef GLX |
|
7211 |
SETWIN(aGLXWindowId) |
|
7212 |
RGBwritemask(_shortVal(red), _shortVal(green), _shortVal(blue)); |
|
7213 |
RETURN (true); |
|
7214 |
#endif |
|
7215 |
%} |
|
7216 |
. |
|
7217 |
^ false |
|
7218 |
! |
|
7219 |
||
7220 |
glxRectzoomX: xfactor y: yfactor in: aGLXWindowId |
|
7221 |
||
7222 |
%{ /* NOCONTEXT */ |
|
7223 |
#ifdef GLX |
|
7224 |
SETWIN(aGLXWindowId) |
|
7225 |
rectzoom(_floatVal(xfactor), _floatVal(yfactor)); |
|
7226 |
RETURN (true); |
|
7227 |
#endif |
|
7228 |
%} |
|
7229 |
. |
|
7230 |
^ false |
|
7231 |
! |
|
7232 |
||
7233 |
glxResetls: b in: aGLXWindowId |
|
7234 |
||
7235 |
%{ /* NOCONTEXT */ |
|
7236 |
#ifdef GLX |
|
7237 |
SETWIN(aGLXWindowId) |
|
7238 |
resetls(_booleanVal(b)); |
|
7239 |
RETURN (true); |
|
7240 |
#endif |
|
7241 |
%} |
|
7242 |
. |
|
7243 |
^ false |
|
7244 |
! |
|
7245 |
||
7246 |
glxRingbellIn: aGLXWindowId |
|
7247 |
||
7248 |
%{ /* NOCONTEXT */ |
|
7249 |
#ifdef GLX |
|
7250 |
SETWIN(aGLXWindowId) |
|
7251 |
ringbell(); |
|
7252 |
RETURN (true); |
|
7253 |
#endif |
|
7254 |
%} |
|
7255 |
. |
|
7256 |
^ false |
|
7257 |
! |
|
7258 |
||
7259 |
glxSboxX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7260 |
||
7261 |
%{ /* NOCONTEXT */ |
|
7262 |
#ifdef GLX |
|
7263 |
SETWIN(aGLXWindowId) |
|
7264 |
sbox(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
7265 |
RETURN (true); |
|
7266 |
#endif |
|
7267 |
%} |
|
7268 |
. |
|
7269 |
^ false |
|
7270 |
! |
|
7271 |
||
7272 |
glxSboxfX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7273 |
||
7274 |
%{ /* NOCONTEXT */ |
|
7275 |
#ifdef GLX |
|
7276 |
SETWIN(aGLXWindowId) |
|
7277 |
sboxf(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
7278 |
RETURN (true); |
|
7279 |
#endif |
|
7280 |
%} |
|
7281 |
. |
|
7282 |
^ false |
|
7283 |
! |
|
7284 |
||
7285 |
glxSboxfiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7286 |
||
7287 |
%{ /* NOCONTEXT */ |
|
7288 |
#ifdef GLX |
|
7289 |
SETWIN(aGLXWindowId) |
|
7290 |
sboxfi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
7291 |
RETURN (true); |
|
7292 |
#endif |
|
7293 |
%} |
|
7294 |
. |
|
7295 |
^ false |
|
7296 |
! |
|
7297 |
||
7298 |
glxSboxfsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7299 |
||
7300 |
%{ /* NOCONTEXT */ |
|
7301 |
#ifdef GLX |
|
7302 |
SETWIN(aGLXWindowId) |
|
7303 |
sboxfs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
7304 |
RETURN (true); |
|
7305 |
#endif |
|
7306 |
%} |
|
7307 |
. |
|
7308 |
^ false |
|
7309 |
! |
|
7310 |
||
7311 |
glxSboxiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7312 |
||
7313 |
%{ /* NOCONTEXT */ |
|
7314 |
#ifdef GLX |
|
7315 |
SETWIN(aGLXWindowId) |
|
7316 |
sboxi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
7317 |
RETURN (true); |
|
7318 |
#endif |
|
7319 |
%} |
|
7320 |
. |
|
7321 |
^ false |
|
7322 |
! |
|
7323 |
||
7324 |
glxSboxsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7325 |
||
7326 |
%{ /* NOCONTEXT */ |
|
7327 |
#ifdef GLX |
|
7328 |
SETWIN(aGLXWindowId) |
|
7329 |
sboxs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
7330 |
RETURN (true); |
|
7331 |
#endif |
|
7332 |
%} |
|
7333 |
. |
|
7334 |
^ false |
|
7335 |
! |
|
7336 |
||
7337 |
glxSclearSval: sval in: aGLXWindowId |
|
7338 |
||
7339 |
%{ /* NOCONTEXT */ |
|
7340 |
#ifdef GLX |
|
7341 |
SETWIN(aGLXWindowId) |
|
7342 |
sclear((ulong)__intVal(sval)); |
|
7343 |
RETURN (true); |
|
7344 |
#endif |
|
7345 |
%} |
|
7346 |
. |
|
7347 |
^ false |
|
7348 |
! |
|
7349 |
||
7350 |
glxScrbox: arg in: aGLXWindowId |
|
7351 |
||
7352 |
%{ /* NOCONTEXT */ |
|
7353 |
#ifdef GLX |
|
7354 |
SETWIN(aGLXWindowId) |
|
7355 |
scrbox(_longVal(arg)); |
|
7356 |
RETURN (true); |
|
7357 |
#endif |
|
7358 |
%} |
|
7359 |
. |
|
7360 |
^ false |
|
7361 |
! |
|
7362 |
||
7363 |
glxScreenspaceIn: aGLXWindowId |
|
7364 |
||
7365 |
%{ /* NOCONTEXT */ |
|
7366 |
#ifdef GLX |
|
7367 |
SETWIN(aGLXWindowId) |
|
7368 |
screenspace(); |
|
7369 |
RETURN (true); |
|
7370 |
#endif |
|
7371 |
%} |
|
7372 |
. |
|
7373 |
^ false |
|
7374 |
! |
|
7375 |
||
7376 |
glxScrmaskLeft: left right: right bottom: bottom top: top in: aGLXWindowId |
|
7377 |
||
7378 |
%{ /* NOCONTEXT */ |
|
7379 |
#ifdef GLX |
|
7380 |
SETWIN(aGLXWindowId) |
|
4718 | 7381 |
scrmask(_screencoordVal(left), _screencoordVal(right), |
294 | 7382 |
_screencoordVal(bottom), _screencoordVal(top)); |
7383 |
RETURN (true); |
|
7384 |
#endif |
|
7385 |
%} |
|
7386 |
. |
|
7387 |
^ false |
|
7388 |
! |
|
7389 |
||
7390 |
glxScrnattach: gsnr in: aGLXWindowId |
|
7391 |
||
7392 |
%{ /* NOCONTEXT */ |
|
7393 |
#ifdef GLX |
|
7394 |
SETWIN(aGLXWindowId) |
|
7395 |
scrnattach(_longVal(gsnr)); |
|
7396 |
RETURN (true); |
|
7397 |
#endif |
|
7398 |
%} |
|
7399 |
. |
|
7400 |
^ false |
|
7401 |
! |
|
7402 |
||
7403 |
glxScrnselect: gsnr in: aGLXWindowId |
|
7404 |
||
7405 |
%{ /* NOCONTEXT */ |
|
7406 |
#ifdef GLX |
|
7407 |
SETWIN(aGLXWindowId) |
|
7408 |
scrnselect(_longVal(gsnr)); |
|
7409 |
RETURN (true); |
|
7410 |
#endif |
|
7411 |
%} |
|
7412 |
. |
|
7413 |
^ false |
|
7414 |
! |
|
7415 |
||
7416 |
glxSetcursorIndex: index color: color wtn: wtn in: aGLXWindowId |
|
7417 |
||
7418 |
%{ /* NOCONTEXT */ |
|
7419 |
#ifdef GLX |
|
7420 |
SETWIN(aGLXWindowId) |
|
7421 |
setcursor(_shortVal(index), _colorindexVal(color), _colorindexVal(wtn)); |
|
7422 |
RETURN (true); |
|
7423 |
#endif |
|
7424 |
%} |
|
7425 |
. |
|
7426 |
^ false |
|
7427 |
! |
|
7428 |
||
7429 |
glxSetdblightsMask: mask in: aGLXWindowId |
|
7430 |
||
7431 |
%{ /* NOCONTEXT */ |
|
7432 |
#ifdef GLX |
|
7433 |
SETWIN(aGLXWindowId) |
|
7434 |
setdblights((ulong)__intVal(mask)); |
|
7435 |
RETURN (true); |
|
7436 |
#endif |
|
7437 |
%} |
|
7438 |
. |
|
7439 |
^ false |
|
7440 |
! |
|
7441 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7442 |
glxSetdepthNear:znear far:zfar in: aGLXWindowId |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7443 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7444 |
%{ /* NOCONTEXT */ |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7445 |
#ifdef GLX |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7446 |
SETWIN(aGLXWindowId) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7447 |
setdepth(_screencoordVal(znear), _screencoordVal(zfar)); |
294 | 7448 |
RETURN (true); |
7449 |
#endif |
|
7450 |
%} |
|
7451 |
. |
|
7452 |
^ false |
|
7453 |
! |
|
7454 |
||
7455 |
glxSetmap: mapnum in: aGLXWindowId |
|
7456 |
||
7457 |
%{ /* NOCONTEXT */ |
|
7458 |
#ifdef GLX |
|
7459 |
SETWIN(aGLXWindowId) |
|
7460 |
setmap(_shortVal(mapnum)); |
|
7461 |
RETURN (true); |
|
7462 |
#endif |
|
7463 |
%} |
|
7464 |
. |
|
7465 |
^ false |
|
7466 |
! |
|
7467 |
||
7468 |
glxSetmonitor: mtype in: aGLXWindowId |
|
7469 |
||
7470 |
%{ /* NOCONTEXT */ |
|
7471 |
#ifdef GLX |
|
7472 |
SETWIN(aGLXWindowId) |
|
7473 |
setmonitor(_shortVal(mtype)); |
|
7474 |
RETURN (true); |
|
7475 |
#endif |
|
7476 |
%} |
|
7477 |
. |
|
7478 |
^ false |
|
7479 |
! |
|
7480 |
||
7481 |
glxSetnurbsproperty: property value: value in: aGLXWindowId |
|
7482 |
||
7483 |
%{ /* NOCONTEXT */ |
|
7484 |
#ifdef GLX |
|
7485 |
SETWIN(aGLXWindowId) |
|
7486 |
setnurbsproperty(_longVal(property), _floatVal(value)); |
|
7487 |
RETURN (true); |
|
7488 |
#endif |
|
7489 |
%} |
|
7490 |
. |
|
7491 |
^ false |
|
7492 |
! |
|
7493 |
||
7494 |
glxSetpattern: index in: aGLXWindowId |
|
7495 |
||
7496 |
%{ /* NOCONTEXT */ |
|
7497 |
#ifdef GLX |
|
7498 |
SETWIN(aGLXWindowId) |
|
7499 |
setpattern(_shortVal(index)); |
|
7500 |
RETURN (true); |
|
7501 |
#endif |
|
7502 |
%} |
|
7503 |
. |
|
7504 |
^ false |
|
7505 |
! |
|
7506 |
||
7507 |
glxSetpup: pup entry: entry mode: mode in: aGLXWindowId |
|
7508 |
||
7509 |
%{ /* NOCONTEXT */ |
|
7510 |
#ifdef GLX |
|
7511 |
SETWIN(aGLXWindowId) |
|
7512 |
setpup(_longVal(pup), _longVal(entry), (ulong)__intVal(mode)); |
|
7513 |
RETURN (true); |
|
7514 |
#endif |
|
7515 |
%} |
|
7516 |
. |
|
7517 |
^ false |
|
7518 |
! |
|
7519 |
||
7520 |
glxSetvaluator: v init: init vmin: vmin vmax: vmax in: aGLXWindowId |
|
7521 |
||
7522 |
%{ /* NOCONTEXT */ |
|
7523 |
#ifdef GLX |
|
7524 |
SETWIN(aGLXWindowId) |
|
7525 |
setvaluator(_deviceVal(v), _shortVal(init), _shortVal(vmin), _shortVal(vmax)); |
|
7526 |
RETURN (true); |
|
7527 |
#endif |
|
7528 |
%} |
|
7529 |
. |
|
7530 |
^ false |
|
7531 |
! |
|
7532 |
||
7533 |
glxSetvideo: reg value: value in: aGLXWindowId |
|
7534 |
||
7535 |
%{ /* NOCONTEXT */ |
|
7536 |
#ifdef GLX |
|
7537 |
SETWIN(aGLXWindowId) |
|
7538 |
setvideo(_longVal(reg), _longVal(value)); |
|
7539 |
RETURN (true); |
|
7540 |
#endif |
|
7541 |
%} |
|
7542 |
. |
|
7543 |
^ false |
|
7544 |
! |
|
7545 |
||
7546 |
glxShademodel: model in: aGLXWindowId |
|
7547 |
||
7548 |
%{ /* NOCONTEXT */ |
|
7549 |
#ifdef GLX |
|
7550 |
SETWIN(aGLXWindowId) |
|
7551 |
shademodel(_longVal(model)); |
|
7552 |
RETURN (true); |
|
7553 |
#endif |
|
7554 |
%} |
|
7555 |
. |
|
7556 |
^ false |
|
7557 |
! |
|
7558 |
||
7559 |
glxShaderangeLowin: lowin hiwin: hiwin z1: z1 z2: z2 in: aGLXWindowId |
|
7560 |
||
7561 |
%{ /* NOCONTEXT */ |
|
7562 |
#ifdef GLX |
|
7563 |
SETWIN(aGLXWindowId) |
|
4718 | 7564 |
shaderange(_colorindexVal(lowin), _colorindexVal(hiwin), |
294 | 7565 |
_screencoordVal(z1), _screencoordVal(z2)); |
7566 |
RETURN (true); |
|
7567 |
#endif |
|
7568 |
%} |
|
7569 |
. |
|
7570 |
^ false |
|
7571 |
! |
|
7572 |
||
7573 |
glxSmoothline: mode in: aGLXWindowId |
|
7574 |
||
7575 |
%{ /* NOCONTEXT */ |
|
7576 |
#ifdef GLX |
|
7577 |
SETWIN(aGLXWindowId) |
|
7578 |
smoothline(_longVal(mode)); |
|
7579 |
RETURN (true); |
|
7580 |
#endif |
|
7581 |
%} |
|
7582 |
. |
|
7583 |
^ false |
|
7584 |
! |
|
7585 |
||
4718 | 7586 |
glxStencilEnable: enable ref: ref func: func mask: mask fail: fail |
294 | 7587 |
pass: pass zpass: zpass in: aGLXWindowId |
7588 |
||
7589 |
%{ /* NOCONTEXT */ |
|
7590 |
#ifdef GLX |
|
7591 |
SETWIN(aGLXWindowId) |
|
4718 | 7592 |
stencil(_longVal(enable), (ulong)__intVal(ref), _longVal(func), |
294 | 7593 |
(ulong)__intVal(mask), _longVal(fail), _longVal(pass), _longVal(zpass)); |
7594 |
RETURN (true); |
|
7595 |
#endif |
|
7596 |
%} |
|
7597 |
. |
|
7598 |
^ false |
|
7599 |
! |
|
7600 |
||
7601 |
glxStensize: planes in: aGLXWindowId |
|
7602 |
||
7603 |
%{ /* NOCONTEXT */ |
|
7604 |
#ifdef GLX |
|
7605 |
SETWIN(aGLXWindowId) |
|
7606 |
stensize(_longVal(planes)); |
|
7607 |
RETURN (true); |
|
7608 |
#endif |
|
7609 |
%} |
|
7610 |
. |
|
7611 |
^ false |
|
7612 |
! |
|
7613 |
||
7614 |
glxStepunitX: x y: y in: aGLXWindowId |
|
7615 |
||
7616 |
%{ /* NOCONTEXT */ |
|
7617 |
#ifdef GLX |
|
7618 |
SETWIN(aGLXWindowId) |
|
7619 |
stepunit(_longVal(x), _longVal(y)); |
|
7620 |
RETURN (true); |
|
7621 |
#endif |
|
7622 |
%} |
|
7623 |
. |
|
7624 |
^ false |
|
7625 |
! |
|
7626 |
||
7627 |
glxSubpixel: b in: aGLXWindowId |
|
7628 |
||
7629 |
%{ /* NOCONTEXT */ |
|
7630 |
#ifdef GLX |
|
7631 |
SETWIN(aGLXWindowId) |
|
7632 |
subpixel(_booleanVal(b)); |
|
7633 |
RETURN (true); |
|
7634 |
#endif |
|
7635 |
%} |
|
7636 |
. |
|
7637 |
^ false |
|
7638 |
! |
|
7639 |
||
7640 |
glxSwapinterval: i in: aGLXWindowId |
|
7641 |
||
7642 |
%{ /* NOCONTEXT */ |
|
7643 |
#ifdef GLX |
|
7644 |
SETWIN(aGLXWindowId) |
|
7645 |
swapinterval(_shortVal(i)); |
|
7646 |
RETURN (true); |
|
7647 |
#endif |
|
7648 |
%} |
|
7649 |
. |
|
7650 |
^ false |
|
7651 |
! |
|
7652 |
||
7653 |
glxSwaptmeshIn: aGLXWindowId |
|
7654 |
||
7655 |
%{ /* NOCONTEXT */ |
|
7656 |
#ifdef GLX |
|
7657 |
SETWIN(aGLXWindowId) |
|
7658 |
swaptmesh(); |
|
7659 |
RETURN (true); |
|
7660 |
#endif |
|
7661 |
%} |
|
7662 |
. |
|
7663 |
^ false |
|
7664 |
! |
|
7665 |
||
7666 |
glxSwinopen: parent in: aGLXWindowId |
|
7667 |
||
7668 |
%{ /* NOCONTEXT */ |
|
7669 |
#ifdef GLX |
|
7670 |
SETWIN(aGLXWindowId) |
|
7671 |
swinopen(_longVal(parent)); |
|
7672 |
RETURN (true); |
|
7673 |
#endif |
|
7674 |
%} |
|
7675 |
. |
|
7676 |
^ false |
|
7677 |
! |
|
7678 |
||
7679 |
glxSwritemask: mask in: aGLXWindowId |
|
7680 |
||
7681 |
%{ /* NOCONTEXT */ |
|
7682 |
#ifdef GLX |
|
7683 |
SETWIN(aGLXWindowId) |
|
7684 |
swritemask((ulong)__intVal(mask)); |
|
7685 |
RETURN (true); |
|
7686 |
#endif |
|
7687 |
%} |
|
7688 |
. |
|
7689 |
^ false |
|
7690 |
! |
|
7691 |
||
7692 |
glxTextinitIn: aGLXWindowId |
|
7693 |
||
7694 |
%{ /* NOCONTEXT */ |
|
7695 |
#ifdef GLX |
|
7696 |
SETWIN(aGLXWindowId) |
|
7697 |
textinit(); |
|
7698 |
RETURN (true); |
|
7699 |
#endif |
|
7700 |
%} |
|
7701 |
. |
|
7702 |
^ false |
|
7703 |
! |
|
7704 |
||
7705 |
glxTextportLeft: left right: right bottom: bottom top: top in: aGLXWindowId |
|
7706 |
||
7707 |
%{ /* NOCONTEXT */ |
|
7708 |
#ifdef GLX |
|
7709 |
SETWIN(aGLXWindowId) |
|
4718 | 7710 |
textport(_screencoordVal(left), _screencoordVal(right), |
294 | 7711 |
_screencoordVal(bottom), _screencoordVal(top)); |
7712 |
RETURN (true); |
|
7713 |
#endif |
|
7714 |
%} |
|
7715 |
. |
|
7716 |
^ false |
|
7717 |
! |
|
7718 |
||
7719 |
glxTieB: b v1: v1 v2: v2 in: aGLXWindowId |
|
7720 |
||
7721 |
%{ /* NOCONTEXT */ |
|
7722 |
#ifdef GLX |
|
7723 |
SETWIN(aGLXWindowId) |
|
7724 |
tie(_deviceVal(b), _deviceVal(v1), _deviceVal(v2)); |
|
7725 |
RETURN (true); |
|
7726 |
#endif |
|
7727 |
%} |
|
7728 |
. |
|
7729 |
^ false |
|
7730 |
! |
|
7731 |
||
7732 |
glxTlutbind: target index: index in: aGLXWindowId |
|
7733 |
||
7734 |
%{ /* NOCONTEXT */ |
|
7735 |
#ifdef FULL_GLX |
|
7736 |
SETWIN(aGLXWindowId) |
|
7737 |
tlutbind(_longVal(target), _longVal(index)); |
|
7738 |
RETURN (true); |
|
7739 |
#endif |
|
7740 |
%} |
|
7741 |
. |
|
7742 |
^ false |
|
7743 |
! |
|
7744 |
||
7745 |
glxTpoffIn: aGLXWindowId |
|
7746 |
||
7747 |
%{ /* NOCONTEXT */ |
|
7748 |
#ifdef GLX |
|
7749 |
SETWIN(aGLXWindowId) |
|
7750 |
tpoff(); |
|
7751 |
RETURN (true); |
|
7752 |
#endif |
|
7753 |
%} |
|
7754 |
. |
|
7755 |
^ false |
|
7756 |
! |
|
7757 |
||
7758 |
glxTponIn: aGLXWindowId |
|
7759 |
||
7760 |
%{ /* NOCONTEXT */ |
|
7761 |
#ifdef GLX |
|
7762 |
SETWIN(aGLXWindowId) |
|
7763 |
tpon(); |
|
7764 |
RETURN (true); |
|
7765 |
#endif |
|
7766 |
%} |
|
7767 |
. |
|
7768 |
^ false |
|
7769 |
! |
|
7770 |
||
7771 |
glxUnqdevice: dev in: aGLXWindowId |
|
7772 |
||
7773 |
%{ /* NOCONTEXT */ |
|
1932 | 7774 |
SETWIN(aGLXWindowId) |
7775 |
#ifdef OPENGL |
|
7776 |
#else |
|
294 | 7777 |
unqdevice(_deviceVal(dev)); |
1932 | 7778 |
#endif |
7779 |
%} |
|
294 | 7780 |
! |
7781 |
||
7782 |
glxWmpack: pack in: aGLXWindowId |
|
7783 |
||
7784 |
%{ /* NOCONTEXT */ |
|
7785 |
#ifdef GLX |
|
7786 |
SETWIN(aGLXWindowId) |
|
7787 |
wmpack((ulong)__intVal(pack)); |
|
7788 |
RETURN (true); |
|
7789 |
#endif |
|
7790 |
%} |
|
7791 |
. |
|
7792 |
^ false |
|
7793 |
! |
|
7794 |
||
7795 |
glxWritemask: wtm in: aGLXWindowId |
|
7796 |
||
7797 |
%{ /* NOCONTEXT */ |
|
7798 |
#ifdef GLX |
|
7799 |
SETWIN(aGLXWindowId) |
|
7800 |
writemask(_colorindexVal(wtm)); |
|
7801 |
RETURN (true); |
|
7802 |
#endif |
|
7803 |
%} |
|
7804 |
. |
|
7805 |
^ false |
|
7806 |
! |
|
7807 |
||
7808 |
glxXfpt2X: x y: y in: aGLXWindowId |
|
7809 |
||
7810 |
%{ /* NOCONTEXT */ |
|
7811 |
#ifdef GLX |
|
7812 |
Coord c_x, c_y; |
|
7813 |
||
7814 |
_COORD_ (x, c_x) |
|
7815 |
_COORD_ (y, c_y) |
|
7816 |
SETWIN(aGLXWindowId) |
|
7817 |
xfpt2(c_x, c_y); |
|
7818 |
RETURN (true); |
|
7819 |
#endif |
|
7820 |
%} |
|
7821 |
. |
|
7822 |
^ false |
|
7823 |
! |
|
7824 |
||
7825 |
glxXfpt2iX: x y: y in: aGLXWindowId |
|
7826 |
||
7827 |
%{ /* NOCONTEXT */ |
|
7828 |
#ifdef GLX |
|
7829 |
Icoord c_x, c_y; |
|
7830 |
||
7831 |
_ICOORD_ (x, c_x) |
|
7832 |
_ICOORD_ (y, c_y) |
|
7833 |
SETWIN(aGLXWindowId) |
|
7834 |
xfpt2i(c_x, c_y); |
|
7835 |
RETURN (true); |
|
7836 |
#endif |
|
7837 |
%} |
|
7838 |
. |
|
7839 |
^ false |
|
7840 |
! |
|
7841 |
||
7842 |
glxXfpt2sX: x y: y in: aGLXWindowId |
|
7843 |
||
7844 |
%{ /* NOCONTEXT */ |
|
7845 |
#ifdef GLX |
|
7846 |
Scoord c_x, c_y; |
|
7847 |
||
7848 |
_SCOORD_ (x, c_x) |
|
7849 |
_SCOORD_ (y, c_y) |
|
7850 |
SETWIN(aGLXWindowId) |
|
7851 |
xfpt2s(c_x, c_y); |
|
7852 |
RETURN (true); |
|
7853 |
#endif |
|
7854 |
%} |
|
7855 |
. |
|
7856 |
^ false |
|
7857 |
! |
|
7858 |
||
7859 |
glxXfpt4X: x y: y z: z w: w in: aGLXWindowId |
|
7860 |
||
7861 |
%{ /* NOCONTEXT */ |
|
7862 |
#ifdef GLX |
|
7863 |
Coord c_x, c_y, c_z, c_w; |
|
7864 |
||
7865 |
_COORD_ (x, c_x) |
|
7866 |
_COORD_ (y, c_y) |
|
7867 |
_COORD_ (z, c_z) |
|
7868 |
_COORD_ (w, c_w) |
|
7869 |
SETWIN(aGLXWindowId) |
|
7870 |
xfpt4(c_x, c_y, c_z, c_w); |
|
7871 |
RETURN (true); |
|
7872 |
#endif |
|
7873 |
%} |
|
7874 |
. |
|
7875 |
^ false |
|
7876 |
! |
|
7877 |
||
7878 |
glxXfpt4iX: x y: y z: z w: w in: aGLXWindowId |
|
7879 |
||
7880 |
%{ /* NOCONTEXT */ |
|
7881 |
#ifdef GLX |
|
7882 |
Icoord c_x, c_y, c_z, c_w; |
|
7883 |
||
7884 |
_ICOORD_ (x, c_x) |
|
7885 |
_ICOORD_ (y, c_y) |
|
7886 |
_ICOORD_ (z, c_z) |
|
7887 |
_ICOORD_ (w, c_w) |
|
7888 |
SETWIN(aGLXWindowId) |
|
7889 |
xfpt4i(c_x, c_y, c_z, c_w); |
|
7890 |
RETURN (true); |
|
7891 |
#endif |
|
7892 |
%} |
|
7893 |
. |
|
7894 |
^ false |
|
7895 |
! |
|
7896 |
||
7897 |
glxXfpt4sX: x y: y z: z w: w in: aGLXWindowId |
|
7898 |
||
7899 |
%{ /* NOCONTEXT */ |
|
7900 |
#ifdef GLX |
|
7901 |
Scoord c_x, c_y, c_z, c_w; |
|
7902 |
||
7903 |
_SCOORD_ (x, c_x) |
|
7904 |
_SCOORD_ (y, c_y) |
|
7905 |
_SCOORD_ (z, c_z) |
|
7906 |
_SCOORD_ (w, c_w) |
|
7907 |
SETWIN(aGLXWindowId) |
|
7908 |
xfpt4s(c_x, c_y, c_z, c_w); |
|
7909 |
RETURN (true); |
|
7910 |
#endif |
|
7911 |
%} |
|
7912 |
. |
|
7913 |
^ false |
|
7914 |
! |
|
7915 |
||
7916 |
glxXfptX: x y: y z: z in: aGLXWindowId |
|
7917 |
||
7918 |
%{ /* NOCONTEXT */ |
|
7919 |
#ifdef GLX |
|
7920 |
Coord c_x, c_y, c_z; |
|
7921 |
||
7922 |
_COORD_ (x, c_x) |
|
7923 |
_COORD_ (y, c_y) |
|
7924 |
_COORD_ (z, c_z) |
|
7925 |
SETWIN(aGLXWindowId) |
|
7926 |
xfpt(c_x, c_y, c_z); |
|
7927 |
RETURN (true); |
|
7928 |
#endif |
|
7929 |
%} |
|
7930 |
. |
|
7931 |
^ false |
|
7932 |
! |
|
7933 |
||
7934 |
glxXfptiX: x y: y z: z in: aGLXWindowId |
|
7935 |
||
7936 |
%{ /* NOCONTEXT */ |
|
7937 |
#ifdef GLX |
|
7938 |
Icoord c_x, c_y, c_z; |
|
7939 |
||
7940 |
_ICOORD_ (x, c_x) |
|
7941 |
_ICOORD_ (y, c_y) |
|
7942 |
_ICOORD_ (z, c_z) |
|
7943 |
SETWIN(aGLXWindowId) |
|
7944 |
xfpti(c_x, c_y, c_z); |
|
7945 |
RETURN (true); |
|
7946 |
#endif |
|
7947 |
%} |
|
7948 |
. |
|
7949 |
^ false |
|
7950 |
! |
|
7951 |
||
7952 |
glxXfptsX: x y: y z: z in: aGLXWindowId |
|
7953 |
||
7954 |
%{ /* NOCONTEXT */ |
|
7955 |
#ifdef GLX |
|
7956 |
Scoord c_x, c_y, c_z; |
|
7957 |
||
7958 |
_SCOORD_ (x, c_x) |
|
7959 |
_SCOORD_ (y, c_y) |
|
7960 |
_SCOORD_ (z, c_z) |
|
7961 |
SETWIN(aGLXWindowId) |
|
7962 |
xfpts(c_x, c_y, c_z); |
|
7963 |
RETURN (true); |
|
7964 |
#endif |
|
7965 |
%} |
|
7966 |
. |
|
7967 |
^ false |
|
7968 |
! ! |
|
7969 |
||
7970 |
!GLXWorkstation methodsFor:'vertex data transfer'! |
|
7971 |
||
7972 |
glxN3f:arrayOf3Floats in:aGLXWindowId |
|
7973 |
"argument must be an array of 3 floats containing the |
|
7974 |
current vertex normal - in real GL only" |
|
7975 |
||
7976 |
%{ /* NOCONTEXT */ |
|
7977 |
#ifdef GLX |
|
7978 |
float vec[3], *v; |
|
7979 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7980 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 7981 |
SETWIN(aGLXWindowId) |
7982 |
n3f(v); |
|
7983 |
RETURN (true); |
|
7984 |
#endif |
|
7985 |
%} |
|
7986 |
. |
|
7987 |
^ false |
|
7988 |
! |
|
7989 |
||
7990 |
glxV2d:v in:aGLXWindowId |
|
7991 |
"pass a vertex; v must be a vector with 2 doubles; z is taken as 0" |
|
7992 |
||
7993 |
%{ /* NOCONTEXT */ |
|
7994 |
double vec[2], *c_v; |
|
7995 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7996 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 2))) RETURN(false); |
294 | 7997 |
SETWIN(aGLXWindowId) |
1932 | 7998 |
#ifdef OPENGL |
7999 |
#else |
|
294 | 8000 |
v2d(c_v); |
1932 | 8001 |
#endif |
294 | 8002 |
RETURN (true); |
8003 |
%} |
|
8004 |
! |
|
8005 |
||
8006 |
glxV2f:v in:aGLXWindowId |
|
8007 |
"pass a vertex; v must be a vector with 2 floats; z is taken as 0" |
|
8008 |
||
8009 |
%{ /* NOCONTEXT */ |
|
8010 |
float vec[2], *c_v; |
|
8011 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8012 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
294 | 8013 |
SETWIN(aGLXWindowId) |
1932 | 8014 |
#ifdef OPENGL |
8015 |
#else |
|
294 | 8016 |
v2f(c_v); |
1932 | 8017 |
#endif |
294 | 8018 |
RETURN (true); |
8019 |
%} |
|
8020 |
! |
|
8021 |
||
8022 |
glxV2fX:x y:y in:aGLXWindowId |
|
8023 |
"pass a vertex from individual x and y values; z is taken as 0.0" |
|
8024 |
||
8025 |
%{ /* NOCONTEXT */ |
|
8026 |
float vec[2]; |
|
8027 |
||
8028 |
_FLOAT_(x, vec[0]) |
|
8029 |
_FLOAT_(y, vec[1]) |
|
8030 |
SETWIN(aGLXWindowId) |
|
1932 | 8031 |
#ifdef OPENGL |
8032 |
#else |
|
294 | 8033 |
v2f(vec); |
1932 | 8034 |
#endif |
294 | 8035 |
RETURN (true); |
8036 |
%} |
|
8037 |
! |
|
8038 |
||
8039 |
glxV2i:v in:aGLXWindowId |
|
8040 |
"pass a vertex; v must be a vector with 2 longs; z is taken as 0" |
|
8041 |
||
8042 |
%{ /* NOCONTEXT */ |
|
8043 |
long vec[2], *c_v; |
|
8044 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8045 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 2))) RETURN(false); |
294 | 8046 |
SETWIN(aGLXWindowId) |
1932 | 8047 |
#ifdef OPENGL |
8048 |
#else |
|
294 | 8049 |
v2i(c_v); |
1932 | 8050 |
#endif |
294 | 8051 |
RETURN (true); |
8052 |
%} |
|
8053 |
! |
|
8054 |
||
8055 |
glxV2s:v in:aGLXWindowId |
|
8056 |
"pass a vertex; v must be a vector with 2 shorts; z is taken as 0" |
|
8057 |
||
8058 |
%{ /* NOCONTEXT */ |
|
8059 |
short vec[2], *c_v; |
|
8060 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8061 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 2))) RETURN(false); |
294 | 8062 |
SETWIN(aGLXWindowId) |
1932 | 8063 |
#ifdef OPENGL |
8064 |
#else |
|
294 | 8065 |
v2s(c_v); |
1932 | 8066 |
#endif |
294 | 8067 |
RETURN (true); |
8068 |
%} |
|
8069 |
! |
|
8070 |
||
8071 |
glxV3d:v in:aGLXWindowId |
|
8072 |
"pass a vertex; v must be a 3-element double-vector" |
|
8073 |
||
8074 |
%{ /* NOCONTEXT */ |
|
8075 |
double vec[3], *c_v; |
|
8076 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8077 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 3))) RETURN(false); |
294 | 8078 |
SETWIN(aGLXWindowId) |
1932 | 8079 |
#ifdef OPENGL |
8080 |
#else |
|
294 | 8081 |
v3d(c_v); |
1932 | 8082 |
#endif |
294 | 8083 |
RETURN (true); |
8084 |
%} |
|
8085 |
. |
|
8086 |
^ false |
|
8087 |
! |
|
8088 |
||
8089 |
glxV3f:v in:aGLXWindowId |
|
8090 |
"pass a vertex; v must be a 3-element float-vector" |
|
8091 |
||
8092 |
%{ /* NOCONTEXT */ |
|
8093 |
float vec[3], *c_v; |
|
8094 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8095 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
294 | 8096 |
SETWIN(aGLXWindowId) |
1932 | 8097 |
#ifdef OPENGL |
8098 |
#else |
|
294 | 8099 |
v3f(c_v); |
1932 | 8100 |
#endif |
294 | 8101 |
RETURN (true); |
8102 |
%} |
|
8103 |
! |
|
8104 |
||
8105 |
glxV3fX:x y:y z:z in: aGLXWindowId |
|
8106 |
"pass a vector from individual x, y and z (float) values" |
|
8107 |
||
8108 |
%{ /* NOCONTEXT */ |
|
8109 |
float vec[3]; |
|
8110 |
||
8111 |
_FLOAT_(x, vec[0]) |
|
8112 |
_FLOAT_(y, vec[1]) |
|
8113 |
_FLOAT_(z, vec[2]) |
|
8114 |
SETWIN(aGLXWindowId) |
|
1932 | 8115 |
#ifdef OPENGL |
8116 |
#else |
|
294 | 8117 |
v3f(vec); |
1932 | 8118 |
#endif |
294 | 8119 |
RETURN (true); |
8120 |
%} |
|
8121 |
! |
|
8122 |
||
8123 |
glxV3i:v in:aGLXWindowId |
|
8124 |
"pass a vertex; v must be a vector with 3 longs" |
|
8125 |
||
8126 |
%{ /* NOCONTEXT */ |
|
8127 |
long vec[3], *c_v; |
|
8128 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8129 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
294 | 8130 |
SETWIN(aGLXWindowId) |
1932 | 8131 |
#ifdef OPENGL |
8132 |
#else |
|
294 | 8133 |
v3i(c_v); |
1932 | 8134 |
#endif |
294 | 8135 |
RETURN (true); |
8136 |
%} |
|
8137 |
! |
|
8138 |
||
8139 |
glxV3s:v in:aGLXWindowId |
|
8140 |
"pass a vertex; v must be a vector with 3 shorts" |
|
8141 |
||
8142 |
%{ /* NOCONTEXT */ |
|
8143 |
short vec[3], *c_v; |
|
8144 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8145 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
294 | 8146 |
SETWIN(aGLXWindowId) |
1932 | 8147 |
#ifdef OPENGL |
8148 |
#else |
|
294 | 8149 |
v3s(c_v); |
1932 | 8150 |
#endif |
294 | 8151 |
RETURN (true); |
8152 |
%} |
|
8153 |
! |
|
8154 |
||
8155 |
glxV4d:v in:aGLXWindowId |
|
8156 |
"pass a vertex; v must be a 4-element double-vector, |
|
8157 |
containing x, y, z and w" |
|
8158 |
||
8159 |
%{ /* NOCONTEXT */ |
|
8160 |
double vec[4], *c_v; |
|
8161 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8162 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 4))) RETURN(false); |
294 | 8163 |
SETWIN(aGLXWindowId) |
1932 | 8164 |
#ifdef OPENGL |
8165 |
#else |
|
294 | 8166 |
v4d(c_v); |
1932 | 8167 |
#endif |
294 | 8168 |
RETURN (true); |
8169 |
%} |
|
8170 |
! |
|
8171 |
||
8172 |
glxV4f:v in:aGLXWindowId |
|
8173 |
"pass a vertex; v must be a 4-element float-vector, |
|
8174 |
containing x, y, z and w" |
|
8175 |
||
8176 |
%{ /* NOCONTEXT */ |
|
8177 |
float vec[4], *c_v; |
|
8178 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8179 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
294 | 8180 |
SETWIN(aGLXWindowId) |
1932 | 8181 |
#ifdef OPENGL |
8182 |
#else |
|
294 | 8183 |
v4f(c_v); |
1932 | 8184 |
#endif |
294 | 8185 |
RETURN (true); |
8186 |
%} |
|
8187 |
! |
|
8188 |
||
8189 |
glxV4i:v in:aGLXWindowId |
|
8190 |
"pass a vertex; v must be a 4-element int-vector, |
|
8191 |
containing x, y, z and w" |
|
8192 |
||
8193 |
%{ /* NOCONTEXT */ |
|
8194 |
long vec[4], *c_v; |
|
8195 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8196 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
294 | 8197 |
SETWIN(aGLXWindowId) |
1932 | 8198 |
#ifdef OPENGL |
8199 |
#else |
|
294 | 8200 |
v4i(c_v); |
1932 | 8201 |
#endif |
294 | 8202 |
RETURN (true); |
8203 |
%} |
|
8204 |
! |
|
8205 |
||
8206 |
glxV4s:v in:aGLXWindowId |
|
8207 |
"pass a vertex; v must be a 4-element short-vector, |
|
8208 |
containing x, y, z and w" |
|
8209 |
||
8210 |
%{ /* NOCONTEXT */ |
|
8211 |
short vec[4], *c_v; |
|
8212 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8213 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
294 | 8214 |
SETWIN(aGLXWindowId) |
1932 | 8215 |
#ifdef OPENGL |
8216 |
#else |
|
294 | 8217 |
v4s(c_v); |
1932 | 8218 |
#endif |
294 | 8219 |
RETURN (true); |
8220 |
%} |
|
8221 |
! |
|
8222 |
||
8223 |
glxVOriginIn:aGLXWindowId |
|
8224 |
"pass a 0.0/0.0/0.0 vector. |
|
8225 |
This is the same as v3f:#(0.0 0.0 0.0), but, since its so |
|
8226 |
common, this somewhat faster method has been provided" |
|
8227 |
||
8228 |
%{ /* NOCONTEXT */ |
|
8229 |
static float vec[3] = {0.0, 0.0, 0.0}; |
|
8230 |
||
8231 |
SETWIN(aGLXWindowId) |
|
1932 | 8232 |
#ifdef OPENGL |
8233 |
#else |
|
294 | 8234 |
v3f(vec); |
1932 | 8235 |
#endif |
294 | 8236 |
RETURN (true); |
8237 |
%} |
|
8238 |
! |
|
8239 |
||
8240 |
glxVUnitXIn:aGLXWindowId |
|
8241 |
"pass a 1.0/0.0/0.0 vector. |
|
8242 |
This is the same as v3f:#(1.0 0.0 0.0), but, since its so |
|
8243 |
common, this somewhat faster method has been provided" |
|
8244 |
||
8245 |
%{ /* NOCONTEXT */ |
|
8246 |
static float vec[3] = {1.0, 0.0, 0.0}; |
|
8247 |
||
8248 |
SETWIN(aGLXWindowId) |
|
1932 | 8249 |
#ifdef OPENGL |
8250 |
#else |
|
294 | 8251 |
v3f(vec); |
1932 | 8252 |
#endif |
294 | 8253 |
RETURN (true); |
8254 |
%} |
|
8255 |
! |
|
8256 |
||
8257 |
glxVUnitYIn:aGLXWindowId |
|
8258 |
"pass a 0.0/1.0/0.0 vector. |
|
8259 |
This is the same as v3f:#(0.0 1.0 0.0), but, since its so |
|
8260 |
common, this somewhat faster method has been provided" |
|
8261 |
||
8262 |
%{ /* NOCONTEXT */ |
|
8263 |
static float vec[3] = {0.0, 1.0, 0.0}; |
|
8264 |
||
8265 |
SETWIN(aGLXWindowId) |
|
1932 | 8266 |
#ifdef OPENGL |
8267 |
#else |
|
294 | 8268 |
v3f(vec); |
1932 | 8269 |
#endif |
294 | 8270 |
RETURN (true); |
8271 |
%} |
|
8272 |
! |
|
8273 |
||
8274 |
glxVUnitZIn:aGLXWindowId |
|
8275 |
"pass a 0.0/0.0/1.0 vector. |
|
8276 |
This is the same as v3f:#(0.0 0.0 1.0), but, since its so |
|
8277 |
common, this somewhat faster method has been provided" |
|
8278 |
||
8279 |
%{ /* NOCONTEXT */ |
|
8280 |
static float vec[3] = {0.0, 0.0, 1.0}; |
|
8281 |
||
8282 |
SETWIN(aGLXWindowId) |
|
1932 | 8283 |
#ifdef OPENGL |
8284 |
#else |
|
294 | 8285 |
v3f(vec); |
1932 | 8286 |
#endif |
294 | 8287 |
RETURN (true); |
8288 |
%} |
|
8289 |
! ! |
|
8290 |
||
8291 |
!GLXWorkstation methodsFor:'video and planes'! |
|
8292 |
||
8293 |
glxOverlayPlanes: planes in: aGLXWindowId |
|
8294 |
||
8295 |
%{ /* NOCONTEXT */ |
|
8296 |
#ifdef GLX |
|
8297 |
SETWIN(aGLXWindowId) |
|
8298 |
overlay(_longVal(planes)); |
|
8299 |
RETURN (true); |
|
8300 |
#endif |
|
8301 |
%} |
|
8302 |
. |
|
8303 |
^ false |
|
8304 |
! |
|
8305 |
||
8306 |
glxStereobufferIn: aGLXWindowId |
|
8307 |
||
8308 |
%{ /* NOCONTEXT */ |
|
8309 |
#ifdef FULL_GLX |
|
8310 |
SETWIN(aGLXWindowId) |
|
8311 |
stereobuffer(); |
|
8312 |
RETURN (true); |
|
8313 |
#endif |
|
8314 |
%} |
|
8315 |
. |
|
8316 |
^ false |
|
8317 |
! |
|
8318 |
||
8319 |
glxUnderlay: planes in: aGLXWindowId |
|
8320 |
||
8321 |
%{ /* NOCONTEXT */ |
|
8322 |
#ifdef GLX |
|
8323 |
SETWIN(aGLXWindowId) |
|
8324 |
underlay(_longVal(planes)); |
|
8325 |
RETURN (true); |
|
8326 |
#endif |
|
8327 |
%} |
|
8328 |
. |
|
8329 |
^ false |
|
8330 |
! |
|
8331 |
||
8332 |
glxVideocmd:cmd in:aGLXWindowId |
|
8333 |
||
8334 |
%{ /* NOCONTEXT */ |
|
8335 |
#ifdef GLX |
|
8336 |
SETWIN(aGLXWindowId) |
|
8337 |
videocmd(_longVal(cmd)); |
|
8338 |
RETURN (true); |
|
8339 |
#endif |
|
8340 |
%} |
|
8341 |
. |
|
8342 |
^ false |
|
8343 |
! ! |
|
8344 |
||
8345 |
!GLXWorkstation methodsFor:'viewing'! |
|
8346 |
||
8347 |
glxLookatVx:vx vy:vy vz:vz px:px py:py pz:pz twist:twist in:aGLXWindowId |
|
8348 |
"define viewing transformation" |
|
8349 |
||
8350 |
%{ /* NOCONTEXT */ |
|
8351 |
||
8352 |
Coord f_vx, f_vy, f_vz, f_px, f_py, f_pz; |
|
8353 |
Angle a_twist; |
|
8354 |
||
8355 |
_COORD_ (vx, f_vx) |
|
8356 |
_COORD_ (vy, f_vy) |
|
8357 |
_COORD_ (vz, f_vz) |
|
8358 |
_COORD_ (px, f_px) |
|
8359 |
_COORD_ (py, f_py) |
|
8360 |
_COORD_ (pz, f_pz) |
|
8361 |
_ANGLE_ (twist, a_twist) |
|
8362 |
SETWIN(aGLXWindowId) |
|
1932 | 8363 |
#ifdef OPENGL |
8364 |
#else |
|
294 | 8365 |
lookat(f_vx, f_vy, f_vz, f_px, f_py, f_pz, a_twist); |
1932 | 8366 |
#endif |
294 | 8367 |
%} |
8368 |
! |
|
8369 |
||
8370 |
glxOrtho2Left: left right: right bottom: bottom top: top in: aGLXWindowId |
|
8371 |
"define 2D orthogonal projection" |
|
8372 |
||
8373 |
%{ /* NOCONTEXT */ |
|
8374 |
float f_left, f_right, f_top, f_bottom; |
|
8375 |
||
8376 |
SETWIN(aGLXWindowId) |
|
8377 |
_FLOAT_(left, f_left) |
|
8378 |
_FLOAT_(right, f_right) |
|
8379 |
_FLOAT_(bottom, f_bottom) |
|
8380 |
_FLOAT_(top, f_top) |
|
1932 | 8381 |
#ifdef OPENGL |
8382 |
#else |
|
294 | 8383 |
ortho2(f_left, f_right, f_bottom, f_top); |
1932 | 8384 |
#endif |
8385 |
%} |
|
294 | 8386 |
! |
8387 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8388 |
glxOrthoLeft: left right: right bottom: bottom top: top near: znear far: zfar in: aGLXWindowId |
294 | 8389 |
"define orthogonal projection" |
8390 |
||
8391 |
%{ /* NOCONTEXT */ |
|
8392 |
float f_left, f_right, f_bottom, f_top, |
|
8393 |
f_near, f_far; |
|
8394 |
||
8395 |
_FLOAT_(left, f_left) |
|
8396 |
_FLOAT_(right, f_right) |
|
8397 |
_FLOAT_(bottom, f_bottom) |
|
8398 |
_FLOAT_(top, f_top) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8399 |
_FLOAT_(znear, f_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8400 |
_FLOAT_(zfar, f_far) |
294 | 8401 |
SETWIN(aGLXWindowId) |
1932 | 8402 |
#ifdef OPENGL |
8403 |
#else |
|
294 | 8404 |
ortho(f_left, f_right, f_bottom, f_top, f_near, f_far); |
1932 | 8405 |
#endif |
294 | 8406 |
%} |
8407 |
! |
|
8408 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8409 |
glxPerspectiveFovy:fovy aspect:aspect near:znear far:zfar in:aGLXWindowId |
294 | 8410 |
"define perspective projection" |
8411 |
||
8412 |
%{ /* NOCONTEXT */ |
|
8413 |
||
8414 |
Angle a_fovy; |
|
8415 |
Coord c_near, c_far; |
|
8416 |
float f_aspect; |
|
8417 |
||
8418 |
_ANGLE_ (fovy, a_fovy) |
|
8419 |
_FLOAT_ (aspect, f_aspect) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8420 |
_COORD_ (znear, c_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8421 |
_COORD_ (zfar, c_far) |
294 | 8422 |
|
8423 |
SETWIN(aGLXWindowId) |
|
1932 | 8424 |
#ifdef OPENGL |
8425 |
#else |
|
294 | 8426 |
perspective(a_fovy, f_aspect, c_near, c_far); |
1932 | 8427 |
#endif |
294 | 8428 |
%} |
8429 |
! |
|
8430 |
||
8431 |
glxPolarviewDist: dist azim: azim inc: inc twist: twist in: aGLXWindowId |
|
8432 |
||
8433 |
%{ /* NOCONTEXT */ |
|
8434 |
Coord c_dist; |
|
8435 |
Angle a_azim, a_inc, a_twist; |
|
8436 |
||
8437 |
_COORD_(dist, c_dist) |
|
8438 |
_ANGLE_(azim, a_azim) |
|
8439 |
_ANGLE_(inc, a_inc) |
|
8440 |
_ANGLE_(twist, a_twist) |
|
8441 |
SETWIN(aGLXWindowId) |
|
1932 | 8442 |
#ifdef OPENGL |
8443 |
#else |
|
294 | 8444 |
polarview(c_dist, a_azim, a_inc, a_twist); |
1932 | 8445 |
#endif |
294 | 8446 |
%} |
8447 |
! |
|
8448 |
||
528 | 8449 |
glxPopviewportIn: aGLXWindowId |
8450 |
"pops the top viewport off the viewport stack" |
|
8451 |
||
8452 |
%{ /* NOCONTEXT */ |
|
8453 |
SETWIN(aGLXWindowId) |
|
1932 | 8454 |
#ifdef OPENGL |
8455 |
#else |
|
528 | 8456 |
popviewport(); |
1932 | 8457 |
#endif |
528 | 8458 |
%} |
8459 |
||
8460 |
"Modified: 19.3.1996 / 18:58:24 / cg" |
|
8461 |
! |
|
8462 |
||
8463 |
glxPushviewportIn: aGLXWindowId |
|
8464 |
"pushes the current viewport on the viewport stack" |
|
8465 |
||
8466 |
%{ /* NOCONTEXT */ |
|
8467 |
SETWIN(aGLXWindowId) |
|
1932 | 8468 |
#ifdef OPENGL |
8469 |
#else |
|
528 | 8470 |
pushviewport(); |
1932 | 8471 |
#endif |
528 | 8472 |
%} |
8473 |
||
8474 |
"Modified: 19.3.1996 / 18:58:02 / cg" |
|
8475 |
! |
|
8476 |
||
294 | 8477 |
glxReshapeViewPortIn: aGLXWindowId |
8478 |
||
8479 |
%{ /* NOCONTEXT */ |
|
8480 |
SETWIN(aGLXWindowId) |
|
1932 | 8481 |
#ifdef OPENGL |
8482 |
#else |
|
294 | 8483 |
reshapeviewport(); |
1932 | 8484 |
#endif |
8485 |
%} |
|
294 | 8486 |
! |
8487 |
||
8488 |
glxViewportLeft:left right:right bottom:bottom top:top in:aGLXWindowId |
|
8489 |
||
8490 |
%{ /* NOCONTEXT */ |
|
8491 |
SETWIN(aGLXWindowId) |
|
1932 | 8492 |
#ifdef OPENGL |
8493 |
#else |
|
4718 | 8494 |
viewport(_screencoordVal(left), _screencoordVal(right), |
294 | 8495 |
_screencoordVal(bottom), _screencoordVal(top)); |
1932 | 8496 |
#endif |
294 | 8497 |
%} |
8498 |
! |
|
8499 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8500 |
glxWindowLeft: left right: right bottom: bottom top: top near: znear far: zfar in: aGLXWindowId |
294 | 8501 |
"this one was added independently by JEFF - kept for his programs ..." |
8502 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8503 |
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
|
8504 |
! |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8505 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8506 |
glxWindowLeft:left right:right top:top bottom:bottom near:znear far:zfar in:aGLXWindowId |
294 | 8507 |
"define perspective viewing pyramid" |
8508 |
||
8509 |
%{ /* NOCONTEXT */ |
|
8510 |
Coord c_left, c_right, c_top, c_bot, c_near, c_far; |
|
8511 |
||
8512 |
_COORD_ (left, c_left) |
|
8513 |
_COORD_ (right, c_right) |
|
8514 |
_COORD_ (top, c_top) |
|
8515 |
_COORD_ (bottom, c_bot) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8516 |
_COORD_ (znear, c_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8517 |
_COORD_ (zfar, c_far) |
294 | 8518 |
SETWIN(aGLXWindowId) |
1932 | 8519 |
#ifdef OPENGL |
8520 |
#else |
|
294 | 8521 |
window(c_left, c_right, c_bot, c_top, c_near, c_far); |
1932 | 8522 |
#endif |
294 | 8523 |
%} |
8524 |
! ! |
|
8525 |
||
8526 |
!GLXWorkstation methodsFor:'window control'! |
|
8527 |
||
2045 | 8528 |
glxResizedView:aGLXWindowId width:width height:height |
2048 | 8529 |
"pass down resize info to the GL - this adjusts the viewport. |
8530 |
This only works with VGL or openGL" |
|
8531 |
||
8532 |
%{ /* NOCONTEXT */ |
|
2074 | 8533 |
SETWIN(aGLXWindowId) |
8534 |
#ifdef VGL |
|
2045 | 8535 |
X11_resized(__intVal(width), __intVal(height)); |
8536 |
RETURN (true); |
|
8537 |
#endif |
|
8538 |
%} |
|
8539 |
. |
|
8540 |
^ false |
|
8541 |
! |
|
8542 |
||
294 | 8543 |
glxWinclose:gwid in:aGLXWindowId |
8544 |
||
8545 |
%{ /* NOCONTEXT */ |
|
8546 |
#ifdef GLX |
|
8547 |
SETWIN(aGLXWindowId) |
|
8548 |
winclose(_longVal(gwid)); |
|
8549 |
RETURN (true); |
|
8550 |
#endif |
|
8551 |
%} |
|
8552 |
. |
|
8553 |
^ false |
|
8554 |
! |
|
8555 |
||
8556 |
glxWinconstraintsIn: aGLXWindowId |
|
8557 |
||
8558 |
%{ /* NOCONTEXT */ |
|
8559 |
#ifdef GLX |
|
8560 |
SETWIN(aGLXWindowId) |
|
8561 |
winconstraints(); |
|
8562 |
RETURN (true); |
|
8563 |
#endif |
|
8564 |
%} |
|
8565 |
. |
|
8566 |
^ false |
|
8567 |
! |
|
8568 |
||
8569 |
glxWindepth: gwid in: aGLXWindowId |
|
8570 |
||
8571 |
%{ /* NOCONTEXT */ |
|
8572 |
#ifdef GLX |
|
8573 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
8574 |
RETURN (__MKSMALLINT(windepth(_longVal(gwid)))); |
294 | 8575 |
#endif |
8576 |
%} |
|
8577 |
. |
|
8578 |
^ false |
|
8579 |
! |
|
8580 |
||
8581 |
glxWingetIn: aGLXWindowId |
|
8582 |
||
8583 |
%{ /* NOCONTEXT */ |
|
8584 |
#ifdef GLX |
|
8585 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
8586 |
RETURN (__MKSMALLINT(winget())); |
294 | 8587 |
#endif |
8588 |
%} |
|
8589 |
. |
|
8590 |
^ false |
|
8591 |
! |
|
8592 |
||
8593 |
glxWinmoveX: x y: y in: aGLXWindowId |
|
8594 |
||
8595 |
%{ /* NOCONTEXT */ |
|
8596 |
#ifdef GLX |
|
8597 |
SETWIN(aGLXWindowId) |
|
8598 |
winmove(_longVal(x), _longVal(y)); |
|
8599 |
RETURN (true); |
|
8600 |
#endif |
|
8601 |
%} |
|
8602 |
. |
|
8603 |
^ false |
|
8604 |
! |
|
8605 |
||
8606 |
glxWinpopIn: aGLXWindowId |
|
8607 |
||
8608 |
%{ /* NOCONTEXT */ |
|
8609 |
#ifdef GLX |
|
8610 |
SETWIN(aGLXWindowId) |
|
8611 |
winpop(); |
|
8612 |
RETURN (true); |
|
8613 |
#endif |
|
8614 |
%} |
|
8615 |
. |
|
8616 |
^ false |
|
8617 |
! |
|
8618 |
||
8619 |
glxWinpositionX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
8620 |
||
8621 |
%{ /* NOCONTEXT */ |
|
8622 |
#ifdef GLX |
|
8623 |
SETWIN(aGLXWindowId) |
|
8624 |
winposition(_longVal(x1), _longVal(y1), _longVal(x2), _longVal(y2)); |
|
8625 |
RETURN (true); |
|
8626 |
#endif |
|
8627 |
%} |
|
8628 |
. |
|
8629 |
^ false |
|
8630 |
! |
|
8631 |
||
8632 |
glxWinpushIn: aGLXWindowId |
|
8633 |
||
8634 |
%{ /* NOCONTEXT */ |
|
8635 |
#ifdef GLX |
|
8636 |
SETWIN(aGLXWindowId) |
|
8637 |
winpush(); |
|
8638 |
RETURN (true); |
|
8639 |
#endif |
|
8640 |
%} |
|
8641 |
. |
|
8642 |
^ false |
|
8643 |
! |
|
8644 |
||
8645 |
glxWinset: gwid in: aGLXWindowId |
|
8646 |
||
8647 |
%{ /* NOCONTEXT */ |
|
8648 |
#ifdef GLX |
|
8649 |
SETWIN(aGLXWindowId) |
|
8650 |
winset(_longVal(gwid)); |
|
8651 |
RETURN (true); |
|
8652 |
#endif |
|
8653 |
%} |
|
8654 |
. |
|
8655 |
^ false |
|
8656 |
! ! |
|
8657 |
||
0 | 8658 |
!GLXWorkstation methodsFor:'window creation'! |
8659 |
||
12 | 8660 |
createGLXWindowFor:aView left:xpos top:ypos width:wwidth height:wheight type:glxType |
157 | 8661 |
|ext wsuperView wsuperViewId windowId| |
0 | 8662 |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
8663 |
glOK ifFalse:[^ nil]. |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
8664 |
|
793 | 8665 |
wsuperView := aView superView view. |
0 | 8666 |
wsuperView notNil ifTrue:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8667 |
wsuperViewId := wsuperView id |
0 | 8668 |
]. |
8669 |
||
524 | 8670 |
%{ /* CALLSSTACK: 20000 */ |
0 | 8671 |
Display *dpy = myDpy; |
185 | 8672 |
int screen = __intVal(_INST(screen)); |
0 | 8673 |
Window newWindow, parentWindow; |
12 | 8674 |
int t; |
0 | 8675 |
|
97 | 8676 |
if (__isSmallInteger(xpos) && __isSmallInteger(ypos) |
8677 |
&& __isSmallInteger(wwidth) && __isSmallInteger(wheight)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8678 |
if (__isExternalAddress(wsuperViewId)) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8679 |
parentWindow = _WindowVal(wsuperViewId); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8680 |
} else { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8681 |
parentWindow = RootWindow(dpy, screen); |
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 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8684 |
if (glxType == @symbol(colorIndexSingleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8685 |
t = GLXcolorIndexSingleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8686 |
else if (glxType == @symbol(colorIndexDoubleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8687 |
t = GLXcolorIndexDoubleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8688 |
else if (glxType == @symbol(rgbSingleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8689 |
t = GLXrgbSingleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8690 |
else if (glxType == @symbol(rgbDoubleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8691 |
t = GLXrgbDoubleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8692 |
else { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8693 |
RETURN ( nil ); |
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 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8696 |
ENTERGLX; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8697 |
newWindow = __GLXCreateWindow(dpy, parentWindow, |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8698 |
__intVal(xpos), __intVal(ypos), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8699 |
__intVal(wwidth), __intVal(wheight), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8700 |
0, t); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8701 |
LEAVEGLX; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8702 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8703 |
if (! newWindow) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8704 |
RETURN ( nil ); |
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 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8707 |
windowId = __MKOBJ(newWindow); |
0 | 8708 |
} |
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
8709 |
%}. |
0 | 8710 |
windowId notNil ifTrue:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8711 |
self addKnownView:aView withId:windowId. |
0 | 8712 |
]. |
8713 |
^ windowId |
|
20 | 8714 |
! |
8715 |
||
8716 |
unlinkGLXView:aGLXWindowId |
|
8717 |
"remove X/GLX link" |
|
524 | 8718 |
|
8719 |
%{ /* CALLSSTACK: 20000 */ |
|
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
8720 |
if (__isExternalAddress(aGLXWindowId)) { |
134 | 8721 |
ENTERGLX; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8722 |
__GLXUnlinkWindow(myDpy, _WindowVal(aGLXWindowId)); |
134 | 8723 |
LEAVEGLX; |
8724 |
} |
|
20 | 8725 |
%} |
0 | 8726 |
! ! |
8727 |
||
294 | 8728 |
!GLXWorkstation methodsFor:'zbuffer'! |
8729 |
||
8730 |
glxZbsize: planes in: aGLXWindowId |
|
127 | 8731 |
|
8732 |
%{ /* NOCONTEXT */ |
|
8733 |
#ifdef FULL_GLX |
|
8734 |
SETWIN(aGLXWindowId) |
|
294 | 8735 |
zbsize(_longVal(planes)); |
8736 |
RETURN (true); |
|
8737 |
#endif |
|
8738 |
%} |
|
8739 |
. |
|
8740 |
^ false |
|
8741 |
! |
|
64 | 8742 |
|
8743 |
glxZbuffer:aBoolean in:aGLXWindowId |
|
8744 |
"enable/disable z-buffer operation" |
|
8745 |
||
8746 |
%{ /* NOCONTEXT */ |
|
8747 |
#ifdef GLX |
|
8748 |
SETWIN(aGLXWindowId) |
|
8749 |
zbuffer(aBoolean == false ? FALSE : TRUE); |
|
8750 |
RETURN (true); |
|
8751 |
#endif |
|
8752 |
%} |
|
8753 |
. |
|
8754 |
^ false |
|
294 | 8755 |
! |
64 | 8756 |
|
8757 |
glxZdraw: b in: aGLXWindowId |
|
8758 |
"enable/disable drawing into the z-buffer" |
|
8759 |
||
8760 |
%{ /* NOCONTEXT */ |
|
8761 |
#ifdef GLX |
|
8762 |
SETWIN(aGLXWindowId) |
|
8763 |
zdraw(_booleanVal(b)); |
|
8764 |
RETURN (true); |
|
8765 |
#endif |
|
8766 |
%} |
|
8767 |
. |
|
8768 |
^ false |
|
294 | 8769 |
! |
64 | 8770 |
|
8771 |
glxZfunction: func in: aGLXWindowId |
|
8772 |
"set the z-buffer comparison function. |
|
8773 |
func may be either the numeric value or a symbol (preferred)" |
|
8774 |
||
8775 |
%{ /* NOCONTEXT */ |
|
8776 |
#ifdef GLX |
|
8777 |
long f; |
|
8778 |
||
8779 |
SETWIN(aGLXWindowId) |
|
8780 |
if (func == @symbol(NEVER)) |
|
77 | 8781 |
f = ZF_NEVER; |
64 | 8782 |
else if (func == @symbol(LESS)) |
77 | 8783 |
f = ZF_LESS; |
64 | 8784 |
else if (func == @symbol(EQUAL)) |
77 | 8785 |
f = ZF_EQUAL; |
64 | 8786 |
else if (func == @symbol(LEQUAL)) |
77 | 8787 |
f = ZF_LEQUAL; |
64 | 8788 |
else if (func == @symbol(GREATER)) |
77 | 8789 |
f = ZF_GREATER; |
64 | 8790 |
else if (func == @symbol(NOTEQUAL)) |
77 | 8791 |
f = ZF_NOTEQUAL; |
64 | 8792 |
else if (func == @symbol(GEQUAL)) |
77 | 8793 |
f = ZF_GEQUAL; |
64 | 8794 |
else if (func == @symbol(ALWAYS)) |
77 | 8795 |
f = ZF_ALWAYS; |
64 | 8796 |
else |
77 | 8797 |
f = _longVal(func); |
64 | 8798 |
zfunction(f); |
8799 |
RETURN (true); |
|
8800 |
#endif |
|
8801 |
%} |
|
8802 |
. |
|
8803 |
^ false |
|
294 | 8804 |
! |
64 | 8805 |
|
8806 |
glxZsource: src in: aGLXWindowId |
|
8807 |
||
8808 |
%{ /* NOCONTEXT */ |
|
8809 |
#ifdef GLX |
|
8810 |
SETWIN(aGLXWindowId) |
|
8811 |
zsource(_longVal(src)); |
|
8812 |
RETURN (true); |
|
8813 |
#endif |
|
8814 |
%} |
|
8815 |
. |
|
8816 |
^ false |
|
294 | 8817 |
! |
64 | 8818 |
|
8819 |
glxZwritemask: mask in: aGLXWindowId |
|
8820 |
||
8821 |
%{ /* NOCONTEXT */ |
|
8822 |
#ifdef GLX |
|
8823 |
SETWIN(aGLXWindowId) |
|
185 | 8824 |
zwritemask((ulong)__intVal(mask)); |
64 | 8825 |
RETURN (true); |
8826 |
#endif |
|
8827 |
%} |
|
8828 |
. |
|
8829 |
^ false |
|
8830 |
! ! |
|
8831 |
||
294 | 8832 |
!GLXWorkstation class methodsFor:'documentation'! |
8833 |
||
8834 |
version |
|
6978 | 8835 |
^ '$Header$' |
5479
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 |
|
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
8838 |
version_CVS |
6978 | 8839 |
^ '$Header$' |
89 | 8840 |
! ! |
7656 | 8841 |