Acme-MITHALDU-BleedingOpenGL

 view release on metacpan or  search on metacpan

pogl_const.xs  view on Meta::CPAN



#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"
	;
	return 0;
}

#undef i
#undef f

#endif /* defined IN_POGL_CONST_XS */


MODULE = Acme::MITHALDU::BleedingOpenGL::Const		PACKAGE = Acme::MITHALDU::BleedingOpenGL

#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 */



( run in 1.341 second using v1.01-cache-2.11-cpan-437f7b0c052 )