My answer: use Perl bindings for OpenGL
I didn’t exactly answer your question, but I'm sure you can accept this code
I haven't done OpenGL before, but it was a fun little evening project.
use OpenGL qw/ :all /; use constant ESCAPE => 27;
source share