/*
 * This file was generated automatically by ExtUtils::ParseXS version 3.51 from the
 * contents of V1.xs. Do not edit this file, edit V1.xs instead.
 *
 *    ANY CHANGES MADE HERE WILL BE LOST!
 *
 */

#line 1 "lib/OpenGL/V1.xs"
/*  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.
 */

#include <stdio.h>

#include "pgopogl.h"
#include "gl_errors.h"

#ifdef HAVE_GL
#include "gl_util.h"
#endif /* defined HAVE_GL */

#line 27 "lib/OpenGL/V1.c"
#ifndef PERL_UNUSED_VAR
#  define PERL_UNUSED_VAR(var) if (0) var = var
#endif

#ifndef dVAR
#  define dVAR		dNOOP
#endif


/* This stuff is not part of the API! You have been warned. */
#ifndef PERL_VERSION_DECIMAL
#  define PERL_VERSION_DECIMAL(r,v,s) (r*1000000 + v*1000 + s)
#endif
#ifndef PERL_DECIMAL_VERSION
#  define PERL_DECIMAL_VERSION \
	  PERL_VERSION_DECIMAL(PERL_REVISION,PERL_VERSION,PERL_SUBVERSION)
#endif
#ifndef PERL_VERSION_GE
#  define PERL_VERSION_GE(r,v,s) \
	  (PERL_DECIMAL_VERSION >= PERL_VERSION_DECIMAL(r,v,s))
#endif
#ifndef PERL_VERSION_LE
#  define PERL_VERSION_LE(r,v,s) \
	  (PERL_DECIMAL_VERSION <= PERL_VERSION_DECIMAL(r,v,s))
#endif

/* XS_INTERNAL is the explicit static-linkage variant of the default
 * XS macro.
 *
 * XS_EXTERNAL is the same as XS_INTERNAL except it does not include
 * "STATIC", ie. it exports XSUB symbols. You probably don't want that
 * for anything but the BOOT XSUB.
 *
 * See XSUB.h in core!
 */


/* TODO: This might be compatible further back than 5.10.0. */
#if PERL_VERSION_GE(5, 10, 0) && PERL_VERSION_LE(5, 15, 1)
#  undef XS_EXTERNAL
#  undef XS_INTERNAL
#  if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
#    define XS_EXTERNAL(name) __declspec(dllexport) XSPROTO(name)
#    define XS_INTERNAL(name) STATIC XSPROTO(name)
#  endif
#  if defined(__SYMBIAN32__)
#    define XS_EXTERNAL(name) EXPORT_C XSPROTO(name)
#    define XS_INTERNAL(name) EXPORT_C STATIC XSPROTO(name)
#  endif
#  ifndef XS_EXTERNAL
#    if defined(HASATTRIBUTE_UNUSED) && !defined(__cplusplus)
#      define XS_EXTERNAL(name) void name(pTHX_ CV* cv __attribute__unused__)
#      define XS_INTERNAL(name) STATIC void name(pTHX_ CV* cv __attribute__unused__)
#    else
#      ifdef __cplusplus
#        define XS_EXTERNAL(name) extern "C" XSPROTO(name)
#        define XS_INTERNAL(name) static XSPROTO(name)
#      else
#        define XS_EXTERNAL(name) XSPROTO(name)
#        define XS_INTERNAL(name) STATIC XSPROTO(name)
#      endif
#    endif
#  endif
#endif

/* perl >= 5.10.0 && perl <= 5.15.1 */


/* The XS_EXTERNAL macro is used for functions that must not be static
 * like the boot XSUB of a module. If perl didn't have an XS_EXTERNAL
 * macro defined, the best we can do is assume XS is the same.
 * Dito for XS_INTERNAL.
 */
#ifndef XS_EXTERNAL
#  define XS_EXTERNAL(name) XS(name)
#endif
#ifndef XS_INTERNAL
#  define XS_INTERNAL(name) XS(name)
#endif

/* Now, finally, after all this mess, we want an ExtUtils::ParseXS
 * internal macro that we're free to redefine for varying linkage due
 * to the EXPORT_XSUB_SYMBOLS XS keyword. This is internal, use
 * XS_EXTERNAL(name) or XS_INTERNAL(name) in your code if you need to!
 */

#undef XS_EUPXS
#if defined(PERL_EUPXS_ALWAYS_EXPORT)
#  define XS_EUPXS(name) XS_EXTERNAL(name)
#else
   /* default to internal */
#  define XS_EUPXS(name) XS_INTERNAL(name)
#endif

#ifndef PERL_ARGS_ASSERT_CROAK_XS_USAGE
#define PERL_ARGS_ASSERT_CROAK_XS_USAGE assert(cv); assert(params)

/* prototype to pass -Wmissing-prototypes */
STATIC void
S_croak_xs_usage(const CV *const cv, const char *const params);

STATIC void
S_croak_xs_usage(const CV *const cv, const char *const params)
{
    const GV *const gv = CvGV(cv);

    PERL_ARGS_ASSERT_CROAK_XS_USAGE;

    if (gv) {
        const char *const gvname = GvNAME(gv);
        const HV *const stash = GvSTASH(gv);
        const char *const hvname = stash ? HvNAME(stash) : NULL;

        if (hvname)
	    Perl_croak_nocontext("Usage: %s::%s(%s)", hvname, gvname, params);
        else
	    Perl_croak_nocontext("Usage: %s(%s)", gvname, params);
    } else {
        /* Pants. I don't think that it should be possible to get here. */
	Perl_croak_nocontext("Usage: CODE(0x%" UVxf ")(%s)", PTR2UV(cv), params);
    }
}
#undef  PERL_ARGS_ASSERT_CROAK_XS_USAGE

#define croak_xs_usage        S_croak_xs_usage

#endif

/* NOTE: the prototype of newXSproto() is different in versions of perls,
 * so we define a portable version of newXSproto()
 */
#ifdef newXS_flags
#define newXSproto_portable(name, c_impl, file, proto) newXS_flags(name, c_impl, file, proto, 0)
#else
#define newXSproto_portable(name, c_impl, file, proto) (PL_Sv=(SV*)newXS(name, c_impl, file), sv_setpv(PL_Sv, proto), (CV*)PL_Sv)
#endif /* !defined(newXS_flags) */

#if PERL_VERSION_LE(5, 21, 5)
#  define newXS_deffile(a,b) Perl_newXS(aTHX_ a,b,file)
#else
#  define newXS_deffile(a,b) Perl_newXS_deffile(aTHX_ a,b)
#endif

#line 171 "lib/OpenGL/V1.c"
#ifdef HAVE_GL
#define XSubPPtmpAAAA 1


XS_EUPXS(XS_OpenGL_glBitmap_c); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glBitmap_c)
{
    dVAR; dXSARGS;
    if (items != 7)
       croak_xs_usage(cv,  "width, height, xorig, yorig, xmove, ymove, bitmap");
    {
	GLsizei	width = (int)SvIV(ST(0))
;
	GLsizei	height = (int)SvIV(ST(1))
;
	GLfloat	xorig = (float)SvNV(ST(2))
;
	GLfloat	yorig = (float)SvNV(ST(3))
;
	GLfloat	xmove = (float)SvNV(ST(4))
;
	GLfloat	ymove = (float)SvNV(ST(5))
;
	void *	bitmap = INT2PTR(void *,SvIV(ST(6)))
;
#line 33 "lib/OpenGL/V1.xs"
	glBitmap(width, height, xorig, yorig, xmove, ymove, bitmap);
#line 199 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glBitmap_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glBitmap_s)
{
    dVAR; dXSARGS;
    if (items != 7)
       croak_xs_usage(cv,  "width, height, xorig, yorig, xmove, ymove, bitmap");
    {
	GLsizei	width = (int)SvIV(ST(0))
;
	GLsizei	height = (int)SvIV(ST(1))
;
	GLfloat	xorig = (float)SvNV(ST(2))
;
	GLfloat	yorig = (float)SvNV(ST(3))
;
	GLfloat	xmove = (float)SvNV(ST(4))
;
	GLfloat	ymove = (float)SvNV(ST(5))
;
	SV *	bitmap = ST(6)
;
#line 46 "lib/OpenGL/V1.xs"
	{
	GLubyte * bitmap_s = ELI(bitmap, width, height,
		GL_COLOR_INDEX, GL_BITMAP, gl_pixelbuffer_unpack);
	glBitmap(width, height, xorig, yorig, xmove, ymove, bitmap_s);
	}
#line 232 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glBitmap_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glBitmap_p)
{
    dVAR; dXSARGS;
    if (items < 6)
       croak_xs_usage(cv,  "width, height, xorig, yorig, xmove, ymove, ...");
    {
	GLsizei	width = (int)SvIV(ST(0))
;
	GLsizei	height = (int)SvIV(ST(1))
;
	GLfloat	xorig = (float)SvNV(ST(2))
;
	GLfloat	yorig = (float)SvNV(ST(3))
;
	GLfloat	xmove = (float)SvNV(ST(4))
;
	GLfloat	ymove = (float)SvNV(ST(5))
;
#line 62 "lib/OpenGL/V1.xs"
	{
	GLvoid * ptr;
	glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
	glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
	glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
	ptr = pack_image_ST(&(ST(6)), items-6, width, height,
		1, GL_COLOR_INDEX, GL_BITMAP, 0);
	glBitmap(width, height, xorig, yorig, xmove, ymove, ptr);
	glPopClientAttrib();
	free(ptr);
	}
#line 269 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glCallLists_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glCallLists_s)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "n, type, lists");
    {
	GLsizei	n = (int)SvIV(ST(0))
;
	GLenum	type = (int)SvIV(ST(1))
;
	SV *	lists = ST(2)
;
#line 82 "lib/OpenGL/V1.xs"
	{
	int size = gl_type_size(type);
	if (size < 0) croak("unknown type");
	void * lists_s = EL(lists, size * n);
	glCallLists(n, type, lists_s);
	}
#line 295 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glCallLists_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glCallLists_p)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
    {
#line 95 "lib/OpenGL/V1.xs"
	if (items) {
		int * list = malloc(sizeof(int) * items);
		int i;
		for(i=0;i<items;i++)
			list[i] = SvIV(ST(i));
		glCallLists(items, GL_INT, list);
		free(list);
	}
#line 317 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}

#ifdef GL_VERSION_1_1
#define XSubPPtmpAAAB 1


XS_EUPXS(XS_OpenGL_glDrawElements_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glDrawElements_s)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "mode, count, type, indices");
    {
	GLenum	mode = (int)SvIV(ST(0))
;
	GLint	count = (int)SvIV(ST(1))
;
	GLenum	type = (int)SvIV(ST(2))
;
	SV *	indices = ST(3)
;
#line 115 "lib/OpenGL/V1.xs"
	{
		int size = gl_type_size(type);
		if (size < 0) croak("unknown type");
		void * indices_s = EL(indices, size*count);
		glDrawElements(mode, count, type, indices_s);
	}
#line 348 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glDrawElements_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glDrawElements_p)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "mode, ...");
    {
	GLenum	mode = (int)SvIV(ST(0))
;
#line 128 "lib/OpenGL/V1.xs"
	{
		GLuint * indices = malloc(sizeof(GLuint) * items);
		int i;

		for (i=1; i<items; i++)
			indices[i-1] = SvIV(ST(i));

		glDrawElements(mode, items-1, GL_UNSIGNED_INT, indices);

		free(indices);
	}
#line 375 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}

#endif

XS_EUPXS(XS_OpenGL_glDrawPixels_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glDrawPixels_s)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "width, height, format, type, pixels");
    {
	GLsizei	width = (int)SvIV(ST(0))
;
	GLsizei	height = (int)SvIV(ST(1))
;
	GLenum	format = (int)SvIV(ST(2))
;
	GLenum	type = (int)SvIV(ST(3))
;
	SV *	pixels = ST(4)
;
#line 152 "lib/OpenGL/V1.xs"
	{
	GLvoid * ptr = ELI(pixels, width, height,
		format, type, gl_pixelbuffer_unpack);
	glDrawPixels(width, height, format, type, ptr);
	}
#line 405 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glDrawPixels_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glDrawPixels_p)
{
    dVAR; dXSARGS;
    if (items < 4)
       croak_xs_usage(cv,  "width, height, format, type, ...");
    {
	GLsizei	width = (int)SvIV(ST(0))
;
	GLsizei	height = (int)SvIV(ST(1))
;
	GLenum	format = (int)SvIV(ST(2))
;
	GLenum	type = (int)SvIV(ST(3))
;
#line 167 "lib/OpenGL/V1.xs"
	{
	GLvoid * ptr;
	glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
	glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
	glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
	ptr = pack_image_ST(&(ST(4)), items-4, width, height, 1, format, type, 0);
	glDrawPixels(width, height, format, type, ptr);
	glPopClientAttrib();
	free(ptr);
	}
#line 437 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}

#ifdef GL_VERSION_1_2
#define XSubPPtmpAAAC 1


XS_EUPXS(XS_OpenGL_glDrawRangeElements_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glDrawRangeElements_s)
{
    dVAR; dXSARGS;
    if (items != 6)
       croak_xs_usage(cv,  "mode, start, end, count, type, indices");
    {
	GLenum	mode = (int)SvIV(ST(0))
;
	GLuint	start = (unsigned int)SvUV(ST(1))
;
	GLuint	end = (unsigned int)SvUV(ST(2))
;
	GLsizei	count = (int)SvIV(ST(3))
;
	GLenum	type = (int)SvIV(ST(4))
;
	SV *	indices = ST(5)
;
#line 190 "lib/OpenGL/V1.xs"
		loadProc(glDrawRangeElements,"glDrawRangeElements");
#line 467 "lib/OpenGL/V1.c"
#line 192 "lib/OpenGL/V1.xs"
	{
		int size = gl_type_size(type);
		if (size < 0) croak("unknown type");
		void * indices_s = EL(indices, size * count);
		glDrawRangeElements(mode, start, end, count, type, indices_s);
	}
#line 475 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glDrawRangeElements_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glDrawRangeElements_p)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "mode, start, count, ...");
    {
	GLenum	mode = (int)SvIV(ST(0))
;
	GLuint	start = (unsigned int)SvUV(ST(1))
;
	GLuint	count = (unsigned int)SvUV(ST(2))
;
#line 207 "lib/OpenGL/V1.xs"
		loadProc(glDrawRangeElements,"glDrawRangeElements");
#line 496 "lib/OpenGL/V1.c"
#line 209 "lib/OpenGL/V1.xs"
	{
		if (items > 3)
		{
			if (start < (GLuint)items-3)
			{
				GLuint * indices;
				GLuint i;

				if (start+count > (GLuint)(items-3))
					count = (GLuint)items-(start+3);

				indices = malloc(sizeof(GLuint) * count);

				for (i=start; i<count; i++)
					indices[i] = SvIV(ST(i+3));

				glDrawRangeElements(mode, start, start+count-1,
					count, GL_UNSIGNED_INT, indices);

				free(indices);
			}
		}
		else
		{
			glDrawRangeElements(mode, start, start+count-1,
				count, GL_UNSIGNED_INT, 0);
		}
	}
#line 526 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}

#endif

XS_EUPXS(XS_OpenGL_glGetMapdv_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetMapdv_s)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "target, query, v");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	query = (int)SvIV(ST(1))
;
	SV *	v = ST(2)
;
#line 248 "lib/OpenGL/V1.xs"
	{
		int nparams = gl_map_count(target, query);
		if (nparams < 0) croak("Unknown map query");
		GLdouble * v_s = EL(v, sizeof(GLdouble)*nparams);
		glGetMapdv(target, query, v_s);
	}
#line 553 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetMapfv_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetMapfv_s)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "target, query, v");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	query = (int)SvIV(ST(1))
;
	SV *	v = ST(2)
;
#line 263 "lib/OpenGL/V1.xs"
	{
		int nparams = gl_map_count(target, query);
		if (nparams < 0) croak("Unknown map query");
		GLfloat * v_s = EL(v, sizeof(GLfloat)*nparams);
		glGetMapfv(target, query, v_s);
	}
#line 579 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetMapiv_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetMapiv_s)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "target, query, v");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	query = (int)SvIV(ST(1))
;
	SV *	v = ST(2)
;
#line 278 "lib/OpenGL/V1.xs"
	{
		int nparams = gl_map_count(target, query);
		if (nparams < 0) croak("Unknown map query");
		GLint * v_s = EL(v, sizeof(GLint)*nparams);
		glGetMapiv(target, query, v_s);
	}
#line 605 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetMapfv_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetMapfv_p)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "target, query");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	query = (int)SvIV(ST(1))
;
#line 292 "lib/OpenGL/V1.xs"
	{
		GLfloat	ret[MAX_GL_MAP_COUNT];
		int n = gl_map_count(target, query);
		if (n < 0) croak("Unknown map query");
		int i;
		glGetMapfv(target, query, &ret[0]);
		EXTEND(sp, n);
		for(i=0;i<n;i++)
			PUSHs(sv_2mortal(newSVnv(ret[i])));
	}
#line 635 "lib/OpenGL/V1.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_OpenGL_glGetMapdv_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetMapdv_p)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "target, query");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	query = (int)SvIV(ST(1))
;
#line 310 "lib/OpenGL/V1.xs"
	{
		GLdouble	ret[MAX_GL_MAP_COUNT];
		int n = gl_map_count(target, query);
		if (n < 0) croak("Unknown map query");
		int i;
		glGetMapdv(target, query, &ret[0]);
		EXTEND(sp, n);
		for(i=0;i<n;i++)
			PUSHs(sv_2mortal(newSVnv(ret[i])));
	}
#line 666 "lib/OpenGL/V1.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_OpenGL_glGetMapiv_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetMapiv_p)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "target, query");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	query = (int)SvIV(ST(1))
;
#line 328 "lib/OpenGL/V1.xs"
	{
		GLint	ret[MAX_GL_MAP_COUNT];
		int n = gl_map_count(target, query);
		if (n < 0) croak("Unknown map query");
		int i;
		glGetMapiv(target, query, &ret[0]);
		EXTEND(sp, n);
		for(i=0;i<n;i++)
			PUSHs(sv_2mortal(newSViv(ret[i])));
	}
#line 697 "lib/OpenGL/V1.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_OpenGL_glGetPixelMapfv_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetPixelMapfv_s)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "map, values");
    {
	GLenum	map = (int)SvIV(ST(0))
;
	SV *	values = ST(1)
;
#line 346 "lib/OpenGL/V1.xs"
	{
	int nparams = gl_pixelmap_size(map);
	if (nparams < 0) croak("unknown pixelmap");
	GLfloat * values_s = EL(values, sizeof(GLfloat)* nparams);
	glGetPixelMapfv(map, values_s);
	}
#line 722 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetPixelMapuiv_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetPixelMapuiv_s)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "map, values");
    {
	GLenum	map = (int)SvIV(ST(0))
;
	SV *	values = ST(1)
;
#line 360 "lib/OpenGL/V1.xs"
	{
	int nparams = gl_pixelmap_size(map);
	if (nparams < 0) croak("unknown pixelmap");
	GLuint * values_s = EL(values, sizeof(GLuint)* nparams);
	glGetPixelMapuiv(map, values_s);
	}
#line 746 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetPixelMapusv_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetPixelMapusv_s)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "map, values");
    {
	GLenum	map = (int)SvIV(ST(0))
;
	SV *	values = ST(1)
;
#line 374 "lib/OpenGL/V1.xs"
	{
	int nparams = gl_pixelmap_size(map);
	if (nparams < 0) croak("unknown pixelmap");
	GLushort * values_s = EL(values, sizeof(GLushort)* nparams);
	glGetPixelMapusv(map, values_s);
	}
#line 770 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetPixelMapfv_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetPixelMapfv_p)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "map");
    {
	GLenum	map = (int)SvIV(ST(0))
;
#line 387 "lib/OpenGL/V1.xs"
	{
		int count = gl_pixelmap_size(map);
		if (count < 0) croak("unknown pixelmap");
		GLfloat * values;
		int i;

		values = malloc(sizeof(GLfloat) * count);

		glGetPixelMapfv(map, values);

		EXTEND(sp, count);

		for(i=0; i<count; i++)
			PUSHs(sv_2mortal(newSVnv(values[i])));

		free(values);
	}
#line 803 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetPixelMapuiv_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetPixelMapuiv_p)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "map");
    {
	GLenum	map = (int)SvIV(ST(0))
;
#line 411 "lib/OpenGL/V1.xs"
	{
		int count = gl_pixelmap_size(map);
		if (count < 0) croak("unknown pixelmap");
		GLuint * values;
		int i;
		values = malloc(sizeof(GLuint) * count);
		glGetPixelMapuiv(map, values);
		EXTEND(sp, count);
		for(i=0; i<count; i++)
			PUSHs(sv_2mortal(newSViv(values[i])));
		free(values);
	}
#line 831 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetPixelMapusv_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetPixelMapusv_p)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "map");
    {
	GLenum	map = (int)SvIV(ST(0))
;
#line 430 "lib/OpenGL/V1.xs"
	{
		int count = gl_pixelmap_size(map);
		if (count < 0) croak("unknown pixelmap");
		GLushort * values;
		int i;
		values = malloc(sizeof(GLushort) * count);
		glGetPixelMapusv(map, values);
		EXTEND(sp, count);
		for(i=0; i<count; i++)
			PUSHs(sv_2mortal(newSViv(values[i])));
		free(values);
	}
#line 859 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glPolygonStipple_c); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glPolygonStipple_c)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "mask");
    {
	void *	mask = INT2PTR(void *,SvIV(ST(0)))
;
#line 449 "lib/OpenGL/V1.xs"
	glPolygonStipple(mask);
#line 876 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetPolygonStipple_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetPolygonStipple_s)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "mask");
    {
	SV *	mask = ST(0)
;
#line 457 "lib/OpenGL/V1.xs"
	{
	GLubyte * ptr = ELI(mask, 32, 32, GL_COLOR_INDEX, GL_BITMAP, gl_pixelbuffer_unpack);
	glGetPolygonStipple(ptr);
	}
#line 896 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetPolygonStipple_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetPolygonStipple_p)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
#line 467 "lib/OpenGL/V1.xs"
	{
		void * ptr;
		glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
		glPixelStorei(GL_PACK_ROW_LENGTH, 0);
		glPixelStorei(GL_PACK_ALIGNMENT, 1);
		ptr = allocate_image_ST(32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, 0);
		glGetPolygonStipple(ptr);
		sp = unpack_image_ST(sp, ptr, 32, 32, 1,
			GL_COLOR_INDEX, GL_BITMAP, 0);
		free(ptr);
		glPopClientAttrib();
	}
#line 924 "lib/OpenGL/V1.c"
	PUTBACK;
	return;
    }
}

#ifdef GL_VERSION_1_1
#define XSubPPtmpAAAD 1


XS_EUPXS(XS_OpenGL_glGetPointerv_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetPointerv_s)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "pname, params");
    {
	GLenum	pname = (int)SvIV(ST(0))
;
	SV *	params = ST(1)
;
#line 489 "lib/OpenGL/V1.xs"
	{
		void ** params_s = EL(params, sizeof(void*));
		glGetPointerv(pname, params_s);
	}
#line 950 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetPointerv_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetPointerv_p)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "pname");
    {
	GLenum	pname = (int)SvIV(ST(0))
;
	void *	RETVAL;
	dXSTARG;
#line 500 "lib/OpenGL/V1.xs"
	glGetPointerv(pname, &RETVAL);
#line 969 "lib/OpenGL/V1.c"
	XSprePUSH;
	PUSHi(PTR2IV(RETVAL));
    }
    XSRETURN(1);
}

#endif

XS_EUPXS(XS_OpenGL_glGetTexImage_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetTexImage_s)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "target, level, format, type, pixels");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	level = (int)SvIV(ST(1))
;
	GLenum	format = (int)SvIV(ST(2))
;
	GLenum	type = (int)SvIV(ST(3))
;
	SV *	pixels = ST(4)
;
#line 516 "lib/OpenGL/V1.xs"
	{
		GLint width, height;
		GLvoid * ptr;

		glGetTexLevelParameteriv(target, level,
			GL_TEXTURE_WIDTH, &width);
		glGetTexLevelParameteriv(target, level,
			GL_TEXTURE_HEIGHT, &height);

		ptr = ELI(pixels, width, height, format, type,
			gl_pixelbuffer_unpack);
		glGetTexImage(target, level, format, type, pixels);
	}
#line 1009 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetTexImage_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetTexImage_p)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "target, level, format, type");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	level = (int)SvIV(ST(1))
;
	GLenum	format = (int)SvIV(ST(2))
;
	GLenum	type = (int)SvIV(ST(3))
;
#line 539 "lib/OpenGL/V1.xs"
	{
		GLint width, height;
		GLvoid * ptr;

		glGetTexLevelParameteriv(target, level,
			GL_TEXTURE_WIDTH, &width);
		glGetTexLevelParameteriv(target, level,
			GL_TEXTURE_HEIGHT, &height);

		glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
		glPixelStorei(GL_PACK_ROW_LENGTH, 0);
		glPixelStorei(GL_PACK_ALIGNMENT, 1);

		ptr = allocate_image_ST(width, height, 1, format, type, 0);
		glGetTexImage(target, level, format, type, ptr);
		sp = unpack_image_ST(sp, ptr, width, height, 1, format, type, 0);

		free(ptr);
		glPopClientAttrib();
	}
#line 1053 "lib/OpenGL/V1.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_OpenGL_glMap1d_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glMap1d_s)
{
    dVAR; dXSARGS;
    if (items != 6)
       croak_xs_usage(cv,  "target, u1, u2, stride, order, points");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLdouble	u1 = (double)SvNV(ST(1))
;
	GLdouble	u2 = (double)SvNV(ST(2))
;
	GLint	stride = (int)SvIV(ST(3))
;
	GLint	order = (int)SvIV(ST(4))
;
	SV *	points = ST(5)
;
#line 571 "lib/OpenGL/V1.xs"
	{
	GLdouble * points_s = EL(points, 0 /*FIXME*/);
	glMap1d(target, u1, u2, stride, order, points_s);
	}
#line 1084 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glMap1f_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glMap1f_s)
{
    dVAR; dXSARGS;
    if (items != 6)
       croak_xs_usage(cv,  "target, u1, u2, stride, order, points");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLfloat	u1 = (float)SvNV(ST(1))
;
	GLfloat	u2 = (float)SvNV(ST(2))
;
	GLint	stride = (int)SvIV(ST(3))
;
	GLint	order = (int)SvIV(ST(4))
;
	SV *	points = ST(5)
;
#line 587 "lib/OpenGL/V1.xs"
	{
	GLfloat * points_s = EL(points, 0 /*FIXME*/);
	glMap1f(target, u1, u2, stride, order, points_s);
	}
#line 1114 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glMap1d_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glMap1d_p)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "target, u1, u2, ...");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLdouble	u1 = (double)SvNV(ST(1))
;
	GLdouble	u2 = (double)SvNV(ST(2))
;
#line 601 "lib/OpenGL/V1.xs"
	{
		int count = items-3;
		int nparams = gl_map_count(target, GL_COEFF);
		if (nparams < 0) croak("Unknown map query");
		GLint order = (items - 3) / nparams;
		GLdouble * points = malloc(sizeof(GLdouble) * (count+1));
		int i;
		for (i=0;i<count;i++)
			points[i] = SvNV(ST(i+3));
		glMap1d(target, u1, u2, 0, order, points);
		free(points);
	}
#line 1146 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glMap1f_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glMap1f_p)
{
    dVAR; dXSARGS;
    if (items < 3)
       croak_xs_usage(cv,  "target, u1, u2, ...");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLfloat	u1 = (float)SvNV(ST(1))
;
	GLfloat	u2 = (float)SvNV(ST(2))
;
#line 623 "lib/OpenGL/V1.xs"
	{
		int count = items-3;
		int nparams = gl_map_count(target, GL_COEFF);
		if (nparams < 0) croak("Unknown map query");
		GLint order = (items - 3) / nparams;
		GLfloat * points = malloc(sizeof(GLfloat) * (count+1));
		int i;
		for (i=0;i<count;i++)
			points[i] = (GLfloat)SvNV(ST(i+3));
		glMap1f(target, u1, u2, 0, order, points);
		free(points);
	}
#line 1178 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glMap2d_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glMap2d_s)
{
    dVAR; dXSARGS;
    if (items != 10)
       croak_xs_usage(cv,  "target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLdouble	u1 = (double)SvNV(ST(1))
;
	GLdouble	u2 = (double)SvNV(ST(2))
;
	GLint	ustride = (int)SvIV(ST(3))
;
	GLint	uorder = (int)SvIV(ST(4))
;
	GLdouble	v1 = (double)SvNV(ST(5))
;
	GLdouble	v2 = (double)SvNV(ST(6))
;
	GLint	vstride = (int)SvIV(ST(7))
;
	GLint	vorder = (int)SvIV(ST(8))
;
	SV *	points = ST(9)
;
#line 651 "lib/OpenGL/V1.xs"
	{
	GLdouble * points_s = EL(points, 0 /*FIXME*/);
	glMap2d(target, u1, u2, ustride, uorder, v1, v2,
		vstride, vorder, points_s);
	}
#line 1217 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glMap2f_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glMap2f_s)
{
    dVAR; dXSARGS;
    if (items != 10)
       croak_xs_usage(cv,  "target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLfloat	u1 = (float)SvNV(ST(1))
;
	GLfloat	u2 = (float)SvNV(ST(2))
;
	GLint	ustride = (int)SvIV(ST(3))
;
	GLint	uorder = (int)SvIV(ST(4))
;
	GLfloat	v1 = (float)SvNV(ST(5))
;
	GLfloat	v2 = (float)SvNV(ST(6))
;
	GLint	vstride = (int)SvIV(ST(7))
;
	GLint	vorder = (int)SvIV(ST(8))
;
	SV *	points = ST(9)
;
#line 672 "lib/OpenGL/V1.xs"
	{
	GLfloat * points_s = EL(points, 0 /*FIXME*/);
	glMap2f(target, u1, u2, ustride, uorder, v1, v2,
		vstride, vorder, points_s);
	}
#line 1256 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glMap2d_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glMap2d_p)
{
    dVAR; dXSARGS;
    if (items < 6)
       croak_xs_usage(cv,  "target, u1, u2, uorder, v1, v2, ...");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLdouble	u1 = (double)SvNV(ST(1))
;
	GLdouble	u2 = (double)SvNV(ST(2))
;
	GLint	uorder = (int)SvIV(ST(3))
;
	GLdouble	v1 = (double)SvNV(ST(4))
;
	GLdouble	v2 = (double)SvNV(ST(5))
;
#line 690 "lib/OpenGL/V1.xs"
	{
		int count = items-6;
		int nparams = gl_map_count(target, GL_COEFF);
		if (nparams < 0) croak("Unknown map query");
		GLint vorder = (count / uorder) / nparams;
		GLdouble * points = malloc(sizeof(GLdouble) * (count+1));
		int i;
		for (i=0;i<count;i++)
			points[i] = SvNV(ST(i+6));
		glMap2d(target, u1, u2, 0, uorder, v1, v2, 0, vorder, points);
		free(points);
	}
#line 1294 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glMap2f_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glMap2f_p)
{
    dVAR; dXSARGS;
    if (items < 6)
       croak_xs_usage(cv,  "target, u1, u2, uorder, v1, v2, ...");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLfloat	u1 = (float)SvNV(ST(1))
;
	GLfloat	u2 = (float)SvNV(ST(2))
;
	GLint	uorder = (int)SvIV(ST(3))
;
	GLfloat	v1 = (float)SvNV(ST(4))
;
	GLfloat	v2 = (float)SvNV(ST(5))
;
#line 715 "lib/OpenGL/V1.xs"
	{
		int count = items-6;
		int nparams = gl_map_count(target, GL_COEFF);
		if (nparams < 0) croak("Unknown map query");
		GLint vorder = (count / uorder) / nparams;
		GLfloat * points = malloc(sizeof(GLfloat) * (count+1));
		int i;
		for (i=0;i<count;i++)
			points[i] = (GLfloat)SvNV(ST(i+6));
		glMap2f(target, u1, u2, 0, uorder, v1, v2, 0, vorder, points);
		free(points);
	}
#line 1332 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glPolygonStipple_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glPolygonStipple_s)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "mask");
    {
	SV *	mask = ST(0)
;
#line 734 "lib/OpenGL/V1.xs"
	{
	GLubyte * ptr = ELI(mask, 32, 32, GL_COLOR_INDEX, GL_BITMAP, 0);
	glPolygonStipple(ptr);
	}
#line 1352 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glPolygonStipple_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glPolygonStipple_p)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
    {
#line 743 "lib/OpenGL/V1.xs"
	{
	GLvoid * ptr;
	glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
	glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
	glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
	ptr = pack_image_ST(&(ST(0)), items, 32, 32, 1,
		GL_COLOR_INDEX, GL_BITMAP, 0);
	glPolygonStipple(ptr);
	glPopClientAttrib();
	free(ptr);
	}
#line 1377 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glReadPixels_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glReadPixels_s)
{
    dVAR; dXSARGS;
    if (items != 7)
       croak_xs_usage(cv,  "x, y, width, height, format, type, pixels");
    {
	GLint	x = (int)SvIV(ST(0))
;
	GLint	y = (int)SvIV(ST(1))
;
	GLsizei	width = (int)SvIV(ST(2))
;
	GLsizei	height = (int)SvIV(ST(3))
;
	GLenum	format = (int)SvIV(ST(4))
;
	GLenum	type = (int)SvIV(ST(5))
;
	SV *	pixels = ST(6)
;
#line 767 "lib/OpenGL/V1.xs"
	{
		void * ptr = ELI(pixels, width, height,
			format, type, gl_pixelbuffer_pack);
		glReadPixels(x, y, width, height, format, type, ptr);
	}
#line 1410 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glReadPixels_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glReadPixels_p)
{
    dVAR; dXSARGS;
    if (items != 6)
       croak_xs_usage(cv,  "x, y, width, height, format, type");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GLint	x = (int)SvIV(ST(0))
;
	GLint	y = (int)SvIV(ST(1))
;
	GLsizei	width = (int)SvIV(ST(2))
;
	GLsizei	height = (int)SvIV(ST(3))
;
	GLenum	format = (int)SvIV(ST(4))
;
	GLenum	type = (int)SvIV(ST(5))
;
#line 784 "lib/OpenGL/V1.xs"
	{
		void * ptr;
		glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
		glPixelStorei(GL_PACK_ROW_LENGTH, 0);
		glPixelStorei(GL_PACK_ALIGNMENT, 1);
		ptr = allocate_image_ST(width, height, 1, format, type, 0);
		glReadPixels(x, y, width, height, format, type, ptr);
		sp = unpack_image_ST(sp, ptr, width, height, 1, format, type, 0);
		free(ptr);
		glPopClientAttrib();
	}
#line 1449 "lib/OpenGL/V1.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_OpenGL_glTexImage1D_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glTexImage1D_s)
{
    dVAR; dXSARGS;
    if (items != 8)
       croak_xs_usage(cv,  "target, level, internalformat, width, border, format, type, pixels");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	level = (int)SvIV(ST(1))
;
	GLint	internalformat = (int)SvIV(ST(2))
;
	GLsizei	width = (int)SvIV(ST(3))
;
	GLint	border = (int)SvIV(ST(4))
;
	GLenum	format = (int)SvIV(ST(5))
;
	GLenum	type = (int)SvIV(ST(6))
;
	SV *	pixels = ST(7)
;
#line 809 "lib/OpenGL/V1.xs"
	{
	GLvoid * ptr = ELI(pixels, width, 1, format, type,
		gl_pixelbuffer_unpack);
	glTexImage1D(target, level, internalformat,
		width, border, format, type, ptr);
	}
#line 1486 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glTexImage1D_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glTexImage1D_p)
{
    dVAR; dXSARGS;
    if (items < 7)
       croak_xs_usage(cv,  "target, level, internalformat, width, border, format, type, ...");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	level = (int)SvIV(ST(1))
;
	GLint	internalformat = (int)SvIV(ST(2))
;
	GLsizei	width = (int)SvIV(ST(3))
;
	GLint	border = (int)SvIV(ST(4))
;
	GLenum	format = (int)SvIV(ST(5))
;
	GLenum	type = (int)SvIV(ST(6))
;
#line 828 "lib/OpenGL/V1.xs"
	{
	GLvoid * ptr;
	glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
	glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
	glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
	ptr = pack_image_ST(&(ST(7)), items-7, width, 1, 1, format, type, 0);
	glTexImage1D(target, level, internalformat,
		width, border, format, type, ptr);
	glPopClientAttrib();
	free(ptr);
	}
#line 1525 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glTexImage2D_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glTexImage2D_s)
{
    dVAR; dXSARGS;
    if (items != 9)
       croak_xs_usage(cv,  "target, level, internalformat, width, height, border, format, type, pixels");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	level = (int)SvIV(ST(1))
;
	GLint	internalformat = (int)SvIV(ST(2))
;
	GLsizei	width = (int)SvIV(ST(3))
;
	GLsizei	height = (int)SvIV(ST(4))
;
	GLint	border = (int)SvIV(ST(5))
;
	GLenum	format = (int)SvIV(ST(6))
;
	GLenum	type = (int)SvIV(ST(7))
;
	SV *	pixels = ST(8)
;
#line 854 "lib/OpenGL/V1.xs"
	{
		GLvoid * ptr = NULL;
		if (pixels)
		{
			ptr = ELI(pixels, width, height,
				format, type, gl_pixelbuffer_unpack);
		}
		glTexImage2D(target, level, internalformat,
			width, height, border, format, type, ptr);
	}
#line 1567 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glTexImage2D_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glTexImage2D_p)
{
    dVAR; dXSARGS;
    if (items < 8)
       croak_xs_usage(cv,  "target, level, internalformat, width, height, border, format, type, ...");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	level = (int)SvIV(ST(1))
;
	GLint	internalformat = (int)SvIV(ST(2))
;
	GLsizei	width = (int)SvIV(ST(3))
;
	GLsizei	height = (int)SvIV(ST(4))
;
	GLint	border = (int)SvIV(ST(5))
;
	GLenum	format = (int)SvIV(ST(6))
;
	GLenum	type = (int)SvIV(ST(7))
;
#line 878 "lib/OpenGL/V1.xs"
	{
	GLvoid * ptr;
	glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
	glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
	glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
	ptr = pack_image_ST(&(ST(8)), items-8, width, height,
		1, format, type, 0);
	glTexImage2D(target, level, internalformat,
		width, height, border, format, type, ptr);
	glPopClientAttrib();
	free(ptr);
	}
#line 1609 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}

#ifdef GL_VERSION_1_2
#define XSubPPtmpAAAE 1


XS_EUPXS(XS_OpenGL_glTexImage3D_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glTexImage3D_s)
{
    dVAR; dXSARGS;
    if (items != 10)
       croak_xs_usage(cv,  "target, level, internalformat, width, height, depth, border, format, type, pixels");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	level = (int)SvIV(ST(1))
;
	GLint	internalformat = (int)SvIV(ST(2))
;
	GLsizei	width = (int)SvIV(ST(3))
;
	GLsizei	height = (int)SvIV(ST(4))
;
	GLsizei	depth = (int)SvIV(ST(5))
;
	GLint	border = (int)SvIV(ST(6))
;
	GLenum	format = (int)SvIV(ST(7))
;
	GLenum	type = (int)SvIV(ST(8))
;
	SV *	pixels = ST(9)
;
#line 908 "lib/OpenGL/V1.xs"
		loadProc(glTexImage3D,"glTexImage3D");
#line 1647 "lib/OpenGL/V1.c"
#line 910 "lib/OpenGL/V1.xs"
	{
		GLvoid * ptr = ELI(pixels, width, height, format,
			type, gl_pixelbuffer_unpack);
		glTexImage3D(target, level, internalformat,
			width, height, depth, border, format, type, ptr);
	}
#line 1655 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glTexImage3D_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glTexImage3D_p)
{
    dVAR; dXSARGS;
    if (items < 9)
       croak_xs_usage(cv,  "target, level, internalformat, width, height, depth, border, format, type, ...");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	level = (int)SvIV(ST(1))
;
	GLint	internalformat = (int)SvIV(ST(2))
;
	GLsizei	width = (int)SvIV(ST(3))
;
	GLsizei	height = (int)SvIV(ST(4))
;
	GLsizei	depth = (int)SvIV(ST(5))
;
	GLint	border = (int)SvIV(ST(6))
;
	GLenum	format = (int)SvIV(ST(7))
;
	GLenum	type = (int)SvIV(ST(8))
;
#line 931 "lib/OpenGL/V1.xs"
		loadProc(glTexImage3D,"glTexImage3D");
#line 1688 "lib/OpenGL/V1.c"
#line 933 "lib/OpenGL/V1.xs"
	{
		GLvoid * ptr;
		glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
		glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
		glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
		ptr = pack_image_ST(&(ST(9)), items-9, width, height,
			depth, format, type, 0);
		glTexImage3D(target, level, internalformat,
			width, height, depth, border, format, type, ptr);
		glPopClientAttrib();
		free(ptr);
	}
#line 1702 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}

#endif
#ifdef GL_VERSION_1_1
#define XSubPPtmpAAAF 1


XS_EUPXS(XS_OpenGL_glTexSubImage1D_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glTexSubImage1D_s)
{
    dVAR; dXSARGS;
    if (items != 7)
       croak_xs_usage(cv,  "target, level, xoffset, width, format, type, pixels");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	level = (int)SvIV(ST(1))
;
	GLint	xoffset = (int)SvIV(ST(2))
;
	GLsizei	width = (int)SvIV(ST(3))
;
	GLenum	format = (int)SvIV(ST(4))
;
	GLenum	type = (int)SvIV(ST(5))
;
	SV *	pixels = ST(6)
;
#line 962 "lib/OpenGL/V1.xs"
	{
	GLvoid * ptr = ELI(pixels, width, 1, format, type, gl_pixelbuffer_unpack);
	glTexSubImage1D(target, level, xoffset, width, format, type, ptr);
	}
#line 1738 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glTexSubImage1D_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glTexSubImage1D_p)
{
    dVAR; dXSARGS;
    if (items < 6)
       croak_xs_usage(cv,  "target, level, xoffset, width, format, type, ...");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	level = (int)SvIV(ST(1))
;
	GLint	xoffset = (int)SvIV(ST(2))
;
	GLsizei	width = (int)SvIV(ST(3))
;
	GLenum	format = (int)SvIV(ST(4))
;
	GLenum	type = (int)SvIV(ST(5))
;
#line 978 "lib/OpenGL/V1.xs"
	{
	GLvoid * ptr;
	glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
	glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
	glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
	ptr = pack_image_ST(&(ST(7)), items-7, width, 1, 1, format, type, 0);
	glTexSubImage1D(target, level, xoffset, width, format, type, ptr);
	glPopClientAttrib();
	free(ptr);
	}
#line 1774 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glTexSubImage2D_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glTexSubImage2D_s)
{
    dVAR; dXSARGS;
    if (items != 9)
       croak_xs_usage(cv,  "target, level, xoffset, yoffset, width, height, format, type, pixels");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	level = (int)SvIV(ST(1))
;
	GLint	xoffset = (int)SvIV(ST(2))
;
	GLint	yoffset = (int)SvIV(ST(3))
;
	GLsizei	width = (int)SvIV(ST(4))
;
	GLsizei	height = (int)SvIV(ST(5))
;
	GLenum	format = (int)SvIV(ST(6))
;
	GLenum	type = (int)SvIV(ST(7))
;
	SV *	pixels = ST(8)
;
#line 1003 "lib/OpenGL/V1.xs"
	{
	GLvoid * ptr = ELI(pixels, width, height,
		format, type, gl_pixelbuffer_unpack);
	glTexSubImage2D(target, level, xoffset, yoffset,
		width, height, format, type, ptr);
	}
#line 1812 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glTexSubImage2D_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glTexSubImage2D_p)
{
    dVAR; dXSARGS;
    if (items < 8)
       croak_xs_usage(cv,  "target, level, xoffset, yoffset, width, height, format, type, ...");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	level = (int)SvIV(ST(1))
;
	GLint	xoffset = (int)SvIV(ST(2))
;
	GLint	yoffset = (int)SvIV(ST(3))
;
	GLsizei	width = (int)SvIV(ST(4))
;
	GLsizei	height = (int)SvIV(ST(5))
;
	GLenum	format = (int)SvIV(ST(6))
;
	GLenum	type = (int)SvIV(ST(7))
;
#line 1023 "lib/OpenGL/V1.xs"
	{
	GLvoid * ptr;
	glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
	glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
	glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
	ptr = pack_image_ST(&(ST(8)), items-8, width, height, 1,
		format, type, 0);
	glTexSubImage2D(target, level, xoffset, yoffset,
		width, height, format, type, ptr);
	glPopClientAttrib();
	free(ptr);
	}
#line 1854 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}

#ifdef GL_VERSION_1_2
#define XSubPPtmpAAAG 1


XS_EUPXS(XS_OpenGL_glTexSubImage3D_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glTexSubImage3D_s)
{
    dVAR; dXSARGS;
    if (items != 11)
       croak_xs_usage(cv,  "target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	level = (int)SvIV(ST(1))
;
	GLint	xoffset = (int)SvIV(ST(2))
;
	GLint	yoffset = (int)SvIV(ST(3))
;
	GLint	zoffset = (int)SvIV(ST(4))
;
	GLsizei	width = (int)SvIV(ST(5))
;
	GLsizei	height = (int)SvIV(ST(6))
;
	GLsizei	depth = (int)SvIV(ST(7))
;
	GLenum	format = (int)SvIV(ST(8))
;
	GLenum	type = (int)SvIV(ST(9))
;
	SV *	pixels = ST(10)
;
#line 1054 "lib/OpenGL/V1.xs"
		loadProc(glTexSubImage3D,"glTexSubImage3D");
#line 1894 "lib/OpenGL/V1.c"
#line 1056 "lib/OpenGL/V1.xs"
	{
		GLvoid * ptr = ELI(pixels, width, height,
			format, type, gl_pixelbuffer_unpack);
		glTexSubImage3D(target, level, xoffset, yoffset, zoffset,
			width, height, depth, format, type, ptr);
	}
#line 1902 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glTexSubImage3D_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glTexSubImage3D_p)
{
    dVAR; dXSARGS;
    if (items < 10)
       croak_xs_usage(cv,  "target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, ...");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	level = (int)SvIV(ST(1))
;
	GLint	xoffset = (int)SvIV(ST(2))
;
	GLint	yoffset = (int)SvIV(ST(3))
;
	GLint	zoffset = (int)SvIV(ST(4))
;
	GLsizei	width = (int)SvIV(ST(5))
;
	GLsizei	height = (int)SvIV(ST(6))
;
	GLsizei	depth = (int)SvIV(ST(7))
;
	GLenum	format = (int)SvIV(ST(8))
;
	GLenum	type = (int)SvIV(ST(9))
;
#line 1078 "lib/OpenGL/V1.xs"
		loadProc(glTexSubImage3D,"glTexSubImage3D");
#line 1937 "lib/OpenGL/V1.c"
#line 1080 "lib/OpenGL/V1.xs"
	{
		GLvoid * ptr;
		glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
		glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
		glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
		ptr = pack_image_ST(&(ST(10)), items-10, width, height,
			depth, format, type, 0);
		glTexSubImage3D(target, level, xoffset, yoffset, zoffset,
			width, height, depth, format, type, ptr);
		glPopClientAttrib();
		free(ptr);
	}
#line 1951 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}

#endif
#endif
#if defined(GL_VERSION_1_1) || defined(GL_EXT_vertex_array)
#define XSubPPtmpAAAH 1


XS_EUPXS(XS_OpenGL_glVertexPointerEXT_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glVertexPointerEXT_s)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "size, type, stride, count, pointer");
    {
	GLint	size = (int)SvIV(ST(0))
;
	GLenum	type = (int)SvIV(ST(1))
;
	GLsizei	stride = (int)SvIV(ST(2))
;
	GLsizei	count = (int)SvIV(ST(3))
;
	SV *	pointer = ST(4)
;
#line 1108 "lib/OpenGL/V1.xs"
#ifndef GL_VERSION_1_1 // GL_EXT_vertex_array
		loadProc(glVertexPointerEXT,"glVertexPointerEXT");
#endif
#line 1983 "lib/OpenGL/V1.c"
#line 1112 "lib/OpenGL/V1.xs"
	{
		int width = stride ? stride : (sizeof(type)*size);
		void * pointer_s = EL(pointer, width*count);
#ifdef GL_VERSION_1_1
		glVertexPointer(size, type, stride, pointer_s);
#else // GL_EXT_vertex_array
		glVertexPointerEXT(size, type, stride, count, pointer_s);
#endif
	}
#line 1994 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glVertexPointerEXT_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glVertexPointerEXT_p)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "size, oga");
    {
	GLint	size = (int)SvIV(ST(0))
;
	OpenGL__Array	oga;

	if (SvROK(ST(1)) && sv_derived_from(ST(1), "OpenGL::Array")) {
	    IV tmp = SvIV((SV*)SvRV(ST(1)));
	    oga = INT2PTR(OpenGL__Array,tmp);
	}
	else {
		const char* refstr = SvROK(ST(1)) ? "" : SvOK(ST(1)) ? "scalar " : "undef";
	    Perl_croak_nocontext("%s: Expected %s to be of type %s; got %s%" SVf " instead",
			GvNAME(CvGV(cv)),
			"oga", "OpenGL::Array",
			refstr, ST(1)
		);
	}
;
#line 1133 "lib/OpenGL/V1.xs"
#ifndef GL_VERSION_1_1 // GL_EXT_vertex_array
		loadProc(glVertexPointerEXT,"glVertexPointerEXT");
#endif
#ifdef GL_VERSION_2_0
		loadProc(glBindBufferARB,"glBindBufferARB");
#endif
#line 2032 "lib/OpenGL/V1.c"
#line 1140 "lib/OpenGL/V1.xs"
	{
		GLvoid * data = oga->data;
#ifdef GL_VERSION_2_0
		glBindBufferARB(GL_ARRAY_BUFFER, oga->bind);
		if (oga->bind) data = NULL;
#elif defined(GL_ARB_vertex_buffer_object)
		if (testProc(glBindBufferARB,"glBindBufferARB"))
		{
			glBindBufferARB(GL_ARRAY_BUFFER_ARB, oga->bind);
			if (oga->bind) data = NULL;
		}
#endif
#ifdef GL_VERSION_1_1
		glVertexPointer(size, oga->types[0], 0, data);
#else // GL_EXT_vertex_array
		glVertexPointerEXT(size, oga->types[0], 0, oga->item_count/size, data);
#endif
	}
#line 2052 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glNormalPointerEXT_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glNormalPointerEXT_s)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "size, type, stride, count, pointer");
    {
	GLint	size = (int)SvIV(ST(0))
;
	GLenum	type = (int)SvIV(ST(1))
;
	GLsizei	stride = (int)SvIV(ST(2))
;
	GLsizei	count = (int)SvIV(ST(3))
;
	SV *	pointer = ST(4)
;
#line 1168 "lib/OpenGL/V1.xs"
#ifndef GL_VERSION_1_1 // GL_EXT_vertex_array
		loadProc(glNormalPointerEXT,"glNormalPointerEXT");
#endif
#line 2079 "lib/OpenGL/V1.c"
#line 1172 "lib/OpenGL/V1.xs"
	{
		int width = stride ? stride : (sizeof(type)*size);
		void * pointer_s = EL(pointer, width*count);
#ifdef GL_VERSION_1_1
		glNormalPointer(type, stride, pointer_s);
#else // GL_EXT_vertex_array
		glNormalPointerEXT(type, stride, count, pointer_s);
#endif
	}
#line 2090 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glNormalPointer_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glNormalPointer_p)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "oga");
    {
	OpenGL__Array	oga;

	if (SvROK(ST(0)) && sv_derived_from(ST(0), "OpenGL::Array")) {
	    IV tmp = SvIV((SV*)SvRV(ST(0)));
	    oga = INT2PTR(OpenGL__Array,tmp);
	}
	else {
		const char* refstr = SvROK(ST(0)) ? "" : SvOK(ST(0)) ? "scalar " : "undef";
	    Perl_croak_nocontext("%s: Expected %s to be of type %s; got %s%" SVf " instead",
			GvNAME(CvGV(cv)),
			"oga", "OpenGL::Array",
			refstr, ST(0)
		);
	}
;
#line 1192 "lib/OpenGL/V1.xs"
#ifndef GL_VERSION_1_1 // GL_EXT_vertex_array
		loadProc(glNormalPointerEXT,"glNormalPointerEXT");
#endif
#ifdef GL_VERSION_2_0
		loadProc(glBindBufferARB,"glBindBufferARB");
#endif
#line 2126 "lib/OpenGL/V1.c"
#line 1199 "lib/OpenGL/V1.xs"
	{
		GLvoid * data = oga->data;
#ifdef GL_VERSION_2_0
		glBindBufferARB(GL_ARRAY_BUFFER, oga->bind);
		if (oga->bind) data = NULL;
#elif defined(GL_ARB_vertex_buffer_object)
		if (testProc(glBindBufferARB,"glBindBufferARB"))
		{
			glBindBufferARB(GL_ARRAY_BUFFER_ARB, oga->bind);
			if (oga->bind) data = NULL;
		}
#endif
#ifdef GL_VERSION_1_1
		glNormalPointer(oga->types[0], 0, data);
#else // GL_EXT_vertex_array
		glNormalPointerEXT(oga->types[0], 0, oga->item_count/3, data);
#endif
	}
#line 2146 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glColorPointerEXT_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glColorPointerEXT_s)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "size, type, stride, count, pointer");
    {
	GLint	size = (int)SvIV(ST(0))
;
	GLenum	type = (int)SvIV(ST(1))
;
	GLsizei	stride = (int)SvIV(ST(2))
;
	GLsizei	count = (int)SvIV(ST(3))
;
	SV *	pointer = ST(4)
;
#line 1227 "lib/OpenGL/V1.xs"
#ifndef GL_VERSION_1_1 // GL_EXT_vertex_array
		loadProc(glColorPointerEXT,"glColorPointerEXT");
#endif
#line 2173 "lib/OpenGL/V1.c"
#line 1231 "lib/OpenGL/V1.xs"
	{
		int width = stride ? stride : (sizeof(type)*size);
		void * pointer_s = EL(pointer, width*count);
#ifdef GL_VERSION_1_1
		glColorPointer(size, type, stride, pointer_s);
#else // GL_EXT_vertex_array
		glColorPointerEXT(size, type, stride, count, pointer_s);
#endif
	}
#line 2184 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glColorPointer_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glColorPointer_p)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "size, oga");
    {
	GLint	size = (int)SvIV(ST(0))
;
	OpenGL__Array	oga;

	if (SvROK(ST(1)) && sv_derived_from(ST(1), "OpenGL::Array")) {
	    IV tmp = SvIV((SV*)SvRV(ST(1)));
	    oga = INT2PTR(OpenGL__Array,tmp);
	}
	else {
		const char* refstr = SvROK(ST(1)) ? "" : SvOK(ST(1)) ? "scalar " : "undef";
	    Perl_croak_nocontext("%s: Expected %s to be of type %s; got %s%" SVf " instead",
			GvNAME(CvGV(cv)),
			"oga", "OpenGL::Array",
			refstr, ST(1)
		);
	}
;
#line 1252 "lib/OpenGL/V1.xs"
#ifndef GL_VERSION_1_1 // GL_EXT_vertex_array
		loadProc(glColorPointerEXT,"glColorPointerEXT");
#endif
#ifdef GL_VERSION_2_0
		loadProc(glBindBufferARB,"glBindBufferARB");
#endif
#line 2222 "lib/OpenGL/V1.c"
#line 1259 "lib/OpenGL/V1.xs"
	{
		GLvoid * data = oga->data;
#ifdef GL_VERSION_2_0
		glBindBufferARB(GL_ARRAY_BUFFER, oga->bind);
		if (oga->bind) data = NULL;
#elif defined(GL_ARB_vertex_buffer_object)
		if (testProc(glBindBufferARB,"glBindBufferARB"))
		{
			glBindBufferARB(GL_ARRAY_BUFFER_ARB, oga->bind);
			if (oga->bind) data = NULL;
		}
#endif
#ifdef GL_VERSION_1_1
		glColorPointer(size, oga->types[0], 0, data);
#else // GL_EXT_vertex_array
		glColorPointerEXT(size, oga->types[0], 0, oga->item_count/size, data);
#endif
	}
#line 2242 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glIndexPointerEXT_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glIndexPointerEXT_s)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "size, type, stride, count, pointer");
    {
	GLint	size = (int)SvIV(ST(0))
;
	GLenum	type = (int)SvIV(ST(1))
;
	GLsizei	stride = (int)SvIV(ST(2))
;
	GLsizei	count = (int)SvIV(ST(3))
;
	SV *	pointer = ST(4)
;
#line 1287 "lib/OpenGL/V1.xs"
#ifndef GL_VERSION_1_1 // GL_EXT_vertex_array
		loadProc(glIndexPointerEXT,"glIndexPointerEXT");
#endif
#line 2269 "lib/OpenGL/V1.c"
#line 1291 "lib/OpenGL/V1.xs"
	{
		int width = stride ? stride : (sizeof(type)*size);
		void * pointer_s = EL(pointer, width*count);
#ifdef GL_VERSION_1_1
		glIndexPointer(type, stride, pointer_s);
#else // GL_EXT_vertex_array
		glIndexPointerEXT(type, stride, count, pointer_s);
#endif
	}
#line 2280 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glIndexPointer_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glIndexPointer_p)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "oga");
    {
	OpenGL__Array	oga;

	if (SvROK(ST(0)) && sv_derived_from(ST(0), "OpenGL::Array")) {
	    IV tmp = SvIV((SV*)SvRV(ST(0)));
	    oga = INT2PTR(OpenGL__Array,tmp);
	}
	else {
		const char* refstr = SvROK(ST(0)) ? "" : SvOK(ST(0)) ? "scalar " : "undef";
	    Perl_croak_nocontext("%s: Expected %s to be of type %s; got %s%" SVf " instead",
			GvNAME(CvGV(cv)),
			"oga", "OpenGL::Array",
			refstr, ST(0)
		);
	}
;
#line 1311 "lib/OpenGL/V1.xs"
#ifndef GL_VERSION_1_1 // GL_EXT_vertex_array
		loadProc(glIndexPointerEXT,"glIndexPointerEXT");
#endif
#ifdef GL_VERSION_2_0
		loadProc(glBindBufferARB,"glBindBufferARB");
#endif
#line 2316 "lib/OpenGL/V1.c"
#line 1318 "lib/OpenGL/V1.xs"
	{
		GLvoid * data = oga->data;
#ifdef GL_VERSION_2_0
		glBindBufferARB(GL_ARRAY_BUFFER, oga->bind);
		if (oga->bind) data = NULL;
#elif defined(GL_ARB_vertex_buffer_object)
		if (testProc(glBindBufferARB,"glBindBufferARB"))
		{
			glBindBufferARB(GL_ARRAY_BUFFER_ARB, oga->bind);
			if (oga->bind) data = NULL;
		}
#endif
#ifdef GL_VERSION_1_1
		glIndexPointer(oga->types[0], 0, data);
#else // GL_EXT_vertex_array
		glIndexPointerEXT(oga->types[0], 0, oga->item_count, data);
#endif
	}
#line 2336 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glTexCoordPointerEXT_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glTexCoordPointerEXT_s)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "size, type, stride, count, pointer");
    {
	GLint	size = (int)SvIV(ST(0))
;
	GLenum	type = (int)SvIV(ST(1))
;
	GLsizei	stride = (int)SvIV(ST(2))
;
	GLsizei	count = (int)SvIV(ST(3))
;
	SV *	pointer = ST(4)
;
#line 1346 "lib/OpenGL/V1.xs"
#ifndef GL_VERSION_1_1 // GL_EXT_vertex_array
		loadProc(glTexCoordPointerEXT,"glTexCoordPointerEXT");
#endif
#line 2363 "lib/OpenGL/V1.c"
#line 1350 "lib/OpenGL/V1.xs"
	{
		int width = stride ? stride : (sizeof(type)*size);
		void * pointer_s = EL(pointer, width*count);
#ifdef GL_VERSION_1_1
		glTexCoordPointer(size, type, stride, pointer_s);
#else // GL_EXT_vertex_array
		glTexCoordPointerEXT(size, type, stride, count, pointer_s);
#endif
	}
#line 2374 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glTexCoordPointer_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glTexCoordPointer_p)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 2)
       croak_xs_usage(cv,  "size, oga");
    {
	GLint	size = (int)SvIV(ST(0))
;
	OpenGL__Array	oga;

	if (SvROK(ST(1)) && sv_derived_from(ST(1), "OpenGL::Array")) {
	    IV tmp = SvIV((SV*)SvRV(ST(1)));
	    oga = INT2PTR(OpenGL__Array,tmp);
	}
	else {
		const char* refstr = SvROK(ST(1)) ? "" : SvOK(ST(1)) ? "scalar " : "undef";
	    Perl_croak_nocontext("%s: Expected %s to be of type %s; got %s%" SVf " instead",
			GvNAME(CvGV(cv)),
			"oga", "OpenGL::Array",
			refstr, ST(1)
		);
	}
;
#line 1371 "lib/OpenGL/V1.xs"
#ifndef GL_VERSION_1_1 // GL_EXT_vertex_array
		loadProc(glTexCoordPointerEXT,"glTexCoordPointerEXT");
#endif
#ifdef GL_VERSION_2_0
		loadProc(glBindBufferARB,"glBindBufferARB");
#endif
#line 2412 "lib/OpenGL/V1.c"
#line 1378 "lib/OpenGL/V1.xs"
	{
		GLvoid * data = oga->data;
#ifdef GL_VERSION_2_0
		glBindBufferARB(GL_ARRAY_BUFFER, oga->bind);
		if (oga->bind) data = NULL;
#elif defined(GL_ARB_vertex_buffer_object)
		if (testProc(glBindBufferARB,"glBindBufferARB"))
		{
			glBindBufferARB(GL_ARRAY_BUFFER_ARB, oga->bind);
			if (oga->bind) data = NULL;
		}
#endif
#ifdef GL_VERSION_1_1
		glTexCoordPointer(size, oga->types[0], 0, data);
#else // GL_EXT_vertex_array
		glTexCoordPointerEXT(size, oga->types[0], 0, oga->item_count/size, data);
#endif
	}
#line 2432 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glEdgeFlagPointerEXT_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glEdgeFlagPointerEXT_s)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "size, type, stride, count, pointer");
    {
	GLint	size = (int)SvIV(ST(0))
;
	GLenum	type = (int)SvIV(ST(1))
;
	GLsizei	stride = (int)SvIV(ST(2))
;
	GLsizei	count = (int)SvIV(ST(3))
;
	SV *	pointer = ST(4)
;
#line 1406 "lib/OpenGL/V1.xs"
#ifndef GL_VERSION_1_1 // GL_EXT_vertex_array
		loadProc(glTexCoordPointerEXT,"glEdgeFlagPointerEXT");
#endif
#line 2459 "lib/OpenGL/V1.c"
#line 1410 "lib/OpenGL/V1.xs"
	{
		int width = stride ? stride : (sizeof(type)*size);
		void * pointer_s = EL(pointer, width*count);
#ifdef GL_VERSION_1_1
		glEdgeFlagPointer(stride, pointer_s);
#else // GL_EXT_vertex_array
		glEdgeFlagPointerEXT(stride, count, pointer_s);
#endif
	}
#line 2470 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glEdgeFlagPointer_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glEdgeFlagPointer_p)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 1)
       croak_xs_usage(cv,  "oga");
    {
	OpenGL__Array	oga;

	if (SvROK(ST(0)) && sv_derived_from(ST(0), "OpenGL::Array")) {
	    IV tmp = SvIV((SV*)SvRV(ST(0)));
	    oga = INT2PTR(OpenGL__Array,tmp);
	}
	else {
		const char* refstr = SvROK(ST(0)) ? "" : SvOK(ST(0)) ? "scalar " : "undef";
	    Perl_croak_nocontext("%s: Expected %s to be of type %s; got %s%" SVf " instead",
			GvNAME(CvGV(cv)),
			"oga", "OpenGL::Array",
			refstr, ST(0)
		);
	}
;
#line 1430 "lib/OpenGL/V1.xs"
#ifndef GL_VERSION_1_1 // GL_EXT_vertex_array
		loadProc(glTexCoordPointerEXT,"glEdgeFlagPointerEXT");
#endif
#ifdef GL_VERSION_2_0
		loadProc(glBindBufferARB,"glBindBufferARB");
#endif
#line 2506 "lib/OpenGL/V1.c"
#line 1437 "lib/OpenGL/V1.xs"
	{
		GLvoid * data = oga->data;
#ifdef GL_VERSION_2_0
		glBindBufferARB(GL_ARRAY_BUFFER, oga->bind);
		if (oga->bind) data = NULL;
#elif defined(GL_ARB_vertex_buffer_object)
		if (testProc(glBindBufferARB,"glBindBufferARB"))
		{
			glBindBufferARB(GL_ARRAY_BUFFER_ARB, oga->bind);
			if (oga->bind) data = NULL;
		}
#endif
#ifdef GL_VERSION_1_1
		glEdgeFlagPointer(0, data);
#else // GL_EXT_vertex_array
		glEdgeFlagPointerEXT(0, oga->item_count, data);
#endif
	}
#line 2526 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}

#endif // GL_EXT_vertex_array || GL_VERSION_1_1
#ifdef GL_VERSION_1_1
#define XSubPPtmpAAAI 1


XS_EUPXS(XS_OpenGL_glVertexPointer_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glVertexPointer_s)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "size, type, stride, pointer");
    {
	GLint	size = (int)SvIV(ST(0))
;
	GLenum	type = (int)SvIV(ST(1))
;
	GLsizei	stride = (int)SvIV(ST(2))
;
	SV *	pointer = ST(3)
;
#line 1469 "lib/OpenGL/V1.xs"
	{
		int width = stride ? stride : (sizeof(type)*size);
		void * pointer_s = NULL;
		if ( pointer ) {
			pointer_s = EL(pointer, width);
		}
		glVertexPointer(size, type, stride, pointer_s);
	}
#line 2560 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glNormalPointer_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glNormalPointer_s)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "type, stride, pointer");
    {
	GLenum	type = (int)SvIV(ST(0))
;
	GLsizei	stride = (int)SvIV(ST(1))
;
	SV *	pointer = ST(2)
;
#line 1485 "lib/OpenGL/V1.xs"
	{
		int size = gl_type_size(type);
		if (size < 0) croak("unknown type");
		int width = stride ? stride : (size*3);
		void * pointer_s = NULL;
		if ( pointer ) {
			pointer_s = EL(pointer, width);
		}
		glNormalPointer(type, stride, pointer_s);
	}
#line 2590 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glColorPointer_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glColorPointer_s)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "size, type, stride, pointer");
    {
	GLint	size = (int)SvIV(ST(0))
;
	GLenum	type = (int)SvIV(ST(1))
;
	GLsizei	stride = (int)SvIV(ST(2))
;
	SV *	pointer = ST(3)
;
#line 1504 "lib/OpenGL/V1.xs"
	{
		int width = stride ? stride : (sizeof(type)*size);
		void * pointer_s = NULL;
		if ( pointer ) {
			pointer_s = EL(pointer, width);
		}
		glColorPointer(size, type, stride, pointer_s);
	}
#line 2620 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glIndexPointer_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glIndexPointer_s)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "type, stride, pointer");
    {
	GLenum	type = (int)SvIV(ST(0))
;
	GLsizei	stride = (int)SvIV(ST(1))
;
	SV *	pointer = ST(2)
;
#line 1520 "lib/OpenGL/V1.xs"
	{
		int size = gl_type_size(type);
		if (size < 0) croak("unknown type");
		int width = stride ? stride : size;
		void * pointer_s = NULL;
		if ( pointer ) {
			pointer_s = EL(pointer, width);
		}
		glIndexPointer(type, stride, pointer_s);
	}
#line 2650 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glTexCoordPointer_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glTexCoordPointer_s)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "size, type, stride, pointer");
    {
	GLint	size = (int)SvIV(ST(0))
;
	GLenum	type = (int)SvIV(ST(1))
;
	GLsizei	stride = (int)SvIV(ST(2))
;
	SV *	pointer = ST(3)
;
#line 1539 "lib/OpenGL/V1.xs"
	{
		int width = stride ? stride : (sizeof(type)*size);
		void * pointer_s = NULL;
		if ( pointer ) {
			pointer_s = EL(pointer, width);
		}
		glTexCoordPointer(size, type, stride, pointer_s);
	}
#line 2680 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glEdgeFlagPointer_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glEdgeFlagPointer_s)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "stride, pointer");
    {
	GLsizei	stride = (int)SvIV(ST(0))
;
	SV *	pointer = ST(1)
;
#line 1554 "lib/OpenGL/V1.xs"
	{
		int width = stride ? stride : sizeof(GLboolean);
		void * pointer_s = NULL;
		if ( pointer ) {
			pointer_s = EL(pointer, width);
		}
		glEdgeFlagPointer(stride, pointer_s);
	}
#line 2706 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}

#endif // GL_VERSION_1_1
#ifdef GL_VERSION_1_4
#define XSubPPtmpAAAJ 1


XS_EUPXS(XS_OpenGL_glBufferData_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glBufferData_s)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "target, size, data, usage");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLsizei	size = (int)SvIV(ST(1))
;
	SV *	data = ST(2)
;
	GLenum	usage = (int)SvIV(ST(3))
;
#line 1575 "lib/OpenGL/V1.xs"
	{
		void * data_s = EL(data, size);
		glBufferData(target,size,data_s,usage);
	}
#line 2736 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glBufferData_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glBufferData_p)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 3)
       croak_xs_usage(cv,  "target, oga, usage");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	OpenGL__Array	oga;
	GLenum	usage = (int)SvIV(ST(2))
;

	if (SvROK(ST(1)) && sv_derived_from(ST(1), "OpenGL::Array")) {
	    IV tmp = SvIV((SV*)SvRV(ST(1)));
	    oga = INT2PTR(OpenGL__Array,tmp);
	}
	else {
		const char* refstr = SvROK(ST(1)) ? "" : SvOK(ST(1)) ? "scalar " : "undef";
	    Perl_croak_nocontext("%s: Expected %s to be of type %s; got %s%" SVf " instead",
			GvNAME(CvGV(cv)),
			"oga", "OpenGL::Array",
			refstr, ST(1)
		);
	}
;
#line 1589 "lib/OpenGL/V1.xs"
	{
		glBufferData(target,oga->data_length,oga->data,usage);
	}
#line 2773 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glBufferSubData_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glBufferSubData_s)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "target, offset, size, data");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	offset = (int)SvIV(ST(1))
;
	GLsizei	size = (int)SvIV(ST(2))
;
	SV *	data = ST(3)
;
#line 1601 "lib/OpenGL/V1.xs"
	{
		void * data_s = EL(data, size);
		glBufferSubData(target,offset,size,data);
	}
#line 2799 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glBufferSubData_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glBufferSubData_p)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 3)
       croak_xs_usage(cv,  "target, offset, oga");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	offset = (int)SvIV(ST(1))
;
	OpenGL__Array	oga;

	if (SvROK(ST(2)) && sv_derived_from(ST(2), "OpenGL::Array")) {
	    IV tmp = SvIV((SV*)SvRV(ST(2)));
	    oga = INT2PTR(OpenGL__Array,tmp);
	}
	else {
		const char* refstr = SvROK(ST(2)) ? "" : SvOK(ST(2)) ? "scalar " : "undef";
	    Perl_croak_nocontext("%s: Expected %s to be of type %s; got %s%" SVf " instead",
			GvNAME(CvGV(cv)),
			"oga", "OpenGL::Array",
			refstr, ST(2)
		);
	}
;
#line 1615 "lib/OpenGL/V1.xs"
	{
		glBufferSubData(target,offset*oga->total_types_width,oga->data_length,oga->data);
	}
#line 2836 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetBufferSubData_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetBufferSubData_s)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "target, offset, size, data");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	offset = (int)SvIV(ST(1))
;
	GLsizei	size = (int)SvIV(ST(2))
;
	SV *	data = ST(3)
;
#line 1627 "lib/OpenGL/V1.xs"
	{
		GLubyte * data_s = EL(data,size);
		glGetBufferSubData(target,offset,size,data_s);
	}
#line 2862 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetBufferSubData_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetBufferSubData_p)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items < 3)
       croak_xs_usage(cv,  "target, offset, count, ...");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	offset = (int)SvIV(ST(1))
;
	GLsizei	count = (int)SvIV(ST(2))
;
	OpenGL__Array	RETVAL;
#line 1642 "lib/OpenGL/V1.xs"
	{
		oga_struct * oga = malloc(sizeof(oga_struct));
		GLint size;

		oga->item_count = count;
		oga->type_count = (items - 3);

				if (oga->type_count)
		{
			int i,j;

			oga->types = malloc(sizeof(GLenum) * oga->type_count);
			oga->type_offset = malloc(sizeof(GLint) * oga->type_count);
			for(i=0,j=0;i<oga->type_count;i++) {
				oga->types[i] = SvIV(ST(i+3));
				oga->type_offset[i] = j;
				int size = gl_type_size(oga->types[i]);
				if (size < 0) croak("unknown type");
				j += size;
			}
			oga->total_types_width = j;
		}
		else
		{
			oga->type_count = 1;
			oga->types = malloc(sizeof(GLenum) * oga->type_count);
			oga->type_offset = malloc(sizeof(GLint) * oga->type_count);

			oga->types[0] = GL_UNSIGNED_BYTE;
			oga->type_offset[0] = 0;
			int size = gl_type_size(oga->types[0]);
			if (size < 0) croak("unknown type");
			oga->total_types_width = size;
		}
		if (!oga->total_types_width) croak("Unable to determine type sizes\n");

		glGetBufferParameteriv(target,GL_BUFFER_SIZE,&size);
		size /= oga->total_types_width;
		if (offset > size) croak("Offset is greater than elements in buffer: %d\n",size);

		if ((offset+count) > size) count = size - offset;

		oga->data_length = oga->total_types_width * count;
		oga->data = malloc(oga->data_length);

		glGetBufferSubData(target,offset*oga->total_types_width,
			oga->data_length,oga->data);

		oga->free_data = 1;

		RETVAL = oga;
	}
#line 2936 "lib/OpenGL/V1.c"
	{
	    SV * RETVALSV;
	    RETVALSV = sv_newmortal();
	    sv_setref_pv(RETVALSV, "OpenGL::Array", (void*)RETVAL);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

#define FIXME /* !!! Need to refactor with glGetBufferPointerv_p */

XS_EUPXS(XS_OpenGL_glMapBuffer_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glMapBuffer_p)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items < 2)
       croak_xs_usage(cv,  "target, access, ...");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	access = (int)SvIV(ST(1))
;
	OpenGL__Array	RETVAL;
#line 1708 "lib/OpenGL/V1.xs"
	{
		GLsizeiptr size;
		oga_struct * oga;
		int i,j;

		void * buffer =	glMapBuffer(target,access);
		if (!buffer) croak("Unable to map buffer\n");

		glGetBufferParameteriv(target,GL_BUFFER_SIZE,(GLint*)&size);
		if (!size) croak("Buffer has no size\n");

		oga = malloc(sizeof(oga_struct));

		oga->type_count = (items - 2);

				if (oga->type_count)
		{
			oga->types = malloc(sizeof(GLenum) * oga->type_count);
			oga->type_offset = malloc(sizeof(GLint) * oga->type_count);
			for(i=0,j=0;i<oga->type_count;i++) {
				oga->types[i] = SvIV(ST(i+2));
				oga->type_offset[i] = j;
				int size = gl_type_size(oga->types[i]);
				if (size < 0) croak("unknown type");
				j += size;
			}
			oga->total_types_width = j;
		}
		else
		{
			oga->type_count = 1;
			oga->types = malloc(sizeof(GLenum) * oga->type_count);
			oga->type_offset = malloc(sizeof(GLint) * oga->type_count);

			oga->types[0] = GL_UNSIGNED_BYTE;
			oga->type_offset[0] = 0;
			int size = gl_type_size(oga->types[0]);
			if (size < 0) croak("unknown type");
			oga->total_types_width = size;
		}

		if (!oga->total_types_width) croak("Unable to determine type sizes\n");
		oga->item_count = size / oga->total_types_width;

		oga->data_length = oga->total_types_width * oga->item_count;

		oga->data = buffer;

		oga->free_data = 0;

		RETVAL = oga;
	}
#line 3015 "lib/OpenGL/V1.c"
	{
	    SV * RETVALSV;
	    RETVALSV = sv_newmortal();
	    sv_setref_pv(RETVALSV, "OpenGL::Array", (void*)RETVAL);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glGetBufferPointerv_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetBufferPointerv_s)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "target, pname, params");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	pname = (int)SvIV(ST(1))
;
	SV *	params = ST(2)
;
#line 1770 "lib/OpenGL/V1.xs"
	{
		void ** params_s = EL(params, sizeof(void*));
		glGetBufferPointerv(target,pname,params_s);
	}
#line 3045 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetBufferPointerv_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetBufferPointerv_p)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items < 2)
       croak_xs_usage(cv,  "target, pname, ...");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	pname = (int)SvIV(ST(1))
;
	OpenGL__Array	RETVAL;
#line 1784 "lib/OpenGL/V1.xs"
	{
		GLsizeiptr size;
		oga_struct * oga;
		void * buffer;
		int i,j;

		glGetBufferPointerv(target,pname,&buffer);
		if (!buffer) croak("Buffer is not mapped\n");

		glGetBufferParameteriv(target,GL_BUFFER_SIZE,(GLint*)&size);
		if (!size) croak("Buffer has no size\n");

		oga = malloc(sizeof(oga_struct));

		oga->type_count = (items - 2);

				if (oga->type_count)
		{
			oga->types = malloc(sizeof(GLenum) * oga->type_count);
			oga->type_offset = malloc(sizeof(GLint) * oga->type_count);
			for(i=0,j=0;i<oga->type_count;i++) {
				oga->types[i] = SvIV(ST(i+2));
				oga->type_offset[i] = j;
				int size = gl_type_size(oga->types[i]);
				if (size < 0) croak("unknown type");
				j += size;
			}
			oga->total_types_width = j;
		}
		else
		{
			oga->type_count = 1;
			oga->types = malloc(sizeof(GLenum) * oga->type_count);
			oga->type_offset = malloc(sizeof(GLint) * oga->type_count);

			oga->types[0] = GL_UNSIGNED_BYTE;
			oga->type_offset[0] = 0;
			int size = gl_type_size(oga->types[0]);
			if (size < 0) croak("unknown type");
			oga->total_types_width = size;
		}

		if (!oga->total_types_width) croak("Unable to determine type sizes\n");
		oga->item_count = size / oga->total_types_width;

		oga->data_length = oga->total_types_width * oga->item_count;

		oga->data = buffer;

		oga->free_data = 0;

		RETVAL = oga;
	}
#line 3118 "lib/OpenGL/V1.c"
	{
	    SV * RETVALSV;
	    RETVALSV = sv_newmortal();
	    sv_setref_pv(RETVALSV, "OpenGL::Array", (void*)RETVAL);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

#endif // GL_VERSION_1_4
#ifdef GL_VERSION_1_5
#define XSubPPtmpAAAK 1


XS_EUPXS(XS_OpenGL_glGetQueryObjectiv); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetQueryObjectiv)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "id, pname");
    {
	GLuint	id = (unsigned int)SvUV(ST(0))
;
	GLenum	pname = (int)SvIV(ST(1))
;
	GLint	RETVAL;
	dXSTARG;
#line 1850 "lib/OpenGL/V1.xs"
		loadProc(glGetQueryObjectiv,"glGetQueryObjectiv");
#line 3149 "lib/OpenGL/V1.c"
#line 1852 "lib/OpenGL/V1.xs"
		{
		GLint result;
		glGetQueryObjectiv(id, pname, &result);
		RETVAL = result;
		}
#line 3156 "lib/OpenGL/V1.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glGetQueryObjectuiv); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetQueryObjectuiv)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "id, pname");
    {
	GLuint	id = (unsigned int)SvUV(ST(0))
;
	GLenum	pname = (int)SvIV(ST(1))
;
	GLuint	RETVAL;
	dXSTARG;
#line 1866 "lib/OpenGL/V1.xs"
		loadProc(glGetQueryObjectuiv,"glGetQueryObjectuiv");
#line 3179 "lib/OpenGL/V1.c"
#line 1868 "lib/OpenGL/V1.xs"
		{
		GLuint result;
		glGetQueryObjectuiv(id, pname, &result);
		RETVAL = result;
		}
#line 3186 "lib/OpenGL/V1.c"
	XSprePUSH;
	PUSHu((UV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glGetQueryiv); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetQueryiv)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "target, pname");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	pname = (int)SvIV(ST(1))
;
	GLint	RETVAL;
	dXSTARG;
#line 1882 "lib/OpenGL/V1.xs"
		loadProc(glGetQueryiv,"glGetQueryiv");
#line 3209 "lib/OpenGL/V1.c"
#line 1884 "lib/OpenGL/V1.xs"
		{
		GLint result;
		glGetQueryiv(target, pname, &result);
		RETVAL = result;
		}
#line 3216 "lib/OpenGL/V1.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}

#endif // GL_VERSION_1_5
#ifdef GL_ARB_vertex_buffer_object
#define XSubPPtmpAAAL 1


XS_EUPXS(XS_OpenGL_glBufferDataARB_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glBufferDataARB_s)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "target, size, data, usage");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLsizei	size = (int)SvIV(ST(1))
;
	SV *	data = ST(2)
;
	GLenum	usage = (int)SvIV(ST(3))
;
#line 1904 "lib/OpenGL/V1.xs"
		loadProc(glBufferDataARB,"glBufferDataARB");
#line 3245 "lib/OpenGL/V1.c"
#line 1906 "lib/OpenGL/V1.xs"
	{
		void * data_s = EL(data, size);
		glBufferDataARB(target,size,data_s,usage);
	}
#line 3251 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glBufferDataARB_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glBufferDataARB_p)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 3)
       croak_xs_usage(cv,  "target, oga, usage");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	OpenGL__Array	oga;
	GLenum	usage = (int)SvIV(ST(2))
;

	if (SvROK(ST(1)) && sv_derived_from(ST(1), "OpenGL::Array")) {
	    IV tmp = SvIV((SV*)SvRV(ST(1)));
	    oga = INT2PTR(OpenGL__Array,tmp);
	}
	else {
		const char* refstr = SvROK(ST(1)) ? "" : SvOK(ST(1)) ? "scalar " : "undef";
	    Perl_croak_nocontext("%s: Expected %s to be of type %s; got %s%" SVf " instead",
			GvNAME(CvGV(cv)),
			"oga", "OpenGL::Array",
			refstr, ST(1)
		);
	}
;
#line 1920 "lib/OpenGL/V1.xs"
		loadProc(glBufferDataARB,"glBufferDataARB");
#line 3286 "lib/OpenGL/V1.c"
#line 1922 "lib/OpenGL/V1.xs"
	{
		glBufferDataARB(target,oga->data_length,oga->data,usage);
	}
#line 3291 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glBufferSubDataARB_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glBufferSubDataARB_s)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "target, offset, size, data");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	offset = (int)SvIV(ST(1))
;
	GLsizei	size = (int)SvIV(ST(2))
;
	SV *	data = ST(3)
;
#line 1934 "lib/OpenGL/V1.xs"
		loadProc(glBufferSubDataARB,"glBufferSubDataARB");
#line 3314 "lib/OpenGL/V1.c"
#line 1936 "lib/OpenGL/V1.xs"
	{
		void * data_s = EL(data, size);
		glBufferSubDataARB(target,offset,size,data);
	}
#line 3320 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glBufferSubDataARB_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glBufferSubDataARB_p)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items != 3)
       croak_xs_usage(cv,  "target, offset, oga");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	offset = (int)SvIV(ST(1))
;
	OpenGL__Array	oga;

	if (SvROK(ST(2)) && sv_derived_from(ST(2), "OpenGL::Array")) {
	    IV tmp = SvIV((SV*)SvRV(ST(2)));
	    oga = INT2PTR(OpenGL__Array,tmp);
	}
	else {
		const char* refstr = SvROK(ST(2)) ? "" : SvOK(ST(2)) ? "scalar " : "undef";
	    Perl_croak_nocontext("%s: Expected %s to be of type %s; got %s%" SVf " instead",
			GvNAME(CvGV(cv)),
			"oga", "OpenGL::Array",
			refstr, ST(2)
		);
	}
;
#line 1950 "lib/OpenGL/V1.xs"
		loadProc(glBufferSubDataARB,"glBufferSubDataARB");
#line 3355 "lib/OpenGL/V1.c"
#line 1952 "lib/OpenGL/V1.xs"
	{
		glBufferSubDataARB(target,offset*oga->total_types_width,oga->data_length,oga->data);
	}
#line 3360 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetBufferSubDataARB_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetBufferSubDataARB_s)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "target, offset, size, data");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	offset = (int)SvIV(ST(1))
;
	GLsizei	size = (int)SvIV(ST(2))
;
	SV *	data = ST(3)
;
#line 1964 "lib/OpenGL/V1.xs"
		loadProc(glGetBufferSubDataARB,"glBufferSubDataARB");
#line 3383 "lib/OpenGL/V1.c"
#line 1966 "lib/OpenGL/V1.xs"
	{
		GLubyte * data_s = EL(data,size);
		glGetBufferSubDataARB(target,offset,size,data_s);
	}
#line 3389 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetBufferSubDataARB_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetBufferSubDataARB_p)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items < 3)
       croak_xs_usage(cv,  "target, offset, count, ...");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	offset = (int)SvIV(ST(1))
;
	GLsizei	count = (int)SvIV(ST(2))
;
	OpenGL__Array	RETVAL;
#line 1981 "lib/OpenGL/V1.xs"
		loadProc(glGetBufferSubDataARB,"glGetBufferSubDataARB");
		loadProc(glGetBufferParameterivARB,"glGetBufferParameterivARB");
#line 3413 "lib/OpenGL/V1.c"
#line 1984 "lib/OpenGL/V1.xs"
	{
		oga_struct * oga = malloc(sizeof(oga_struct));
		GLint size;

		oga->item_count = count;
		oga->type_count = (items - 3);

                if (oga->type_count)
		{
			int i,j;

			oga->types = malloc(sizeof(GLenum) * oga->type_count);
			oga->type_offset = malloc(sizeof(GLint) * oga->type_count);
			for(i=0,j=0;i<oga->type_count;i++) {
				oga->types[i] = SvIV(ST(i+3));
				oga->type_offset[i] = j;
				int size = gl_type_size(oga->types[i]);
				if (size < 0) croak("unknown type");
				j += size;
			}
			oga->total_types_width = j;
		}
		else
		{
			oga->type_count = 1;
			oga->types = malloc(sizeof(GLenum) * oga->type_count);
			oga->type_offset = malloc(sizeof(GLint) * oga->type_count);

			oga->types[0] = GL_UNSIGNED_BYTE;
			oga->type_offset[0] = 0;
			int size = gl_type_size(oga->types[0]);
			if (size < 0) croak("unknown type");
			oga->total_types_width = size;
		}
		if (!oga->total_types_width) croak("Unable to determine type sizes\n");

		glGetBufferParameterivARB(target,GL_BUFFER_SIZE_ARB,&size);
		size /= oga->total_types_width;
		if (offset > size) croak("Offset is greater than elements in buffer: %d\n",size);

		if ((offset+count) > size) count = size - offset;

		oga->data_length = oga->total_types_width * count;
		oga->data = malloc(oga->data_length);

		glGetBufferSubDataARB(target,offset*oga->total_types_width,
			oga->data_length,oga->data);

		oga->free_data = 1;

		RETVAL = oga;
	}
#line 3467 "lib/OpenGL/V1.c"
	{
	    SV * RETVALSV;
	    RETVALSV = sv_newmortal();
	    sv_setref_pv(RETVALSV, "OpenGL::Array", (void*)RETVAL);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

#define FIXME /* !!! Need to refactor with glGetBufferPointervARB_p */

XS_EUPXS(XS_OpenGL_glMapBufferARB_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glMapBufferARB_p)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items < 2)
       croak_xs_usage(cv,  "target, access, ...");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	access = (int)SvIV(ST(1))
;
	OpenGL__Array	RETVAL;
#line 2050 "lib/OpenGL/V1.xs"
		loadProc(glMapBufferARB,"glMapBufferARB");
		loadProc(glGetBufferParameterivARB,"glGetBufferParameterivARB");
#line 3496 "lib/OpenGL/V1.c"
#line 2053 "lib/OpenGL/V1.xs"
	{
		GLsizeiptrARB size = 0;
		oga_struct * oga;
		int i,j;

		void * buffer =	glMapBufferARB(target,access);
		if (!buffer) croak("Unable to map buffer\n");

		glGetBufferParameterivARB(target,GL_BUFFER_SIZE_ARB,(GLint*)&size);
		if (!size) croak("Buffer has no size\n");

		oga = malloc(sizeof(oga_struct));

		oga->type_count = (items - 2);

                if (oga->type_count)
		{
			oga->types = malloc(sizeof(GLenum) * oga->type_count);
			oga->type_offset = malloc(sizeof(GLint) * oga->type_count);
			for(i=0,j=0;i<oga->type_count;i++) {
				oga->types[i] = SvIV(ST(i+2));
				oga->type_offset[i] = j;
				int size = gl_type_size(oga->types[i]);
				if (size < 0) croak("unknown type");
				j += size;
			}
			oga->total_types_width = j;
		}
		else
		{
			oga->type_count = 1;
			oga->types = malloc(sizeof(GLenum) * oga->type_count);
			oga->type_offset = malloc(sizeof(GLint) * oga->type_count);

			oga->types[0] = GL_UNSIGNED_BYTE;
			oga->type_offset[0] = 0;
			int size = gl_type_size(oga->types[0]);
			if (size < 0) croak("unknown type");
			oga->total_types_width = size;
		}

		if (!oga->total_types_width) croak("Unable to determine type sizes\n");
		oga->item_count = size / oga->total_types_width;

		oga->data_length = oga->total_types_width * oga->item_count;

		oga->data = buffer;

		oga->free_data = 0;

		RETVAL = oga;
	}
#line 3550 "lib/OpenGL/V1.c"
	{
	    SV * RETVALSV;
	    RETVALSV = sv_newmortal();
	    sv_setref_pv(RETVALSV, "OpenGL::Array", (void*)RETVAL);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glGetBufferPointervARB_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetBufferPointervARB_s)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "target, pname, params");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	pname = (int)SvIV(ST(1))
;
	SV *	params = ST(2)
;
#line 2115 "lib/OpenGL/V1.xs"
		loadProc(glGetBufferPointervARB,"glGetBufferPointervARB");
#line 3577 "lib/OpenGL/V1.c"
#line 2117 "lib/OpenGL/V1.xs"
	{
		void ** params_s = EL(params, sizeof(void*));
		glGetBufferPointervARB(target,pname,params_s);
	}
#line 3583 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetBufferPointervARB_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetBufferPointervARB_p)
{
    dVAR; dXSARGS;
    dXSI32;
    if (items < 2)
       croak_xs_usage(cv,  "target, pname, ...");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	pname = (int)SvIV(ST(1))
;
	OpenGL__Array	RETVAL;
#line 2131 "lib/OpenGL/V1.xs"
		loadProc(glGetBufferPointervARB,"glGetBufferPointervARB");
		loadProc(glGetBufferParameterivARB,"glGetBufferParameterivARB");
#line 3605 "lib/OpenGL/V1.c"
#line 2134 "lib/OpenGL/V1.xs"
	{
		GLsizeiptrARB size;
		oga_struct * oga;
		void * buffer;
		int i,j;

		glGetBufferPointervARB(target,pname,&buffer);
		if (!buffer) croak("Buffer is not mapped\n");

		glGetBufferParameterivARB(target,GL_BUFFER_SIZE_ARB,(GLint*)&size);
		if (!size) croak("Buffer has no size\n");

		oga = malloc(sizeof(oga_struct));

		oga->type_count = (items - 2);

                if (oga->type_count)
		{
			oga->types = malloc(sizeof(GLenum) * oga->type_count);
			oga->type_offset = malloc(sizeof(GLint) * oga->type_count);
			for(i=0,j=0;i<oga->type_count;i++) {
				oga->types[i] = SvIV(ST(i+2));
				oga->type_offset[i] = j;
				int size = gl_type_size(oga->types[i]);
				if (size < 0) croak("unknown type");
				j += size;
			}
			oga->total_types_width = j;
		}
		else
		{
			oga->type_count = 1;
			oga->types = malloc(sizeof(GLenum) * oga->type_count);
			oga->type_offset = malloc(sizeof(GLint) * oga->type_count);

			oga->types[0] = GL_UNSIGNED_BYTE;
			oga->type_offset[0] = 0;
			int size = gl_type_size(oga->types[0]);
			if (size < 0) croak("unknown type");
			oga->total_types_width = size;
		}

		if (!oga->total_types_width) croak("Unable to determine type sizes\n");
		oga->item_count = size / oga->total_types_width;

		oga->data_length = oga->total_types_width * oga->item_count;

		oga->data = buffer;

		oga->free_data = 0;

		RETVAL = oga;
	}
#line 3660 "lib/OpenGL/V1.c"
	{
	    SV * RETVALSV;
	    RETVALSV = sv_newmortal();
	    sv_setref_pv(RETVALSV, "OpenGL::Array", (void*)RETVAL);
	    ST(0) = RETVALSV;
	}
    }
    XSRETURN(1);
}

#endif // GL_ARB_vertex_buffer_object
#ifdef GL_EXT_texture3D
#define XSubPPtmpAAAM 1


XS_EUPXS(XS_OpenGL_glTexImage3DEXT_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glTexImage3DEXT_s)
{
    dVAR; dXSARGS;
    if (items != 10)
       croak_xs_usage(cv,  "target, level, internalformat, width, height, depth, border, format, type, pixels");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	level = (int)SvIV(ST(1))
;
	GLenum	internalformat = (int)SvIV(ST(2))
;
	GLsizei	width = (int)SvIV(ST(3))
;
	GLsizei	height = (int)SvIV(ST(4))
;
	GLsizei	depth = (int)SvIV(ST(5))
;
	GLint	border = (int)SvIV(ST(6))
;
	GLenum	format = (int)SvIV(ST(7))
;
	GLenum	type = (int)SvIV(ST(8))
;
	SV *	pixels = ST(9)
;
#line 2208 "lib/OpenGL/V1.xs"
		loadProc(glTexImage3DEXT,"glTexImage3DEXT");
#line 3705 "lib/OpenGL/V1.c"
#line 2210 "lib/OpenGL/V1.xs"
	{
		GLvoid * ptr = ELI(pixels, width, height,
			format, type, gl_pixelbuffer_unpack);
		glTexImage3DEXT(target, level, internalformat, width, height,
			depth, border, format, type, ptr);
	}
#line 3713 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glTexImage3DEXT_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glTexImage3DEXT_p)
{
    dVAR; dXSARGS;
    if (items < 9)
       croak_xs_usage(cv,  "target, level, internalformat, width, height, depth, border, format, type, ...");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	level = (int)SvIV(ST(1))
;
	GLenum	internalformat = (int)SvIV(ST(2))
;
	GLsizei	width = (int)SvIV(ST(3))
;
	GLsizei	height = (int)SvIV(ST(4))
;
	GLsizei	depth = (int)SvIV(ST(5))
;
	GLint	border = (int)SvIV(ST(6))
;
	GLenum	format = (int)SvIV(ST(7))
;
	GLenum	type = (int)SvIV(ST(8))
;
#line 2230 "lib/OpenGL/V1.xs"
		loadProc(glTexImage3DEXT,"glTexImage3DEXT");
#line 3746 "lib/OpenGL/V1.c"
#line 2232 "lib/OpenGL/V1.xs"
	{
		GLvoid * ptr;
		glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
		glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
		glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
		ptr = pack_image_ST(&(ST(4)), items-4, width, height, 1, format, type, 0);
		glTexImage3DEXT(target, level, internalformat, width, height,
			depth, border, format, type, ptr);
		glPopClientAttrib();
		free(ptr);
	}
#line 3759 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glTexSubImage3DEXT_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glTexSubImage3DEXT_s)
{
    dVAR; dXSARGS;
    if (items != 11)
       croak_xs_usage(cv,  "target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	level = (int)SvIV(ST(1))
;
	GLint	xoffset = (int)SvIV(ST(2))
;
	GLint	yoffset = (int)SvIV(ST(3))
;
	GLint	zoffset = (int)SvIV(ST(4))
;
	GLsizei	width = (int)SvIV(ST(5))
;
	GLsizei	height = (int)SvIV(ST(6))
;
	GLsizei	depth = (int)SvIV(ST(7))
;
	GLenum	format = (int)SvIV(ST(8))
;
	GLenum	type = (int)SvIV(ST(9))
;
	SV *	pixels = ST(10)
;
#line 2259 "lib/OpenGL/V1.xs"
		loadProc(glTexSubImage3DEXT,"glTexSubImage3DEXT");
#line 3796 "lib/OpenGL/V1.c"
#line 2261 "lib/OpenGL/V1.xs"
	{
		GLvoid * ptr = ELI(pixels, width, height,
			format, type, gl_pixelbuffer_unpack);
		glTexSubImage3DEXT(target, level, xoffset, yoffset, zoffset,
			width, height, depth, format, type, ptr);
	}
#line 3804 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glTexSubImage3DEXT_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glTexSubImage3DEXT_p)
{
    dVAR; dXSARGS;
    if (items < 10)
       croak_xs_usage(cv,  "target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, ...");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLint	level = (int)SvIV(ST(1))
;
	GLint	xoffset = (int)SvIV(ST(2))
;
	GLint	yoffset = (int)SvIV(ST(3))
;
	GLint	zoffset = (int)SvIV(ST(4))
;
	GLsizei	width = (int)SvIV(ST(5))
;
	GLsizei	height = (int)SvIV(ST(6))
;
	GLsizei	depth = (int)SvIV(ST(7))
;
	GLenum	format = (int)SvIV(ST(8))
;
	GLenum	type = (int)SvIV(ST(9))
;
#line 2282 "lib/OpenGL/V1.xs"
		loadProc(glTexSubImage3DEXT,"glTexSubImage3DEXT");
#line 3839 "lib/OpenGL/V1.c"
#line 2284 "lib/OpenGL/V1.xs"
	{
		GLvoid * ptr;
		glPushClientAttrib(GL_CLIENT_PIXEL_STORE_BIT);
		glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
		glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
		ptr = pack_image_ST(&(ST(4)), items-4, width, height, 1, format, type, 0);
		glTexSubImage3DEXT(target, level, xoffset, yoffset, zoffset,
			width, height, depth, format, type, ptr);
		glPopClientAttrib();
		free(ptr);
	}
#line 3852 "lib/OpenGL/V1.c"
    }
    XSRETURN_EMPTY;
}

#endif
#endif /* HAVE_GL */
#ifdef __cplusplus
extern "C" {
#endif
XS_EXTERNAL(boot_OpenGL__V1); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_OpenGL__V1)
{
#if PERL_VERSION_LE(5, 21, 5)
    dVAR; dXSARGS;
#else
    dVAR; dXSBOOTARGSXSAPIVERCHK;
#endif
#if PERL_VERSION_LE(5, 8, 999) /* PERL_VERSION_LT is 5.33+ */
    char* file = __FILE__;
#else
    const char* file = __FILE__;
#endif

    PERL_UNUSED_VAR(file);

    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
#if PERL_VERSION_LE(5, 21, 5)
    XS_VERSION_BOOTCHECK;
#  ifdef XS_APIVERSION_BOOTCHECK
    XS_APIVERSION_BOOTCHECK;
#  endif
#endif

#if XSubPPtmpAAAA
        newXS_deffile("OpenGL::glBitmap_c", XS_OpenGL_glBitmap_c);
        newXS_deffile("OpenGL::glBitmap_s", XS_OpenGL_glBitmap_s);
        newXS_deffile("OpenGL::glBitmap_p", XS_OpenGL_glBitmap_p);
        newXS_deffile("OpenGL::glCallLists_s", XS_OpenGL_glCallLists_s);
        newXS_deffile("OpenGL::glCallLists_p", XS_OpenGL_glCallLists_p);
#if XSubPPtmpAAAB
        newXS_deffile("OpenGL::glDrawElements_s", XS_OpenGL_glDrawElements_s);
        newXS_deffile("OpenGL::glDrawElements_p", XS_OpenGL_glDrawElements_p);
#endif
        newXS_deffile("OpenGL::glDrawPixels_s", XS_OpenGL_glDrawPixels_s);
        newXS_deffile("OpenGL::glDrawPixels_p", XS_OpenGL_glDrawPixels_p);
#if XSubPPtmpAAAC
        newXS_deffile("OpenGL::glDrawRangeElements_s", XS_OpenGL_glDrawRangeElements_s);
        newXS_deffile("OpenGL::glDrawRangeElements_p", XS_OpenGL_glDrawRangeElements_p);
#endif
        newXS_deffile("OpenGL::glGetMapdv_s", XS_OpenGL_glGetMapdv_s);
        newXS_deffile("OpenGL::glGetMapfv_s", XS_OpenGL_glGetMapfv_s);
        newXS_deffile("OpenGL::glGetMapiv_s", XS_OpenGL_glGetMapiv_s);
        newXS_deffile("OpenGL::glGetMapfv_p", XS_OpenGL_glGetMapfv_p);
        newXS_deffile("OpenGL::glGetMapdv_p", XS_OpenGL_glGetMapdv_p);
        newXS_deffile("OpenGL::glGetMapiv_p", XS_OpenGL_glGetMapiv_p);
        newXS_deffile("OpenGL::glGetPixelMapfv_s", XS_OpenGL_glGetPixelMapfv_s);
        newXS_deffile("OpenGL::glGetPixelMapuiv_s", XS_OpenGL_glGetPixelMapuiv_s);
        newXS_deffile("OpenGL::glGetPixelMapusv_s", XS_OpenGL_glGetPixelMapusv_s);
        newXS_deffile("OpenGL::glGetPixelMapfv_p", XS_OpenGL_glGetPixelMapfv_p);
        newXS_deffile("OpenGL::glGetPixelMapuiv_p", XS_OpenGL_glGetPixelMapuiv_p);
        newXS_deffile("OpenGL::glGetPixelMapusv_p", XS_OpenGL_glGetPixelMapusv_p);
        newXS_deffile("OpenGL::glPolygonStipple_c", XS_OpenGL_glPolygonStipple_c);
        newXS_deffile("OpenGL::glGetPolygonStipple_s", XS_OpenGL_glGetPolygonStipple_s);
        newXS_deffile("OpenGL::glGetPolygonStipple_p", XS_OpenGL_glGetPolygonStipple_p);
#if XSubPPtmpAAAD
        newXS_deffile("OpenGL::glGetPointerv_s", XS_OpenGL_glGetPointerv_s);
        newXS_deffile("OpenGL::glGetPointerv_p", XS_OpenGL_glGetPointerv_p);
#endif
        newXS_deffile("OpenGL::glGetTexImage_s", XS_OpenGL_glGetTexImage_s);
        newXS_deffile("OpenGL::glGetTexImage_p", XS_OpenGL_glGetTexImage_p);
        newXS_deffile("OpenGL::glMap1d_s", XS_OpenGL_glMap1d_s);
        newXS_deffile("OpenGL::glMap1f_s", XS_OpenGL_glMap1f_s);
        newXS_deffile("OpenGL::glMap1d_p", XS_OpenGL_glMap1d_p);
        newXS_deffile("OpenGL::glMap1f_p", XS_OpenGL_glMap1f_p);
        newXS_deffile("OpenGL::glMap2d_s", XS_OpenGL_glMap2d_s);
        newXS_deffile("OpenGL::glMap2f_s", XS_OpenGL_glMap2f_s);
        newXS_deffile("OpenGL::glMap2d_p", XS_OpenGL_glMap2d_p);
        newXS_deffile("OpenGL::glMap2f_p", XS_OpenGL_glMap2f_p);
        newXS_deffile("OpenGL::glPolygonStipple_s", XS_OpenGL_glPolygonStipple_s);
        newXS_deffile("OpenGL::glPolygonStipple_p", XS_OpenGL_glPolygonStipple_p);
        newXS_deffile("OpenGL::glReadPixels_s", XS_OpenGL_glReadPixels_s);
        newXS_deffile("OpenGL::glReadPixels_p", XS_OpenGL_glReadPixels_p);
        newXS_deffile("OpenGL::glTexImage1D_s", XS_OpenGL_glTexImage1D_s);
        newXS_deffile("OpenGL::glTexImage1D_p", XS_OpenGL_glTexImage1D_p);
        newXS_deffile("OpenGL::glTexImage2D_s", XS_OpenGL_glTexImage2D_s);
        newXS_deffile("OpenGL::glTexImage2D_p", XS_OpenGL_glTexImage2D_p);
#if XSubPPtmpAAAE
        newXS_deffile("OpenGL::glTexImage3D_s", XS_OpenGL_glTexImage3D_s);
        newXS_deffile("OpenGL::glTexImage3D_p", XS_OpenGL_glTexImage3D_p);
#endif
#if XSubPPtmpAAAF
        newXS_deffile("OpenGL::glTexSubImage1D_s", XS_OpenGL_glTexSubImage1D_s);
        newXS_deffile("OpenGL::glTexSubImage1D_p", XS_OpenGL_glTexSubImage1D_p);
        newXS_deffile("OpenGL::glTexSubImage2D_s", XS_OpenGL_glTexSubImage2D_s);
        newXS_deffile("OpenGL::glTexSubImage2D_p", XS_OpenGL_glTexSubImage2D_p);
#if XSubPPtmpAAAG
        newXS_deffile("OpenGL::glTexSubImage3D_s", XS_OpenGL_glTexSubImage3D_s);
        newXS_deffile("OpenGL::glTexSubImage3D_p", XS_OpenGL_glTexSubImage3D_p);
#endif
#endif
#if XSubPPtmpAAAH
        newXS_deffile("OpenGL::glVertexPointerEXT_s", XS_OpenGL_glVertexPointerEXT_s);
        cv = newXS_deffile("OpenGL::glVertexPointerEXT_o", XS_OpenGL_glVertexPointerEXT_p);
        XSANY.any_i32 = 3;
        cv = newXS_deffile("OpenGL::glVertexPointerEXT_p", XS_OpenGL_glVertexPointerEXT_p);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("OpenGL::glVertexPointer_o", XS_OpenGL_glVertexPointerEXT_p);
        XSANY.any_i32 = 2;
        cv = newXS_deffile("OpenGL::glVertexPointer_p", XS_OpenGL_glVertexPointerEXT_p);
        XSANY.any_i32 = 1;
        newXS_deffile("OpenGL::glNormalPointerEXT_s", XS_OpenGL_glNormalPointerEXT_s);
        cv = newXS_deffile("OpenGL::glNormalPointerEXT_o", XS_OpenGL_glNormalPointer_p);
        XSANY.any_i32 = 3;
        cv = newXS_deffile("OpenGL::glNormalPointerEXT_p", XS_OpenGL_glNormalPointer_p);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("OpenGL::glNormalPointer_o", XS_OpenGL_glNormalPointer_p);
        XSANY.any_i32 = 2;
        cv = newXS_deffile("OpenGL::glNormalPointer_p", XS_OpenGL_glNormalPointer_p);
        XSANY.any_i32 = 0;
        newXS_deffile("OpenGL::glColorPointerEXT_s", XS_OpenGL_glColorPointerEXT_s);
        cv = newXS_deffile("OpenGL::glColorPointerEXT_o", XS_OpenGL_glColorPointer_p);
        XSANY.any_i32 = 2;
        cv = newXS_deffile("OpenGL::glColorPointerEXT_p", XS_OpenGL_glColorPointer_p);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("OpenGL::glColorPointer_o", XS_OpenGL_glColorPointer_p);
        XSANY.any_i32 = 3;
        cv = newXS_deffile("OpenGL::glColorPointer_p", XS_OpenGL_glColorPointer_p);
        XSANY.any_i32 = 0;
        newXS_deffile("OpenGL::glIndexPointerEXT_s", XS_OpenGL_glIndexPointerEXT_s);
        cv = newXS_deffile("OpenGL::glIndexPointerEXT_o", XS_OpenGL_glIndexPointer_p);
        XSANY.any_i32 = 2;
        cv = newXS_deffile("OpenGL::glIndexPointerEXT_p", XS_OpenGL_glIndexPointer_p);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("OpenGL::glIndexPointer_o", XS_OpenGL_glIndexPointer_p);
        XSANY.any_i32 = 3;
        cv = newXS_deffile("OpenGL::glIndexPointer_p", XS_OpenGL_glIndexPointer_p);
        XSANY.any_i32 = 0;
        newXS_deffile("OpenGL::glTexCoordPointerEXT_s", XS_OpenGL_glTexCoordPointerEXT_s);
        cv = newXS_deffile("OpenGL::glTexCoordPointerEXT_o", XS_OpenGL_glTexCoordPointer_p);
        XSANY.any_i32 = 2;
        cv = newXS_deffile("OpenGL::glTexCoordPointerEXT_p", XS_OpenGL_glTexCoordPointer_p);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("OpenGL::glTexCoordPointer_o", XS_OpenGL_glTexCoordPointer_p);
        XSANY.any_i32 = 3;
        cv = newXS_deffile("OpenGL::glTexCoordPointer_p", XS_OpenGL_glTexCoordPointer_p);
        XSANY.any_i32 = 0;
        newXS_deffile("OpenGL::glEdgeFlagPointerEXT_s", XS_OpenGL_glEdgeFlagPointerEXT_s);
        cv = newXS_deffile("OpenGL::glEdgeFlagPointerEXT_o", XS_OpenGL_glEdgeFlagPointer_p);
        XSANY.any_i32 = 2;
        cv = newXS_deffile("OpenGL::glEdgeFlagPointerEXT_p", XS_OpenGL_glEdgeFlagPointer_p);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("OpenGL::glEdgeFlagPointer_o", XS_OpenGL_glEdgeFlagPointer_p);
        XSANY.any_i32 = 3;
        cv = newXS_deffile("OpenGL::glEdgeFlagPointer_p", XS_OpenGL_glEdgeFlagPointer_p);
        XSANY.any_i32 = 0;
#endif
#if XSubPPtmpAAAI
        newXS_deffile("OpenGL::glVertexPointer_s", XS_OpenGL_glVertexPointer_s);
        newXS_deffile("OpenGL::glNormalPointer_s", XS_OpenGL_glNormalPointer_s);
        newXS_deffile("OpenGL::glColorPointer_s", XS_OpenGL_glColorPointer_s);
        newXS_deffile("OpenGL::glIndexPointer_s", XS_OpenGL_glIndexPointer_s);
        newXS_deffile("OpenGL::glTexCoordPointer_s", XS_OpenGL_glTexCoordPointer_s);
        newXS_deffile("OpenGL::glEdgeFlagPointer_s", XS_OpenGL_glEdgeFlagPointer_s);
#endif
#if XSubPPtmpAAAJ
        newXS_deffile("OpenGL::glBufferData_s", XS_OpenGL_glBufferData_s);
        cv = newXS_deffile("OpenGL::glBufferData_o", XS_OpenGL_glBufferData_p);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("OpenGL::glBufferData_p", XS_OpenGL_glBufferData_p);
        XSANY.any_i32 = 0;
        newXS_deffile("OpenGL::glBufferSubData_s", XS_OpenGL_glBufferSubData_s);
        cv = newXS_deffile("OpenGL::glBufferSubData_o", XS_OpenGL_glBufferSubData_p);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("OpenGL::glBufferSubData_p", XS_OpenGL_glBufferSubData_p);
        XSANY.any_i32 = 0;
        newXS_deffile("OpenGL::glGetBufferSubData_s", XS_OpenGL_glGetBufferSubData_s);
        cv = newXS_deffile("OpenGL::glGetBufferSubData_o", XS_OpenGL_glGetBufferSubData_p);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("OpenGL::glGetBufferSubData_p", XS_OpenGL_glGetBufferSubData_p);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("OpenGL::glMapBuffer_o", XS_OpenGL_glMapBuffer_p);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("OpenGL::glMapBuffer_p", XS_OpenGL_glMapBuffer_p);
        XSANY.any_i32 = 0;
        newXS_deffile("OpenGL::glGetBufferPointerv_s", XS_OpenGL_glGetBufferPointerv_s);
        cv = newXS_deffile("OpenGL::glGetBufferPointerv_o", XS_OpenGL_glGetBufferPointerv_p);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("OpenGL::glGetBufferPointerv_p", XS_OpenGL_glGetBufferPointerv_p);
        XSANY.any_i32 = 0;
#endif
#if XSubPPtmpAAAK
        newXS_deffile("OpenGL::glGetQueryObjectiv", XS_OpenGL_glGetQueryObjectiv);
        newXS_deffile("OpenGL::glGetQueryObjectuiv", XS_OpenGL_glGetQueryObjectuiv);
        newXS_deffile("OpenGL::glGetQueryiv", XS_OpenGL_glGetQueryiv);
#endif
#if XSubPPtmpAAAL
        newXS_deffile("OpenGL::glBufferDataARB_s", XS_OpenGL_glBufferDataARB_s);
        cv = newXS_deffile("OpenGL::glBufferDataARB_o", XS_OpenGL_glBufferDataARB_p);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("OpenGL::glBufferDataARB_p", XS_OpenGL_glBufferDataARB_p);
        XSANY.any_i32 = 0;
        newXS_deffile("OpenGL::glBufferSubDataARB_s", XS_OpenGL_glBufferSubDataARB_s);
        cv = newXS_deffile("OpenGL::glBufferSubDataARB_o", XS_OpenGL_glBufferSubDataARB_p);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("OpenGL::glBufferSubDataARB_p", XS_OpenGL_glBufferSubDataARB_p);
        XSANY.any_i32 = 0;
        newXS_deffile("OpenGL::glGetBufferSubDataARB_s", XS_OpenGL_glGetBufferSubDataARB_s);
        cv = newXS_deffile("OpenGL::glGetBufferSubDataARB_o", XS_OpenGL_glGetBufferSubDataARB_p);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("OpenGL::glGetBufferSubDataARB_p", XS_OpenGL_glGetBufferSubDataARB_p);
        XSANY.any_i32 = 0;
        cv = newXS_deffile("OpenGL::glMapBufferARB_o", XS_OpenGL_glMapBufferARB_p);
        XSANY.any_i32 = 1;
        cv = newXS_deffile("OpenGL::glMapBufferARB_p", XS_OpenGL_glMapBufferARB_p);
        XSANY.any_i32 = 0;
        newXS_deffile("OpenGL::glGetBufferPointervARB_s", XS_OpenGL_glGetBufferPointervARB_s);
        cv = newXS_deffile("OpenGL::glGetBufferPointervARB_p", XS_OpenGL_glGetBufferPointervARB_p);
        XSANY.any_i32 = 1;
#endif
#if XSubPPtmpAAAM
        newXS_deffile("OpenGL::glTexImage3DEXT_s", XS_OpenGL_glTexImage3DEXT_s);
        newXS_deffile("OpenGL::glTexImage3DEXT_p", XS_OpenGL_glTexImage3DEXT_p);
        newXS_deffile("OpenGL::glTexSubImage3DEXT_s", XS_OpenGL_glTexSubImage3DEXT_s);
        newXS_deffile("OpenGL::glTexSubImage3DEXT_p", XS_OpenGL_glTexSubImage3DEXT_p);
#endif
#endif

    /* Initialisation Section */

#if XSubPPtmpAAAA
#if XSubPPtmpAAAB
#endif
#if XSubPPtmpAAAC
#endif
#if XSubPPtmpAAAD
#endif
#if XSubPPtmpAAAE
#endif
#if XSubPPtmpAAAF
#if XSubPPtmpAAAG
#endif
#endif
#if XSubPPtmpAAAH
#endif
#if XSubPPtmpAAAI
#endif
#if XSubPPtmpAAAJ
#endif
#if XSubPPtmpAAAK
#endif
#if XSubPPtmpAAAL
#endif
#if XSubPPtmpAAAM
#endif
#endif
#line 4109 "lib/OpenGL/V1.c"

    /* End of Initialisation Section */

#if PERL_VERSION_LE(5, 21, 5)
#  if PERL_VERSION_GE(5, 9, 0)
    if (PL_unitcheckav)
        call_list(PL_scopestack_ix, PL_unitcheckav);
#  endif
    XSRETURN_YES;
#else
    Perl_xs_boot_epilog(aTHX_ ax);
#endif
}

#ifdef __cplusplus
}
#endif
