/*
 * This file was generated automatically by ExtUtils::ParseXS version 3.24 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.
 *  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 507 "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(pTHX_ const CV *const cv, const char *const params);

STATIC void
S_croak_xs_usage(pTHX_ 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(aTHX_ "Usage: %s::%s(%s)", hvname, gvname, params);
        else
            Perl_croak(aTHX_ "Usage: %s(%s)", gvname, params);
    } else {
        /* Pants. I don't think that it should be possible to get here. */
        Perl_croak(aTHX_ "Usage: CODE(0x%"UVxf")(%s)", PTR2UV(cv), params);
    }
}
#undef  PERL_ARGS_ASSERT_CROAK_XS_USAGE

#ifdef PERL_IMPLICIT_CONTEXT
#define croak_xs_usage(a,b)    S_croak_xs_usage(aTHX_ a,b)
#else
#define croak_xs_usage        S_croak_xs_usage
#endif

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

#line 649 "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 503 "pogl_glut.xs"
	RETVAL = _done_glutInit;
#line 662 "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 514 "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 711 "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 580 "pogl_glut.xs"
	RETVAL = glutCreateWindow(name);
	destroy_glut_win_handlers(RETVAL);
#line 813 "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 594 "pogl_glut.xs"
	RETVAL = glutCreateSubWindow(win, x, y, width, height);
	destroy_glut_win_handlers(RETVAL);
#line 842 "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 613 "pogl_glut.xs"
	glutDestroyWindow(win);
	destroy_glut_win_handlers(win);
#line 894 "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 722 "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 1230 "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 758 "pogl_glut.xs"
	{
		glutDestroyMenu(menu);
		av_store(glut_menu_handlers, menu, newSVsv(&PL_sv_undef));
	}
#line 1284 "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 811 "pogl_glut.xs"
	decl_gwh_xs_nullfail(Display, ("Display function must be specified"))
#line 1430 "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 820 "pogl_glut.xs"
	decl_gwh_xs(OverlayDisplay)
#line 1455 "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 829 "pogl_glut.xs"
	decl_gwh_xs(Reshape)
#line 1478 "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 836 "pogl_glut.xs"
	decl_gwh_xs(Keyboard)
#line 1500 "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 845 "pogl_glut.xs"
	decl_gwh_xs(KeyboardUp)
#line 1525 "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 852 "pogl_glut.xs"
        {
#if defined HAVE_FREEGLUT
		decl_gwh_xs(WindowStatus)
#endif
	}
#line 1551 "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 865 "pogl_glut.xs"
	decl_gwh_xs(Mouse)
#line 1574 "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 872 "pogl_glut.xs"
        {
#if defined HAVE_FREEGLUT
		decl_gwh_xs(MouseWheel)
#endif
	}
#line 1600 "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 883 "pogl_glut.xs"
	decl_gwh_xs(Motion)
#line 1622 "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 890 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		decl_gwh_xs(PassiveMotion)
#endif
	}
#line 1648 "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 901 "pogl_glut.xs"
	decl_gwh_xs(Visibility)
#line 1670 "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 908 "pogl_glut.xs"
	decl_gwh_xs(Entry)
#line 1692 "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 917 "pogl_glut.xs"
	decl_gwh_xs(Special)
#line 1717 "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 931 "pogl_glut.xs"
	decl_gwh_xs(SpaceballMotion)
#line 1739 "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 938 "pogl_glut.xs"
	decl_gwh_xs(SpaceballRotate)
#line 1761 "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 945 "pogl_glut.xs"
	decl_gwh_xs(SpaceballButton)
#line 1783 "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 952 "pogl_glut.xs"
	decl_gwh_xs(ButtonBox)
#line 1805 "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 959 "pogl_glut.xs"
	decl_gwh_xs(Dials)
#line 1827 "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 966 "pogl_glut.xs"
	decl_gwh_xs(TabletMotion)
#line 1849 "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 973 "pogl_glut.xs"
	decl_gwh_xs(TabletButton)
#line 1871 "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 984 "pogl_glut.xs"
	decl_ggh_xs(MenuStatus)
#line 1897 "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 993 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		decl_ggh_xs(MenuState)
#endif
	}
#line 1924 "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 1004 "pogl_glut.xs"
	decl_ggh_xs(Idle)
#line 1946 "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 1012 "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 1981 "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 1234 "pogl_glut.xs"
	decl_gwh_xs(SpecialUp)
#line 2602 "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 1241 "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 2633 "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 1277 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		RETVAL = glutBitmapHeight(font);
#endif
	}
#line 2707 "pogl_glut.c"
    }
    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 1290 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		RETVAL = glutBitmapLength(font, string);
#endif
	}
#line 2732 "pogl_glut.c"
    }
    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 1303 "pogl_glut.xs"
{
#if defined HAVE_FREEGLUT
	glutBitmapString(font, string);
#else
	int len, i;
	len = (int) strlen(string);
	for (i = 0; i < len; i++) {
		glutBitmapCharacter(font, string[i]);
	}
#endif
}
#line 2761 "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 1326 "pogl_glut.xs"
	{
#if defined HAVE_AGL_GLUT
		glutCheckLoop();
#elif defined HAVE_FREEGLUT
		glutMainLoopEvent();
#endif
	}
#line 2782 "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 1356 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		glutSolidCylinder(radius, height, slices, stacks);
#endif
	}
#line 2855 "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 1366 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		glutSolidRhombicDodecahedron();
#endif
	}
#line 2874 "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 1377 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		RETVAL = glutStrokeHeight(font);
#endif
	}
#line 2897 "pogl_glut.c"
    }
    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;

	RETVAL = glutStrokeLength(font, string);
	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 1396 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		glutStrokeString(font, string);
#endif
	}
#line 2941 "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 1416 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		glutWireCylinder(radius, height, slices, stacks);
#endif
	}
#line 2986 "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 1427 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		glutWireRhombicDodecahedron();
#endif
	}
#line 3005 "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 1443 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		glutSetOption(option_flag, value);
#endif
	}
#line 3029 "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 1453 "pogl_glut.xs"
	{
#if defined HAVE_FREEGLUT
		glutLeaveMainLoop();
#else
		int win = glutGetWindow();
		glutDestroyWindow(win);
		destroy_glut_win_handlers(win);
#endif
	}
#line 3052 "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 1468 "pogl_glut.xs"
        {
#if defined HAVE_FREEGLUT
		decl_gwh_xs(MenuDestroy)
#endif
	}
#line 3078 "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 1479 "pogl_glut.xs"
        {
	    if (_done_glutCloseFunc_warn == 0) {
	        warn("glutCloseFunc: not implemented\n");
	        _done_glutCloseFunc_warn++;
            }
        }
#line 3105 "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)
{
    dVAR; dXSARGS;
#if (PERL_REVISION == 5 && PERL_VERSION < 9)
    char* file = __FILE__;
#else
    const char* file = __FILE__;
#endif

    PERL_UNUSED_VAR(cv); /* -W */
    PERL_UNUSED_VAR(items); /* -W */
#ifdef XS_APIVERSION_BOOTCHECK
    XS_APIVERSION_BOOTCHECK;
#endif
    XS_VERSION_BOOTCHECK;

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

    /* 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 3304 "pogl_glut.c"

    /* End of Initialisation Section */

#if (PERL_REVISION == 5 && PERL_VERSION >= 9)
  if (PL_unitcheckav)
       call_list(PL_scopestack_ix, PL_unitcheckav);
#endif
    XSRETURN_YES;
}

