4
4
* modify it under the same terms as Perl itself.
5
5
*/
6
6
7
+ /* OpenGL::Array */
8
+ #define IN_POGL_ARRAY_XS
9
+
10
+ /* All OpenGL constants---should split */
11
+ #define IN_POGL_CONST_XS
12
+
13
+ /* OpenGL OpenGL bindings */
14
+ #define IN_POGL_GL_XS
15
+
16
+ /* OpenGL *GLUT bindings */
17
+ #define IN_POGL_GLUT_XS
18
+
19
+ /* OpenGL GLU bindings */
20
+ #define IN_POGL_GLU_XS
21
+
22
+ /* OpenGL GLX bindings */
23
+ #define IN_POGL_GLX_XS
24
+
25
+ /* This ends up being OpenGL.pm */
26
+ #define IN_POGL_MAIN_XS
27
+
28
+ /* OpenGL RPN code */
29
+ #define IN_POGL_RPN_XS
30
+
7
31
#include <stdio.h>
32
+
8
33
#include "pgopogl.h"
9
- #include "ppport.h"
10
34
35
+ #ifdef IN_POGL_MAIN_XS
11
36
= head2 Miscellaneous
12
37
13
- Various useful utilities defined in PGOpogl .xs .
38
+ Various BOOT utilities defined in pogl_main .xs .
14
39
15
40
= over
16
41
@@ -43,19 +68,27 @@ _pgopogl_call_XS (pTHX_ void (*subaddr) (pTHX_ CV *), CV * cv, SV ** mark)
43
68
(* subaddr ) (aTHX_ cv );
44
69
PUTBACK ; /* forget return values */
45
70
}
71
+ #endif /* End IN_POGL_MAIN_XS */
46
72
73
+ #ifdef IN_POGL_GL_XS
47
74
#ifdef HAVE_GL
48
75
#include "gl_util.h"
49
76
#endif
77
+ #endif /* End IN_POGL_GL_XS */
50
78
79
+ #ifdef IN_POGL_GLX_XS
51
80
#ifdef HAVE_GLX
52
81
#include "glx_util.h"
53
82
#endif
83
+ #endif /* End IN_POGL_GLX_XS */
54
84
85
+ #ifdef IN_POGL_GLU_XS
55
86
#ifdef HAVE_GLU
56
87
#include "glu_util.h"
57
88
#endif
89
+ #endif /* End IN_POGL_GLU_XS */
58
90
91
+ #ifdef IN_POGL_GLUT_XS
59
92
#if defined(HAVE_GLUT ) || defined(HAVE_FREEGLUT )
60
93
#ifndef GLUT_API_VERSION
61
94
#define GLUT_API_VERSION 4
@@ -64,34 +97,40 @@ _pgopogl_call_XS (pTHX_ void (*subaddr) (pTHX_ CV *), CV * cv, SV ** mark)
64
97
#endif
65
98
66
99
static int _done_glutInit = 0 ;
100
+ #endif /* End IN_POGL_GLUT_XS */
67
101
102
+ #ifdef IN_POGL_RPN_XS
68
103
#ifndef M_PI
69
104
#ifdef PI
70
105
#define M_PI PI
71
106
#else
72
107
#define M_PI 3.1415926535897932384626433832795
73
108
#endif
74
109
#endif
110
+ #endif /* End IN_POGL_RPN_XS */
75
111
112
+ #ifdef IN_POGL_GL_XS
76
113
GLint FBO_MAX = -1 ;
114
+ #endif /* End IN_POGL_GL_XS */
77
115
78
- static char * SWIZZLE [4 ] = {"x" ,"y" ,"z" ,"w" };
116
+ /* This does not seem to be used */
117
+ #if 0
118
+ static char * SWIZZLE [4 ] = {"x" ,"y" ,"z" ,"w" }; * /
119
+ #endif
79
120
121
+ /* This does not seem to be used */
122
+ #if 0
80
123
static int
81
124
not_here (s )
82
125
char * s ;
83
126
{
84
127
croak ("%s not implemented on this architecture" , s );
85
128
return -1 ;
86
129
}
130
+ #endif
87
131
88
132
89
- /* GLUT on OS/2 PM runs callbacks from a secondary thread. This thread
90
- is not instrumented to run EMX CRTL functions. Basically, no Perl
91
- function may be run from this thread.
92
- We create a ternary thread via CRTL _beginthread() call, and communicate
93
- the requests to this thread via inter-thread communication (ITC). */
94
-
133
+ #ifdef IN_POGL_GLUT_XS
95
134
#ifndef __PM__
96
135
# define DO_perl_call_sv (handler , flag ) perl_call_sv(handler, flag)
97
136
# define ENSURE_callback_thread
@@ -101,6 +140,11 @@ char *s;
101
140
# define GLUT_EXTEND_STACK (sp ,n )
102
141
# define GLUT_PUSHMARK (sp ) PUSHMARK(sp)
103
142
#else
143
+ /* GLUT on OS/2 PM runs callbacks from a secondary thread. This thread
144
+ is not instrumented to run EMX CRTL functions. Basically, no Perl
145
+ function may be run from this thread.
146
+ We create a ternary thread via CRTL _beginthread() call, and communicate
147
+ the requests to this thread via inter-thread communication (ITC). */
104
148
105
149
# define GLUT_PUSHMARK (sp )
106
150
@@ -248,15 +292,14 @@ start_callback_thread()
248
292
croak ("Error creating callback thread" );
249
293
}
250
294
}
251
-
252
295
#endif /* __PM__ */
296
+ #endif /* End IN_POGL_GLUT_XS */
253
297
298
+ #ifdef IN_POGL_CONST_XS
299
+ /* These macros used in neoconstant */
254
300
#define i (test ) if (strEQ(name, #test)) return newSViv((int)test);
255
301
#define f (test ) if (strEQ(name, #test)) return newSVnv((double)test);
256
302
257
- #ifdef __PM__
258
- #endif
259
-
260
303
static SV *
261
304
neoconstant (char * name , int arg )
262
305
{
@@ -271,6 +314,7 @@ neoconstant(char * name, int arg)
271
314
272
315
#undef i
273
316
#undef f
317
+ #endif /* End IN_POGL_CONST_XS */
274
318
275
319
/* Note: this is caching procs once for all contexts */
276
320
/* !!! This should instead cache per context */
0 commit comments