-
Notifications
You must be signed in to change notification settings - Fork 0
/
pogl_const.xs
83 lines (63 loc) · 1.56 KB
/
pogl_const.xs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/* Last saved: Fri 16 Oct 2009 10:25:51 AM */
/* Copyright (c) 1998 Kenneth Albanowski. All rights reserved.
* Copyright (c) 2007 Bob Free. All rights reserved.
* Copyright (c) 2009 Chris Marshall. All rights reserved.
* This program is free software; you can redistribute it and/or
* modify it under the same terms as Perl itself.
*/
/* All OpenGL constants---should split */
#define IN_POGL_CONST_XS
/* This ends up being OpenGL.pm */
/* #define IN_POGL_MAIN_XS */
#include <stdio.h>
#include "pgopogl.h"
#ifdef HAVE_GL
#include "gl_util.h"
#endif
#ifdef HAVE_GLX
#include "glx_util.h"
#endif
#ifdef HAVE_GLU
#include "glu_util.h"
#endif
#if defined(HAVE_GLUT) || defined(HAVE_FREEGLUT)
#ifndef GLUT_API_VERSION
#define GLUT_API_VERSION 4
#endif
#include "glut_util.h"
#endif
#ifdef IN_POGL_CONST_XS
/* These macros used in neoconstant */
#define i(test) if (strEQ(name, #test)) return newSViv((int)test);
#define f(test) if (strEQ(name, #test)) return newSVnv((double)test);
#define p(test) if (strEQ(name, #test)) return newSViv(PTR2IV(test));
static SV *
neoconstant(char * name, int arg)
{
#include "gl_const.h"
#include "glu_const.h"
#include "glut_const.h"
#include "glx_const.h"
#include "glpm_const.h"
;
return 0;
}
#undef i
#undef f
#endif /* defined IN_POGL_CONST_XS */
MODULE = OpenGL::Const PACKAGE = OpenGL
#ifdef IN_POGL_CONST_XS
#// Define a POGL Constant
SV *
constant(name,arg)
char * name
int arg
CODE:
{
RETVAL = neoconstant(name, arg);
if (!RETVAL)
RETVAL = newSVsv(&PL_sv_undef);
}
OUTPUT:
RETVAL
#endif /* End IN_POGL_CONST_XS */