view release on metacpan or search on metacpan
FreeGLUT/freeglut-Readme.txt view on Meta::CPAN
freeglut include folder appears above all other GLUT include folders.
Now open up the general section under Linker, and configure the lib\
folder you created above as an Additional Library Directory. A freeglut
application depends on the import libraries freeglut.lib and opengl32.lib,
which can be configured under the Input section. However, it shouldnt be
necessary to explicitly state these dependencies, since the freeglut headers
handle this for you. Now open the Advanced section, and enter mainCRTStartup
as the Entry Point for your application. This is necessary because GLUT
applications use main as the application entry point, not WinMainwithout it
youll get an undefined reference when you try to link your application.
Thats all of your project properties configured, so you can now add source
files to your project and build the application. If you want your application to
be compatible with GLUT, you should #include <GL/glut.h>. If you want to use
freeglut specific extensions, you should #include <GL/freeglut.h> instead.
Dont forget to either include the freeglut DLL when distributing applications,
or provide your users with some method of obtaining it if they dont already
have it!
Release_Notes view on Meta::CPAN
* Added OpenGL::Matrix subclass of OpenGL::Array
* Unified the following extensions into mainline GL functions:
GL_EXT_vertex_array
GL_ARB_vertex_buffer_object
GL_EXT_framebuffer_object
GL_ARB_multitexture
* Fixed sf.net #21 "delete functions removed from Mesa 10.6"
* Fixed sf.net #22 "Perl::OpenGL make test fails (undefined
symbol: glWindowPos4iMESA)". NOTE: This is a duplicate
report of the problem in bug #21 but it motivated this
release. Thanks for the report, Richard.
* Fixed sf.net #20 "Prefer system GL/#gl.h on non-Win32"
+------------------------------------------------------------------------+
| OpenGL-0.6704
(*(unsigned char**)ptr)++;
(*(GLubyte*)*ptr) = (GLubyte)((v >> 8) & 0xff);
(*(unsigned char**)ptr)++;
(*(GLubyte*)*ptr) = (GLubyte)((v >> 0) & 0xff);
(*ptr)++;
break;
}
default:
croak("Unable to set data with unknown type");
}
#undef RIV
#undef RNV
}
SV * pgl_get_type(GLenum type, void ** ptr)
{
SV * result = 0;
#define RIV(t) \
result = newSViv((*(t*)*ptr)); \
*(unsigned char**)ptr += sizeof(t); \
break;
#define RNV(t) \
(*(unsigned char**)ptr)++;
v |= (*(GLubyte*)*ptr) << 0;
(*(unsigned char**)ptr)++;
result = newSViv(v);
break;
}
default:
croak("Unable to get data with unknown type");
}
return result;
#undef RIV
#undef RNV
}
GLvoid * pack_image_ST(SV ** stack, int count, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, int mode)
{
int i;
void * ptr, * optr;
GLsizei size, max;
gl_pixelbuffer_size2(width, height, depth, format, type, mode, &size, &max);
optr = ptr = malloc(size);
GLsizei size, max;
gl_pixelbuffer_size2(width, height, depth, format, type, mode, &size, &max);
EXTEND(sp, max);
for (i=0;i<max;i++) {
PUSHs(sv_2mortal(pgl_get_type(type, &data)));
}
return sp;
#undef sp
}
glut_util.h view on Meta::CPAN
#if defined(IS_STRAWBERRY)
#undef exit
#include <GL/freeglut.h>
#elif defined(HAVE_FREEGLUT) && (defined(_WIN32) || defined(HAVE_W32API))
#define GLUT_DISABLE_ATEXIT_HACK
#include "./include/GL/freeglut.h"
#elif defined(HAVE_FREEGLUT_H)
pogl_const.xs view on Meta::CPAN
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 */
pogl_gl_GetP_Pass.xs view on Meta::CPAN
#//# $string = glGetString($name);
SV *
glGetString(name)
GLenum name
CODE:
{
char * c = (char*)glGetString(name);
if (c)
RETVAL = newSVpv(c, 0);
else
RETVAL = newSVsv(&PL_sv_undef);
}
OUTPUT:
RETVAL
#// 1.0
#//# glGetTexEnvfv_c($target, $pname, (CPTR)params);
void
glGetTexEnvfv_c(target, pname, params)
GLenum target
GLenum pname
pogl_gl_Mult_Prog.xs view on Meta::CPAN
glGetObjectParameterivARB(obj,GL_OBJECT_INFO_LOG_LENGTH_ARB,(GLvoid *)&maxLength);
if (maxLength)
{
GLint length;
GLcharARB * infoLog = malloc(maxLength+1);
glGetInfoLogARB(obj,maxLength,&length,infoLog);
infoLog[length] = 0;
if (*infoLog)
RETVAL = newSVpv(infoLog, 0);
else
RETVAL = newSVsv(&PL_sv_undef);
free(infoLog);
}
else
{
RETVAL = newSVsv(&PL_sv_undef);
}
}
OUTPUT:
RETVAL
#//# glGetAttachedObjectsARB_c($containerObj, $maxCount, (CPTR)count, (CPTR)obj);
void
glGetAttachedObjectsARB_c(containerObj, maxCount, count, obj)
GLhandleARB containerObj
GLsizei maxCount
pogl_gl_Mult_Prog.xs view on Meta::CPAN
if (*name)
{
EXTEND(sp,3);
PUSHs(sv_2mortal(newSVpv(name,0)));
PUSHs(sv_2mortal(newSViv(type)));
PUSHs(sv_2mortal(newSViv(size)));
}
else
{
EXTEND(sp,1);
PUSHs(sv_2mortal(newSVsv(&PL_sv_undef)));
}
free(name);
}
else
{
EXTEND(sp,1);
PUSHs(sv_2mortal(newSVsv(&PL_sv_undef)));
}
}
#//# glGetUniformfvARB_c($programObj, $location, (CPTR)params);
void
glGetUniformfvARB_c(programObj, location, params)
GLhandleARB programObj
GLint location
void *params
INIT:
pogl_gl_Mult_Prog.xs view on Meta::CPAN
source = malloc(maxLength+1);
glGetShaderSourceARB(obj,maxLength,&length,source);
source[length] = 0;
if (*source)
{
PUSHs(sv_2mortal(newSVpv(source,0)));
}
else
{
PUSHs(sv_2mortal(newSVsv(&PL_sv_undef)));
}
free(source);
}
else
{
PUSHs(sv_2mortal(newSVsv(&PL_sv_undef)));
}
}
#endif // GL_ARB_shader_objects
#ifdef GL_ARB_vertex_program
#//# glProgramStringARB_c($target,$format,$len,(CPTR)string);
void
pogl_gl_Prog_Clam.xs view on Meta::CPAN
GLint len;
glGetProgramivARB(target,GL_PROGRAM_LENGTH_ARB,(GLvoid *)&len);
if (len)
{
char * string = malloc(len+1);
glGetProgramStringARB(target,pname,(GLubyte*)string);
string[len] = 0;
if (*string)
RETVAL = newSVpv(string, 0);
else
RETVAL = newSVsv(&PL_sv_undef);
free(string);
}
else
{
RETVAL = newSVsv(&PL_sv_undef);
}
}
OUTPUT:
RETVAL
#//# glIsProgramARB(program);
GLboolean
glIsProgramARB(program)
GLuint program
INIT:
pogl_gl_Prog_Clam.xs view on Meta::CPAN
if (*name)
{
EXTEND(sp,3);
PUSHs(sv_2mortal(newSVpv(name,0)));
PUSHs(sv_2mortal(newSViv(type)));
PUSHs(sv_2mortal(newSViv(size)));
}
else
{
EXTEND(sp,1);
PUSHs(sv_2mortal(newSVsv(&PL_sv_undef)));
}
free(name);
}
else
{
EXTEND(sp,1);
PUSHs(sv_2mortal(newSVsv(&PL_sv_undef)));
}
}
#//# glGetAttribLocationARB_c($programObj, (CPTR)name);
GLint
glGetAttribLocationARB_c(programObj, name)
GLhandleARB programObj
void *name
INIT:
loadProc(glGetAttribLocationARB,"glGetAttribLocationARB");
pogl_gl_gltut.xs view on Meta::CPAN
glGetShaderiv(shader,GL_INFO_LOG_LENGTH,(GLvoid *)&infoLogLength);
if (infoLogLength)
{
GLint length;
GLchar * infoLog = malloc(infoLogLength+1);
glGetShaderInfoLog(shader,infoLogLength,&length,infoLog);
infoLog[length] = 0;
if (*infoLog)
RETVAL = newSVpv(infoLog, 0);
else
RETVAL = newSVsv(&PL_sv_undef);
free(infoLog);
}
else
{
RETVAL = newSVsv(&PL_sv_undef);
}
}
OUTPUT:
RETVAL
#//# $value = glGetProgramiv_p($target,$pname);
GLuint
glGetProgramiv_p(target,pname)
GLenum target
GLenum pname
pogl_glu.xs view on Meta::CPAN
if (!handler) croak("Missing tess callback for combine_data");
if (t->use_vertex_data) {
PGLUtess * opaque = malloc(sizeof(PGLUtess));
if (!opaque) croak("Couldn't allocate storage for vertex opaque data");
opaque->triangulator = t->triangulator;
opaque->vertex_datas = t->vertex_datas;
opaque->vertex_callback = t->vertex_callback;
opaque->combine_callback = t->combine_callback;
opaque->vertex_data = vertex;
opaque->polygon_data = &PL_sv_undef;
opaque->use_vertex_data = TRUE;
opaque->do_colors = t->do_colors;
opaque->do_normals = t->do_normals;
if (! t->tess_datas) t->tess_datas = newAV();
av_push(t->tess_datas, newSViv(PTR2IV(opaque)));
*out_data = opaque;
for (i = 0; i < 4; i++) {
PGLUtess* ot = (PGLUtess*)vertex_data[i];
vd[i] = (GLdouble*)ot->vertex_data;
}
pogl_glu.xs view on Meta::CPAN
for ( ; j < J; j++)
av_push(vec, sv_2mortal(newSVnv(weight[i] ? vd[i][j] : 0)));
}
if (t->do_normals) {
int J = j + 3;
for ( ; j < J; j++)
av_push(vec, sv_2mortal(newSVnv(weight[i] ? vd[i][j] : 0)));
}
if (t->use_vertex_data) {
PGLUtess* ot = (PGLUtess*)vertex_data[i];
av_push(vec, ot->polygon_data ? ot->polygon_data : &PL_sv_undef);
}
}
for (i = 0; i < 4; i++)
XPUSHs(sv_2mortal(newSVnv(weight[i])));
XPUSHs(t->polygon_data ? t->polygon_data : &PL_sv_undef); /* would be nice to have the option to only do this on COMBINE_DATA */
PUTBACK;
n = perl_call_sv(handler, G_ARRAY);
SPAGAIN;
if (t->do_colors) {
if (t->do_normals) {
if (n == 11 && t->use_vertex_data) has_data = TRUE;
pogl_glut.xs view on Meta::CPAN
SV ** h;
if (!glut_handlers)
return;
h = av_fetch(glut_handlers, win, FALSE);
if (!h || !SvOK(*h) || !SvROK(*h))
return;
av_store(glut_handlers, win, newSVsv(&PL_sv_undef));
}
/* Release a handler */
static void destroy_glut_win_handler(int win, int type)
{
SV ** h;
AV * a;
if (!glut_handlers)
glut_handlers = newAV();
h = av_fetch(glut_handlers, win, FALSE);
if (!h || !SvOK(*h) || !SvROK(*h))
return;
a = (AV*)SvRV(*h);
av_store(a, type, newSVsv(&PL_sv_undef));
}
/* Begin window callback definition */
#define begin_decl_gwh(type, params, nparam) \
\
static void generic_glut_ ## type ## _handler params \
{ \
int win = glutGetWindow(); \
AV * handler_data = (AV*)get_glut_win_handler(win, HANDLE_GLUT_ ## type);\
SV * handler; \
pogl_glut.xs view on Meta::CPAN
int
glutGetMenu()
#//# glutDestroyMenu($menu);
void
glutDestroyMenu(menu)
int menu
CODE:
{
glutDestroyMenu(menu);
av_store(glut_menu_handlers, menu, newSVsv(&PL_sv_undef));
}
#//# glutAddMenuEntry($name, $value);
void
glutAddMenuEntry(name, value)
char * name
int value
#//# glutAddSubMenu($name, $menu);
void
pogl_rpn.xs view on Meta::CPAN
rpn_context * ctx;
oga_struct ** oga_list;
int oga_count = 0;
int ops_count,i;
char ** ops;
/* Determine number of OGAs passed in */
for (i=0; i<items; i++)
{
SV * sv = ST(i);
if (sv == &PL_sv_undef ||
!sv_derived_from(sv,"OpenGL::Array")) break;
oga_count++;
}
/* Grab OGA data buffers */
if (!oga_count) croak("Missing OGA parameters");
ops_count = items - oga_count;
oga_list = malloc(sizeof(oga_struct *) * oga_count);
if (!oga_list) croak("Unable to alloc oga_list");
pogl_rpn.xs view on Meta::CPAN
oga_list[i] = INT2PTR(OpenGL__Array,ref);
}
ops = malloc(sizeof(char *) * ops_count);
if (!ops) croak("Unable to alloc ops");
/* Parse parameters */
for (i=0;i<ops_count;i++)
{
SV * sv = ST(i+oga_count);
char * op = (sv != &PL_sv_undef) ?
(char *)SvPV(sv,PL_na) : "";
ops[i] = op;
}
/* Instantiate RPN context */
ctx = rpn_init(oga_count,oga_list,ops_count,ops);
rpn_exec(ctx);
rpn_term(ctx);
/* Delete lists */
pogl_rpn.xs view on Meta::CPAN
{
GLfloat * data = (GLfloat *)oga->data;
GLfloat * mat = NULL;
int len = oga->item_count;
int fbo_width = 0;
int i,j,count,dim,cols;
SV * sv = ST(1);
int free_mat = 0;
/* Get transform matrix OGA */
if (sv != &PL_sv_undef && sv_derived_from(sv,"OpenGL::Array"))
{
IV ref = SvIV((SV*)SvRV(sv));
oga_struct *oga_mat = INT2PTR(OpenGL__Array,ref);
count = oga_mat->item_count;
for (i=0;i<oga_mat->type_count;i++)
{
if (oga_mat->types[i] != GL_FLOAT)
croak("Unsupported datatype in affine matrix");
}
PL_rsfp_filters|5.014000||p
PL_rsfp|5.014000||p
PL_rs|||n
PL_signals|5.008001||p
PL_stack_base|5.004050||p
PL_stack_sp|5.004050||p
PL_statcache|5.005000||p
PL_stdingv|5.004050||p
PL_sv_arenaroot|5.004050||p
PL_sv_no|5.004050||pn
PL_sv_undef|5.004050||pn
PL_sv_yes|5.004050||pn
PL_tainted|5.004050||p
PL_tainting|5.004050||p
PL_tokenbuf|5.014000||p
POP_MULTICALL||5.014000|
POPi|||n
POPl|||n
POPn|||n
POPpbytex||5.007001|n
POPpx||5.005030|n
av_fetch|||
av_fill|||
av_iter_p||5.011000|
av_len|||
av_make|||
av_pop|||
av_push|||
av_reify|||
av_shift|||
av_store|||
av_undef|||
av_unshift|||
ax|||n
bad_type|||
bind_match|||
block_end|||
block_gimme||5.004000|
block_start|||
blockhook_register||5.013003|
boolSV|5.004000||p
boot_core_PerlIO|||
custom_op_desc||5.007003|
custom_op_name||5.007003|
custom_op_register||5.013007|
custom_op_xop||5.013007|
cv_ckproto_len|||
cv_clone|||
cv_const_sv||5.004000|
cv_dump|||
cv_get_call_checker||5.013006|
cv_set_call_checker||5.013006|
cv_undef|||
cvgv_set|||
cvstash_set|||
cx_dump||5.005000|
cx_dup|||
cxinc|||
dAXMARK|5.009003||p
dAX|5.007002||p
dITEMS|5.007002||p
dMARK|||
dMULTICALL||5.009003|
filter_del|||
filter_gets|||
filter_read|||
find_and_forget_pmops|||
find_array_subscript|||
find_beginning|||
find_byclass|||
find_hash_subscript|||
find_in_my_stash|||
find_runcv||5.008001|
find_rundefsvoffset||5.009002|
find_rundefsv||5.013002|
find_script|||
find_uninit_var|||
first_symbol|||n
foldEQ_latin1||5.013008|n
foldEQ_locale||5.013002|n
foldEQ_utf8_flags||5.013010|
foldEQ_utf8||5.013002|
foldEQ||5.013002|n
fold_constants|||
forbid_setid|||
hv_placeholders_get||5.009003|
hv_placeholders_p||5.009003|
hv_placeholders_set||5.009003|
hv_riter_p||5.009003|
hv_riter_set||5.009003|
hv_scalar||5.009001|
hv_store_ent||5.004000|
hv_store_flags||5.008000|
hv_stores|5.009004||p
hv_store|||
hv_undef_flags|||
hv_undef|||
ibcmp_locale||5.004000|
ibcmp_utf8||5.007003|
ibcmp|||
incline|||
incpush_if_exists|||
incpush_use_sep|||
incpush|||
ingroup|||
init_argv_symbols|||
init_dbargs|||
while (<DATA>) {
if ($hint) {
my $h = $hint->[0] eq 'Hint' ? \%hints : \%warnings;
if (m{^\s*\*\s(.*?)\s*$}) {
for (@{$hint->[1]}) {
$h->{$_} ||= ''; # suppress warning with older perls
$h->{$_} .= "$1\n";
}
}
else { undef $hint }
}
$hint = [$1, [split /,?\s+/, $2]]
if m{^\s*$rccs\s+(Hint|Warning):\s+(\w+(?:,?\s+\w+)*)\s*$};
if ($define) {
if ($define->[1] =~ /\\$/) {
$define->[1] .= $_;
}
else {
if (exists $API{$define->[0]} && $define->[1] !~ /^DPPP_\(/) {
my @n = find_api($define->[1]);
push @{$depends{$define->[0]}}, @n if @n
}
undef $define;
}
}
$define = [$1, $2] if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(.*)};
if ($function) {
if (/^}/) {
if (exists $API{$function->[0]}) {
my @n = find_api($function->[1]);
push @{$depends{$function->[0]}}, @n if @n
}
undef $function;
}
else {
$function->[1] .= $_;
}
}
$function = [$1, ''] if m{^DPPP_\(my_(\w+)\)};
$replace = $1 if m{^\s*$rccs\s+Replace:\s+(\d+)\s+$rcce\s*$};
$replace{$2} = $1 if $replace and m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+)};
unlink $tmp;
return $diff;
}
unlink $tmp;
}
else {
error("Cannot open '$tmp' for writing: $!");
}
return undef;
}
sub rec_depend
{
my($func, $seen) = @_;
return () unless exists $depends{$func};
$seen = {%{$seen||{}}};
return () if $seen->{$func}++;
my %s;
grep !$s{$_}++, map { ($_, rec_depend($_, $seen)) } @{$depends{$func}};
#endif
#ifndef PTR2UV
# define PTR2UV(p) INT2PTR(UV,p)
#endif
#ifndef PTR2NV
# define PTR2NV(p) NUM2PTR(NV,p)
#endif
#undef START_EXTERN_C
#undef END_EXTERN_C
#undef EXTERN_C
#ifdef __cplusplus
# define START_EXTERN_C extern "C" {
# define END_EXTERN_C }
# define EXTERN_C extern "C"
#else
# define START_EXTERN_C
# define END_EXTERN_C
# define EXTERN_C extern
#endif
# define PERL_GCC_BRACE_GROUPS_FORBIDDEN
# endif
#endif
#if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__cplusplus)
# ifndef PERL_USE_GCC_BRACE_GROUPS
# define PERL_USE_GCC_BRACE_GROUPS
# endif
#endif
#undef STMT_START
#undef STMT_END
#ifdef PERL_USE_GCC_BRACE_GROUPS
# define STMT_START (void)( /* gcc supports ``({ STATEMENTS; })'' */
# define STMT_END )
#else
# if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__)
# define STMT_START if (1)
# define STMT_END else (void)0
# else
# define STMT_START do
# define STMT_END while (0)
#endif
#ifndef dAXMARK
# define dAXMARK I32 ax = POPMARK; \
register SV ** const mark = PL_stack_base + ax++
#endif
#ifndef XSprePUSH
# define XSprePUSH (sp = PL_stack_base + ax - 1)
#endif
#if (PERL_BCDVERSION < 0x5005000)
# undef XSRETURN
# define XSRETURN(off) \
STMT_START { \
PL_stack_sp = PL_stack_base + ax + ((off) - 1); \
return; \
} STMT_END
#endif
#ifndef XSPROTO
# define XSPROTO(name) void name(pTHX_ CV* cv)
#endif
# define isXDIGIT(c) isxdigit(c)
#endif
#else
# if (PERL_BCDVERSION < 0x5010000)
/* Hint: isPRINT
* The implementation in older perl versions includes all of the
* isSPACE() characters, which is wrong. The version provided by
* Devel::PPPort always overrides a present buggy version.
*/
# undef isPRINT
# endif
#ifndef isALNUMC
# define isALNUMC(c) (isALPHA(c) || isDIGIT(c))
#endif
#ifndef isASCII
# define isASCII(c) ((U8) (c) <= 127)
#endif
#ifndef isCNTRL
# define PL_perl_destruct_level perl_destruct_level
# define PL_perldb perldb
# define PL_rsfp_filters rsfp_filters
# define PL_rsfp rsfp
# define PL_stack_base stack_base
# define PL_stack_sp stack_sp
# define PL_statcache statcache
# define PL_stdingv stdingv
# define PL_sv_arenaroot sv_arenaroot
# define PL_sv_no sv_no
# define PL_sv_undef sv_undef
# define PL_sv_yes sv_yes
# define PL_tainted tainted
# define PL_tainting tainting
# define PL_tokenbuf tokenbuf
/* Replace: 0 */
#endif
/* Warning: PL_parser
* For perl versions earlier than 5.9.5, this is an always
* non-NULL dummy. Also, it cannot be dereferenced. Don't
# define PERL_LOADMOD_NOIMPORT 0x2
#endif
#ifndef PERL_LOADMOD_IMPORT_OPS
# define PERL_LOADMOD_IMPORT_OPS 0x4
#endif
#ifndef G_METHOD
# define G_METHOD 64
# ifdef call_sv
# undef call_sv
# endif
# if (PERL_BCDVERSION < 0x5006000)
# define call_sv(sv, flags) ((flags) & G_METHOD ? perl_call_method((char *) SvPV_nolen_const(sv), \
(flags) & ~G_METHOD) : perl_call_sv(sv, flags))
# else
# define call_sv(sv, flags) ((flags) & G_METHOD ? Perl_call_method(aTHX_ (char *) SvPV_nolen_const(sv), \
(flags) & ~G_METHOD) : Perl_call_sv(aTHX_ sv, flags))
# endif
#endif
#ifndef eval_pv
#if defined(NEED_eval_pv)
static SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
static
#else
extern SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
#endif
#ifdef eval_pv
# undef eval_pv
#endif
#define eval_pv(a,b) DPPP_(my_eval_pv)(aTHX_ a,b)
#define Perl_eval_pv DPPP_(my_eval_pv)
#if defined(NEED_eval_pv) || defined(NEED_eval_pv_GLOBAL)
SV*
DPPP_(my_eval_pv)(char *p, I32 croak_on_error)
{
dSP;
#ifndef vload_module
#if defined(NEED_vload_module)
static void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
static
#else
extern void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args);
#endif
#ifdef vload_module
# undef vload_module
#endif
#define vload_module(a,b,c,d) DPPP_(my_vload_module)(aTHX_ a,b,c,d)
#define Perl_vload_module DPPP_(my_vload_module)
#if defined(NEED_vload_module) || defined(NEED_vload_module_GLOBAL)
void
DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args)
{
dTHR;
#ifndef load_module
#if defined(NEED_load_module)
static void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
static
#else
extern void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...);
#endif
#ifdef load_module
# undef load_module
#endif
#define load_module DPPP_(my_load_module)
#define Perl_load_module DPPP_(my_load_module)
#if defined(NEED_load_module) || defined(NEED_load_module_GLOBAL)
void
DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...)
{
va_list args;
#ifndef newRV_noinc
#if defined(NEED_newRV_noinc)
static SV * DPPP_(my_newRV_noinc)(SV *sv);
static
#else
extern SV * DPPP_(my_newRV_noinc)(SV *sv);
#endif
#ifdef newRV_noinc
# undef newRV_noinc
#endif
#define newRV_noinc(a) DPPP_(my_newRV_noinc)(aTHX_ a)
#define Perl_newRV_noinc DPPP_(my_newRV_noinc)
#if defined(NEED_newRV_noinc) || defined(NEED_newRV_noinc_GLOBAL)
SV *
DPPP_(my_newRV_noinc)(SV *sv)
{
SV *rv = (SV *)newRV(sv);
SvREFCNT_dec(sv);
/* newCONSTSUB from IO.xs is in the core starting with 5.004_63 */
#if (PERL_BCDVERSION < 0x5004063) && (PERL_BCDVERSION != 0x5004005)
#if defined(NEED_newCONSTSUB)
static void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
static
#else
extern void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv);
#endif
#ifdef newCONSTSUB
# undef newCONSTSUB
#endif
#define newCONSTSUB(a,b,c) DPPP_(my_newCONSTSUB)(aTHX_ a,b,c)
#define Perl_newCONSTSUB DPPP_(my_newCONSTSUB)
#if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL)
/* This is just a trick to avoid a dependency of newCONSTSUB on PL_parser */
/* (There's no PL_parser in perl < 5.005, so this is completely safe) */
#define D_PPP_PL_copline PL_copline
#ifndef newSV_type
#if defined(NEED_newSV_type)
static SV* DPPP_(my_newSV_type)(pTHX_ svtype const t);
static
#else
extern SV* DPPP_(my_newSV_type)(pTHX_ svtype const t);
#endif
#ifdef newSV_type
# undef newSV_type
#endif
#define newSV_type(a) DPPP_(my_newSV_type)(aTHX_ a)
#define Perl_newSV_type DPPP_(my_newSV_type)
#if defined(NEED_newSV_type) || defined(NEED_newSV_type_GLOBAL)
SV*
DPPP_(my_newSV_type)(pTHX_ svtype const t)
{
SV* const sv = newSV(0);
#ifndef newSVpvn_flags
#if defined(NEED_newSVpvn_flags)
static SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags);
static
#else
extern SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags);
#endif
#ifdef newSVpvn_flags
# undef newSVpvn_flags
#endif
#define newSVpvn_flags(a,b,c) DPPP_(my_newSVpvn_flags)(aTHX_ a,b,c)
#define Perl_newSVpvn_flags DPPP_(my_newSVpvn_flags)
#if defined(NEED_newSVpvn_flags) || defined(NEED_newSVpvn_flags_GLOBAL)
SV *
DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags)
{
SV *sv = newSVpvn(D_PPP_CONSTPV_ARG(s), len);
#if (PERL_BCDVERSION < 0x5007000)
#if defined(NEED_sv_2pvbyte)
static char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp);
static
#else
extern char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp);
#endif
#ifdef sv_2pvbyte
# undef sv_2pvbyte
#endif
#define sv_2pvbyte(a,b) DPPP_(my_sv_2pvbyte)(aTHX_ a,b)
#define Perl_sv_2pvbyte DPPP_(my_sv_2pvbyte)
#if defined(NEED_sv_2pvbyte) || defined(NEED_sv_2pvbyte_GLOBAL)
char *
DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp)
{
sv_utf8_downgrade(sv,0);
return SvPV(sv,*lp);
}
#endif
/* Hint: sv_2pvbyte
* Use the SvPVbyte() macro instead of sv_2pvbyte().
*/
#undef SvPVbyte
#define SvPVbyte(sv, lp) \
((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK) \
? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvbyte(sv, &lp))
#endif
#else
# define SvPVbyte SvPV
#endif
/* Hint: sv_pvn
* Always use the SvPV() macro instead of sv_pvn().
*/
/* Hint: sv_pvn_force
* Always use the SvPV_force() macro instead of sv_pvn_force().
*/
/* If these are undefined, they're not handled by the core anyway */
#ifndef SV_IMMEDIATE_UNREF
# define SV_IMMEDIATE_UNREF 0
#endif
#ifndef SV_GMAGIC
# define SV_GMAGIC 0
#endif
#ifndef SV_COW_DROP_PV
# define SV_COW_DROP_PV 0
#if (PERL_BCDVERSION < 0x5007002)
#if defined(NEED_sv_2pv_flags)
static char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
static
#else
extern char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
#endif
#ifdef sv_2pv_flags
# undef sv_2pv_flags
#endif
#define sv_2pv_flags(a,b,c) DPPP_(my_sv_2pv_flags)(aTHX_ a,b,c)
#define Perl_sv_2pv_flags DPPP_(my_sv_2pv_flags)
#if defined(NEED_sv_2pv_flags) || defined(NEED_sv_2pv_flags_GLOBAL)
char *
DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
{
STRLEN n_a = (STRLEN) flags;
#endif
#if defined(NEED_sv_pvn_force_flags)
static char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
static
#else
extern char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags);
#endif
#ifdef sv_pvn_force_flags
# undef sv_pvn_force_flags
#endif
#define sv_pvn_force_flags(a,b,c) DPPP_(my_sv_pvn_force_flags)(aTHX_ a,b,c)
#define Perl_sv_pvn_force_flags DPPP_(my_sv_pvn_force_flags)
#if defined(NEED_sv_pvn_force_flags) || defined(NEED_sv_pvn_force_flags_GLOBAL)
char *
DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags)
{
STRLEN n_a = (STRLEN) flags;
#if (PERL_BCDVERSION >= 0x5004000) && !defined(vnewSVpvf)
#if defined(NEED_vnewSVpvf)
static SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
static
#else
extern SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args);
#endif
#ifdef vnewSVpvf
# undef vnewSVpvf
#endif
#define vnewSVpvf(a,b) DPPP_(my_vnewSVpvf)(aTHX_ a,b)
#define Perl_vnewSVpvf DPPP_(my_vnewSVpvf)
#if defined(NEED_vnewSVpvf) || defined(NEED_vnewSVpvf_GLOBAL)
SV *
DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args)
{
register SV *sv = newSV(0);
#ifndef newSVpvn_share
#if defined(NEED_newSVpvn_share)
static SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
static
#else
extern SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash);
#endif
#ifdef newSVpvn_share
# undef newSVpvn_share
#endif
#define newSVpvn_share(a,b,c) DPPP_(my_newSVpvn_share)(aTHX_ a,b,c)
#define Perl_newSVpvn_share DPPP_(my_newSVpvn_share)
#if defined(NEED_newSVpvn_share) || defined(NEED_newSVpvn_share_GLOBAL)
SV *
DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash)
{
SV *sv;
#ifndef grok_numeric_radix
#if defined(NEED_grok_numeric_radix)
static bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send);
static
#else
extern bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send);
#endif
#ifdef grok_numeric_radix
# undef grok_numeric_radix
#endif
#define grok_numeric_radix(a,b) DPPP_(my_grok_numeric_radix)(aTHX_ a,b)
#define Perl_grok_numeric_radix DPPP_(my_grok_numeric_radix)
#if defined(NEED_grok_numeric_radix) || defined(NEED_grok_numeric_radix_GLOBAL)
bool
DPPP_(my_grok_numeric_radix)(pTHX_ const char **sp, const char *send)
{
#ifdef USE_LOCALE_NUMERIC
#ifdef PL_numeric_radix_sv
#ifndef grok_number
#if defined(NEED_grok_number)
static int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
static
#else
extern int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep);
#endif
#ifdef grok_number
# undef grok_number
#endif
#define grok_number(a,b,c) DPPP_(my_grok_number)(aTHX_ a,b,c)
#define Perl_grok_number DPPP_(my_grok_number)
#if defined(NEED_grok_number) || defined(NEED_grok_number_GLOBAL)
int
DPPP_(my_grok_number)(pTHX_ const char *pv, STRLEN len, UV *valuep)
{
const char *s = pv;
const char *send = pv + len;
#ifndef grok_bin
#if defined(NEED_grok_bin)
static UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
static
#else
extern UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
#endif
#ifdef grok_bin
# undef grok_bin
#endif
#define grok_bin(a,b,c,d) DPPP_(my_grok_bin)(aTHX_ a,b,c,d)
#define Perl_grok_bin DPPP_(my_grok_bin)
#if defined(NEED_grok_bin) || defined(NEED_grok_bin_GLOBAL)
UV
DPPP_(my_grok_bin)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
{
const char *s = start;
STRLEN len = *len_p;
#ifndef grok_hex
#if defined(NEED_grok_hex)
static UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
static
#else
extern UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
#endif
#ifdef grok_hex
# undef grok_hex
#endif
#define grok_hex(a,b,c,d) DPPP_(my_grok_hex)(aTHX_ a,b,c,d)
#define Perl_grok_hex DPPP_(my_grok_hex)
#if defined(NEED_grok_hex) || defined(NEED_grok_hex_GLOBAL)
UV
DPPP_(my_grok_hex)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
{
const char *s = start;
STRLEN len = *len_p;
#ifndef grok_oct
#if defined(NEED_grok_oct)
static UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
static
#else
extern UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result);
#endif
#ifdef grok_oct
# undef grok_oct
#endif
#define grok_oct(a,b,c,d) DPPP_(my_grok_oct)(aTHX_ a,b,c,d)
#define Perl_grok_oct DPPP_(my_grok_oct)
#if defined(NEED_grok_oct) || defined(NEED_grok_oct_GLOBAL)
UV
DPPP_(my_grok_oct)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result)
{
const char *s = start;
STRLEN len = *len_p;
#ifndef pv_escape
#if defined(NEED_pv_escape)
static char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags);
static
#else
extern char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, STRLEN * const escaped, const U32 flags);
#endif
#ifdef pv_escape
# undef pv_escape
#endif
#define pv_escape(a,b,c,d,e,f) DPPP_(my_pv_escape)(aTHX_ a,b,c,d,e,f)
#define Perl_pv_escape DPPP_(my_pv_escape)
#if defined(NEED_pv_escape) || defined(NEED_pv_escape_GLOBAL)
char *
DPPP_(my_pv_escape)(pTHX_ SV *dsv, char const * const str,
const STRLEN count, const STRLEN max,
STRLEN * const escaped, const U32 flags)
#ifndef pv_pretty
#if defined(NEED_pv_pretty)
static char * DPPP_(my_pv_pretty)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags);
static
#else
extern char * DPPP_(my_pv_pretty)(pTHX_ SV * dsv, char const * const str, const STRLEN count, const STRLEN max, char const * const start_color, char const * const end_color, const U32 flags);
#endif
#ifdef pv_pretty
# undef pv_pretty
#endif
#define pv_pretty(a,b,c,d,e,f,g) DPPP_(my_pv_pretty)(aTHX_ a,b,c,d,e,f,g)
#define Perl_pv_pretty DPPP_(my_pv_pretty)
#if defined(NEED_pv_pretty) || defined(NEED_pv_pretty_GLOBAL)
char *
DPPP_(my_pv_pretty)(pTHX_ SV *dsv, char const * const str, const STRLEN count,
const STRLEN max, char const * const start_color, char const * const end_color,
const U32 flags)
#ifndef pv_display
#if defined(NEED_pv_display)
static char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
static
#else
extern char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim);
#endif
#ifdef pv_display
# undef pv_display
#endif
#define pv_display(a,b,c,d,e) DPPP_(my_pv_display)(aTHX_ a,b,c,d,e)
#define Perl_pv_display DPPP_(my_pv_display)
#if defined(NEED_pv_display) || defined(NEED_pv_display_GLOBAL)
char *
DPPP_(my_pv_display)(pTHX_ SV *dsv, const char *pv, STRLEN cur, STRLEN len, STRLEN pvlim)
{
pv_pretty(dsv, pv, cur, pvlim, NULL, NULL, PERL_PV_PRETTY_DUMP);
if (defined($gameMode))
{
print "Leaving game mode.\n";
glutLeaveGameMode();
}
else
{
print "Destroying window.\n";
glutDestroyWindow($Window_ID);
}
undef($Window_ID);
print "Cleanup completed.\n";
}
sub ReleaseResources
{
return if (!defined($Window_ID));
if ($hasFBO)
{
# Release resources
glBindRenderbufferEXT( GL_RENDERBUFFER_EXT, 0 );
glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, 0 );
glDeleteRenderbuffersEXT_p( $RenderBufferID ) if ($RenderBufferID);
glDeleteFramebuffersEXT_p( $FrameBufferID ) if ($FrameBufferID);
}
if ($Shader)
{
undef($Shader);
}
elsif ($hasFragProg)
{
glBindProgramARB(GL_VERTEX_PROGRAM_ARB, 0);
glDeleteProgramsARB_p( $VertexProgID ) if ($VertexProgID);
glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 0);
glDeleteProgramsARB_p( $FragProgID ) if ($FragProgID);
}