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

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

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

#line 26 "lib/OpenGL/V3.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 170 "lib/OpenGL/V3.c"
#ifdef HAVE_GL
#ifdef GL_VERSION_3_0
#define XSubPPtmpAAAA 1


XS_EUPXS(XS_OpenGL_glIsRenderbuffer); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glIsRenderbuffer)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "renderbuffer");
    {
	GLuint	renderbuffer = (unsigned int)SvUV(ST(0))
;
	GLboolean	RETVAL;
#line 27 "lib/OpenGL/V3.xs"
	{
		RETVAL = glIsRenderbuffer(renderbuffer);
	}
#line 190 "lib/OpenGL/V3.c"
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glBindRenderbuffer); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glBindRenderbuffer)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "target, renderbuffer");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLuint	renderbuffer = (unsigned int)SvUV(ST(1))
;
#line 39 "lib/OpenGL/V3.xs"
	{
		glBindRenderbuffer(target,renderbuffer);
	}
#line 212 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glDeleteRenderbuffers_c); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glDeleteRenderbuffers_c)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "n, renderbuffers");
    {
	GLsizei	n = (int)SvIV(ST(0))
;
	void *	renderbuffers = INT2PTR(void *,SvIV(ST(1)))
;
#line 49 "lib/OpenGL/V3.xs"
	{
		glDeleteRenderbuffers(n,renderbuffers);
	}
#line 233 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glDeleteRenderbuffers_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glDeleteRenderbuffers_s)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "n, renderbuffers");
    {
	GLsizei	n = (int)SvIV(ST(0))
;
	SV *	renderbuffers = ST(1)
;
#line 59 "lib/OpenGL/V3.xs"
	{
		void * renderbuffers_s = EL(renderbuffers, sizeof(GLuint)*n);
		glDeleteRenderbuffers(n,renderbuffers_s);
	}
#line 255 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glDeleteRenderbuffers_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glDeleteRenderbuffers_p)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
    {
#line 68 "lib/OpenGL/V3.xs"
	{
		if (items) {
			GLuint * list = malloc(sizeof(GLuint) * items);
			int i;

			for (i=0;i<items;i++)
				list[i] = SvIV(ST(i));

			glDeleteRenderbuffers(items, list);
			free(list);
		}
	}
#line 281 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGenRenderbuffers_c); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGenRenderbuffers_c)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "n, renderbuffers");
    {
	GLsizei	n = (int)SvIV(ST(0))
;
	void *	renderbuffers = INT2PTR(void *,SvIV(ST(1)))
;
#line 87 "lib/OpenGL/V3.xs"
	{
		glGenRenderbuffers(n, renderbuffers);
	}
#line 302 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGenRenderbuffers_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGenRenderbuffers_s)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "n, renderbuffers");
    {
	GLsizei	n = (int)SvIV(ST(0))
;
	SV *	renderbuffers = ST(1)
;
#line 97 "lib/OpenGL/V3.xs"
	{
		void * renderbuffers_s = EL(renderbuffers, sizeof(GLuint)*n);
		glGenRenderbuffers(n, renderbuffers_s);
	}
#line 324 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGenRenderbuffers_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGenRenderbuffers_p)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "n");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GLsizei	n = (int)SvIV(ST(0))
;
#line 107 "lib/OpenGL/V3.xs"
	if (n)
	{
		GLuint * renderbuffers = malloc(sizeof(GLuint) * n);
		int i;

		glGenRenderbuffers(n, renderbuffers);

		EXTEND(sp, n);
		for(i=0;i<n;i++)
			PUSHs(sv_2mortal(newSViv(renderbuffers[i])));

		free(renderbuffers);
	}
#line 355 "lib/OpenGL/V3.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_OpenGL_glRenderbufferStorage); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glRenderbufferStorage)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "target, internalformat, width, height");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	internalformat = (int)SvIV(ST(1))
;
	GLsizei	width = (int)SvIV(ST(2))
;
	GLsizei	height = (int)SvIV(ST(3))
;
#line 129 "lib/OpenGL/V3.xs"
	{
		glRenderbufferStorage(target,internalformat,width,height);
	}
#line 381 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetRenderbufferParameteriv_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetRenderbufferParameteriv_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 140 "lib/OpenGL/V3.xs"
	{
		GLint * params_s = EL(params, sizeof(GLint));
		glGetRenderbufferParameteriv(target,pname,params_s);
	}
#line 405 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetRenderbufferParameteriv_c); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetRenderbufferParameteriv_c)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "target, pname, params");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	pname = (int)SvIV(ST(1))
;
	void *	params = INT2PTR(void *,SvIV(ST(2)))
;
#line 152 "lib/OpenGL/V3.xs"
	{
		glGetRenderbufferParameteriv(target,pname,params);
	}
#line 428 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glIsFramebuffer); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glIsFramebuffer)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "framebuffer");
    {
	GLuint	framebuffer = (unsigned int)SvUV(ST(0))
;
	GLboolean	RETVAL;
#line 161 "lib/OpenGL/V3.xs"
	{
		RETVAL = glIsFramebuffer(framebuffer);
	}
#line 448 "lib/OpenGL/V3.c"
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glBindFramebuffer); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glBindFramebuffer)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "target, framebuffer");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLuint	framebuffer = (unsigned int)SvUV(ST(1))
;
#line 173 "lib/OpenGL/V3.xs"
	{
		glBindFramebuffer(target,framebuffer);
	}
#line 470 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glDeleteFramebuffers_c); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glDeleteFramebuffers_c)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "n, framebuffers");
    {
	GLsizei	n = (int)SvIV(ST(0))
;
	void *	framebuffers = INT2PTR(void *,SvIV(ST(1)))
;
#line 183 "lib/OpenGL/V3.xs"
	{
		glDeleteFramebuffers(n,framebuffers);
	}
#line 491 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glDeleteFramebuffers_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glDeleteFramebuffers_s)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "n, framebuffers");
    {
	GLsizei	n = (int)SvIV(ST(0))
;
	SV *	framebuffers = ST(1)
;
#line 193 "lib/OpenGL/V3.xs"
	{
		void * framebuffers_s = EL(framebuffers, sizeof(GLuint)*n);
		glDeleteFramebuffers(n,framebuffers_s);
	}
#line 513 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glDeleteFramebuffers_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glDeleteFramebuffers_p)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
    {
#line 202 "lib/OpenGL/V3.xs"
	{
		if (items) {
			GLuint * list = malloc(sizeof(GLuint) * items);
			int i;

			for(i=0;i<items;i++)
				list[i] = SvIV(ST(i));

			glDeleteFramebuffers(items, list);
			free(list);
		}
	}
#line 539 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGenFramebuffers_c); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGenFramebuffers_c)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "n, framebuffers");
    {
	GLsizei	n = (int)SvIV(ST(0))
;
	void *	framebuffers = INT2PTR(void *,SvIV(ST(1)))
;
#line 221 "lib/OpenGL/V3.xs"
	{
		glGenFramebuffers(n,framebuffers);
	}
#line 560 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGenFramebuffers_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGenFramebuffers_s)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "n, framebuffers");
    {
	GLsizei	n = (int)SvIV(ST(0))
;
	SV *	framebuffers = ST(1)
;
#line 231 "lib/OpenGL/V3.xs"
	{
		void * framebuffers_s = EL(framebuffers, sizeof(GLuint)*n);
		glGenFramebuffers(n,framebuffers_s);
	}
#line 582 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGenFramebuffers_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGenFramebuffers_p)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "n");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GLsizei	n = (int)SvIV(ST(0))
;
#line 241 "lib/OpenGL/V3.xs"
	if (n)
	{
		GLuint * framebuffers = malloc(sizeof(GLuint) * n);
		int i;

		glGenFramebuffers(n, framebuffers);

		EXTEND(sp, n);
		for(i=0;i<n;i++)
			PUSHs(sv_2mortal(newSViv(framebuffers[i])));

		free(framebuffers);
	}
#line 613 "lib/OpenGL/V3.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_OpenGL_glCheckFramebufferStatus); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glCheckFramebufferStatus)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "target");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	RETVAL;
	dXSTARG;
#line 260 "lib/OpenGL/V3.xs"
	{
		RETVAL = glCheckFramebufferStatus(target);
	}
#line 635 "lib/OpenGL/V3.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glFramebufferTexture1D); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glFramebufferTexture1D)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "target, attachment, textarget, texture, level");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	attachment = (int)SvIV(ST(1))
;
	GLenum	textarget = (int)SvIV(ST(2))
;
	GLuint	texture = (unsigned int)SvUV(ST(3))
;
	GLint	level = (int)SvIV(ST(4))
;
#line 275 "lib/OpenGL/V3.xs"
	{
		glFramebufferTexture1D(target,attachment,textarget,texture,level);
	}
#line 664 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glFramebufferTexture2D); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glFramebufferTexture2D)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "target, attachment, textarget, texture, level");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	attachment = (int)SvIV(ST(1))
;
	GLenum	textarget = (int)SvIV(ST(2))
;
	GLuint	texture = (unsigned int)SvUV(ST(3))
;
	GLint	level = (int)SvIV(ST(4))
;
#line 288 "lib/OpenGL/V3.xs"
	{
		glFramebufferTexture2D(target,attachment,textarget,texture,level);
	}
#line 691 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glFramebufferTexture3D); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glFramebufferTexture3D)
{
    dVAR; dXSARGS;
    if (items != 6)
       croak_xs_usage(cv,  "target, attachment, textarget, texture, level, zoffset");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	attachment = (int)SvIV(ST(1))
;
	GLenum	textarget = (int)SvIV(ST(2))
;
	GLuint	texture = (unsigned int)SvUV(ST(3))
;
	GLint	level = (int)SvIV(ST(4))
;
	GLint	zoffset = (int)SvIV(ST(5))
;
#line 302 "lib/OpenGL/V3.xs"
	{
		glFramebufferTexture3D(target,attachment,textarget,texture,level,zoffset);
	}
#line 720 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glFramebufferRenderbuffer); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glFramebufferRenderbuffer)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "target, attachment, renderbuffertarget, renderbuffer");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	attachment = (int)SvIV(ST(1))
;
	GLenum	renderbuffertarget = (int)SvIV(ST(2))
;
	GLuint	renderbuffer = (unsigned int)SvUV(ST(3))
;
#line 314 "lib/OpenGL/V3.xs"
	{
		glFramebufferRenderbuffer(target,attachment,renderbuffertarget,renderbuffer);
	}
#line 745 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetFramebufferAttachmentParameteriv_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetFramebufferAttachmentParameteriv_s)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "target, attachment, pname, params");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	attachment = (int)SvIV(ST(1))
;
	GLenum	pname = (int)SvIV(ST(2))
;
	SV *	params = ST(3)
;
#line 326 "lib/OpenGL/V3.xs"
	{
		GLint * params_s = EL(params, sizeof(GLint));
		glGetFramebufferAttachmentParameteriv(target,attachment,pname,params_s);
	}
#line 771 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetFramebufferAttachmentParameteriv_c); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetFramebufferAttachmentParameteriv_c)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "target, attachment, pname, params");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	attachment = (int)SvIV(ST(1))
;
	GLenum	pname = (int)SvIV(ST(2))
;
	void *	params = INT2PTR(void *,SvIV(ST(3)))
;
#line 339 "lib/OpenGL/V3.xs"
	{
		glGetFramebufferAttachmentParameteriv(target,attachment,pname,params);
	}
#line 796 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGenerateMipmap); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGenerateMipmap)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "target");
    {
	GLenum	target = (int)SvIV(ST(0))
;
#line 348 "lib/OpenGL/V3.xs"
	{
		glGenerateMipmap(target);
	}
#line 815 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGenVertexArrays_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGenVertexArrays_p)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "n");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GLsizei	n = (int)SvIV(ST(0))
;
#line 357 "lib/OpenGL/V3.xs"
               loadProc(glGenVertexArrays,"glGenVertexArrays");
#line 834 "lib/OpenGL/V3.c"
#line 359 "lib/OpenGL/V3.xs"
       if (n)
       {
               GLuint * vertex_arrays = malloc(sizeof(GLuint) * n);
               int i;

               glGenVertexArrays(n, vertex_arrays);

               EXTEND(sp, n);
               for(i=0;i<n;i++)
                       PUSHs(sv_2mortal(newSViv(vertex_arrays[i])));

               free(vertex_arrays);
       }
#line 849 "lib/OpenGL/V3.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_OpenGL_glBindVertexArray); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glBindVertexArray)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "vertex_array");
    {
	GLuint	vertex_array = (unsigned int)SvUV(ST(0))
;
#line 378 "lib/OpenGL/V3.xs"
               loadProc(glBindVertexArray,"glBindVertexArray");
#line 867 "lib/OpenGL/V3.c"
#line 380 "lib/OpenGL/V3.xs"
       {
               glBindVertexArray(vertex_array);
       }
#line 872 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glDeleteVertexArrays_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glDeleteVertexArrays_p)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
    {
#line 388 "lib/OpenGL/V3.xs"
		loadProc(glDeleteVertexArrays,"glDeleteVertexArrays");
#line 887 "lib/OpenGL/V3.c"
#line 390 "lib/OpenGL/V3.xs"
	{
		if (items) {
			GLuint * list = malloc(sizeof(GLuint) * items);
			int i;
			for (i=0;i<items;i++)
				list[i] = SvIV(ST(i));
			glDeleteRenderbuffers(items, list);
			free(list);
		}
	}
#line 899 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}

#endif // GL_VERSION_3_0
#ifdef GL_VERSION_3_2
#define XSubPPtmpAAAB 1


XS_EUPXS(XS_OpenGL_glDrawElementsBaseVertex_c); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glDrawElementsBaseVertex_c)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "mode, count, type, indices, basevertex");
    {
	GLenum	mode = (int)SvIV(ST(0))
;
	GLint	count = (int)SvIV(ST(1))
;
	GLenum	type = (int)SvIV(ST(2))
;
	void *	indices = INT2PTR(void *,SvIV(ST(3)))
;
	GLint	basevertex = (int)SvIV(ST(4))
;
#line 414 "lib/OpenGL/V3.xs"
		loadProc(glDrawElementsBaseVertex,"glDrawElementsBaseVertex");
#line 928 "lib/OpenGL/V3.c"
#line 416 "lib/OpenGL/V3.xs"
		glDrawElementsBaseVertex(mode, count, type, indices, basevertex);
#line 931 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}

#endif // GL_VERSION_3_2
#ifdef GL_EXT_framebuffer_object
#define XSubPPtmpAAAC 1


XS_EUPXS(XS_OpenGL_glIsRenderbufferEXT); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glIsRenderbufferEXT)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "renderbuffer");
    {
	GLuint	renderbuffer = (unsigned int)SvUV(ST(0))
;
	GLboolean	RETVAL;
#line 427 "lib/OpenGL/V3.xs"
		loadProc(glIsRenderbufferEXT,"glIsRenderbufferEXT");
#line 953 "lib/OpenGL/V3.c"
#line 429 "lib/OpenGL/V3.xs"
	{
		RETVAL = glIsRenderbufferEXT(renderbuffer);
	}
#line 958 "lib/OpenGL/V3.c"
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glBindRenderbufferEXT); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glBindRenderbufferEXT)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "target, renderbuffer");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLuint	renderbuffer = (unsigned int)SvUV(ST(1))
;
#line 441 "lib/OpenGL/V3.xs"
		loadProc(glBindRenderbufferEXT,"glBindRenderbufferEXT");
#line 978 "lib/OpenGL/V3.c"
#line 443 "lib/OpenGL/V3.xs"
	{
		glBindRenderbufferEXT(target,renderbuffer);
	}
#line 983 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glDeleteRenderbuffersEXT_c); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glDeleteRenderbuffersEXT_c)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "n, renderbuffers");
    {
	GLsizei	n = (int)SvIV(ST(0))
;
	void *	renderbuffers = INT2PTR(void *,SvIV(ST(1)))
;
#line 453 "lib/OpenGL/V3.xs"
		loadProc(glDeleteRenderbuffersEXT,"glDeleteRenderbuffersEXT");
#line 1002 "lib/OpenGL/V3.c"
#line 455 "lib/OpenGL/V3.xs"
	{
		glDeleteRenderbuffersEXT(n,renderbuffers);
	}
#line 1007 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glDeleteRenderbuffersEXT_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glDeleteRenderbuffersEXT_s)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "n, renderbuffers");
    {
	GLsizei	n = (int)SvIV(ST(0))
;
	SV *	renderbuffers = ST(1)
;
#line 465 "lib/OpenGL/V3.xs"
		loadProc(glDeleteRenderbuffersEXT,"glDeleteRenderbuffersEXT");
#line 1026 "lib/OpenGL/V3.c"
#line 467 "lib/OpenGL/V3.xs"
	{
		void * renderbuffers_s = EL(renderbuffers, sizeof(GLuint)*n);
		glDeleteRenderbuffersEXT(n,renderbuffers_s);
	}
#line 1032 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glDeleteRenderbuffersEXT_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glDeleteRenderbuffersEXT_p)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
    {
#line 476 "lib/OpenGL/V3.xs"
		loadProc(glDeleteRenderbuffersEXT,"glDeleteRenderbuffersEXT");
#line 1047 "lib/OpenGL/V3.c"
#line 478 "lib/OpenGL/V3.xs"
	{
		if (items) {
			GLuint * list = malloc(sizeof(GLuint) * items);
			int i;

			for (i=0;i<items;i++)
				list[i] = SvIV(ST(i));

			glDeleteRenderbuffersEXT(items, list);
			free(list);
		}
	}
#line 1061 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGenRenderbuffersEXT_c); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGenRenderbuffersEXT_c)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "n, renderbuffers");
    {
	GLsizei	n = (int)SvIV(ST(0))
;
	void *	renderbuffers = INT2PTR(void *,SvIV(ST(1)))
;
#line 497 "lib/OpenGL/V3.xs"
		loadProc(glGenRenderbuffersEXT,"glGenRenderbuffersEXT");
#line 1080 "lib/OpenGL/V3.c"
#line 499 "lib/OpenGL/V3.xs"
	{
		glGenRenderbuffersEXT(n, renderbuffers);
	}
#line 1085 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGenRenderbuffersEXT_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGenRenderbuffersEXT_s)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "n, renderbuffers");
    {
	GLsizei	n = (int)SvIV(ST(0))
;
	SV *	renderbuffers = ST(1)
;
#line 509 "lib/OpenGL/V3.xs"
		loadProc(glGenRenderbuffersEXT,"glGenRenderbuffersEXT");
#line 1104 "lib/OpenGL/V3.c"
#line 511 "lib/OpenGL/V3.xs"
	{
		void * renderbuffers_s = EL(renderbuffers, sizeof(GLuint)*n);
		glGenRenderbuffersEXT(n, renderbuffers_s);
	}
#line 1110 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGenRenderbuffersEXT_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGenRenderbuffersEXT_p)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "n");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GLsizei	n = (int)SvIV(ST(0))
;
#line 521 "lib/OpenGL/V3.xs"
		loadProc(glGenRenderbuffersEXT,"glGenRenderbuffersEXT");
#line 1129 "lib/OpenGL/V3.c"
#line 523 "lib/OpenGL/V3.xs"
	if (n)
	{
		GLuint * renderbuffers = malloc(sizeof(GLuint) * n);
		int i;

		glGenRenderbuffersEXT(n, renderbuffers);

		EXTEND(sp, n);
		for(i=0;i<n;i++)
			PUSHs(sv_2mortal(newSViv(renderbuffers[i])));

		free(renderbuffers);
	}
#line 1144 "lib/OpenGL/V3.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_OpenGL_glRenderbufferStorageEXT); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glRenderbufferStorageEXT)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "target, internalformat, width, height");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	internalformat = (int)SvIV(ST(1))
;
	GLsizei	width = (int)SvIV(ST(2))
;
	GLsizei	height = (int)SvIV(ST(3))
;
#line 545 "lib/OpenGL/V3.xs"
		loadProc(glRenderbufferStorageEXT,"glRenderbufferStorageEXT");
#line 1168 "lib/OpenGL/V3.c"
#line 547 "lib/OpenGL/V3.xs"
	{
		glRenderbufferStorageEXT(target,internalformat,width,height);
	}
#line 1173 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetRenderbufferParameterivEXT_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetRenderbufferParameterivEXT_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 558 "lib/OpenGL/V3.xs"
		loadProc(glGetRenderbufferParameterivEXT,"glGetRenderbufferParameterivEXT");
#line 1194 "lib/OpenGL/V3.c"
#line 560 "lib/OpenGL/V3.xs"
	{
		GLint * params_s = EL(params, sizeof(GLint));
		glGetRenderbufferParameterivEXT(target,pname,params_s);
        }
#line 1200 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetRenderbufferParameterivEXT_c); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetRenderbufferParameterivEXT_c)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "target, pname, params");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	pname = (int)SvIV(ST(1))
;
	void *	params = INT2PTR(void *,SvIV(ST(2)))
;
#line 572 "lib/OpenGL/V3.xs"
		loadProc(glGetRenderbufferParameterivEXT,"glGetRenderbufferParameterivEXT");
#line 1221 "lib/OpenGL/V3.c"
#line 574 "lib/OpenGL/V3.xs"
	{
		glGetRenderbufferParameterivEXT(target,pname,params);
        }
#line 1226 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glIsFramebufferEXT); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glIsFramebufferEXT)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "framebuffer");
    {
	GLuint	framebuffer = (unsigned int)SvUV(ST(0))
;
	GLboolean	RETVAL;
#line 583 "lib/OpenGL/V3.xs"
		loadProc(glIsFramebufferEXT,"glIsFramebufferEXT");
#line 1244 "lib/OpenGL/V3.c"
#line 585 "lib/OpenGL/V3.xs"
	{
		RETVAL = glIsFramebufferEXT(framebuffer);
        }
#line 1249 "lib/OpenGL/V3.c"
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glBindFramebufferEXT); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glBindFramebufferEXT)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "target, framebuffer");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLuint	framebuffer = (unsigned int)SvUV(ST(1))
;
#line 597 "lib/OpenGL/V3.xs"
		loadProc(glBindFramebufferEXT,"glBindFramebufferEXT");
#line 1269 "lib/OpenGL/V3.c"
#line 599 "lib/OpenGL/V3.xs"
	{
		glBindFramebufferEXT(target,framebuffer);
        }
#line 1274 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glDeleteFramebuffersEXT_c); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glDeleteFramebuffersEXT_c)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "n, framebuffers");
    {
	GLsizei	n = (int)SvIV(ST(0))
;
	void *	framebuffers = INT2PTR(void *,SvIV(ST(1)))
;
#line 609 "lib/OpenGL/V3.xs"
		loadProc(glDeleteFramebuffersEXT,"glDeleteFramebuffersEXT");
#line 1293 "lib/OpenGL/V3.c"
#line 611 "lib/OpenGL/V3.xs"
	{
		glDeleteFramebuffersEXT(n,framebuffers);
	}
#line 1298 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glDeleteFramebuffersEXT_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glDeleteFramebuffersEXT_s)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "n, framebuffers");
    {
	GLsizei	n = (int)SvIV(ST(0))
;
	SV *	framebuffers = ST(1)
;
#line 621 "lib/OpenGL/V3.xs"
		loadProc(glDeleteFramebuffersEXT,"glDeleteFramebuffersEXT");
#line 1317 "lib/OpenGL/V3.c"
#line 623 "lib/OpenGL/V3.xs"
	{
		void * framebuffers_s = EL(framebuffers, sizeof(GLuint)*n);
		glDeleteFramebuffersEXT(n,framebuffers_s);
	}
#line 1323 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glDeleteFramebuffersEXT_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glDeleteFramebuffersEXT_p)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
    {
#line 632 "lib/OpenGL/V3.xs"
		loadProc(glDeleteFramebuffersEXT,"glDeleteFramebuffersEXT");
#line 1338 "lib/OpenGL/V3.c"
#line 634 "lib/OpenGL/V3.xs"
	{
		if (items) {
			GLuint * list = malloc(sizeof(GLuint) * items);
			int i;

			for(i=0;i<items;i++)
				list[i] = SvIV(ST(i));

			glDeleteFramebuffersEXT(items, list);
			free(list);
		}
	}
#line 1352 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGenFramebuffersEXT_c); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGenFramebuffersEXT_c)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "n, framebuffers");
    {
	GLsizei	n = (int)SvIV(ST(0))
;
	void *	framebuffers = INT2PTR(void *,SvIV(ST(1)))
;
#line 653 "lib/OpenGL/V3.xs"
		loadProc(glGenFramebuffersEXT,"glGenFramebuffersEXT");
#line 1371 "lib/OpenGL/V3.c"
#line 655 "lib/OpenGL/V3.xs"
	{
		glGenFramebuffersEXT(n,framebuffers);
	}
#line 1376 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGenFramebuffersEXT_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGenFramebuffersEXT_s)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "n, framebuffers");
    {
	GLsizei	n = (int)SvIV(ST(0))
;
	SV *	framebuffers = ST(1)
;
#line 665 "lib/OpenGL/V3.xs"
		loadProc(glGenFramebuffersEXT,"glGenFramebuffersEXT");
#line 1395 "lib/OpenGL/V3.c"
#line 667 "lib/OpenGL/V3.xs"
	{
		void * framebuffers_s = EL(framebuffers, sizeof(GLuint)*n);
		glGenFramebuffersEXT(n,framebuffers_s);
	}
#line 1401 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGenFramebuffersEXT_p); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGenFramebuffersEXT_p)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "n");
    PERL_UNUSED_VAR(ax); /* -Wall */
    SP -= items;
    {
	GLsizei	n = (int)SvIV(ST(0))
;
#line 677 "lib/OpenGL/V3.xs"
		loadProc(glGenFramebuffersEXT,"glGenFramebuffersEXT");
#line 1420 "lib/OpenGL/V3.c"
#line 679 "lib/OpenGL/V3.xs"
	if (n)
	{
		GLuint * framebuffers = malloc(sizeof(GLuint) * n);
		int i;

		glGenFramebuffersEXT(n, framebuffers);

		EXTEND(sp, n);
		for(i=0;i<n;i++)
			PUSHs(sv_2mortal(newSViv(framebuffers[i])));

		free(framebuffers);
	}
#line 1435 "lib/OpenGL/V3.c"
	PUTBACK;
	return;
    }
}


XS_EUPXS(XS_OpenGL_glCheckFramebufferStatusEXT); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glCheckFramebufferStatusEXT)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "target");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	RETVAL;
	dXSTARG;
#line 698 "lib/OpenGL/V3.xs"
		loadProc(glCheckFramebufferStatusEXT,"glCheckFramebufferStatusEXT");
#line 1455 "lib/OpenGL/V3.c"
#line 700 "lib/OpenGL/V3.xs"
	{
		RETVAL = glCheckFramebufferStatusEXT(target);
	}
#line 1460 "lib/OpenGL/V3.c"
	XSprePUSH;
	PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glFramebufferTexture1DEXT); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glFramebufferTexture1DEXT)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "target, attachment, textarget, texture, level");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	attachment = (int)SvIV(ST(1))
;
	GLenum	textarget = (int)SvIV(ST(2))
;
	GLuint	texture = (unsigned int)SvUV(ST(3))
;
	GLint	level = (int)SvIV(ST(4))
;
#line 715 "lib/OpenGL/V3.xs"
		loadProc(glFramebufferTexture1DEXT,"glFramebufferTexture1DEXT");
#line 1487 "lib/OpenGL/V3.c"
#line 717 "lib/OpenGL/V3.xs"
	{
		glFramebufferTexture1DEXT(target,attachment,textarget,texture,level);
	}
#line 1492 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glFramebufferTexture2DEXT); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glFramebufferTexture2DEXT)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "target, attachment, textarget, texture, level");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	attachment = (int)SvIV(ST(1))
;
	GLenum	textarget = (int)SvIV(ST(2))
;
	GLuint	texture = (unsigned int)SvUV(ST(3))
;
	GLint	level = (int)SvIV(ST(4))
;
#line 730 "lib/OpenGL/V3.xs"
		loadProc(glFramebufferTexture2DEXT,"glFramebufferTexture2DEXT");
#line 1517 "lib/OpenGL/V3.c"
#line 732 "lib/OpenGL/V3.xs"
	{
		glFramebufferTexture2DEXT(target,attachment,textarget,texture,level);
	}
#line 1522 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glFramebufferTexture3DEXT); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glFramebufferTexture3DEXT)
{
    dVAR; dXSARGS;
    if (items != 6)
       croak_xs_usage(cv,  "target, attachment, textarget, texture, level, zoffset");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	attachment = (int)SvIV(ST(1))
;
	GLenum	textarget = (int)SvIV(ST(2))
;
	GLuint	texture = (unsigned int)SvUV(ST(3))
;
	GLint	level = (int)SvIV(ST(4))
;
	GLint	zoffset = (int)SvIV(ST(5))
;
#line 746 "lib/OpenGL/V3.xs"
		loadProc(glFramebufferTexture3DEXT,"glFramebufferTexture3DEXT");
#line 1549 "lib/OpenGL/V3.c"
#line 748 "lib/OpenGL/V3.xs"
	{
		glFramebufferTexture3DEXT(target,attachment,textarget,texture,level,zoffset);
	}
#line 1554 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glFramebufferRenderbufferEXT); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glFramebufferRenderbufferEXT)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "target, attachment, renderbuffertarget, renderbuffer");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	attachment = (int)SvIV(ST(1))
;
	GLenum	renderbuffertarget = (int)SvIV(ST(2))
;
	GLuint	renderbuffer = (unsigned int)SvUV(ST(3))
;
#line 760 "lib/OpenGL/V3.xs"
		loadProc(glFramebufferRenderbufferEXT,"glFramebufferRenderbufferEXT");
#line 1577 "lib/OpenGL/V3.c"
#line 762 "lib/OpenGL/V3.xs"
	{
		glFramebufferRenderbufferEXT(target,attachment,renderbuffertarget,renderbuffer);
	}
#line 1582 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetFramebufferAttachmentParameterivEXT_s); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetFramebufferAttachmentParameterivEXT_s)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "target, attachment, pname, params");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	attachment = (int)SvIV(ST(1))
;
	GLenum	pname = (int)SvIV(ST(2))
;
	SV *	params = ST(3)
;
#line 774 "lib/OpenGL/V3.xs"
		loadProc(glGetFramebufferAttachmentParameterivEXT,"glGetFramebufferAttachmentParameterivEXT");
#line 1605 "lib/OpenGL/V3.c"
#line 776 "lib/OpenGL/V3.xs"
	{
		GLint * params_s = EL(params, sizeof(GLint));
		glGetFramebufferAttachmentParameterivEXT(target,attachment,pname,params_s);
        }
#line 1611 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGetFramebufferAttachmentParameterivEXT_c); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGetFramebufferAttachmentParameterivEXT_c)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "target, attachment, pname, params");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	attachment = (int)SvIV(ST(1))
;
	GLenum	pname = (int)SvIV(ST(2))
;
	void *	params = INT2PTR(void *,SvIV(ST(3)))
;
#line 789 "lib/OpenGL/V3.xs"
		loadProc(glGetFramebufferAttachmentParameterivEXT,"glGetFramebufferAttachmentParameterivEXT");
#line 1634 "lib/OpenGL/V3.c"
#line 791 "lib/OpenGL/V3.xs"
	{
		glGetFramebufferAttachmentParameterivEXT(target,attachment,pname,params);
        }
#line 1639 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glGenerateMipmapEXT); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glGenerateMipmapEXT)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "target");
    {
	GLenum	target = (int)SvIV(ST(0))
;
#line 800 "lib/OpenGL/V3.xs"
		loadProc(glGenerateMipmapEXT,"glGenerateMipmapEXT");
#line 1656 "lib/OpenGL/V3.c"
#line 802 "lib/OpenGL/V3.xs"
	{
		glGenerateMipmapEXT(target);
        }
#line 1661 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}

#endif // GL_EXT_framebuffer_object
#ifdef GL_ARB_color_buffer_float
#define XSubPPtmpAAAD 1


XS_EUPXS(XS_OpenGL_glClampColorARB); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glClampColorARB)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "target, clamp");
    {
	GLenum	target = (int)SvIV(ST(0))
;
	GLenum	clamp = (int)SvIV(ST(1))
;
#line 816 "lib/OpenGL/V3.xs"
		loadProc(glClampColorARB,"glClampColorARB");
#line 1684 "lib/OpenGL/V3.c"
#line 818 "lib/OpenGL/V3.xs"
	{
		glClampColorARB(target,clamp);
	}
#line 1689 "lib/OpenGL/V3.c"
    }
    XSRETURN_EMPTY;
}

#endif
#endif /* HAVE_GL */
#ifdef __cplusplus
extern "C" {
#endif
XS_EXTERNAL(boot_OpenGL__V3); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_OpenGL__V3)
{
#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::glIsRenderbuffer", XS_OpenGL_glIsRenderbuffer);
        newXS_deffile("OpenGL::glBindRenderbuffer", XS_OpenGL_glBindRenderbuffer);
        newXS_deffile("OpenGL::glDeleteRenderbuffers_c", XS_OpenGL_glDeleteRenderbuffers_c);
        newXS_deffile("OpenGL::glDeleteRenderbuffers_s", XS_OpenGL_glDeleteRenderbuffers_s);
        newXS_deffile("OpenGL::glDeleteRenderbuffers_p", XS_OpenGL_glDeleteRenderbuffers_p);
        newXS_deffile("OpenGL::glGenRenderbuffers_c", XS_OpenGL_glGenRenderbuffers_c);
        newXS_deffile("OpenGL::glGenRenderbuffers_s", XS_OpenGL_glGenRenderbuffers_s);
        newXS_deffile("OpenGL::glGenRenderbuffers_p", XS_OpenGL_glGenRenderbuffers_p);
        newXS_deffile("OpenGL::glRenderbufferStorage", XS_OpenGL_glRenderbufferStorage);
        newXS_deffile("OpenGL::glGetRenderbufferParameteriv_s", XS_OpenGL_glGetRenderbufferParameteriv_s);
        newXS_deffile("OpenGL::glGetRenderbufferParameteriv_c", XS_OpenGL_glGetRenderbufferParameteriv_c);
        newXS_deffile("OpenGL::glIsFramebuffer", XS_OpenGL_glIsFramebuffer);
        newXS_deffile("OpenGL::glBindFramebuffer", XS_OpenGL_glBindFramebuffer);
        newXS_deffile("OpenGL::glDeleteFramebuffers_c", XS_OpenGL_glDeleteFramebuffers_c);
        newXS_deffile("OpenGL::glDeleteFramebuffers_s", XS_OpenGL_glDeleteFramebuffers_s);
        newXS_deffile("OpenGL::glDeleteFramebuffers_p", XS_OpenGL_glDeleteFramebuffers_p);
        newXS_deffile("OpenGL::glGenFramebuffers_c", XS_OpenGL_glGenFramebuffers_c);
        newXS_deffile("OpenGL::glGenFramebuffers_s", XS_OpenGL_glGenFramebuffers_s);
        newXS_deffile("OpenGL::glGenFramebuffers_p", XS_OpenGL_glGenFramebuffers_p);
        newXS_deffile("OpenGL::glCheckFramebufferStatus", XS_OpenGL_glCheckFramebufferStatus);
        newXS_deffile("OpenGL::glFramebufferTexture1D", XS_OpenGL_glFramebufferTexture1D);
        newXS_deffile("OpenGL::glFramebufferTexture2D", XS_OpenGL_glFramebufferTexture2D);
        newXS_deffile("OpenGL::glFramebufferTexture3D", XS_OpenGL_glFramebufferTexture3D);
        newXS_deffile("OpenGL::glFramebufferRenderbuffer", XS_OpenGL_glFramebufferRenderbuffer);
        newXS_deffile("OpenGL::glGetFramebufferAttachmentParameteriv_s", XS_OpenGL_glGetFramebufferAttachmentParameteriv_s);
        newXS_deffile("OpenGL::glGetFramebufferAttachmentParameteriv_c", XS_OpenGL_glGetFramebufferAttachmentParameteriv_c);
        newXS_deffile("OpenGL::glGenerateMipmap", XS_OpenGL_glGenerateMipmap);
        newXS_deffile("OpenGL::glGenVertexArrays_p", XS_OpenGL_glGenVertexArrays_p);
        newXS_deffile("OpenGL::glBindVertexArray", XS_OpenGL_glBindVertexArray);
        newXS_deffile("OpenGL::glDeleteVertexArrays_p", XS_OpenGL_glDeleteVertexArrays_p);
#endif
#if XSubPPtmpAAAB
        newXS_deffile("OpenGL::glDrawElementsBaseVertex_c", XS_OpenGL_glDrawElementsBaseVertex_c);
#endif
#if XSubPPtmpAAAC
        newXS_deffile("OpenGL::glIsRenderbufferEXT", XS_OpenGL_glIsRenderbufferEXT);
        newXS_deffile("OpenGL::glBindRenderbufferEXT", XS_OpenGL_glBindRenderbufferEXT);
        newXS_deffile("OpenGL::glDeleteRenderbuffersEXT_c", XS_OpenGL_glDeleteRenderbuffersEXT_c);
        newXS_deffile("OpenGL::glDeleteRenderbuffersEXT_s", XS_OpenGL_glDeleteRenderbuffersEXT_s);
        newXS_deffile("OpenGL::glDeleteRenderbuffersEXT_p", XS_OpenGL_glDeleteRenderbuffersEXT_p);
        newXS_deffile("OpenGL::glGenRenderbuffersEXT_c", XS_OpenGL_glGenRenderbuffersEXT_c);
        newXS_deffile("OpenGL::glGenRenderbuffersEXT_s", XS_OpenGL_glGenRenderbuffersEXT_s);
        newXS_deffile("OpenGL::glGenRenderbuffersEXT_p", XS_OpenGL_glGenRenderbuffersEXT_p);
        newXS_deffile("OpenGL::glRenderbufferStorageEXT", XS_OpenGL_glRenderbufferStorageEXT);
        newXS_deffile("OpenGL::glGetRenderbufferParameterivEXT_s", XS_OpenGL_glGetRenderbufferParameterivEXT_s);
        newXS_deffile("OpenGL::glGetRenderbufferParameterivEXT_c", XS_OpenGL_glGetRenderbufferParameterivEXT_c);
        newXS_deffile("OpenGL::glIsFramebufferEXT", XS_OpenGL_glIsFramebufferEXT);
        newXS_deffile("OpenGL::glBindFramebufferEXT", XS_OpenGL_glBindFramebufferEXT);
        newXS_deffile("OpenGL::glDeleteFramebuffersEXT_c", XS_OpenGL_glDeleteFramebuffersEXT_c);
        newXS_deffile("OpenGL::glDeleteFramebuffersEXT_s", XS_OpenGL_glDeleteFramebuffersEXT_s);
        newXS_deffile("OpenGL::glDeleteFramebuffersEXT_p", XS_OpenGL_glDeleteFramebuffersEXT_p);
        newXS_deffile("OpenGL::glGenFramebuffersEXT_c", XS_OpenGL_glGenFramebuffersEXT_c);
        newXS_deffile("OpenGL::glGenFramebuffersEXT_s", XS_OpenGL_glGenFramebuffersEXT_s);
        newXS_deffile("OpenGL::glGenFramebuffersEXT_p", XS_OpenGL_glGenFramebuffersEXT_p);
        newXS_deffile("OpenGL::glCheckFramebufferStatusEXT", XS_OpenGL_glCheckFramebufferStatusEXT);
        newXS_deffile("OpenGL::glFramebufferTexture1DEXT", XS_OpenGL_glFramebufferTexture1DEXT);
        newXS_deffile("OpenGL::glFramebufferTexture2DEXT", XS_OpenGL_glFramebufferTexture2DEXT);
        newXS_deffile("OpenGL::glFramebufferTexture3DEXT", XS_OpenGL_glFramebufferTexture3DEXT);
        newXS_deffile("OpenGL::glFramebufferRenderbufferEXT", XS_OpenGL_glFramebufferRenderbufferEXT);
        newXS_deffile("OpenGL::glGetFramebufferAttachmentParameterivEXT_s", XS_OpenGL_glGetFramebufferAttachmentParameterivEXT_s);
        newXS_deffile("OpenGL::glGetFramebufferAttachmentParameterivEXT_c", XS_OpenGL_glGetFramebufferAttachmentParameterivEXT_c);
        newXS_deffile("OpenGL::glGenerateMipmapEXT", XS_OpenGL_glGenerateMipmapEXT);
#endif
#if XSubPPtmpAAAD
        newXS_deffile("OpenGL::glClampColorARB", XS_OpenGL_glClampColorARB);
#endif

    /* Initialisation Section */

#if XSubPPtmpAAAA
#endif
#if XSubPPtmpAAAB
#endif
#if XSubPPtmpAAAC
#endif
#if XSubPPtmpAAAD
#endif
#line 1802 "lib/OpenGL/V3.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
