Acme-MITHALDU-BleedingOpenGL
view release on metacpan or search on metacpan
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
FreeGLUT/freeglut-Readme.txt view on Meta::CPAN
Compiling 32 bit Applications
To create a 32 bit freeglut application, create a new Win32 C++ project in MSVC.
From the Win32 Application Wizard, choose a Windows application, check the
Empty project box, and submit.
Youll now need to configure the compiler and linker settings. Open up the
project properties, and select All Configurations (this is necessary to ensure
our changes are applied for both debug and release builds). Open up the
general section under C/C++, and configure the include\ folder you created
above as an Additional Include Directory. If you have more than one GLUT
package which contains a glut.h file, its important to ensure that the
freeglut include folder appears above all other GLUT include folders.
Now open up the general section under Linker, and configure the lib\
folder you created above as an Additional Library Directory. A freeglut
application depends on the import libraries freeglut.lib and opengl32.lib,
which can be configured under the Input section. However, it shouldnt be
necessary to explicitly state these dependencies, since the freeglut headers
handle this for you. Now open the Advanced section, and enter mainCRTStartup
as the Entry Point for your application. This is necessary because GLUT
applications use main as the application entry point, not WinMainwithout it
youll get an undefined reference when you try to link your application.
Thats all of your project properties configured, so you can now add source
files to your project and build the application. If you want your application to
be compatible with GLUT, you should #include <GL/glut.h>. If you want to use
freeglut specific extensions, you should #include <GL/freeglut.h> instead.
Dont forget to either include the freeglut DLL when distributing applications,
glext_consts.h view on Meta::CPAN
i(GL_MAX_RASTER_SAMPLES_EXT)
i(GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT)
i(GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT)
i(GL_EFFECTIVE_RASTER_SAMPLES_EXT)
#endif /* GL_EXT_raster_multisample */
#ifndef NO_GL_EXT_rescale_normal
i(GL_RESCALE_NORMAL_EXT)
#endif /* GL_EXT_rescale_normal */
#ifndef NO_GL_EXT_secondary_color
i(GL_COLOR_SUM_EXT)
i(GL_CURRENT_SECONDARY_COLOR_EXT)
i(GL_SECONDARY_COLOR_ARRAY_SIZE_EXT)
i(GL_SECONDARY_COLOR_ARRAY_TYPE_EXT)
i(GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT)
i(GL_SECONDARY_COLOR_ARRAY_POINTER_EXT)
i(GL_SECONDARY_COLOR_ARRAY_EXT)
#endif /* GL_EXT_secondary_color */
#ifndef NO_GL_EXT_separate_shader_objects
i(GL_ACTIVE_PROGRAM_EXT)
#endif /* GL_EXT_separate_shader_objects */
#ifndef NO_GL_EXT_separate_specular_color
i(GL_LIGHT_MODEL_COLOR_CONTROL_EXT)
i(GL_SINGLE_COLOR_EXT)
i(GL_SEPARATE_SPECULAR_COLOR_EXT)
#endif /* GL_EXT_separate_specular_color */
glext_procs.h view on Meta::CPAN
#endif /* GL_GLEXT_PROCS */
#endif /* GL_EXT_raster_multisample */
#ifndef NO_GL_EXT_rescale_normal
#ifndef GL_EXT_rescale_normal
#define GL_EXT_rescale_normal 1
#endif
#define GL_RESCALE_NORMAL_EXT 0x803A
#endif /* GL_EXT_rescale_normal */
#ifndef NO_GL_EXT_secondary_color
#ifndef GL_EXT_secondary_color
#define GL_EXT_secondary_color 1
#endif
#define GL_COLOR_SUM_EXT 0x8458
#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459
#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A
#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B
#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C
#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
glext_procs.h view on Meta::CPAN
static PFNGLSECONDARYCOLOR3SEXTPROC glSecondaryColor3sEXT = NULL;
static PFNGLSECONDARYCOLOR3SVEXTPROC glSecondaryColor3svEXT = NULL;
static PFNGLSECONDARYCOLOR3UBEXTPROC glSecondaryColor3ubEXT = NULL;
static PFNGLSECONDARYCOLOR3UBVEXTPROC glSecondaryColor3ubvEXT = NULL;
static PFNGLSECONDARYCOLOR3UIEXTPROC glSecondaryColor3uiEXT = NULL;
static PFNGLSECONDARYCOLOR3UIVEXTPROC glSecondaryColor3uivEXT = NULL;
static PFNGLSECONDARYCOLOR3USEXTPROC glSecondaryColor3usEXT = NULL;
static PFNGLSECONDARYCOLOR3USVEXTPROC glSecondaryColor3usvEXT = NULL;
static PFNGLSECONDARYCOLORPOINTEREXTPROC glSecondaryColorPointerEXT = NULL;
#endif /* GL_GLEXT_PROCS */
#endif /* GL_EXT_secondary_color */
#ifndef NO_GL_EXT_separate_shader_objects
#ifndef GL_EXT_separate_shader_objects
#define GL_EXT_separate_shader_objects 1
#endif
#define GL_ACTIVE_PROGRAM_EXT 0x8B8D
typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program);
typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program);
typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string);
#ifdef GL_GLEXT_PROTOTYPES
include/GL/glext.h view on Meta::CPAN
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glRasterSamplesEXT (GLuint samples, GLboolean fixedsamplelocations);
#endif
#endif /* GL_EXT_raster_multisample */
#ifndef GL_EXT_rescale_normal
#define GL_EXT_rescale_normal 1
#define GL_RESCALE_NORMAL_EXT 0x803A
#endif /* GL_EXT_rescale_normal */
#ifndef GL_EXT_secondary_color
#define GL_EXT_secondary_color 1
#define GL_COLOR_SUM_EXT 0x8458
#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459
#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A
#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B
#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C
#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);
include/GL/glext.h view on Meta::CPAN
GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort red, GLshort green, GLshort blue);
GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *v);
GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte red, GLubyte green, GLubyte blue);
GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *v);
GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint red, GLuint green, GLuint blue);
GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *v);
GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort red, GLushort green, GLushort blue);
GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *v);
GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint size, GLenum type, GLsizei stride, const void *pointer);
#endif
#endif /* GL_EXT_secondary_color */
#ifndef GL_EXT_separate_shader_objects
#define GL_EXT_separate_shader_objects 1
#define GL_ACTIVE_PROGRAM_EXT 0x8B8D
typedef void (APIENTRYP PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program);
typedef void (APIENTRYP PFNGLACTIVEPROGRAMEXTPROC) (GLuint program);
typedef GLuint (APIENTRYP PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar *string);
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glUseShaderProgramEXT (GLenum type, GLuint program);
GLAPI void APIENTRY glActiveProgramEXT (GLuint program);
include/GL/glxext.h view on Meta::CPAN
#ifndef GLX_NV_copy_image
#define GLX_NV_copy_image 1
typedef void ( *PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLi...
#ifdef GLX_GLXEXT_PROTOTYPES
void glXCopyImageSubDataNV (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ...
#endif
#endif /* GLX_NV_copy_image */
#ifndef GLX_NV_delay_before_swap
#define GLX_NV_delay_before_swap 1
typedef Bool ( *PFNGLXDELAYBEFORESWAPNVPROC) (Display *dpy, GLXDrawable drawable, GLfloat seconds);
#ifdef GLX_GLXEXT_PROTOTYPES
Bool glXDelayBeforeSwapNV (Display *dpy, GLXDrawable drawable, GLfloat seconds);
#endif
#endif /* GLX_NV_delay_before_swap */
#ifndef GLX_NV_float_buffer
#define GLX_NV_float_buffer 1
#define GLX_FLOAT_COMPONENTS_NV 0x20B0
#endif /* GLX_NV_float_buffer */
#ifndef GLX_NV_multisample_coverage
#define GLX_NV_multisample_coverage 1
include/GL/wglext.h view on Meta::CPAN
#ifndef WGL_NV_copy_image
#define WGL_NV_copy_image 1
typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint ds...
#ifdef WGL_WGLEXT_PROTOTYPES
BOOL WINAPI wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, ...
#endif
#endif /* WGL_NV_copy_image */
#ifndef WGL_NV_delay_before_swap
#define WGL_NV_delay_before_swap 1
typedef BOOL (WINAPI * PFNWGLDELAYBEFORESWAPNVPROC) (HDC hDC, GLfloat seconds);
#ifdef WGL_WGLEXT_PROTOTYPES
BOOL WINAPI wglDelayBeforeSwapNV (HDC hDC, GLfloat seconds);
#endif
#endif /* WGL_NV_delay_before_swap */
#ifndef WGL_NV_float_buffer
#define WGL_NV_float_buffer 1
#define WGL_FLOAT_COMPONENTS_NV 0x20B0
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
* Definitions of specific events.
*/
typedef struct {
int type; /* of event */
unsigned long serial; /* # of last request processed by server */
Bool send_event; /* true if this came from a SendEvent request */
Display *display; /* Display the event was read from */
Window window; /* "event" window it is reported relative to */
Window root; /* root window that the event occured on */
Window subwindow; /* child window */
Time time; /* milliseconds */
int x, y; /* pointer x, y coordinates in event window */
int x_root, y_root; /* coordinates relative to root */
unsigned int state; /* key or button mask */
unsigned int keycode; /* detail */
Bool same_screen; /* same screen flag */
char trans_chars[XMaxTransChars];
/* translated characters */
int nchars;
} XKeyEvent;
typedef XKeyEvent XKeyPressedEvent;
typedef XKeyEvent XKeyReleasedEvent;
typedef struct {
int type; /* of event */
unsigned long serial; /* # of last request processed by server */
Bool send_event; /* true if this came from a SendEvent request */
Display *display; /* Display the event was read from */
Window window; /* "event" window it is reported relative to */
Window root; /* root window that the event occured on */
Window subwindow; /* child window */
Time time; /* milliseconds */
int x, y; /* pointer x, y coordinates in event window */
int x_root, y_root; /* coordinates relative to root */
unsigned int state; /* key or button mask */
unsigned int button; /* detail */
Bool same_screen; /* same screen flag */
} XButtonEvent;
typedef XButtonEvent XButtonPressedEvent;
typedef XButtonEvent XButtonReleasedEvent;
typedef struct {
int type; /* of event */
unsigned long serial; /* # of last request processed by server */
Bool send_event; /* true if this came from a SendEvent request */
Display *display; /* Display the event was read from */
Window window; /* "event" window reported relative to */
Window root; /* root window that the event occured on */
Window subwindow; /* child window */
Time time; /* milliseconds */
int x, y; /* pointer x, y coordinates in event window */
int x_root, y_root; /* coordinates relative to root */
unsigned int state; /* key or button mask */
char is_hint; /* detail */
Bool same_screen; /* same screen flag */
} XMotionEvent;
typedef XMotionEvent XPointerMovedEvent;
typedef struct {
int type; /* of event */
unsigned long serial; /* # of last request processed by server */
Bool send_event; /* true if this came from a SendEvent request */
Display *display; /* Display the event was read from */
Window window; /* "event" window reported relative to */
Window root; /* root window that the event occured on */
Window subwindow; /* child window */
Time time; /* milliseconds */
int x, y; /* pointer x, y coordinates in event window */
int x_root, y_root; /* coordinates relative to root */
int mode; /* NotifyNormal, NotifyGrab, NotifyUngrab */
int detail;
/*
* NotifyAncestor, NotifyVirtual, NotifyInferior,
* NotifyNonlinear,NotifyNonlinearVirtual
*/
Bool same_screen; /* same screen flag */
Bool focus; /* boolean focus */
pogl_glut.xs view on Meta::CPAN
#endif
}
#//# glutIdleFunc(\&callback);
void
glutIdleFunc(handler=0, ...)
SV * handler
CODE:
decl_ggh_xs(Idle)
#//# glutTimerFunc($msecs, \&callback);
void
glutTimerFunc(msecs, handler=0, ...)
unsigned int msecs
SV * handler
CODE:
{
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;}
# Colors
#//# glutSetColor($cell, $red, $green, $blue)
void
glutSetColor(cell, red, green, blue)
int cell
macro. Just C<#define> the macro before including C<newppp.h>:
#define DPPP_NAMESPACE MyOwnNamespace_
#include "newppp.h"
The default namespace is C<DPPP_>.
=back
The good thing is that most of the above can be checked by running
F<newppp.h> on your source code. See the next section for
details.
=head1 EXAMPLES
To verify whether F<newppp.h> is needed for your module, whether you
should make any changes to your code, and whether any special defines
should be used, F<newppp.h> can be run as a Perl script to check your
source code. Simply say:
perl newppp.h
init_stacks||5.005000|
init_tm||5.007002|
instr|||n
intro_my|||
intuit_method|||
intuit_more|||
invert|||
invlist_array|||
invlist_destroy|||
invlist_extend|||
invlist_intersection|||
invlist_len|||
invlist_max|||
invlist_set_array|||
invlist_set_len|||
invlist_set_max|||
invlist_trim|||
invlist_union|||
invoke_exception_hook|||
io_close|||
isALNUMC|5.006000||p
* data from C. All statics in extensions should be reworked to use
* this, if you want to make the extension thread-safe. See ext/re/re.xs
* for an example of the use of these macros.
*
* Code that uses these macros is responsible for the following:
* 1. #define MY_CXT_KEY to a unique string, e.g. "DynaLoader_guts"
* 2. Declare a typedef named my_cxt_t that is a structure that contains
* all the data that needs to be interpreter-local.
* 3. Use the START_MY_CXT macro after the declaration of my_cxt_t.
* 4. Use the MY_CXT_INIT macro such that it is called exactly once
* (typically put in the BOOT: section).
* 5. Use the members of the my_cxt_t structure everywhere as
* MY_CXT.member.
* 6. Use the dMY_CXT macro (a declaration) in all the functions that
* access MY_CXT.
*/
#if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \
defined(PERL_CAPI) || defined(PERL_IMPLICIT_CONTEXT)
#ifndef START_MY_CXT
(
1.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
0.0, 0.0, 0.0, 1.0
);
my $xform = OpenGL::Array->new_list(GL_FLOAT,@xform);
# ------
# Frames per second (FPS) statistic variables and routine.
use constant CLOCKS_PER_SEC => $hasHires ? 1000 : 1;
use constant FRAME_RATE_SAMPLES => 50;
my $FrameCount = 0;
my $FrameRate = 0;
my $last=0;
sub ourDoFPS
{
glRasterPos2i(2,62); ourPrintString(GLUT_BITMAP_HELVETICA_12,$buf);
$buf = sprintf "Inset: %d", $Inset_On;
glRasterPos2i(2,74); ourPrintString(GLUT_BITMAP_HELVETICA_12,$buf);
# Now we want to render the calulated FPS at the top.
# To ease, simply translate up. Note we're working in screen
# pixels in this projection.
glTranslatef(6.0,$Window_Height - 14,0.0);
# Make sure we can read the FPS section by first placing a
# dark, mostly opaque backdrop rectangle.
glColor4f(0.2,0.2,0.2,0.75);
glBegin(GL_QUADS);
glVertex3f( 0.0, -2.0, 0.0);
glVertex3f( 0.0, 12.0, 0.0);
glVertex3f(140.0, 12.0, 0.0);
glVertex3f(140.0, -2.0, 0.0);
glEnd();
utils/wgl_ext.txt view on Meta::CPAN
GL_EXT_depth_bounds_test
GL_EXT_draw_range_elements
GL_EXT_fog_coord
GL_EXT_framebuffer_object
GL_EXT_multi_draw_arrays
GL_EXT_packed_depth_stencil
GL_EXT_packed_pixels
GL_EXT_pixel_buffer_object
GL_EXT_point_parameters
GL_EXT_rescale_normal
GL_EXT_secondary_color
GL_EXT_separate_specular_color
GL_EXT_shadow_funcs
GL_EXT_stencil_clear_tag
GL_EXT_stencil_two_side
GL_EXT_stencil_wrap
GL_EXT_texture3D
GL_EXT_texture_compression_s3tc
GL_EXT_texture_cube_map
GL_EXT_texture_edge_clamp
GL_EXT_texture_env_combine
( run in 1.637 second using v1.01-cache-2.11-cpan-39bf76dae61 )