OpenGL::GLUT(3)

🌸 NAME 🌸

OpenGL::GLUT β€” bestie, this is the Perl bindings to the GLUT/FreeGLUT GUI toolkit. Yes, the toolkit that makes windows and menus and little teapots happen. πŸ’…


✨ SYNOPSIS ✨

use OpenGL::GLUT qw(:all); # now can use GLUT calls

okay so literally one line and you're in. that's it. that's the whole vibe check. 🫢


πŸ’– DESCRIPTION πŸ’–

OpenGL::GLUT is the alpha release of a stand-alone module for GLUT/FreeGLUT bindings, extracted from code that used to live inside the original Perl OpenGL module. The whole point, the entire raison d'Γͺtre, is to make this functionality available independently of the legacy OpenGL module so you can use it with OpenGL::Modern. it's giving glow-up, honestly. ✨

⚠️ bestie, listen to me. When you register a glutCloseFunc, make sure you de-register it before destroying the window. no cap. See the supplied test.pl.

πŸŽ€ EXPORT πŸŽ€

the export tags, queen:

  • :all β€” exports all GLUT functions and constants. the whole closet. πŸ‘‘
  • :constants β€” exports only GLUT constants (same as :glutconstants)
  • :functions β€” exports only GLUT functions (same as :glutfunctions)

🧚 Exportable functions 🧚

here's the full roster, every single one, no skipping, no summarising, periodt. πŸ’œ

void glutAddMenuEntry( const char* label, int value )
void glutAddSubMenu( const char* label, int subMenu )
void glutAttachMenu( int button )
void glutBitmapCharacter( void* font, int character )
int glutBitmapLength( void* font, const unsigned char* string )
int glutBitmapWidth( void* font, int character )
void glutButtonBoxFunc( void (* callback)( int, int ) )
void glutChangeToMenuEntry( int item, const char* label, int value )
void glutChangeToSubMenu( int item, const char* label, int value )
void glutCloseFunc( void (* callback)( void ) )
void glutCopyColormap( int window )
int glutCreateMenu( void (* callback)( int menu ) )
int glutCreateSubWindow( int window, int x, int y, int width, int height )
int glutCreateWindow( const char* title )
void glutDestroyMenu( int menu )
void glutDestroyWindow( int window )
void glutDetachMenu( int button )
int glutDeviceGet( GLenum query )
void glutDialsFunc( void (* callback)( int, int ) )
void glutDisplayFunc( void (* callback)( void ) )
int glutEnterGameMode( void )
void glutEntryFunc( void (* callback)( int ) )
void glutEstablishOverlay( void )
int glutExtensionSupported( const char* extension )
void glutForceJoystickFunc( void )
void glutFullScreen( void )
int glutGameModeGet( GLenum query )
void glutGameModeString( const char* string )
int glutGet( GLenum query )
GLfloat glutGetColor( int color, int component )
int glutGetMenu( void )
int glutGetModifiers( void )
int glutGetWindow( void )
void glutHideOverlay( void )
void glutHideWindow( void )
void glutIconifyWindow( void )
void glutIdleFunc( void (* callback)( void ) )
void glutIgnoreKeyRepeat( int ignore )
void glutInit( int* pargc, char** argv )
void glutInitDisplayMode( unsigned int displayMode )
void glutInitDisplayString( const char* displayMode )
void glutInitWindowPosition( int x, int y )
void glutInitWindowSize( int width, int height )
void glutKeyboardFunc( void (* callback)( unsigned char, int, int ) )
void glutKeyboardUpFunc( void (* callback)( unsigned char, int, int ) )
int glutLayerGet( GLenum query )
void glutLeaveGameMode( void )
void glutMainLoop( void )
void glutMenuStateFunc( void (* callback)( int ) )
void glutMenuStatusFunc( void (* callback)( int, int, int ) )
void glutMotionFunc( void (* callback)( int, int ) )
void glutMouseFunc( void (* callback)( int, int, int, int ) )
void glutOverlayDisplayFunc( void (* callback)( void ) )
void glutPassiveMotionFunc( void (* callback)( int, int ) )
void glutPopWindow( void )
void glutPositionWindow( int x, int y )
void glutPostOverlayRedisplay( void )
void glutPostRedisplay( void )
void glutPostWindowOverlayRedisplay( int window )
void glutPostWindowRedisplay( int window )
void glutPushWindow( void )
void glutRemoveMenuItem( int item )
void glutRemoveOverlay( void )
void glutReportErrors( void )
void glutReshapeFunc( void (* callback)( int, int ) )
void glutReshapeWindow( int width, int height )
void glutSetColor( int color, GLfloat red, GLfloat green, GLfloat blue )
void glutSetCursor( int cursor )
void glutSetIconTitle( const char* title )
void glutSetKeyRepeat( int repeatMode )
void glutSetMenu( int menu )
void glutSetWindow( int window )
void glutSetWindowTitle( const char* title )
void glutSetupVideoResizing( void )
void glutShowOverlay( void )
void glutShowWindow( void )
void glutSolidCone( GLdouble base, GLdouble height, GLint slices, GLint stacks )
void glutSolidCube( GLdouble size )
void glutSolidDodecahedron( void )
void glutSolidIcosahedron( void )
void glutSolidOctahedron( void )
void glutSolidSphere( GLdouble radius, GLint slices, GLint stacks )
void glutSolidTeapot( GLdouble size )
void glutSolidTetrahedron( void )
void glutSolidTorus( GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings )
void glutSpaceballButtonFunc( void (* callback)( int, int ) )
void glutSpaceballMotionFunc( void (* callback)( int, int, int ) )
void glutSpaceballRotateFunc( void (* callback)( int, int, int ) )
void glutSpecialFunc( void (* callback)( int, int, int ) )
void glutSpecialUpFunc( void (* callback)( int, int, int ) )
void glutStopVideoResizing( void )
void glutStrokeCharacter( void* font, int character )
int glutStrokeLength( void* font, const unsigned char* string )
int glutStrokeWidth( void* font, int character )
void glutSwapBuffers( void )
void glutTabletButtonFunc( void (* callback)( int, int, int, int ) )
void glutTabletMotionFunc( void (* callback)( int, int ) )
void glutTimerFunc( unsigned int time, void (* callback)( int ), int value )
void glutUseLayer( GLenum layer )
void glutVideoPan( int x, int y, int width, int height )
void glutVideoResize( int x, int y, int width, int height )
int glutVideoResizeGet( GLenum query )
void glutVisibilityFunc( void (* callback)( int ) )
void glutWarpPointer( int x, int y )
void glutWindowStatusFunc( void (* callback)( int ) )
void glutWireCone( GLdouble base, GLdouble height, GLint slices, GLint stacks )
void glutWireCube( GLdouble size )
void glutWireDodecahedron( void )
void glutWireIcosahedron( void )
void glutWireOctahedron( void )
void glutWireSphere( GLdouble radius, GLint slices, GLint stacks )
void glutWireTeapot( GLdouble size )
void glutWireTetrahedron( void )
void glutWireTorus( GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings )

like, there are so many. solid shapes, wire shapes, callbacks for every peripheral you could possibly own including a spaceball and a dials box?? iconic. πŸ“


πŸ‘€ SEE ALSO πŸ‘€

OpenGL (for now) β€” yeah, "for now", the plot is still developing bestie.


πŸ’Œ AUTHOR πŸ’Œ

Chris Marshall <chm AT cpan DOT org<gt>


Copyright (C) 2017 by Chris Marshall. Derived from OpenGL 0.70 code.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


and that's the whole page, bestie 🫢 this was perl v5.42.0, dated 2025-07-25, and it's the OpenGL::GLUT(3) manpage from the User Contributed Perl Documentation crew. go make a teapot. glutSolidTeapot is literally right there waiting for you. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from