Acme-MITHALDU-BleedingOpenGL
view release on metacpan or search on metacpan
BleedingOpenGL.pm view on Meta::CPAN
}
eval "sub $AUTOLOAD { $val }";
goto &$AUTOLOAD;
}
bootstrap Acme::MITHALDU::BleedingOpenGL;
*OpenGL::Array::CLONE_SKIP = sub { 1 }; # OpenGL::Array is not thread safe
*OpenGL::Matrix::CLONE_SKIP = sub { 1 }; # OpenGL::Matrix is not thread safe
# The following material is directly copied from Stan Melax's original OpenGL-0.4
# (with modifications for OS/2).
%window_defaults=(
'x' => 0,
'y' => 0,
'width' => 500,
'height' => 500,
'parent' => 0,
'steal' => 0,
'mask' => (_have_glx() ? StructureNotifyMask() : 0),
BleedingOpenGL.pm view on Meta::CPAN
}
#
# glpcOpenWindow() no longer exported. Use fully qualified
# package name or (better!) glpOpenWindow()
#
glpcOpenWindow($p{'x'},$p{'y'},$p{'width'},$p{'height'},
$p{'parent'},$p{'mask'},$p{'steal'},
@{$p{'attributes'}});
}
# The following material is original to OpenGL-0.5, and provides compatibility
# with some of Stan's functions.
sub glpClipPlane { glClipPlane_p(@_) }
sub glpGetClipPlane { glGetClipPlane_p(@_) }
sub glpLoadMatrixd { glLoadMatrixd_p(@_) }
sub glpMultMatrixd { glMultMatrixd_p(@_) }
BleedingOpenGL.pm view on Meta::CPAN
}
unless (_have_glut()) {
*glutSolidSphere = \&glpSolidSphere;
}
sub glpFullScreen
{
my $params = {};
$params->{original_x} = glutGet(0x0064); # GLUT_WINDOW_X
$params->{original_y} = glutGet(0x0065); # GLUT_WINDOW_Y
$params->{original_w} = glutGet(0x0066); # GLUT_WINDOW_WIDTH
$params->{original_h} = glutGet(0x0067); # GLUT_WINDOW_HEIGHT
glutFullScreen();
$params->{w} = glutGet(0x0066); # GLUT_WINDOW_WIDTH
$params->{h} = glutGet(0x0067); # GLUT_WINDOW_HEIGHT
return $params;
}
sub glpRestoreScreen
{
my($params) = @_;
glutPositionWindow($params->{original_x},$params->{original_y});
glutReshapeWindow($params->{original_w},$params->{original_h});
glutPostRedisplay();
}
sub glpCheckExtension
{
my(@extensions) = @_;
# Get/cache OpenGL Version
if (!$gl_version)
{
Copyright (c) 1998,1999 Kenneth Albanowski. All rights reserved.
Copyright (c) 2007 Bob Free. All rights reserved.
Copyright (c) 2009-2013 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.
Some portions of this module, including some code sections in OpenGL.pm and
OpenGL.xs (marked by "Melax" comments) are Copyright Stan Melax, as are the
files in the example/ directory. This is Stan's original COPYRIGHT message
for those works:
(c) Copyright 1995, Stan Melax, ALL RIGHTS RESERVED
Stan Melax
Alberta Research Council
stan@arc.ab.ca
http://www.arc.ab.ca/~stan
Please feel free to give
me acknowledgement/credit/money/honorable-mention/job-offers/research-funding
KNOWN_PROBLEMS view on Meta::CPAN
* ActiveState automated PPM builds currently fail due to
what appears to be interface detection failures in their
build environment. You'll need to use another PPM site
or build your own OpenGL: (1) install ASPerl on your
system, (2) do ppm install MinGW to get the compile
environment, (3) cpan -i OpenGL, and you should be done!
* The build may fail if your FreeGLUT installation uses
freeglut.h as the name of its include file. This may
happen if you have both original GLUT and FreeGLUT on
the same system. Edit the Makefile produced and add
-DHAVE_FREEGLUT_H to the DEFINE = line and things may
compile then.
* Configuration and compiling requires an active OpenGL
context on non-win32 systems (e.g. a display)
* The calling interfaces for OpenGL, GLU, GLUT, GLX, X11,
and the perl module routines (names beginning with glp)
are in a state of flux and may not be in sync with the
Perl OpenGL: a.k.a. POGL
As of OpenGL-0.57 POGL now requires FreeGLUT (GLUT on Mac OS X)
for full functionality:
http://freeglut.sourceforge.net/
This was due to licensing constraints and lack of window close events
in GLUT. Efforts are being made to support the original GLUT with
reduced functionality and limited to the common subset of operations.
NOTE: FreeGLUT distributions on Linux are deployed as libglut.so files,
making it difficult to detect whether GLUT or FreeGLUT is installed.
As such, FreeGLUT is assumed. See INSTALL for options to override
this default.
NOTE: POGL automatically installs a binary FreeGLUT library on 32bit
It is intended that it supports:
OpenGL 1.0, 1.1, 1.2 (some? most?). (And various extensions).
GLU (unknown version). Several (important to nurbs) functions are not
supported yet.
GLUT, with full support up to API version 3.
GLX is only supported to the degree that Stan's original module
supported it. Without an entire X binding it is of limited use, and I
recommend using glut or Gtk::GLArea instead.
Most functions that have no pointer arguments are called identically in
Perl as in C, and the same name is used. Functions that use array
arguments and have been changed in "the obvious way" -- to take a
variable number of arguments and/or to return an array -- have the
the same names as their C counterparts, but with a _p suffix.
All functions that take pointers are available with their original
calling syntax and a _c suffix. These are most useful when combined with
the OpenGL::Array module, which lets you allocate C arrays from Perl.
A third variant, _s, exists for most pointer functions, and takes a string
argument for each pointer. The underlying OpenGL function will be passed
a pointer to that string. If these variants are passed a reference to a
string, they treat the string contents as the buffer being pointed to.
glext_procs.h view on Meta::CPAN
#define GL_QUERY_TARGET 0x82EA
#define GL_GUILTY_CONTEXT_RESET 0x8253
#define GL_INNOCENT_CONTEXT_RESET 0x8254
#define GL_UNKNOWN_CONTEXT_RESET 0x8255
#define GL_RESET_NOTIFICATION_STRATEGY 0x8256
#define GL_LOSE_CONTEXT_ON_RESET 0x8252
#define GL_NO_RESET_NOTIFICATION 0x8261
#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT 0x00000004
#define GL_CONTEXT_RELEASE_BEHAVIOR 0x82FB
#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82FC
typedef void (APIENTRYP PFNGLCLIPCONTROLPROC) (GLenum origin, GLenum depth);
typedef void (APIENTRYP PFNGLCREATETRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids);
typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC) (GLuint xfb, GLuint index, GLuint buffer);
typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC) (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKIVPROC) (GLuint xfb, GLenum pname, GLint *param);
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint *param);
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI64_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint64 *param);
typedef void (APIENTRYP PFNGLCREATEBUFFERSPROC) (GLsizei n, GLuint *buffers);
typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags);
typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage);
typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data);
glext_procs.h view on Meta::CPAN
typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVPROC) (GLenum map, GLsizei bufSize, GLuint *values);
typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVPROC) (GLenum map, GLsizei bufSize, GLushort *values);
typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEPROC) (GLsizei bufSize, GLubyte *pattern);
typedef void (APIENTRYP PFNGLGETNCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table);
typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image);
typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span);
typedef void (APIENTRYP PFNGLGETNHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values);
typedef void (APIENTRYP PFNGLGETNMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values);
typedef void (APIENTRYP PFNGLTEXTUREBARRIERPROC) (void);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glClipControl (GLenum origin, GLenum depth);
GLAPI void APIENTRY glCreateTransformFeedbacks (GLsizei n, GLuint *ids);
GLAPI void APIENTRY glTransformFeedbackBufferBase (GLuint xfb, GLuint index, GLuint buffer);
GLAPI void APIENTRY glTransformFeedbackBufferRange (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
GLAPI void APIENTRY glGetTransformFeedbackiv (GLuint xfb, GLenum pname, GLint *param);
GLAPI void APIENTRY glGetTransformFeedbacki_v (GLuint xfb, GLenum pname, GLuint index, GLint *param);
GLAPI void APIENTRY glGetTransformFeedbacki64_v (GLuint xfb, GLenum pname, GLuint index, GLint64 *param);
GLAPI void APIENTRY glCreateBuffers (GLsizei n, GLuint *buffers);
GLAPI void APIENTRY glNamedBufferStorage (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags);
GLAPI void APIENTRY glNamedBufferData (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage);
GLAPI void APIENTRY glNamedBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data);
include/GL/glext.h view on Meta::CPAN
#define GL_QUERY_TARGET 0x82EA
#define GL_GUILTY_CONTEXT_RESET 0x8253
#define GL_INNOCENT_CONTEXT_RESET 0x8254
#define GL_UNKNOWN_CONTEXT_RESET 0x8255
#define GL_RESET_NOTIFICATION_STRATEGY 0x8256
#define GL_LOSE_CONTEXT_ON_RESET 0x8252
#define GL_NO_RESET_NOTIFICATION 0x8261
#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT 0x00000004
#define GL_CONTEXT_RELEASE_BEHAVIOR 0x82FB
#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH 0x82FC
typedef void (APIENTRYP PFNGLCLIPCONTROLPROC) (GLenum origin, GLenum depth);
typedef void (APIENTRYP PFNGLCREATETRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint *ids);
typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERBASEPROC) (GLuint xfb, GLuint index, GLuint buffer);
typedef void (APIENTRYP PFNGLTRANSFORMFEEDBACKBUFFERRANGEPROC) (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKIVPROC) (GLuint xfb, GLenum pname, GLint *param);
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint *param);
typedef void (APIENTRYP PFNGLGETTRANSFORMFEEDBACKI64_VPROC) (GLuint xfb, GLenum pname, GLuint index, GLint64 *param);
typedef void (APIENTRYP PFNGLCREATEBUFFERSPROC) (GLsizei n, GLuint *buffers);
typedef void (APIENTRYP PFNGLNAMEDBUFFERSTORAGEPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags);
typedef void (APIENTRYP PFNGLNAMEDBUFFERDATAPROC) (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage);
typedef void (APIENTRYP PFNGLNAMEDBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data);
include/GL/glext.h view on Meta::CPAN
typedef void (APIENTRYP PFNGLGETNPIXELMAPUIVPROC) (GLenum map, GLsizei bufSize, GLuint *values);
typedef void (APIENTRYP PFNGLGETNPIXELMAPUSVPROC) (GLenum map, GLsizei bufSize, GLushort *values);
typedef void (APIENTRYP PFNGLGETNPOLYGONSTIPPLEPROC) (GLsizei bufSize, GLubyte *pattern);
typedef void (APIENTRYP PFNGLGETNCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *table);
typedef void (APIENTRYP PFNGLGETNCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void *image);
typedef void (APIENTRYP PFNGLGETNSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void *row, GLsizei columnBufSize, void *column, void *span);
typedef void (APIENTRYP PFNGLGETNHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values);
typedef void (APIENTRYP PFNGLGETNMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void *values);
typedef void (APIENTRYP PFNGLTEXTUREBARRIERPROC) (void);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glClipControl (GLenum origin, GLenum depth);
GLAPI void APIENTRY glCreateTransformFeedbacks (GLsizei n, GLuint *ids);
GLAPI void APIENTRY glTransformFeedbackBufferBase (GLuint xfb, GLuint index, GLuint buffer);
GLAPI void APIENTRY glTransformFeedbackBufferRange (GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
GLAPI void APIENTRY glGetTransformFeedbackiv (GLuint xfb, GLenum pname, GLint *param);
GLAPI void APIENTRY glGetTransformFeedbacki_v (GLuint xfb, GLenum pname, GLuint index, GLint *param);
GLAPI void APIENTRY glGetTransformFeedbacki64_v (GLuint xfb, GLenum pname, GLuint index, GLint64 *param);
GLAPI void APIENTRY glCreateBuffers (GLsizei n, GLuint *buffers);
GLAPI void APIENTRY glNamedBufferStorage (GLuint buffer, GLsizeiptr size, const void *data, GLbitfield flags);
GLAPI void APIENTRY glNamedBufferData (GLuint buffer, GLsizeiptr size, const void *data, GLenum usage);
GLAPI void APIENTRY glNamedBufferSubData (GLuint buffer, GLintptr offset, GLsizeiptr size, const void *data);
pogl_gl_top.xs view on Meta::CPAN
##################### GLU #########################
############################## GLUT #########################
# /* This is assigned to GLX for now. The glp*() functions should be split out */
#ifdef IN_POGL_GLX_XS
# /* The following material is directly copied from Stan Melax's original OpenGL-0.4 */
int
__had_dbuffer_hack()
#ifdef HAVE_GLpc /* GLX */
#// $ID = glpcOpenWindow($x,$y,$w,$h,$pw,$steal,$event_mask,@attribs);
HV *
glpcOpenWindow(x,y,w,h,pw,event_mask,steal, ...)
If this option is given, a single patch file will be created if
any changes are suggested. This requires a working diff program
to be installed on your system.
=head2 --copy=I<suffix>
If this option is given, a copy of each file will be saved with
the given suffix that contains the suggested changes. This does
not require any external programs. Note that this does not
automagially add a dot between the original filename and the
suffix. If you want the dot, you have to include it in the option
argument.
If neither C<--patch> or C<--copy> are given, the default is to
simply print the diffs for each file. This requires either
C<Text::Diff> or a C<diff> program to be installed.
=head2 --diff=I<program>
Manually set the diff program and options to use. The default
{
my $self = do { local(@ARGV,$/)=($0); <> };
my($copy) = $self =~ /^=head\d\s+COPYRIGHT\s*^(.*?)^=\w+/ms;
$copy =~ s/^(?=\S+)/ /gms;
$self =~ s/^$HS+Do NOT edit.*?(?=^-)/$copy/ms;
$self =~ s/^SKIP.*(?=^__DATA__)/SKIP
if (\@ARGV && \$ARGV[0] eq '--unstrip') {
eval { require Devel::PPPort };
\$@ and die "Cannot require Devel::PPPort, please install.\\n";
if (eval \$Devel::PPPort::VERSION < $VERSION) {
die "$0 was originally generated with Devel::PPPort $VERSION.\\n"
. "Your Devel::PPPort is only version \$Devel::PPPort::VERSION.\\n"
. "Please install a newer version, or --unstrip will not work.\\n";
}
Devel::PPPort::WriteFile(\$0);
exit 0;
}
print <<END;
Sorry, but this is a stripped version of \$0.
To be able to use its original script and doc functionality,
please try to regenerate this file using:
\$^X \$0 --unstrip
END
/ms;
my($pl, $c) = $self =~ /(.*^__DATA__)(.*)/ms;
$c =~ s{
/ (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]*)
| ( "[^"\\]*(?:\\.[^"\\]*)*"
{
glDrawArrays(GL_QUADS, $i, 4);
}
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_NORMAL_ARRAY);
glDisableClientState(GL_VERTEX_ARRAY);
# Move back to the origin (for the text, below).
glLoadIdentity();
# We need to change the projection matrix for the text rendering.
glMatrixMode(GL_PROJECTION);
# But we like our current view too; so we save it here.
glPushMatrix();
# Now we set up a new projection for the text.
glLoadIdentity();
( run in 0.783 second using v1.01-cache-2.11-cpan-1c8d708658b )