OpenGL::Sandbox - Rapid-prototyping utilities for OpenGL
version 0.01_1
This module can export OpenGL constants and functions, selecting them out of either OpenGL or OpenGL::Modern. When exported by name, constants will be exported as true perl constants. However, the full selection of GL constants and functions is *not* available directly from this module's namespace. i.e. OpenGL::Sandbox::GL_TRUE() does not work.
OpenGL::Sandbox::GL_TRUE()
Returns a default global instance of the resource manager with resource_root_dir pointing to the current directory.
resource_root_dir
Shortcut for OpenGL::Sandbox::ResMan->default_instance->tex
OpenGL::Sandbox::ResMan->default_instance->tex
Shortcut for OpenGL::Sandbox::ResMan->default_instance->font
OpenGL::Sandbox::ResMan->default_instance->font
Note that you need to install OpenGL::Sandbox::V1::FTGLFont in order to get font support, currently. Other font providers might be added later.
Exports ':all' from OpenGL::Sandbox::V1 (which must be installed separately). This module contains many "sugar" functions to make the GL 1.x API more friendly.
:V2:all, :V3:all, etc will likewise import everything from packages named OpenGL::SandBox::V$_ which do not currently exist, but could be authored in the future.
:V2:all
:V3:all
OpenGL::SandBox::V$_
Pick the lightest smallest module that can get a window set up for rendering. This tries: X11::GLX, and SDLx::App in that order. It assumes you don't have any desire to receive user input and just want to render some stuff. If you do actually have a preference, you should just invoke that package yourself.
Always returns an object whose scope controls the lifecycle of the window, and that object always has a swap_buffers method.
swap_buffers
Returns the symbolic names of any pending OpenGL errors, as a list.
Getting this module collection installed is abnormally difficult. This is a "selfish module" that I wrote primarily for me, but published in case it might be useful to someone else. My other more altruistic modules aim for high compatibility, but this one just unapologetically depends on lots of specific things.
For the core module, you need:
Perl 5.14 or higher
libGL, and headers
LibAV libraries libswscale, libavutil, and headers, for the feature that automatically rescales textures
Image::PNG::Libpng, for the feature that automatically loads PNG.
File::Map, for efficiently memory-mapping resource files
Inline::C, including a local C compiler
For the "V1" module (OpenGL::Sandbox::V1) you will additionally need
libGLU and headers
Inline::CPP, including a local C++ compiler
For the "FTGLFont" module (OpenGL::Sandbox::V1::FTGLFont) you will additionally need
libftgl, and libfreetype2, and headers
You probably also want a module to open a GL context to see things in. This module is aware of X11::GLX and SDL, but you can use anything you like since the GL context is global.
Michael Conrad <mike@nrdvana.net>
This software is copyright (c) 2018 by Michael Conrad.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install OpenGL::Sandbox, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OpenGL::Sandbox
CPAN shell
perl -MCPAN -e shell install OpenGL::Sandbox
For more information on module installation, please visit the detailed CPAN module installation guide.