author | Claus Gittinger <cg@exept.de> |
Thu, 28 Apr 2016 14:18:50 +0200 | |
changeset 7319 | a7aeb15d709f |
parent 6978 | 5b28db37852a |
child 7656 | e39deb3fb1ac |
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 |
||
0 | 14 |
XWorkstation subclass:#GLXWorkstation |
528 | 15 |
instanceVariableNames:'activeWindow hasStereoExtension glOK' |
16 |
classVariableNames:'ForceGL' |
|
17 |
poolDictionaries:'' |
|
18 |
category:'Interface-Graphics' |
|
294 | 19 |
! |
77 | 20 |
|
89 | 21 |
!GLXWorkstation primitiveDefinitions! |
0 | 22 |
%{ |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
23 |
#include "stxOSDefs.h" |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
24 |
|
24 | 25 |
/* |
26 |
* on SGI, this class is compiled with -DGLX, while |
|
29 | 27 |
* for simulation (using vogl), this is compiled with -DVGL |
4718 | 28 |
* |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
29 |
* New note: starting to support openGL (tm) (compile with -DOPENGL) |
1932 | 30 |
* or its simulation (compile with -DMESA) |
24 | 31 |
*/ |
29 | 32 |
|
0 | 33 |
/* |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
34 |
* SAD, SAD: |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
35 |
* 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
|
36 |
* some include the functions below, others dont. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
37 |
* To avoid getting undefined symbol errors when linking, these |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
38 |
* functions are not included by default. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
39 |
* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
40 |
* 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
|
41 |
* the following: |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
42 |
* |
46 | 43 |
* blendcolor getgconfig getmultisample leftbuffer rightbuffer monobuffer |
44 |
* msalpha msmask mspattern mssize multisample stereobuffer |
|
45 |
* t3s t3i t3f t3d t4s t4i t4f t4d tlutbind zbsize |
|
46 |
* |
|
47 |
* these are not available on all gl's |
|
48 |
*/ |
|
49 |
||
1932 | 50 |
#ifdef GLX |
46 | 51 |
/* #define FULL_GLX */ |
1932 | 52 |
#endif |
46 | 53 |
|
54 |
/* |
|
554
34cc776bcc0f
compilable with String/Object definition
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
55 |
* 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
|
56 |
* ... and xlib defines True and False |
554
34cc776bcc0f
compilable with String/Object definition
Claus Gittinger <cg@exept.de>
parents:
553
diff
changeset
|
57 |
* It might be a better idea, to completely separate GLX stuff from ST/X |
0 | 58 |
*/ |
1899 | 59 |
#ifdef String |
60 |
# undef String |
|
61 |
#endif |
|
62 |
#define String GLX_String |
|
63 |
||
64 |
#ifdef Object |
|
65 |
# undef Object |
|
66 |
#endif |
|
67 |
#define Object GLX_Object |
|
68 |
||
69 |
#undef True |
|
70 |
#undef False |
|
71 |
||
2768 | 72 |
#ifdef Time |
73 |
# undef Time |
|
74 |
#endif |
|
75 |
#define Time X_Time |
|
76 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
77 |
|
1899 | 78 |
#ifdef __VMS__ |
79 |
# include "vms_Xnames.h" |
|
80 |
#endif |
|
24 | 81 |
|
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
82 |
#ifdef __arm__ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
83 |
// # define _POSIX_C_SOURCE |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
84 |
#endif |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
85 |
|
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
86 |
#ifndef _STDIO_H_INCLUDED_ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
87 |
# include <stdio.h> |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
88 |
# define _STDIO_H_INCLUDED_ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
89 |
#endif |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
90 |
|
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
91 |
#ifdef __arm__ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
92 |
# ifndef _SYS_TYPES_H_INCLUDED_ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
93 |
# include <sys/types.h> |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
94 |
# define _SYS_TYPES_H_INCLUDED_ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
95 |
# endif |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
96 |
# ifndef _SYS_SIGNAL_H_INCLUDED_ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
97 |
# include <sys/signal.h> |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
98 |
# define _SYS_SIGNAL_H_INCLUDED_ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
99 |
# endif |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
100 |
|
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 |
|
6254 | 103 |
#ifdef __osx__ |
104 |
# include <sys/signal.h> |
|
105 |
# define DYNAMICALLY_LOADABLE |
|
106 |
#endif |
|
168 | 107 |
|
1932 | 108 |
#ifndef OPENGL |
109 |
# ifdef MESA |
|
110 |
# define OPENGL |
|
111 |
# endif |
|
112 |
#endif |
|
113 |
||
6978 | 114 |
#ifdef OPENGL /* SGI or other's OPENGL library */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
115 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
116 |
# include "GL/gl.h" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
117 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
118 |
# ifdef MESA /* GNU MESA openGL simulation */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
119 |
# include "GL/xmesa.h" |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
120 |
# define OPENGLCONTEXT XMesaContext |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
121 |
# define GLXMAKECURRENT(dpy, draw, con) XMesaMakeCurrent(con) |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
122 |
# else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
123 |
/* 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
|
124 |
# define OPENGLCONTEXT GLXContext |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
125 |
# 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
|
126 |
# endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
127 |
|
24 | 128 |
#else |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
129 |
|
6978 | 130 |
# ifdef GLX /* SGI's native GL library */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
131 |
# include <gl/glws.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
132 |
# include <gl/sphere.h> |
6978 | 133 |
# else /* VOGL GL subset simulation */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
134 |
# undef memset |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
135 |
# include <vogl.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
136 |
# undef move |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
137 |
# include <X11/Xlib.h> |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
138 |
# endif |
24 | 139 |
#endif |
0 | 140 |
|
185 | 141 |
/* |
142 |
* XSGIStereo extension - if available |
|
143 |
*/ |
|
144 |
#ifdef XSGIStereo |
|
145 |
# include <X11/extensions/SGIStereo.h> |
|
146 |
#endif |
|
147 |
||
35 | 148 |
#ifndef NULL |
58 | 149 |
# define NULL (char *)0 /* sigh */ |
35 | 150 |
#endif |
151 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
152 |
|
0 | 153 |
typedef enum { |
154 |
GLXcolorIndexSingleBuffer, |
|
155 |
GLXcolorIndexDoubleBuffer, |
|
156 |
GLXrgbSingleBuffer, |
|
157 |
GLXrgbDoubleBuffer |
|
158 |
} GLXWindowType; |
|
159 |
||
333 | 160 |
# define ENTERGLX __BEGIN_PROTECT_REGISTERS__ |
161 |
# define LEAVEGLX __END_PROTECT_REGISTERS__ |
|
134 | 162 |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
163 |
/* |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
164 |
* stupid again - from now on, we need ST/X's String again |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
165 |
*/ |
0 | 166 |
#undef String |
969 | 167 |
#ifdef __DEF_String |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
168 |
# define String __DEF_String |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
169 |
#endif |
969 | 170 |
#undef Object |
171 |
#ifdef __DEF_Object |
|
172 |
# define Object __DEF_Object |
|
173 |
#endif |
|
0 | 174 |
|
175 |
/* |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
176 |
* mhmh - openGL has its separate gl-context, |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
177 |
* which is distinct (?) from the windowID. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
178 |
* We dont want to add another instvar to View - do we ? |
0 | 179 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
180 |
#if defined(OPENGL) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
181 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
182 |
# ifndef MAX_OPENGL_VIEWS |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
183 |
# define MAX_OPENGL_VIEWS 50 |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
184 |
# endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
185 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
186 |
struct windowIDToGLContextMapping { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
187 |
Window win; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
188 |
OPENGLCONTEXT con; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
189 |
}; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
190 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
191 |
static struct windowIDToGLContextMapping windowIDToGLContextMapping[MAX_OPENGL_VIEWS]; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
192 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
193 |
static OPENGLCONTEXT |
4718 | 194 |
__glxWindowIdToGLContext(xId) |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
195 |
Window xId; |
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 |
int i; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
198 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
199 |
for (i=0; i<MAX_OPENGL_VIEWS; i++) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
200 |
if (windowIDToGLContextMapping[i].win == xId) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
201 |
return windowIDToGLContextMapping[i].con; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
202 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
203 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
204 |
return (OPENGLCONTEXT) 0; |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
205 |
} |
0 | 206 |
|
157 | 207 |
/* |
208 |
* set the GLXWindow for followup drawing |
|
209 |
*/ |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
210 |
#define SETWIN(aGLXWindowId) \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
211 |
{ \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
212 |
OPENGLCONTEXT context; \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
213 |
\ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
214 |
if (_INST(activeWindow) != aGLXWindowId) { \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
215 |
if (! ISCONNECTED ) { \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
216 |
RETURN (false); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
217 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
218 |
if (! __isExternalAddress(aGLXWindowId)) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
219 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
220 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
221 |
context = (OPENGLCONTEXT) __glxWindowIdToGLContext(_WindowVal(aGLXWindowId)); \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
222 |
if (! context) { \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
223 |
RETURN (false); \ |
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 |
GLXMAKECURRENT(myDpy, _WindowVal(aGLXWindowId), context ); \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
226 |
_INST(activeWindow) = aGLXWindowId; \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
227 |
__STORE(self, aGLXWindowId); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
228 |
} else { \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
229 |
if (aGLXWindowId == nil) { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
230 |
RETURN (false); \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
231 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
232 |
} \ |
12 | 233 |
} |
234 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
235 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
236 |
#else /* old GL */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
237 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
238 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
239 |
* set the GLXWindow for followup drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
240 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
241 |
#define SETWIN(aGLXWindowId) \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
242 |
{ \ |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
243 |
if (_INST(activeWindow) != aGLXWindowId) { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
244 |
if (! ISCONNECTED ) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
245 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
246 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
247 |
if (! __isExternalAddress(aGLXWindowId)) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
248 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
249 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
250 |
if (GLXwinset(myDpy, _WindowVal(aGLXWindowId)) < 0) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
251 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
252 |
} \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
253 |
_INST(activeWindow) = aGLXWindowId; \ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
254 |
__STORE(self, aGLXWindowId); \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
255 |
} else { \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
256 |
if (aGLXWindowId == nil) { \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
257 |
RETURN (false); \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
258 |
} \ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
259 |
} \ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
260 |
} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
261 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
262 |
#endif /* old GL */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
263 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
264 |
/* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
265 |
* some defines - tired of typing ... |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
266 |
* 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
|
267 |
* put/pack them into corresponding c variables. |
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 |
*/ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
270 |
#ifdef OPENGL |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
271 |
# define Boolean int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
272 |
# define TRUE 1 |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
273 |
# define FALSE 0 |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
274 |
# define Coord float |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
275 |
# define Icoord int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
276 |
# define Scoord int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
277 |
# define Colorindex int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
278 |
# define Linestyle int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
279 |
# define Offset int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
280 |
# define Angle int |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
281 |
# define Screencoord int |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
282 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
283 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
284 |
#define myDpy (Display *)(__MKCP(_INST(displayId))) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
285 |
#define ISCONNECTED (_INST(displayId) != nil) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
286 |
#define _WindowVal(o) (Window)(__MKCP(o)) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
287 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
288 |
#define __MKBOOLEAN(b) ((b==FALSE) ? false : true) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
289 |
#define _booleanVal(b) ((b==false) ? (Boolean)FALSE : (Boolean)TRUE) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
290 |
#define _coordVal(c) ((__isFloat(c)) ? (Coord)(_floatVal(c)) : (Coord)(__intVal(c))) |
185 | 291 |
#define _icoordVal(c) ((Icoord)(__intVal(c))) |
292 |
#define _scoordVal(c) ((Scoord)(__intVal(c))) |
|
293 |
#define _screencoordVal(c) ((Screencoord)(__intVal(c))) |
|
294 |
#define _colorindexVal(c) ((Colorindex)(__intVal(c))) |
|
295 |
#define _linestyleVal(l) ((Linestyle)(__intVal(l))) |
|
296 |
#define _shortVal(l) ((short)(__intVal(l))) |
|
297 |
#define _longVal(l) ((long)(__intVal(l))) |
|
298 |
#define _deviceVal(l) ((Device)(__intVal(l))) |
|
299 |
#define _tagVal(l) ((Tag)(__intVal(l))) |
|
969 | 300 |
#define _objectVal(l) ((GLX_Object)(__intVal(l))) |
185 | 301 |
#define _offsetVal(l) ((Offset)(__intVal(l))) |
302 |
#define _rgbVal(l) ((RGBvalue)(__intVal(l))) |
|
303 |
#define _angleVal(c) ((Angle)(__intVal(c))) |
|
157 | 304 |
|
29 | 305 |
/* |
306 |
* 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
|
307 |
* ST-object must be true or false. Return from method if invalid. |
29 | 308 |
*/ |
309 |
#define _BOOLEAN_(arg, dst) \ |
|
30 | 310 |
if (arg==true) \ |
77 | 311 |
dst = (Boolean)TRUE; \ |
30 | 312 |
else if (arg==false) \ |
77 | 313 |
dst = (Boolean)FALSE; \ |
29 | 314 |
else { RETURN(false); } |
315 |
||
316 |
/* |
|
317 |
* check for and fetch a coord from ST-arg into C-dst |
|
157 | 318 |
* ST-object must be Float, SmallInteger or Fraction. |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
319 |
* Return from method if invalid. |
29 | 320 |
*/ |
0 | 321 |
#define _COORD_(arg, dst) \ |
97 | 322 |
if (__isFloat(arg)) \ |
77 | 323 |
dst = (Coord)(_floatVal(arg)); \ |
97 | 324 |
else if (__isSmallInteger(arg)) \ |
185 | 325 |
dst = (Coord)(__intVal(arg)); \ |
97 | 326 |
else if (__isFraction(arg) \ |
327 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_numerator) \ |
|
328 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_denominator)) { \ |
|
77 | 329 |
float n, d; \ |
330 |
\ |
|
185 | 331 |
n = (float)(__intVal(_FractionInstPtr(arg)->f_numerator)); \ |
332 |
d = (float)(__intVal(_FractionInstPtr(arg)->f_denominator)); \ |
|
77 | 333 |
dst = (Coord)(n / d); \ |
29 | 334 |
} else { RETURN(false); } |
335 |
||
336 |
/* |
|
337 |
* check for and fetch an icoord from ST-arg into C-dst |
|
4718 | 338 |
* ST-object must be SmallInteger. Return from method if invalid. |
29 | 339 |
*/ |
340 |
#define _ICOORD_(arg, dst) \ |
|
97 | 341 |
if (__isSmallInteger(arg)) \ |
185 | 342 |
dst = (Icoord)(__intVal(arg)); \ |
29 | 343 |
else { RETURN(false); } |
344 |
||
345 |
/* |
|
157 | 346 |
* check for and fetch an scoord from ST-arg into C-dst |
4718 | 347 |
* ST-object must be SmallInteger. Return from method if invalid. |
29 | 348 |
*/ |
349 |
#define _SCOORD_(arg, dst) \ |
|
97 | 350 |
if (__isSmallInteger(arg)) \ |
185 | 351 |
dst = (Scoord)(__intVal(arg)); \ |
29 | 352 |
else { RETURN(false); } |
353 |
||
354 |
#define _SCREENCOORD_(arg, dst) \ |
|
97 | 355 |
if (__isSmallInteger(arg)) \ |
185 | 356 |
dst = (Screencoord)(__intVal(arg)); \ |
29 | 357 |
else { RETURN(false); } |
358 |
||
359 |
#define _COLORINDEX_(arg, dst) \ |
|
97 | 360 |
if (__isSmallInteger(arg)) \ |
185 | 361 |
dst = (Colorindex)(__intVal(arg)); \ |
29 | 362 |
else { RETURN(false); } |
363 |
||
364 |
#define _ANGLE_(arg, dst) \ |
|
97 | 365 |
if (__isSmallInteger(arg)) \ |
185 | 366 |
dst = (Angle)(__intVal(arg)); \ |
29 | 367 |
else { RETURN(false); } |
0 | 368 |
|
369 |
#define _FLOAT_(arg, dst) \ |
|
97 | 370 |
if (__isFloat(arg)) \ |
77 | 371 |
dst = (float)(_floatVal(arg)); \ |
97 | 372 |
else if (__isSmallInteger(arg)) \ |
185 | 373 |
dst = (float)(__intVal(arg)); \ |
97 | 374 |
else if (__isFraction(arg) \ |
375 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_numerator) \ |
|
376 |
&& __isSmallInteger(_FractionInstPtr(arg)->f_denominator)) { \ |
|
77 | 377 |
float n, d; \ |
378 |
\ |
|
185 | 379 |
n = (float)(__intVal(_FractionInstPtr(arg)->f_numerator)); \ |
380 |
d = (float)(__intVal(_FractionInstPtr(arg)->f_denominator)); \ |
|
77 | 381 |
dst = (float)(n / d); \ |
29 | 382 |
} else { RETURN(false); } |
0 | 383 |
|
384 |
#define _INT_(arg, dst) \ |
|
97 | 385 |
if (__isSmallInteger(arg)) \ |
185 | 386 |
dst = (int)(__intVal(arg)); \ |
29 | 387 |
else { RETURN(false); } |
388 |
||
30 | 389 |
#define _indexedArea(object) \ |
390 |
(((char *) (_InstPtr(object))) \ |
|
77 | 391 |
+ OHDR_SIZE \ |
185 | 392 |
+ (__intVal(_ClassInstPtr(__qClass(object))->c_ninstvars)) * sizeof(OBJ)) |
77 | 393 |
%} |
394 |
! ! |
|
395 |
||
168 | 396 |
!GLXWorkstation primitiveVariables! |
397 |
%{ |
|
398 |
/* |
|
399 |
* remembered info from private error handler |
|
400 |
*/ |
|
4164
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
401 |
static char lastErrorMsg[128] = ""; |
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
402 |
static unsigned INT lastRequestCode = 0; |
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
403 |
static unsigned INT lastMinorCode = 0; |
390662205891
#resourceIdOfLastError return ExternalAddress as in XWorkstation
Stefan Vogel <sv@exept.de>
parents:
3743
diff
changeset
|
404 |
static unsigned INT lastResource = 0; |
168 | 405 |
|
406 |
%} |
|
407 |
! ! |
|
408 |
||
89 | 409 |
!GLXWorkstation primitiveFunctions! |
77 | 410 |
%{ |
151 | 411 |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
412 |
#ifdef DYNAMICALLY_LOADABLE |
168 | 413 |
/* |
414 |
* catch X-errors and forward as errorInterrupt:#DisplayError, |
|
4251 | 415 |
* (which itself invokes my handler and optionally raises an exception) |
168 | 416 |
* the implementation below is somewhat wrong: it will |
417 |
* report all errors for Display, even though there could be |
|
418 |
* more than one display connection. (being fixed, new errorInterrupt mechanism |
|
419 |
* allows passing an additional argument, which is the displayID ...) |
|
420 |
* |
|
4251 | 421 |
* this duplicates the functionality as found in XWorkstation; |
168 | 422 |
* the reason is to allow dynamic loading systems to load this module |
423 |
* before XWorkstation (which was not possible otherwise, due to unresolved |
|
424 |
* external references while loading this one) |
|
425 |
*/ |
|
426 |
static |
|
427 |
__XErrorHandler__(dpy, event) |
|
428 |
Display *dpy; |
|
429 |
XErrorEvent *event; |
|
430 |
{ |
|
431 |
XGetErrorText(dpy, event->error_code, lastErrorMsg, 80); |
|
432 |
if (lastErrorMsg[0] == '\0') { |
|
4718 | 433 |
sprintf(lastErrorMsg, "code: %d", event->error_code); |
168 | 434 |
} |
435 |
lastRequestCode = event->request_code; |
|
436 |
lastMinorCode = event->minor_code; |
|
437 |
lastResource = event->resourceid; |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
438 |
if ((event->error_code == BadWindow) && (lastRequestCode == 4) && (lastMinorCode == 0)) { |
4718 | 439 |
/* |
440 |
* this is a BadWindow error for X_DestroyWindow. |
|
441 |
* ignore it here, since it results from the GC freeing windows |
|
442 |
* in non bottom-up window order. |
|
443 |
*/ |
|
444 |
return 0; |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
445 |
} |
168 | 446 |
|
218
10072d9beba5
can now turn off Xlib error messages from the errorHandler
Claus Gittinger <cg@exept.de>
parents:
216
diff
changeset
|
447 |
if (@global(ErrorPrinting) == true) { |
4718 | 448 |
console_fprintf(stderr, "GLXWORKSTAT: x-error caught maj=%d (0x%x) min=%d (0x%x) resource=%x\n", |
449 |
event->request_code, event->request_code, |
|
450 |
event->minor_code, event->minor_code, event->resourceid); |
|
451 |
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
|
452 |
} |
168 | 453 |
|
207
9124817bbb03
use new c-pointer wrapper macros (based on externalAddress)
Claus Gittinger <cg@exept.de>
parents:
206
diff
changeset
|
454 |
__errorInterruptWithIDAndParameter__(@symbol(DisplayError), __MKOBJ(dpy)); |
168 | 455 |
return 0; |
456 |
} |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
457 |
#else |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
458 |
extern __XErrorHandler__(); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
459 |
#endif |
168 | 460 |
|
4718 | 461 |
/* |
151 | 462 |
* begin moved from GLXsupport.c |
463 |
*/ |
|
464 |
||
465 |
/* |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
466 |
* This provides a helper function "GLXCreateWindow", which does |
4718 | 467 |
* all the necessary magic to create an X window suitable for GL drawing |
468 |
* to take place within. See the definition of GLXCreateWindow for a |
|
151 | 469 |
* description of how to call it. |
470 |
* |
|
471 |
* claus: I really had no time to look into all this, |
|
472 |
* this file has been just copied from a 4Dgifts demo .. |
|
473 |
* (will need more than a day to show more ...) |
|
474 |
*/ |
|
1932 | 475 |
#if !defined(OPENGL) |
151 | 476 |
|
1899 | 477 |
# include <X11/Xlib.h> |
478 |
# include <X11/Xutil.h> |
|
479 |
# ifndef VGL |
|
4718 | 480 |
# include <gl/glws.h> |
1899 | 481 |
# endif |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
482 |
# ifndef _SIGNAL_H_INCLUDED_ |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
483 |
# include <signal.h> |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
484 |
# endif |
1899 | 485 |
# include <setjmp.h> |
486 |
# include "stcIntern.h" |
|
151 | 487 |
|
488 |
/* |
|
489 |
* glxhelper.h: |
|
490 |
* |
|
491 |
* List of drawing modes supported by GLXCreateWindow (in glxhelper.c). |
|
4718 | 492 |
* More than this are possible with mixed model, but this is just an |
493 |
* example. You can either expand this list (and the corresponding code in |
|
494 |
* GLXCreateWindow) or call the mixed model calls yourself, using |
|
151 | 495 |
* GLXCreateWindow as an example. |
496 |
*/ |
|
497 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
498 |
static char * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
499 |
typeToName[] = { |
151 | 500 |
"color index single buffer", |
501 |
"color index double buffer", |
|
502 |
"rgb single buffer", |
|
503 |
"rgb double buffer", |
|
504 |
}; |
|
505 |
||
1932 | 506 |
#endif /* GLX || VGL */ |
507 |
||
508 |
#if defined(GLX) && !defined(VGL) |
|
151 | 509 |
/* |
510 |
* Dorky little helper function used to build up a GLXconfig array. |
|
511 |
*/ |
|
512 |
||
4718 | 513 |
static void |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
514 |
set_entry (GLXconfig* ptr, int b, int m, int a) |
151 | 515 |
{ |
516 |
ptr->buffer = b; |
|
517 |
ptr->mode = m; |
|
518 |
ptr->arg = a; |
|
519 |
} |
|
1932 | 520 |
#endif /* GLX & not VGL */ |
151 | 521 |
|
4711 | 522 |
static stx_jmp_buf errorReturn; |
151 | 523 |
|
524 |
static void |
|
525 |
glAbort() { |
|
6002 | 526 |
stx_longjmp(errorReturn, 1); |
151 | 527 |
} |
528 |
||
529 |
/* |
|
530 |
* GLXCreateWindow(dpy, parent, x, y, w, h, boderWidth, type) |
|
531 |
* |
|
532 |
* Return value is the X window id of the newly created window. |
|
533 |
* |
|
534 |
* Arguments are: |
|
535 |
* dpy The X "Display*" returned by XOpenDisplay |
|
536 |
* parent The parent of the newly created window, |
|
537 |
* a typical value for this is |
|
538 |
* RootWindow(dpy, DefaultScreen(dpy)) |
|
539 |
* x,y The location of the window to be created, |
|
540 |
* y coordinate is measured from the top down. |
|
541 |
* w,h size of the new window |
|
542 |
* borderWidth the X border size for this window, should probably |
|
543 |
* be zero. |
|
544 |
* type the GLXWindowType (see glxhelper.h) desribing the |
|
545 |
* typer of GL drawing to be done in this window |
|
546 |
*/ |
|
4718 | 547 |
Window |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
548 |
__GLXCreateWindow(dpy, parent, x, y, w, h, borderWidth, type) |
151 | 549 |
Display* dpy; |
550 |
Window parent; |
|
551 |
GLXWindowType type; |
|
552 |
{ |
|
1932 | 553 |
#if !defined(OPENGL) |
554 |
# ifndef VGL |
|
151 | 555 |
GLXconfig params[50]; |
556 |
GLXconfig* next; |
|
557 |
GLXconfig* retconfig; |
|
558 |
Colormap cmap = DefaultColormap(dpy, DefaultScreen(dpy)); |
|
1932 | 559 |
# endif |
560 |
#endif |
|
561 |
Visual visual; |
|
151 | 562 |
XVisualInfo *vis; |
563 |
XVisualInfo template; |
|
564 |
XColor white; |
|
565 |
XSetWindowAttributes cwa; |
|
566 |
XWindowAttributes pwa; |
|
567 |
int scr, i, nret; |
|
568 |
Window win; |
|
1932 | 569 |
#ifdef HAS_SIGACTION |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
570 |
struct sigaction oldSigSegv, newSigSegv; |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
571 |
#else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
572 |
void *oldSigSegv; |
1932 | 573 |
#endif |
574 |
||
575 |
#if !defined(OPENGL) |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
576 |
__catchExit(1); |
1932 | 577 |
#endif |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
578 |
|
6002 | 579 |
if (stx_setjmp(errorReturn)) { |
4718 | 580 |
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
|
581 |
#ifdef SIGSEGV |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
582 |
# ifdef HAS_SIGACTION |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
583 |
sigaction(SIGSEGV, &oldSigSegv, 0); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
584 |
# else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
585 |
signal(SIGSEGV, oldSigSegv); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
586 |
# endif |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
587 |
#endif |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
588 |
|
1932 | 589 |
#if !defined(OPENGL) |
4718 | 590 |
__catchExit(0); |
591 |
#endif |
|
592 |
return 0; |
|
151 | 593 |
} |
594 |
__CONT__ |
|
595 |
||
1932 | 596 |
if (w <= 0) { |
4718 | 597 |
console_fprintf(stderr, "GL: bad width: %d\n", w); |
598 |
w = 1; |
|
1932 | 599 |
} |
600 |
if (h <= 0) { |
|
4718 | 601 |
console_fprintf(stderr, "GL: bad height: %d\n", h); |
602 |
h = 1; |
|
1932 | 603 |
} |
604 |
||
605 |
#if !defined(OPENGL) |
|
1899 | 606 |
# ifdef VGL |
151 | 607 |
/* |
608 |
* I know what VGL supports; its somewhat unclean to hard code it here |
|
609 |
*/ |
|
610 |
switch (type) { |
|
611 |
case GLXcolorIndexSingleBuffer: |
|
612 |
case GLXcolorIndexDoubleBuffer: |
|
4718 | 613 |
break; |
151 | 614 |
|
615 |
case GLXrgbSingleBuffer: |
|
616 |
case GLXrgbDoubleBuffer: |
|
4718 | 617 |
console_fprintf(stderr, "Sorry, VGL can't support %s type of windows\n", typeToName[type]); |
618 |
__catchExit(0); |
|
619 |
return 0; |
|
151 | 620 |
} |
621 |
||
622 |
scr = DefaultScreen(dpy); |
|
623 |
visual.visualid = CopyFromParent; |
|
624 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
625 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
4718 | 626 |
borderWidth, DisplayPlanes(dpy, scr), |
627 |
InputOutput, &visual, |
|
628 |
CWBorderPixel, &cwa); |
|
151 | 629 |
|
630 |
/* |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
631 |
* on some, seg-violations occur in the GL, if too many |
151 | 632 |
* views are created ... just to make certain, we catch those |
633 |
* in GL too. |
|
634 |
*/ |
|
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
635 |
# ifdef SIGSEGV |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
636 |
# ifdef HAS_SIGACTION |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
637 |
sigaction(SIGSEGV, (struct sigaction *)0, &oldSigSegv); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
638 |
newSigSegv = oldSigSegv; |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
639 |
newSigSegv.sa_handler = glAbort; |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
640 |
sigaction(SIGSEGV, &newSigSegv, (struct sigaction *)0); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
641 |
# else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
642 |
oldSigSegv = signal(SIGSEGV, glAbort); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
643 |
# endif |
1899 | 644 |
# endif |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
645 |
|
151 | 646 |
i = GLXlink(dpy, win); |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
647 |
|
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
648 |
# ifdef SIGSEGV |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
649 |
# ifdef HAS_SIGACTION |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
650 |
sigaction(SIGSEGV, &oldSigSegv, (struct sigaction *)0); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
651 |
# else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
652 |
signal(SIGSEGV, oldSigSegv); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
653 |
# endif |
1899 | 654 |
# endif |
151 | 655 |
|
656 |
if (i < 0) { |
|
4718 | 657 |
console_fprintf(stderr, "GLXlink returned %d\n", i); |
658 |
__catchExit(0); |
|
659 |
return 0; |
|
151 | 660 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
661 |
|
1899 | 662 |
# else /* not VGL */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
663 |
|
151 | 664 |
/* |
665 |
* This builds an array in "params" that describes for GLXgetconfig(3G) |
|
666 |
* the type of GL drawing that will be done. |
|
667 |
*/ |
|
668 |
next = params; |
|
669 |
switch (type) { |
|
670 |
case GLXcolorIndexSingleBuffer: |
|
4718 | 671 |
set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE); |
672 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE); |
|
673 |
break; |
|
151 | 674 |
case GLXcolorIndexDoubleBuffer: |
4718 | 675 |
set_entry(next++, GLX_NORMAL, GLX_RGB, FALSE); |
676 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE); |
|
677 |
break; |
|
151 | 678 |
case GLXrgbSingleBuffer: |
4718 | 679 |
set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE); |
680 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, FALSE); |
|
681 |
break; |
|
151 | 682 |
case GLXrgbDoubleBuffer: |
4718 | 683 |
set_entry(next++, GLX_NORMAL, GLX_RGB, TRUE); |
684 |
set_entry(next++, GLX_NORMAL, GLX_DOUBLE, TRUE); |
|
685 |
break; |
|
151 | 686 |
} |
687 |
set_entry(next, 0, 0, 0); /* The input to GLXgetconfig is null terminated */ |
|
688 |
||
689 |
/* |
|
690 |
* Get configuration data for a window based on above parameters |
|
691 |
* First we have to find out which screen the parent window is on, |
|
692 |
* then we can call GXLgetconfig() |
|
693 |
*/ |
|
694 |
XGetWindowAttributes(dpy, parent, &pwa); |
|
695 |
retconfig = GLXgetconfig(dpy, XScreenNumberOfScreen(pwa.screen), params); |
|
696 |
if (retconfig == 0) { |
|
4718 | 697 |
console_fprintf(stderr, "Sorry, can't support %s type of windows\n", typeToName[type]); |
698 |
__catchExit(0); |
|
699 |
return 0; |
|
151 | 700 |
} |
701 |
||
702 |
/* |
|
703 |
* Scan through config info, pulling info needed to create a window |
|
704 |
* that supports the rendering mode. |
|
705 |
*/ |
|
706 |
for (next = retconfig; next->buffer; next++) { |
|
4718 | 707 |
unsigned long buffer = next->buffer; |
708 |
unsigned long mode = next->mode; |
|
709 |
unsigned long value = next->arg; |
|
710 |
switch (mode) { |
|
711 |
case GLX_COLORMAP: |
|
712 |
if (buffer == GLX_NORMAL) { |
|
713 |
cmap = value; |
|
714 |
} |
|
715 |
break; |
|
716 |
case GLX_VISUAL: |
|
717 |
if (buffer == GLX_NORMAL) { |
|
718 |
template.visualid = value; |
|
719 |
template.screen = DefaultScreen(dpy); |
|
720 |
vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask, |
|
721 |
&template, &nret); |
|
722 |
} |
|
723 |
break; |
|
724 |
} |
|
151 | 725 |
} |
726 |
||
727 |
/* |
|
728 |
* Create the window |
|
729 |
*/ |
|
730 |
cwa.colormap = cmap; |
|
731 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
732 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
4718 | 733 |
borderWidth, vis->depth, InputOutput, vis->visual, |
734 |
CWColormap|CWBorderPixel, &cwa); |
|
151 | 735 |
|
736 |
/* |
|
737 |
* Rescan configuration info and find window slot that getconfig |
|
738 |
* provided. Fill it in with the window we just created. |
|
739 |
*/ |
|
740 |
for (next = retconfig; next->buffer; next++) { |
|
4718 | 741 |
if ((next->buffer == GLX_NORMAL) && (next->mode == GLX_WINDOW)) { |
742 |
next->arg = win; |
|
743 |
break; |
|
744 |
} |
|
151 | 745 |
} |
746 |
||
747 |
/* |
|
748 |
* Now "retconfig" contains all the information the GL needs to |
|
749 |
* configure the window and its own internal state. |
|
750 |
*/ |
|
751 |
/* |
|
389
4e08ad24670a
oops - use sigaction if available when catching gl errors
Claus Gittinger <cg@exept.de>
parents:
350
diff
changeset
|
752 |
* on iris, seg-violations occur in the GL, if too many |
151 | 753 |
* views are created ... |
754 |
*/ |
|
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
755 |
# ifdef SIGSEGV |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
756 |
# ifdef HAS_SIGACTION |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
757 |
sigaction(SIGSEGV, (struct sigaction *)0, &oldSigSegv); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
758 |
newSigSegv = oldSigSegv; |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
759 |
newSigSegv.sa_handler = glAbort; |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
760 |
sigaction(SIGSEGV, &newSigSegv, (struct sigaction *)0); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
761 |
# else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
762 |
oldSigSegv = signal(SIGSEGV, glAbort); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
763 |
# endif |
1899 | 764 |
# endif |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
765 |
|
151 | 766 |
i = GLXlink(dpy, retconfig); |
6617
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
767 |
|
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
768 |
# ifdef SIGSEGV |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
769 |
# ifdef HAS_SIGACTION |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
770 |
sigaction(SIGSEGV, &oldSigSegv, (struct sigaction *)0); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
771 |
# else |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
772 |
signal(SIGSEGV, oldSigSegv); |
2af71b6a7e46
compilable on systems without SIGSEGV
Claus Gittinger <cg@exept.de>
parents:
6254
diff
changeset
|
773 |
# endif |
1899 | 774 |
# endif |
151 | 775 |
|
776 |
if (i < 0) { |
|
4718 | 777 |
console_fprintf(stderr, "GLXlink returned %d\n", i); |
778 |
__catchExit(0); |
|
779 |
return 0; |
|
151 | 780 |
} |
781 |
||
782 |
/* |
|
783 |
* The GL sets its own X error handlers, which exits - this is not what we want |
|
784 |
*/ |
|
785 |
XSetErrorHandler(__XErrorHandler__); |
|
1899 | 786 |
# endif /* not VGL */ |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
787 |
__catchExit(0); |
1932 | 788 |
|
789 |
#else /* OPENGL | MESA */ |
|
790 |
||
791 |
scr = DefaultScreen(dpy); |
|
792 |
visual.visualid = CopyFromParent; |
|
793 |
cwa.border_pixel = 0; /* Even if we don't use it, it must be something */ |
|
794 |
win = XCreateWindow(dpy, parent, x, y, w, h, |
|
4718 | 795 |
borderWidth, DisplayPlanes(dpy, scr), |
796 |
InputOutput, &visual, |
|
797 |
CWBorderPixel, &cwa); |
|
1932 | 798 |
|
799 |
vis = XGetVisualInfo(dpy, VisualScreenMask|VisualIDMask, &visual, &nret); |
|
4718 | 800 |
console_fprintf(stderr, "vis is %x\n", vis); |
1932 | 801 |
#endif /* GLX || VGL */ |
802 |
||
151 | 803 |
return win; |
804 |
} |
|
805 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
806 |
__GLXUnlinkWindow(dpy, win) |
151 | 807 |
Display* dpy; |
808 |
Window win; |
|
809 |
{ |
|
810 |
/* |
|
811 |
* only needed for VGL - GLX does it automatically |
|
812 |
*/ |
|
1932 | 813 |
#ifdef VGL |
151 | 814 |
GLXunlink(dpy, win); |
1932 | 815 |
#endif |
151 | 816 |
} |
817 |
||
29 | 818 |
/* |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
819 |
* helper for rotation - calls rot() |
29 | 820 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
821 |
OBJ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
822 |
__glx_doRotate(angle, axis) |
29 | 823 |
OBJ angle; |
824 |
char axis; |
|
825 |
{ |
|
826 |
float f_angle; |
|
827 |
||
35 | 828 |
if (__isFloat(angle)) { |
4718 | 829 |
f_angle = (float)(_floatVal(angle)); |
830 |
if (f_angle != 0.0) { |
|
831 |
#ifdef OPENGL |
|
832 |
#else |
|
833 |
rot(f_angle, axis); |
|
834 |
#endif |
|
835 |
} |
|
836 |
return (true); |
|
29 | 837 |
} |
35 | 838 |
if (__isFraction(angle) |
97 | 839 |
&& __isSmallInteger(_FractionInstPtr(angle)->f_numerator) |
840 |
&& __isSmallInteger(_FractionInstPtr(angle)->f_denominator)) { |
|
4718 | 841 |
float n, d; |
842 |
||
843 |
n = (float)(__intVal(_FractionInstPtr(angle)->f_numerator)); |
|
844 |
d = (float)(__intVal(_FractionInstPtr(angle)->f_denominator)); |
|
845 |
f_angle = n / d; |
|
846 |
if (f_angle != 0.0) { |
|
847 |
#ifdef OPENGL |
|
848 |
#else |
|
849 |
rot(f_angle, axis); |
|
850 |
#endif |
|
851 |
} |
|
852 |
return (true); |
|
29 | 853 |
} |
97 | 854 |
if (__isSmallInteger(angle)) { |
4718 | 855 |
f_angle = (float)(__intVal(angle)); |
856 |
if (f_angle != 0.0) { |
|
857 |
#ifdef OPENGL |
|
858 |
#else |
|
859 |
rot(f_angle, axis); |
|
860 |
#endif |
|
861 |
} |
|
862 |
return (true); |
|
29 | 863 |
} |
864 |
return false; |
|
865 |
} |
|
0 | 866 |
|
24 | 867 |
/* |
29 | 868 |
* fetch integers from an st-array (elements must be smallIntegers) |
869 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
870 |
long * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
871 |
__glx_getLongsFromInto(obj, vec, count) |
29 | 872 |
OBJ obj; |
873 |
long *vec; |
|
874 |
{ |
|
875 |
OBJ cls, o; |
|
876 |
int nByte, i, ninstVars, nInstBytes; |
|
877 |
char *pElem; |
|
878 |
||
879 |
if (! _isNonNilObject(obj)) return (long *)NULL; |
|
134 | 880 |
cls = __qClass(obj); |
185 | 881 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 882 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 883 |
nByte = __qSize(obj) - nInstBytes; |
29 | 884 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
885 |
if (nByte < (count * sizeof(OBJ))) return (long *)NULL; |
|
886 |
for (i=0; i<count; i++) { |
|
4718 | 887 |
o = *(OBJ *)pElem; |
888 |
if (! __isSmallInteger(o)) return (long *)NULL; |
|
889 |
vec[i] = (long)__intVal(o); |
|
890 |
pElem += sizeof(OBJ); |
|
29 | 891 |
} |
892 |
return vec; |
|
893 |
} |
|
894 |
||
895 |
/* |
|
896 |
* fetch shorts from an st-array (elements must be smallIntegers) |
|
897 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
898 |
short * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
899 |
__glx_getShortsFromInto(obj, vec, count) |
29 | 900 |
OBJ obj; |
901 |
short *vec; |
|
902 |
{ |
|
903 |
OBJ cls, o; |
|
904 |
int nByte, i, ninstVars, nInstBytes; |
|
905 |
char *pElem; |
|
906 |
||
907 |
if (! _isNonNilObject(obj)) return (short *)NULL; |
|
134 | 908 |
cls = __qClass(obj); |
185 | 909 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 910 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 911 |
nByte = __qSize(obj) - nInstBytes; |
29 | 912 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
913 |
if (nByte < (count * sizeof(OBJ))) return (short *)NULL; |
|
914 |
for (i=0; i<count; i++) { |
|
4718 | 915 |
o = *(OBJ *)pElem; |
916 |
if (! __isSmallInteger(o)) return (short *)NULL; |
|
917 |
vec[i] = (short)__intVal(o); |
|
918 |
pElem += sizeof(OBJ); |
|
29 | 919 |
} |
920 |
return vec; |
|
921 |
} |
|
922 |
||
923 |
/* |
|
4718 | 924 |
* fetch floats from an st-object into a c-float array |
29 | 925 |
* which may be a floatArray, doubleArray or array-of-something, |
926 |
* where something may be a float, fraction or smallInteger, |
|
24 | 927 |
*/ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
928 |
float * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
929 |
__glx_getFloatsFromInto(obj, vec, count) |
12 | 930 |
OBJ obj; |
931 |
float *vec; |
|
932 |
{ |
|
933 |
OBJ cls; |
|
934 |
int nByte; |
|
935 |
OBJ o; |
|
936 |
int i, ninstVars, nInstBytes; |
|
937 |
char *pElem; |
|
938 |
||
939 |
if (! _isNonNilObject(obj)) return (float *)0; |
|
940 |
||
134 | 941 |
cls = __qClass(obj); |
185 | 942 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
12 | 943 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 944 |
nByte = __qSize(obj) - nInstBytes; |
12 | 945 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
946 |
||
185 | 947 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
12 | 948 |
case FLOATARRAY: |
4718 | 949 |
/* |
950 |
* best speed for float array |
|
951 |
* - the data is already as we want it |
|
952 |
*/ |
|
953 |
if (nByte < (count * sizeof(float))) return (float *)0; |
|
954 |
return (float *)pElem; |
|
12 | 955 |
|
956 |
case DOUBLEARRAY: |
|
4718 | 957 |
/* |
958 |
* for double array, have to copy-and-cast |
|
959 |
*/ |
|
960 |
if (nByte < (count * sizeof(double))) return (float *)0; |
|
961 |
for (i=0; i<count; i++) { |
|
962 |
vec[i] = *((double *)pElem); |
|
963 |
pElem += sizeof(double); |
|
964 |
} |
|
965 |
return vec; |
|
12 | 966 |
|
967 |
case POINTERARRAY: |
|
4718 | 968 |
/* |
969 |
* for other array, have to fetch, check and store |
|
970 |
* the elements can be floats, smallintegers or fractions |
|
971 |
*/ |
|
972 |
if (nByte < (count * sizeof(OBJ))) return (float *)0; |
|
973 |
/* get elements one-by-one */ |
|
974 |
for (i=0; i<count; i++) { |
|
975 |
o = *(OBJ *)pElem; |
|
976 |
if (__isFloat(o)) { |
|
977 |
vec[i] = _floatVal(o); |
|
978 |
} else if (__isSmallInteger(o)) { |
|
979 |
vec[i] = (float)(__intVal(o)); |
|
980 |
} else if (__isFraction(o) |
|
981 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
|
982 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
983 |
float n, d; |
|
984 |
||
985 |
n = (float)(__intVal(_FractionInstPtr(o)->f_numerator)); |
|
986 |
d = (float)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
987 |
vec[i] = n / d; |
|
988 |
} else |
|
989 |
return 0; |
|
990 |
pElem += sizeof(OBJ); |
|
991 |
} |
|
992 |
return vec; |
|
12 | 993 |
} |
994 |
return (float *)0; |
|
995 |
} |
|
996 |
||
29 | 997 |
/* |
4718 | 998 |
* fetch doubles from an st-object into a c-double array |
29 | 999 |
* which may be a floatArray, doubleArray or array-of-something, |
1000 |
* where something may be a float, fraction or smallInteger, |
|
1001 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1002 |
double * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1003 |
__glx_getDoublesFromInto(obj, vec, count) |
29 | 1004 |
OBJ obj; |
1005 |
double *vec; |
|
1006 |
{ |
|
1007 |
OBJ cls, o; |
|
1008 |
int nByte, i, ninstVars, nInstBytes; |
|
1009 |
char *pElem; |
|
1010 |
||
1011 |
if (! _isNonNilObject(obj)) return (double *)0; |
|
134 | 1012 |
cls = __qClass(obj); |
185 | 1013 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 1014 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1015 |
nByte = __qSize(obj) - nInstBytes; |
29 | 1016 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1017 |
||
185 | 1018 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
29 | 1019 |
case DOUBLEARRAY: |
4718 | 1020 |
/* best speed for double array - the data is already as we want it */ |
1021 |
if (nByte < (count * sizeof(double))) return (double *)0; |
|
1022 |
return (double *)pElem; |
|
29 | 1023 |
|
1024 |
case FLOATARRAY: |
|
4718 | 1025 |
if (nByte < (count * sizeof(float))) return (double *)0; |
1026 |
for (i=0; i<count; i++) { |
|
1027 |
vec[i] = *((float *)pElem); |
|
1028 |
pElem += sizeof(float); |
|
1029 |
} |
|
1030 |
return vec; |
|
29 | 1031 |
|
1032 |
case POINTERARRAY: |
|
4718 | 1033 |
if (nByte < (count * sizeof(OBJ))) return (double *)0; |
1034 |
/* get elements one-by-one */ |
|
1035 |
for (i=0; i<count; i++) { |
|
1036 |
o = *(OBJ *)pElem; |
|
1037 |
if (__isFloat(o)) |
|
1038 |
vec[i] = _floatVal(o); |
|
1039 |
else if (__isSmallInteger(o)) |
|
1040 |
vec[i] = (double)(__intVal(o)); |
|
1041 |
else if (__isFraction(o) |
|
1042 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
|
1043 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
1044 |
double n, d; |
|
1045 |
||
1046 |
n = (double)(__intVal(_FractionInstPtr(o)->f_numerator)); |
|
1047 |
d = (double)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
1048 |
vec[i] = n / d; |
|
1049 |
||
1050 |
} else |
|
1051 |
return 0; |
|
1052 |
pElem += sizeof(OBJ); |
|
1053 |
} |
|
1054 |
return vec; |
|
29 | 1055 |
} |
1056 |
return (double *)0; |
|
1057 |
} |
|
1058 |
||
1059 |
/* |
|
1060 |
* move from a c-float array into an st-object, |
|
1061 |
* the st-object MUST be either a float- or double array |
|
1062 |
*/ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1063 |
__glx_putFloatsFromInto(vec, obj, count) |
12 | 1064 |
OBJ obj; |
1065 |
float *vec; |
|
1066 |
{ |
|
1067 |
OBJ cls; |
|
1068 |
int nByte; |
|
1069 |
OBJ o; |
|
1070 |
int i, ninstVars, nInstBytes; |
|
1071 |
char *pElem; |
|
1072 |
||
1073 |
if (! _isNonNilObject(obj)) return 0; |
|
1074 |
||
134 | 1075 |
cls = __qClass(obj); |
185 | 1076 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
12 | 1077 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1078 |
nByte = __qSize(obj) - nInstBytes; |
12 | 1079 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1080 |
||
185 | 1081 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
12 | 1082 |
case FLOATARRAY: |
4718 | 1083 |
if (nByte < (count * sizeof(float))) return 0; |
1084 |
for (i=0; i<count; i++) { |
|
1085 |
*(float *)pElem = vec[i]; |
|
1086 |
pElem += sizeof(float); |
|
1087 |
} |
|
1088 |
return 1; |
|
12 | 1089 |
|
1090 |
case DOUBLEARRAY: |
|
4718 | 1091 |
if (nByte < (count * sizeof(float))) return 0; |
1092 |
for (i=0; i<count; i++) { |
|
1093 |
*(double *)pElem = vec[i]; |
|
1094 |
pElem += sizeof(double); |
|
1095 |
} |
|
1096 |
return 1; |
|
12 | 1097 |
} |
1098 |
/* not implemented for others */ |
|
1099 |
||
1100 |
return 0; |
|
1101 |
} |
|
1102 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1103 |
#ifndef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1104 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1105 |
Matrix * |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1106 |
__glx_getFloatsFromMatrixInto(obj, mp) |
12 | 1107 |
OBJ obj; |
1108 |
Matrix *mp; |
|
1109 |
{ |
|
1110 |
OBJ cls; |
|
1111 |
int nByte; |
|
1112 |
OBJ o; |
|
29 | 1113 |
int ninstVars, nInstBytes; |
1114 |
char *pElem; |
|
1115 |
int x = 0; |
|
1116 |
int i,j; |
|
12 | 1117 |
|
1118 |
if (! _isNonNilObject(obj)) return (Matrix *)0; |
|
1119 |
||
134 | 1120 |
cls = __qClass(obj); |
185 | 1121 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
29 | 1122 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
134 | 1123 |
nByte = __qSize(obj) - nInstBytes; |
29 | 1124 |
pElem = (char *)(_InstPtr(obj)) + nInstBytes; |
1125 |
||
185 | 1126 |
switch (__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) { |
4718 | 1127 |
case FLOATARRAY: |
1128 |
/* |
|
1129 |
* very easy for FLOATARRAY objects - no copying needed |
|
1130 |
*/ |
|
1131 |
if (nByte < (16 * sizeof(float))) return (Matrix *)0; |
|
1132 |
return (Matrix *) _FloatArrayInstPtr(obj)->f_element; |
|
1133 |
||
1134 |
case DOUBLEARRAY: |
|
1135 |
/* |
|
1136 |
* for DOUBLEARRAY objects copy and cast |
|
1137 |
*/ |
|
1138 |
if (nByte < (16 * sizeof(double))) return (Matrix *)0; |
|
1139 |
for (i=0; i<4; i++) { |
|
1140 |
for (j=0; j<4; j++) { |
|
1141 |
(*mp)[i][j] = _DoubleArrayInstPtr(obj)->d_element[x]; |
|
1142 |
x++; |
|
1143 |
} |
|
1144 |
} |
|
1145 |
return mp; |
|
1146 |
||
1147 |
case POINTERARRAY: |
|
1148 |
if (nByte < (16 * sizeof(OBJ))) return (Matrix *)0; |
|
1149 |
/* |
|
1150 |
* get elements one-by-one |
|
1151 |
*/ |
|
1152 |
for (i=0; i<4; i++) { |
|
1153 |
for (j=0; j<4; j++) { |
|
1154 |
o = _ArrayInstPtr(obj)->a_element[x]; |
|
1155 |
if (__isFloat(o)) { |
|
1156 |
(*mp)[i][j] = _floatVal(o); |
|
1157 |
} else if (__isSmallInteger(o)) { |
|
1158 |
(*mp)[i][j] = (double)__intVal(o); |
|
1159 |
} else if (__isFraction(o) |
|
1160 |
&& __isSmallInteger(_FractionInstPtr(o)->f_numerator) |
|
1161 |
&& __isSmallInteger(_FractionInstPtr(o)->f_denominator)) { |
|
1162 |
double n, d; |
|
1163 |
||
1164 |
n = (double)(__intVal(_FractionInstPtr(o)->f_numerator)); |
|
1165 |
d = (double)(__intVal(_FractionInstPtr(o)->f_denominator)); |
|
1166 |
(*mp)[i][j] = n / d; |
|
1167 |
} else |
|
1168 |
return (Matrix *)0; |
|
1169 |
x++; |
|
1170 |
} |
|
1171 |
} |
|
1172 |
return mp; |
|
12 | 1173 |
} |
1174 |
return (Matrix *)0; |
|
1175 |
} |
|
1176 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1177 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1178 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1179 |
float* |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1180 |
__glx_getFloatsFromFloatArrayInto(obj, fp) |
46 | 1181 |
OBJ obj; |
1182 |
float *fp; |
|
1183 |
{ |
|
1184 |
OBJ cls; |
|
1185 |
int ninstVars; |
|
1186 |
||
1187 |
if (! _isNonNilObject(obj)) return (float *)0; |
|
134 | 1188 |
cls = __qClass(obj); |
350 | 1189 |
if (cls == @global(FloatArray)) |
4718 | 1190 |
return _FloatArrayInstPtr(obj)->f_element; |
46 | 1191 |
|
185 | 1192 |
if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) { |
4718 | 1193 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
1194 |
return (float *) &(_InstPtr(obj)->i_instvars[ninstVars]); |
|
46 | 1195 |
} |
1196 |
||
1197 |
/* |
|
1198 |
* need more here (i.e. convert from array-of-floats) |
|
1199 |
*/ |
|
1200 |
return (float *)0; |
|
1201 |
} |
|
1202 |
||
1203 |
%} |
|
1204 |
! ! |
|
0 | 1205 |
|
294 | 1206 |
!GLXWorkstation class methodsFor:'documentation'! |
1207 |
||
1208 |
copyright |
|
1209 |
" |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1210 |
COPYRIGHT (c) 1993 by Claus Gittinger |
294 | 1211 |
All Rights Reserved |
1212 |
||
1213 |
This software is furnished under a license and may be used |
|
1214 |
only in accordance with the terms of that license and with the |
|
1215 |
inclusion of the above copyright notice. This software may not |
|
1216 |
be provided or otherwise made available to, or used by, any |
|
1217 |
other person. No title to or ownership of the software is |
|
1218 |
hereby transferred. |
|
1219 |
" |
|
1220 |
! |
|
1221 |
||
1222 |
documentation |
|
1223 |
" |
|
1224 |
this class was originally written as a demo on how an interface to |
|
1225 |
a c graphics library could be implemented. In the mean time, it has become |
|
1226 |
quite complete ... |
|
1227 |
||
1228 |
It provides an interface to either a real GL (on SGI workstations) |
|
1229 |
or a simulated VGL (i.e. GL-light; low nicotine). |
|
1230 |
The GL simulation is derived from the PD vogl library, with slight |
|
1231 |
modifictions to support multiple GL views. |
|
1232 |
||
1233 |
Most of the hard work was done by Jeff (thanks indeed) ... |
|
1234 |
||
1235 |
||
1236 |
Some notes: |
|
1237 |
||
1238 |
I do not really know what most of these functions do - for more |
|
1239 |
detail, see the GL man pages (on SGI) or the doc provided with VGL. |
|
1240 |
||
1241 |
The interface offered here provides a very very low level (i.e one-to-one) |
|
1242 |
interface to GL functions. More high-level stuff is required, to make |
|
4718 | 1243 |
3D drawing be more object-oriented. |
294 | 1244 |
(see a bit of this in 'clients/IRIS-specials') |
1245 |
||
1246 |
Some functions are duplicated, Jeff and I developed those in parallel - |
|
1247 |
for now, both will remain - finally they will be merged and duplicates removed ... |
|
1248 |
(examples are makeobj and makeObject). |
|
1249 |
||
1250 |
Also, in a hurry to implement all those methods, many do no or only |
|
1251 |
limited argument checking - make certain, that you pass the correct |
|
1252 |
arguments. |
|
1253 |
||
1254 |
There might be some confusion in the v3[sifd] functions: basically they |
|
1255 |
all do the same, and could be mapped onto one st-method (such as vertex3). |
|
1256 |
However, the C-functions expect different argument types - I dont know if |
|
1257 |
one or another of these functions suffers from any performance penalties. |
|
1258 |
Therefore, I leave the direct 1-to-1 mapping; GL experts might know more |
|
1259 |
about this (I use v3f in all of my code). |
|
1260 |
||
1261 |
written june 93 by claus |
|
1262 |
VGL stuff dec 93 |
|
1263 |
many many additions jan 94 by Jeff McAffer <jeff@is.s.u-tokyo.ac.jp> |
|
1264 |
||
4718 | 1265 |
Since this is a demo (consider it a free add-on goody) there is |
294 | 1266 |
*** NO WARRANTY ** for this. |
1267 |
||
1268 |
Notice: this should be rewritten to use the openGL library functions |
|
1269 |
(actually, to not loose the VGL interface, another OpenGLWorkstation |
|
1270 |
class should be written) |
|
614 | 1271 |
|
1272 |
[author:] |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1273 |
Claus Gittinger |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1274 |
Jeff McAffer |
294 | 1275 |
" |
1276 |
! ! |
|
1277 |
||
168 | 1278 |
!GLXWorkstation class methodsFor:'error handling'! |
1279 |
||
294 | 1280 |
errorStringOfLastError |
1281 |
%{ |
|
4251 | 1282 |
#ifdef DYNAMICALLY_LOADABLE |
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
1283 |
RETURN ( __MKSTRING(lastErrorMsg) ); |
4251 | 1284 |
#endif |
1285 |
%}. |
|
1286 |
||
1287 |
^ super errorStringOfLastError. |
|
1288 |
! |
|
1289 |
||
1290 |
minorCodeOfLastError |
|
1291 |
%{ /* NOCONTEXT */ |
|
1292 |
#ifdef DYNAMICALLY_LOADABLE |
|
1293 |
RETURN ( __MKSMALLINT(lastMinorCode) ); |
|
1294 |
#endif |
|
1295 |
%}. |
|
1296 |
||
1297 |
^ super minorCodeOfLastError. |
|
1298 |
! |
|
1299 |
||
1300 |
requestCodeOfLastError |
|
1301 |
%{ /* NOCONTEXT */ |
|
1302 |
#ifdef DYNAMICALLY_LOADABLE |
|
1303 |
RETURN ( __MKSMALLINT(lastRequestCode) ); |
|
1304 |
#endif |
|
1305 |
%}. |
|
1306 |
||
1307 |
^ super requestCodeOfLastError. |
|
1308 |
! |
|
1309 |
||
1310 |
resourceIdOfLastError |
|
1311 |
%{ /* NOCONTEXT */ |
|
1312 |
#ifdef DYNAMICALLY_LOADABLE |
|
1313 |
if (lastResource != 0) { |
|
1314 |
RETURN ( __MKEXTERNALADDRESS(lastResource) ); |
|
1315 |
} |
|
1316 |
RETURN ( nil ); |
|
1317 |
#endif |
|
1318 |
%}. |
|
1319 |
||
1320 |
^ super resourceIdOfLastError. |
|
1321 |
! ! |
|
1322 |
||
1323 |
!GLXWorkstation class methodsFor:'misc'! |
|
168 | 1324 |
|
528 | 1325 |
forceGL:aBoolean |
1326 |
ForceGL := aBoolean. |
|
1327 |
AllScreens notNil ifTrue:[ |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1328 |
AllScreens do:[:screen | screen initializeScreenProperties] |
528 | 1329 |
]. |
294 | 1330 |
! ! |
1331 |
||
1332 |
!GLXWorkstation methodsFor:'arcs and circles'! |
|
1333 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1334 |
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
|
1335 |
"draw an arc at a given location. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1336 |
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
|
1337 |
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
|
1338 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1339 |
%{ /* NOCONTEXT */ |
294 | 1340 |
Coord c_x, c_y, c_radius; |
1341 |
Angle a_startang, a_endang; |
|
1342 |
||
1343 |
_COORD_(x, c_x) |
|
1344 |
_COORD_(y, c_y) |
|
1345 |
_COORD_(radius, c_radius) |
|
1346 |
_ANGLE_(startang, a_startang) |
|
1347 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1348 |
|
294 | 1349 |
SETWIN(aGLXWindowId) |
1932 | 1350 |
#ifdef OPENGL |
1351 |
#else |
|
294 | 1352 |
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
|
1353 |
#endif |
294 | 1354 |
%} |
528 | 1355 |
|
1356 |
"Modified: 19.3.1996 / 18:43:52 / cg" |
|
294 | 1357 |
! |
1358 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1359 |
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
|
1360 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1361 |
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
|
1362 |
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
|
1363 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1364 |
%{ /* NOCONTEXT */ |
294 | 1365 |
Coord c_x, c_y, c_radius; |
1366 |
Angle a_startang, a_endang; |
|
1367 |
||
1368 |
_COORD_(x, c_x) |
|
1369 |
_COORD_(y, c_y) |
|
1370 |
_COORD_(radius, c_radius) |
|
1371 |
_ANGLE_(startang, a_startang) |
|
1372 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1373 |
|
294 | 1374 |
SETWIN(aGLXWindowId) |
1932 | 1375 |
#ifdef OPENGL |
1376 |
#else |
|
294 | 1377 |
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
|
1378 |
#endif |
294 | 1379 |
%} |
1380 |
! |
|
1381 |
||
1382 |
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
|
1383 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1384 |
All arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1385 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1386 |
%{ /* NOCONTEXT */ |
294 | 1387 |
Icoord c_x, c_y, c_radius; |
1388 |
Angle a_startang, a_endang; |
|
1389 |
||
1390 |
_ICOORD_(x, c_x) |
|
1391 |
_ICOORD_(y, c_y) |
|
1392 |
_ICOORD_(radius, c_radius) |
|
1393 |
_ANGLE_(startang, a_startang); |
|
1394 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1395 |
|
294 | 1396 |
SETWIN(aGLXWindowId) |
1932 | 1397 |
#ifdef OPENGL |
1398 |
#else |
|
294 | 1399 |
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
|
1400 |
#endif |
294 | 1401 |
%} |
1402 |
! |
|
1403 |
||
1404 |
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
|
1405 |
"draw a filled arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1406 |
All arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1407 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1408 |
%{ /* NOCONTEXT */ |
294 | 1409 |
Scoord c_x, c_y, c_radius; |
1410 |
Angle a_startang, a_endang; |
|
1411 |
||
1412 |
_SCOORD_(x, c_x) |
|
1413 |
_SCOORD_(y, c_y) |
|
1414 |
_SCOORD_(radius, c_radius) |
|
1415 |
_ANGLE_(startang, a_startang) |
|
1416 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1417 |
|
294 | 1418 |
SETWIN(aGLXWindowId) |
1932 | 1419 |
#ifdef OPENGL |
1420 |
#else |
|
294 | 1421 |
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
|
1422 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1423 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1424 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1425 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1426 |
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
|
1427 |
"draw an (unfilled) arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1428 |
All arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1429 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1430 |
%{ /* NOCONTEXT */ |
294 | 1431 |
Icoord c_x, c_y, c_radius; |
1432 |
Angle a_startang, a_endang; |
|
1433 |
||
1434 |
_ICOORD_(x, c_x) |
|
1435 |
_ICOORD_(y, c_y) |
|
1436 |
_ICOORD_(radius, c_radius) |
|
1437 |
_ANGLE_(startang, a_startang) |
|
1438 |
_ANGLE_(endang, a_endang) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1439 |
|
294 | 1440 |
SETWIN(aGLXWindowId) |
1932 | 1441 |
#ifdef OPENGL |
1442 |
#else |
|
294 | 1443 |
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
|
1444 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1445 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1446 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1447 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1448 |
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
|
1449 |
"draw an (unfilled) arc. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1450 |
All arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1451 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1452 |
%{ /* NOCONTEXT */ |
1932 | 1453 |
Scoord c_x, c_y, c_radius; |
1454 |
Angle a_startang, a_endang; |
|
1455 |
||
1456 |
_SCOORD_(x, c_x) |
|
1457 |
_SCOORD_(y, c_y) |
|
1458 |
_SCOORD_(radius, c_radius) |
|
1459 |
_ANGLE_(startang, a_startang) |
|
1460 |
_ANGLE_(endang, a_endang) |
|
1461 |
||
1462 |
SETWIN(aGLXWindowId) |
|
1463 |
#ifdef OPENGL |
|
1464 |
#else |
|
1465 |
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
|
1466 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1467 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1468 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1469 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1470 |
glxCircX:x y:y radius: radius in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1471 |
"draw a circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1472 |
x/y/radius may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1473 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1474 |
%{ /* NOCONTEXT */ |
1932 | 1475 |
Coord c_x, c_y, c_radius; |
1476 |
||
1477 |
_COORD_ (x, c_x) |
|
1478 |
_COORD_ (y, c_y) |
|
1479 |
_COORD_ (radius, c_radius) |
|
1480 |
||
1481 |
SETWIN(aGLXWindowId) |
|
1482 |
#ifdef OPENGL |
|
1483 |
#else |
|
1484 |
circ(c_x, c_y, c_radius); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1485 |
#endif |
294 | 1486 |
%} |
1487 |
! |
|
1488 |
||
1489 |
glxCircfX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1490 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1491 |
x/y/radius may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1492 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1493 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1494 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1495 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1496 |
Coord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1497 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1498 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1499 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1500 |
_COORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1501 |
|
1932 | 1502 |
#ifdef OPENGL |
1503 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1504 |
circf(c_x, c_y, c_radius); |
1932 | 1505 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1506 |
} |
294 | 1507 |
%} |
1508 |
! |
|
1509 |
||
1510 |
glxCircfiX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1511 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1512 |
x/y/radius must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1513 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1514 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1515 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1516 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1517 |
Icoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1518 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1519 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1520 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1521 |
_ICOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1522 |
|
1932 | 1523 |
#ifdef OPENGL |
1524 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1525 |
circfi(c_x, c_y, c_radius); |
1932 | 1526 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1527 |
} |
294 | 1528 |
%} |
1529 |
! |
|
1530 |
||
1531 |
glxCircfsX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1532 |
"draw a filled circle. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1533 |
x/y/radius must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1534 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1535 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1536 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1537 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1538 |
Scoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1539 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1540 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1541 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1542 |
_SCOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1543 |
|
1932 | 1544 |
#ifdef OPENGL |
1545 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1546 |
circfs(c_x, c_y, c_radius); |
1932 | 1547 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1548 |
} |
294 | 1549 |
%} |
1550 |
! |
|
1551 |
||
1552 |
glxCirciX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1553 |
"draw a circle (unfilled). |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1554 |
x/y/radius must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1555 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1556 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1557 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1558 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1559 |
Icoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1560 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1561 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1562 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1563 |
_ICOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1564 |
|
1932 | 1565 |
#ifdef OPENGL |
1566 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1567 |
circi(c_x, c_y, c_radius); |
1932 | 1568 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1569 |
} |
294 | 1570 |
%} |
1571 |
! |
|
1572 |
||
1573 |
glxCircsX: x y: y radius: radius in: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1574 |
"draw a circle (unfilled) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1575 |
x/y/radius must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1576 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1577 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1578 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1579 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1580 |
Scoord c_x, c_y, c_radius; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1581 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1582 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1583 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1584 |
_SCOORD_ (radius, c_radius) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1585 |
|
1932 | 1586 |
#ifdef OPENGL |
1587 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1588 |
circs(c_x, c_y, c_radius); |
1932 | 1589 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1590 |
} |
294 | 1591 |
%} |
1592 |
! ! |
|
1593 |
||
528 | 1594 |
!GLXWorkstation methodsFor:'attribute stack'! |
1595 |
||
1596 |
glxPopattributesIn: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1597 |
"pop (and forget) the top entry on the attribute stack" |
528 | 1598 |
|
1599 |
%{ /* NOCONTEXT */ |
|
1600 |
SETWIN(aGLXWindowId) |
|
1932 | 1601 |
#ifndef OPENGL |
528 | 1602 |
popattributes(); |
1932 | 1603 |
#endif |
528 | 1604 |
%} |
1605 |
||
1606 |
"Modified: 19.3.1996 / 18:42:53 / cg" |
|
1607 |
! |
|
1608 |
||
1609 |
glxPushattributesIn: aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1610 |
"save the current attributes on the attribute stack" |
528 | 1611 |
|
1612 |
%{ /* NOCONTEXT */ |
|
1613 |
SETWIN(aGLXWindowId) |
|
1932 | 1614 |
#ifndef OPENGL |
528 | 1615 |
pushattributes(); |
1932 | 1616 |
#endif |
528 | 1617 |
%} |
1618 |
||
1619 |
"Modified: 19.3.1996 / 18:43:04 / cg" |
|
1620 |
! ! |
|
1621 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1622 |
!GLXWorkstation methodsFor:'character position'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1623 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1624 |
glxCmov2X: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1625 |
"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
|
1626 |
The arguments may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1627 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1628 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1629 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1630 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1631 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1632 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1633 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1634 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1635 |
|
1932 | 1636 |
#ifdef OPENGL |
1637 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1638 |
cmov2(c_x, c_y); |
1932 | 1639 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1640 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1641 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1642 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1643 |
"Modified: 22.3.1996 / 18:17:38 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1644 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1645 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1646 |
glxCmov2iX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1647 |
"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
|
1648 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1649 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1650 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1651 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1652 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1653 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1654 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1655 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1656 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1657 |
|
1932 | 1658 |
#ifdef OPENGL |
1659 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1660 |
cmov2i(c_x, c_y); |
1932 | 1661 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1662 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1663 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1664 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1665 |
"Modified: 22.3.1996 / 18:17:43 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1666 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1667 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1668 |
glxCmov2sX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1669 |
"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
|
1670 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1671 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1672 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1673 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1674 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1675 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1676 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1677 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1678 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1679 |
|
1932 | 1680 |
#ifdef OPENGL |
1681 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1682 |
cmov2s(c_x, c_y); |
1932 | 1683 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1684 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1685 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1686 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1687 |
"Modified: 22.3.1996 / 18:17:47 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1688 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1689 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1690 |
glxCmovX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1691 |
"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
|
1692 |
The arguments may be floats, fractions or smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1693 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1694 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1695 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1696 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1697 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1698 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1699 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1700 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1701 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1702 |
|
1932 | 1703 |
#ifdef OPENGL |
1704 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1705 |
cmov(c_x, c_y, c_z); |
1932 | 1706 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1707 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1708 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1709 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1710 |
"Modified: 22.3.1996 / 18:17:22 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1711 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1712 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1713 |
glxCmoviX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1714 |
"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
|
1715 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1716 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1717 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1718 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1719 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1720 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1721 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1722 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1723 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1724 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1725 |
|
1932 | 1726 |
#ifdef OPENGL |
1727 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1728 |
cmovi(c_x, c_y, c_z); |
1932 | 1729 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1730 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1731 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1732 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1733 |
"Modified: 22.3.1996 / 18:17:55 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1734 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1735 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1736 |
glxCmovsX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1737 |
"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
|
1738 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1739 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1740 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1741 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1742 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1743 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1744 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1745 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1746 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1747 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1748 |
|
1932 | 1749 |
#ifdef OPENGL |
1750 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
1751 |
cmovs(c_x, c_y, c_z); |
1932 | 1752 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1753 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1754 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1755 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1756 |
"Modified: 22.3.1996 / 18:17:59 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1757 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1758 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1759 |
glxGetcposIn: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1760 |
"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
|
1761 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1762 |
| x y | |
4718 | 1763 |
%{ |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1764 |
short s_x, s_y; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1765 |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1766 |
SETWIN(aGLXWindowId) |
1932 | 1767 |
#ifdef OPENGL |
1768 |
#else |
|
1769 |
# ifdef GLX |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1770 |
getcpos(&s_x, &s_y); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1771 |
x = __MKSMALLINT(s_x); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1772 |
y = __MKSMALLINT(s_y); |
1932 | 1773 |
# endif |
1774 |
#endif |
|
1775 |
%}. |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1776 |
^x @ y |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1777 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
1778 |
|
294 | 1779 |
!GLXWorkstation methodsFor:'clearing'! |
1780 |
||
1781 |
glxClearIn:aGLXWindowId |
|
1782 |
"clear to current color" |
|
1783 |
||
1784 |
%{ /* NOCONTEXT */ |
|
1785 |
SETWIN(aGLXWindowId) |
|
1932 | 1786 |
#ifdef OPENGL |
1787 |
#else |
|
294 | 1788 |
clear(); |
1932 | 1789 |
#endif |
294 | 1790 |
%} |
1791 |
! |
|
1792 |
||
1793 |
glxCzclearCval:cval zval:zval in:aGLXWindowId |
|
1794 |
"clear to a color (cval) and clear z buffer to zval simultaniously" |
|
1795 |
||
1796 |
%{ /* NOCONTEXT */ |
|
1932 | 1797 |
SETWIN(aGLXWindowId) |
1798 |
#ifdef OPENGL |
|
1799 |
#else |
|
1800 |
# ifdef GLX |
|
294 | 1801 |
czclear((ulong)__intVal(cval), __intVal(zval)); |
1932 | 1802 |
# endif |
1803 |
#endif |
|
1804 |
%} |
|
294 | 1805 |
! |
1806 |
||
1807 |
glxZClearIn:aGLXWindowId |
|
1808 |
"clear z buffer" |
|
1809 |
||
1810 |
%{ /* NOCONTEXT */ |
|
1932 | 1811 |
SETWIN(aGLXWindowId) |
1812 |
#ifdef OPENGL |
|
1813 |
#else |
|
1814 |
# ifdef GLX |
|
294 | 1815 |
zclear(); |
1932 | 1816 |
# endif |
1817 |
#endif |
|
1818 |
%} |
|
294 | 1819 |
! ! |
1820 |
||
1821 |
!GLXWorkstation methodsFor:'color'! |
|
1822 |
||
1823 |
glxColor:index in:aGLXWindowId |
|
4718 | 1824 |
"set the drawing color; |
1825 |
for non gouraud shading, we dont care if the argument is integer or float; |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1826 |
otherwise, better results are expected with float values." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1827 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1828 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1829 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1830 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1831 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1832 |
#else |
294 | 1833 |
if (__isSmallInteger(index)) { |
1834 |
color((Colorindex)(__intVal(index))); |
|
1932 | 1835 |
RETURN (self); |
294 | 1836 |
} |
1837 |
if (__isFloat(index)) { |
|
1838 |
colorf((float)(_floatVal(index))); |
|
1932 | 1839 |
RETURN (self); |
294 | 1840 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1841 |
#endif |
1932 | 1842 |
%} |
294 | 1843 |
! |
1844 |
||
1845 |
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
|
1846 |
"set the drawing color, including alpha value. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1847 |
The args must be integer values within 0..255" |
294 | 1848 |
|
1849 |
%{ /* NOCONTEXT */ |
|
1850 |
short s_r, s_g, s_b, s_a; |
|
1851 |
||
1852 |
_INT_(r, s_r); |
|
1853 |
_INT_(g, s_g); |
|
1854 |
_INT_(b, s_b); |
|
1855 |
_INT_(a, s_a); |
|
1856 |
SETWIN(aGLXWindowId) |
|
1932 | 1857 |
#ifdef GLX |
294 | 1858 |
cpack((((((s_a<<8) | s_b) << 8) | s_g) << 8) | s_r); |
1932 | 1859 |
#endif |
1860 |
%} |
|
294 | 1861 |
! |
1862 |
||
1863 |
glxColorRed:r green:g blue:b in:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1864 |
"set the drawing color. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1865 |
The args must be integer values in 0..255" |
294 | 1866 |
|
1867 |
%{ /* NOCONTEXT */ |
|
1868 |
short s_r, s_g, s_b; |
|
1869 |
||
1870 |
_INT_(r, s_r); |
|
1871 |
_INT_(g, s_g); |
|
1872 |
_INT_(b, s_b); |
|
1873 |
SETWIN(aGLXWindowId) |
|
1932 | 1874 |
#ifdef GLX |
294 | 1875 |
RGBcolor(s_r, s_g, s_b); |
1932 | 1876 |
#endif |
1877 |
%} |
|
294 | 1878 |
! |
1879 |
||
528 | 1880 |
glxLrgbrangeRmin: rmin gmin: gmin bmin: bmin rmax: rmax gmax: gmax bmax: bmax |
1881 |
znear: znear zfar: zfar in: aGLXWindowId |
|
1882 |
||
1883 |
%{ /* NOCONTEXT */ |
|
1932 | 1884 |
SETWIN(aGLXWindowId) |
1885 |
#ifdef GLX |
|
4718 | 1886 |
lRGBrange(_shortVal(rmin), _shortVal(gmin), _shortVal(bmin), |
1887 |
_shortVal(rmax), _shortVal(gmax), _shortVal(bmax), |
|
528 | 1888 |
_longVal(znear), _longVal(zfar)); |
1932 | 1889 |
#endif |
1890 |
%} |
|
528 | 1891 |
! |
1892 |
||
1893 |
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
|
1894 |
"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
|
1895 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1896 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1897 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1898 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1899 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1900 |
#else |
528 | 1901 |
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
|
1902 |
#endif |
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 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1905 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1906 |
glxTextcolor:tcolor in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1907 |
"change the color used for text drawing" |
294 | 1908 |
|
1909 |
%{ /* NOCONTEXT */ |
|
1932 | 1910 |
SETWIN(aGLXWindowId) |
1911 |
#ifdef GLX |
|
294 | 1912 |
textcolor(_colorindexVal(tcolor)); |
1932 | 1913 |
#endif |
1914 |
%} |
|
294 | 1915 |
! ! |
1916 |
||
528 | 1917 |
!GLXWorkstation methodsFor:'curves'! |
1918 |
||
1919 |
glxCurvebasis: basid in: aGLXWindowId |
|
1920 |
"sets the basis type of curves" |
|
1921 |
||
1922 |
%{ /* NOCONTEXT */ |
|
1923 |
SETWIN(aGLXWindowId) |
|
1932 | 1924 |
#ifdef GLX |
528 | 1925 |
curvebasis(_shortVal(basid)); |
1932 | 1926 |
#endif |
528 | 1927 |
%} |
1928 |
||
1929 |
"Modified: 19.3.1996 / 18:47:09 / cg" |
|
1930 |
! |
|
1931 |
||
1932 |
glxCurveit: iterationcount in: aGLXWindowId |
|
1933 |
"Iterates the top matrix on the stack as a forward difference |
|
1934 |
matrix, drawing as it goes along." |
|
1935 |
||
1936 |
%{ /* NOCONTEXT */ |
|
1937 |
SETWIN(aGLXWindowId) |
|
1932 | 1938 |
#ifdef GLX |
528 | 1939 |
curveit(_shortVal(iterationcount)); |
1932 | 1940 |
#endif |
528 | 1941 |
%} |
1942 |
||
1943 |
"Modified: 19.3.1996 / 18:48:57 / cg" |
|
1944 |
! |
|
1945 |
||
1946 |
glxCurveprecision: nsegments in: aGLXWindowId |
|
1947 |
"sets the number of line segments that make up a curve segment" |
|
1948 |
||
1949 |
%{ /* NOCONTEXT */ |
|
1950 |
SETWIN(aGLXWindowId) |
|
1932 | 1951 |
#ifdef GLX |
528 | 1952 |
curveprecision(_shortVal(nsegments)); |
1932 | 1953 |
#endif |
528 | 1954 |
%} |
1955 |
||
1956 |
"Modified: 19.3.1996 / 18:47:43 / cg" |
|
1957 |
! ! |
|
1958 |
||
294 | 1959 |
!GLXWorkstation methodsFor:'double buffering'! |
1960 |
||
1961 |
glxBackBufferIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1962 |
"switch to back buffer drawing - turning frontbuffer drawing off" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1963 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1964 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1965 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1966 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1967 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1968 |
# ifdef GLX |
294 | 1969 |
frontbuffer(FALSE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1970 |
# endif |
294 | 1971 |
backbuffer(TRUE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1972 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1973 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1974 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1975 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1976 |
glxBackbuffer:b in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1977 |
"turn backBuffer drawing on/off. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1978 |
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
|
1979 |
... enabling the backbuffer automatically disables frontbuffer drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1980 |
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
|
1981 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1982 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1983 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1984 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1985 |
#else |
294 | 1986 |
backbuffer(_booleanVal(b)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
1987 |
#endif |
294 | 1988 |
%} |
528 | 1989 |
|
1990 |
"Modified: 19.3.1996 / 18:45:05 / cg" |
|
294 | 1991 |
! |
1992 |
||
1993 |
glxDoubleBufferIn:aGLXWindowId |
|
1994 |
"set double buffer mode" |
|
1995 |
||
1996 |
%{ /* NOCONTEXT */ |
|
1997 |
SETWIN(aGLXWindowId) |
|
1932 | 1998 |
#ifdef OPENGL |
1999 |
#else |
|
294 | 2000 |
doublebuffer(); |
1932 | 2001 |
#endif |
294 | 2002 |
%} |
2003 |
! |
|
2004 |
||
2005 |
glxFrontBufferIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2006 |
"switch to front buffer drawing - turning backbuffer drawing off" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2007 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2008 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2009 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2010 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2011 |
#else |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2012 |
# ifdef GLX |
294 | 2013 |
backbuffer(FALSE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2014 |
# endif |
294 | 2015 |
frontbuffer(TRUE); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2016 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2017 |
%} |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2018 |
! |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2019 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2020 |
glxFrontbuffer:b in: aGLXWindowId |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2021 |
"turn on/off frontbuffer drawing. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2022 |
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
|
2023 |
... enabling the backbuffer automatically disables frontbuffer drawing |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2024 |
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
|
2025 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2026 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2027 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2028 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2029 |
#else |
294 | 2030 |
frontbuffer(_booleanVal(b)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2031 |
#endif |
294 | 2032 |
%} |
528 | 2033 |
|
2034 |
"Modified: 19.3.1996 / 18:45:31 / cg" |
|
294 | 2035 |
! |
2036 |
||
2037 |
glxSingleBufferIn: aGLXWindowId |
|
2038 |
"set single buffer mode" |
|
2039 |
||
2040 |
%{ /* NOCONTEXT */ |
|
2041 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2042 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2043 |
#else |
294 | 2044 |
singlebuffer(); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2045 |
#endif |
294 | 2046 |
%} |
2047 |
! |
|
2048 |
||
2049 |
glxSwapBuffersIn:aGLXWindowId |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2050 |
"swap the back and front buffers. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2051 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2052 |
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
|
2053 |
displayed and swap them for every frame." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2054 |
|
1903 | 2055 |
%{ /* UNLIMITEDSTACK */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2056 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2057 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2058 |
#else |
294 | 2059 |
swapbuffers(); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2060 |
#endif |
294 | 2061 |
%} |
528 | 2062 |
|
2063 |
"Modified: 19.3.1996 / 18:45:47 / cg" |
|
294 | 2064 |
! ! |
2065 |
||
2066 |
!GLXWorkstation methodsFor:'flat drawing'! |
|
2067 |
||
2068 |
glxBeginClosedLineIn:aGLXWindowId |
|
2069 |
"start a closed line" |
|
2070 |
||
2071 |
%{ /* NOCONTEXT */ |
|
1932 | 2072 |
#ifdef OPENGL |
2073 |
#else |
|
294 | 2074 |
SETWIN(aGLXWindowId) |
2075 |
bgnclosedline(); |
|
1932 | 2076 |
#endif |
294 | 2077 |
%} |
2078 |
! |
|
2079 |
||
2080 |
glxBeginLineIn:aGLXWindowId |
|
2081 |
"start a line group" |
|
2082 |
||
2075 | 2083 |
%{ /* NOCONTEXT STACK:32000 */ |
1932 | 2084 |
#ifdef OPENGL |
2085 |
#else |
|
294 | 2086 |
SETWIN(aGLXWindowId) |
2087 |
bgnline(); |
|
1932 | 2088 |
#endif |
294 | 2089 |
%} |
2090 |
! |
|
2091 |
||
2092 |
glxBeginPointIn:aGLXWindowId |
|
2093 |
"start a point-group" |
|
2094 |
||
2095 |
%{ /* NOCONTEXT */ |
|
1932 | 2096 |
#ifdef OPENGL |
2097 |
#else |
|
294 | 2098 |
SETWIN(aGLXWindowId) |
2099 |
bgnpoint(); |
|
1932 | 2100 |
#endif |
294 | 2101 |
%} |
2102 |
! |
|
2103 |
||
2104 |
glxBeginPolygonIn:aGLXWindowId |
|
2105 |
"start a polygon" |
|
2106 |
||
2107 |
%{ /* NOCONTEXT */ |
|
1932 | 2108 |
#ifdef OPENGL |
2109 |
#else |
|
294 | 2110 |
SETWIN(aGLXWindowId) |
2111 |
bgnpolygon(); |
|
1932 | 2112 |
#endif |
294 | 2113 |
%} |
2114 |
! |
|
2115 |
||
2116 |
glxBeginQuadrilateralStripIn:aGLXWindowId |
|
2117 |
"start a quadrilateral strip" |
|
2118 |
||
2119 |
%{ /* NOCONTEXT */ |
|
1932 | 2120 |
#ifdef OPENGL |
2121 |
#else |
|
294 | 2122 |
SETWIN(aGLXWindowId) |
2123 |
bgnqstrip(); |
|
1932 | 2124 |
#endif |
294 | 2125 |
%} |
2126 |
! |
|
2127 |
||
2128 |
glxBeginTriangleMeshIn:aGLXWindowId |
|
2129 |
"start a triangle mesh" |
|
2130 |
||
2131 |
%{ /* NOCONTEXT */ |
|
1932 | 2132 |
#ifdef OPENGL |
2133 |
#else |
|
294 | 2134 |
SETWIN(aGLXWindowId) |
2135 |
bgntmesh(); |
|
1932 | 2136 |
#endif |
294 | 2137 |
%} |
2138 |
! |
|
2139 |
||
2140 |
glxEndClosedLineIn:aGLXWindowId |
|
2141 |
"end a closed line" |
|
2142 |
||
2143 |
%{ /* NOCONTEXT */ |
|
1932 | 2144 |
#ifdef OPENGL |
2145 |
#else |
|
294 | 2146 |
SETWIN(aGLXWindowId) |
2147 |
endclosedline(); |
|
1932 | 2148 |
#endif |
294 | 2149 |
%} |
2150 |
! |
|
2151 |
||
2152 |
glxEndLineIn:aGLXWindowId |
|
2153 |
"end a line group" |
|
2154 |
||
2075 | 2155 |
%{ /* NOCONTEXT STACK:32000 */ |
1932 | 2156 |
#ifdef OPENGL |
2157 |
#else |
|
294 | 2158 |
SETWIN(aGLXWindowId) |
2159 |
endline(); |
|
1932 | 2160 |
#endif |
294 | 2161 |
%} |
2162 |
! |
|
2163 |
||
2164 |
glxEndPointIn:aGLXWindowId |
|
2165 |
"end a point group" |
|
2166 |
||
2167 |
%{ /* NOCONTEXT */ |
|
1932 | 2168 |
#ifdef OPENGL |
2169 |
#else |
|
294 | 2170 |
SETWIN(aGLXWindowId) |
2171 |
endpoint(); |
|
1932 | 2172 |
#endif |
294 | 2173 |
%} |
2174 |
! |
|
2175 |
||
2176 |
glxEndPolygonIn:aGLXWindowId |
|
2177 |
"end a polygon" |
|
2178 |
||
2179 |
%{ /* NOCONTEXT */ |
|
1932 | 2180 |
#ifdef OPENGL |
2181 |
#else |
|
294 | 2182 |
SETWIN(aGLXWindowId) |
2183 |
endpolygon(); |
|
1932 | 2184 |
#endif |
294 | 2185 |
%} |
2186 |
! |
|
2187 |
||
2188 |
glxEndQuadrilateralStripIn:aGLXWindowId |
|
2189 |
"end a quadrilateral strip" |
|
2190 |
||
2191 |
%{ /* NOCONTEXT */ |
|
1932 | 2192 |
#ifdef OPENGL |
2193 |
#else |
|
294 | 2194 |
SETWIN(aGLXWindowId) |
2195 |
endqstrip(); |
|
1932 | 2196 |
#endif |
294 | 2197 |
%} |
2198 |
! |
|
2199 |
||
2200 |
glxEndTriangleMeshIn:aGLXWindowId |
|
2201 |
"end a triangle mesh" |
|
2202 |
||
2203 |
%{ /* NOCONTEXT */ |
|
1932 | 2204 |
#ifdef OPENGL |
2205 |
#else |
|
294 | 2206 |
SETWIN(aGLXWindowId) |
2207 |
endtmesh(); |
|
1932 | 2208 |
#endif |
168 | 2209 |
%} |
2210 |
! ! |
|
2211 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2212 |
!GLXWorkstation methodsFor:'graphics position'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2213 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2214 |
glxMove2:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2215 |
"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
|
2216 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2217 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2218 |
float vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2219 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2220 |
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
|
2221 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2222 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2223 |
#else |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2224 |
move2((Coord)(c_v[0]), (Coord)(c_v[1])); |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2225 |
RETURN (true); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2226 |
#endif |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2227 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2228 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2229 |
"Modified: 22.3.1996 / 18:15:23 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2230 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2231 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2232 |
glxMove2X: x y: y in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2233 |
"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
|
2234 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2235 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2236 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2237 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2238 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2239 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2240 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2241 |
SETWIN(aGLXWindowId) |
1932 | 2242 |
#ifdef OPENGL |
2243 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2244 |
move2(c_x, c_y); |
1932 | 2245 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2246 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2247 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2248 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2249 |
"Modified: 22.3.1996 / 18:15:02 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2250 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2251 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2252 |
glxMove2iX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2253 |
"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
|
2254 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2255 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2256 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2257 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2258 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2259 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2260 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2261 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2262 |
SETWIN(aGLXWindowId) |
1932 | 2263 |
#ifdef OPENGL |
2264 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2265 |
move2i(c_x, c_y); |
1932 | 2266 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2267 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2268 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2269 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2270 |
"Modified: 22.3.1996 / 18:15:08 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2271 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2272 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2273 |
glxMove2sX: x y: y in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2274 |
"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
|
2275 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2276 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2277 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2278 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2279 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2280 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2281 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2282 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2283 |
SETWIN(aGLXWindowId) |
1932 | 2284 |
#ifdef OPENGL |
2285 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2286 |
move2s(c_x, c_y); |
1932 | 2287 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2288 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2289 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2290 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2291 |
"Modified: 22.3.1996 / 18:15:13 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2292 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2293 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2294 |
glxMove:v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2295 |
"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
|
2296 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2297 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2298 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2299 |
float vec[3], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2300 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2301 |
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
|
2302 |
SETWIN(aGLXWindowId) |
1932 | 2303 |
#ifdef OPENGL |
2304 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2305 |
move((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
1932 | 2306 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2307 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2308 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2309 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2310 |
"Modified: 22.3.1996 / 18:14:29 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2311 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2312 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2313 |
glxMoveX: x y: y z: z in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2314 |
"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
|
2315 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2316 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2317 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2318 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2319 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2320 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2321 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2322 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2323 |
SETWIN(aGLXWindowId) |
1932 | 2324 |
#ifdef OPENGL |
2325 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2326 |
move(c_x, c_y, c_z); |
1932 | 2327 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2328 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2329 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2330 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2331 |
"Modified: 22.3.1996 / 18:14:38 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2332 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2333 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2334 |
glxMoveiX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2335 |
"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
|
2336 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2337 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2338 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2339 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2340 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2341 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2342 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2343 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2344 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2345 |
SETWIN(aGLXWindowId) |
1932 | 2346 |
#ifdef OPENGL |
2347 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2348 |
movei(c_x, c_y, c_z); |
1932 | 2349 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2350 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2351 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2352 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2353 |
"Modified: 22.3.1996 / 18:14:44 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2354 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2355 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2356 |
glxMovesX: x y: y z: z in: aGLXWindowId |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2357 |
"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
|
2358 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2359 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2360 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2361 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2362 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2363 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2364 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2365 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2366 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2367 |
SETWIN(aGLXWindowId) |
1932 | 2368 |
#ifdef OPENGL |
2369 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2370 |
moves(c_x, c_y, c_z); |
1932 | 2371 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2372 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2373 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2374 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2375 |
"Modified: 22.3.1996 / 18:14:48 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2376 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2377 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2378 |
glxRmv2:v in: aGLXWindowId |
4718 | 2379 |
"change the graphics position to a 2D point, |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2380 |
the relative distance is passed in vector v" |
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 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2383 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2384 |
float vec[2], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2385 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2386 |
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
|
2387 |
SETWIN(aGLXWindowId) |
1932 | 2388 |
#ifdef OPENGL |
2389 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2390 |
rmv2((Coord)(c_v[0]), (Coord)(c_v[1])); |
1932 | 2391 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2392 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2393 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2394 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2395 |
"Modified: 22.3.1996 / 18:15:57 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2396 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2397 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2398 |
glxRmv2X: x y: y in: aGLXWindowId |
4718 | 2399 |
"change the graphics position to a 2D point, |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2400 |
the relative distance is passed in x/y" |
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 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2403 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2404 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2405 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2406 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2407 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2408 |
SETWIN(aGLXWindowId) |
1932 | 2409 |
#ifdef OPENGL |
2410 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2411 |
rmv2(c_x, c_y); |
1932 | 2412 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2413 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2414 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2415 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2416 |
"Modified: 22.3.1996 / 18:16:42 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2417 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2418 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2419 |
glxRmv2iX: x y: y in: aGLXWindowId |
4718 | 2420 |
"change the graphics position to a 2D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2421 |
the relative distance is passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2422 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2423 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2424 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2425 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2426 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2427 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2428 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2429 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2430 |
SETWIN(aGLXWindowId) |
1932 | 2431 |
#ifdef OPENGL |
2432 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2433 |
rmv2i(c_x, c_y); |
1932 | 2434 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2435 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2436 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2437 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2438 |
"Modified: 22.3.1996 / 18:16:39 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2439 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2440 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2441 |
glxRmv2sX: x y: y in: aGLXWindowId |
4718 | 2442 |
"change the graphics position to a 2D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2443 |
the relative distance is passed in x/y. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2444 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2445 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2446 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2447 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2448 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2449 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2450 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2451 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2452 |
SETWIN(aGLXWindowId) |
1932 | 2453 |
#ifdef OPENGL |
2454 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2455 |
rmv2s(c_x, c_y); |
1932 | 2456 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2457 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2458 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2459 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2460 |
"Modified: 22.3.1996 / 18:16:33 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2461 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2462 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2463 |
glxRmv:v in: aGLXWindowId |
4718 | 2464 |
"change the graphics position to a 3D point, |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2465 |
the relative distance is passed in vector v" |
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 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2468 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2469 |
float vec[3], *c_v; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2470 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2471 |
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
|
2472 |
SETWIN(aGLXWindowId) |
1932 | 2473 |
#ifdef OPENGL |
2474 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2475 |
rmv((Coord)(c_v[0]), (Coord)(c_v[1]), (Coord)(c_v[2])); |
1932 | 2476 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2477 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2478 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2479 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2480 |
"Modified: 22.3.1996 / 18:16:08 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2481 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2482 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2483 |
glxRmvX: x y: y z: z in: aGLXWindowId |
4718 | 2484 |
"change the graphics position to a 3D point, |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2485 |
the relative distance is passed in x/y/z" |
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 |
%{ /* NOCONTEXT */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2488 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2489 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2490 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2491 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2492 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2493 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2494 |
SETWIN(aGLXWindowId) |
1932 | 2495 |
#ifdef OPENGL |
2496 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2497 |
rmv(c_x, c_y, c_z); |
1932 | 2498 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2499 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2500 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2501 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2502 |
"Modified: 22.3.1996 / 18:16:16 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2503 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2504 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2505 |
glxRmviX: x y: y z: z in: aGLXWindowId |
4718 | 2506 |
"change the graphics position to a 3D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2507 |
the relative distance is passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2508 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2509 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2510 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2511 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2512 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2513 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2514 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2515 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2516 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2517 |
SETWIN(aGLXWindowId) |
1932 | 2518 |
#ifdef OPENGL |
2519 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2520 |
rmvi(c_x, c_y, c_z); |
1932 | 2521 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2522 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2523 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2524 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2525 |
"Modified: 22.3.1996 / 18:16:21 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2526 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2527 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2528 |
glxRmvsX: x y: y z: z in: aGLXWindowId |
4718 | 2529 |
"change the graphics position to a 3D point, |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2530 |
the relative distance is passed in x/y/z. |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2531 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2532 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2533 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2534 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2535 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2536 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2537 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2538 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2539 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2540 |
SETWIN(aGLXWindowId) |
1932 | 2541 |
#ifdef OPENGL |
2542 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2543 |
rmvs(c_x, c_y, c_z); |
1932 | 2544 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2545 |
} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2546 |
%} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2547 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2548 |
"Modified: 22.3.1996 / 18:16:25 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2549 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2550 |
|
168 | 2551 |
!GLXWorkstation methodsFor:'initialization'! |
2552 |
||
2553 |
initializeFor:aDisplayName |
|
169 | 2554 |
(super initializeFor:aDisplayName) isNil ifTrue:[^ nil]. |
168 | 2555 |
%{ |
2556 |
if (_INST(displayId) != nil) { |
|
185 | 2557 |
XSetErrorHandler(__XErrorHandler__); |
2558 |
} |
|
2559 |
%} |
|
2560 |
! |
|
2561 |
||
2562 |
initializeScreenProperties |
|
2563 |
super initializeScreenProperties. |
|
2564 |
||
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2565 |
"/ 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
|
2566 |
"/ 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
|
2567 |
"/ 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
|
2568 |
"/ 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
|
2569 |
"/ 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
|
2570 |
"/ 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
|
2571 |
"/ 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
|
2572 |
"/ have no documentation). |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2573 |
"/ Late note: setting the ForceGL classVar overrides above behavior. |
4718 | 2574 |
"/ it may be set from a startupScript with: 'GLXWorkstation forceGL:true' |
2575 |
"/ 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
|
2576 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2577 |
(self isTrueGL and:[ForceGL ~~ true]) ifTrue:[ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2578 |
glOK := (displayName = ':0') or:[displayName = ':0.0']. |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2579 |
] ifFalse:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2580 |
glOK := true. |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2581 |
]. |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
2582 |
|
185 | 2583 |
%{ |
2584 |
Display *dpy = myDpy; |
|
2585 |
int dummy; |
|
2586 |
||
2587 |
if (ISCONNECTED) { |
|
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2588 |
_INST(hasStereoExtension) = false; |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
2589 |
|
1932 | 2590 |
#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
|
2591 |
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
|
2592 |
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
|
2593 |
_INST(hasStereoExtension) = true; |
290
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2594 |
} |
f9397ade6677
fix for sgi - need displayName to be set for initScreenProps
Claus Gittinger <cg@exept.de>
parents:
268
diff
changeset
|
2595 |
#endif |
168 | 2596 |
} |
2597 |
%} |
|
2598 |
! ! |
|
2599 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2600 |
!GLXWorkstation methodsFor:'lines'! |
528 | 2601 |
|
2602 |
glxDeflinestyleN: n ls: ls in: aGLXWindowId |
|
2603 |
"define a line style" |
|
2604 |
||
2605 |
%{ /* NOCONTEXT */ |
|
1932 | 2606 |
SETWIN(aGLXWindowId) |
2607 |
#ifdef OPENGL |
|
2608 |
#else |
|
528 | 2609 |
deflinestyle(_shortVal(n), _linestyleVal(ls)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2610 |
#endif |
528 | 2611 |
%} |
2612 |
! |
|
2613 |
||
2614 |
glxDraw2:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2615 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2616 |
to a new 2D position, passed in vector v." |
528 | 2617 |
|
2618 |
%{ /* NOCONTEXT */ |
|
2619 |
float vec[2], *c_v; |
|
2620 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2621 |
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
|
2622 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2623 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2624 |
#else |
528 | 2625 |
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
|
2626 |
#endif |
528 | 2627 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2628 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2629 |
"Modified: 22.3.1996 / 18:03:29 / cg" |
528 | 2630 |
! |
2631 |
||
2632 |
glxDraw2X: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2633 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2634 |
to a new 2D position, passed in x/y." |
528 | 2635 |
|
2636 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2637 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2638 |
Coord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2639 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2640 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2641 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2642 |
SETWIN(aGLXWindowId) |
1932 | 2643 |
#ifdef OPENGL |
2644 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2645 |
draw2(c_x, c_y); |
1932 | 2646 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2647 |
} |
528 | 2648 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2649 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2650 |
"Modified: 22.3.1996 / 18:03:50 / cg" |
528 | 2651 |
! |
2652 |
||
2653 |
glxDraw2iX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2654 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2655 |
to a new 2D position, passed in x/y." |
528 | 2656 |
|
2657 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2658 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2659 |
Icoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2660 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2661 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2662 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2663 |
SETWIN(aGLXWindowId) |
1932 | 2664 |
#ifdef OPENGL |
2665 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2666 |
draw2i(c_x, c_y); |
1932 | 2667 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2668 |
} |
528 | 2669 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2670 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2671 |
"Modified: 22.3.1996 / 18:04:07 / cg" |
528 | 2672 |
! |
2673 |
||
2674 |
glxDraw2sX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2675 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2676 |
to a new 2D position, passed in x/y." |
528 | 2677 |
|
2678 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2679 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2680 |
Scoord c_x, c_y; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2681 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2682 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2683 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2684 |
SETWIN(aGLXWindowId) |
1932 | 2685 |
#ifdef OPENGL |
2686 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2687 |
draw2s(c_x, c_y); |
1932 | 2688 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2689 |
} |
528 | 2690 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2691 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2692 |
"Modified: 22.3.1996 / 18:04:19 / cg" |
528 | 2693 |
! |
2694 |
||
2695 |
glxDraw:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2696 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2697 |
to a new 3D position, passed in vector v." |
528 | 2698 |
|
2699 |
%{ /* NOCONTEXT */ |
|
2700 |
float vec[3], *c_v; |
|
2701 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2702 |
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
|
2703 |
SETWIN(aGLXWindowId) |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2704 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2705 |
#else |
528 | 2706 |
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
|
2707 |
#endif |
528 | 2708 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2709 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2710 |
"Modified: 22.3.1996 / 18:04:34 / cg" |
528 | 2711 |
! |
2712 |
||
2713 |
glxDrawX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2714 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2715 |
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
|
2716 |
The arguments may be floats, fractions or smallIntegers" |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2717 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2718 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2719 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2720 |
Coord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2721 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2722 |
_COORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2723 |
_COORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2724 |
_COORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2725 |
SETWIN(aGLXWindowId) |
1932 | 2726 |
#ifdef OPENGL |
2727 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2728 |
draw(c_x, c_y, c_z); |
1932 | 2729 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2730 |
} |
528 | 2731 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2732 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2733 |
"Modified: 22.3.1996 / 18:04:46 / cg" |
528 | 2734 |
! |
2735 |
||
2736 |
glxDrawiX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2737 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2738 |
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
|
2739 |
The arguments must be smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2740 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2741 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2742 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2743 |
Icoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2744 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2745 |
_ICOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2746 |
_ICOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2747 |
_ICOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2748 |
SETWIN(aGLXWindowId) |
1932 | 2749 |
#ifdef OPENGL |
2750 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2751 |
drawi(c_x, c_y, c_z); |
1932 | 2752 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2753 |
} |
528 | 2754 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2755 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2756 |
"Modified: 22.3.1996 / 18:04:54 / cg" |
528 | 2757 |
! |
2758 |
||
2759 |
glxDrawsX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2760 |
"draw a line from the current graphics position |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2761 |
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
|
2762 |
The arguments must be (16bit) smallIntegers." |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2763 |
|
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2764 |
%{ /* NOCONTEXT */ |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2765 |
{ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2766 |
Scoord c_x, c_y, c_z; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2767 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2768 |
_SCOORD_ (x, c_x) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2769 |
_SCOORD_ (y, c_y) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2770 |
_SCOORD_ (z, c_z) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2771 |
SETWIN(aGLXWindowId) |
1932 | 2772 |
#ifdef OPENGL |
2773 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
2774 |
draws(c_x, c_y, c_z); |
1932 | 2775 |
#endif |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2776 |
} |
528 | 2777 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2778 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2779 |
"Modified: 22.3.1996 / 18:05:01 / cg" |
528 | 2780 |
! |
2781 |
||
2782 |
glxLinewidth: n in: aGLXWindowId |
|
2783 |
"set the linewidth" |
|
2784 |
||
2785 |
%{ /* NOCONTEXT */ |
|
2786 |
SETWIN(aGLXWindowId) |
|
1932 | 2787 |
#ifdef OPENGL |
2788 |
#else |
|
528 | 2789 |
linewidth(_shortVal(n)); |
1932 | 2790 |
#endif |
528 | 2791 |
%} |
2792 |
! |
|
2793 |
||
2794 |
glxLinewidthf: n in: aGLXWindowId |
|
2795 |
"set the linewidth" |
|
2796 |
||
2797 |
%{ /* NOCONTEXT */ |
|
2798 |
SETWIN(aGLXWindowId) |
|
1932 | 2799 |
#ifdef OPENGL |
2800 |
#else |
|
528 | 2801 |
linewidthf(_floatVal(n)); |
1932 | 2802 |
#endif |
528 | 2803 |
RETURN (true); |
2804 |
%} |
|
2805 |
! |
|
2806 |
||
2807 |
glxRdr2:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2808 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2809 |
to a new 2D position, passing the relative distance in the vector v." |
528 | 2810 |
|
2811 |
%{ /* NOCONTEXT */ |
|
2812 |
float vec[2], *c_v; |
|
2813 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2814 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
528 | 2815 |
SETWIN(aGLXWindowId) |
1932 | 2816 |
#ifdef OPENGL |
2817 |
#else |
|
528 | 2818 |
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
|
2819 |
#endif |
528 | 2820 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2821 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2822 |
"Modified: 22.3.1996 / 18:05:54 / cg" |
528 | 2823 |
! |
2824 |
||
2825 |
glxRdr2X: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2826 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2827 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2828 |
|
2829 |
%{ /* NOCONTEXT */ |
|
2830 |
Coord c_x, c_y; |
|
2831 |
||
2832 |
_COORD_ (x, c_x) |
|
2833 |
_COORD_ (y, c_y) |
|
2834 |
SETWIN(aGLXWindowId) |
|
1932 | 2835 |
#ifdef OPENGL |
2836 |
#else |
|
528 | 2837 |
rdr2(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2838 |
#endif |
528 | 2839 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2840 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2841 |
"Modified: 22.3.1996 / 18:06:20 / cg" |
528 | 2842 |
! |
2843 |
||
2844 |
glxRdr2iX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2845 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2846 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2847 |
|
2848 |
%{ /* NOCONTEXT */ |
|
2849 |
Icoord c_x, c_y; |
|
2850 |
||
2851 |
_ICOORD_ (x, c_x) |
|
2852 |
_ICOORD_ (y, c_y) |
|
2853 |
SETWIN(aGLXWindowId) |
|
1932 | 2854 |
#ifdef OPENGL |
2855 |
#else |
|
528 | 2856 |
rdr2i(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2857 |
#endif |
528 | 2858 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2859 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2860 |
"Modified: 22.3.1996 / 18:06:28 / cg" |
528 | 2861 |
! |
2862 |
||
2863 |
glxRdr2sX: x y: y in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2864 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2865 |
to a new 2D position, passing the relative distance in x/y." |
528 | 2866 |
|
2867 |
%{ /* NOCONTEXT */ |
|
2868 |
Scoord c_x, c_y; |
|
2869 |
||
2870 |
_SCOORD_ (x, c_x) |
|
2871 |
_SCOORD_ (y, c_y) |
|
2872 |
SETWIN(aGLXWindowId) |
|
1932 | 2873 |
#ifdef OPENGL |
2874 |
#else |
|
528 | 2875 |
rdr2s(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2876 |
#endif |
528 | 2877 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2878 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2879 |
"Modified: 22.3.1996 / 18:06:34 / cg" |
528 | 2880 |
! |
2881 |
||
2882 |
glxRdr:v in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2883 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2884 |
to a new 3D position, passing the relative distance in the vector v." |
528 | 2885 |
|
2886 |
%{ /* NOCONTEXT */ |
|
2887 |
float vec[3], *c_v; |
|
2888 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2889 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
528 | 2890 |
SETWIN(aGLXWindowId) |
1932 | 2891 |
#ifdef OPENGL |
2892 |
#else |
|
528 | 2893 |
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
|
2894 |
#endif |
528 | 2895 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2896 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2897 |
"Modified: 22.3.1996 / 18:06:07 / cg" |
528 | 2898 |
! |
2899 |
||
2900 |
glxRdrX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2901 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2902 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2903 |
|
2904 |
%{ /* NOCONTEXT */ |
|
2905 |
Coord c_x, c_y, c_z; |
|
2906 |
||
2907 |
_COORD_ (x, c_x) |
|
2908 |
_COORD_ (y, c_y) |
|
2909 |
_COORD_ (z, c_z) |
|
2910 |
SETWIN(aGLXWindowId) |
|
1932 | 2911 |
#ifdef OPENGL |
2912 |
#else |
|
528 | 2913 |
rdr(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2914 |
#endif |
528 | 2915 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2916 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2917 |
"Modified: 22.3.1996 / 18:06:44 / cg" |
528 | 2918 |
! |
2919 |
||
2920 |
glxRdriX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2921 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2922 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2923 |
|
2924 |
%{ /* NOCONTEXT */ |
|
2925 |
Icoord c_x, c_y, c_z; |
|
2926 |
||
2927 |
_ICOORD_ (x, c_x) |
|
2928 |
_ICOORD_ (y, c_y) |
|
2929 |
_ICOORD_ (z, c_z) |
|
2930 |
SETWIN(aGLXWindowId) |
|
1932 | 2931 |
#ifdef OPENGL |
2932 |
#else |
|
528 | 2933 |
rdri(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2934 |
#endif |
528 | 2935 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2936 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2937 |
"Modified: 22.3.1996 / 18:06:51 / cg" |
528 | 2938 |
! |
2939 |
||
2940 |
glxRdrsX: x y: y z: z in: aGLXWindowId |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2941 |
"draw a line from the current graphics position |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2942 |
to a new 3D position, passing the relative distance in x/y/z." |
528 | 2943 |
|
2944 |
%{ /* NOCONTEXT */ |
|
2945 |
Scoord c_x, c_y, c_z; |
|
2946 |
||
2947 |
_SCOORD_ (x, c_x) |
|
2948 |
_SCOORD_ (y, c_y) |
|
2949 |
_SCOORD_ (z, c_z) |
|
2950 |
SETWIN(aGLXWindowId) |
|
1932 | 2951 |
#ifdef OPENGL |
2952 |
#else |
|
528 | 2953 |
rdrs(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
2954 |
#endif |
528 | 2955 |
%} |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2956 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
2957 |
"Modified: 22.3.1996 / 18:06:55 / cg" |
528 | 2958 |
! |
2959 |
||
2960 |
glxSetlinestyle: index in: aGLXWindowId |
|
2961 |
"set the linestyle" |
|
2962 |
||
2963 |
%{ /* NOCONTEXT */ |
|
2964 |
SETWIN(aGLXWindowId) |
|
1932 | 2965 |
#ifdef OPENGL |
2966 |
#else |
|
528 | 2967 |
setlinestyle(_shortVal(index)); |
1932 | 2968 |
#endif |
2969 |
%} |
|
528 | 2970 |
! ! |
2971 |
||
294 | 2972 |
!GLXWorkstation methodsFor:'materials & lights'! |
2973 |
||
2974 |
glxLmbind:target index:index in:aGLXWindowId |
|
2975 |
"select a material, light or lighting model. |
|
2976 |
target must be a symbol from: #material, #backMaterial, |
|
2977 |
#light0-light7 or #lightModel." |
|
2978 |
||
2979 |
%{ /* NOCONTEXT */ |
|
2980 |
#ifdef GLX |
|
2981 |
short defType; |
|
2982 |
short i_index; |
|
2983 |
||
2984 |
if (target == @symbol(material)) |
|
2985 |
defType = MATERIAL; |
|
2986 |
else if (target == @symbol(backMaterial)) |
|
2987 |
defType = BACKMATERIAL; |
|
2988 |
else if (target == @symbol(light0)) |
|
2989 |
defType = LIGHT0; |
|
2990 |
else if (target == @symbol(light1)) |
|
2991 |
defType = LIGHT1; |
|
2992 |
else if (target == @symbol(light2)) |
|
2993 |
defType = LIGHT2; |
|
2994 |
else if (target == @symbol(light3)) |
|
2995 |
defType = LIGHT3; |
|
2996 |
else if (target == @symbol(light4)) |
|
2997 |
defType = LIGHT4; |
|
2998 |
else if (target == @symbol(light5)) |
|
2999 |
defType = LIGHT5; |
|
3000 |
else if (target == @symbol(light6)) |
|
3001 |
defType = LIGHT6; |
|
3002 |
else if (target == @symbol(light7)) |
|
3003 |
defType = LIGHT7; |
|
3004 |
else if (target == @symbol(lightModel)) |
|
3005 |
defType = LMODEL; |
|
4718 | 3006 |
else { |
3007 |
RETURN (nil); |
|
294 | 3008 |
} |
3009 |
||
3010 |
_INT_ (index, i_index); |
|
3011 |
SETWIN(aGLXWindowId) |
|
3012 |
lmbind(defType, i_index); |
|
1932 | 3013 |
#endif |
3014 |
%} |
|
294 | 3015 |
! |
3016 |
||
3017 |
glxLmdef:what index:index np:np props:props in:aGLXWindowId |
|
3018 |
"define a material, light source or lighting model; |
|
3019 |
what must be one of #material, #light or #lightModel. |
|
3020 |
props must be a FloatArray or a subclass of FloatArray" |
|
3021 |
||
3022 |
%{ /* NOCONTEXT */ |
|
3023 |
#ifdef GLX |
|
3024 |
short defType; |
|
3025 |
short i_index, i_np; |
|
3026 |
float *fp; |
|
3027 |
OBJ cls; |
|
3028 |
int ninstVars, nInstBytes; |
|
3029 |
||
3030 |
if (what == @symbol(material)) |
|
3031 |
defType = DEFMATERIAL; |
|
3032 |
else if (what == @symbol(light)) |
|
3033 |
defType = DEFLIGHT; |
|
3034 |
else if (what == @symbol(lightModel)) |
|
3035 |
defType = DEFLMODEL; |
|
3036 |
else { |
|
1932 | 3037 |
RETURN (nil); |
294 | 3038 |
} |
3039 |
||
3040 |
_INT_ (index, i_index); |
|
3041 |
_INT_ (np, i_np); |
|
3042 |
||
3043 |
if (! _isNonNilObject(props)) fp = NULL; |
|
3044 |
else { |
|
3045 |
cls = __qClass(props); |
|
350 | 3046 |
if (cls == @global(FloatArray)) |
294 | 3047 |
fp = _FloatArrayInstPtr(props)->f_element; |
3048 |
else { |
|
3049 |
if ((__intVal(_ClassInstPtr(cls)->c_flags) & ARRAYMASK) == FLOATARRAY) { |
|
3050 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
3051 |
fp = (float *) &(_InstPtr(props)->i_instvars[ninstVars]); |
|
3052 |
} else { |
|
1932 | 3053 |
RETURN (nil); |
294 | 3054 |
} |
4718 | 3055 |
} |
294 | 3056 |
} |
3057 |
SETWIN(aGLXWindowId) |
|
3058 |
lmdef(defType, i_index, i_np, fp); |
|
1932 | 3059 |
#endif |
3060 |
%} |
|
294 | 3061 |
! |
3062 |
||
3063 |
glxTevbind:target index:index in:aGLXWindowId |
|
3064 |
"bind a texture environment; target must be 0 |
|
3065 |
or the symbol #env0." |
|
3066 |
||
3067 |
%{ /* NOCONTEXT */ |
|
3068 |
#ifdef GLX |
|
3069 |
long t; |
|
3070 |
||
3071 |
if (__isSmallInteger(target)) { |
|
3072 |
t = __intVal(target); |
|
3073 |
} else { |
|
3074 |
if (target == @symbol(env0)) { |
|
3075 |
t = TV_ENV0; |
|
3076 |
} else { |
|
1932 | 3077 |
RETURN (nil); |
294 | 3078 |
} |
3079 |
} |
|
3080 |
SETWIN(aGLXWindowId) |
|
3081 |
tevbind(t, __intVal(index)); |
|
1932 | 3082 |
#endif |
3083 |
%} |
|
294 | 3084 |
! |
3085 |
||
3086 |
glxTevdef:index np:np props:props in:aGLXWindowId |
|
3087 |
||
3088 |
%{ /* NOCONTEXT */ |
|
3089 |
#ifdef GLX |
|
3090 |
const float *fp; |
|
3091 |
float fbuff[30]; |
|
3092 |
||
3093 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3094 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
294 | 3095 |
tevdef(__intVal(index), __intVal(np), fp); |
1932 | 3096 |
#endif |
3097 |
%} |
|
294 | 3098 |
! |
3099 |
||
3100 |
glxTexDef2d:index nc:nc width:w height:h bits:image np:np props:props in:aGLXWindowId |
|
3101 |
"define a 2D texture. index is the 'name' of the texture; |
|
3102 |
nc is the number of components (1-4) per pixel; |
|
3103 |
w/h define the size of the texture; bits is a byteArray containing the |
|
3104 |
long-word aligned pixel data; np is the number of props found in |
|
3105 |
the floatArray props. Props must be delimited by a 0.0 entry." |
|
3106 |
||
3107 |
%{ /* NOCONTEXT */ |
|
6254 | 3108 |
#ifdef GLX |
294 | 3109 |
unsigned char *cp; |
3110 |
const float *fp; |
|
3111 |
OBJ cls; |
|
3112 |
float fbuff[30]; |
|
3113 |
||
5479
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3114 |
if (__isByteArrayLike(image)) { |
6254 | 3115 |
cp = _ByteArrayInstPtr(image)->ba_element; |
3116 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
|
3117 |
||
3118 |
SETWIN(aGLXWindowId) |
|
3119 |
texdef2d(__intVal(index), __intVal(nc), __intVal(w), __intVal(h), |
|
3120 |
(const unsigned long *)cp, __intVal(np), fp); |
|
294 | 3121 |
} |
3122 |
#endif |
|
3123 |
%} |
|
3124 |
! |
|
3125 |
||
3126 |
glxTexDef3d:index nc:nc width:w height:h depth:d bits:image np:np props:props in:aGLXWindowId |
|
3127 |
"define a 3D texture. index is the 'name' of the texture; |
|
3128 |
nc is the number of components (1-4) per pixel; |
|
3129 |
w/h/d define the size of the texture; bits is a byteArray containing the |
|
3130 |
long-word aligned pixel data; np is the number of props found in |
|
3131 |
the floatArray props. Props must be delimited by a 0.0 entry." |
|
3132 |
||
3133 |
%{ /* NOCONTEXT */ |
|
3134 |
#ifdef GLX |
|
3135 |
unsigned char *cp; |
|
3136 |
const float *fp; |
|
3137 |
OBJ cls; |
|
3138 |
float fbuff[30]; |
|
3139 |
||
5479
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
3140 |
if (__isByteArrayLike(image)) { |
6254 | 3141 |
cp = _ByteArrayInstPtr(image)->ba_element; |
3142 |
fp = __glx_getFloatsFromFloatArrayInto(props, fbuff); |
|
3143 |
||
3144 |
SETWIN(aGLXWindowId) |
|
3145 |
texdef3d(__intVal(index), __intVal(nc), __intVal(w), __intVal(h), |
|
3146 |
__intVal(d), |
|
3147 |
(const unsigned long *)cp, __intVal(np), fp); |
|
294 | 3148 |
} |
3149 |
#endif |
|
3150 |
%} |
|
3151 |
! |
|
3152 |
||
3153 |
glxTexbind:target index:index in:aGLXWindowId |
|
3154 |
"bind a texture; target must be an integer or one |
|
3155 |
of the symbols #texture0, #textureDetail or #textureIdle." |
|
3156 |
||
3157 |
%{ /* NOCONTEXT */ |
|
3158 |
#ifdef GLX |
|
3159 |
long t; |
|
3160 |
||
3161 |
if (__isSmallInteger(target)) { |
|
3162 |
t = __intVal(target); |
|
3163 |
} else { |
|
3164 |
if (target == @symbol(texture0)) { |
|
3165 |
t = TX_TEXTURE_0; |
|
3166 |
} else if (target == @symbol(textureDetail)) { |
|
3167 |
t = TX_TEXTURE_DETAIL; |
|
3168 |
} else if (target == @symbol(textureIdle)) { |
|
3169 |
t = TX_TEXTURE_IDLE; |
|
3170 |
} else { |
|
1932 | 3171 |
RETURN (nil); |
294 | 3172 |
} |
3173 |
} |
|
3174 |
SETWIN(aGLXWindowId) |
|
3175 |
texbind(t, __intVal(index)); |
|
1932 | 3176 |
#endif |
3177 |
%} |
|
294 | 3178 |
! ! |
3179 |
||
3180 |
!GLXWorkstation methodsFor:'matrix stack'! |
|
3181 |
||
3182 |
glxGetMatrix:arrayOf16Floats in:aGLXWindowId |
|
3183 |
"argument must be an array (a matrix) of 16 floats. The current matrix |
|
3184 |
will be stored into that." |
|
3185 |
||
3186 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3187 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3188 |
#else |
294 | 3189 |
Matrix matrix; |
3190 |
||
3191 |
SETWIN(aGLXWindowId) |
|
3192 |
getmatrix(matrix); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3193 |
if (! __glx_putFloatsFromInto(matrix, arrayOf16Floats, 16)) RETURN(false); |
1932 | 3194 |
#endif |
3195 |
%} |
|
294 | 3196 |
! |
3197 |
||
3198 |
glxLoadMatrix:arrayOf16Floats in:aGLXWindowId |
|
3199 |
"argument must be an array(a matrix) of 16 floats. The current matrix |
|
3200 |
will be loaded from that." |
|
3201 |
||
3202 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3203 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3204 |
#else |
294 | 3205 |
Matrix matrix; |
3206 |
Matrix *m; |
|
3207 |
||
2814 | 3208 |
if (! (m = __glx_getFloatsFromMatrixInto(arrayOf16Floats, matrix))) RETURN (false); |
294 | 3209 |
SETWIN(aGLXWindowId) |
3210 |
loadmatrix(*m); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3211 |
#endif |
294 | 3212 |
%} |
3213 |
! |
|
3214 |
||
3215 |
glxMultMatrix:arrayOf16Floats in:aGLXWindowId |
|
3216 |
"argument must be an array(a matrix) of 16 floats containing a |
|
3217 |
matrix to multiply into the current matrix." |
|
3218 |
||
3219 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3220 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3221 |
#else |
294 | 3222 |
Matrix matrix; |
3223 |
Matrix *m; |
|
3224 |
||
2814 | 3225 |
if (! (m = __glx_getFloatsFromMatrixInto(arrayOf16Floats, matrix))) RETURN (false); |
294 | 3226 |
SETWIN(aGLXWindowId) |
3227 |
multmatrix(*m); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3228 |
#endif |
294 | 3229 |
%} |
3230 |
! |
|
3231 |
||
3232 |
glxPopmatrixIn:aGLXWindowId |
|
3233 |
"pop transformation stack" |
|
3234 |
||
3235 |
%{ /* NOCONTEXT */ |
|
3236 |
SETWIN(aGLXWindowId) |
|
1932 | 3237 |
#ifdef OPENGL |
3238 |
#else |
|
294 | 3239 |
popmatrix(); |
1932 | 3240 |
#endif |
294 | 3241 |
%} |
3242 |
! |
|
3243 |
||
3244 |
glxPushmatrixIn:aGLXWindowId |
|
3245 |
"push down transformation stack" |
|
3246 |
||
3247 |
%{ /* NOCONTEXT */ |
|
3248 |
SETWIN(aGLXWindowId) |
|
1932 | 3249 |
#ifdef OPENGL |
3250 |
#else |
|
294 | 3251 |
pushmatrix(); |
1932 | 3252 |
#endif |
294 | 3253 |
%} |
3254 |
! ! |
|
3255 |
||
3256 |
!GLXWorkstation methodsFor:'misc'! |
|
3257 |
||
3258 |
glxGconfigIn:aGLXWindowId |
|
3259 |
"must be sent after RGBmode, doubleBuffer etc. to have these |
|
3260 |
changes really take effect. See GLX manual. |
|
3261 |
(Actually, it seems to be not allowed - I dont really know)" |
|
3262 |
||
3263 |
%{ /* NOCONTEXT */ |
|
3264 |
SETWIN(aGLXWindowId) |
|
1932 | 3265 |
#ifdef OPENGL |
3266 |
#else |
|
294 | 3267 |
gconfig(); |
1932 | 3268 |
#endif |
294 | 3269 |
%} |
3270 |
! |
|
3271 |
||
3272 |
glxMmode:aSymbol in:aGLXWindowId |
|
3273 |
"set matrix mode: #single, #viewing, #projection or #texture" |
|
3274 |
||
3275 |
%{ /* NOCONTEXT */ |
|
3276 |
#ifdef GLX |
|
3277 |
if (aSymbol == @symbol(single)) { |
|
3278 |
mmode(MSINGLE); |
|
3279 |
RETURN (true); |
|
3280 |
} |
|
3281 |
if (aSymbol == @symbol(viewing)) { |
|
3282 |
mmode(MVIEWING); |
|
3283 |
RETURN (true); |
|
3284 |
} |
|
3285 |
if (aSymbol == @symbol(projection)) { |
|
3286 |
mmode(MPROJECTION); |
|
3287 |
RETURN (true); |
|
3288 |
} |
|
3289 |
if (aSymbol == @symbol(texture)) { |
|
3290 |
mmode(MTEXTURE); |
|
3291 |
RETURN (true); |
|
3292 |
} |
|
3293 |
#endif |
|
3294 |
%} |
|
3295 |
. |
|
3296 |
^ false |
|
3297 |
! |
|
3298 |
||
3299 |
glxNmode:aSymbol in:aGLXWindowId |
|
3300 |
"set normalize mode: #auto, #normalize" |
|
3301 |
||
3302 |
%{ /* NOCONTEXT */ |
|
3303 |
#ifdef GLX |
|
3304 |
if (aSymbol == @symbol(auto)) { |
|
3305 |
nmode(NAUTO); |
|
3306 |
RETURN (true); |
|
3307 |
} |
|
3308 |
if (aSymbol == @symbol(normalize)) { |
|
3309 |
nmode(NNORMALIZE); |
|
3310 |
RETURN (true); |
|
3311 |
} |
|
3312 |
#endif |
|
3313 |
%} |
|
3314 |
. |
|
3315 |
^ false |
|
3316 |
! |
|
3317 |
||
3318 |
glxRGBmodeIn:aGLXWindowId |
|
3319 |
"set true color mode (no colormap)" |
|
3320 |
||
3321 |
%{ /* NOCONTEXT */ |
|
3322 |
#ifdef GLX |
|
3323 |
SETWIN(aGLXWindowId) |
|
3324 |
RGBmode(); |
|
3325 |
RETURN (true); |
|
3326 |
#endif |
|
3327 |
%} |
|
3328 |
. |
|
3329 |
^ false |
|
3330 |
! ! |
|
3331 |
||
3332 |
!GLXWorkstation methodsFor:'objects'! |
|
3333 |
||
3334 |
glxCallObject:obj in:aGLXWindowId |
|
3335 |
"perform the commands of an object (macro)." |
|
3336 |
||
2075 | 3337 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3338 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3339 |
#else |
294 | 3340 |
if (__isSmallInteger(obj)) { |
3341 |
SETWIN(aGLXWindowId) |
|
3342 |
callobj(_objectVal(obj)); |
|
3343 |
RETURN (true); |
|
3344 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3345 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3346 |
%}. |
294 | 3347 |
^ false |
3348 |
! |
|
3349 |
||
3350 |
glxCloseObjectIn:aGLXWindowId |
|
3351 |
"end object defnition" |
|
3352 |
||
2075 | 3353 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3354 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3355 |
#else |
294 | 3356 |
SETWIN(aGLXWindowId) |
3357 |
closeobj(); |
|
3358 |
RETURN (true); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3359 |
#endif |
294 | 3360 |
%} |
3361 |
! |
|
3362 |
||
3363 |
glxDeleteObject:obj in:aGLXWindowId |
|
3364 |
||
2075 | 3365 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3366 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3367 |
#else |
1882 | 3368 |
if (__isSmallInteger(obj)) { |
4718 | 3369 |
SETWIN(aGLXWindowId) |
3370 |
delobj(_objectVal(obj)); |
|
3371 |
RETURN (true); |
|
1882 | 3372 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3373 |
#endif |
294 | 3374 |
%} |
3375 |
! |
|
3376 |
||
3377 |
glxGenObjectIn:aGLXWindowId |
|
3378 |
"return a new (free & unused) object id for use |
|
3379 |
with makeObj" |
|
3380 |
||
3381 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3382 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3383 |
#else |
294 | 3384 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3385 |
RETURN (__MKSMALLINT(genobj())); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3386 |
#endif |
294 | 3387 |
%} |
3388 |
! |
|
3389 |
||
3390 |
glxGetopenobjIn:aGLXWindowId |
|
3391 |
"return the currently open objects id; -1 if none is open" |
|
3392 |
||
3393 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3394 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3395 |
#else |
294 | 3396 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3397 |
RETURN (__MKSMALLINT(getopenobj())); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3398 |
#endif |
294 | 3399 |
%} |
3400 |
! |
|
3401 |
||
3402 |
glxIsobj:obj in:aGLXWindowId |
|
3403 |
"return true, if obj is a valid object id" |
|
3404 |
||
3405 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3406 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3407 |
#else |
294 | 3408 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
3409 |
RETURN (__MKBOOLEAN(isobj(_objectVal(obj)))); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3410 |
#endif |
294 | 3411 |
%} |
3412 |
! |
|
3413 |
||
3414 |
glxMakeObject:id in:aGLXWindowId |
|
3415 |
"start object definition - |
|
3416 |
another name conflict" |
|
3417 |
||
2075 | 3418 |
%{ /* NOCONTEXT STACK:32000 */ |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3419 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3420 |
#else |
294 | 3421 |
if (__isSmallInteger(id)) { |
3422 |
SETWIN(aGLXWindowId) |
|
3423 |
makeobj(_objectVal(id)); |
|
3424 |
RETURN (true); |
|
3425 |
} |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3426 |
#endif |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3427 |
%}. |
294 | 3428 |
^ false |
3429 |
! ! |
|
3430 |
||
3431 |
!GLXWorkstation methodsFor:'patches & surfaces'! |
|
3432 |
||
3433 |
glxBeginCurveIn:aGLXWindowId |
|
3434 |
"start a NURBS curve def - in real GL only" |
|
3435 |
||
3436 |
%{ /* NOCONTEXT */ |
|
1932 | 3437 |
SETWIN(aGLXWindowId) |
3438 |
#ifdef GLX |
|
294 | 3439 |
bgncurve(); |
1932 | 3440 |
#endif |
3441 |
%} |
|
294 | 3442 |
! |
3443 |
||
3444 |
glxBeginSurfaceIn:aGLXWindowId |
|
3445 |
"start a NURBS surface def - in real GL only" |
|
3446 |
||
3447 |
%{ /* NOCONTEXT */ |
|
1932 | 3448 |
SETWIN(aGLXWindowId) |
3449 |
#ifdef GLX |
|
294 | 3450 |
bgnsurface(); |
1932 | 3451 |
#endif |
3452 |
%} |
|
294 | 3453 |
! |
3454 |
||
3455 |
glxDefBasis:id mat:aMatrix in:aGLXWindowId |
|
528 | 3456 |
"define the basis matrix for a patch or curve" |
294 | 3457 |
|
3458 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3459 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3460 |
#else |
294 | 3461 |
Matrix matrix; |
3462 |
Matrix *m; |
|
3463 |
||
2814 | 3464 |
if (! (m = __glx_getFloatsFromMatrixInto(aMatrix, matrix))) RETURN (false); |
294 | 3465 |
if (__isSmallInteger(id)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3466 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3467 |
defbasis((short)(__intVal(id)), *m); |
294 | 3468 |
} |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3469 |
#endif |
1932 | 3470 |
%} |
528 | 3471 |
|
3472 |
"Modified: 19.3.1996 / 18:52:56 / cg" |
|
294 | 3473 |
! |
3474 |
||
3475 |
glxEndCurveIn:aGLXWindowId |
|
3476 |
"end a NURBS curve def - in real GL only" |
|
3477 |
||
3478 |
%{ /* NOCONTEXT */ |
|
1932 | 3479 |
SETWIN(aGLXWindowId) |
3480 |
#ifdef GLX |
|
294 | 3481 |
endcurve(); |
1932 | 3482 |
#endif |
3483 |
%} |
|
294 | 3484 |
! |
3485 |
||
3486 |
glxEndSurfaceIn:aGLXWindowId |
|
3487 |
"end a NURBS surface def - in real GL only" |
|
3488 |
||
3489 |
%{ /* NOCONTEXT */ |
|
1932 | 3490 |
SETWIN(aGLXWindowId) |
3491 |
#ifdef GLX |
|
294 | 3492 |
endsurface(); |
1932 | 3493 |
#endif |
3494 |
%} |
|
294 | 3495 |
! |
3496 |
||
4718 | 3497 |
glxNurbsSurfaceUKnotCount: uKnotCount uKnot: uKnot |
294 | 3498 |
vKnotCount: vKnotCount vKnot: vKnot |
4718 | 3499 |
uOffset: uOffset vOffset: vOffset |
3500 |
ctlArray: ctlArray |
|
3501 |
uOrder: uOrder vOrder: vOrder |
|
294 | 3502 |
type: type in: aGLXWindowId |
3503 |
||
3504 |
| ctlPoints i | |
|
3505 |
ctlPoints := DoubleArray new: ctlArray size * (ctlArray first size). |
|
3506 |
i := 1. |
|
3507 |
ctlArray do: [:point | |
|
4718 | 3508 |
point do: [:coord | |
294 | 3509 |
ctlPoints at: i put: coord. |
3510 |
i := i + 1]]. |
|
3511 |
||
3512 |
%{ /* NOCONTEXT */ |
|
3513 |
#ifdef GLX |
|
3514 |
char *uKnotElements, *vKnotElements, *ctlElements; |
|
3515 |
OBJ cls; |
|
3516 |
int ninstVars, nInstBytes; |
|
3517 |
||
3518 |
SETWIN(aGLXWindowId) |
|
3519 |
cls = __qClass(ctlPoints); |
|
3520 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
3521 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
|
3522 |
||
3523 |
ctlElements = (char *)(_InstPtr(ctlPoints)) + nInstBytes; |
|
3524 |
uKnotElements = (char *)(_InstPtr(uKnot)) + nInstBytes; |
|
3525 |
vKnotElements = (char *)(_InstPtr(vKnot)) + nInstBytes; |
|
3526 |
||
3527 |
nurbssurface ( |
|
3528 |
__intVal(uKnotCount), (double *)uKnotElements, |
|
3529 |
__intVal(vKnotCount), (double *)vKnotElements, |
|
3530 |
__intVal(uOffset), __intVal(vOffset), |
|
4718 | 3531 |
(double *)ctlElements, |
294 | 3532 |
__intVal(uOrder), __intVal(vOrder), __intVal(type)); |
3533 |
RETURN(true); |
|
3534 |
#endif |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3535 |
%}. |
294 | 3536 |
^ false |
3537 |
! |
|
3538 |
||
3539 |
glxPatchBasisU:u v:v in:aGLXWindowId |
|
528 | 3540 |
"set the two basis matrices for a patch" |
294 | 3541 |
|
3542 |
%{ /* NOCONTEXT */ |
|
3543 |
if (__bothSmallInteger(u, v)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3544 |
SETWIN(aGLXWindowId) |
1932 | 3545 |
#ifdef OPENGL |
3546 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3547 |
patchbasis((long)__intVal(u), (long)__intVal(v)); |
1932 | 3548 |
#endif |
294 | 3549 |
} |
1932 | 3550 |
%} |
528 | 3551 |
|
3552 |
"Modified: 19.3.1996 / 18:53:18 / cg" |
|
294 | 3553 |
! |
3554 |
||
3555 |
glxPatchCurvesU:u v:v in:aGLXWindowId |
|
528 | 3556 |
"set the number of curves to be drawn in each direction on a patch" |
294 | 3557 |
|
3558 |
%{ /* NOCONTEXT */ |
|
3559 |
if (__bothSmallInteger(u, v)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3560 |
SETWIN(aGLXWindowId) |
1932 | 3561 |
#ifdef OPENGL |
3562 |
#else |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3563 |
patchcurves((long)__intVal(u), (long)__intVal(v)); |
1932 | 3564 |
#endif |
294 | 3565 |
} |
1932 | 3566 |
%} |
528 | 3567 |
|
3568 |
"Modified: 19.3.1996 / 18:53:34 / cg" |
|
294 | 3569 |
! |
3570 |
||
3571 |
glxPatchPrecisionU:u v:v in:aGLXWindowId |
|
3572 |
"set the patch precision" |
|
3573 |
||
3574 |
%{ /* NOCONTEXT */ |
|
3575 |
if (__bothSmallInteger(u, v)) { |
|
3576 |
SETWIN(aGLXWindowId) |
|
1932 | 3577 |
#ifdef OPENGL |
3578 |
#else |
|
294 | 3579 |
patchprecision((long)__intVal(u), (long)__intVal(v)); |
1932 | 3580 |
#endif |
294 | 3581 |
} |
1932 | 3582 |
%} |
294 | 3583 |
! |
3584 |
||
3585 |
glxPatchX:arrayOf16XFloats y:arrayOf16YFloats z:arrayOf16ZFloats in:aGLXWindowId |
|
528 | 3586 |
"Draws a bicubic patch. |
3587 |
arguments must be arrays of 16 floats containing the patch" |
|
294 | 3588 |
|
3589 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3590 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3591 |
#else |
294 | 3592 |
Matrix matrixX, matrixY, matrixZ; |
3593 |
Matrix *mX, *mY, *mZ; |
|
3594 |
||
4718 | 3595 |
if (! (mX = __glx_getFloatsFromMatrixInto(arrayOf16XFloats, matrixX))) |
1932 | 3596 |
RETURN (nil); |
4718 | 3597 |
if (! (mY = __glx_getFloatsFromMatrixInto(arrayOf16YFloats, matrixY))) |
1932 | 3598 |
RETURN (nil); |
4718 | 3599 |
if (! (mZ = __glx_getFloatsFromMatrixInto(arrayOf16ZFloats, matrixZ))) |
1932 | 3600 |
RETURN (nil); |
294 | 3601 |
SETWIN(aGLXWindowId) |
3602 |
patch(*mX, *mY, *mZ); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3603 |
#endif |
294 | 3604 |
%} |
528 | 3605 |
|
3606 |
"Modified: 19.3.1996 / 18:54:02 / cg" |
|
3607 |
! |
|
3608 |
||
3609 |
glxRpatchX:arrayOf16XFloats y:arrayOf16YFloats z:arrayOf16ZFloats w:arrayOf16WFloats in:aGLXWindowId |
|
3610 |
"Draws a rational bicubic patch. |
|
3611 |
arguments must be arrays of 16 floats containing the patch" |
|
3612 |
||
3613 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3614 |
#ifdef OPENGL |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3615 |
#else |
529 | 3616 |
Matrix matrixX, matrixY, matrixZ, matrixW; |
3617 |
Matrix *mX, *mY, *mZ, *mW; |
|
528 | 3618 |
|
4718 | 3619 |
if (! (mX = __glx_getFloatsFromMatrixInto(arrayOf16XFloats, matrixX))) |
1932 | 3620 |
RETURN (nil); |
4718 | 3621 |
if (! (mY = __glx_getFloatsFromMatrixInto(arrayOf16YFloats, matrixY))) |
1932 | 3622 |
RETURN (nil); |
4718 | 3623 |
if (! (mZ = __glx_getFloatsFromMatrixInto(arrayOf16ZFloats, matrixZ))) |
1932 | 3624 |
RETURN (nil); |
4718 | 3625 |
if (! (mW = __glx_getFloatsFromMatrixInto(arrayOf16WFloats, matrixW))) |
1932 | 3626 |
RETURN (nil); |
529 | 3627 |
SETWIN(aGLXWindowId) |
3628 |
rpatch(*mX, *mY, *mZ, *mW); |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3629 |
#endif |
528 | 3630 |
%} |
3631 |
||
3632 |
"Modified: 19.3.1996 / 18:54:02 / cg" |
|
3633 |
"Created: 19.3.1996 / 18:56:34 / cg" |
|
3634 |
! ! |
|
3635 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3636 |
!GLXWorkstation methodsFor:'pixel copy'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3637 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3638 |
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
|
3639 |
"copy a rectangular area in the view. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3640 |
For now, this is only supported with a true GL. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3641 |
readsource specifies which plane/buffer is affected by this operation." |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3642 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3643 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3644 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3645 |
SETWIN(aGLXWindowId) |
4718 | 3646 |
rectcopy(_screencoordVal(x1), _screencoordVal(y1), |
3647 |
_screencoordVal(x2), _screencoordVal(y2), |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3648 |
_screencoordVal(newx), _screencoordVal(newy)); |
1932 | 3649 |
#endif |
3650 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3651 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3652 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3653 |
!GLXWorkstation methodsFor:'pixel reading'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3654 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3655 |
glxReadpixelsTo:dest in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3656 |
"read pixels from the view. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3657 |
Dest must be an array and gets pixel values assigned, |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3658 |
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
|
3659 |
For now, pixel-reading is only supported with a true GL. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3660 |
Caveat: the number of pixels is limited to 256. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3661 |
In double buffer mode, the backBuffer is read." |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3662 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3663 |
|n| |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3664 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3665 |
n := dest size. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3666 |
n > 256 ifTrue:[^ 0]. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3667 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3668 |
%{ /* STACK:1024 */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3669 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3670 |
Colorindex buffer[256]; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3671 |
int i, nRead; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3672 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3673 |
if (__isArray(dest)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3674 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3675 |
nRead = readpixels(__intVal(n), buffer); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3676 |
for (i=0; i<nRead;i++) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3677 |
__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
|
3678 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3679 |
RETURN (__MKSMALLINT(nRead)); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3680 |
} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3681 |
#endif |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3682 |
%}. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3683 |
^ 0 |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3684 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3685 |
"Modified: 22.3.1996 / 18:08:00 / cg" |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3686 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3687 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3688 |
glxReadsource: src in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3689 |
"specify what is read with folowing readPixels requests. |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3690 |
For now, pixel-reading is only supported with a true GL" |
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 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3693 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3694 |
OBJ s = src; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3695 |
int what; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3696 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3697 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3698 |
if (s == @symbol(auto)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3699 |
what = SRC_AUTO; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3700 |
} else if (s == @symbol(front)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3701 |
what = SRC_FRONT; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3702 |
} else if (s == @symbol(back)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3703 |
what = SRC_BACK; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3704 |
} else if (s == @symbol(zBuffer)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3705 |
what = SRC_ZBUFFER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3706 |
} else if (s == @symbol(frameGrabber)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3707 |
what = SRC_FRAMEGRABBER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3708 |
} else if (s == @symbol(over)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3709 |
what = SRC_OVER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3710 |
} else if (s == @symbol(under)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3711 |
what = SRC_UNDER; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3712 |
} else if (s == @symbol(popUp)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3713 |
what = SRC_PUP; |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3714 |
} else { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3715 |
what = _longVal(src); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3716 |
} |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3717 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3718 |
readsource(what); |
1932 | 3719 |
#endif |
3720 |
%} |
|
538 | 3721 |
! |
3722 |
||
541 | 3723 |
glxRectreadX1:x1 y1:y1 x2:x2 y2:y2 h:viewHeight to:dest in:aGLXWindowId |
538 | 3724 |
"read pixels from a rectanglular area. |
3725 |
Dest must be an array and gets pixel values assigned, |
|
3726 |
reading n*m pixels. |
|
3727 |
For now, pixel-reading is only supported with a true GL. |
|
3728 |
Caveat: the number of pixels is limited to 256. |
|
3729 |
In double buffer mode, the backBuffer is read." |
|
3730 |
||
541 | 3731 |
|n idx sy1 sy2| |
3732 |
||
3733 |
"/ GLX's y coordinates go bottom to top ... |
|
3734 |
||
3735 |
sy1 := viewHeight - y1. |
|
3736 |
sy2 := viewHeight - y2. |
|
538 | 3737 |
|
3738 |
n := (x2 - x1 + 1) * (y2 - y1 + 1). |
|
3739 |
n > 256 ifTrue:[^ 0]. |
|
3740 |
dest size < n ifTrue:[^ 0]. |
|
3741 |
||
3742 |
%{ /* STACK:1024 */ |
|
3743 |
#ifdef GLX |
|
3744 |
Colorindex buffer[256]; |
|
3745 |
int i, nRead; |
|
3746 |
||
3747 |
if (__isArray(dest) |
|
3748 |
&& __isSmallInteger(x1) && __isSmallInteger(x2) |
|
541 | 3749 |
&& __isSmallInteger(sy1) && __isSmallInteger(sy2) |
538 | 3750 |
) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3751 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3752 |
nRead = rectread(__intVal(x1), __intVal(sy1), |
4718 | 3753 |
__intVal(x2), __intVal(sy2), |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3754 |
buffer); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3755 |
for (i=0; i<nRead;i++) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3756 |
__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
|
3757 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3758 |
RETURN (__MKSMALLINT(nRead)); |
538 | 3759 |
} |
3760 |
#endif |
|
3761 |
%}. |
|
3762 |
"/ |
|
3763 |
"/ ok, this is not a GL - use XWorkstations pixel read method |
|
3764 |
"/ and convert |
|
3765 |
"/ |
|
3766 |
idx := 1. |
|
3767 |
y1 to:y2 do:[:y | |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3768 |
x1 to:x2 do:[:x | |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3769 |
|pix| |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3770 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3771 |
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
|
3772 |
dest at:idx put:pix |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3773 |
] |
538 | 3774 |
]. |
3775 |
^ n |
|
3776 |
||
3777 |
"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
|
3778 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3779 |
! |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3780 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3781 |
glxXColorToGLColor:pixel |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3782 |
"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
|
3783 |
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
|
3784 |
|
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3785 |
%{ /* NOCONTEXT */ |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3786 |
#ifdef VGL |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3787 |
if (__isSmallInteger(pixel)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3788 |
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
|
3789 |
} |
5e3b0dc0b01a
fixed screen read for VGL (return GL color, not X color)
Claus Gittinger <cg@exept.de>
parents:
541
diff
changeset
|
3790 |
#endif |
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 |
^ pixel |
543
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3793 |
! |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3794 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3795 |
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
|
3796 |
"special for VGL" |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3797 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3798 |
%{ |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3799 |
#ifdef VGL |
1932 | 3800 |
if (__bothSmallInteger(x, y)) { |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3801 |
SETWIN(aGLXWindowId) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
3802 |
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
|
3803 |
} |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3804 |
#endif |
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 |
^ 0 |
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3807 |
|
abe110532199
another change for pixelRead - needed to read from backbuffer with VGL
Claus Gittinger <cg@exept.de>
parents:
542
diff
changeset
|
3808 |
"Modified: 22.3.1996 / 18:08:00 / cg" |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3809 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
3810 |
|
528 | 3811 |
!GLXWorkstation methodsFor:'points'! |
3812 |
||
3813 |
glxPnt2X: x y: y in: aGLXWindowId |
|
3814 |
"plot a point in x, y, 0." |
|
3815 |
||
3816 |
%{ /* NOCONTEXT */ |
|
3817 |
Coord c_x, c_y; |
|
3818 |
||
3819 |
_COORD_ (x, c_x) |
|
3820 |
_COORD_ (y, c_y) |
|
3821 |
SETWIN(aGLXWindowId) |
|
1932 | 3822 |
#ifdef OPENGL |
3823 |
#else |
|
528 | 3824 |
pnt2(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3825 |
#endif |
528 | 3826 |
%} |
3827 |
||
3828 |
"Modified: 19.3.1996 / 18:35:55 / cg" |
|
3829 |
! |
|
3830 |
||
3831 |
glxPnt2iX: x y: y in: aGLXWindowId |
|
3832 |
"plot a point in x, y, 0." |
|
3833 |
||
3834 |
%{ /* NOCONTEXT */ |
|
3835 |
Icoord c_x, c_y; |
|
3836 |
||
3837 |
_ICOORD_ (x, c_x) |
|
3838 |
_ICOORD_ (y, c_y) |
|
3839 |
SETWIN(aGLXWindowId) |
|
1932 | 3840 |
#ifdef OPENGL |
3841 |
#else |
|
528 | 3842 |
pnt2i(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3843 |
#endif |
528 | 3844 |
%} |
3845 |
||
3846 |
"Modified: 19.3.1996 / 18:35:59 / cg" |
|
3847 |
! |
|
3848 |
||
3849 |
glxPnt2sX: x y: y in: aGLXWindowId |
|
3850 |
"plot a point in x, y, 0." |
|
3851 |
||
3852 |
%{ /* NOCONTEXT */ |
|
3853 |
Scoord c_x, c_y; |
|
3854 |
||
3855 |
_SCOORD_ (x, c_x) |
|
3856 |
_SCOORD_ (y, c_y) |
|
3857 |
SETWIN(aGLXWindowId) |
|
1932 | 3858 |
#ifdef OPENGL |
3859 |
#else |
|
528 | 3860 |
pnt2s(c_x, c_y); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3861 |
#endif |
528 | 3862 |
%} |
3863 |
||
3864 |
"Modified: 19.3.1996 / 18:36:03 / cg" |
|
3865 |
! |
|
3866 |
||
3867 |
glxPntX: x y: y z: z in: aGLXWindowId |
|
3868 |
"plot a point in x, y, z." |
|
3869 |
||
3870 |
%{ /* NOCONTEXT */ |
|
3871 |
Coord c_x, c_y, c_z; |
|
3872 |
||
3873 |
_COORD_ (x, c_x) |
|
3874 |
_COORD_ (y, c_y) |
|
3875 |
_COORD_ (z, c_z) |
|
3876 |
SETWIN(aGLXWindowId) |
|
1932 | 3877 |
#ifdef OPENGL |
3878 |
#else |
|
528 | 3879 |
pnt(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3880 |
#endif |
528 | 3881 |
%} |
3882 |
||
3883 |
"Modified: 19.3.1996 / 18:36:08 / cg" |
|
3884 |
! |
|
3885 |
||
3886 |
glxPntiX: x y: y z: z in: aGLXWindowId |
|
3887 |
"plot a point in x, y, z." |
|
3888 |
||
3889 |
%{ /* NOCONTEXT */ |
|
3890 |
Icoord c_x, c_y, c_z; |
|
3891 |
||
3892 |
_ICOORD_ (x, c_x) |
|
3893 |
_ICOORD_ (y, c_y) |
|
3894 |
_ICOORD_ (z, c_z) |
|
3895 |
SETWIN(aGLXWindowId) |
|
1932 | 3896 |
#ifdef OPENGL |
3897 |
#else |
|
528 | 3898 |
pnti(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3899 |
#endif |
528 | 3900 |
%} |
3901 |
||
3902 |
"Modified: 19.3.1996 / 18:36:14 / cg" |
|
3903 |
! |
|
3904 |
||
3905 |
glxPntsX: x y: y z: z in: aGLXWindowId |
|
3906 |
"plot a point in x, y, z." |
|
3907 |
||
3908 |
%{ /* NOCONTEXT */ |
|
3909 |
Scoord c_x, c_y, c_z; |
|
3910 |
||
3911 |
_SCOORD_ (x, c_x) |
|
3912 |
_SCOORD_ (y, c_y) |
|
3913 |
_SCOORD_ (z, c_z) |
|
3914 |
SETWIN(aGLXWindowId) |
|
1932 | 3915 |
#ifdef OPENGL |
3916 |
#else |
|
528 | 3917 |
pnts(c_x, c_y, c_z); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
3918 |
#endif |
528 | 3919 |
%} |
3920 |
||
3921 |
"Modified: 19.3.1996 / 18:36:17 / cg" |
|
3922 |
! |
|
3923 |
||
3924 |
glxPntsize: n in: aGLXWindowId |
|
3925 |
||
3926 |
%{ /* NOCONTEXT */ |
|
1932 | 3927 |
SETWIN(aGLXWindowId) |
3928 |
#ifdef GLX |
|
528 | 3929 |
pntsize(_shortVal(n)); |
1932 | 3930 |
#endif |
3931 |
%} |
|
528 | 3932 |
! |
3933 |
||
3934 |
glxPntsizef: n in: aGLXWindowId |
|
3935 |
||
3936 |
%{ /* NOCONTEXT */ |
|
1932 | 3937 |
SETWIN(aGLXWindowId) |
3938 |
#ifdef GLX |
|
528 | 3939 |
pntsizef(_floatVal(n)); |
1932 | 3940 |
#endif |
3941 |
%} |
|
528 | 3942 |
! ! |
3943 |
||
3944 |
!GLXWorkstation methodsFor:'polygons'! |
|
3945 |
||
3946 |
glxBackface: b in: aGLXWindowId |
|
4718 | 3947 |
"enable/disable culling of backfacing polygons (suppress its drawing). |
528 | 3948 |
A polygon is backfacing if it's orientation in *screen* coords is clockwise" |
3949 |
||
3950 |
%{ /* NOCONTEXT */ |
|
3951 |
SETWIN(aGLXWindowId) |
|
1932 | 3952 |
#ifdef OPENGL |
3953 |
#else |
|
528 | 3954 |
backface(_booleanVal(b)); |
1932 | 3955 |
#endif |
528 | 3956 |
%} |
3957 |
||
3958 |
"Modified: 19.3.1996 / 18:26:50 / cg" |
|
3959 |
! |
|
3960 |
||
3961 |
glxConcave: b in: aGLXWindowId |
|
3962 |
"signal wether or not polygons are concave" |
|
3963 |
||
3964 |
%{ /* NOCONTEXT */ |
|
3965 |
SETWIN(aGLXWindowId) |
|
1932 | 3966 |
#ifdef OPENGL |
3967 |
#else |
|
528 | 3968 |
concave(_booleanVal(b)); |
1932 | 3969 |
#endif |
528 | 3970 |
%} |
3971 |
! |
|
3972 |
||
3973 |
glxFrontface: b in: aGLXWindowId |
|
4718 | 3974 |
"enable/disable culling of frontfacing polygons (suppress its drawing). |
3975 |
A polygon is frontfacing if it's orientation in *screen* coords is |
|
528 | 3976 |
anti-clockwise" |
3977 |
||
3978 |
||
3979 |
%{ /* NOCONTEXT */ |
|
3980 |
SETWIN(aGLXWindowId) |
|
1932 | 3981 |
#ifdef OPENGL |
3982 |
#else |
|
528 | 3983 |
frontface(_booleanVal(b)); |
1932 | 3984 |
#endif |
3985 |
%} |
|
528 | 3986 |
! |
3987 |
||
3988 |
glxPdr2X: x y: y in: aGLXWindowId |
|
3989 |
"add another vertex to the polygon" |
|
3990 |
||
3991 |
%{ /* NOCONTEXT */ |
|
3992 |
Coord c_x, c_y; |
|
3993 |
||
3994 |
_COORD_ (x, c_x) |
|
3995 |
_COORD_ (y, c_y) |
|
3996 |
SETWIN(aGLXWindowId) |
|
1932 | 3997 |
#ifdef OPENGL |
3998 |
#else |
|
528 | 3999 |
pdr2(c_x, c_y); |
1932 | 4000 |
#endif |
4001 |
%} |
|
528 | 4002 |
! |
4003 |
||
4004 |
glxPdr2iX: x y: y in: aGLXWindowId |
|
4005 |
"add another vertex to the polygon" |
|
4006 |
||
4007 |
%{ /* NOCONTEXT */ |
|
4008 |
Icoord c_x, c_y; |
|
4009 |
||
4010 |
_ICOORD_ (x, c_x) |
|
4011 |
_ICOORD_ (y, c_y) |
|
4012 |
SETWIN(aGLXWindowId) |
|
1932 | 4013 |
#ifdef OPENGL |
4014 |
#else |
|
528 | 4015 |
pdr2i(c_x, c_y); |
1932 | 4016 |
#endif |
528 | 4017 |
%} |
4018 |
||
4019 |
"Modified: 19.3.1996 / 18:33:28 / cg" |
|
4020 |
! |
|
4021 |
||
4022 |
glxPdr2sX: x y: y in: aGLXWindowId |
|
4023 |
"add another vertex to the polygon" |
|
4024 |
||
4025 |
%{ /* NOCONTEXT */ |
|
4026 |
Scoord c_x, c_y; |
|
4027 |
||
4028 |
_SCOORD_ (x, c_x) |
|
4029 |
_SCOORD_ (y, c_y) |
|
4030 |
SETWIN(aGLXWindowId) |
|
1932 | 4031 |
#ifdef OPENGL |
4032 |
#else |
|
528 | 4033 |
pdr2s(c_x, c_y); |
1932 | 4034 |
#endif |
528 | 4035 |
%} |
4036 |
||
4037 |
"Modified: 19.3.1996 / 18:34:03 / cg" |
|
4038 |
! |
|
4039 |
||
4040 |
glxPdrX: x y: y z: z in: aGLXWindowId |
|
4041 |
"add another vertex to the polygon" |
|
4042 |
||
4043 |
%{ /* NOCONTEXT */ |
|
4044 |
Coord c_x, c_y, c_z; |
|
4045 |
||
4046 |
_COORD_ (x, c_x) |
|
4047 |
_COORD_ (y, c_y) |
|
4048 |
_COORD_ (z, c_z) |
|
4049 |
SETWIN(aGLXWindowId) |
|
1932 | 4050 |
#ifdef OPENGL |
4051 |
#else |
|
528 | 4052 |
pdr(c_x, c_y, c_z); |
1932 | 4053 |
#endif |
528 | 4054 |
%} |
4055 |
||
4056 |
"Modified: 19.3.1996 / 18:34:06 / cg" |
|
4057 |
! |
|
4058 |
||
4059 |
glxPdriX: x y: y z: z in: aGLXWindowId |
|
4060 |
"add another vertex to the polygon" |
|
4061 |
||
4062 |
%{ /* NOCONTEXT */ |
|
4063 |
Icoord c_x, c_y, c_z; |
|
4064 |
||
4065 |
_ICOORD_ (x, c_x) |
|
4066 |
_ICOORD_ (y, c_y) |
|
4067 |
_ICOORD_ (z, c_z) |
|
4068 |
SETWIN(aGLXWindowId) |
|
1932 | 4069 |
#ifdef OPENGL |
4070 |
#else |
|
528 | 4071 |
pdri(c_x, c_y, c_z); |
1932 | 4072 |
#endif |
528 | 4073 |
%} |
4074 |
||
4075 |
"Modified: 19.3.1996 / 18:34:11 / cg" |
|
4076 |
! |
|
4077 |
||
4078 |
glxPdrsX: x y: y z: z in: aGLXWindowId |
|
4079 |
"add another vertex to the polygon" |
|
4080 |
||
4081 |
%{ /* NOCONTEXT */ |
|
4082 |
Scoord c_x, c_y, c_z; |
|
4083 |
||
4084 |
_SCOORD_ (x, c_x) |
|
4085 |
_SCOORD_ (y, c_y) |
|
4086 |
_SCOORD_ (z, c_z) |
|
4087 |
SETWIN(aGLXWindowId) |
|
1932 | 4088 |
#ifdef OPENGL |
4089 |
#else |
|
528 | 4090 |
pdrs(c_x, c_y, c_z); |
1932 | 4091 |
#endif |
528 | 4092 |
%} |
4093 |
||
4094 |
"Modified: 19.3.1996 / 18:34:14 / cg" |
|
4095 |
! |
|
4096 |
||
4097 |
glxPmv2X: x y: y in: aGLXWindowId |
|
4098 |
"set the start position of a polygon" |
|
4099 |
||
4100 |
%{ /* NOCONTEXT */ |
|
4101 |
Coord c_x, c_y; |
|
4102 |
||
4103 |
_COORD_ (x, c_x) |
|
4104 |
_COORD_ (y, c_y) |
|
4105 |
SETWIN(aGLXWindowId) |
|
1932 | 4106 |
#ifdef OPENGL |
4107 |
#else |
|
528 | 4108 |
pmv2(c_x, c_y); |
1932 | 4109 |
#endif |
528 | 4110 |
%} |
4111 |
||
4112 |
"Modified: 19.3.1996 / 18:32:45 / cg" |
|
4113 |
! |
|
4114 |
||
4115 |
glxPmv2iX: x y: y in: aGLXWindowId |
|
4116 |
"set the start position of a polygon" |
|
4117 |
||
4118 |
%{ /* NOCONTEXT */ |
|
4119 |
Icoord c_x, c_y; |
|
4120 |
||
4121 |
_ICOORD_ (x, c_x) |
|
4122 |
_ICOORD_ (y, c_y) |
|
4123 |
SETWIN(aGLXWindowId) |
|
1932 | 4124 |
#ifdef OPENGL |
4125 |
#else |
|
528 | 4126 |
pmv2i(c_x, c_y); |
1932 | 4127 |
#endif |
528 | 4128 |
%} |
4129 |
||
4130 |
"Modified: 19.3.1996 / 18:32:42 / cg" |
|
4131 |
! |
|
4132 |
||
4133 |
glxPmv2sX: x y: y in: aGLXWindowId |
|
4134 |
"set the start position of a polygon" |
|
4135 |
||
4136 |
%{ /* NOCONTEXT */ |
|
4137 |
Scoord c_x, c_y; |
|
4138 |
||
4139 |
_SCOORD_ (x, c_x) |
|
4140 |
_SCOORD_ (y, c_y) |
|
4141 |
SETWIN(aGLXWindowId) |
|
1932 | 4142 |
#ifdef OPENGL |
4143 |
#else |
|
528 | 4144 |
pmv2s(c_x, c_y); |
1932 | 4145 |
#endif |
528 | 4146 |
%} |
4147 |
||
4148 |
"Modified: 19.3.1996 / 18:32:38 / cg" |
|
4149 |
! |
|
4150 |
||
4151 |
glxPmvX: x y: y z: z in: aGLXWindowId |
|
4152 |
"set the start position of a polygon" |
|
4153 |
||
4154 |
%{ /* NOCONTEXT */ |
|
4155 |
Coord c_x, c_y, c_z; |
|
4156 |
||
4157 |
_COORD_ (x, c_x) |
|
4158 |
_COORD_ (y, c_y) |
|
4159 |
_COORD_ (z, c_z) |
|
4160 |
SETWIN(aGLXWindowId) |
|
1932 | 4161 |
#ifdef OPENGL |
4162 |
#else |
|
528 | 4163 |
pmv(c_x, c_y, c_z); |
1932 | 4164 |
#endif |
528 | 4165 |
%} |
4166 |
||
4167 |
"Modified: 19.3.1996 / 18:31:52 / cg" |
|
4168 |
! |
|
4169 |
||
4170 |
glxPmviX: x y: y z: z in: aGLXWindowId |
|
4171 |
"set the start position of a polygon" |
|
4172 |
||
4173 |
%{ /* NOCONTEXT */ |
|
4174 |
Icoord c_x, c_y, c_z; |
|
4175 |
||
4176 |
_ICOORD_ (x, c_x) |
|
4177 |
_ICOORD_ (y, c_y) |
|
4178 |
_ICOORD_ (z, c_z) |
|
4179 |
SETWIN(aGLXWindowId) |
|
1932 | 4180 |
#ifdef OPENGL |
4181 |
#else |
|
528 | 4182 |
pmvi(c_x, c_y, c_z); |
1932 | 4183 |
#endif |
528 | 4184 |
%} |
4185 |
||
4186 |
"Modified: 19.3.1996 / 18:31:59 / cg" |
|
4187 |
! |
|
4188 |
||
4189 |
glxPmvsX: x y: y z: z in: aGLXWindowId |
|
4190 |
"set the start position of a polygon" |
|
4191 |
||
4192 |
%{ /* NOCONTEXT */ |
|
4193 |
Scoord c_x, c_y, c_z; |
|
4194 |
||
4195 |
_SCOORD_ (x, c_x) |
|
4196 |
_SCOORD_ (y, c_y) |
|
4197 |
_SCOORD_ (z, c_z) |
|
4198 |
SETWIN(aGLXWindowId) |
|
1932 | 4199 |
#ifdef OPENGL |
4200 |
#else |
|
528 | 4201 |
pmvs(c_x, c_y, c_z); |
1932 | 4202 |
#endif |
528 | 4203 |
%} |
4204 |
||
4205 |
"Modified: 19.3.1996 / 18:32:03 / cg" |
|
4206 |
! |
|
4207 |
||
4208 |
glxPolymode: mode in: aGLXWindowId |
|
4209 |
"Sets the polygon filling mode - only filled (1) or outlined (0) |
|
4210 |
are supported" |
|
4211 |
||
4212 |
%{ /* NOCONTEXT */ |
|
4213 |
SETWIN(aGLXWindowId) |
|
1932 | 4214 |
#ifdef OPENGL |
4215 |
#else |
|
528 | 4216 |
polymode(_longVal(mode)); |
1932 | 4217 |
#endif |
528 | 4218 |
%} |
4219 |
||
4220 |
"Modified: 19.3.1996 / 18:29:32 / cg" |
|
4221 |
! |
|
4222 |
||
4223 |
glxRpdr2X: x y: y in: aGLXWindowId |
|
4224 |
"add another relative vertex to the polygon" |
|
4225 |
||
4226 |
%{ /* NOCONTEXT */ |
|
4227 |
Coord c_x, c_y; |
|
4228 |
||
4229 |
_COORD_ (x, c_x) |
|
4230 |
_COORD_ (y, c_y) |
|
4231 |
SETWIN(aGLXWindowId) |
|
1932 | 4232 |
#ifdef OPENGL |
4233 |
#else |
|
528 | 4234 |
rpdr2(c_x, c_y); |
1932 | 4235 |
#endif |
528 | 4236 |
%} |
4237 |
||
4238 |
"Modified: 19.3.1996 / 18:34:31 / cg" |
|
4239 |
! |
|
4240 |
||
4241 |
glxRpdr2iX: x y: y in: aGLXWindowId |
|
4242 |
"add another relative vertex to the polygon" |
|
4243 |
||
4244 |
%{ /* NOCONTEXT */ |
|
4245 |
Icoord c_x, c_y; |
|
4246 |
||
4247 |
_ICOORD_ (x, c_x) |
|
4248 |
_ICOORD_ (y, c_y) |
|
4249 |
SETWIN(aGLXWindowId) |
|
1932 | 4250 |
#ifdef OPENGL |
4251 |
#else |
|
528 | 4252 |
rpdr2i(c_x, c_y); |
1932 | 4253 |
#endif |
528 | 4254 |
%} |
4255 |
||
4256 |
"Modified: 19.3.1996 / 18:34:36 / cg" |
|
4257 |
! |
|
4258 |
||
4259 |
glxRpdr2sX: x y: y in: aGLXWindowId |
|
4260 |
"add another relative vertex to the polygon" |
|
4261 |
||
4262 |
%{ /* NOCONTEXT */ |
|
4263 |
Scoord c_x, c_y; |
|
4264 |
||
4265 |
_SCOORD_ (x, c_x) |
|
4266 |
_SCOORD_ (y, c_y) |
|
4267 |
SETWIN(aGLXWindowId) |
|
1932 | 4268 |
#ifdef OPENGL |
4269 |
#else |
|
528 | 4270 |
rpdr2s(c_x, c_y); |
1932 | 4271 |
#endif |
528 | 4272 |
%} |
4273 |
||
4274 |
"Modified: 19.3.1996 / 18:34:40 / cg" |
|
4275 |
! |
|
4276 |
||
4277 |
glxRpdrX: x y: y z: z in: aGLXWindowId |
|
4278 |
"add another relative vertex to the polygon" |
|
4279 |
||
4280 |
%{ /* NOCONTEXT */ |
|
4281 |
Coord c_x, c_y, c_z; |
|
4282 |
||
4283 |
_COORD_ (x, c_x) |
|
4284 |
_COORD_ (y, c_y) |
|
4285 |
_COORD_ (z, c_z) |
|
4286 |
SETWIN(aGLXWindowId) |
|
1932 | 4287 |
#ifdef OPENGL |
4288 |
#else |
|
528 | 4289 |
rpdr(c_x, c_y, c_z); |
1932 | 4290 |
#endif |
528 | 4291 |
%} |
4292 |
||
4293 |
"Modified: 19.3.1996 / 18:34:48 / cg" |
|
4294 |
! |
|
4295 |
||
4296 |
glxRpdriX: x y: y z: z in: aGLXWindowId |
|
4297 |
"add another relative vertex to the polygon" |
|
4298 |
||
4299 |
%{ /* NOCONTEXT */ |
|
4300 |
Icoord c_x, c_y, c_z; |
|
4301 |
||
4302 |
_ICOORD_ (x, c_x) |
|
4303 |
_ICOORD_ (y, c_y) |
|
4304 |
_ICOORD_ (z, c_z) |
|
4305 |
SETWIN(aGLXWindowId) |
|
1932 | 4306 |
#ifdef OPENGL |
4307 |
#else |
|
528 | 4308 |
rpdri(c_x, c_y, c_z); |
1932 | 4309 |
#endif |
528 | 4310 |
%} |
4311 |
||
4312 |
"Modified: 19.3.1996 / 18:34:51 / cg" |
|
4313 |
! |
|
4314 |
||
4315 |
glxRpdrsX: x y: y z: z in: aGLXWindowId |
|
4316 |
"add another relative vertex to the polygon" |
|
4317 |
||
4318 |
%{ /* NOCONTEXT */ |
|
4319 |
Scoord c_x, c_y, c_z; |
|
4320 |
||
4321 |
_SCOORD_ (x, c_x) |
|
4322 |
_SCOORD_ (y, c_y) |
|
4323 |
_SCOORD_ (z, c_z) |
|
4324 |
SETWIN(aGLXWindowId) |
|
1932 | 4325 |
#ifdef OPENGL |
4326 |
#else |
|
528 | 4327 |
rpdrs(c_x, c_y, c_z); |
1932 | 4328 |
#endif |
528 | 4329 |
%} |
4330 |
||
4331 |
"Modified: 19.3.1996 / 18:34:55 / cg" |
|
4332 |
! |
|
4333 |
||
4334 |
glxRpmv2X: x y: y in: aGLXWindowId |
|
4335 |
"set the start position of a polygon" |
|
4336 |
||
4337 |
%{ /* NOCONTEXT */ |
|
4338 |
Coord c_x, c_y; |
|
4339 |
||
4340 |
_COORD_ (x, c_x) |
|
4341 |
_COORD_ (y, c_y) |
|
4342 |
SETWIN(aGLXWindowId) |
|
1932 | 4343 |
#ifdef OPENGL |
4344 |
#else |
|
528 | 4345 |
rpmv2(c_x, c_y); |
1932 | 4346 |
#endif |
528 | 4347 |
%} |
4348 |
||
4349 |
"Modified: 19.3.1996 / 18:37:15 / cg" |
|
4350 |
! |
|
4351 |
||
4352 |
glxRpmv2iX: x y: y in: aGLXWindowId |
|
4353 |
"set the start position of a polygon" |
|
4354 |
||
4355 |
%{ /* NOCONTEXT */ |
|
4356 |
Icoord c_x, c_y; |
|
4357 |
||
4358 |
_ICOORD_ (x, c_x) |
|
4359 |
_ICOORD_ (y, c_y) |
|
4360 |
SETWIN(aGLXWindowId) |
|
1932 | 4361 |
#ifdef OPENGL |
4362 |
#else |
|
528 | 4363 |
rpmv2i(c_x, c_y); |
1932 | 4364 |
#endif |
528 | 4365 |
%} |
4366 |
||
4367 |
"Modified: 19.3.1996 / 18:37:20 / cg" |
|
4368 |
! |
|
4369 |
||
4370 |
glxRpmv2sX: x y: y in: aGLXWindowId |
|
4371 |
"set the relative start position of a polygon" |
|
4372 |
||
4373 |
%{ /* NOCONTEXT */ |
|
4374 |
Scoord c_x, c_y; |
|
4375 |
||
4376 |
_SCOORD_ (x, c_x) |
|
4377 |
_SCOORD_ (y, c_y) |
|
4378 |
SETWIN(aGLXWindowId) |
|
1932 | 4379 |
#ifdef OPENGL |
4380 |
#else |
|
528 | 4381 |
rpmv2s(c_x, c_y); |
1932 | 4382 |
#endif |
528 | 4383 |
%} |
4384 |
||
4385 |
"Modified: 19.3.1996 / 18:38:06 / cg" |
|
4386 |
! |
|
4387 |
||
4388 |
glxRpmvX: x y: y z: z in: aGLXWindowId |
|
4389 |
"set the relative start position of a polygon" |
|
4390 |
||
4391 |
%{ /* NOCONTEXT */ |
|
4392 |
Coord c_x, c_y, c_z; |
|
4393 |
||
4394 |
_COORD_ (x, c_x) |
|
4395 |
_COORD_ (y, c_y) |
|
4396 |
_COORD_ (z, c_z) |
|
4397 |
SETWIN(aGLXWindowId) |
|
1932 | 4398 |
#ifdef OPENGL |
4399 |
#else |
|
528 | 4400 |
rpmv(c_x, c_y, c_z); |
1932 | 4401 |
#endif |
528 | 4402 |
%} |
4403 |
||
4404 |
"Modified: 19.3.1996 / 18:38:03 / cg" |
|
4405 |
! |
|
4406 |
||
4407 |
glxRpmviX: x y: y z: z in: aGLXWindowId |
|
4408 |
"set the relative start position of a polygon" |
|
4409 |
||
4410 |
%{ /* NOCONTEXT */ |
|
4411 |
Icoord c_x, c_y, c_z; |
|
4412 |
||
4413 |
_ICOORD_ (x, c_x) |
|
4414 |
_ICOORD_ (y, c_y) |
|
4415 |
_ICOORD_ (z, c_z) |
|
4416 |
SETWIN(aGLXWindowId) |
|
1932 | 4417 |
#ifdef OPENGL |
4418 |
#else |
|
528 | 4419 |
rpmvi(c_x, c_y, c_z); |
1932 | 4420 |
#endif |
528 | 4421 |
%} |
4422 |
||
4423 |
"Modified: 19.3.1996 / 18:37:53 / cg" |
|
4424 |
! |
|
4425 |
||
4426 |
glxRpmvsX: x y: y z: z in: aGLXWindowId |
|
4427 |
"set the relative start position of a polygon" |
|
4428 |
||
4429 |
%{ /* NOCONTEXT */ |
|
4430 |
Scoord c_x, c_y, c_z; |
|
4431 |
||
4432 |
_SCOORD_ (x, c_x) |
|
4433 |
_SCOORD_ (y, c_y) |
|
4434 |
_SCOORD_ (z, c_z) |
|
4435 |
SETWIN(aGLXWindowId) |
|
1932 | 4436 |
#ifdef OPENGL |
4437 |
#else |
|
528 | 4438 |
rpmvs(c_x, c_y, c_z); |
1932 | 4439 |
#endif |
528 | 4440 |
%} |
4441 |
||
4442 |
"Modified: 19.3.1996 / 18:37:58 / cg" |
|
294 | 4443 |
! ! |
4444 |
||
24 | 4445 |
!GLXWorkstation methodsFor:'queries'! |
4446 |
||
159 | 4447 |
glVersion |
4448 |
"return a string describing the GL version. |
|
4449 |
For informative use only; portable applications do not depend |
|
4450 |
on the returned string." |
|
4451 |
||
4452 |
%{ /* NOCONTEXT */ |
|
4453 |
#ifdef VGL |
|
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
4454 |
RETURN (__MKSTRING("vogl")); |
159 | 4455 |
#else |
1932 | 4456 |
# ifdef GLX |
159 | 4457 |
char buffer[128]; |
4458 |
||
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4459 |
if (_INST(glOK) == true) { |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4460 |
gversion(buffer); |
1065
fdc5b9059d82
removed all COMMA_CON / CON_COMMA uses
Claus Gittinger <cg@exept.de>
parents:
969
diff
changeset
|
4461 |
RETURN (__MKSTRING(buffer)); |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4462 |
} |
1932 | 4463 |
RETURN (nil); |
4464 |
# else |
|
4465 |
RETURN (nil); |
|
4466 |
# endif |
|
159 | 4467 |
#endif |
4468 |
%} |
|
4469 |
||
4470 |
" |
|
4718 | 4471 |
Display glVersion |
159 | 4472 |
" |
4473 |
! |
|
4474 |
||
528 | 4475 |
glxGetplanesIn: aGLXWindowId |
4476 |
"Returns the number if bit planes available on the device." |
|
4477 |
||
4478 |
%{ /* NOCONTEXT */ |
|
1932 | 4479 |
SETWIN(aGLXWindowId) |
4480 |
#ifdef OPENGL |
|
4481 |
#else |
|
528 | 4482 |
RETURN (__MKSMALLINT(getplanes())); |
4483 |
#endif |
|
1932 | 4484 |
%}. |
4485 |
^ 0 |
|
528 | 4486 |
|
4487 |
"Modified: 19.3.1996 / 18:50:44 / cg" |
|
4488 |
! |
|
4489 |
||
294 | 4490 |
hasStereoExtension |
4491 |
"return true, if this workstation supports stereo GL drawing. |
|
4492 |
Both the server must support it, and the feature must have been |
|
4493 |
enabled in the smalltalk system, for true to be returned." |
|
4494 |
||
4495 |
^ hasStereoExtension |
|
4496 |
||
4497 |
" |
|
4718 | 4498 |
Display hasStereoExtension |
294 | 4499 |
" |
4500 |
! |
|
4501 |
||
3214 | 4502 |
isOpenGL |
4503 |
"return true, if this is an openGL (as opposed to a GL)" |
|
4504 |
||
4505 |
%{ /* NOCONTEXT */ |
|
4506 |
#ifdef OPENGL |
|
4507 |
RETURN ( true ); |
|
4508 |
#else |
|
4509 |
RETURN ( false ); |
|
4510 |
#endif |
|
4511 |
%} |
|
4512 |
! |
|
4513 |
||
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4514 |
isTrueGL |
1932 | 4515 |
"return true, if this is a true GL (as opposed to a simulated VOGL). |
4516 |
Returns false for all openGL systems." |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4517 |
|
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4518 |
%{ /* NOCONTEXT */ |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4519 |
#ifdef VGL |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4520 |
RETURN ( false ); |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4521 |
#else |
1932 | 4522 |
# ifdef GLX |
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4523 |
RETURN ( true ); |
1932 | 4524 |
# endif |
4525 |
#endif |
|
3214 | 4526 |
%}. |
4527 |
^ false |
|
448
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4528 |
! |
abcba4fa3fc0
added forceGL (or knowledgable SGI users)
Claus Gittinger <cg@exept.de>
parents:
389
diff
changeset
|
4529 |
|
294 | 4530 |
maxZValue |
4531 |
"return the max. Z value (only valid if z-buffer is supported)" |
|
4718 | 4532 |
%{ |
1932 | 4533 |
#ifndef OPENGL |
4534 |
# ifdef GD_ZMAX |
|
294 | 4535 |
long zMax; |
4536 |
||
4537 |
if (_INST(glOK) == true) { |
|
4538 |
zMax = getgdesc(GD_ZMAX); |
|
4539 |
||
4540 |
if ((zMax >= _MIN_INT) && (zMax <= _MAX_INT)) { |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4541 |
RETURN ( __MKSMALLINT(zMax) ); |
294 | 4542 |
} |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4543 |
RETURN ( __MKLARGEINT(zMax) ); |
294 | 4544 |
} |
1932 | 4545 |
# endif |
294 | 4546 |
#endif |
4547 |
%}. |
|
4548 |
^ nil |
|
4549 |
! |
|
4550 |
||
4551 |
supportsDoubleBuffer |
|
4552 |
"return true, if this gl workstation supports double buffering. |
|
157 | 4553 |
For portable applications, always combine this with a query |
4554 |
if the display supports GL drawing at all." |
|
24 | 4555 |
|
4556 |
%{ /* NOCONTEXT */ |
|
294 | 4557 |
|
1932 | 4558 |
#ifndef OPENGL |
4559 |
# ifdef VGL |
|
4560 |
RETURN (true); |
|
4561 |
# else |
|
4562 |
# ifdef GD_BITS_NORM_DBL_RED |
|
294 | 4563 |
if (getgdesc(GD_BITS_NORM_DBL_RED) != 0) { |
4564 |
RETURN ( _INST(glOK) ); |
|
4565 |
} |
|
1932 | 4566 |
# endif |
4567 |
# endif |
|
24 | 4568 |
#endif |
89 | 4569 |
%}. |
4570 |
^ false |
|
4571 |
||
4572 |
" |
|
4718 | 4573 |
Display supportsDoubleBuffer |
294 | 4574 |
" |
4575 |
! |
|
4576 |
||
4577 |
supportsGLDrawing |
|
4578 |
"return true, if this device supports 3D GL drawing." |
|
4579 |
||
4580 |
^ glOK |
|
4581 |
||
4582 |
" |
|
4718 | 4583 |
Display supportsGLDrawing |
89 | 4584 |
" |
64 | 4585 |
! |
4586 |
||
4587 |
supportsLight |
|
157 | 4588 |
"return true, if this gl workstation supports light sources |
4589 |
(i.e. if its a real GL). |
|
4590 |
For portable applications, always combine this with a query |
|
4591 |
if the display supports GL drawing at all." |
|
89 | 4592 |
|
4593 |
%{ /* NOCONTEXT */ |
|
64 | 4594 |
#ifdef GLX |
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4595 |
RETURN ( _INST(glOK) ); |
64 | 4596 |
#endif |
89 | 4597 |
%}. |
4598 |
^ false |
|
4599 |
||
4600 |
" |
|
4718 | 4601 |
Display supportsLight |
89 | 4602 |
" |
4603 |
! |
|
4604 |
||
294 | 4605 |
supportsRGB |
4606 |
"return true, if this gl workstation supports rgb |
|
4607 |
(in addition to indexed) colors. Actually, we return true |
|
4608 |
for a real GL engine, false for the simulator here. |
|
4609 |
For portable applications, always combine this with a query |
|
4610 |
if the display supports GL drawing at all." |
|
4611 |
||
4612 |
%{ /* NOCONTEXT */ |
|
4613 |
#ifdef GLX |
|
4614 |
RETURN ( _INST(glOK) ); |
|
4615 |
#endif |
|
4616 |
%}. |
|
4617 |
^ false |
|
4618 |
||
4619 |
" |
|
4718 | 4620 |
Display supportsRGB |
294 | 4621 |
" |
4622 |
! |
|
4623 |
||
89 | 4624 |
supportsTextures |
4625 |
"return true, if this gl workstation supports texture mapping |
|
157 | 4626 |
(i.e. if its a real GL). |
4627 |
For portable applications, always combine this with a query |
|
4628 |
if the display supports GL drawing at all." |
|
89 | 4629 |
|
4630 |
%{ /* NOCONTEXT */ |
|
1932 | 4631 |
#ifndef OPENGL |
4632 |
# ifdef GD_TEXTURE |
|
89 | 4633 |
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
|
4634 |
RETURN ( _INST(glOK) ); |
89 | 4635 |
} |
1932 | 4636 |
# endif |
89 | 4637 |
#endif |
4638 |
%}. |
|
4639 |
^ false |
|
4640 |
||
4641 |
" |
|
4718 | 4642 |
Display supportsTextures |
89 | 4643 |
" |
4644 |
! |
|
4645 |
||
4646 |
supportsZBuffer |
|
157 | 4647 |
"return true, if this gl workstation has z buffer support. |
4648 |
For portable applications, always combine this with a query |
|
4649 |
if the display supports GL drawing at all." |
|
4650 |
||
89 | 4651 |
%{ /* NOCONTEXT */ |
4652 |
||
1932 | 4653 |
#ifndef OPENGL |
4654 |
# ifdef GD_BITS_NORM_ZBUFFER |
|
89 | 4655 |
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
|
4656 |
RETURN ( _INST(glOK) ); |
89 | 4657 |
} |
1932 | 4658 |
# endif |
89 | 4659 |
#endif |
4660 |
%}. |
|
4661 |
^ false |
|
4662 |
||
4663 |
" |
|
4718 | 4664 |
Display supportsZBuffer |
89 | 4665 |
" |
294 | 4666 |
! ! |
4667 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4668 |
!GLXWorkstation methodsFor:'rectangles'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4669 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4670 |
glxRectX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4671 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4672 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4673 |
SETWIN(aGLXWindowId) |
1932 | 4674 |
#ifdef OPENGL |
4675 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4676 |
rect(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
1932 | 4677 |
#endif |
537
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 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4680 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4681 |
glxRectfX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4682 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4683 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4684 |
SETWIN(aGLXWindowId) |
1932 | 4685 |
#ifdef OPENGL |
4686 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4687 |
rectf(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
1932 | 4688 |
#endif |
537
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 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4691 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4692 |
glxRectfiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4693 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4694 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4695 |
SETWIN(aGLXWindowId) |
1932 | 4696 |
#ifdef OPENGL |
4697 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4698 |
rectfi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
1932 | 4699 |
#endif |
537
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 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4702 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4703 |
glxRectfsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4704 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4705 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4706 |
SETWIN(aGLXWindowId) |
1932 | 4707 |
#ifdef OPENGL |
4708 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4709 |
rectfs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
1932 | 4710 |
#endif |
537
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 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4713 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4714 |
glxRectiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4715 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4716 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4717 |
SETWIN(aGLXWindowId) |
1932 | 4718 |
#ifdef OPENGL |
4719 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4720 |
recti(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
1932 | 4721 |
#endif |
537
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 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4724 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4725 |
glxRectsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4726 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4727 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4728 |
SETWIN(aGLXWindowId) |
1932 | 4729 |
#ifdef OPENGL |
4730 |
#else |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4731 |
rects(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
1932 | 4732 |
#endif |
537
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 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
4735 |
|
528 | 4736 |
!GLXWorkstation methodsFor:'spheres'! |
294 | 4737 |
|
4738 |
glxSphDraw:arrayOf4Floats in:aGLXWindowId |
|
4739 |
"argument must be an array(a matrix) of 4 floats containing the |
|
4740 |
sphere - in real GL only" |
|
4741 |
||
4742 |
%{ /* NOCONTEXT */ |
|
4743 |
#ifdef GLX |
|
4744 |
float vec[4], *v; |
|
4745 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4746 |
if (! (v = __glx_getFloatsFromInto(arrayOf4Floats, vec, 4))) RETURN(false); |
294 | 4747 |
SETWIN(aGLXWindowId) |
4748 |
sphdraw(v); |
|
1932 | 4749 |
#endif |
4750 |
%} |
|
294 | 4751 |
! |
4752 |
||
4753 |
glxSphDrawX:x y:y z:z radius:r in:aGLXWindowId |
|
4754 |
"arguments must be convertable to floats - in real GL only" |
|
4755 |
||
4756 |
%{ /* NOCONTEXT */ |
|
4757 |
#ifdef GLX |
|
4758 |
float vec[4]; |
|
4759 |
||
4760 |
_FLOAT_(x, vec[0]) |
|
4761 |
_FLOAT_(y, vec[1]) |
|
4762 |
_FLOAT_(z, vec[2]) |
|
4763 |
_FLOAT_(r, vec[3]) |
|
4764 |
SETWIN(aGLXWindowId) |
|
4765 |
sphdraw(vec); |
|
1932 | 4766 |
#endif |
4767 |
%} |
|
294 | 4768 |
! |
4769 |
||
4770 |
glxSphfreeIn: aGLXWindowId |
|
4771 |
||
4772 |
%{ /* NOCONTEXT */ |
|
4773 |
#ifdef GLX |
|
4774 |
SETWIN(aGLXWindowId) |
|
4775 |
sphfree(); |
|
1932 | 4776 |
#endif |
4777 |
%} |
|
294 | 4778 |
! |
4779 |
||
4780 |
glxSphgnpolysIn: aGLXWindowId |
|
4781 |
||
4782 |
%{ /* NOCONTEXT */ |
|
4783 |
#ifdef GLX |
|
4784 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
4785 |
RETURN (__MKSMALLINT(sphgnpolys())); |
294 | 4786 |
#endif |
4787 |
%} |
|
4788 |
! |
|
4789 |
||
4790 |
glxSphmode: attribute value: value in: aGLXWindowId |
|
4791 |
||
4792 |
%{ /* NOCONTEXT */ |
|
4793 |
#ifdef GLX |
|
4794 |
SETWIN(aGLXWindowId) |
|
4795 |
sphmode(__intVal(attribute), __intVal(value)); |
|
1932 | 4796 |
#endif |
4797 |
%} |
|
294 | 4798 |
! |
4799 |
||
4800 |
glxSphobj: objid in: aGLXWindowId |
|
4801 |
||
4802 |
%{ /* NOCONTEXT */ |
|
4803 |
#ifdef GLX |
|
4804 |
SETWIN(aGLXWindowId) |
|
4805 |
sphobj(_objectVal(objid)); |
|
1932 | 4806 |
#endif |
4807 |
%} |
|
294 | 4808 |
! |
4809 |
||
4810 |
glxSphrotmatrix: mat in: aGLXWindowId |
|
4811 |
||
4812 |
%{ /* NOCONTEXT */ |
|
4813 |
#ifdef GLX |
|
4814 |
Matrix matrix, *m; |
|
4815 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
4816 |
if (! (m = __glx_getFloatsFromMatrixInto(mat, &matrix))) RETURN (false); |
294 | 4817 |
SETWIN(aGLXWindowId) |
4818 |
sphrotmatrix(*m); |
|
1932 | 4819 |
#endif |
4820 |
%} |
|
294 | 4821 |
! ! |
4822 |
||
4823 |
!GLXWorkstation methodsFor:'stereo extension'! |
|
4824 |
||
528 | 4825 |
glxLeftbuffer: bool in: aGLXWindowId |
4826 |
||
4827 |
%{ /* NOCONTEXT */ |
|
4828 |
#ifdef FULL_GLX |
|
4829 |
SETWIN(aGLXWindowId) |
|
4830 |
leftbuffer(_booleanVal(bool)); |
|
1932 | 4831 |
#endif |
4832 |
%} |
|
528 | 4833 |
! |
4834 |
||
4835 |
glxMonobufferIn: aGLXWindowId |
|
4836 |
||
4837 |
%{ /* NOCONTEXT */ |
|
4838 |
#ifdef FULL_GLX |
|
4839 |
SETWIN(aGLXWindowId) |
|
4840 |
monobuffer(); |
|
1932 | 4841 |
#endif |
4842 |
%} |
|
528 | 4843 |
! |
4844 |
||
4845 |
glxRightbuffer: bool in: aGLXWindowId |
|
4846 |
||
4847 |
%{ /* NOCONTEXT */ |
|
4848 |
#ifdef FULL_GLX |
|
4849 |
SETWIN(aGLXWindowId) |
|
4850 |
rightbuffer(_booleanVal(bool)); |
|
1932 | 4851 |
#endif |
4852 |
%} |
|
528 | 4853 |
! |
4854 |
||
294 | 4855 |
stereoExtensionBuffer:aBufferSymbol for:aWindowId |
4856 |
"set the current stereo buffer; the argument may be one of: |
|
4857 |
#left -> STEREO_BUFFER_LEFT |
|
4858 |
#right -> STEREO_BUFFER_RIGHT |
|
4859 |
" |
|
4860 |
||
4861 |
%{ /* NOCONTEXT */ |
|
4862 |
#if defined(XSGIStereo) && defined(GLX) |
|
4863 |
Status status; |
|
4864 |
int buffer; |
|
4865 |
Window win; |
|
4866 |
||
4718 | 4867 |
if (ISCONNECTED |
294 | 4868 |
&& __isExternalAddress(aWindowId)) { |
4869 |
win = _WindowVal(aWindowId); |
|
4870 |
if (aBufferSymbol == @symbol(left)) { |
|
4871 |
buffer = STEREO_BUFFER_LEFT; |
|
4872 |
} else { |
|
4873 |
if (aBufferSymbol == @symbol(right)) { |
|
4874 |
buffer = STEREO_BUFFER_RIGHT; |
|
4875 |
} else { |
|
4876 |
goto bad; |
|
4877 |
} |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
4878 |
} |
294 | 4879 |
status = XSGISetStereoBuffer(myDpy, win, buffer); |
4880 |
RETURN ( status ? true : false); |
|
4881 |
} |
|
4882 |
bad: ; |
|
4883 |
#endif |
|
4884 |
%}. |
|
4885 |
self primitiveFailed |
|
4886 |
||
4887 |
" |
|
4888 |
|t v| |
|
4889 |
||
4890 |
t := StandardSystemView new. |
|
4891 |
t extent:300@300. |
|
4892 |
v := GLXView origin:0.0@0.0 corner:1.0@1.0 in:t. |
|
4893 |
t openAndWait. |
|
4894 |
||
4718 | 4895 |
v device stereoExtensionBuffer:#left for:(v id). |
294 | 4896 |
(Delay forSeconds:10) wait. |
4718 | 4897 |
v device stereoExtensionBuffer:#right for:(v id). |
294 | 4898 |
" |
4899 |
! |
|
4900 |
||
4901 |
stereoExtensionMode:aModeSymbol height:h offset:o for:aWindowId |
|
4902 |
"set the current stereo mode; the argument may be one of: |
|
4903 |
nil/false #off -> turn it off |
|
4904 |
#bottom -> STEREO_BOTTOM |
|
4905 |
#top -> STEREO_TOP |
|
4906 |
" |
|
4907 |
||
4908 |
%{ /* NOCONTEXT */ |
|
4909 |
#if defined(XSGIStereo) && defined(GLX) |
|
4910 |
Status status; |
|
4911 |
int mode; |
|
4912 |
unsigned short us_h, us_o; |
|
4913 |
Window win; |
|
4914 |
||
4718 | 4915 |
if (ISCONNECTED |
294 | 4916 |
&& __bothSmallInteger(h, o) |
4917 |
&& __isExternalAddress(aWindowId)) { |
|
4918 |
win = _WindowVal(aWindowId); |
|
4919 |
if ((aModeSymbol == nil) |
|
4920 |
|| (aModeSymbol == false) |
|
4921 |
|| (aModeSymbol == @symbol(off))) { |
|
4922 |
mode = STEREO_OFF; |
|
4923 |
} else { |
|
4924 |
if (aModeSymbol == @symbol(bottom)) { |
|
4925 |
mode = STEREO_BOTTOM; |
|
4926 |
} else { |
|
4927 |
if (aModeSymbol == @symbol(top)) { |
|
4928 |
mode = STEREO_TOP; |
|
4929 |
} else { |
|
4930 |
goto bad; |
|
4931 |
} |
|
4932 |
} |
|
4933 |
} |
|
4934 |
us_h = __intVal(h); |
|
4935 |
us_o = __intVal(o); |
|
4936 |
status = XSGISetStereoMode(myDpy, win, us_h, us_o, mode); |
|
4937 |
RETURN ( status ? true : false); |
|
4938 |
} |
|
4939 |
bad: ; |
|
4940 |
#endif |
|
4941 |
%}. |
|
4942 |
self primitiveFailed |
|
4943 |
||
4944 |
" |
|
4718 | 4945 |
Display stereoExtensionMode:#top height:492 offset:532 for:(Display rootWindowId). |
294 | 4946 |
(Delay forSeconds:10) wait. |
4718 | 4947 |
Display stereoExtensionMode:#off height:0 offset:0 for:(Display rootWindowId). |
294 | 4948 |
" |
4949 |
! |
|
4950 |
||
4951 |
stereoExtensionModeIn:aWindowId |
|
4952 |
"return the current stereo mode for some window" |
|
4953 |
||
4954 |
%{ /* NOCONTEXT */ |
|
4955 |
#if defined(XSGIStereo) && defined(GLX) |
|
4956 |
int mode; |
|
4957 |
Window win; |
|
4958 |
||
4959 |
if (ISCONNECTED && __isExternalAddress(aWindowId)) { |
|
4960 |
win = _WindowVal(aWindowId); |
|
4961 |
mode = XSGIQueryStereoMode(myDpy, win); |
|
4962 |
switch (mode) { |
|
4963 |
case STEREO_OFF: |
|
4964 |
RETURN ( @symbol(off) ); |
|
4965 |
case STEREO_BOTTOM: |
|
4966 |
RETURN ( @symbol(bottom) ); |
|
4967 |
case STEREO_TOP: |
|
4968 |
RETURN ( @symbol(top) ); |
|
4969 |
} |
|
4970 |
RETURN ( @symbol(unsupported) ); |
|
4971 |
} |
|
4972 |
#endif |
|
4973 |
%}. |
|
4974 |
self primitiveFailed |
|
4975 |
||
4976 |
" |
|
4977 |
|v| |
|
4978 |
||
4979 |
v := StandardSystemView new. |
|
4980 |
v extent:300@300. |
|
4981 |
v openAndWait. |
|
4982 |
v device stereoExtensionModeIn:(v id) |
|
4983 |
||
4718 | 4984 |
Display stereoExtensionModeIn:Display rootWindowId |
294 | 4985 |
" |
4986 |
! |
|
4987 |
||
4988 |
stereoExtensionVersion |
|
4989 |
"return the stereo extensions version as an array consisting of |
|
4990 |
major and minor numbers." |
|
4991 |
||
4992 |
%{ /* NOCONTEXT */ |
|
4993 |
#if defined(XSGIStereo) && defined(GLX) |
|
4994 |
Status status; |
|
4995 |
Display *dpy = myDpy; |
|
4996 |
int major, minor; |
|
4997 |
||
4998 |
if (ISCONNECTED) { |
|
4999 |
status = XSGIStereoQueryVersion(myDpy, &major, &minor); |
|
5000 |
if (status == True) { |
|
5001 |
RETURN ( __ARRAY_WITH2(__MKSMALLINT(major), __MKSMALLINT(minor))); |
|
5002 |
} |
|
89 | 5003 |
} |
5004 |
#endif |
|
5005 |
%}. |
|
294 | 5006 |
self primitiveFailed |
185 | 5007 |
|
5008 |
" |
|
294 | 5009 |
Display stereoExtensionVersion |
185 | 5010 |
" |
24 | 5011 |
! ! |
5012 |
||
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5013 |
!GLXWorkstation methodsFor:'texture data transfer'! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5014 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5015 |
glxT2d: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5016 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5017 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5018 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5019 |
double vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5020 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5021 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5022 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5023 |
t2d(c_v); |
1932 | 5024 |
#endif |
5025 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5026 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5027 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5028 |
glxT2f: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5029 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5030 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5031 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5032 |
float vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5033 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5034 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5035 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5036 |
t2f(c_v); |
1932 | 5037 |
#endif |
5038 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5039 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5040 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5041 |
glxT2i: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5042 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5043 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5044 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5045 |
long vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5046 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5047 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5048 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5049 |
t2i(c_v); |
1932 | 5050 |
#endif |
5051 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5052 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5053 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5054 |
glxT2s: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5055 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5056 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5057 |
#ifdef GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5058 |
short vec[2], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5059 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5060 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 2))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5061 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5062 |
t2s(c_v); |
1932 | 5063 |
#endif |
5064 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5065 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5066 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5067 |
glxT3d:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5068 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5069 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5070 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5071 |
double vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5072 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5073 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5074 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5075 |
t3d(c_v); |
1932 | 5076 |
#endif |
5077 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5078 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5079 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5080 |
glxT3f:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5081 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5082 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5083 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5084 |
float vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5085 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5086 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5087 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5088 |
t3f(c_v); |
1932 | 5089 |
#endif |
5090 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5091 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5092 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5093 |
glxT3i:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5094 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5095 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5096 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5097 |
long vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5098 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5099 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5100 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5101 |
t3i(c_v); |
1932 | 5102 |
#endif |
5103 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5104 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5105 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5106 |
glxT3s:v in:aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5107 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5108 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5109 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5110 |
short vec[3], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5111 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5112 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5113 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5114 |
t3s(c_v); |
1932 | 5115 |
#endif |
5116 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5117 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5118 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5119 |
glxT4d: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5120 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5121 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5122 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5123 |
double vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5124 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5125 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5126 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5127 |
t4d(c_v); |
1932 | 5128 |
#endif |
5129 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5130 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5131 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5132 |
glxT4f: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5133 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5134 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5135 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5136 |
float vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5137 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5138 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5139 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5140 |
t4f(c_v); |
1932 | 5141 |
#endif |
5142 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5143 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5144 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5145 |
glxT4i: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5146 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5147 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5148 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5149 |
long vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5150 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5151 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5152 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5153 |
t4i(c_v); |
1932 | 5154 |
#endif |
5155 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5156 |
! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5157 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5158 |
glxT4s: v in: aGLXWindowId |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5159 |
|
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5160 |
%{ /* NOCONTEXT */ |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5161 |
#ifdef FULL_GLX |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5162 |
short vec[4], *c_v; |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5163 |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5164 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5165 |
SETWIN(aGLXWindowId) |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5166 |
t4s(c_v); |
1932 | 5167 |
#endif |
5168 |
%} |
|
537
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5169 |
! ! |
56ccc83b3ac7
commentary & category changes
Claus Gittinger <cg@exept.de>
parents:
529
diff
changeset
|
5170 |
|
294 | 5171 |
!GLXWorkstation methodsFor:'transformations'! |
5172 |
||
5173 |
glxRotate:angle axis:axis in:aGLXWindowId |
|
5174 |
"rotate the current matrix around the axis given by the axis arg, |
|
5175 |
which must be one of the symbols: #x, #y or #z. |
|
5176 |
The angle is in degrees." |
|
5177 |
||
5178 |
%{ /* NOCONTEXT */ |
|
5179 |
||
5180 |
char c_axis; |
|
5181 |
||
5182 |
if (axis == @symbol(x)) |
|
5183 |
c_axis = 'x'; |
|
5184 |
else if (axis == @symbol(y)) |
|
5185 |
c_axis = 'y'; |
|
5186 |
else if (axis == @symbol(z)) |
|
5187 |
c_axis = 'z'; |
|
5188 |
else { |
|
5189 |
RETURN (false); |
|
5190 |
} |
|
5191 |
||
5192 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5193 |
RETURN ( __glx_doRotate(angle, c_axis) ); |
294 | 5194 |
%} |
5195 |
! |
|
5196 |
||
5197 |
glxRotate:arrayOf3Floats in:aGLXWindowId |
|
5198 |
"rotate current matrix, given a 3-element vector (or more). |
|
5199 |
The elements of the array are degrees." |
|
5200 |
||
5201 |
%{ /* NOCONTEXT */ |
|
5202 |
||
5203 |
float vec[3], *v; |
|
5204 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5205 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5206 |
|
5207 |
SETWIN(aGLXWindowId) |
|
1932 | 5208 |
#ifdef OPENGL |
5209 |
#else |
|
294 | 5210 |
rot(v[0], 'x'); |
5211 |
rot(v[1], 'y'); |
|
5212 |
rot(v[2], 'z'); |
|
1932 | 5213 |
#endif |
294 | 5214 |
%} |
5215 |
! |
|
5216 |
||
5217 |
glxRotateI:angle axis:axis in:aGLXWindowId |
|
5218 |
"rotate the current matrix around the axis given by the axis arg, |
|
5219 |
which must be one of the symbols: #x, #y or #z. |
|
5220 |
The angle is an integer specifying tenths of a degree." |
|
5221 |
||
5222 |
%{ /* NOCONTEXT */ |
|
5223 |
||
5224 |
char c_axis; |
|
5225 |
||
5226 |
if (axis == @symbol(x)) |
|
5227 |
c_axis = 'x'; |
|
5228 |
else if (axis == @symbol(y)) |
|
5229 |
c_axis = 'y'; |
|
5230 |
else if (axis == @symbol(z)) |
|
5231 |
c_axis = 'z'; |
|
5232 |
else { |
|
5233 |
RETURN (false); |
|
5234 |
} |
|
5235 |
||
5236 |
if (__isSmallInteger(angle)) { |
|
5237 |
SETWIN(aGLXWindowId) |
|
1932 | 5238 |
#ifdef OPENGL |
5239 |
#else |
|
294 | 5240 |
rotate(__intVal(angle), c_axis); |
1932 | 5241 |
#endif |
294 | 5242 |
} |
5243 |
%} |
|
5244 |
! |
|
5245 |
||
5246 |
glxRotateIX:angle in:aGLXWindowId |
|
5247 |
"rotate the current matrix on x axis. |
|
5248 |
The angle is an integer specifying tenths of a degree." |
|
5249 |
||
5250 |
%{ /* NOCONTEXT */ |
|
5251 |
||
5252 |
if (__isSmallInteger(angle)) { |
|
5253 |
SETWIN(aGLXWindowId) |
|
1932 | 5254 |
#ifdef OPENGL |
5255 |
#else |
|
294 | 5256 |
rotate(__intVal(angle), 'x'); |
1932 | 5257 |
#endif |
294 | 5258 |
} |
5259 |
%} |
|
5260 |
! |
|
5261 |
||
5262 |
glxRotateIX:xAngle y:yAngle z:zAngle in:aGLXWindowId |
|
5263 |
"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
|
5264 |
The values are smallIntegers specifying tenths of a degree." |
294 | 5265 |
|
5266 |
%{ /* NOCONTEXT */ |
|
5267 |
||
5268 |
if (__bothSmallInteger(xAngle, yAngle) |
|
5269 |
&& __isSmallInteger(zAngle)) { |
|
5270 |
SETWIN(aGLXWindowId) |
|
1932 | 5271 |
#ifdef OPENGL |
5272 |
#else |
|
294 | 5273 |
rotate(__intVal(xAngle), 'x'); |
5274 |
rotate(__intVal(yAngle), 'y'); |
|
5275 |
rotate(__intVal(zAngle), 'z'); |
|
1932 | 5276 |
#endif |
294 | 5277 |
} |
5278 |
%} |
|
5279 |
! |
|
5280 |
||
5281 |
glxRotateIY:angle in:aGLXWindowId |
|
5282 |
"rotate the current matrix on x axis. |
|
5283 |
The angle is an integer specifying tenths of a degree." |
|
5284 |
||
5285 |
%{ /* NOCONTEXT */ |
|
5286 |
||
5287 |
if (__isSmallInteger(angle)) { |
|
5288 |
SETWIN(aGLXWindowId) |
|
1932 | 5289 |
#ifdef OPENGL |
5290 |
#else |
|
294 | 5291 |
rotate(__intVal(angle), 'y'); |
1932 | 5292 |
#endif |
294 | 5293 |
} |
5294 |
%} |
|
5295 |
! |
|
5296 |
||
5297 |
glxRotateIZ:angle in:aGLXWindowId |
|
5298 |
"rotate the current matrix on x axis. |
|
5299 |
The angle is an integer specifying tenths of a degree." |
|
5300 |
||
5301 |
%{ /* NOCONTEXT */ |
|
5302 |
||
5303 |
if (__isSmallInteger(angle)) { |
|
5304 |
SETWIN(aGLXWindowId) |
|
1932 | 5305 |
#ifdef OPENGL |
5306 |
#else |
|
294 | 5307 |
rotate(__intVal(angle), 'z'); |
1932 | 5308 |
#endif |
294 | 5309 |
} |
5310 |
%} |
|
5311 |
! |
|
5312 |
||
5313 |
glxRotateX:angle in:aGLXWindowId |
|
5314 |
"rotate the current matrix on x axis. |
|
5315 |
The angle is in degrees." |
|
5316 |
||
5317 |
%{ /* NOCONTEXT */ |
|
5318 |
||
5319 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5320 |
RETURN (__glx_doRotate(angle, 'x')); |
294 | 5321 |
%} |
5322 |
! |
|
5323 |
||
5324 |
glxRotateX:xAngle y:yAngle z:zAngle in:aGLXWindowId |
|
5325 |
"rotate the current matrix on all axes, given individual x, y and z values. |
|
5326 |
The values are in degrees" |
|
5327 |
||
5328 |
%{ /* NOCONTEXT */ |
|
5329 |
||
5330 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5331 |
if ( __glx_doRotate(xAngle, 'x') == true) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5332 |
if ( __glx_doRotate(yAngle, 'y') == true) { |
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5333 |
RETURN (__glx_doRotate(zAngle, 'z')); |
294 | 5334 |
} |
5335 |
} |
|
5336 |
%} |
|
5337 |
! |
|
5338 |
||
5339 |
glxRotateY:angle in:aGLXWindowId |
|
5340 |
"rotate the current matrix on y axis. |
|
5341 |
The angle is in degrees." |
|
5342 |
||
5343 |
%{ /* NOCONTEXT */ |
|
5344 |
||
5345 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5346 |
RETURN (__glx_doRotate(angle, 'y')); |
294 | 5347 |
%} |
5348 |
! |
|
5349 |
||
5350 |
glxRotateZ:angle in:aGLXWindowId |
|
5351 |
"rotate the current matrix on z axis. |
|
5352 |
The angle is in degrees." |
|
5353 |
||
5354 |
%{ /* NOCONTEXT */ |
|
5355 |
||
5356 |
SETWIN(aGLXWindowId) |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5357 |
RETURN (__glx_doRotate(angle, 'z')); |
294 | 5358 |
%} |
5359 |
! |
|
5360 |
||
5361 |
glxScale:arrayOf3Floats in:aGLXWindowId |
|
5362 |
"scale current matrix, given a 3-element vector" |
|
5363 |
||
5364 |
%{ /* NOCONTEXT */ |
|
5365 |
||
5366 |
float vec[3], *v; |
|
5367 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5368 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5369 |
|
5370 |
SETWIN(aGLXWindowId) |
|
1932 | 5371 |
#ifdef OPENGL |
5372 |
#else |
|
294 | 5373 |
scale(v[0], v[1], v[2]); |
1932 | 5374 |
#endif |
294 | 5375 |
%} |
5376 |
! |
|
5377 |
||
5378 |
glxScaleX:x in:aGLXWindowId |
|
5379 |
"scale in x direction" |
|
5380 |
||
5381 |
%{ /* NOCONTEXT */ |
|
5382 |
||
5383 |
float f_x; |
|
5384 |
||
5385 |
_FLOAT_ (x, f_x) |
|
5386 |
SETWIN(aGLXWindowId) |
|
1932 | 5387 |
#ifdef OPENGL |
5388 |
#else |
|
294 | 5389 |
scale(f_x, (float)0, (float)0); |
1932 | 5390 |
#endif |
294 | 5391 |
%} |
5392 |
! |
|
5393 |
||
5394 |
glxScaleX:x y:y z:z in:aGLXWindowId |
|
5395 |
"scale & mirror current matrix, given individual x, y and z values" |
|
5396 |
||
5397 |
%{ /* NOCONTEXT */ |
|
5398 |
||
5399 |
float f_x, f_y, f_z; |
|
5400 |
||
5401 |
_FLOAT_ (x, f_x) |
|
5402 |
_FLOAT_ (y, f_y) |
|
5403 |
_FLOAT_ (z, f_z) |
|
5404 |
SETWIN(aGLXWindowId) |
|
1932 | 5405 |
#ifdef OPENGL |
5406 |
#else |
|
294 | 5407 |
scale(f_x, f_y, f_z); |
1932 | 5408 |
#endif |
294 | 5409 |
%} |
5410 |
! |
|
5411 |
||
5412 |
glxScaleY:y in:aGLXWindowId |
|
5413 |
"scale in y direction" |
|
5414 |
||
5415 |
%{ /* NOCONTEXT */ |
|
5416 |
||
5417 |
float f_y; |
|
5418 |
||
5419 |
_FLOAT_ (y, f_y) |
|
5420 |
SETWIN(aGLXWindowId) |
|
1932 | 5421 |
#ifdef OPENGL |
5422 |
#else |
|
294 | 5423 |
scale((float)0, f_y, (float)0); |
1932 | 5424 |
#endif |
294 | 5425 |
%} |
5426 |
! |
|
5427 |
||
5428 |
glxScaleZ:z in:aGLXWindowId |
|
5429 |
"scale in z direction" |
|
5430 |
||
5431 |
%{ /* NOCONTEXT */ |
|
5432 |
||
5433 |
float f_z; |
|
5434 |
||
5435 |
_FLOAT_ (z, f_z) |
|
5436 |
SETWIN(aGLXWindowId) |
|
1932 | 5437 |
#ifdef OPENGL |
5438 |
#else |
|
294 | 5439 |
scale((float)0, (float)0, f_z); |
1932 | 5440 |
#endif |
294 | 5441 |
%} |
5442 |
! |
|
5443 |
||
5444 |
glxTranslate:arrayOf3Floats in:aGLXWindowId |
|
5445 |
"translate current matrix, given a 3-element vector" |
|
5446 |
||
5447 |
%{ /* NOCONTEXT */ |
|
5448 |
||
5449 |
float vec[3], *v; |
|
5450 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5451 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 5452 |
|
5453 |
SETWIN(aGLXWindowId) |
|
1932 | 5454 |
#ifdef OPENGL |
5455 |
#else |
|
294 | 5456 |
translate((Coord)(v[0]), (Coord)(v[1]), (Coord)(v[2])); |
1932 | 5457 |
#endif |
294 | 5458 |
%} |
5459 |
! |
|
5460 |
||
5461 |
glxTranslateX:x in:aGLXWindowId |
|
5462 |
"translate current matrix on X axis" |
|
5463 |
||
5464 |
%{ /* NOCONTEXT */ |
|
5465 |
||
5466 |
Coord c_x; |
|
5467 |
||
5468 |
_COORD_ (x, c_x) |
|
5469 |
SETWIN(aGLXWindowId) |
|
1932 | 5470 |
#ifdef OPENGL |
5471 |
#else |
|
294 | 5472 |
translate(c_x, (Coord)0, (Coord)0); |
1932 | 5473 |
#endif |
294 | 5474 |
%} |
5475 |
! |
|
5476 |
||
5477 |
glxTranslateX:x y:y z:z in:aGLXWindowId |
|
5478 |
"translate current matrix, given individual x, y and z values" |
|
5479 |
||
5480 |
%{ /* NOCONTEXT */ |
|
5481 |
||
5482 |
Coord c_x, c_y, c_z; |
|
5483 |
||
5484 |
_COORD_ (x, c_x) |
|
5485 |
_COORD_ (y, c_y) |
|
5486 |
_COORD_ (z, c_z) |
|
5487 |
SETWIN(aGLXWindowId) |
|
1932 | 5488 |
#ifdef OPENGL |
5489 |
#else |
|
294 | 5490 |
translate(c_x, c_y, c_z); |
1932 | 5491 |
#endif |
294 | 5492 |
%} |
5493 |
! |
|
5494 |
||
5495 |
glxTranslateY:y in:aGLXWindowId |
|
5496 |
"translate current matrix on Y axis" |
|
5497 |
||
5498 |
%{ /* NOCONTEXT */ |
|
5499 |
||
5500 |
Coord c_y; |
|
5501 |
||
5502 |
_COORD_ (y, c_y) |
|
5503 |
SETWIN(aGLXWindowId) |
|
1932 | 5504 |
#ifdef OPENGL |
5505 |
#else |
|
294 | 5506 |
translate((Coord)0, c_y, (Coord)0); |
1932 | 5507 |
#endif |
294 | 5508 |
%} |
5509 |
! |
|
5510 |
||
5511 |
glxTranslateZ:z in:aGLXWindowId |
|
5512 |
"translate current matrix on Z axis" |
|
5513 |
||
5514 |
%{ /* NOCONTEXT */ |
|
5515 |
||
5516 |
Coord c_z; |
|
5517 |
||
5518 |
_COORD_ (z, c_z) |
|
5519 |
SETWIN(aGLXWindowId) |
|
1932 | 5520 |
#ifdef OPENGL |
5521 |
#else |
|
294 | 5522 |
translate((Coord)0, (Coord)0, c_z); |
1932 | 5523 |
#endif |
294 | 5524 |
%} |
5525 |
! ! |
|
5526 |
||
5527 |
!GLXWorkstation methodsFor:'unspecified rest'! |
|
5528 |
||
5529 |
glxAcbufOp:op value:value in:aGLXWindowId |
|
5530 |
||
5531 |
%{ /* NOCONTEXT */ |
|
1932 | 5532 |
SETWIN(aGLXWindowId) |
5533 |
#ifdef GLX |
|
294 | 5534 |
acbuf(__intVal(op), _floatVal(value)); |
1932 | 5535 |
#endif |
5536 |
%} |
|
294 | 5537 |
! |
5538 |
||
5539 |
glxAcsizePlanes: planes in: aGLXWindowId |
|
5540 |
||
5541 |
%{ /* NOCONTEXT */ |
|
1932 | 5542 |
SETWIN(aGLXWindowId) |
5543 |
#ifdef GLX |
|
294 | 5544 |
acsize(__intVal(planes)); |
1932 | 5545 |
#endif |
5546 |
%} |
|
294 | 5547 |
! |
5548 |
||
5549 |
glxAfunctionRef: ref func: func in: aGLXWindowId |
|
5550 |
||
5551 |
%{ /* NOCONTEXT */ |
|
1932 | 5552 |
SETWIN(aGLXWindowId) |
5553 |
#ifdef GLX |
|
294 | 5554 |
afunction(__intVal(ref), __intVal(func)); |
1932 | 5555 |
#endif |
5556 |
%} |
|
294 | 5557 |
! |
5558 |
||
5559 |
glxBbox2Xmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5560 |
||
5561 |
%{ /* NOCONTEXT */ |
|
5562 |
Screencoord c_xmin, c_ymin; |
|
4718 | 5563 |
Coord c_x1, c_y1, c_x2, c_y2; |
294 | 5564 |
|
5565 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5566 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5567 |
_COORD_ (x1, c_x1) |
|
5568 |
_COORD_ (y1, c_y1) |
|
5569 |
_COORD_ (x2, c_x2) |
|
5570 |
_COORD_ (y2, c_y2) |
|
5571 |
SETWIN(aGLXWindowId) |
|
1932 | 5572 |
#ifdef GLX |
294 | 5573 |
bbox2(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5574 |
#endif |
5575 |
%} |
|
294 | 5576 |
! |
5577 |
||
5578 |
glxBbox2iXmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5579 |
||
5580 |
%{ /* NOCONTEXT */ |
|
5581 |
Screencoord c_xmin, c_ymin; |
|
4718 | 5582 |
Icoord c_x1, c_y1, c_x2, c_y2; |
294 | 5583 |
|
5584 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5585 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5586 |
_ICOORD_ (x1, c_x1) |
|
5587 |
_ICOORD_ (y1, c_y1) |
|
5588 |
_ICOORD_ (x2, c_x2) |
|
5589 |
_ICOORD_ (y2, c_y2) |
|
5590 |
SETWIN(aGLXWindowId) |
|
1932 | 5591 |
#ifdef GLX |
294 | 5592 |
bbox2i(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5593 |
#endif |
5594 |
%} |
|
294 | 5595 |
! |
5596 |
||
5597 |
glxBbox2sXmin: xmin ymin: ymin x1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
5598 |
||
5599 |
%{ /* NOCONTEXT */ |
|
5600 |
Screencoord c_xmin, c_ymin; |
|
4718 | 5601 |
Scoord c_x1, c_y1, c_x2, c_y2; |
294 | 5602 |
|
5603 |
_SCREENCOORD_ (xmin, c_xmin) |
|
5604 |
_SCREENCOORD_ (ymin, c_ymin) |
|
5605 |
_SCOORD_ (x1, c_x1) |
|
5606 |
_SCOORD_ (y1, c_y1) |
|
5607 |
_SCOORD_ (x2, c_x2) |
|
5608 |
_SCOORD_ (y2, c_y2) |
|
5609 |
SETWIN(aGLXWindowId) |
|
1932 | 5610 |
#ifdef GLX |
294 | 5611 |
bbox2s(c_xmin, c_ymin, c_x1, c_y1, c_x2, c_y2); |
1932 | 5612 |
#endif |
5613 |
%} |
|
294 | 5614 |
! |
5615 |
||
5616 |
glxBeginTrimIn: aGLXWindowId |
|
5617 |
||
5618 |
%{ /* NOCONTEXT */ |
|
1932 | 5619 |
SETWIN(aGLXWindowId) |
5620 |
#ifdef GLX |
|
294 | 5621 |
bgntrim(); |
1932 | 5622 |
#endif |
5623 |
%} |
|
294 | 5624 |
! |
5625 |
||
5626 |
glxBlankscreen: b in: aGLXWindowId |
|
5627 |
||
5628 |
%{ /* NOCONTEXT */ |
|
1932 | 5629 |
SETWIN(aGLXWindowId) |
5630 |
#ifdef GLX |
|
294 | 5631 |
blankscreen(_booleanVal(b)); |
1932 | 5632 |
#endif |
5633 |
%} |
|
294 | 5634 |
! |
5635 |
||
5636 |
glxBlanktime: count in: aGLXWindowId |
|
5637 |
||
5638 |
%{ /* NOCONTEXT */ |
|
1932 | 5639 |
SETWIN(aGLXWindowId) |
5640 |
#ifdef GLX |
|
294 | 5641 |
blanktime(__intVal(count)); |
1932 | 5642 |
#endif |
5643 |
%} |
|
294 | 5644 |
! |
5645 |
||
5646 |
glxBlendcolorRed: red green: green blue: blue alpha: alpha in: aGLXWindowId |
|
5647 |
||
5648 |
%{ /* NOCONTEXT */ |
|
1932 | 5649 |
SETWIN(aGLXWindowId) |
294 | 5650 |
#ifdef FULL_GLX |
4718 | 5651 |
blendcolor(_floatVal(red), _floatVal(green), _floatVal(blue), _floatVal(alpha)); |
1932 | 5652 |
#endif |
5653 |
%} |
|
294 | 5654 |
! |
5655 |
||
5656 |
glxBlendfunctionSfactr: sfactr dfactr: dfactr in: aGLXWindowId |
|
5657 |
||
5658 |
%{ /* NOCONTEXT */ |
|
1932 | 5659 |
SETWIN(aGLXWindowId) |
5660 |
#ifdef GLX |
|
294 | 5661 |
blendfunction(__intVal(sfactr), __intVal(dfactr)); |
1932 | 5662 |
#endif |
5663 |
%} |
|
294 | 5664 |
! |
5665 |
||
5666 |
glxBlinkRate: rate i: i red: red green: green blue: blue in: aGLXWindowId |
|
5667 |
||
5668 |
%{ /* NOCONTEXT */ |
|
1932 | 5669 |
SETWIN(aGLXWindowId) |
5670 |
#ifdef GLX |
|
4718 | 5671 |
blink(_shortVal(rate), _colorindexVal(i), |
294 | 5672 |
_shortVal(red), _shortVal(green), _shortVal(blue)); |
1932 | 5673 |
#endif |
5674 |
%} |
|
294 | 5675 |
! |
5676 |
||
5677 |
glxBlkqreadData: data n: n in: aGLXWindowId |
|
5678 |
||
5679 |
%{ /* NOCONTEXT */ |
|
1932 | 5680 |
int rslt = -1; |
5681 |
||
5682 |
SETWIN(aGLXWindowId) |
|
5683 |
#ifdef GLX |
|
5684 |
rslt = blkqread((short *)_indexedArea(data), __intVal(n)); |
|
5685 |
#endif |
|
5686 |
RETURN (__MKSMALLINT(rslt)); |
|
5687 |
%} |
|
294 | 5688 |
! |
5689 |
||
5690 |
glxC3f: v in: aGLXWindowId |
|
5691 |
||
5692 |
%{ /* NOCONTEXT */ |
|
5693 |
float vec[3], *c_v; |
|
5694 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5695 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
294 | 5696 |
SETWIN(aGLXWindowId) |
1932 | 5697 |
#ifdef GLX |
294 | 5698 |
c3f(c_v); |
1932 | 5699 |
#endif |
5700 |
%} |
|
294 | 5701 |
! |
5702 |
||
5703 |
glxC3i: v in: aGLXWindowId |
|
5704 |
||
5705 |
%{ /* NOCONTEXT */ |
|
5706 |
long vec[3], *c_v; |
|
5707 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5708 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
294 | 5709 |
SETWIN(aGLXWindowId) |
1932 | 5710 |
#ifdef GLX |
294 | 5711 |
c3i(c_v); |
1932 | 5712 |
#endif |
5713 |
%} |
|
294 | 5714 |
! |
5715 |
||
5716 |
glxC3s: v in: aGLXWindowId |
|
5717 |
||
5718 |
%{ /* NOCONTEXT */ |
|
5719 |
short vec[3], *c_v; |
|
5720 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5721 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
294 | 5722 |
SETWIN(aGLXWindowId) |
1932 | 5723 |
#ifdef GLX |
294 | 5724 |
c3s(c_v); |
1932 | 5725 |
#endif |
5726 |
%} |
|
294 | 5727 |
! |
5728 |
||
5729 |
glxC4f: v in: aGLXWindowId |
|
5730 |
||
5731 |
%{ /* NOCONTEXT */ |
|
5732 |
float vec[4], *c_v; |
|
5733 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5734 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
294 | 5735 |
SETWIN(aGLXWindowId) |
1932 | 5736 |
#ifdef GLX |
294 | 5737 |
c4f(c_v); |
1932 | 5738 |
#endif |
5739 |
%} |
|
294 | 5740 |
! |
5741 |
||
5742 |
glxC4i: v in: aGLXWindowId |
|
5743 |
||
5744 |
%{ /* NOCONTEXT */ |
|
5745 |
long vec[4], *c_v; |
|
5746 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5747 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
294 | 5748 |
SETWIN(aGLXWindowId) |
1932 | 5749 |
#ifdef GLX |
294 | 5750 |
c4i(c_v); |
1932 | 5751 |
#endif |
5752 |
%} |
|
294 | 5753 |
! |
5754 |
||
5755 |
glxC4s: v in: aGLXWindowId |
|
5756 |
||
5757 |
%{ /* NOCONTEXT */ |
|
5758 |
short vec[4], *c_v; |
|
5759 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5760 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
294 | 5761 |
SETWIN(aGLXWindowId) |
1932 | 5762 |
#ifdef GLX |
294 | 5763 |
c4s(c_v); |
1932 | 5764 |
#endif |
5765 |
%} |
|
294 | 5766 |
! |
5767 |
||
5768 |
glxClearhitcodeIn: aGLXWindowId |
|
5769 |
||
5770 |
%{ /* NOCONTEXT */ |
|
1932 | 5771 |
SETWIN(aGLXWindowId) |
5772 |
#ifdef GLX |
|
294 | 5773 |
clearhitcode(); |
1932 | 5774 |
#endif |
5775 |
%} |
|
294 | 5776 |
! |
5777 |
||
5778 |
glxClipplaneIndex: index mode: mode params: params in: aGLXWindowId |
|
5779 |
||
5780 |
%{ /* NOCONTEXT */ |
|
5781 |
float vec[4], *v; |
|
5782 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
5783 |
if (! (v = __glx_getFloatsFromInto(params, vec, 4))) RETURN(false); |
294 | 5784 |
SETWIN(aGLXWindowId) |
1932 | 5785 |
#ifdef GLX |
294 | 5786 |
clipplane(__intVal(index), __intVal(mode), v); |
1932 | 5787 |
#endif |
5788 |
%} |
|
294 | 5789 |
! |
5790 |
||
5791 |
glxCmodeIn: aGLXWindowId |
|
5792 |
||
5793 |
%{ /* NOCONTEXT */ |
|
1932 | 5794 |
SETWIN(aGLXWindowId) |
5795 |
#ifdef GLX |
|
294 | 5796 |
cmode(); |
1932 | 5797 |
#endif |
5798 |
%} |
|
294 | 5799 |
! |
5800 |
||
5801 |
glxColorfIndex: index in: aGLXWindowId |
|
5802 |
||
5803 |
^self glxColor: index in: aGLXWindowId |
|
5804 |
! |
|
5805 |
||
5806 |
glxCuroriginN: n xorigin: xorigin yorigin: yorigin in: aGLXWindowId |
|
5807 |
||
5808 |
%{ /* NOCONTEXT */ |
|
1932 | 5809 |
SETWIN(aGLXWindowId) |
5810 |
#ifdef GLX |
|
294 | 5811 |
curorigin(_shortVal(n), _shortVal(xorigin), _shortVal(yorigin)); |
1932 | 5812 |
#endif |
5813 |
%} |
|
294 | 5814 |
! |
5815 |
||
5816 |
glxCursoffIn: aGLXWindowId |
|
5817 |
||
5818 |
%{ /* NOCONTEXT */ |
|
1932 | 5819 |
SETWIN(aGLXWindowId) |
5820 |
#ifdef GLX |
|
294 | 5821 |
cursoff(); |
1932 | 5822 |
#endif |
5823 |
%} |
|
294 | 5824 |
! |
5825 |
||
5826 |
glxCursonIn: aGLXWindowId |
|
5827 |
||
5828 |
%{ /* NOCONTEXT */ |
|
1932 | 5829 |
SETWIN(aGLXWindowId) |
5830 |
#ifdef GLX |
|
294 | 5831 |
curson(); |
1932 | 5832 |
#endif |
5833 |
%} |
|
294 | 5834 |
! |
5835 |
||
5836 |
glxCurstype: type in: aGLXWindowId |
|
5837 |
||
5838 |
%{ /* NOCONTEXT */ |
|
1932 | 5839 |
SETWIN(aGLXWindowId) |
5840 |
#ifdef GLX |
|
294 | 5841 |
curstype(__intVal(type)); |
1932 | 5842 |
#endif |
5843 |
%} |
|
294 | 5844 |
! |
5845 |
||
5846 |
glxCyclemapDuration: duration map: map nxtmap: nxtmap in: aGLXWindowId |
|
5847 |
||
5848 |
%{ /* NOCONTEXT */ |
|
1932 | 5849 |
SETWIN(aGLXWindowId) |
5850 |
#ifdef GLX |
|
294 | 5851 |
cyclemap(_shortVal(duration), _shortVal(map), _shortVal(nxtmap)); |
1932 | 5852 |
#endif |
5853 |
%} |
|
294 | 5854 |
! |
5855 |
||
5856 |
glxDefpatternN: n size: size mask: mask in: aGLXWindowId |
|
5857 |
||
5858 |
%{ /* NOCONTEXT */ |
|
1932 | 5859 |
SETWIN(aGLXWindowId) |
5860 |
#ifdef GLX |
|
294 | 5861 |
defpattern(_shortVal(n), _shortVal(size), (unsigned short *)_indexedArea(mask)); |
1932 | 5862 |
#endif |
5863 |
%} |
|
294 | 5864 |
! |
5865 |
||
5866 |
glxDeltag: t in: aGLXWindowId |
|
5867 |
||
5868 |
%{ /* NOCONTEXT */ |
|
1932 | 5869 |
SETWIN(aGLXWindowId) |
5870 |
#ifdef GLX |
|
294 | 5871 |
deltag(_tagVal(t)); |
1932 | 5872 |
#endif |
5873 |
%} |
|
294 | 5874 |
! |
5875 |
||
5876 |
glxDepthcueMode: mode in: aGLXWindowId |
|
5877 |
||
5878 |
%{ /* NOCONTEXT */ |
|
1932 | 5879 |
SETWIN(aGLXWindowId) |
5880 |
#ifdef GLX |
|
294 | 5881 |
depthcue(_booleanVal(mode)); |
1932 | 5882 |
#endif |
5883 |
%} |
|
294 | 5884 |
! |
5885 |
||
5886 |
glxDitherMode: mode in: aGLXWindowId |
|
5887 |
||
5888 |
%{ /* NOCONTEXT */ |
|
1932 | 5889 |
SETWIN(aGLXWindowId) |
5890 |
#ifdef GLX |
|
294 | 5891 |
dither(_longVal(mode)); |
1932 | 5892 |
#endif |
5893 |
%} |
|
294 | 5894 |
! |
5895 |
||
5896 |
glxDopup: pup in: aGLXWindowId |
|
5897 |
||
5898 |
%{ /* NOCONTEXT */ |
|
1932 | 5899 |
SETWIN(aGLXWindowId) |
5900 |
#ifdef GLX |
|
294 | 5901 |
dopup(_longVal(pup)); |
1932 | 5902 |
#endif |
5903 |
%} |
|
294 | 5904 |
! |
5905 |
||
5906 |
glxDrawmode: mode in: aGLXWindowId |
|
5907 |
||
5908 |
%{ /* NOCONTEXT */ |
|
1932 | 5909 |
SETWIN(aGLXWindowId) |
5910 |
#ifdef GLX |
|
294 | 5911 |
drawmode(_longVal(mode)); |
1932 | 5912 |
#endif |
5913 |
%} |
|
294 | 5914 |
! |
5915 |
||
5916 |
glxEditobj: obj in: aGLXWindowId |
|
5917 |
||
5918 |
%{ /* NOCONTEXT */ |
|
1932 | 5919 |
SETWIN(aGLXWindowId) |
5920 |
#ifdef GLX |
|
294 | 5921 |
editobj(_objectVal(obj)); |
1932 | 5922 |
#endif |
5923 |
%} |
|
294 | 5924 |
! |
5925 |
||
5926 |
glxEndTrimIn: aGLXWindowId |
|
5927 |
||
5928 |
%{ /* NOCONTEXT */ |
|
1932 | 5929 |
SETWIN(aGLXWindowId) |
5930 |
#ifdef GLX |
|
294 | 5931 |
endtrim(); |
1932 | 5932 |
#endif |
5933 |
%} |
|
294 | 5934 |
! |
5935 |
||
5936 |
glxEndfullscrnIn: aGLXWindowId |
|
5937 |
||
5938 |
%{ /* NOCONTEXT */ |
|
1932 | 5939 |
SETWIN(aGLXWindowId) |
5940 |
#ifdef GLX |
|
294 | 5941 |
endfullscrn(); |
1932 | 5942 |
#endif |
5943 |
%} |
|
294 | 5944 |
! |
5945 |
||
5946 |
glxEndpupmodeIn: aGLXWindowId |
|
5947 |
||
5948 |
%{ /* NOCONTEXT */ |
|
1932 | 5949 |
SETWIN(aGLXWindowId) |
5950 |
#ifdef GLX |
|
294 | 5951 |
endpupmode(); |
1932 | 5952 |
#endif |
5953 |
%} |
|
294 | 5954 |
! |
5955 |
||
5956 |
glxFinishIn: aGLXWindowId |
|
5957 |
||
5958 |
%{ /* NOCONTEXT */ |
|
1932 | 5959 |
SETWIN(aGLXWindowId) |
5960 |
#ifdef GLX |
|
294 | 5961 |
finish(); |
1932 | 5962 |
#endif |
5963 |
%} |
|
294 | 5964 |
! |
5965 |
||
5966 |
glxFont: fntnum in: aGLXWindowId |
|
5967 |
||
5968 |
%{ /* NOCONTEXT */ |
|
5969 |
SETWIN(aGLXWindowId) |
|
1932 | 5970 |
#ifdef GLX |
294 | 5971 |
font(_shortVal(fntnum)); |
1932 | 5972 |
#endif |
294 | 5973 |
%} |
5974 |
! |
|
5975 |
||
5976 |
glxForegroundIn: aGLXWindowId |
|
5977 |
||
5978 |
%{ /* NOCONTEXT */ |
|
5979 |
SETWIN(aGLXWindowId) |
|
1932 | 5980 |
#ifdef OPENGL |
5981 |
#else |
|
294 | 5982 |
foreground(); |
1932 | 5983 |
#endif |
294 | 5984 |
%} |
5985 |
! |
|
5986 |
||
5987 |
glxFreepup: pup in: aGLXWindowId |
|
5988 |
||
5989 |
%{ /* NOCONTEXT */ |
|
1932 | 5990 |
SETWIN(aGLXWindowId) |
5991 |
#ifdef GLX |
|
294 | 5992 |
freepup(_longVal(pup)); |
1932 | 5993 |
#endif |
5994 |
%} |
|
294 | 5995 |
! |
5996 |
||
5997 |
glxFudgeXfudge: xfudge yfudge: yfudge in: aGLXWindowId |
|
5998 |
||
5999 |
%{ /* NOCONTEXT */ |
|
1932 | 6000 |
SETWIN(aGLXWindowId) |
6001 |
#ifdef GLX |
|
294 | 6002 |
fudge(_longVal(xfudge), _longVal(yfudge)); |
1932 | 6003 |
#endif |
6004 |
%} |
|
294 | 6005 |
! |
6006 |
||
6007 |
glxFullscrnIn: aGLXWindowId |
|
6008 |
||
6009 |
%{ /* NOCONTEXT */ |
|
1932 | 6010 |
SETWIN(aGLXWindowId) |
6011 |
#ifdef GLX |
|
294 | 6012 |
fullscrn(); |
1932 | 6013 |
#endif |
6014 |
%} |
|
294 | 6015 |
! |
6016 |
||
6017 |
glxGbeginIn: aGLXWindowId |
|
6018 |
||
6019 |
%{ /* NOCONTEXT */ |
|
1932 | 6020 |
SETWIN(aGLXWindowId) |
6021 |
#ifdef GLX |
|
294 | 6022 |
gbegin(); |
1932 | 6023 |
#endif |
6024 |
%} |
|
294 | 6025 |
! |
6026 |
||
6027 |
glxGentagIn: aGLXWindowId |
|
6028 |
||
6029 |
%{ /* NOCONTEXT */ |
|
1932 | 6030 |
int rslt = -1; |
6031 |
||
6032 |
#ifdef GLX |
|
6033 |
SETWIN(aGLXWindowId) |
|
6034 |
rslt = gentag(); |
|
6035 |
#endif |
|
6036 |
RETURN (__MKSMALLINT(rslt)); |
|
6037 |
%} |
|
294 | 6038 |
! |
6039 |
||
6040 |
glxGetbackfaceIn: aGLXWindowId |
|
6041 |
||
6042 |
%{ /* NOCONTEXT */ |
|
1932 | 6043 |
int rslt = -1; |
6044 |
||
6045 |
#ifdef GLX |
|
6046 |
SETWIN(aGLXWindowId) |
|
6047 |
rslt = getbackface(); |
|
6048 |
#endif |
|
6049 |
RETURN (__MKSMALLINT(rslt)); |
|
6050 |
%} |
|
294 | 6051 |
! |
6052 |
||
6053 |
glxGetbufferIn: aGLXWindowId |
|
6054 |
||
6055 |
%{ /* NOCONTEXT */ |
|
1932 | 6056 |
int rslt = -1; |
6057 |
||
6058 |
#ifdef GLX |
|
6059 |
SETWIN(aGLXWindowId) |
|
6060 |
rslt = getbuffer(); |
|
6061 |
#endif |
|
6062 |
RETURN (__MKSMALLINT(rslt)); |
|
6063 |
%} |
|
294 | 6064 |
! |
6065 |
||
6066 |
glxGetbutton: num in: aGLXWindowId |
|
6067 |
||
6068 |
%{ /* NOCONTEXT */ |
|
1932 | 6069 |
int rslt = -1; |
6070 |
||
6071 |
SETWIN(aGLXWindowId) |
|
6072 |
#ifdef OPENGL |
|
6073 |
#else |
|
6074 |
rslt = getbutton(_deviceVal(num)); |
|
6075 |
#endif |
|
6076 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6077 |
%} |
6078 |
! |
|
6079 |
||
6080 |
glxGetcmmodeIn: aGLXWindowId |
|
6081 |
||
6082 |
%{ /* NOCONTEXT */ |
|
1932 | 6083 |
int rslt = 0; |
6084 |
||
6085 |
SETWIN(aGLXWindowId) |
|
6086 |
#ifdef GLX |
|
6087 |
rslt = getcmmode(); |
|
6088 |
#endif |
|
6089 |
RETURN (__MKBOOLEAN(rslt)); |
|
6090 |
%} |
|
294 | 6091 |
! |
6092 |
||
6093 |
glxGetcolorIn: aGLXWindowId |
|
6094 |
"return the current drawing color" |
|
6095 |
||
6096 |
%{ /* NOCONTEXT */ |
|
1932 | 6097 |
int rslt = -1; |
6098 |
||
6099 |
SETWIN(aGLXWindowId) |
|
6100 |
#ifdef OPENGL |
|
6101 |
#else |
|
6102 |
rslt = getcolor(); |
|
6103 |
#endif |
|
6104 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6105 |
%} |
6106 |
! |
|
6107 |
||
6108 |
glxGetdcmIn: aGLXWindowId |
|
6109 |
||
6110 |
%{ /* NOCONTEXT */ |
|
6111 |
#ifdef GLX |
|
6112 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6113 |
RETURN (__MKBOOLEAN(getdcm())); |
294 | 6114 |
#endif |
6115 |
%} |
|
6116 |
. |
|
6117 |
^ false |
|
6118 |
! |
|
6119 |
||
6120 |
glxGetdescenderIn: aGLXWindowId |
|
6121 |
||
6122 |
%{ /* NOCONTEXT */ |
|
6123 |
#ifdef GLX |
|
6124 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6125 |
RETURN (__MKSMALLINT(getdescender())); |
294 | 6126 |
#endif |
6127 |
%} |
|
6128 |
. |
|
6129 |
^ false |
|
6130 |
! |
|
6131 |
||
6132 |
glxGetdisplaymodeIn: aGLXWindowId |
|
6133 |
||
6134 |
%{ /* NOCONTEXT */ |
|
6135 |
#ifdef GLX |
|
6136 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6137 |
RETURN (__MKSMALLINT(getdisplaymode())); |
294 | 6138 |
#endif |
6139 |
%} |
|
6140 |
. |
|
6141 |
^ false |
|
6142 |
! |
|
6143 |
||
6144 |
glxGetdrawmodeIn: aGLXWindowId |
|
6145 |
||
6146 |
%{ /* NOCONTEXT */ |
|
6147 |
#ifdef GLX |
|
6148 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6149 |
RETURN (__MKSMALLINT(getdrawmode())); |
294 | 6150 |
#endif |
6151 |
%} |
|
6152 |
. |
|
6153 |
^ false |
|
6154 |
! |
|
6155 |
||
6156 |
glxGetfontIn: aGLXWindowId |
|
6157 |
||
6158 |
%{ /* NOCONTEXT */ |
|
6159 |
#ifdef GLX |
|
6160 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6161 |
RETURN (__MKSMALLINT(getfont())); |
294 | 6162 |
#endif |
6163 |
%} |
|
6164 |
. |
|
6165 |
^ false |
|
6166 |
! |
|
6167 |
||
6168 |
glxGetgconfigBuffer: buffer in: aGLXWindowId |
|
6169 |
||
6170 |
%{ /* NOCONTEXT */ |
|
6171 |
#ifdef FULL_GLX |
|
6172 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6173 |
RETURN (__MKSMALLINT(getgconfig(_longVal(buffer)))); |
294 | 6174 |
#endif |
6175 |
%} |
|
6176 |
. |
|
6177 |
^ false |
|
6178 |
! |
|
6179 |
||
6180 |
glxGetgdescInquiry: inquiry in: aGLXWindowId |
|
6181 |
||
6182 |
%{ /* NOCONTEXT */ |
|
1932 | 6183 |
int rslt = 0; |
6184 |
||
6185 |
SETWIN(aGLXWindowId) |
|
6186 |
#ifdef OPENGL |
|
6187 |
#else |
|
6188 |
rslt = getgdesc(_longVal(inquiry)); |
|
6189 |
#endif |
|
6190 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6191 |
%} |
6192 |
! |
|
6193 |
||
6194 |
glxGetheightIn: aGLXWindowId |
|
6195 |
||
6196 |
%{ /* NOCONTEXT */ |
|
1932 | 6197 |
int rslt = 0; |
6198 |
||
6199 |
SETWIN(aGLXWindowId) |
|
6200 |
#ifdef OPENGL |
|
6201 |
#else |
|
6202 |
rslt = getheight(); |
|
6203 |
#endif |
|
6204 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 6205 |
%} |
6206 |
! |
|
6207 |
||
6208 |
glxGethitcodeIn: aGLXWindowId |
|
6209 |
||
6210 |
%{ /* NOCONTEXT */ |
|
6211 |
#ifdef GLX |
|
6212 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6213 |
RETURN (__MKSMALLINT(gethitcode())); |
294 | 6214 |
#endif |
6215 |
%} |
|
6216 |
. |
|
6217 |
^ false |
|
6218 |
! |
|
6219 |
||
6220 |
glxGetlsbackupIn: aGLXWindowId |
|
6221 |
||
6222 |
%{ /* NOCONTEXT */ |
|
6223 |
#ifdef GLX |
|
6224 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6225 |
RETURN (__MKBOOLEAN(getlsbackup())); |
294 | 6226 |
#endif |
6227 |
%} |
|
6228 |
. |
|
6229 |
^ false |
|
6230 |
! |
|
6231 |
||
6232 |
glxGetlsrepeatIn: aGLXWindowId |
|
6233 |
||
6234 |
%{ /* NOCONTEXT */ |
|
6235 |
#ifdef GLX |
|
6236 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6237 |
RETURN (__MKSMALLINT(getlsrepeat())); |
294 | 6238 |
#endif |
6239 |
%} |
|
6240 |
. |
|
6241 |
^ false |
|
6242 |
! |
|
6243 |
||
6244 |
glxGetlstyleIn: aGLXWindowId |
|
6245 |
||
6246 |
%{ /* NOCONTEXT */ |
|
6247 |
#ifdef GLX |
|
6248 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6249 |
RETURN (__MKSMALLINT(getlstyle())); |
294 | 6250 |
#endif |
6251 |
%} |
|
6252 |
. |
|
6253 |
^ false |
|
6254 |
! |
|
6255 |
||
6256 |
glxGetlwidthIn: aGLXWindowId |
|
6257 |
||
6258 |
%{ /* NOCONTEXT */ |
|
6259 |
#ifdef GLX |
|
6260 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6261 |
RETURN (__MKSMALLINT(getlwidth())); |
294 | 6262 |
#endif |
6263 |
%} |
|
6264 |
. |
|
6265 |
^ false |
|
6266 |
! |
|
6267 |
||
6268 |
glxGetmapIn: aGLXWindowId |
|
6269 |
||
6270 |
%{ /* NOCONTEXT */ |
|
6271 |
#ifdef GLX |
|
6272 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6273 |
RETURN (__MKSMALLINT(getmap())); |
294 | 6274 |
#endif |
6275 |
%} |
|
6276 |
. |
|
6277 |
^ false |
|
6278 |
! |
|
6279 |
||
6280 |
glxGetmmodeIn: aGLXWindowId |
|
6281 |
||
6282 |
%{ /* NOCONTEXT */ |
|
6283 |
#ifdef GLX |
|
6284 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6285 |
RETURN (__MKSMALLINT(getmmode())); |
294 | 6286 |
#endif |
6287 |
%} |
|
6288 |
. |
|
6289 |
^ false |
|
6290 |
! |
|
6291 |
||
6292 |
glxGetmonitorIn: aGLXWindowId |
|
6293 |
||
6294 |
%{ /* NOCONTEXT */ |
|
6295 |
#ifdef GLX |
|
6296 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6297 |
RETURN (__MKSMALLINT(getmonitor())); |
294 | 6298 |
#endif |
6299 |
%} |
|
6300 |
. |
|
6301 |
^ false |
|
6302 |
! |
|
6303 |
||
6304 |
glxGetmultisampleIn: aGLXWindowId |
|
6305 |
||
6306 |
%{ /* NOCONTEXT */ |
|
6307 |
#ifdef FULL_GLX |
|
6308 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6309 |
RETURN (__MKBOOLEAN(getmultisample())); |
294 | 6310 |
#endif |
6311 |
%} |
|
6312 |
. |
|
6313 |
^ false |
|
6314 |
! |
|
6315 |
||
6316 |
glxGetothermonitorIn: aGLXWindowId |
|
6317 |
||
6318 |
%{ /* NOCONTEXT */ |
|
6319 |
#ifdef GLX |
|
6320 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6321 |
RETURN (__MKSMALLINT(getothermonitor())); |
294 | 6322 |
#endif |
6323 |
%} |
|
6324 |
. |
|
6325 |
^ false |
|
6326 |
! |
|
6327 |
||
6328 |
glxGetpatternIn: aGLXWindowId |
|
6329 |
||
6330 |
%{ /* NOCONTEXT */ |
|
6331 |
#ifdef GLX |
|
6332 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6333 |
RETURN (__MKSMALLINT(getpattern())); |
294 | 6334 |
#endif |
6335 |
%} |
|
6336 |
. |
|
6337 |
^ false |
|
6338 |
! |
|
6339 |
||
6340 |
glxGetresetlsIn: aGLXWindowId |
|
6341 |
||
6342 |
%{ /* NOCONTEXT */ |
|
6343 |
#ifdef GLX |
|
6344 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6345 |
RETURN (__MKBOOLEAN(getresetls())); |
294 | 6346 |
#endif |
6347 |
%} |
|
6348 |
. |
|
6349 |
^ false |
|
6350 |
! |
|
6351 |
||
6352 |
glxGetshadeIn: aGLXWindowId |
|
6353 |
||
6354 |
%{ /* NOCONTEXT */ |
|
6355 |
#ifdef GLX |
|
6356 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6357 |
RETURN (__MKSMALLINT(getshade())); |
294 | 6358 |
#endif |
6359 |
%} |
|
6360 |
. |
|
6361 |
^ false |
|
6362 |
! |
|
6363 |
||
6364 |
glxGetsmIn: aGLXWindowId |
|
6365 |
||
6366 |
%{ /* NOCONTEXT */ |
|
6367 |
#ifdef GLX |
|
6368 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6369 |
RETURN (__MKSMALLINT(getsm())); |
294 | 6370 |
#endif |
6371 |
%} |
|
6372 |
. |
|
6373 |
^ false |
|
6374 |
! |
|
6375 |
||
6376 |
glxGetvaluator: dev in: aGLXWindowId |
|
6377 |
||
6378 |
%{ /* NOCONTEXT */ |
|
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
6379 |
#ifndef OPENGL |
294 | 6380 |
SETWIN(aGLXWindowId) |
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6381 |
RETURN (__MKSMALLINT(getvaluator(_deviceVal(dev)))); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
6382 |
#endif |
294 | 6383 |
%} |
6384 |
. |
|
6385 |
^ false |
|
6386 |
! |
|
6387 |
||
6388 |
glxGetvideo: reg in: aGLXWindowId |
|
6389 |
||
6390 |
%{ /* NOCONTEXT */ |
|
6391 |
#ifdef GLX |
|
6392 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6393 |
RETURN (__MKSMALLINT(getvideo(_longVal(reg)))); |
294 | 6394 |
#endif |
6395 |
%} |
|
6396 |
. |
|
6397 |
^ false |
|
6398 |
! |
|
6399 |
||
6400 |
glxGetwritemaskIn: aGLXWindowId |
|
6401 |
||
6402 |
%{ /* NOCONTEXT */ |
|
6403 |
#ifdef GLX |
|
6404 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6405 |
RETURN (__MKSMALLINT(getwritemask())); |
294 | 6406 |
#endif |
6407 |
%} |
|
6408 |
. |
|
6409 |
^ false |
|
6410 |
! |
|
6411 |
||
6412 |
glxGetwscrnIn: aGLXWindowId |
|
6413 |
||
6414 |
%{ /* NOCONTEXT */ |
|
6415 |
#ifdef GLX |
|
6416 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6417 |
RETURN (__MKSMALLINT(getwscrn())); |
294 | 6418 |
#endif |
6419 |
%} |
|
6420 |
. |
|
6421 |
^ false |
|
6422 |
! |
|
6423 |
||
6424 |
glxGetzbufferIn: aGLXWindowId |
|
6425 |
||
6426 |
%{ /* NOCONTEXT */ |
|
6427 |
#ifdef GLX |
|
6428 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6429 |
RETURN (__MKBOOLEAN(getzbuffer())); |
294 | 6430 |
#endif |
6431 |
%} |
|
6432 |
. |
|
6433 |
^ false |
|
6434 |
! |
|
6435 |
||
6436 |
glxGexitIn: aGLXWindowId |
|
6437 |
||
6438 |
%{ /* NOCONTEXT */ |
|
1932 | 6439 |
SETWIN(aGLXWindowId) |
6440 |
#ifdef OPENGL |
|
6441 |
#else |
|
294 | 6442 |
gexit(); |
1932 | 6443 |
#endif |
6444 |
%} |
|
294 | 6445 |
! |
6446 |
||
6447 |
glxGflushIn: aGLXWindowId |
|
6448 |
||
6449 |
%{ /* NOCONTEXT */ |
|
6450 |
#ifdef GLX |
|
6451 |
SETWIN(aGLXWindowId) |
|
6452 |
gflush(); |
|
1932 | 6453 |
#endif |
6454 |
%} |
|
294 | 6455 |
! |
6456 |
||
6457 |
glxGinitIn: aGLXWindowId |
|
6458 |
||
6459 |
%{ /* NOCONTEXT */ |
|
1932 | 6460 |
SETWIN(aGLXWindowId) |
6461 |
#ifdef OPENGL |
|
6462 |
#else |
|
294 | 6463 |
ginit(); |
1932 | 6464 |
#endif |
6465 |
%} |
|
294 | 6466 |
! |
6467 |
||
6468 |
glxGlcompatMode: mode value: value in: aGLXWindowId |
|
6469 |
||
6470 |
%{ /* NOCONTEXT */ |
|
6471 |
#ifdef GLX |
|
6472 |
SETWIN(aGLXWindowId) |
|
6473 |
glcompat(_longVal(mode), _longVal(value)); |
|
1932 | 6474 |
#endif |
6475 |
%} |
|
294 | 6476 |
! |
6477 |
||
6478 |
glxGresetIn: aGLXWindowId |
|
6479 |
||
6480 |
%{ /* NOCONTEXT */ |
|
6481 |
#ifdef GLX |
|
6482 |
SETWIN(aGLXWindowId) |
|
6483 |
greset(); |
|
1932 | 6484 |
#endif |
6485 |
%} |
|
294 | 6486 |
! |
6487 |
||
6488 |
glxGsyncIn: aGLXWindowId |
|
6489 |
||
6490 |
%{ /* NOCONTEXT */ |
|
6491 |
#ifdef GLX |
|
6492 |
SETWIN(aGLXWindowId) |
|
6493 |
gsync(); |
|
1932 | 6494 |
#endif |
6495 |
%} |
|
294 | 6496 |
! |
6497 |
||
6498 |
glxIconsizeX: x y: y in: aGLXWindowId |
|
6499 |
||
6500 |
%{ /* NOCONTEXT */ |
|
6501 |
#ifdef GLX |
|
6502 |
SETWIN(aGLXWindowId) |
|
6503 |
iconsize(_longVal(x), _longVal(y)); |
|
1932 | 6504 |
#endif |
6505 |
%} |
|
294 | 6506 |
! |
6507 |
||
6508 |
glxImakebackgroundIn: aGLXWindowId |
|
6509 |
||
6510 |
%{ /* NOCONTEXT */ |
|
6511 |
#ifdef GLX |
|
6512 |
SETWIN(aGLXWindowId) |
|
6513 |
imakebackground(); |
|
1932 | 6514 |
#endif |
6515 |
%} |
|
294 | 6516 |
! |
6517 |
||
6518 |
glxInitnamesIn: aGLXWindowId |
|
6519 |
||
6520 |
%{ /* NOCONTEXT */ |
|
6521 |
#ifdef GLX |
|
6522 |
SETWIN(aGLXWindowId) |
|
6523 |
initnames(); |
|
1932 | 6524 |
#endif |
6525 |
%} |
|
294 | 6526 |
! |
6527 |
||
6528 |
glxIsqueued: dev in: aGLXWindowId |
|
6529 |
||
6530 |
%{ /* NOCONTEXT */ |
|
6531 |
#ifdef GLX |
|
6532 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6533 |
RETURN (__MKBOOLEAN(isqueued(_deviceVal(dev)))); |
294 | 6534 |
#endif |
6535 |
%} |
|
6536 |
. |
|
6537 |
^ false |
|
6538 |
! |
|
6539 |
||
6540 |
glxIstag: t in: aGLXWindowId |
|
6541 |
||
6542 |
%{ /* NOCONTEXT */ |
|
6543 |
#ifdef GLX |
|
6544 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6545 |
RETURN (__MKBOOLEAN(istag(_tagVal(t)))); |
294 | 6546 |
#endif |
6547 |
%} |
|
6548 |
. |
|
6549 |
^ false |
|
6550 |
! |
|
6551 |
||
6552 |
glxKeepaspectX: x y: y in: aGLXWindowId |
|
6553 |
||
6554 |
%{ /* NOCONTEXT */ |
|
6555 |
#ifdef GLX |
|
6556 |
SETWIN(aGLXWindowId) |
|
6557 |
keepaspect(_longVal(x), _longVal(y)); |
|
6558 |
RETURN (true); |
|
6559 |
#endif |
|
6560 |
%} |
|
6561 |
. |
|
6562 |
^ false |
|
6563 |
! |
|
6564 |
||
6565 |
glxLinesmoothMode: mode in: aGLXWindowId |
|
6566 |
||
6567 |
%{ /* NOCONTEXT */ |
|
6568 |
#ifdef GLX |
|
6569 |
SETWIN(aGLXWindowId) |
|
6570 |
linesmooth((ulong)__intVal(mode)); |
|
6571 |
RETURN (true); |
|
6572 |
#endif |
|
6573 |
%} |
|
6574 |
. |
|
6575 |
^ false |
|
6576 |
! |
|
6577 |
||
6578 |
glxLmcolorMode: mode in: aGLXWindowId |
|
6579 |
||
6580 |
%{ /* NOCONTEXT */ |
|
6581 |
#ifdef GLX |
|
6582 |
SETWIN(aGLXWindowId) |
|
6583 |
lmcolor(_longVal(mode)); |
|
6584 |
RETURN (true); |
|
6585 |
#endif |
|
6586 |
%} |
|
6587 |
. |
|
6588 |
^ false |
|
6589 |
! |
|
6590 |
||
6591 |
glxLoadname: name in: aGLXWindowId |
|
6592 |
||
6593 |
%{ /* NOCONTEXT */ |
|
6594 |
#ifdef GLX |
|
6595 |
SETWIN(aGLXWindowId) |
|
6596 |
loadname(_shortVal(name)); |
|
6597 |
RETURN (true); |
|
6598 |
#endif |
|
6599 |
%} |
|
6600 |
. |
|
6601 |
^ false |
|
6602 |
! |
|
6603 |
||
6604 |
glxLogicop: opcode in: aGLXWindowId |
|
6605 |
||
6606 |
%{ /* NOCONTEXT */ |
|
6607 |
#ifdef GLX |
|
6608 |
SETWIN(aGLXWindowId) |
|
6609 |
logicop(_longVal(opcode)); |
|
6610 |
RETURN (true); |
|
6611 |
#endif |
|
6612 |
%} |
|
6613 |
. |
|
6614 |
^ false |
|
6615 |
! |
|
6616 |
||
6617 |
glxLsbackup: b in: aGLXWindowId |
|
6618 |
||
6619 |
%{ /* NOCONTEXT */ |
|
6620 |
#ifdef GLX |
|
6621 |
SETWIN(aGLXWindowId) |
|
6622 |
lsbackup(_booleanVal(b)); |
|
6623 |
RETURN (true); |
|
6624 |
#endif |
|
6625 |
%} |
|
6626 |
. |
|
6627 |
^ false |
|
6628 |
! |
|
6629 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6630 |
glxLsetdepthNear:znear far:zfar in: aGLXWindowId |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6631 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6632 |
%{ /* NOCONTEXT */ |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6633 |
#ifdef GLX |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6634 |
SETWIN(aGLXWindowId) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
6635 |
lsetdepth(_longVal(znear), _longVal(zfar)); |
294 | 6636 |
RETURN (true); |
6637 |
#endif |
|
6638 |
%} |
|
6639 |
. |
|
6640 |
^ false |
|
6641 |
! |
|
6642 |
||
6643 |
glxLshaderangeLowin: lowin hiwin: hiwin znear: znear zfar: zfar in: aGLXWindowId |
|
6644 |
||
6645 |
%{ /* NOCONTEXT */ |
|
6646 |
#ifdef GLX |
|
6647 |
SETWIN(aGLXWindowId) |
|
4718 | 6648 |
lshaderange(_colorindexVal(lowin), _colorindexVal(hiwin), |
294 | 6649 |
_longVal(znear), _longVal(zfar)); |
6650 |
RETURN (true); |
|
6651 |
#endif |
|
6652 |
%} |
|
6653 |
. |
|
6654 |
^ false |
|
6655 |
! |
|
6656 |
||
6657 |
glxLsrepeatFactor: factor in: aGLXWindowId |
|
6658 |
||
6659 |
%{ /* NOCONTEXT */ |
|
6660 |
#ifdef GLX |
|
6661 |
SETWIN(aGLXWindowId) |
|
6662 |
lsrepeat(_longVal(factor)); |
|
6663 |
RETURN (true); |
|
6664 |
#endif |
|
6665 |
%} |
|
6666 |
. |
|
6667 |
^ false |
|
6668 |
! |
|
6669 |
||
6670 |
glxMaketag: t in: aGLXWindowId |
|
6671 |
||
6672 |
%{ /* NOCONTEXT */ |
|
6673 |
#ifdef GLX |
|
6674 |
SETWIN(aGLXWindowId) |
|
6675 |
maketag(_tagVal(t)); |
|
6676 |
RETURN (true); |
|
6677 |
#endif |
|
6678 |
%} |
|
6679 |
. |
|
6680 |
^ false |
|
6681 |
! |
|
6682 |
||
6683 |
glxMaxsizeX: x y: y in: aGLXWindowId |
|
6684 |
||
6685 |
%{ /* NOCONTEXT */ |
|
6686 |
#ifdef GLX |
|
6687 |
SETWIN(aGLXWindowId) |
|
6688 |
maxsize(_longVal(x), _longVal(y)); |
|
6689 |
RETURN (true); |
|
6690 |
#endif |
|
6691 |
%} |
|
6692 |
. |
|
6693 |
^ false |
|
6694 |
! |
|
6695 |
||
6696 |
glxMinsizeX: x y: y in: aGLXWindowId |
|
6697 |
||
6698 |
%{ /* NOCONTEXT */ |
|
6699 |
#ifdef GLX |
|
6700 |
SETWIN(aGLXWindowId) |
|
6701 |
minsize(_longVal(x), _longVal(y)); |
|
6702 |
RETURN (true); |
|
6703 |
#endif |
|
6704 |
%} |
|
6705 |
. |
|
6706 |
^ false |
|
6707 |
! |
|
6708 |
||
6709 |
glxMsalphaMode: mode in: aGLXWindowId |
|
6710 |
||
6711 |
%{ /* NOCONTEXT */ |
|
6712 |
#ifdef FULL_GLX |
|
6713 |
SETWIN(aGLXWindowId) |
|
6714 |
msalpha(_longVal(mode)); |
|
6715 |
RETURN (true); |
|
6716 |
#endif |
|
6717 |
%} |
|
6718 |
. |
|
6719 |
^ false |
|
6720 |
! |
|
6721 |
||
6722 |
glxMsmask: mask inverse: inverse in: aGLXWindowId |
|
6723 |
||
6724 |
%{ /* NOCONTEXT */ |
|
6725 |
#ifdef FULL_GLX |
|
6726 |
SETWIN(aGLXWindowId) |
|
6727 |
msmask(_floatVal(mask), _booleanVal(inverse)); |
|
6728 |
RETURN (true); |
|
6729 |
#endif |
|
6730 |
%} |
|
6731 |
. |
|
6732 |
^ false |
|
6733 |
! |
|
6734 |
||
6735 |
glxMspattern: pattern in: aGLXWindowId |
|
6736 |
||
6737 |
%{ /* NOCONTEXT */ |
|
6738 |
#ifdef FULL_GLX |
|
6739 |
SETWIN(aGLXWindowId) |
|
6740 |
mspattern(_longVal(pattern)); |
|
6741 |
RETURN (true); |
|
6742 |
#endif |
|
6743 |
%} |
|
6744 |
. |
|
6745 |
^ false |
|
6746 |
! |
|
6747 |
||
6748 |
glxMssizeSamples: samples zsize: zsize ssize: ssize in: aGLXWindowId |
|
6749 |
||
6750 |
%{ /* NOCONTEXT */ |
|
6751 |
#ifdef FULL_GLX |
|
6752 |
SETWIN(aGLXWindowId) |
|
6753 |
mssize(_longVal(samples), _longVal(zsize), _longVal(ssize)); |
|
6754 |
RETURN (true); |
|
6755 |
#endif |
|
6756 |
%} |
|
6757 |
. |
|
6758 |
^ false |
|
6759 |
! |
|
6760 |
||
6761 |
glxMswapbuffers: fbuf in: aGLXWindowId |
|
6762 |
||
6763 |
%{ /* NOCONTEXT */ |
|
6764 |
#ifdef GLX |
|
6765 |
SETWIN(aGLXWindowId) |
|
6766 |
mswapbuffers(_longVal(fbuf)); |
|
6767 |
RETURN (true); |
|
6768 |
#endif |
|
6769 |
%} |
|
6770 |
. |
|
6771 |
^ false |
|
6772 |
! |
|
6773 |
||
6774 |
glxMultimapIn: aGLXWindowId |
|
6775 |
||
6776 |
%{ /* NOCONTEXT */ |
|
6777 |
#ifdef GLX |
|
6778 |
SETWIN(aGLXWindowId) |
|
6779 |
multimap(); |
|
6780 |
RETURN (true); |
|
6781 |
#endif |
|
6782 |
%} |
|
6783 |
. |
|
6784 |
^ false |
|
6785 |
! |
|
6786 |
||
6787 |
glxMultisample: bool in: aGLXWindowId |
|
6788 |
||
6789 |
%{ /* NOCONTEXT */ |
|
6790 |
#ifdef FULL_GLX |
|
6791 |
SETWIN(aGLXWindowId) |
|
6792 |
multisample(_booleanVal(bool)); |
|
6793 |
RETURN (true); |
|
6794 |
#endif |
|
6795 |
%} |
|
6796 |
. |
|
6797 |
^ false |
|
6798 |
! |
|
6799 |
||
6800 |
glxNewpupIn: aGLXWindowId |
|
6801 |
||
6802 |
%{ /* NOCONTEXT */ |
|
6803 |
#ifdef GLX |
|
6804 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
6805 |
RETURN (__MKSMALLINT(newpup())); |
294 | 6806 |
#endif |
6807 |
%} |
|
6808 |
. |
|
6809 |
^ false |
|
6810 |
! |
|
6811 |
||
6812 |
glxNewtag: newtg oldtg: oldtg offst: offst in: aGLXWindowId |
|
6813 |
||
6814 |
%{ /* NOCONTEXT */ |
|
6815 |
#ifdef GLX |
|
6816 |
SETWIN(aGLXWindowId) |
|
6817 |
newtag(_tagVal(newtg), _tagVal(oldtg), _offsetVal(offst)); |
|
6818 |
RETURN (true); |
|
6819 |
#endif |
|
6820 |
%} |
|
6821 |
. |
|
6822 |
^ false |
|
6823 |
! |
|
6824 |
||
6825 |
glxNoborderIn: aGLXWindowId |
|
6826 |
||
6827 |
%{ /* NOCONTEXT */ |
|
6828 |
#ifdef GLX |
|
6829 |
SETWIN(aGLXWindowId) |
|
6830 |
noborder(); |
|
6831 |
RETURN (true); |
|
6832 |
#endif |
|
6833 |
%} |
|
6834 |
. |
|
6835 |
^ false |
|
6836 |
! |
|
6837 |
||
6838 |
glxNoise: v delta: delta in: aGLXWindowId |
|
6839 |
||
6840 |
%{ /* NOCONTEXT */ |
|
6841 |
#ifdef GLX |
|
6842 |
SETWIN(aGLXWindowId) |
|
6843 |
noise(_deviceVal(v), _shortVal(delta)); |
|
6844 |
RETURN (true); |
|
6845 |
#endif |
|
6846 |
%} |
|
6847 |
. |
|
6848 |
^ false |
|
6849 |
! |
|
6850 |
||
6851 |
glxNoportIn: aGLXWindowId |
|
6852 |
||
6853 |
%{ /* NOCONTEXT */ |
|
6854 |
#ifdef GLX |
|
6855 |
SETWIN(aGLXWindowId) |
|
6856 |
noport(); |
|
6857 |
RETURN (true); |
|
6858 |
#endif |
|
6859 |
%} |
|
6860 |
. |
|
6861 |
^ false |
|
6862 |
! |
|
6863 |
||
6864 |
glxNurbscurveKnotCount: knotCount knotList: knotList |
|
4718 | 6865 |
offset: offset ctlArray: ctlArray |
294 | 6866 |
order: order type: type in: aGLXWindowId |
6867 |
||
6868 |
| ctlPoints i | |
|
6869 |
ctlPoints := DoubleArray new: ctlArray size * (ctlArray first size). |
|
6870 |
i := 1. |
|
6871 |
ctlArray do: [:point | |
|
4718 | 6872 |
point do: [:coord | |
294 | 6873 |
ctlPoints at: i put: coord. |
6874 |
i := i + 1]]. |
|
6875 |
||
6876 |
%{ /* NOCONTEXT */ |
|
6877 |
#ifdef GLX |
|
6878 |
char *knotElements, *ctlElements; |
|
6879 |
OBJ cls; |
|
6880 |
int ninstVars, nInstBytes; |
|
6881 |
||
6882 |
SETWIN(aGLXWindowId) |
|
6883 |
cls = __qClass(ctlPoints); |
|
6884 |
ninstVars = __intVal(_ClassInstPtr(cls)->c_ninstvars); |
|
6885 |
nInstBytes = OHDR_SIZE + ninstVars * sizeof(OBJ); |
|
6886 |
||
6887 |
ctlElements = (char *)(_InstPtr(ctlPoints)) + nInstBytes; |
|
6888 |
knotElements = (char *)(_InstPtr(knotList)) + nInstBytes; |
|
6889 |
||
6890 |
nurbscurve ( |
|
6891 |
_longVal(knotCount), (double *)knotElements, |
|
4718 | 6892 |
_longVal(offset), (double *)ctlElements, |
294 | 6893 |
_longVal(order), _longVal(type)); |
6894 |
RETURN(true); |
|
6895 |
#endif |
|
6896 |
%} |
|
6897 |
. |
|
6898 |
^ false |
|
6899 |
! |
|
6900 |
||
6901 |
glxObjdeleteTag1: tag1 tag2: tag2 in: aGLXWindowId |
|
6902 |
||
6903 |
%{ /* NOCONTEXT */ |
|
6904 |
#ifdef GLX |
|
6905 |
SETWIN(aGLXWindowId) |
|
6906 |
objdelete(_tagVal(tag1), _tagVal(tag2)); |
|
6907 |
RETURN (true); |
|
6908 |
#endif |
|
6909 |
%} |
|
6910 |
. |
|
6911 |
^ false |
|
6912 |
! |
|
6913 |
||
6914 |
glxObjinsert: t in: aGLXWindowId |
|
6915 |
||
6916 |
%{ /* NOCONTEXT */ |
|
6917 |
#ifdef GLX |
|
6918 |
SETWIN(aGLXWindowId) |
|
6919 |
objinsert(_tagVal(t)); |
|
6920 |
RETURN (true); |
|
6921 |
#endif |
|
6922 |
%} |
|
6923 |
. |
|
6924 |
^ false |
|
6925 |
! |
|
6926 |
||
6927 |
glxObjreplace: t in: aGLXWindowId |
|
6928 |
||
6929 |
%{ /* NOCONTEXT */ |
|
6930 |
#ifdef GLX |
|
6931 |
SETWIN(aGLXWindowId) |
|
6932 |
objreplace(_tagVal(t)); |
|
6933 |
RETURN (true); |
|
6934 |
#endif |
|
6935 |
%} |
|
6936 |
. |
|
6937 |
^ false |
|
6938 |
! |
|
6939 |
||
6940 |
glxOnemapIn: aGLXWindowId |
|
6941 |
||
6942 |
%{ /* NOCONTEXT */ |
|
6943 |
#ifdef GLX |
|
6944 |
SETWIN(aGLXWindowId) |
|
6945 |
onemap(); |
|
6946 |
RETURN (true); |
|
6947 |
#endif |
|
6948 |
%} |
|
6949 |
. |
|
6950 |
^ false |
|
6951 |
! |
|
6952 |
||
6953 |
glxPagecolor: pcolor in: aGLXWindowId |
|
6954 |
||
6955 |
%{ /* NOCONTEXT */ |
|
6956 |
#ifdef GLX |
|
6957 |
SETWIN(aGLXWindowId) |
|
6958 |
pagecolor(_colorindexVal(pcolor)); |
|
6959 |
RETURN (true); |
|
6960 |
#endif |
|
6961 |
%} |
|
6962 |
. |
|
6963 |
^ false |
|
6964 |
! |
|
6965 |
||
6966 |
glxPassthroughToken: token in: aGLXWindowId |
|
6967 |
||
6968 |
%{ /* NOCONTEXT */ |
|
6969 |
#ifdef GLX |
|
6970 |
SETWIN(aGLXWindowId) |
|
6971 |
passthrough(_shortVal(token)); |
|
6972 |
RETURN (true); |
|
6973 |
#endif |
|
6974 |
%} |
|
6975 |
. |
|
6976 |
^ false |
|
6977 |
! |
|
6978 |
||
6979 |
glxPclosIn: aGLXWindowId |
|
6980 |
||
6981 |
%{ /* NOCONTEXT */ |
|
6982 |
#ifdef GLX |
|
6983 |
SETWIN(aGLXWindowId) |
|
6984 |
pclos(); |
|
6985 |
RETURN (true); |
|
6986 |
#endif |
|
6987 |
%} |
|
6988 |
. |
|
6989 |
^ false |
|
6990 |
! |
|
6991 |
||
6992 |
glxPicksizeX: x y: y in: aGLXWindowId |
|
6993 |
||
6994 |
%{ /* NOCONTEXT */ |
|
6995 |
#ifdef GLX |
|
6996 |
SETWIN(aGLXWindowId) |
|
6997 |
picksize(_shortVal(x), _shortVal(y)); |
|
6998 |
RETURN (true); |
|
6999 |
#endif |
|
7000 |
%} |
|
7001 |
. |
|
7002 |
^ false |
|
7003 |
! |
|
7004 |
||
7005 |
glxPixmode: mode value: value in: aGLXWindowId |
|
7006 |
||
7007 |
%{ /* NOCONTEXT */ |
|
7008 |
#ifdef GLX |
|
7009 |
SETWIN(aGLXWindowId) |
|
7010 |
pixmode(_longVal(mode), _longVal(value)); |
|
7011 |
RETURN (true); |
|
7012 |
#endif |
|
7013 |
%} |
|
7014 |
. |
|
7015 |
^ false |
|
7016 |
! |
|
7017 |
||
7018 |
glxPntsmoothMode: mode in: aGLXWindowId |
|
7019 |
||
7020 |
%{ /* NOCONTEXT */ |
|
7021 |
#ifdef GLX |
|
7022 |
SETWIN(aGLXWindowId) |
|
7023 |
pntsmooth((ulong)__intVal(mode)); |
|
7024 |
RETURN (true); |
|
7025 |
#endif |
|
7026 |
%} |
|
7027 |
. |
|
7028 |
^ false |
|
7029 |
! |
|
7030 |
||
7031 |
glxPolysmoothMode: mode in: aGLXWindowId |
|
7032 |
||
7033 |
%{ /* NOCONTEXT */ |
|
7034 |
#ifdef GLX |
|
7035 |
SETWIN(aGLXWindowId) |
|
7036 |
polysmooth(_longVal(mode)); |
|
7037 |
RETURN (true); |
|
7038 |
#endif |
|
7039 |
%} |
|
7040 |
. |
|
7041 |
^ false |
|
7042 |
! |
|
7043 |
||
7044 |
glxPopnameIn: aGLXWindowId |
|
7045 |
||
7046 |
%{ /* NOCONTEXT */ |
|
7047 |
#ifdef GLX |
|
7048 |
SETWIN(aGLXWindowId) |
|
7049 |
popname(); |
|
7050 |
RETURN (true); |
|
7051 |
#endif |
|
7052 |
%} |
|
7053 |
. |
|
7054 |
^ false |
|
7055 |
! |
|
7056 |
||
7057 |
glxPrefpositionX1: x1 x2: x2 y1: y1 y2: y2 in: aGLXWindowId |
|
7058 |
||
7059 |
%{ /* NOCONTEXT */ |
|
7060 |
SETWIN(aGLXWindowId) |
|
1932 | 7061 |
#ifdef OPENGL |
7062 |
#else |
|
294 | 7063 |
prefposition(_longVal(x1), _longVal(x2), _longVal(y1), _longVal(y2)); |
1932 | 7064 |
#endif |
294 | 7065 |
RETURN (true); |
7066 |
%} |
|
7067 |
! |
|
7068 |
||
7069 |
glxPrefsizeX: x y: y in: aGLXWindowId |
|
7070 |
||
7071 |
%{ /* NOCONTEXT */ |
|
7072 |
SETWIN(aGLXWindowId) |
|
1932 | 7073 |
#ifdef OPENGL |
7074 |
#else |
|
294 | 7075 |
prefsize(_longVal(x), _longVal(y)); |
1932 | 7076 |
#endif |
294 | 7077 |
RETURN (true); |
7078 |
%} |
|
7079 |
! |
|
7080 |
||
7081 |
glxPupmodeIn: aGLXWindowId |
|
7082 |
||
7083 |
%{ /* NOCONTEXT */ |
|
7084 |
#ifdef GLX |
|
7085 |
SETWIN(aGLXWindowId) |
|
7086 |
pupmode(); |
|
7087 |
RETURN (true); |
|
7088 |
#endif |
|
7089 |
%} |
|
7090 |
. |
|
7091 |
^ false |
|
7092 |
! |
|
7093 |
||
7094 |
glxPushname: name In: aGLXWindowId |
|
7095 |
||
7096 |
%{ /* NOCONTEXT */ |
|
7097 |
#ifdef GLX |
|
7098 |
SETWIN(aGLXWindowId) |
|
7099 |
pushname(_shortVal(name)); |
|
7100 |
RETURN (true); |
|
7101 |
#endif |
|
7102 |
%} |
|
7103 |
. |
|
7104 |
^ false |
|
7105 |
! |
|
7106 |
||
7107 |
glxQdevice: dev in: aGLXWindowId |
|
7108 |
||
7109 |
%{ /* NOCONTEXT */ |
|
1932 | 7110 |
SETWIN(aGLXWindowId) |
7111 |
#ifdef OPENGL |
|
7112 |
#else |
|
294 | 7113 |
qdevice(_deviceVal(dev)); |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7114 |
#endif |
294 | 7115 |
%} |
7116 |
! |
|
7117 |
||
7118 |
glxQenterDev: dev val: val in: aGLXWindowId |
|
7119 |
||
7120 |
%{ /* NOCONTEXT */ |
|
7121 |
SETWIN(aGLXWindowId) |
|
1932 | 7122 |
#ifdef OPENGL |
7123 |
#else |
|
294 | 7124 |
qenter(_deviceVal(dev), _shortVal(val)); |
1932 | 7125 |
#endif |
294 | 7126 |
%} |
7127 |
! |
|
7128 |
||
7129 |
glxQgetfdIn: aGLXWindowId |
|
7130 |
||
7131 |
%{ /* NOCONTEXT */ |
|
7132 |
#ifdef GLX |
|
7133 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7134 |
RETURN (__MKSMALLINT(qgetfd())); |
294 | 7135 |
#endif |
7136 |
%} |
|
7137 |
. |
|
7138 |
^ false |
|
7139 |
! |
|
7140 |
||
7141 |
glxQreadIn: aGLXWindowId |
|
7142 |
||
7143 |
| dev data | |
|
4718 | 7144 |
%{ |
294 | 7145 |
short c_data; |
7146 |
||
7147 |
SETWIN(aGLXWindowId) |
|
1932 | 7148 |
#ifdef OPENGL |
7149 |
#else |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7150 |
dev = __MKSMALLINT(qread(&c_data)); |
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
7151 |
data = __MKSMALLINT(c_data); |
1932 | 7152 |
#endif |
294 | 7153 |
%} |
7154 |
. |
|
7155 |
^ Array with: dev with: data |
|
7156 |
! |
|
7157 |
||
7158 |
glxQresetIn: aGLXWindowId |
|
7159 |
||
7160 |
%{ /* NOCONTEXT */ |
|
7161 |
SETWIN(aGLXWindowId) |
|
1932 | 7162 |
#ifdef OPENGL |
7163 |
#else |
|
294 | 7164 |
qreset(); |
1932 | 7165 |
#endif |
294 | 7166 |
RETURN (true); |
7167 |
%} |
|
7168 |
! |
|
7169 |
||
7170 |
glxQtestIn: aGLXWindowId |
|
7171 |
||
7172 |
%{ /* NOCONTEXT */ |
|
1932 | 7173 |
int rslt = 0; |
7174 |
||
7175 |
SETWIN(aGLXWindowId) |
|
7176 |
#ifdef OPENGL |
|
7177 |
#else |
|
7178 |
rslt = qtest(); |
|
7179 |
#endif |
|
7180 |
RETURN (__MKSMALLINT(rslt)); |
|
294 | 7181 |
%} |
7182 |
! |
|
7183 |
||
4718 | 7184 |
glxRGBcursorIndex: index red: red green: green blue: blue |
294 | 7185 |
redm: redm greenm: greenm bluem: bluem in: aGLXWindowId |
7186 |
||
7187 |
%{ /* NOCONTEXT */ |
|
7188 |
#ifdef GLX |
|
7189 |
SETWIN(aGLXWindowId) |
|
4718 | 7190 |
RGBcursor(_shortVal(index), |
7191 |
_shortVal(red), _shortVal(green), _shortVal(blue), |
|
294 | 7192 |
_shortVal(redm), _shortVal(greenm), _shortVal(bluem)); |
7193 |
RETURN (true); |
|
7194 |
#endif |
|
7195 |
%} |
|
7196 |
. |
|
7197 |
^ false |
|
7198 |
! |
|
7199 |
||
7200 |
glxRGBwritemaskRed: red green: green blue: blue in: aGLXWindowId |
|
7201 |
||
7202 |
%{ /* NOCONTEXT */ |
|
7203 |
#ifdef GLX |
|
7204 |
SETWIN(aGLXWindowId) |
|
7205 |
RGBwritemask(_shortVal(red), _shortVal(green), _shortVal(blue)); |
|
7206 |
RETURN (true); |
|
7207 |
#endif |
|
7208 |
%} |
|
7209 |
. |
|
7210 |
^ false |
|
7211 |
! |
|
7212 |
||
7213 |
glxRectzoomX: xfactor y: yfactor in: aGLXWindowId |
|
7214 |
||
7215 |
%{ /* NOCONTEXT */ |
|
7216 |
#ifdef GLX |
|
7217 |
SETWIN(aGLXWindowId) |
|
7218 |
rectzoom(_floatVal(xfactor), _floatVal(yfactor)); |
|
7219 |
RETURN (true); |
|
7220 |
#endif |
|
7221 |
%} |
|
7222 |
. |
|
7223 |
^ false |
|
7224 |
! |
|
7225 |
||
7226 |
glxResetls: b in: aGLXWindowId |
|
7227 |
||
7228 |
%{ /* NOCONTEXT */ |
|
7229 |
#ifdef GLX |
|
7230 |
SETWIN(aGLXWindowId) |
|
7231 |
resetls(_booleanVal(b)); |
|
7232 |
RETURN (true); |
|
7233 |
#endif |
|
7234 |
%} |
|
7235 |
. |
|
7236 |
^ false |
|
7237 |
! |
|
7238 |
||
7239 |
glxRingbellIn: aGLXWindowId |
|
7240 |
||
7241 |
%{ /* NOCONTEXT */ |
|
7242 |
#ifdef GLX |
|
7243 |
SETWIN(aGLXWindowId) |
|
7244 |
ringbell(); |
|
7245 |
RETURN (true); |
|
7246 |
#endif |
|
7247 |
%} |
|
7248 |
. |
|
7249 |
^ false |
|
7250 |
! |
|
7251 |
||
7252 |
glxSboxX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7253 |
||
7254 |
%{ /* NOCONTEXT */ |
|
7255 |
#ifdef GLX |
|
7256 |
SETWIN(aGLXWindowId) |
|
7257 |
sbox(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
7258 |
RETURN (true); |
|
7259 |
#endif |
|
7260 |
%} |
|
7261 |
. |
|
7262 |
^ false |
|
7263 |
! |
|
7264 |
||
7265 |
glxSboxfX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7266 |
||
7267 |
%{ /* NOCONTEXT */ |
|
7268 |
#ifdef GLX |
|
7269 |
SETWIN(aGLXWindowId) |
|
7270 |
sboxf(_coordVal(x1), _coordVal(y1), _coordVal(x2), _coordVal(y2)); |
|
7271 |
RETURN (true); |
|
7272 |
#endif |
|
7273 |
%} |
|
7274 |
. |
|
7275 |
^ false |
|
7276 |
! |
|
7277 |
||
7278 |
glxSboxfiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7279 |
||
7280 |
%{ /* NOCONTEXT */ |
|
7281 |
#ifdef GLX |
|
7282 |
SETWIN(aGLXWindowId) |
|
7283 |
sboxfi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
7284 |
RETURN (true); |
|
7285 |
#endif |
|
7286 |
%} |
|
7287 |
. |
|
7288 |
^ false |
|
7289 |
! |
|
7290 |
||
7291 |
glxSboxfsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7292 |
||
7293 |
%{ /* NOCONTEXT */ |
|
7294 |
#ifdef GLX |
|
7295 |
SETWIN(aGLXWindowId) |
|
7296 |
sboxfs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
7297 |
RETURN (true); |
|
7298 |
#endif |
|
7299 |
%} |
|
7300 |
. |
|
7301 |
^ false |
|
7302 |
! |
|
7303 |
||
7304 |
glxSboxiX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7305 |
||
7306 |
%{ /* NOCONTEXT */ |
|
7307 |
#ifdef GLX |
|
7308 |
SETWIN(aGLXWindowId) |
|
7309 |
sboxi(_icoordVal(x1), _icoordVal(y1), _icoordVal(x2), _icoordVal(y2)); |
|
7310 |
RETURN (true); |
|
7311 |
#endif |
|
7312 |
%} |
|
7313 |
. |
|
7314 |
^ false |
|
7315 |
! |
|
7316 |
||
7317 |
glxSboxsX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
7318 |
||
7319 |
%{ /* NOCONTEXT */ |
|
7320 |
#ifdef GLX |
|
7321 |
SETWIN(aGLXWindowId) |
|
7322 |
sboxs(_scoordVal(x1), _scoordVal(y1), _scoordVal(x2), _scoordVal(y2)); |
|
7323 |
RETURN (true); |
|
7324 |
#endif |
|
7325 |
%} |
|
7326 |
. |
|
7327 |
^ false |
|
7328 |
! |
|
7329 |
||
7330 |
glxSclearSval: sval in: aGLXWindowId |
|
7331 |
||
7332 |
%{ /* NOCONTEXT */ |
|
7333 |
#ifdef GLX |
|
7334 |
SETWIN(aGLXWindowId) |
|
7335 |
sclear((ulong)__intVal(sval)); |
|
7336 |
RETURN (true); |
|
7337 |
#endif |
|
7338 |
%} |
|
7339 |
. |
|
7340 |
^ false |
|
7341 |
! |
|
7342 |
||
7343 |
glxScrbox: arg in: aGLXWindowId |
|
7344 |
||
7345 |
%{ /* NOCONTEXT */ |
|
7346 |
#ifdef GLX |
|
7347 |
SETWIN(aGLXWindowId) |
|
7348 |
scrbox(_longVal(arg)); |
|
7349 |
RETURN (true); |
|
7350 |
#endif |
|
7351 |
%} |
|
7352 |
. |
|
7353 |
^ false |
|
7354 |
! |
|
7355 |
||
7356 |
glxScreenspaceIn: aGLXWindowId |
|
7357 |
||
7358 |
%{ /* NOCONTEXT */ |
|
7359 |
#ifdef GLX |
|
7360 |
SETWIN(aGLXWindowId) |
|
7361 |
screenspace(); |
|
7362 |
RETURN (true); |
|
7363 |
#endif |
|
7364 |
%} |
|
7365 |
. |
|
7366 |
^ false |
|
7367 |
! |
|
7368 |
||
7369 |
glxScrmaskLeft: left right: right bottom: bottom top: top in: aGLXWindowId |
|
7370 |
||
7371 |
%{ /* NOCONTEXT */ |
|
7372 |
#ifdef GLX |
|
7373 |
SETWIN(aGLXWindowId) |
|
4718 | 7374 |
scrmask(_screencoordVal(left), _screencoordVal(right), |
294 | 7375 |
_screencoordVal(bottom), _screencoordVal(top)); |
7376 |
RETURN (true); |
|
7377 |
#endif |
|
7378 |
%} |
|
7379 |
. |
|
7380 |
^ false |
|
7381 |
! |
|
7382 |
||
7383 |
glxScrnattach: gsnr in: aGLXWindowId |
|
7384 |
||
7385 |
%{ /* NOCONTEXT */ |
|
7386 |
#ifdef GLX |
|
7387 |
SETWIN(aGLXWindowId) |
|
7388 |
scrnattach(_longVal(gsnr)); |
|
7389 |
RETURN (true); |
|
7390 |
#endif |
|
7391 |
%} |
|
7392 |
. |
|
7393 |
^ false |
|
7394 |
! |
|
7395 |
||
7396 |
glxScrnselect: gsnr in: aGLXWindowId |
|
7397 |
||
7398 |
%{ /* NOCONTEXT */ |
|
7399 |
#ifdef GLX |
|
7400 |
SETWIN(aGLXWindowId) |
|
7401 |
scrnselect(_longVal(gsnr)); |
|
7402 |
RETURN (true); |
|
7403 |
#endif |
|
7404 |
%} |
|
7405 |
. |
|
7406 |
^ false |
|
7407 |
! |
|
7408 |
||
7409 |
glxSetcursorIndex: index color: color wtn: wtn in: aGLXWindowId |
|
7410 |
||
7411 |
%{ /* NOCONTEXT */ |
|
7412 |
#ifdef GLX |
|
7413 |
SETWIN(aGLXWindowId) |
|
7414 |
setcursor(_shortVal(index), _colorindexVal(color), _colorindexVal(wtn)); |
|
7415 |
RETURN (true); |
|
7416 |
#endif |
|
7417 |
%} |
|
7418 |
. |
|
7419 |
^ false |
|
7420 |
! |
|
7421 |
||
7422 |
glxSetdblightsMask: mask in: aGLXWindowId |
|
7423 |
||
7424 |
%{ /* NOCONTEXT */ |
|
7425 |
#ifdef GLX |
|
7426 |
SETWIN(aGLXWindowId) |
|
7427 |
setdblights((ulong)__intVal(mask)); |
|
7428 |
RETURN (true); |
|
7429 |
#endif |
|
7430 |
%} |
|
7431 |
. |
|
7432 |
^ false |
|
7433 |
! |
|
7434 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7435 |
glxSetdepthNear:znear far:zfar in: aGLXWindowId |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7436 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7437 |
%{ /* NOCONTEXT */ |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7438 |
#ifdef GLX |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7439 |
SETWIN(aGLXWindowId) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
7440 |
setdepth(_screencoordVal(znear), _screencoordVal(zfar)); |
294 | 7441 |
RETURN (true); |
7442 |
#endif |
|
7443 |
%} |
|
7444 |
. |
|
7445 |
^ false |
|
7446 |
! |
|
7447 |
||
7448 |
glxSetmap: mapnum in: aGLXWindowId |
|
7449 |
||
7450 |
%{ /* NOCONTEXT */ |
|
7451 |
#ifdef GLX |
|
7452 |
SETWIN(aGLXWindowId) |
|
7453 |
setmap(_shortVal(mapnum)); |
|
7454 |
RETURN (true); |
|
7455 |
#endif |
|
7456 |
%} |
|
7457 |
. |
|
7458 |
^ false |
|
7459 |
! |
|
7460 |
||
7461 |
glxSetmonitor: mtype in: aGLXWindowId |
|
7462 |
||
7463 |
%{ /* NOCONTEXT */ |
|
7464 |
#ifdef GLX |
|
7465 |
SETWIN(aGLXWindowId) |
|
7466 |
setmonitor(_shortVal(mtype)); |
|
7467 |
RETURN (true); |
|
7468 |
#endif |
|
7469 |
%} |
|
7470 |
. |
|
7471 |
^ false |
|
7472 |
! |
|
7473 |
||
7474 |
glxSetnurbsproperty: property value: value in: aGLXWindowId |
|
7475 |
||
7476 |
%{ /* NOCONTEXT */ |
|
7477 |
#ifdef GLX |
|
7478 |
SETWIN(aGLXWindowId) |
|
7479 |
setnurbsproperty(_longVal(property), _floatVal(value)); |
|
7480 |
RETURN (true); |
|
7481 |
#endif |
|
7482 |
%} |
|
7483 |
. |
|
7484 |
^ false |
|
7485 |
! |
|
7486 |
||
7487 |
glxSetpattern: index in: aGLXWindowId |
|
7488 |
||
7489 |
%{ /* NOCONTEXT */ |
|
7490 |
#ifdef GLX |
|
7491 |
SETWIN(aGLXWindowId) |
|
7492 |
setpattern(_shortVal(index)); |
|
7493 |
RETURN (true); |
|
7494 |
#endif |
|
7495 |
%} |
|
7496 |
. |
|
7497 |
^ false |
|
7498 |
! |
|
7499 |
||
7500 |
glxSetpup: pup entry: entry mode: mode in: aGLXWindowId |
|
7501 |
||
7502 |
%{ /* NOCONTEXT */ |
|
7503 |
#ifdef GLX |
|
7504 |
SETWIN(aGLXWindowId) |
|
7505 |
setpup(_longVal(pup), _longVal(entry), (ulong)__intVal(mode)); |
|
7506 |
RETURN (true); |
|
7507 |
#endif |
|
7508 |
%} |
|
7509 |
. |
|
7510 |
^ false |
|
7511 |
! |
|
7512 |
||
7513 |
glxSetvaluator: v init: init vmin: vmin vmax: vmax in: aGLXWindowId |
|
7514 |
||
7515 |
%{ /* NOCONTEXT */ |
|
7516 |
#ifdef GLX |
|
7517 |
SETWIN(aGLXWindowId) |
|
7518 |
setvaluator(_deviceVal(v), _shortVal(init), _shortVal(vmin), _shortVal(vmax)); |
|
7519 |
RETURN (true); |
|
7520 |
#endif |
|
7521 |
%} |
|
7522 |
. |
|
7523 |
^ false |
|
7524 |
! |
|
7525 |
||
7526 |
glxSetvideo: reg value: value in: aGLXWindowId |
|
7527 |
||
7528 |
%{ /* NOCONTEXT */ |
|
7529 |
#ifdef GLX |
|
7530 |
SETWIN(aGLXWindowId) |
|
7531 |
setvideo(_longVal(reg), _longVal(value)); |
|
7532 |
RETURN (true); |
|
7533 |
#endif |
|
7534 |
%} |
|
7535 |
. |
|
7536 |
^ false |
|
7537 |
! |
|
7538 |
||
7539 |
glxShademodel: model in: aGLXWindowId |
|
7540 |
||
7541 |
%{ /* NOCONTEXT */ |
|
7542 |
#ifdef GLX |
|
7543 |
SETWIN(aGLXWindowId) |
|
7544 |
shademodel(_longVal(model)); |
|
7545 |
RETURN (true); |
|
7546 |
#endif |
|
7547 |
%} |
|
7548 |
. |
|
7549 |
^ false |
|
7550 |
! |
|
7551 |
||
7552 |
glxShaderangeLowin: lowin hiwin: hiwin z1: z1 z2: z2 in: aGLXWindowId |
|
7553 |
||
7554 |
%{ /* NOCONTEXT */ |
|
7555 |
#ifdef GLX |
|
7556 |
SETWIN(aGLXWindowId) |
|
4718 | 7557 |
shaderange(_colorindexVal(lowin), _colorindexVal(hiwin), |
294 | 7558 |
_screencoordVal(z1), _screencoordVal(z2)); |
7559 |
RETURN (true); |
|
7560 |
#endif |
|
7561 |
%} |
|
7562 |
. |
|
7563 |
^ false |
|
7564 |
! |
|
7565 |
||
7566 |
glxSmoothline: mode in: aGLXWindowId |
|
7567 |
||
7568 |
%{ /* NOCONTEXT */ |
|
7569 |
#ifdef GLX |
|
7570 |
SETWIN(aGLXWindowId) |
|
7571 |
smoothline(_longVal(mode)); |
|
7572 |
RETURN (true); |
|
7573 |
#endif |
|
7574 |
%} |
|
7575 |
. |
|
7576 |
^ false |
|
7577 |
! |
|
7578 |
||
4718 | 7579 |
glxStencilEnable: enable ref: ref func: func mask: mask fail: fail |
294 | 7580 |
pass: pass zpass: zpass in: aGLXWindowId |
7581 |
||
7582 |
%{ /* NOCONTEXT */ |
|
7583 |
#ifdef GLX |
|
7584 |
SETWIN(aGLXWindowId) |
|
4718 | 7585 |
stencil(_longVal(enable), (ulong)__intVal(ref), _longVal(func), |
294 | 7586 |
(ulong)__intVal(mask), _longVal(fail), _longVal(pass), _longVal(zpass)); |
7587 |
RETURN (true); |
|
7588 |
#endif |
|
7589 |
%} |
|
7590 |
. |
|
7591 |
^ false |
|
7592 |
! |
|
7593 |
||
7594 |
glxStensize: planes in: aGLXWindowId |
|
7595 |
||
7596 |
%{ /* NOCONTEXT */ |
|
7597 |
#ifdef GLX |
|
7598 |
SETWIN(aGLXWindowId) |
|
7599 |
stensize(_longVal(planes)); |
|
7600 |
RETURN (true); |
|
7601 |
#endif |
|
7602 |
%} |
|
7603 |
. |
|
7604 |
^ false |
|
7605 |
! |
|
7606 |
||
7607 |
glxStepunitX: x y: y in: aGLXWindowId |
|
7608 |
||
7609 |
%{ /* NOCONTEXT */ |
|
7610 |
#ifdef GLX |
|
7611 |
SETWIN(aGLXWindowId) |
|
7612 |
stepunit(_longVal(x), _longVal(y)); |
|
7613 |
RETURN (true); |
|
7614 |
#endif |
|
7615 |
%} |
|
7616 |
. |
|
7617 |
^ false |
|
7618 |
! |
|
7619 |
||
7620 |
glxSubpixel: b in: aGLXWindowId |
|
7621 |
||
7622 |
%{ /* NOCONTEXT */ |
|
7623 |
#ifdef GLX |
|
7624 |
SETWIN(aGLXWindowId) |
|
7625 |
subpixel(_booleanVal(b)); |
|
7626 |
RETURN (true); |
|
7627 |
#endif |
|
7628 |
%} |
|
7629 |
. |
|
7630 |
^ false |
|
7631 |
! |
|
7632 |
||
7633 |
glxSwapinterval: i in: aGLXWindowId |
|
7634 |
||
7635 |
%{ /* NOCONTEXT */ |
|
7636 |
#ifdef GLX |
|
7637 |
SETWIN(aGLXWindowId) |
|
7638 |
swapinterval(_shortVal(i)); |
|
7639 |
RETURN (true); |
|
7640 |
#endif |
|
7641 |
%} |
|
7642 |
. |
|
7643 |
^ false |
|
7644 |
! |
|
7645 |
||
7646 |
glxSwaptmeshIn: aGLXWindowId |
|
7647 |
||
7648 |
%{ /* NOCONTEXT */ |
|
7649 |
#ifdef GLX |
|
7650 |
SETWIN(aGLXWindowId) |
|
7651 |
swaptmesh(); |
|
7652 |
RETURN (true); |
|
7653 |
#endif |
|
7654 |
%} |
|
7655 |
. |
|
7656 |
^ false |
|
7657 |
! |
|
7658 |
||
7659 |
glxSwinopen: parent in: aGLXWindowId |
|
7660 |
||
7661 |
%{ /* NOCONTEXT */ |
|
7662 |
#ifdef GLX |
|
7663 |
SETWIN(aGLXWindowId) |
|
7664 |
swinopen(_longVal(parent)); |
|
7665 |
RETURN (true); |
|
7666 |
#endif |
|
7667 |
%} |
|
7668 |
. |
|
7669 |
^ false |
|
7670 |
! |
|
7671 |
||
7672 |
glxSwritemask: mask in: aGLXWindowId |
|
7673 |
||
7674 |
%{ /* NOCONTEXT */ |
|
7675 |
#ifdef GLX |
|
7676 |
SETWIN(aGLXWindowId) |
|
7677 |
swritemask((ulong)__intVal(mask)); |
|
7678 |
RETURN (true); |
|
7679 |
#endif |
|
7680 |
%} |
|
7681 |
. |
|
7682 |
^ false |
|
7683 |
! |
|
7684 |
||
7685 |
glxTextinitIn: aGLXWindowId |
|
7686 |
||
7687 |
%{ /* NOCONTEXT */ |
|
7688 |
#ifdef GLX |
|
7689 |
SETWIN(aGLXWindowId) |
|
7690 |
textinit(); |
|
7691 |
RETURN (true); |
|
7692 |
#endif |
|
7693 |
%} |
|
7694 |
. |
|
7695 |
^ false |
|
7696 |
! |
|
7697 |
||
7698 |
glxTextportLeft: left right: right bottom: bottom top: top in: aGLXWindowId |
|
7699 |
||
7700 |
%{ /* NOCONTEXT */ |
|
7701 |
#ifdef GLX |
|
7702 |
SETWIN(aGLXWindowId) |
|
4718 | 7703 |
textport(_screencoordVal(left), _screencoordVal(right), |
294 | 7704 |
_screencoordVal(bottom), _screencoordVal(top)); |
7705 |
RETURN (true); |
|
7706 |
#endif |
|
7707 |
%} |
|
7708 |
. |
|
7709 |
^ false |
|
7710 |
! |
|
7711 |
||
7712 |
glxTieB: b v1: v1 v2: v2 in: aGLXWindowId |
|
7713 |
||
7714 |
%{ /* NOCONTEXT */ |
|
7715 |
#ifdef GLX |
|
7716 |
SETWIN(aGLXWindowId) |
|
7717 |
tie(_deviceVal(b), _deviceVal(v1), _deviceVal(v2)); |
|
7718 |
RETURN (true); |
|
7719 |
#endif |
|
7720 |
%} |
|
7721 |
. |
|
7722 |
^ false |
|
7723 |
! |
|
7724 |
||
7725 |
glxTlutbind: target index: index in: aGLXWindowId |
|
7726 |
||
7727 |
%{ /* NOCONTEXT */ |
|
7728 |
#ifdef FULL_GLX |
|
7729 |
SETWIN(aGLXWindowId) |
|
7730 |
tlutbind(_longVal(target), _longVal(index)); |
|
7731 |
RETURN (true); |
|
7732 |
#endif |
|
7733 |
%} |
|
7734 |
. |
|
7735 |
^ false |
|
7736 |
! |
|
7737 |
||
7738 |
glxTpoffIn: aGLXWindowId |
|
7739 |
||
7740 |
%{ /* NOCONTEXT */ |
|
7741 |
#ifdef GLX |
|
7742 |
SETWIN(aGLXWindowId) |
|
7743 |
tpoff(); |
|
7744 |
RETURN (true); |
|
7745 |
#endif |
|
7746 |
%} |
|
7747 |
. |
|
7748 |
^ false |
|
7749 |
! |
|
7750 |
||
7751 |
glxTponIn: aGLXWindowId |
|
7752 |
||
7753 |
%{ /* NOCONTEXT */ |
|
7754 |
#ifdef GLX |
|
7755 |
SETWIN(aGLXWindowId) |
|
7756 |
tpon(); |
|
7757 |
RETURN (true); |
|
7758 |
#endif |
|
7759 |
%} |
|
7760 |
. |
|
7761 |
^ false |
|
7762 |
! |
|
7763 |
||
7764 |
glxUnqdevice: dev in: aGLXWindowId |
|
7765 |
||
7766 |
%{ /* NOCONTEXT */ |
|
1932 | 7767 |
SETWIN(aGLXWindowId) |
7768 |
#ifdef OPENGL |
|
7769 |
#else |
|
294 | 7770 |
unqdevice(_deviceVal(dev)); |
1932 | 7771 |
#endif |
7772 |
%} |
|
294 | 7773 |
! |
7774 |
||
7775 |
glxWmpack: pack in: aGLXWindowId |
|
7776 |
||
7777 |
%{ /* NOCONTEXT */ |
|
7778 |
#ifdef GLX |
|
7779 |
SETWIN(aGLXWindowId) |
|
7780 |
wmpack((ulong)__intVal(pack)); |
|
7781 |
RETURN (true); |
|
7782 |
#endif |
|
7783 |
%} |
|
7784 |
. |
|
7785 |
^ false |
|
7786 |
! |
|
7787 |
||
7788 |
glxWritemask: wtm in: aGLXWindowId |
|
7789 |
||
7790 |
%{ /* NOCONTEXT */ |
|
7791 |
#ifdef GLX |
|
7792 |
SETWIN(aGLXWindowId) |
|
7793 |
writemask(_colorindexVal(wtm)); |
|
7794 |
RETURN (true); |
|
7795 |
#endif |
|
7796 |
%} |
|
7797 |
. |
|
7798 |
^ false |
|
7799 |
! |
|
7800 |
||
7801 |
glxXfpt2X: x y: y in: aGLXWindowId |
|
7802 |
||
7803 |
%{ /* NOCONTEXT */ |
|
7804 |
#ifdef GLX |
|
7805 |
Coord c_x, c_y; |
|
7806 |
||
7807 |
_COORD_ (x, c_x) |
|
7808 |
_COORD_ (y, c_y) |
|
7809 |
SETWIN(aGLXWindowId) |
|
7810 |
xfpt2(c_x, c_y); |
|
7811 |
RETURN (true); |
|
7812 |
#endif |
|
7813 |
%} |
|
7814 |
. |
|
7815 |
^ false |
|
7816 |
! |
|
7817 |
||
7818 |
glxXfpt2iX: x y: y in: aGLXWindowId |
|
7819 |
||
7820 |
%{ /* NOCONTEXT */ |
|
7821 |
#ifdef GLX |
|
7822 |
Icoord c_x, c_y; |
|
7823 |
||
7824 |
_ICOORD_ (x, c_x) |
|
7825 |
_ICOORD_ (y, c_y) |
|
7826 |
SETWIN(aGLXWindowId) |
|
7827 |
xfpt2i(c_x, c_y); |
|
7828 |
RETURN (true); |
|
7829 |
#endif |
|
7830 |
%} |
|
7831 |
. |
|
7832 |
^ false |
|
7833 |
! |
|
7834 |
||
7835 |
glxXfpt2sX: x y: y in: aGLXWindowId |
|
7836 |
||
7837 |
%{ /* NOCONTEXT */ |
|
7838 |
#ifdef GLX |
|
7839 |
Scoord c_x, c_y; |
|
7840 |
||
7841 |
_SCOORD_ (x, c_x) |
|
7842 |
_SCOORD_ (y, c_y) |
|
7843 |
SETWIN(aGLXWindowId) |
|
7844 |
xfpt2s(c_x, c_y); |
|
7845 |
RETURN (true); |
|
7846 |
#endif |
|
7847 |
%} |
|
7848 |
. |
|
7849 |
^ false |
|
7850 |
! |
|
7851 |
||
7852 |
glxXfpt4X: x y: y z: z w: w in: aGLXWindowId |
|
7853 |
||
7854 |
%{ /* NOCONTEXT */ |
|
7855 |
#ifdef GLX |
|
7856 |
Coord c_x, c_y, c_z, c_w; |
|
7857 |
||
7858 |
_COORD_ (x, c_x) |
|
7859 |
_COORD_ (y, c_y) |
|
7860 |
_COORD_ (z, c_z) |
|
7861 |
_COORD_ (w, c_w) |
|
7862 |
SETWIN(aGLXWindowId) |
|
7863 |
xfpt4(c_x, c_y, c_z, c_w); |
|
7864 |
RETURN (true); |
|
7865 |
#endif |
|
7866 |
%} |
|
7867 |
. |
|
7868 |
^ false |
|
7869 |
! |
|
7870 |
||
7871 |
glxXfpt4iX: x y: y z: z w: w in: aGLXWindowId |
|
7872 |
||
7873 |
%{ /* NOCONTEXT */ |
|
7874 |
#ifdef GLX |
|
7875 |
Icoord c_x, c_y, c_z, c_w; |
|
7876 |
||
7877 |
_ICOORD_ (x, c_x) |
|
7878 |
_ICOORD_ (y, c_y) |
|
7879 |
_ICOORD_ (z, c_z) |
|
7880 |
_ICOORD_ (w, c_w) |
|
7881 |
SETWIN(aGLXWindowId) |
|
7882 |
xfpt4i(c_x, c_y, c_z, c_w); |
|
7883 |
RETURN (true); |
|
7884 |
#endif |
|
7885 |
%} |
|
7886 |
. |
|
7887 |
^ false |
|
7888 |
! |
|
7889 |
||
7890 |
glxXfpt4sX: x y: y z: z w: w in: aGLXWindowId |
|
7891 |
||
7892 |
%{ /* NOCONTEXT */ |
|
7893 |
#ifdef GLX |
|
7894 |
Scoord c_x, c_y, c_z, c_w; |
|
7895 |
||
7896 |
_SCOORD_ (x, c_x) |
|
7897 |
_SCOORD_ (y, c_y) |
|
7898 |
_SCOORD_ (z, c_z) |
|
7899 |
_SCOORD_ (w, c_w) |
|
7900 |
SETWIN(aGLXWindowId) |
|
7901 |
xfpt4s(c_x, c_y, c_z, c_w); |
|
7902 |
RETURN (true); |
|
7903 |
#endif |
|
7904 |
%} |
|
7905 |
. |
|
7906 |
^ false |
|
7907 |
! |
|
7908 |
||
7909 |
glxXfptX: x y: y z: z in: aGLXWindowId |
|
7910 |
||
7911 |
%{ /* NOCONTEXT */ |
|
7912 |
#ifdef GLX |
|
7913 |
Coord c_x, c_y, c_z; |
|
7914 |
||
7915 |
_COORD_ (x, c_x) |
|
7916 |
_COORD_ (y, c_y) |
|
7917 |
_COORD_ (z, c_z) |
|
7918 |
SETWIN(aGLXWindowId) |
|
7919 |
xfpt(c_x, c_y, c_z); |
|
7920 |
RETURN (true); |
|
7921 |
#endif |
|
7922 |
%} |
|
7923 |
. |
|
7924 |
^ false |
|
7925 |
! |
|
7926 |
||
7927 |
glxXfptiX: x y: y z: z in: aGLXWindowId |
|
7928 |
||
7929 |
%{ /* NOCONTEXT */ |
|
7930 |
#ifdef GLX |
|
7931 |
Icoord c_x, c_y, c_z; |
|
7932 |
||
7933 |
_ICOORD_ (x, c_x) |
|
7934 |
_ICOORD_ (y, c_y) |
|
7935 |
_ICOORD_ (z, c_z) |
|
7936 |
SETWIN(aGLXWindowId) |
|
7937 |
xfpti(c_x, c_y, c_z); |
|
7938 |
RETURN (true); |
|
7939 |
#endif |
|
7940 |
%} |
|
7941 |
. |
|
7942 |
^ false |
|
7943 |
! |
|
7944 |
||
7945 |
glxXfptsX: x y: y z: z in: aGLXWindowId |
|
7946 |
||
7947 |
%{ /* NOCONTEXT */ |
|
7948 |
#ifdef GLX |
|
7949 |
Scoord c_x, c_y, c_z; |
|
7950 |
||
7951 |
_SCOORD_ (x, c_x) |
|
7952 |
_SCOORD_ (y, c_y) |
|
7953 |
_SCOORD_ (z, c_z) |
|
7954 |
SETWIN(aGLXWindowId) |
|
7955 |
xfpts(c_x, c_y, c_z); |
|
7956 |
RETURN (true); |
|
7957 |
#endif |
|
7958 |
%} |
|
7959 |
. |
|
7960 |
^ false |
|
7961 |
! ! |
|
7962 |
||
7963 |
!GLXWorkstation methodsFor:'vertex data transfer'! |
|
7964 |
||
7965 |
glxN3f:arrayOf3Floats in:aGLXWindowId |
|
7966 |
"argument must be an array of 3 floats containing the |
|
7967 |
current vertex normal - in real GL only" |
|
7968 |
||
7969 |
%{ /* NOCONTEXT */ |
|
7970 |
#ifdef GLX |
|
7971 |
float vec[3], *v; |
|
7972 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7973 |
if (! (v = __glx_getFloatsFromInto(arrayOf3Floats, vec, 3))) RETURN(false); |
294 | 7974 |
SETWIN(aGLXWindowId) |
7975 |
n3f(v); |
|
7976 |
RETURN (true); |
|
7977 |
#endif |
|
7978 |
%} |
|
7979 |
. |
|
7980 |
^ false |
|
7981 |
! |
|
7982 |
||
7983 |
glxV2d:v in:aGLXWindowId |
|
7984 |
"pass a vertex; v must be a vector with 2 doubles; z is taken as 0" |
|
7985 |
||
7986 |
%{ /* NOCONTEXT */ |
|
7987 |
double vec[2], *c_v; |
|
7988 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
7989 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 2))) RETURN(false); |
294 | 7990 |
SETWIN(aGLXWindowId) |
1932 | 7991 |
#ifdef OPENGL |
7992 |
#else |
|
294 | 7993 |
v2d(c_v); |
1932 | 7994 |
#endif |
294 | 7995 |
RETURN (true); |
7996 |
%} |
|
7997 |
! |
|
7998 |
||
7999 |
glxV2f:v in:aGLXWindowId |
|
8000 |
"pass a vertex; v must be a vector with 2 floats; z is taken as 0" |
|
8001 |
||
8002 |
%{ /* NOCONTEXT */ |
|
8003 |
float vec[2], *c_v; |
|
8004 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8005 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 2))) RETURN(false); |
294 | 8006 |
SETWIN(aGLXWindowId) |
1932 | 8007 |
#ifdef OPENGL |
8008 |
#else |
|
294 | 8009 |
v2f(c_v); |
1932 | 8010 |
#endif |
294 | 8011 |
RETURN (true); |
8012 |
%} |
|
8013 |
! |
|
8014 |
||
8015 |
glxV2fX:x y:y in:aGLXWindowId |
|
8016 |
"pass a vertex from individual x and y values; z is taken as 0.0" |
|
8017 |
||
8018 |
%{ /* NOCONTEXT */ |
|
8019 |
float vec[2]; |
|
8020 |
||
8021 |
_FLOAT_(x, vec[0]) |
|
8022 |
_FLOAT_(y, vec[1]) |
|
8023 |
SETWIN(aGLXWindowId) |
|
1932 | 8024 |
#ifdef OPENGL |
8025 |
#else |
|
294 | 8026 |
v2f(vec); |
1932 | 8027 |
#endif |
294 | 8028 |
RETURN (true); |
8029 |
%} |
|
8030 |
! |
|
8031 |
||
8032 |
glxV2i:v in:aGLXWindowId |
|
8033 |
"pass a vertex; v must be a vector with 2 longs; z is taken as 0" |
|
8034 |
||
8035 |
%{ /* NOCONTEXT */ |
|
8036 |
long vec[2], *c_v; |
|
8037 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8038 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 2))) RETURN(false); |
294 | 8039 |
SETWIN(aGLXWindowId) |
1932 | 8040 |
#ifdef OPENGL |
8041 |
#else |
|
294 | 8042 |
v2i(c_v); |
1932 | 8043 |
#endif |
294 | 8044 |
RETURN (true); |
8045 |
%} |
|
8046 |
! |
|
8047 |
||
8048 |
glxV2s:v in:aGLXWindowId |
|
8049 |
"pass a vertex; v must be a vector with 2 shorts; z is taken as 0" |
|
8050 |
||
8051 |
%{ /* NOCONTEXT */ |
|
8052 |
short vec[2], *c_v; |
|
8053 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8054 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 2))) RETURN(false); |
294 | 8055 |
SETWIN(aGLXWindowId) |
1932 | 8056 |
#ifdef OPENGL |
8057 |
#else |
|
294 | 8058 |
v2s(c_v); |
1932 | 8059 |
#endif |
294 | 8060 |
RETURN (true); |
8061 |
%} |
|
8062 |
! |
|
8063 |
||
8064 |
glxV3d:v in:aGLXWindowId |
|
8065 |
"pass a vertex; v must be a 3-element double-vector" |
|
8066 |
||
8067 |
%{ /* NOCONTEXT */ |
|
8068 |
double vec[3], *c_v; |
|
8069 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8070 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 3))) RETURN(false); |
294 | 8071 |
SETWIN(aGLXWindowId) |
1932 | 8072 |
#ifdef OPENGL |
8073 |
#else |
|
294 | 8074 |
v3d(c_v); |
1932 | 8075 |
#endif |
294 | 8076 |
RETURN (true); |
8077 |
%} |
|
8078 |
. |
|
8079 |
^ false |
|
8080 |
! |
|
8081 |
||
8082 |
glxV3f:v in:aGLXWindowId |
|
8083 |
"pass a vertex; v must be a 3-element float-vector" |
|
8084 |
||
8085 |
%{ /* NOCONTEXT */ |
|
8086 |
float vec[3], *c_v; |
|
8087 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8088 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 3))) RETURN(false); |
294 | 8089 |
SETWIN(aGLXWindowId) |
1932 | 8090 |
#ifdef OPENGL |
8091 |
#else |
|
294 | 8092 |
v3f(c_v); |
1932 | 8093 |
#endif |
294 | 8094 |
RETURN (true); |
8095 |
%} |
|
8096 |
! |
|
8097 |
||
8098 |
glxV3fX:x y:y z:z in: aGLXWindowId |
|
8099 |
"pass a vector from individual x, y and z (float) values" |
|
8100 |
||
8101 |
%{ /* NOCONTEXT */ |
|
8102 |
float vec[3]; |
|
8103 |
||
8104 |
_FLOAT_(x, vec[0]) |
|
8105 |
_FLOAT_(y, vec[1]) |
|
8106 |
_FLOAT_(z, vec[2]) |
|
8107 |
SETWIN(aGLXWindowId) |
|
1932 | 8108 |
#ifdef OPENGL |
8109 |
#else |
|
294 | 8110 |
v3f(vec); |
1932 | 8111 |
#endif |
294 | 8112 |
RETURN (true); |
8113 |
%} |
|
8114 |
! |
|
8115 |
||
8116 |
glxV3i:v in:aGLXWindowId |
|
8117 |
"pass a vertex; v must be a vector with 3 longs" |
|
8118 |
||
8119 |
%{ /* NOCONTEXT */ |
|
8120 |
long vec[3], *c_v; |
|
8121 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8122 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 3))) RETURN(false); |
294 | 8123 |
SETWIN(aGLXWindowId) |
1932 | 8124 |
#ifdef OPENGL |
8125 |
#else |
|
294 | 8126 |
v3i(c_v); |
1932 | 8127 |
#endif |
294 | 8128 |
RETURN (true); |
8129 |
%} |
|
8130 |
! |
|
8131 |
||
8132 |
glxV3s:v in:aGLXWindowId |
|
8133 |
"pass a vertex; v must be a vector with 3 shorts" |
|
8134 |
||
8135 |
%{ /* NOCONTEXT */ |
|
8136 |
short vec[3], *c_v; |
|
8137 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8138 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 3))) RETURN(false); |
294 | 8139 |
SETWIN(aGLXWindowId) |
1932 | 8140 |
#ifdef OPENGL |
8141 |
#else |
|
294 | 8142 |
v3s(c_v); |
1932 | 8143 |
#endif |
294 | 8144 |
RETURN (true); |
8145 |
%} |
|
8146 |
! |
|
8147 |
||
8148 |
glxV4d:v in:aGLXWindowId |
|
8149 |
"pass a vertex; v must be a 4-element double-vector, |
|
8150 |
containing x, y, z and w" |
|
8151 |
||
8152 |
%{ /* NOCONTEXT */ |
|
8153 |
double vec[4], *c_v; |
|
8154 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8155 |
if (! (c_v = __glx_getDoublesFromInto(v, vec, 4))) RETURN(false); |
294 | 8156 |
SETWIN(aGLXWindowId) |
1932 | 8157 |
#ifdef OPENGL |
8158 |
#else |
|
294 | 8159 |
v4d(c_v); |
1932 | 8160 |
#endif |
294 | 8161 |
RETURN (true); |
8162 |
%} |
|
8163 |
! |
|
8164 |
||
8165 |
glxV4f:v in:aGLXWindowId |
|
8166 |
"pass a vertex; v must be a 4-element float-vector, |
|
8167 |
containing x, y, z and w" |
|
8168 |
||
8169 |
%{ /* NOCONTEXT */ |
|
8170 |
float vec[4], *c_v; |
|
8171 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8172 |
if (! (c_v = __glx_getFloatsFromInto(v, vec, 4))) RETURN(false); |
294 | 8173 |
SETWIN(aGLXWindowId) |
1932 | 8174 |
#ifdef OPENGL |
8175 |
#else |
|
294 | 8176 |
v4f(c_v); |
1932 | 8177 |
#endif |
294 | 8178 |
RETURN (true); |
8179 |
%} |
|
8180 |
! |
|
8181 |
||
8182 |
glxV4i:v in:aGLXWindowId |
|
8183 |
"pass a vertex; v must be a 4-element int-vector, |
|
8184 |
containing x, y, z and w" |
|
8185 |
||
8186 |
%{ /* NOCONTEXT */ |
|
8187 |
long vec[4], *c_v; |
|
8188 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8189 |
if (! (c_v = __glx_getLongsFromInto(v, vec, 4))) RETURN(false); |
294 | 8190 |
SETWIN(aGLXWindowId) |
1932 | 8191 |
#ifdef OPENGL |
8192 |
#else |
|
294 | 8193 |
v4i(c_v); |
1932 | 8194 |
#endif |
294 | 8195 |
RETURN (true); |
8196 |
%} |
|
8197 |
! |
|
8198 |
||
8199 |
glxV4s:v in:aGLXWindowId |
|
8200 |
"pass a vertex; v must be a 4-element short-vector, |
|
8201 |
containing x, y, z and w" |
|
8202 |
||
8203 |
%{ /* NOCONTEXT */ |
|
8204 |
short vec[4], *c_v; |
|
8205 |
||
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8206 |
if (! (c_v = __glx_getShortsFromInto(v, vec, 4))) RETURN(false); |
294 | 8207 |
SETWIN(aGLXWindowId) |
1932 | 8208 |
#ifdef OPENGL |
8209 |
#else |
|
294 | 8210 |
v4s(c_v); |
1932 | 8211 |
#endif |
294 | 8212 |
RETURN (true); |
8213 |
%} |
|
8214 |
! |
|
8215 |
||
8216 |
glxVOriginIn:aGLXWindowId |
|
8217 |
"pass a 0.0/0.0/0.0 vector. |
|
8218 |
This is the same as v3f:#(0.0 0.0 0.0), but, since its so |
|
8219 |
common, this somewhat faster method has been provided" |
|
8220 |
||
8221 |
%{ /* NOCONTEXT */ |
|
8222 |
static float vec[3] = {0.0, 0.0, 0.0}; |
|
8223 |
||
8224 |
SETWIN(aGLXWindowId) |
|
1932 | 8225 |
#ifdef OPENGL |
8226 |
#else |
|
294 | 8227 |
v3f(vec); |
1932 | 8228 |
#endif |
294 | 8229 |
RETURN (true); |
8230 |
%} |
|
8231 |
! |
|
8232 |
||
8233 |
glxVUnitXIn:aGLXWindowId |
|
8234 |
"pass a 1.0/0.0/0.0 vector. |
|
8235 |
This is the same as v3f:#(1.0 0.0 0.0), but, since its so |
|
8236 |
common, this somewhat faster method has been provided" |
|
8237 |
||
8238 |
%{ /* NOCONTEXT */ |
|
8239 |
static float vec[3] = {1.0, 0.0, 0.0}; |
|
8240 |
||
8241 |
SETWIN(aGLXWindowId) |
|
1932 | 8242 |
#ifdef OPENGL |
8243 |
#else |
|
294 | 8244 |
v3f(vec); |
1932 | 8245 |
#endif |
294 | 8246 |
RETURN (true); |
8247 |
%} |
|
8248 |
! |
|
8249 |
||
8250 |
glxVUnitYIn:aGLXWindowId |
|
8251 |
"pass a 0.0/1.0/0.0 vector. |
|
8252 |
This is the same as v3f:#(0.0 1.0 0.0), but, since its so |
|
8253 |
common, this somewhat faster method has been provided" |
|
8254 |
||
8255 |
%{ /* NOCONTEXT */ |
|
8256 |
static float vec[3] = {0.0, 1.0, 0.0}; |
|
8257 |
||
8258 |
SETWIN(aGLXWindowId) |
|
1932 | 8259 |
#ifdef OPENGL |
8260 |
#else |
|
294 | 8261 |
v3f(vec); |
1932 | 8262 |
#endif |
294 | 8263 |
RETURN (true); |
8264 |
%} |
|
8265 |
! |
|
8266 |
||
8267 |
glxVUnitZIn:aGLXWindowId |
|
8268 |
"pass a 0.0/0.0/1.0 vector. |
|
8269 |
This is the same as v3f:#(0.0 0.0 1.0), but, since its so |
|
8270 |
common, this somewhat faster method has been provided" |
|
8271 |
||
8272 |
%{ /* NOCONTEXT */ |
|
8273 |
static float vec[3] = {0.0, 0.0, 1.0}; |
|
8274 |
||
8275 |
SETWIN(aGLXWindowId) |
|
1932 | 8276 |
#ifdef OPENGL |
8277 |
#else |
|
294 | 8278 |
v3f(vec); |
1932 | 8279 |
#endif |
294 | 8280 |
RETURN (true); |
8281 |
%} |
|
8282 |
! ! |
|
8283 |
||
8284 |
!GLXWorkstation methodsFor:'video and planes'! |
|
8285 |
||
8286 |
glxOverlayPlanes: planes in: aGLXWindowId |
|
8287 |
||
8288 |
%{ /* NOCONTEXT */ |
|
8289 |
#ifdef GLX |
|
8290 |
SETWIN(aGLXWindowId) |
|
8291 |
overlay(_longVal(planes)); |
|
8292 |
RETURN (true); |
|
8293 |
#endif |
|
8294 |
%} |
|
8295 |
. |
|
8296 |
^ false |
|
8297 |
! |
|
8298 |
||
8299 |
glxStereobufferIn: aGLXWindowId |
|
8300 |
||
8301 |
%{ /* NOCONTEXT */ |
|
8302 |
#ifdef FULL_GLX |
|
8303 |
SETWIN(aGLXWindowId) |
|
8304 |
stereobuffer(); |
|
8305 |
RETURN (true); |
|
8306 |
#endif |
|
8307 |
%} |
|
8308 |
. |
|
8309 |
^ false |
|
8310 |
! |
|
8311 |
||
8312 |
glxUnderlay: planes in: aGLXWindowId |
|
8313 |
||
8314 |
%{ /* NOCONTEXT */ |
|
8315 |
#ifdef GLX |
|
8316 |
SETWIN(aGLXWindowId) |
|
8317 |
underlay(_longVal(planes)); |
|
8318 |
RETURN (true); |
|
8319 |
#endif |
|
8320 |
%} |
|
8321 |
. |
|
8322 |
^ false |
|
8323 |
! |
|
8324 |
||
8325 |
glxVideocmd:cmd in:aGLXWindowId |
|
8326 |
||
8327 |
%{ /* NOCONTEXT */ |
|
8328 |
#ifdef GLX |
|
8329 |
SETWIN(aGLXWindowId) |
|
8330 |
videocmd(_longVal(cmd)); |
|
8331 |
RETURN (true); |
|
8332 |
#endif |
|
8333 |
%} |
|
8334 |
. |
|
8335 |
^ false |
|
8336 |
! ! |
|
8337 |
||
8338 |
!GLXWorkstation methodsFor:'viewing'! |
|
8339 |
||
8340 |
glxLookatVx:vx vy:vy vz:vz px:px py:py pz:pz twist:twist in:aGLXWindowId |
|
8341 |
"define viewing transformation" |
|
8342 |
||
8343 |
%{ /* NOCONTEXT */ |
|
8344 |
||
8345 |
Coord f_vx, f_vy, f_vz, f_px, f_py, f_pz; |
|
8346 |
Angle a_twist; |
|
8347 |
||
8348 |
_COORD_ (vx, f_vx) |
|
8349 |
_COORD_ (vy, f_vy) |
|
8350 |
_COORD_ (vz, f_vz) |
|
8351 |
_COORD_ (px, f_px) |
|
8352 |
_COORD_ (py, f_py) |
|
8353 |
_COORD_ (pz, f_pz) |
|
8354 |
_ANGLE_ (twist, a_twist) |
|
8355 |
SETWIN(aGLXWindowId) |
|
1932 | 8356 |
#ifdef OPENGL |
8357 |
#else |
|
294 | 8358 |
lookat(f_vx, f_vy, f_vz, f_px, f_py, f_pz, a_twist); |
1932 | 8359 |
#endif |
294 | 8360 |
%} |
8361 |
! |
|
8362 |
||
8363 |
glxOrtho2Left: left right: right bottom: bottom top: top in: aGLXWindowId |
|
8364 |
"define 2D orthogonal projection" |
|
8365 |
||
8366 |
%{ /* NOCONTEXT */ |
|
8367 |
float f_left, f_right, f_top, f_bottom; |
|
8368 |
||
8369 |
SETWIN(aGLXWindowId) |
|
8370 |
_FLOAT_(left, f_left) |
|
8371 |
_FLOAT_(right, f_right) |
|
8372 |
_FLOAT_(bottom, f_bottom) |
|
8373 |
_FLOAT_(top, f_top) |
|
1932 | 8374 |
#ifdef OPENGL |
8375 |
#else |
|
294 | 8376 |
ortho2(f_left, f_right, f_bottom, f_top); |
1932 | 8377 |
#endif |
8378 |
%} |
|
294 | 8379 |
! |
8380 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8381 |
glxOrthoLeft: left right: right bottom: bottom top: top near: znear far: zfar in: aGLXWindowId |
294 | 8382 |
"define orthogonal projection" |
8383 |
||
8384 |
%{ /* NOCONTEXT */ |
|
8385 |
float f_left, f_right, f_bottom, f_top, |
|
8386 |
f_near, f_far; |
|
8387 |
||
8388 |
_FLOAT_(left, f_left) |
|
8389 |
_FLOAT_(right, f_right) |
|
8390 |
_FLOAT_(bottom, f_bottom) |
|
8391 |
_FLOAT_(top, f_top) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8392 |
_FLOAT_(znear, f_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8393 |
_FLOAT_(zfar, f_far) |
294 | 8394 |
SETWIN(aGLXWindowId) |
1932 | 8395 |
#ifdef OPENGL |
8396 |
#else |
|
294 | 8397 |
ortho(f_left, f_right, f_bottom, f_top, f_near, f_far); |
1932 | 8398 |
#endif |
294 | 8399 |
%} |
8400 |
! |
|
8401 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8402 |
glxPerspectiveFovy:fovy aspect:aspect near:znear far:zfar in:aGLXWindowId |
294 | 8403 |
"define perspective projection" |
8404 |
||
8405 |
%{ /* NOCONTEXT */ |
|
8406 |
||
8407 |
Angle a_fovy; |
|
8408 |
Coord c_near, c_far; |
|
8409 |
float f_aspect; |
|
8410 |
||
8411 |
_ANGLE_ (fovy, a_fovy) |
|
8412 |
_FLOAT_ (aspect, f_aspect) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8413 |
_COORD_ (znear, c_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8414 |
_COORD_ (zfar, c_far) |
294 | 8415 |
|
8416 |
SETWIN(aGLXWindowId) |
|
1932 | 8417 |
#ifdef OPENGL |
8418 |
#else |
|
294 | 8419 |
perspective(a_fovy, f_aspect, c_near, c_far); |
1932 | 8420 |
#endif |
294 | 8421 |
%} |
8422 |
! |
|
8423 |
||
8424 |
glxPolarviewDist: dist azim: azim inc: inc twist: twist in: aGLXWindowId |
|
8425 |
||
8426 |
%{ /* NOCONTEXT */ |
|
8427 |
Coord c_dist; |
|
8428 |
Angle a_azim, a_inc, a_twist; |
|
8429 |
||
8430 |
_COORD_(dist, c_dist) |
|
8431 |
_ANGLE_(azim, a_azim) |
|
8432 |
_ANGLE_(inc, a_inc) |
|
8433 |
_ANGLE_(twist, a_twist) |
|
8434 |
SETWIN(aGLXWindowId) |
|
1932 | 8435 |
#ifdef OPENGL |
8436 |
#else |
|
294 | 8437 |
polarview(c_dist, a_azim, a_inc, a_twist); |
1932 | 8438 |
#endif |
294 | 8439 |
%} |
8440 |
! |
|
8441 |
||
528 | 8442 |
glxPopviewportIn: aGLXWindowId |
8443 |
"pops the top viewport off the viewport stack" |
|
8444 |
||
8445 |
%{ /* NOCONTEXT */ |
|
8446 |
SETWIN(aGLXWindowId) |
|
1932 | 8447 |
#ifdef OPENGL |
8448 |
#else |
|
528 | 8449 |
popviewport(); |
1932 | 8450 |
#endif |
528 | 8451 |
%} |
8452 |
||
8453 |
"Modified: 19.3.1996 / 18:58:24 / cg" |
|
8454 |
! |
|
8455 |
||
8456 |
glxPushviewportIn: aGLXWindowId |
|
8457 |
"pushes the current viewport on the viewport stack" |
|
8458 |
||
8459 |
%{ /* NOCONTEXT */ |
|
8460 |
SETWIN(aGLXWindowId) |
|
1932 | 8461 |
#ifdef OPENGL |
8462 |
#else |
|
528 | 8463 |
pushviewport(); |
1932 | 8464 |
#endif |
528 | 8465 |
%} |
8466 |
||
8467 |
"Modified: 19.3.1996 / 18:58:02 / cg" |
|
8468 |
! |
|
8469 |
||
294 | 8470 |
glxReshapeViewPortIn: aGLXWindowId |
8471 |
||
8472 |
%{ /* NOCONTEXT */ |
|
8473 |
SETWIN(aGLXWindowId) |
|
1932 | 8474 |
#ifdef OPENGL |
8475 |
#else |
|
294 | 8476 |
reshapeviewport(); |
1932 | 8477 |
#endif |
8478 |
%} |
|
294 | 8479 |
! |
8480 |
||
8481 |
glxViewportLeft:left right:right bottom:bottom top:top in:aGLXWindowId |
|
8482 |
||
8483 |
%{ /* NOCONTEXT */ |
|
8484 |
SETWIN(aGLXWindowId) |
|
1932 | 8485 |
#ifdef OPENGL |
8486 |
#else |
|
4718 | 8487 |
viewport(_screencoordVal(left), _screencoordVal(right), |
294 | 8488 |
_screencoordVal(bottom), _screencoordVal(top)); |
1932 | 8489 |
#endif |
294 | 8490 |
%} |
8491 |
! |
|
8492 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8493 |
glxWindowLeft: left right: right bottom: bottom top: top near: znear far: zfar in: aGLXWindowId |
294 | 8494 |
"this one was added independently by JEFF - kept for his programs ..." |
8495 |
||
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8496 |
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
|
8497 |
! |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8498 |
|
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8499 |
glxWindowLeft:left right:right top:top bottom:bottom near:znear far:zfar in:aGLXWindowId |
294 | 8500 |
"define perspective viewing pyramid" |
8501 |
||
8502 |
%{ /* NOCONTEXT */ |
|
8503 |
Coord c_left, c_right, c_top, c_bot, c_near, c_far; |
|
8504 |
||
8505 |
_COORD_ (left, c_left) |
|
8506 |
_COORD_ (right, c_right) |
|
8507 |
_COORD_ (top, c_top) |
|
8508 |
_COORD_ (bottom, c_bot) |
|
2422
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8509 |
_COORD_ (znear, c_near) |
6bffcb4c8360
changes for egcs (__new in stdio)
Claus Gittinger <cg@exept.de>
parents:
2075
diff
changeset
|
8510 |
_COORD_ (zfar, c_far) |
294 | 8511 |
SETWIN(aGLXWindowId) |
1932 | 8512 |
#ifdef OPENGL |
8513 |
#else |
|
294 | 8514 |
window(c_left, c_right, c_bot, c_top, c_near, c_far); |
1932 | 8515 |
#endif |
294 | 8516 |
%} |
8517 |
! ! |
|
8518 |
||
8519 |
!GLXWorkstation methodsFor:'window control'! |
|
8520 |
||
2045 | 8521 |
glxResizedView:aGLXWindowId width:width height:height |
2048 | 8522 |
"pass down resize info to the GL - this adjusts the viewport. |
8523 |
This only works with VGL or openGL" |
|
8524 |
||
8525 |
%{ /* NOCONTEXT */ |
|
2074 | 8526 |
SETWIN(aGLXWindowId) |
8527 |
#ifdef VGL |
|
2045 | 8528 |
X11_resized(__intVal(width), __intVal(height)); |
8529 |
RETURN (true); |
|
8530 |
#endif |
|
8531 |
%} |
|
8532 |
. |
|
8533 |
^ false |
|
8534 |
! |
|
8535 |
||
294 | 8536 |
glxWinclose:gwid in:aGLXWindowId |
8537 |
||
8538 |
%{ /* NOCONTEXT */ |
|
8539 |
#ifdef GLX |
|
8540 |
SETWIN(aGLXWindowId) |
|
8541 |
winclose(_longVal(gwid)); |
|
8542 |
RETURN (true); |
|
8543 |
#endif |
|
8544 |
%} |
|
8545 |
. |
|
8546 |
^ false |
|
8547 |
! |
|
8548 |
||
8549 |
glxWinconstraintsIn: aGLXWindowId |
|
8550 |
||
8551 |
%{ /* NOCONTEXT */ |
|
8552 |
#ifdef GLX |
|
8553 |
SETWIN(aGLXWindowId) |
|
8554 |
winconstraints(); |
|
8555 |
RETURN (true); |
|
8556 |
#endif |
|
8557 |
%} |
|
8558 |
. |
|
8559 |
^ false |
|
8560 |
! |
|
8561 |
||
8562 |
glxWindepth: gwid in: aGLXWindowId |
|
8563 |
||
8564 |
%{ /* NOCONTEXT */ |
|
8565 |
#ifdef GLX |
|
8566 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
8567 |
RETURN (__MKSMALLINT(windepth(_longVal(gwid)))); |
294 | 8568 |
#endif |
8569 |
%} |
|
8570 |
. |
|
8571 |
^ false |
|
8572 |
! |
|
8573 |
||
8574 |
glxWingetIn: aGLXWindowId |
|
8575 |
||
8576 |
%{ /* NOCONTEXT */ |
|
8577 |
#ifdef GLX |
|
8578 |
SETWIN(aGLXWindowId) |
|
315
2abc494f0c45
_-macros replaced by __-macros
Claus Gittinger <cg@exept.de>
parents:
294
diff
changeset
|
8579 |
RETURN (__MKSMALLINT(winget())); |
294 | 8580 |
#endif |
8581 |
%} |
|
8582 |
. |
|
8583 |
^ false |
|
8584 |
! |
|
8585 |
||
8586 |
glxWinmoveX: x y: y in: aGLXWindowId |
|
8587 |
||
8588 |
%{ /* NOCONTEXT */ |
|
8589 |
#ifdef GLX |
|
8590 |
SETWIN(aGLXWindowId) |
|
8591 |
winmove(_longVal(x), _longVal(y)); |
|
8592 |
RETURN (true); |
|
8593 |
#endif |
|
8594 |
%} |
|
8595 |
. |
|
8596 |
^ false |
|
8597 |
! |
|
8598 |
||
8599 |
glxWinpopIn: aGLXWindowId |
|
8600 |
||
8601 |
%{ /* NOCONTEXT */ |
|
8602 |
#ifdef GLX |
|
8603 |
SETWIN(aGLXWindowId) |
|
8604 |
winpop(); |
|
8605 |
RETURN (true); |
|
8606 |
#endif |
|
8607 |
%} |
|
8608 |
. |
|
8609 |
^ false |
|
8610 |
! |
|
8611 |
||
8612 |
glxWinpositionX1: x1 y1: y1 x2: x2 y2: y2 in: aGLXWindowId |
|
8613 |
||
8614 |
%{ /* NOCONTEXT */ |
|
8615 |
#ifdef GLX |
|
8616 |
SETWIN(aGLXWindowId) |
|
8617 |
winposition(_longVal(x1), _longVal(y1), _longVal(x2), _longVal(y2)); |
|
8618 |
RETURN (true); |
|
8619 |
#endif |
|
8620 |
%} |
|
8621 |
. |
|
8622 |
^ false |
|
8623 |
! |
|
8624 |
||
8625 |
glxWinpushIn: aGLXWindowId |
|
8626 |
||
8627 |
%{ /* NOCONTEXT */ |
|
8628 |
#ifdef GLX |
|
8629 |
SETWIN(aGLXWindowId) |
|
8630 |
winpush(); |
|
8631 |
RETURN (true); |
|
8632 |
#endif |
|
8633 |
%} |
|
8634 |
. |
|
8635 |
^ false |
|
8636 |
! |
|
8637 |
||
8638 |
glxWinset: gwid in: aGLXWindowId |
|
8639 |
||
8640 |
%{ /* NOCONTEXT */ |
|
8641 |
#ifdef GLX |
|
8642 |
SETWIN(aGLXWindowId) |
|
8643 |
winset(_longVal(gwid)); |
|
8644 |
RETURN (true); |
|
8645 |
#endif |
|
8646 |
%} |
|
8647 |
. |
|
8648 |
^ false |
|
8649 |
! ! |
|
8650 |
||
0 | 8651 |
!GLXWorkstation methodsFor:'window creation'! |
8652 |
||
12 | 8653 |
createGLXWindowFor:aView left:xpos top:ypos width:wwidth height:wheight type:glxType |
157 | 8654 |
|ext wsuperView wsuperViewId windowId| |
0 | 8655 |
|
212
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
8656 |
glOK ifFalse:[^ nil]. |
fc4c2afefff1
on IRIX5: no remote GL (to avoid exit in gl)
Claus Gittinger <cg@exept.de>
parents:
207
diff
changeset
|
8657 |
|
793 | 8658 |
wsuperView := aView superView view. |
0 | 8659 |
wsuperView notNil ifTrue:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8660 |
wsuperViewId := wsuperView id |
0 | 8661 |
]. |
8662 |
||
524 | 8663 |
%{ /* CALLSSTACK: 20000 */ |
0 | 8664 |
Display *dpy = myDpy; |
185 | 8665 |
int screen = __intVal(_INST(screen)); |
0 | 8666 |
Window newWindow, parentWindow; |
12 | 8667 |
int t; |
0 | 8668 |
|
97 | 8669 |
if (__isSmallInteger(xpos) && __isSmallInteger(ypos) |
8670 |
&& __isSmallInteger(wwidth) && __isSmallInteger(wheight)) { |
|
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8671 |
if (__isExternalAddress(wsuperViewId)) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8672 |
parentWindow = _WindowVal(wsuperViewId); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8673 |
} else { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8674 |
parentWindow = RootWindow(dpy, screen); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8675 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8676 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8677 |
if (glxType == @symbol(colorIndexSingleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8678 |
t = GLXcolorIndexSingleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8679 |
else if (glxType == @symbol(colorIndexDoubleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8680 |
t = GLXcolorIndexDoubleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8681 |
else if (glxType == @symbol(rgbSingleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8682 |
t = GLXrgbSingleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8683 |
else if (glxType == @symbol(rgbDoubleBuffer)) |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8684 |
t = GLXrgbDoubleBuffer; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8685 |
else { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8686 |
RETURN ( nil ); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8687 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8688 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8689 |
ENTERGLX; |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8690 |
newWindow = __GLXCreateWindow(dpy, parentWindow, |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8691 |
__intVal(xpos), __intVal(ypos), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8692 |
__intVal(wwidth), __intVal(wheight), |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8693 |
0, t); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8694 |
LEAVEGLX; |
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 |
if (! newWindow) { |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8697 |
RETURN ( nil ); |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8698 |
} |
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8699 |
|
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8700 |
windowId = __MKOBJ(newWindow); |
0 | 8701 |
} |
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
8702 |
%}. |
0 | 8703 |
windowId notNil ifTrue:[ |
962
9c2a114a2bc5
simply suppress those BadWindow-destroy messages (sigh)
Claus Gittinger <cg@exept.de>
parents:
913
diff
changeset
|
8704 |
self addKnownView:aView withId:windowId. |
0 | 8705 |
]. |
8706 |
^ windowId |
|
20 | 8707 |
! |
8708 |
||
8709 |
unlinkGLXView:aGLXWindowId |
|
8710 |
"remove X/GLX link" |
|
524 | 8711 |
|
8712 |
%{ /* CALLSSTACK: 20000 */ |
|
206
4284b80bebdf
changed to use ExternalAddress handles for all Window, Font,
Claus Gittinger <cg@exept.de>
parents:
190
diff
changeset
|
8713 |
if (__isExternalAddress(aGLXWindowId)) { |
134 | 8714 |
ENTERGLX; |
553
616145ac342d
first steps towards openGL support
Claus Gittinger <cg@exept.de>
parents:
543
diff
changeset
|
8715 |
__GLXUnlinkWindow(myDpy, _WindowVal(aGLXWindowId)); |
134 | 8716 |
LEAVEGLX; |
8717 |
} |
|
20 | 8718 |
%} |
0 | 8719 |
! ! |
8720 |
||
294 | 8721 |
!GLXWorkstation methodsFor:'zbuffer'! |
8722 |
||
8723 |
glxZbsize: planes in: aGLXWindowId |
|
127 | 8724 |
|
8725 |
%{ /* NOCONTEXT */ |
|
8726 |
#ifdef FULL_GLX |
|
8727 |
SETWIN(aGLXWindowId) |
|
294 | 8728 |
zbsize(_longVal(planes)); |
8729 |
RETURN (true); |
|
8730 |
#endif |
|
8731 |
%} |
|
8732 |
. |
|
8733 |
^ false |
|
8734 |
! |
|
64 | 8735 |
|
8736 |
glxZbuffer:aBoolean in:aGLXWindowId |
|
8737 |
"enable/disable z-buffer operation" |
|
8738 |
||
8739 |
%{ /* NOCONTEXT */ |
|
8740 |
#ifdef GLX |
|
8741 |
SETWIN(aGLXWindowId) |
|
8742 |
zbuffer(aBoolean == false ? FALSE : TRUE); |
|
8743 |
RETURN (true); |
|
8744 |
#endif |
|
8745 |
%} |
|
8746 |
. |
|
8747 |
^ false |
|
294 | 8748 |
! |
64 | 8749 |
|
8750 |
glxZdraw: b in: aGLXWindowId |
|
8751 |
"enable/disable drawing into the z-buffer" |
|
8752 |
||
8753 |
%{ /* NOCONTEXT */ |
|
8754 |
#ifdef GLX |
|
8755 |
SETWIN(aGLXWindowId) |
|
8756 |
zdraw(_booleanVal(b)); |
|
8757 |
RETURN (true); |
|
8758 |
#endif |
|
8759 |
%} |
|
8760 |
. |
|
8761 |
^ false |
|
294 | 8762 |
! |
64 | 8763 |
|
8764 |
glxZfunction: func in: aGLXWindowId |
|
8765 |
"set the z-buffer comparison function. |
|
8766 |
func may be either the numeric value or a symbol (preferred)" |
|
8767 |
||
8768 |
%{ /* NOCONTEXT */ |
|
8769 |
#ifdef GLX |
|
8770 |
long f; |
|
8771 |
||
8772 |
SETWIN(aGLXWindowId) |
|
8773 |
if (func == @symbol(NEVER)) |
|
77 | 8774 |
f = ZF_NEVER; |
64 | 8775 |
else if (func == @symbol(LESS)) |
77 | 8776 |
f = ZF_LESS; |
64 | 8777 |
else if (func == @symbol(EQUAL)) |
77 | 8778 |
f = ZF_EQUAL; |
64 | 8779 |
else if (func == @symbol(LEQUAL)) |
77 | 8780 |
f = ZF_LEQUAL; |
64 | 8781 |
else if (func == @symbol(GREATER)) |
77 | 8782 |
f = ZF_GREATER; |
64 | 8783 |
else if (func == @symbol(NOTEQUAL)) |
77 | 8784 |
f = ZF_NOTEQUAL; |
64 | 8785 |
else if (func == @symbol(GEQUAL)) |
77 | 8786 |
f = ZF_GEQUAL; |
64 | 8787 |
else if (func == @symbol(ALWAYS)) |
77 | 8788 |
f = ZF_ALWAYS; |
64 | 8789 |
else |
77 | 8790 |
f = _longVal(func); |
64 | 8791 |
zfunction(f); |
8792 |
RETURN (true); |
|
8793 |
#endif |
|
8794 |
%} |
|
8795 |
. |
|
8796 |
^ false |
|
294 | 8797 |
! |
64 | 8798 |
|
8799 |
glxZsource: src in: aGLXWindowId |
|
8800 |
||
8801 |
%{ /* NOCONTEXT */ |
|
8802 |
#ifdef GLX |
|
8803 |
SETWIN(aGLXWindowId) |
|
8804 |
zsource(_longVal(src)); |
|
8805 |
RETURN (true); |
|
8806 |
#endif |
|
8807 |
%} |
|
8808 |
. |
|
8809 |
^ false |
|
294 | 8810 |
! |
64 | 8811 |
|
8812 |
glxZwritemask: mask in: aGLXWindowId |
|
8813 |
||
8814 |
%{ /* NOCONTEXT */ |
|
8815 |
#ifdef GLX |
|
8816 |
SETWIN(aGLXWindowId) |
|
185 | 8817 |
zwritemask((ulong)__intVal(mask)); |
64 | 8818 |
RETURN (true); |
8819 |
#endif |
|
8820 |
%} |
|
8821 |
. |
|
8822 |
^ false |
|
8823 |
! ! |
|
8824 |
||
294 | 8825 |
!GLXWorkstation class methodsFor:'documentation'! |
8826 |
||
8827 |
version |
|
6978 | 8828 |
^ '$Header$' |
5479
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
8829 |
! |
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
8830 |
|
ae6b3ac21920
__isByteArray() to __isByteArrayLike() in primitive code
Stefan Vogel <sv@exept.de>
parents:
4718
diff
changeset
|
8831 |
version_CVS |
6978 | 8832 |
^ '$Header$' |
89 | 8833 |
! ! |