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

#line 1 "pogl_glut.xs"
/*  Last saved: Tue 02 Apr 2013 02:45:10 PM */

/*  Copyright (c) 1998 Kenneth Albanowski. All rights reserved.
 *  Copyright (c) 2007 Bob Free. All rights reserved.
 *  Copyright (c) 2009 Chris Marshall. All rights reserved.
 *  Copyright (c) 2015 Bob Free. 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"


/* glut_util.h is where you include the appropriate GLUT header
 * file based on what is available.  It also defines some constants
 * that may not be defined everywhere.  Replace this by user
 * specified include information for the include and compile-time
 * perl constants rather than some special cases
 */
#include "glut_util.h"


/* TODO: calculate this from the actual GLUT include file */
#ifndef GLUT_API_VERSION
#define GLUT_API_VERSION 4
#endif

static int _done_glutInit = 0;
static int _done_glutCloseFunc_warn = 0;


/* Macros for GLUT callback and handler declarations */
#  define DO_perl_call_sv(handler, flag) perl_call_sv(handler, flag)
#  define ENSURE_callback_thread
#  define GLUT_PUSH_NEW_SV(sv)		XPUSHs(sv_2mortal(newSVsv(sv)))
#  define GLUT_PUSH_NEW_IV(i)		XPUSHs(sv_2mortal(newSViv(i)))
#  define GLUT_PUSH_NEW_U8(c)		XPUSHs(sv_2mortal(newSViv((int)c)))
#  define GLUT_EXTEND_STACK(sp,n)
#  define GLUT_PUSHMARK(sp)		PUSHMARK(sp)


/* Set up for all the GLUT callback handlers */
static AV * glut_handlers = 0;

/* Attach a handler to a window */
static void set_glut_win_handler(int win, int type, SV * data)
{
	SV ** h;
	AV * a;
	
	if (!glut_handlers)
		glut_handlers = newAV();
	
	h = av_fetch(glut_handlers, win, FALSE);
	
	if (!h) {
		a = newAV();
		av_store(glut_handlers, win, newRV_inc((SV*)a));
		SvREFCNT_dec(a);
	} else if (!SvOK(*h) || !SvROK(*h))
		croak("Unable to establish glut handler");
	else 
		a = (AV*)SvRV(*h);
	
	av_store(a, type, newRV_inc(data));
	SvREFCNT_dec(data);
}

/* Get a window's handler */
static SV * get_glut_win_handler(int win, int type)
{
	SV ** h;
	
	if (!glut_handlers)
		croak("Unable to locate glut handler");
	
	h = av_fetch(glut_handlers, win, FALSE);

	if (!h || !SvOK(*h) || !SvROK(*h))
		croak("Unable to locate glut handler");
	
	h = av_fetch((AV*)SvRV(*h), type, FALSE);
	
	if (!h || !SvOK(*h) || !SvROK(*h))
		croak("Unable to locate glut handler");

	return SvRV(*h);
}

/* Release a window's handlers */
static void destroy_glut_win_handlers(int win)
{
	SV ** h;
	
	if (!glut_handlers)
		return;
	
	h = av_fetch(glut_handlers, win, FALSE);
	
	if (!h || !SvOK(*h) || !SvROK(*h))
		return;

	av_store(glut_handlers, win, newSVsv(&PL_sv_undef));
}

/* Release a handler */
static void destroy_glut_win_handler(int win, int type)
{
	SV ** h;
	AV * a;
	
	if (!glut_handlers)
		glut_handlers = newAV();
	
	h = av_fetch(glut_handlers, win, FALSE);
	
	if (!h || !SvOK(*h) || !SvROK(*h))
		return;

	a = (AV*)SvRV(*h);
	
	av_store(a, type, newSVsv(&PL_sv_undef));
}

/* Begin window callback definition */
#define begin_decl_gwh(type, params, nparam)				\
									\
static void generic_glut_ ## type ## _handler params			\
{									\
	int win = glutGetWindow();					\
	AV * handler_data = (AV*)get_glut_win_handler(win, HANDLE_GLUT_ ## type);\
	SV * handler;							\
	int i;								\
	dSP;								\
									\
	handler = *av_fetch(handler_data, 0, 0);			\
									\
	GLUT_PUSHMARK(sp);						\
	GLUT_EXTEND_STACK(sp,av_len(handler_data)+nparam);		\
	for (i=1;i<=av_len(handler_data);i++)				\
		GLUT_PUSH_NEW_SV(*av_fetch(handler_data, i, 0));

/* End window callback definition */
#define end_decl_gwh()							\
	PUTBACK;							\
	DO_perl_call_sv(handler, G_DISCARD);				\
}

/* Activate a window callback handler */
#define decl_gwh_xs(type)						\
	{								\
		int win = glutGetWindow();				\
									\
		if (!handler || !SvOK(handler)) {			\
			destroy_glut_win_handler(win, HANDLE_GLUT_ ## type);\
			glut ## type ## Func(NULL);			\
		} else {						\
			AV * handler_data = newAV();			\
									\
			PackCallbackST(handler_data, 0);		\
									\
			set_glut_win_handler(win, HANDLE_GLUT_ ## type, (SV*)handler_data);\
									\
			glut ## type ## Func(generic_glut_ ## type ## _handler);\
		}							\
	ENSURE_callback_thread;}

/* Activate a window callback handler; die on failure */
#define decl_gwh_xs_nullfail(type, fail)				\
	{								\
		int win = glutGetWindow();				\
									\
		if (!handler || !SvOK(handler)) {			\
			croak fail;					\
		} else {						\
			AV * handler_data = newAV();			\
									\
			PackCallbackST(handler_data, 0);		\
									\
			set_glut_win_handler(win, HANDLE_GLUT_ ## type, (SV*)handler_data);\
									\
			glut ## type ## Func(generic_glut_ ## type ## _handler);\
		}							\
	ENSURE_callback_thread;}


/* Activate a global state callback handler */
#define decl_ggh_xs(type)						\
	{								\
		if (glut_ ## type ## _handler_data)			\
			SvREFCNT_dec(glut_ ## type ## _handler_data);	\
									\
		if (!handler || !SvOK(handler)) {			\
			glut_ ## type ## _handler_data = 0;		\
			glut ## type ## Func(NULL);			\
		} else {						\
			AV * handler_data = newAV();			\
									\
			PackCallbackST(handler_data, 0);		\
									\
			glut_ ## type ## _handler_data = handler_data;	\
									\
			glut ## type ## Func(generic_glut_ ## type ## _handler);\
		}							\
	ENSURE_callback_thread;}


/* Begin a global state callback definition */
#define begin_decl_ggh(type, params, nparam)				\
									\
static AV * glut_ ## type ## _handler_data = 0;				\
									\
static void generic_glut_ ## type ## _handler params			\
{									\
	AV * handler_data = glut_ ## type ## _handler_data;		\
	SV * handler;							\
	int i;								\
	dSP;								\
									\
	handler = *av_fetch(handler_data, 0, 0);			\
									\
	GLUT_PUSHMARK(sp);						\
	GLUT_EXTEND_STACK(sp,av_len(handler_data)+nparam);		\
	for (i=1;i<=av_len(handler_data);i++)				\
		GLUT_PUSH_NEW_SV(*av_fetch(handler_data, i, 0));

/* End a global state callback definition */
#define end_decl_ggh()							\
	PUTBACK;							\
	DO_perl_call_sv(handler, G_DISCARD);				\
}

/* Define callbacks */
enum {
	HANDLE_GLUT_Display,
	HANDLE_GLUT_OverlayDisplay,
	HANDLE_GLUT_Reshape,
	HANDLE_GLUT_Keyboard,
	HANDLE_GLUT_KeyboardUp,
	HANDLE_GLUT_Mouse,
    HANDLE_GLUT_MouseWheel,             /* Open/FreeGLUT -chm */
	HANDLE_GLUT_Motion,
	HANDLE_GLUT_PassiveMotion,
	HANDLE_GLUT_Entry,
	HANDLE_GLUT_Visibility,
	HANDLE_GLUT_WindowStatus,
	HANDLE_GLUT_Special,
	HANDLE_GLUT_SpecialUp,
    HANDLE_GLUT_Joystick,               /* Open/FreeGLUT -chm */
	HANDLE_GLUT_SpaceballMotion,
	HANDLE_GLUT_SpaceballRotate,
	HANDLE_GLUT_SpaceballButton,
	HANDLE_GLUT_ButtonBox,
	HANDLE_GLUT_Dials,
	HANDLE_GLUT_TabletMotion,
	HANDLE_GLUT_TabletButton,
    HANDLE_GLUT_MenuDestroy,            /* Open/FreeGLUT -chm */
	HANDLE_GLUT_Close,                  /* Open/FreeGLUT -chm */
	HANDLE_GLUT_WMClose,                /* AGL GLUT      -chm */
};

/* Callback for glutDisplayFunc */
begin_decl_gwh(Display, (void), 0)
end_decl_gwh()

/* Callback for glutOverlayDisplayFunc */
begin_decl_gwh(OverlayDisplay, (void), 0)
end_decl_gwh()

/* Callback for glutReshapeFunc */
begin_decl_gwh(Reshape, (int width, int height), 2)
	GLUT_PUSH_NEW_IV(width);
	GLUT_PUSH_NEW_IV(height);
end_decl_gwh()

/* Callback for glutKeyboardFunc */
begin_decl_gwh(Keyboard, (unsigned char key, int width, int height), 3)
	GLUT_PUSH_NEW_U8(key);
	GLUT_PUSH_NEW_IV(width);
	GLUT_PUSH_NEW_IV(height);
end_decl_gwh()

/* Callback for glutKeyboardUpFunc */
begin_decl_gwh(KeyboardUp, (unsigned char key, int width, int height), 3)
	GLUT_PUSH_NEW_U8(key);
	GLUT_PUSH_NEW_IV(width);
	GLUT_PUSH_NEW_IV(height);
end_decl_gwh()

/* Callback for glutMouseFunc */
begin_decl_gwh(Mouse, (int button, int state, int x, int y), 4)
	GLUT_PUSH_NEW_IV(button);
	GLUT_PUSH_NEW_IV(state);
	GLUT_PUSH_NEW_IV(x);
	GLUT_PUSH_NEW_IV(y);
end_decl_gwh()

/* Callback for glutMouseWheelFunc */	/* Open/FreeGLUT -chm */
begin_decl_gwh(MouseWheel, (int wheel, int direction, int x, int y), 4)
	GLUT_PUSH_NEW_IV(wheel);
	GLUT_PUSH_NEW_IV(direction);
	GLUT_PUSH_NEW_IV(x);
	GLUT_PUSH_NEW_IV(y);
end_decl_gwh()

/* Callback for glutPassiveMotionFunc */
begin_decl_gwh(PassiveMotion, (int x, int y), 2)
	GLUT_PUSH_NEW_IV(x);
	GLUT_PUSH_NEW_IV(y);
end_decl_gwh()

/* Callback for glutMotionFunc */
begin_decl_gwh(Motion, (int x, int y), 2)
	GLUT_PUSH_NEW_IV(x);
	GLUT_PUSH_NEW_IV(y);
end_decl_gwh()

/* Callback for glutVisibilityFunc */
begin_decl_gwh(Visibility, (int state), 1)
	GLUT_PUSH_NEW_IV(state);
end_decl_gwh()

/* Callback for glutWindowStatusFunc */
begin_decl_gwh(WindowStatus, (int state), 1)
	GLUT_PUSH_NEW_IV(state);
end_decl_gwh()

/* Callback for glutEntryFunc */
begin_decl_gwh(Entry, (int state), 1)
	GLUT_PUSH_NEW_IV(state);
end_decl_gwh()

/* Callback for glutSpecialFunc */
begin_decl_gwh(Special, (int key, int width, int height), 3)
	GLUT_PUSH_NEW_IV(key);
	GLUT_PUSH_NEW_IV(width);
	GLUT_PUSH_NEW_IV(height);
end_decl_gwh()

/* Callback for glutSpecialUpFunc */
begin_decl_gwh(SpecialUp, (int key, int width, int height), 3)
	GLUT_PUSH_NEW_IV(key);
	GLUT_PUSH_NEW_IV(width);
	GLUT_PUSH_NEW_IV(height);
end_decl_gwh()

/* Callback for glutJoystickFunc */	/* Open/FreeGLUT -chm */
begin_decl_gwh(Joystick, (unsigned int buttons, int xaxis, int yaxis, int zaxis), 4)
	GLUT_PUSH_NEW_IV(buttons);
	GLUT_PUSH_NEW_IV(xaxis);
	GLUT_PUSH_NEW_IV(yaxis);
	GLUT_PUSH_NEW_IV(zaxis);
end_decl_gwh()


/* Callback for glutSpaceballMotionFunc */
begin_decl_gwh(SpaceballMotion, (int x, int y, int z), 3)
	GLUT_PUSH_NEW_IV(x);
	GLUT_PUSH_NEW_IV(y);
	GLUT_PUSH_NEW_IV(z);
end_decl_gwh()

/* Callback for glutSpaceballRotateFunc */
begin_decl_gwh(SpaceballRotate, (int x, int y, int z), 3)
	GLUT_PUSH_NEW_IV(x);
	GLUT_PUSH_NEW_IV(y);
	GLUT_PUSH_NEW_IV(z);
end_decl_gwh()

/* Callback for glutSpaceballButtonFunc */
begin_decl_gwh(SpaceballButton, (int button, int state), 2)
	GLUT_PUSH_NEW_IV(button);
	GLUT_PUSH_NEW_IV(state);
end_decl_gwh()

/* Callback for glutButtonBoxFunc */
begin_decl_gwh(ButtonBox, (int button, int state), 2)
	GLUT_PUSH_NEW_IV(button);
	GLUT_PUSH_NEW_IV(state);
end_decl_gwh()

/* Callback for glutDialsFunc */
begin_decl_gwh(Dials, (int dial, int value), 2)
	GLUT_PUSH_NEW_IV(dial);
	GLUT_PUSH_NEW_IV(value);
end_decl_gwh()

/* Callback for glutTabletMotionFunc */
begin_decl_gwh(TabletMotion, (int x, int y), 2)
	GLUT_PUSH_NEW_IV(x);
	GLUT_PUSH_NEW_IV(y);
end_decl_gwh()

/* Callback for glutTabletButtonFunc */
begin_decl_gwh(TabletButton, (int button, int state, int x, int y), 4)
	GLUT_PUSH_NEW_IV(button);
	GLUT_PUSH_NEW_IV(state);
	GLUT_PUSH_NEW_IV(x);
	GLUT_PUSH_NEW_IV(y);
end_decl_gwh()

/* Callback for glutIdleFunc */
begin_decl_ggh(Idle, (void), 0)
end_decl_ggh()

/* Callback for glutMenuStatusFunc */
begin_decl_ggh(MenuStatus, (int status, int x, int y), 3)
	GLUT_PUSH_NEW_IV(status);
	GLUT_PUSH_NEW_IV(x);
	GLUT_PUSH_NEW_IV(y);
end_decl_ggh()

/* Callback for glutMenuStateFunc */
begin_decl_ggh(MenuState, (int status), 1)
	GLUT_PUSH_NEW_IV(status);
end_decl_ggh()

/* Callback for glutMenuDestroyFunc */		/* Open/FreeGLUT -chm */
begin_decl_gwh(MenuDestroy, (void), 0)
end_decl_gwh()

/* Callback for glutCloseFunc */
#ifdef HAVE_AGL_GLUT
static void generic_glut_WMClose_handler(void)
#else
static void generic_glut_Close_handler(void)
#endif
{
	int win = glutGetWindow();
	AV * handler_data = (AV*)get_glut_win_handler(win, HANDLE_GLUT_Close);
	SV * handler = *av_fetch(handler_data, 0, 0);
	dSP;

	GLUT_PUSHMARK(sp);
	GLUT_EXTEND_STACK(sp,1);
	GLUT_PUSH_NEW_IV(win);

	PUTBACK;
	DO_perl_call_sv(handler, G_DISCARD);
}

/* Callback for glutTimerFunc */
static void generic_glut_timer_handler(int value)
{
	AV * handler_data = (AV*)value;
	SV * handler;
	int i;
	dSP;

	handler = *av_fetch(handler_data, 0, 0);

	GLUT_PUSHMARK(sp);
	GLUT_EXTEND_STACK(sp,av_len(handler_data));
	for (i=1;i<=av_len(handler_data);i++)
		GLUT_PUSH_NEW_SV(*av_fetch(handler_data, i, 0));

	PUTBACK;
	DO_perl_call_sv(handler, G_DISCARD);
	
	SvREFCNT_dec(handler_data);
}

static AV * glut_menu_handlers = 0;

/* Callback for glutMenuFunc */
static void generic_glut_menu_handler(int value)
{
	AV * handler_data;
	SV * handler;
	SV ** h;
	int i;
	dSP;
	
	h = av_fetch(glut_menu_handlers, glutGetMenu(), FALSE);
	if (!h || !SvOK(*h) || !SvROK(*h))
		croak("Unable to locate menu handler");
	
	handler_data = (AV*)SvRV(*h);

	handler = *av_fetch(handler_data, 0, 0);

	GLUT_PUSHMARK(sp);
	GLUT_EXTEND_STACK(sp,av_len(handler_data) + 1);
	for (i=1;i<=av_len(handler_data);i++)
		GLUT_PUSH_NEW_SV(*av_fetch(handler_data, i, 0));

	GLUT_PUSH_NEW_IV(value);

	PUTBACK;
	DO_perl_call_sv(handler, G_DISCARD);
}
/* End of set up for GLUT callback stuff */



#line 508 "pogl_glut.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 652 "pogl_glut.c"

XS_EUPXS(XS_OpenGL_done_glutInit); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_done_glutInit)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
	int	RETVAL;
	dXSTARG;
#line 504 "pogl_glut.xs"
	RETVAL = _done_glutInit;
#line 665 "pogl_glut.c"
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glutInit); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutInit)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
#line 515 "pogl_glut.xs"
	{
	int argc;
	char ** argv;
	AV * ARGV;
	SV * ARGV0;
	SV * sv;
	int i;

			if (_done_glutInit)
				croak("illegal glutInit() reinitialization attempt");

			argv  = 0;
			ARGV = perl_get_av("ARGV", FALSE);
			ARGV0 = perl_get_sv("0", FALSE);

			argc = av_len(ARGV)+2;
			if (argc) {
				argv = malloc(sizeof(char*)*argc);
				argv[0] = SvPV(ARGV0, PL_na);
				for(i=0;i<=av_len(ARGV);i++)
					argv[i+1] = SvPV(*av_fetch(ARGV, i, 0), PL_na);
			}

			i = argc;
			glutInit(&argc, argv);

			_done_glutInit = 1;

			while(argc<i--)
				sv = av_shift(ARGV);

			if (argv)
				free(argv);
	}
#line 714 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutInitWindowSize); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutInitWindowSize)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "width, height");
    {
	int	width = (int)SvIV(ST(0))
;
	int	height = (int)SvIV(ST(1))
;

	glutInitWindowSize(width, height);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutInitWindowPosition); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutInitWindowPosition)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "x, y");
    {
	int	x = (int)SvIV(ST(0))
;
	int	y = (int)SvIV(ST(1))
;

	glutInitWindowPosition(x, y);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutInitDisplayMode); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutInitDisplayMode)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "mode");
    {
	int	mode = (int)SvIV(ST(0))
;

	glutInitDisplayMode(mode);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutInitDisplayString); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutInitDisplayString)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "string");
    {
	char *	string = (char *)SvPV_nolen(ST(0))
;

	glutInitDisplayString(string);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutMainLoop); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutMainLoop)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutMainLoop();
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutCreateWindow); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutCreateWindow)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "name");
    {
	char *	name = (char *)SvPV_nolen(ST(0))
;
	int	RETVAL;
	dXSTARG;
#line 581 "pogl_glut.xs"
	RETVAL = glutCreateWindow(name);
	destroy_glut_win_handlers(RETVAL);
#line 816 "pogl_glut.c"
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glutCreateSubWindow); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutCreateSubWindow)
{
    dVAR; dXSARGS;
    if (items != 5)
       croak_xs_usage(cv,  "win, x, y, width, height");
    {
	int	win = (int)SvIV(ST(0))
;
	int	x = (int)SvIV(ST(1))
;
	int	y = (int)SvIV(ST(2))
;
	int	width = (int)SvIV(ST(3))
;
	int	height = (int)SvIV(ST(4))
;
	int	RETVAL;
	dXSTARG;
#line 595 "pogl_glut.xs"
	RETVAL = glutCreateSubWindow(win, x, y, width, height);
	destroy_glut_win_handlers(RETVAL);
#line 845 "pogl_glut.c"
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glutSetWindow); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSetWindow)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "win");
    {
	int	win = (int)SvIV(ST(0))
;

	glutSetWindow(win);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutGetWindow); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutGetWindow)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
	int	RETVAL;
	dXSTARG;

	RETVAL = glutGetWindow();
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glutDestroyWindow); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutDestroyWindow)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "win");
    {
	int	win = (int)SvIV(ST(0))
;
#line 614 "pogl_glut.xs"
	glutDestroyWindow(win);
	destroy_glut_win_handlers(win);
#line 897 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutPostRedisplay); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutPostRedisplay)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutPostRedisplay();
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutSwapBuffers); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSwapBuffers)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutSwapBuffers();
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutPositionWindow); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutPositionWindow)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "x, y");
    {
	int	x = (int)SvIV(ST(0))
;
	int	y = (int)SvIV(ST(1))
;

	glutPositionWindow(x, y);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutReshapeWindow); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutReshapeWindow)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "width, height");
    {
	int	width = (int)SvIV(ST(0))
;
	int	height = (int)SvIV(ST(1))
;

	glutReshapeWindow(width, height);
    }
    XSRETURN_EMPTY;
}

#if GLUT_API_VERSION >= 3
#define XSubPPtmpAAAA 1


XS_EUPXS(XS_OpenGL_glutFullScreen); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutFullScreen)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutFullScreen();
    }
    XSRETURN_EMPTY;
}

#endif

XS_EUPXS(XS_OpenGL_glutPopWindow); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutPopWindow)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutPopWindow();
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutPushWindow); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutPushWindow)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutPushWindow();
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutShowWindow); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutShowWindow)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutShowWindow();
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutHideWindow); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutHideWindow)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutHideWindow();
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutIconifyWindow); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutIconifyWindow)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutIconifyWindow();
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutSetWindowTitle); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSetWindowTitle)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "title");
    {
	char *	title = (char *)SvPV_nolen(ST(0))
;

	glutSetWindowTitle(title);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutSetIconTitle); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSetIconTitle)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "title");
    {
	char *	title = (char *)SvPV_nolen(ST(0))
;

	glutSetIconTitle(title);
    }
    XSRETURN_EMPTY;
}

#if GLUT_API_VERSION >= 3
#define XSubPPtmpAAAB 1


XS_EUPXS(XS_OpenGL_glutSetCursor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSetCursor)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "cursor");
    {
	int	cursor = (int)SvIV(ST(0))
;

	glutSetCursor(cursor);
    }
    XSRETURN_EMPTY;
}

#endif
#if GLUT_API_VERSION >= 3
#define XSubPPtmpAAAC 1


XS_EUPXS(XS_OpenGL_glutEstablishOverlay); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutEstablishOverlay)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutEstablishOverlay();
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutUseLayer); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutUseLayer)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "layer");
    {
	GLenum	layer = (int)SvIV(ST(0))
;

	glutUseLayer(layer);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutRemoveOverlay); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutRemoveOverlay)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutRemoveOverlay();
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutPostOverlayRedisplay); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutPostOverlayRedisplay)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutPostOverlayRedisplay();
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutShowOverlay); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutShowOverlay)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutShowOverlay();
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutHideOverlay); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutHideOverlay)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutHideOverlay();
    }
    XSRETURN_EMPTY;
}

#endif

XS_EUPXS(XS_OpenGL_glutCreateMenu); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutCreateMenu)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;
	int	RETVAL;
	dXSTARG;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 723 "pogl_glut.xs"
	{
		if (!handler || !SvOK(handler)) {
			croak("A handler must be specified");
		} else {
			AV * handler_data = newAV();

			PackCallbackST(handler_data, 0);

			RETVAL = glutCreateMenu(generic_glut_menu_handler);

			if (!glut_menu_handlers)
				glut_menu_handlers = newAV();

			av_store(glut_menu_handlers, RETVAL, newRV_inc((SV*)handler_data));

			SvREFCNT_dec(handler_data);

		}
	}
#line 1233 "pogl_glut.c"
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glutSetMenu); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSetMenu)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "menu");
    {
	int	menu = (int)SvIV(ST(0))
;

	glutSetMenu(menu);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutGetMenu); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutGetMenu)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
	int	RETVAL;
	dXSTARG;

	RETVAL = glutGetMenu();
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glutDestroyMenu); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutDestroyMenu)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "menu");
    {
	int	menu = (int)SvIV(ST(0))
;
#line 759 "pogl_glut.xs"
	{
		glutDestroyMenu(menu);
		av_store(glut_menu_handlers, menu, newSVsv(&PL_sv_undef));
	}
#line 1287 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutAddMenuEntry); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutAddMenuEntry)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "name, value");
    {
	char *	name = (char *)SvPV_nolen(ST(0))
;
	int	value = (int)SvIV(ST(1))
;

	glutAddMenuEntry(name, value);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutAddSubMenu); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutAddSubMenu)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "name, menu");
    {
	char *	name = (char *)SvPV_nolen(ST(0))
;
	int	menu = (int)SvIV(ST(1))
;

	glutAddSubMenu(name, menu);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutChangeToMenuEntry); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutChangeToMenuEntry)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "entry, name, value");
    {
	int	entry = (int)SvIV(ST(0))
;
	char *	name = (char *)SvPV_nolen(ST(1))
;
	int	value = (int)SvIV(ST(2))
;

	glutChangeToMenuEntry(entry, name, value);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutChangeToSubMenu); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutChangeToSubMenu)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "entry, name, menu");
    {
	int	entry = (int)SvIV(ST(0))
;
	char *	name = (char *)SvPV_nolen(ST(1))
;
	int	menu = (int)SvIV(ST(2))
;

	glutChangeToSubMenu(entry, name, menu);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutRemoveMenuItem); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutRemoveMenuItem)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "entry");
    {
	int	entry = (int)SvIV(ST(0))
;

	glutRemoveMenuItem(entry);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutAttachMenu); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutAttachMenu)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "button");
    {
	int	button = (int)SvIV(ST(0))
;

	glutAttachMenu(button);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutDetachMenu); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutDetachMenu)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "button");
    {
	int	button = (int)SvIV(ST(0))
;

	glutDetachMenu(button);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutDisplayFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutDisplayFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 812 "pogl_glut.xs"
	decl_gwh_xs_nullfail(Display, ("Display function must be specified"))
#line 1433 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}

#if GLUT_API_VERSION >= 3
#define XSubPPtmpAAAD 1


XS_EUPXS(XS_OpenGL_glutOverlayDisplayFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutOverlayDisplayFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 821 "pogl_glut.xs"
	decl_gwh_xs(OverlayDisplay)
#line 1458 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}

#endif

XS_EUPXS(XS_OpenGL_glutReshapeFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutReshapeFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 830 "pogl_glut.xs"
	decl_gwh_xs(Reshape)
#line 1481 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutKeyboardFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutKeyboardFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 837 "pogl_glut.xs"
	decl_gwh_xs(Keyboard)
#line 1503 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}

#if GLUT_API_VERSION >= 4
#define XSubPPtmpAAAE 1


XS_EUPXS(XS_OpenGL_glutKeyboardUpFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutKeyboardUpFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 846 "pogl_glut.xs"
	decl_gwh_xs(KeyboardUp)
#line 1528 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutWindowStatusFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutWindowStatusFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 853 "pogl_glut.xs"
        {
#if defined HAVE_FREEGLUT
		decl_gwh_xs(WindowStatus)
#endif
	}
#line 1554 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}

#endif

XS_EUPXS(XS_OpenGL_glutMouseFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutMouseFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 866 "pogl_glut.xs"
	decl_gwh_xs(Mouse)
#line 1577 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutMouseWheelFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutMouseWheelFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 873 "pogl_glut.xs"
        {
#if defined HAVE_FREEGLUT
		decl_gwh_xs(MouseWheel)
#endif
	}
#line 1603 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutMotionFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutMotionFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 884 "pogl_glut.xs"
	decl_gwh_xs(Motion)
#line 1625 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutPassiveMotionFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutPassiveMotionFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 891 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		decl_gwh_xs(PassiveMotion)
#endif
	}
#line 1651 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutVisibilityFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutVisibilityFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 902 "pogl_glut.xs"
	decl_gwh_xs(Visibility)
#line 1673 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutEntryFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutEntryFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 909 "pogl_glut.xs"
	decl_gwh_xs(Entry)
#line 1695 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}

#if GLUT_API_VERSION >= 2
#define XSubPPtmpAAAF 1


XS_EUPXS(XS_OpenGL_glutSpecialFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSpecialFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 918 "pogl_glut.xs"
	decl_gwh_xs(Special)
#line 1720 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutSpaceballMotionFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSpaceballMotionFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 932 "pogl_glut.xs"
	decl_gwh_xs(SpaceballMotion)
#line 1742 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutSpaceballRotateFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSpaceballRotateFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 939 "pogl_glut.xs"
	decl_gwh_xs(SpaceballRotate)
#line 1764 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutSpaceballButtonFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSpaceballButtonFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 946 "pogl_glut.xs"
	decl_gwh_xs(SpaceballButton)
#line 1786 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutButtonBoxFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutButtonBoxFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 953 "pogl_glut.xs"
	decl_gwh_xs(ButtonBox)
#line 1808 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutDialsFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutDialsFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 960 "pogl_glut.xs"
	decl_gwh_xs(Dials)
#line 1830 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutTabletMotionFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutTabletMotionFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 967 "pogl_glut.xs"
	decl_gwh_xs(TabletMotion)
#line 1852 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutTabletButtonFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutTabletButtonFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 974 "pogl_glut.xs"
	decl_gwh_xs(TabletButton)
#line 1874 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}

#endif
#if GLUT_API_VERSION >= 3
#define XSubPPtmpAAAG 1


XS_EUPXS(XS_OpenGL_glutMenuStatusFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutMenuStatusFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 985 "pogl_glut.xs"
	decl_ggh_xs(MenuStatus)
#line 1900 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}

#endif

XS_EUPXS(XS_OpenGL_glutMenuStateFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutMenuStateFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 994 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		decl_ggh_xs(MenuState)
#endif
	}
#line 1927 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutIdleFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutIdleFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 1005 "pogl_glut.xs"
	decl_ggh_xs(Idle)
#line 1949 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutTimerFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutTimerFunc)
{
    dVAR; dXSARGS;
    if (items < 1)
       croak_xs_usage(cv,  "msecs, handler=0, ...");
    {
	unsigned int	msecs = (unsigned int)SvUV(ST(0))
;
	SV *	handler;

	if (items < 2)
	    handler = 0;
	else {
	    handler = ST(1)
;
	}
#line 1013 "pogl_glut.xs"
	{
		if (!handler || !SvOK(handler)) {
			croak("A handler must be specified");
		} else {
			AV * handler_data = newAV();

			PackCallbackST(handler_data, 1);

			glutTimerFunc(msecs, generic_glut_timer_handler, (int)handler_data);
		}
	ENSURE_callback_thread;}
#line 1984 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutSetColor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSetColor)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "cell, red, green, blue");
    {
	int	cell = (int)SvIV(ST(0))
;
	GLfloat	red = (float)SvNV(ST(1))
;
	GLfloat	green = (float)SvNV(ST(2))
;
	GLfloat	blue = (float)SvNV(ST(3))
;

	glutSetColor(cell, red, green, blue);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutGetColor); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutGetColor)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "cell, component");
    {
	int	cell = (int)SvIV(ST(0))
;
	int	component = (int)SvIV(ST(1))
;
	GLfloat	RETVAL;
	dXSTARG;

	RETVAL = glutGetColor(cell, component);
	XSprePUSH; PUSHn((double)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glutCopyColormap); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutCopyColormap)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "win");
    {
	int	win = (int)SvIV(ST(0))
;

	glutCopyColormap(win);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutGet); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutGet)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "state");
    {
	GLenum	state = (int)SvIV(ST(0))
;
	int	RETVAL;
	dXSTARG;

	RETVAL = glutGet(state);
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}

#if GLUT_API_VERSION >= 3
#define XSubPPtmpAAAH 1


XS_EUPXS(XS_OpenGL_glutLayerGet); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutLayerGet)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "info");
    {
	GLenum	info = (int)SvIV(ST(0))
;
	int	RETVAL;
	dXSTARG;

	RETVAL = glutLayerGet(info);
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}

#endif

XS_EUPXS(XS_OpenGL_glutDeviceGet); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutDeviceGet)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "info");
    {
	GLenum	info = (int)SvIV(ST(0))
;
	int	RETVAL;
	dXSTARG;

	RETVAL = glutDeviceGet(info);
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}

#if GLUT_API_VERSION >= 3
#define XSubPPtmpAAAI 1


XS_EUPXS(XS_OpenGL_glutGetModifiers); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutGetModifiers)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
	int	RETVAL;
	dXSTARG;

	RETVAL = glutGetModifiers();
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}

#endif
#if GLUT_API_VERSION >= 2
#define XSubPPtmpAAAJ 1


XS_EUPXS(XS_OpenGL_glutExtensionSupported); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutExtensionSupported)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "extension");
    {
	char *	extension = (char *)SvPV_nolen(ST(0))
;
	int	RETVAL;
	dXSTARG;

	RETVAL = glutExtensionSupported(extension);
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}

#endif

XS_EUPXS(XS_OpenGL_glutBitmapCharacter); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutBitmapCharacter)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "font, character");
    {
	void *	font = INT2PTR(void *,SvIV(ST(0)))
;
	int	character = (int)SvIV(ST(1))
;

	glutBitmapCharacter(font, character);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutStrokeCharacter); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutStrokeCharacter)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "font, character");
    {
	void *	font = INT2PTR(void *,SvIV(ST(0)))
;
	int	character = (int)SvIV(ST(1))
;

	glutStrokeCharacter(font, character);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutBitmapWidth); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutBitmapWidth)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "font, character");
    {
	void *	font = INT2PTR(void *,SvIV(ST(0)))
;
	int	character = (int)SvIV(ST(1))
;
	int	RETVAL;
	dXSTARG;

	RETVAL = glutBitmapWidth(font, character);
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glutStrokeWidth); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutStrokeWidth)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "font, character");
    {
	void *	font = INT2PTR(void *,SvIV(ST(0)))
;
	int	character = (int)SvIV(ST(1))
;
	int	RETVAL;
	dXSTARG;

	RETVAL = glutStrokeWidth(font, character);
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}

#if GLUT_API_VERSION >= 3
#define XSubPPtmpAAAK 1


XS_EUPXS(XS_OpenGL_glutIgnoreKeyRepeat); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutIgnoreKeyRepeat)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "ignore");
    {
	int	ignore = (int)SvIV(ST(0))
;

	glutIgnoreKeyRepeat(ignore);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutSetKeyRepeat); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSetKeyRepeat)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "repeatMode");
    {
	int	repeatMode = (int)SvIV(ST(0))
;

	glutSetKeyRepeat(repeatMode);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutForceJoystickFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutForceJoystickFunc)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutForceJoystickFunc();
    }
    XSRETURN_EMPTY;
}

#endif

XS_EUPXS(XS_OpenGL_glutSolidSphere); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSolidSphere)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "radius, slices, stacks");
    {
	GLdouble	radius = (double)SvNV(ST(0))
;
	GLint	slices = (int)SvIV(ST(1))
;
	GLint	stacks = (int)SvIV(ST(2))
;

	glutSolidSphere(radius, slices, stacks);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutWireSphere); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutWireSphere)
{
    dVAR; dXSARGS;
    if (items != 3)
       croak_xs_usage(cv,  "radius, slices, stacks");
    {
	GLdouble	radius = (double)SvNV(ST(0))
;
	GLint	slices = (int)SvIV(ST(1))
;
	GLint	stacks = (int)SvIV(ST(2))
;

	glutWireSphere(radius, slices, stacks);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutSolidCube); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSolidCube)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "size");
    {
	GLdouble	size = (double)SvNV(ST(0))
;

	glutSolidCube(size);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutWireCube); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutWireCube)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "size");
    {
	GLdouble	size = (double)SvNV(ST(0))
;

	glutWireCube(size);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutSolidCone); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSolidCone)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "base, height, slices, stacks");
    {
	GLdouble	base = (double)SvNV(ST(0))
;
	GLdouble	height = (double)SvNV(ST(1))
;
	GLint	slices = (int)SvIV(ST(2))
;
	GLint	stacks = (int)SvIV(ST(3))
;

	glutSolidCone(base, height, slices, stacks);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutWireCone); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutWireCone)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "base, height, slices, stacks");
    {
	GLdouble	base = (double)SvNV(ST(0))
;
	GLdouble	height = (double)SvNV(ST(1))
;
	GLint	slices = (int)SvIV(ST(2))
;
	GLint	stacks = (int)SvIV(ST(3))
;

	glutWireCone(base, height, slices, stacks);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutSolidTorus); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSolidTorus)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "innerRadius, outerRadius, nsides, rings");
    {
	GLdouble	innerRadius = (double)SvNV(ST(0))
;
	GLdouble	outerRadius = (double)SvNV(ST(1))
;
	GLint	nsides = (int)SvIV(ST(2))
;
	GLint	rings = (int)SvIV(ST(3))
;

	glutSolidTorus(innerRadius, outerRadius, nsides, rings);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutWireTorus); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutWireTorus)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "innerRadius, outerRadius, nsides, rings");
    {
	GLdouble	innerRadius = (double)SvNV(ST(0))
;
	GLdouble	outerRadius = (double)SvNV(ST(1))
;
	GLint	nsides = (int)SvIV(ST(2))
;
	GLint	rings = (int)SvIV(ST(3))
;

	glutWireTorus(innerRadius, outerRadius, nsides, rings);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutSolidDodecahedron); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSolidDodecahedron)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutSolidDodecahedron();
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutWireDodecahedron); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutWireDodecahedron)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutWireDodecahedron();
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutSolidOctahedron); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSolidOctahedron)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutSolidOctahedron();
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutWireOctahedron); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutWireOctahedron)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutWireOctahedron();
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutSolidTetrahedron); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSolidTetrahedron)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutSolidTetrahedron();
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutWireTetrahedron); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutWireTetrahedron)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutWireTetrahedron();
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutSolidIcosahedron); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSolidIcosahedron)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutSolidIcosahedron();
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutWireIcosahedron); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutWireIcosahedron)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutWireIcosahedron();
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutSolidTeapot); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSolidTeapot)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "size");
    {
	GLdouble	size = (double)SvNV(ST(0))
;

	glutSolidTeapot(size);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutWireTeapot); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutWireTeapot)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "size");
    {
	GLdouble	size = (double)SvNV(ST(0))
;

	glutWireTeapot(size);
    }
    XSRETURN_EMPTY;
}

#if GLUT_API_VERSION >= 4
#define XSubPPtmpAAAL 1


XS_EUPXS(XS_OpenGL_glutSpecialUpFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSpecialUpFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 1235 "pogl_glut.xs"
	decl_gwh_xs(SpecialUp)
#line 2605 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutGameModeString); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutGameModeString)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "string");
    {
	char *	string = (char *)SvPV_nolen(ST(0))
;
	GLboolean	RETVAL;
#line 1242 "pogl_glut.xs"
	{
		char mode[1024];
		if (!string || !string[0])
		{
			int w = glutGet(0x00C8);	// GLUT_SCREEN_WIDTH
			int h = glutGet(0x00C9);	// GLUT_SCREEN_HEIGHT

			sprintf(mode,"%dx%d:%d@%d",w,h,32,60);
			string = mode;
		}

		glutGameModeString(string);
		RETVAL = glutGameModeGet(0x0001);	// GLUT_GAME_MODE_POSSIBLE
	}
#line 2636 "pogl_glut.c"
	ST(0) = boolSV(RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glutEnterGameMode); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutEnterGameMode)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
	int	RETVAL;
	dXSTARG;

	RETVAL = glutEnterGameMode();
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glutLeaveGameMode); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutLeaveGameMode)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutLeaveGameMode();
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutGameModeGet); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutGameModeGet)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "mode");
    {
	GLenum	mode = (int)SvIV(ST(0))
;
	int	RETVAL;
	dXSTARG;

	RETVAL = glutGameModeGet(mode);
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glutBitmapHeight); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutBitmapHeight)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "font");
    {
	void *	font = INT2PTR(void *,SvIV(ST(0)))
;
	int	RETVAL;
	dXSTARG;
#line 1278 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		RETVAL = glutBitmapHeight(font);
#endif
	}
#line 2710 "pogl_glut.c"
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glutBitmapLength); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutBitmapLength)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "font, string");
    {
	void *	font = INT2PTR(void *,SvIV(ST(0)))
;
	const unsigned char *	string = (const unsigned char *)SvPV_nolen(ST(1))
;
	int	RETVAL;
	dXSTARG;
#line 1293 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		RETVAL = glutBitmapLength(font, string);
#endif
	}
#line 2736 "pogl_glut.c"
	XSprePUSH; PUSHi((IV)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glutBitmapString); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutBitmapString)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "font, string");
    {
	void *	font = INT2PTR(void *,SvIV(ST(0)))
;
	const unsigned char *	string = (const unsigned char *)SvPV_nolen(ST(1))
;
#line 1308 "pogl_glut.xs"
    {
#if defined HAVE_FREEGLUT
	    glutBitmapString(font, string);
#else
    	int len, i;
    	len = (int) strlen((char *)string);
    	for (i = 0; i < len; i++) {
    		glutBitmapCharacter(font, string[i]);
    	}
#endif
    }
#line 2766 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutMainLoopEvent); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutMainLoopEvent)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
#line 1331 "pogl_glut.xs"
	{
#if defined HAVE_AGL_GLUT
		glutCheckLoop();
#elif defined HAVE_FREEGLUT
		glutMainLoopEvent();
#endif
	}
#line 2787 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutPostWindowOverlayRedisplay); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutPostWindowOverlayRedisplay)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "windowID");
    {
	int	windowID = (int)SvIV(ST(0))
;

	glutPostWindowOverlayRedisplay(windowID);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutPostWindowRedisplay); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutPostWindowRedisplay)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "windowID");
    {
	int	windowID = (int)SvIV(ST(0))
;

	glutPostWindowRedisplay(windowID);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutReportErrors); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutReportErrors)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {

	glutReportErrors();
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutSolidCylinder); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSolidCylinder)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "radius, height, slices, stacks");
    {
	GLdouble	radius = (double)SvNV(ST(0))
;
	GLdouble	height = (double)SvNV(ST(1))
;
	GLint	slices = (int)SvIV(ST(2))
;
	GLint	stacks = (int)SvIV(ST(3))
;
#line 1361 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		glutSolidCylinder(radius, height, slices, stacks);
#endif
	}
#line 2860 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutSolidRhombicDodecahedron); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSolidRhombicDodecahedron)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
#line 1371 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		glutSolidRhombicDodecahedron();
#endif
	}
#line 2879 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutStrokeHeight); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutStrokeHeight)
{
    dVAR; dXSARGS;
    if (items != 1)
       croak_xs_usage(cv,  "font");
    {
	void *	font = INT2PTR(void *,SvIV(ST(0)))
;
	GLfloat	RETVAL;
	dXSTARG;
#line 1382 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		RETVAL = glutStrokeHeight(font);
#endif
	}
#line 2902 "pogl_glut.c"
	XSprePUSH; PUSHn((double)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glutStrokeLength); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutStrokeLength)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "font, string");
    {
	void *	font = INT2PTR(void *,SvIV(ST(0)))
;
	const unsigned char *	string = (const unsigned char *)SvPV_nolen(ST(1))
;
	GLfloat	RETVAL;
	dXSTARG;
#line 1397 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		glutStrokeLength(font, string);
#endif
	}
#line 2928 "pogl_glut.c"
	XSprePUSH; PUSHn((double)RETVAL);
    }
    XSRETURN(1);
}


XS_EUPXS(XS_OpenGL_glutStrokeString); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutStrokeString)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "font, string");
    {
	void *	font = INT2PTR(void *,SvIV(ST(0)))
;
	const unsigned char *	string = (const unsigned char *)SvPV_nolen(ST(1))
;
#line 1411 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		glutStrokeString(font, string);
#endif
	}
#line 2952 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutWarpPointer); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutWarpPointer)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "x, y");
    {
	int	x = (int)SvIV(ST(0))
;
	int	y = (int)SvIV(ST(1))
;

	glutWarpPointer(x, y);
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutWireCylinder); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutWireCylinder)
{
    dVAR; dXSARGS;
    if (items != 4)
       croak_xs_usage(cv,  "radius, height, slices, stacks");
    {
	GLdouble	radius = (double)SvNV(ST(0))
;
	GLdouble	height = (double)SvNV(ST(1))
;
	GLint	slices = (int)SvIV(ST(2))
;
	GLint	stacks = (int)SvIV(ST(3))
;
#line 1431 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		glutWireCylinder(radius, height, slices, stacks);
#endif
	}
#line 2997 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutWireRhombicDodecahedron); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutWireRhombicDodecahedron)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
#line 1441 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		glutWireRhombicDodecahedron();
#endif
	}
#line 3016 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}

#endif

XS_EUPXS(XS_OpenGL_glutSetOption); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutSetOption)
{
    dVAR; dXSARGS;
    if (items != 2)
       croak_xs_usage(cv,  "option_flag, value");
    {
	GLenum	option_flag = (int)SvIV(ST(0))
;
	int	value = (int)SvIV(ST(1))
;
#line 1457 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		glutSetOption(option_flag, value);
#endif
	}
#line 3040 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutLeaveMainLoop); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutLeaveMainLoop)
{
    dVAR; dXSARGS;
    if (items != 0)
       croak_xs_usage(cv,  "");
    {
#line 1467 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		glutLeaveMainLoop();
#else
		int win = glutGetWindow();
		glutDestroyWindow(win);
		destroy_glut_win_handlers(win);
#endif
	}
#line 3063 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutMenuDestroyFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutMenuDestroyFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 1482 "pogl_glut.xs"
    {
#if defined HAVE_FREEGLUT
		decl_gwh_xs(MenuDestroy)
#endif
	}
#line 3089 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}


XS_EUPXS(XS_OpenGL_glutCloseFunc); /* prototype to pass -Wmissing-prototypes */
XS_EUPXS(XS_OpenGL_glutCloseFunc)
{
    dVAR; dXSARGS;
    PERL_UNUSED_VAR(cv); /* -W */
    {
	SV *	handler;

	if (items < 1)
	    handler = 0;
	else {
	    handler = ST(0)
;
	}
#line 1493 "pogl_glut.xs"
        {
	    if (_done_glutCloseFunc_warn == 0) {
	        warn("glutCloseFunc: not implemented\n");
	        _done_glutCloseFunc_warn++;
            }
        }
#line 3116 "pogl_glut.c"
    }
    XSRETURN_EMPTY;
}

#ifdef __cplusplus
extern "C"
#endif
XS_EXTERNAL(boot_OpenGL__GLUT); /* prototype to pass -Wmissing-prototypes */
XS_EXTERNAL(boot_OpenGL__GLUT)
{
#if PERL_VERSION_LE(5, 21, 5)
    dVAR; dXSARGS;
#else
    dVAR; dXSBOOTARGSXSAPIVERCHK;
#endif
#if (PERL_REVISION == 5 && PERL_VERSION < 9)
    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

        newXS_deffile("OpenGL::done_glutInit", XS_OpenGL_done_glutInit);
        newXS_deffile("OpenGL::glutInit", XS_OpenGL_glutInit);
        newXS_deffile("OpenGL::glutInitWindowSize", XS_OpenGL_glutInitWindowSize);
        newXS_deffile("OpenGL::glutInitWindowPosition", XS_OpenGL_glutInitWindowPosition);
        newXS_deffile("OpenGL::glutInitDisplayMode", XS_OpenGL_glutInitDisplayMode);
        newXS_deffile("OpenGL::glutInitDisplayString", XS_OpenGL_glutInitDisplayString);
        newXS_deffile("OpenGL::glutMainLoop", XS_OpenGL_glutMainLoop);
        newXS_deffile("OpenGL::glutCreateWindow", XS_OpenGL_glutCreateWindow);
        newXS_deffile("OpenGL::glutCreateSubWindow", XS_OpenGL_glutCreateSubWindow);
        newXS_deffile("OpenGL::glutSetWindow", XS_OpenGL_glutSetWindow);
        newXS_deffile("OpenGL::glutGetWindow", XS_OpenGL_glutGetWindow);
        newXS_deffile("OpenGL::glutDestroyWindow", XS_OpenGL_glutDestroyWindow);
        newXS_deffile("OpenGL::glutPostRedisplay", XS_OpenGL_glutPostRedisplay);
        newXS_deffile("OpenGL::glutSwapBuffers", XS_OpenGL_glutSwapBuffers);
        newXS_deffile("OpenGL::glutPositionWindow", XS_OpenGL_glutPositionWindow);
        newXS_deffile("OpenGL::glutReshapeWindow", XS_OpenGL_glutReshapeWindow);
#if XSubPPtmpAAAA
        newXS_deffile("OpenGL::glutFullScreen", XS_OpenGL_glutFullScreen);
#endif
        newXS_deffile("OpenGL::glutPopWindow", XS_OpenGL_glutPopWindow);
        newXS_deffile("OpenGL::glutPushWindow", XS_OpenGL_glutPushWindow);
        newXS_deffile("OpenGL::glutShowWindow", XS_OpenGL_glutShowWindow);
        newXS_deffile("OpenGL::glutHideWindow", XS_OpenGL_glutHideWindow);
        newXS_deffile("OpenGL::glutIconifyWindow", XS_OpenGL_glutIconifyWindow);
        newXS_deffile("OpenGL::glutSetWindowTitle", XS_OpenGL_glutSetWindowTitle);
        newXS_deffile("OpenGL::glutSetIconTitle", XS_OpenGL_glutSetIconTitle);
#if XSubPPtmpAAAB
        newXS_deffile("OpenGL::glutSetCursor", XS_OpenGL_glutSetCursor);
#endif
#if XSubPPtmpAAAC
        newXS_deffile("OpenGL::glutEstablishOverlay", XS_OpenGL_glutEstablishOverlay);
        newXS_deffile("OpenGL::glutUseLayer", XS_OpenGL_glutUseLayer);
        newXS_deffile("OpenGL::glutRemoveOverlay", XS_OpenGL_glutRemoveOverlay);
        newXS_deffile("OpenGL::glutPostOverlayRedisplay", XS_OpenGL_glutPostOverlayRedisplay);
        newXS_deffile("OpenGL::glutShowOverlay", XS_OpenGL_glutShowOverlay);
        newXS_deffile("OpenGL::glutHideOverlay", XS_OpenGL_glutHideOverlay);
#endif
        newXS_deffile("OpenGL::glutCreateMenu", XS_OpenGL_glutCreateMenu);
        newXS_deffile("OpenGL::glutSetMenu", XS_OpenGL_glutSetMenu);
        newXS_deffile("OpenGL::glutGetMenu", XS_OpenGL_glutGetMenu);
        newXS_deffile("OpenGL::glutDestroyMenu", XS_OpenGL_glutDestroyMenu);
        newXS_deffile("OpenGL::glutAddMenuEntry", XS_OpenGL_glutAddMenuEntry);
        newXS_deffile("OpenGL::glutAddSubMenu", XS_OpenGL_glutAddSubMenu);
        newXS_deffile("OpenGL::glutChangeToMenuEntry", XS_OpenGL_glutChangeToMenuEntry);
        newXS_deffile("OpenGL::glutChangeToSubMenu", XS_OpenGL_glutChangeToSubMenu);
        newXS_deffile("OpenGL::glutRemoveMenuItem", XS_OpenGL_glutRemoveMenuItem);
        newXS_deffile("OpenGL::glutAttachMenu", XS_OpenGL_glutAttachMenu);
        newXS_deffile("OpenGL::glutDetachMenu", XS_OpenGL_glutDetachMenu);
        newXS_deffile("OpenGL::glutDisplayFunc", XS_OpenGL_glutDisplayFunc);
#if XSubPPtmpAAAD
        newXS_deffile("OpenGL::glutOverlayDisplayFunc", XS_OpenGL_glutOverlayDisplayFunc);
#endif
        newXS_deffile("OpenGL::glutReshapeFunc", XS_OpenGL_glutReshapeFunc);
        newXS_deffile("OpenGL::glutKeyboardFunc", XS_OpenGL_glutKeyboardFunc);
#if XSubPPtmpAAAE
        newXS_deffile("OpenGL::glutKeyboardUpFunc", XS_OpenGL_glutKeyboardUpFunc);
        newXS_deffile("OpenGL::glutWindowStatusFunc", XS_OpenGL_glutWindowStatusFunc);
#endif
        newXS_deffile("OpenGL::glutMouseFunc", XS_OpenGL_glutMouseFunc);
        newXS_deffile("OpenGL::glutMouseWheelFunc", XS_OpenGL_glutMouseWheelFunc);
        newXS_deffile("OpenGL::glutMotionFunc", XS_OpenGL_glutMotionFunc);
        newXS_deffile("OpenGL::glutPassiveMotionFunc", XS_OpenGL_glutPassiveMotionFunc);
        newXS_deffile("OpenGL::glutVisibilityFunc", XS_OpenGL_glutVisibilityFunc);
        newXS_deffile("OpenGL::glutEntryFunc", XS_OpenGL_glutEntryFunc);
#if XSubPPtmpAAAF
        newXS_deffile("OpenGL::glutSpecialFunc", XS_OpenGL_glutSpecialFunc);
        newXS_deffile("OpenGL::glutSpaceballMotionFunc", XS_OpenGL_glutSpaceballMotionFunc);
        newXS_deffile("OpenGL::glutSpaceballRotateFunc", XS_OpenGL_glutSpaceballRotateFunc);
        newXS_deffile("OpenGL::glutSpaceballButtonFunc", XS_OpenGL_glutSpaceballButtonFunc);
        newXS_deffile("OpenGL::glutButtonBoxFunc", XS_OpenGL_glutButtonBoxFunc);
        newXS_deffile("OpenGL::glutDialsFunc", XS_OpenGL_glutDialsFunc);
        newXS_deffile("OpenGL::glutTabletMotionFunc", XS_OpenGL_glutTabletMotionFunc);
        newXS_deffile("OpenGL::glutTabletButtonFunc", XS_OpenGL_glutTabletButtonFunc);
#endif
#if XSubPPtmpAAAG
        newXS_deffile("OpenGL::glutMenuStatusFunc", XS_OpenGL_glutMenuStatusFunc);
#endif
        newXS_deffile("OpenGL::glutMenuStateFunc", XS_OpenGL_glutMenuStateFunc);
        newXS_deffile("OpenGL::glutIdleFunc", XS_OpenGL_glutIdleFunc);
        newXS_deffile("OpenGL::glutTimerFunc", XS_OpenGL_glutTimerFunc);
        newXS_deffile("OpenGL::glutSetColor", XS_OpenGL_glutSetColor);
        newXS_deffile("OpenGL::glutGetColor", XS_OpenGL_glutGetColor);
        newXS_deffile("OpenGL::glutCopyColormap", XS_OpenGL_glutCopyColormap);
        newXS_deffile("OpenGL::glutGet", XS_OpenGL_glutGet);
#if XSubPPtmpAAAH
        newXS_deffile("OpenGL::glutLayerGet", XS_OpenGL_glutLayerGet);
#endif
        newXS_deffile("OpenGL::glutDeviceGet", XS_OpenGL_glutDeviceGet);
#if XSubPPtmpAAAI
        newXS_deffile("OpenGL::glutGetModifiers", XS_OpenGL_glutGetModifiers);
#endif
#if XSubPPtmpAAAJ
        newXS_deffile("OpenGL::glutExtensionSupported", XS_OpenGL_glutExtensionSupported);
#endif
        newXS_deffile("OpenGL::glutBitmapCharacter", XS_OpenGL_glutBitmapCharacter);
        newXS_deffile("OpenGL::glutStrokeCharacter", XS_OpenGL_glutStrokeCharacter);
        newXS_deffile("OpenGL::glutBitmapWidth", XS_OpenGL_glutBitmapWidth);
        newXS_deffile("OpenGL::glutStrokeWidth", XS_OpenGL_glutStrokeWidth);
#if XSubPPtmpAAAK
        newXS_deffile("OpenGL::glutIgnoreKeyRepeat", XS_OpenGL_glutIgnoreKeyRepeat);
        newXS_deffile("OpenGL::glutSetKeyRepeat", XS_OpenGL_glutSetKeyRepeat);
        newXS_deffile("OpenGL::glutForceJoystickFunc", XS_OpenGL_glutForceJoystickFunc);
#endif
        newXS_deffile("OpenGL::glutSolidSphere", XS_OpenGL_glutSolidSphere);
        newXS_deffile("OpenGL::glutWireSphere", XS_OpenGL_glutWireSphere);
        newXS_deffile("OpenGL::glutSolidCube", XS_OpenGL_glutSolidCube);
        newXS_deffile("OpenGL::glutWireCube", XS_OpenGL_glutWireCube);
        newXS_deffile("OpenGL::glutSolidCone", XS_OpenGL_glutSolidCone);
        newXS_deffile("OpenGL::glutWireCone", XS_OpenGL_glutWireCone);
        newXS_deffile("OpenGL::glutSolidTorus", XS_OpenGL_glutSolidTorus);
        newXS_deffile("OpenGL::glutWireTorus", XS_OpenGL_glutWireTorus);
        newXS_deffile("OpenGL::glutSolidDodecahedron", XS_OpenGL_glutSolidDodecahedron);
        newXS_deffile("OpenGL::glutWireDodecahedron", XS_OpenGL_glutWireDodecahedron);
        newXS_deffile("OpenGL::glutSolidOctahedron", XS_OpenGL_glutSolidOctahedron);
        newXS_deffile("OpenGL::glutWireOctahedron", XS_OpenGL_glutWireOctahedron);
        newXS_deffile("OpenGL::glutSolidTetrahedron", XS_OpenGL_glutSolidTetrahedron);
        newXS_deffile("OpenGL::glutWireTetrahedron", XS_OpenGL_glutWireTetrahedron);
        newXS_deffile("OpenGL::glutSolidIcosahedron", XS_OpenGL_glutSolidIcosahedron);
        newXS_deffile("OpenGL::glutWireIcosahedron", XS_OpenGL_glutWireIcosahedron);
        newXS_deffile("OpenGL::glutSolidTeapot", XS_OpenGL_glutSolidTeapot);
        newXS_deffile("OpenGL::glutWireTeapot", XS_OpenGL_glutWireTeapot);
#if XSubPPtmpAAAL
        newXS_deffile("OpenGL::glutSpecialUpFunc", XS_OpenGL_glutSpecialUpFunc);
        newXS_deffile("OpenGL::glutGameModeString", XS_OpenGL_glutGameModeString);
        newXS_deffile("OpenGL::glutEnterGameMode", XS_OpenGL_glutEnterGameMode);
        newXS_deffile("OpenGL::glutLeaveGameMode", XS_OpenGL_glutLeaveGameMode);
        newXS_deffile("OpenGL::glutGameModeGet", XS_OpenGL_glutGameModeGet);
        newXS_deffile("OpenGL::glutBitmapHeight", XS_OpenGL_glutBitmapHeight);
        newXS_deffile("OpenGL::glutBitmapLength", XS_OpenGL_glutBitmapLength);
        newXS_deffile("OpenGL::glutBitmapString", XS_OpenGL_glutBitmapString);
        newXS_deffile("OpenGL::glutMainLoopEvent", XS_OpenGL_glutMainLoopEvent);
        newXS_deffile("OpenGL::glutPostWindowOverlayRedisplay", XS_OpenGL_glutPostWindowOverlayRedisplay);
        newXS_deffile("OpenGL::glutPostWindowRedisplay", XS_OpenGL_glutPostWindowRedisplay);
        newXS_deffile("OpenGL::glutReportErrors", XS_OpenGL_glutReportErrors);
        newXS_deffile("OpenGL::glutSolidCylinder", XS_OpenGL_glutSolidCylinder);
        newXS_deffile("OpenGL::glutSolidRhombicDodecahedron", XS_OpenGL_glutSolidRhombicDodecahedron);
        newXS_deffile("OpenGL::glutStrokeHeight", XS_OpenGL_glutStrokeHeight);
        newXS_deffile("OpenGL::glutStrokeLength", XS_OpenGL_glutStrokeLength);
        newXS_deffile("OpenGL::glutStrokeString", XS_OpenGL_glutStrokeString);
        newXS_deffile("OpenGL::glutWarpPointer", XS_OpenGL_glutWarpPointer);
        newXS_deffile("OpenGL::glutWireCylinder", XS_OpenGL_glutWireCylinder);
        newXS_deffile("OpenGL::glutWireRhombicDodecahedron", XS_OpenGL_glutWireRhombicDodecahedron);
#endif
        newXS_deffile("OpenGL::glutSetOption", XS_OpenGL_glutSetOption);
        newXS_deffile("OpenGL::glutLeaveMainLoop", XS_OpenGL_glutLeaveMainLoop);
        newXS_deffile("OpenGL::glutMenuDestroyFunc", XS_OpenGL_glutMenuDestroyFunc);
        newXS_deffile("OpenGL::glutCloseFunc", XS_OpenGL_glutCloseFunc);

    /* Initialisation Section */

#if XSubPPtmpAAAA
#endif
#if XSubPPtmpAAAB
#endif
#if XSubPPtmpAAAC
#endif
#if XSubPPtmpAAAD
#endif
#if XSubPPtmpAAAE
#endif
#if XSubPPtmpAAAF
#endif
#if XSubPPtmpAAAG
#endif
#if XSubPPtmpAAAH
#endif
#if XSubPPtmpAAAI
#endif
#if XSubPPtmpAAAJ
#endif
#if XSubPPtmpAAAK
#endif
#if XSubPPtmpAAAL
#endif
#line 3323 "pogl_glut.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
}

