Acme-MITHALDU-BleedingOpenGL

 view release on metacpan or  search on metacpan

BleedingOpenGL.pm  view on Meta::CPAN

   SyncBoth
   StaticGray
   GrayScale
   StaticColor
   PseudoColor
   TrueColor
   DirectColor
);


# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.

@oldfunctions = qw(
	glpOpenWindow
	glpMainLoop
	glpMoveResizeWindow
	glpMoveWindow
	glpResizeWindow
	glpDisplay
	glXSwapBuffers 

BleedingOpenGL.pm  view on Meta::CPAN

}

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),
   'attributes'=> [],
);


sub glpOpenWindow {
        # default values
        my(%a) = @_;
        my(%p) = %window_defaults;
        foreach $k (keys(%a)){
                exists($p{$k}) || warn "Not a valid parameter to glpOpenWindow: `$k'\n";
                #print "parameter $k now ",$a{$k}," was ",$p{$k},"\n";  
                $p{$k} = $a{$k};
        }
        #
        # glpcOpenWindow() no longer exported.  Use fully qualified
        # package name or (better!) glpOpenWindow()
        #
        glpcOpenWindow($p{'x'},$p{'y'},$p{'width'},$p{'height'},

INSTALL  view on Meta::CPAN


    Install FreeGLUT (or compatible) - you can find this at
    http://freeglut.sourceforge.net/.  NOTE: Strawberry Perl
    includes the FreeGLUT library and the binary distributions
    at http://www.sisyphusion.tk provide the needed FreeGLUT
    as well.

    On 32-bit MS Windows, a binary FreeGLUT library is installed
    automatically by this module if needed.
    
    On Mac OS X (Leopard and newer), GLUT is available in the default
    OpenGL programming environment with sufficient extensions (added
    by Apple) to support full functionality.
    
    On most Linux distributions FreeGLUT is available via their
    package installers.

    The 'include' subfolder provided with this module contains
    headers that this module has been tested with.

    This module looks for libGL.so, libGLU.so and libglut.so

INSTALL  view on Meta::CPAN

    but not required, that you install PerlMagick (6.3.5 or newer) first,
    as this will dramatically simplify and enhance your ability/performance
    in loading/saving images/textures via OpenGL::Image - see INSTALL note
    in the OpenGL::Image module.

 
 2. Run 'perl Makefile.PL'

    Makefile.PL attempts to detemine your OS and available libs.

    You can override these defaults by specifying addiional
    options, shown in square brackets []:

        perl Makefile.PL [verbose] [interface=<XFACE>] [dist=<EXCLUSION SETTING>]

    The "verbose" option provides additional diagnostic output messages
    which can be helpful for troubleshooting and bug reports.

    For the "interface" option, <XFACE> is one of the following strings:
			      
        FREEGLUT		Default window interface
        GLUT			Fallback if FreeGLUT is not available
        AGL			GLUT framework on Mac OS X
        GLX			Legacy X11+GLX, use FreeGLUT instead
	W32API                  FreeGLUT and W32API OpenGL on CYGWIN
	WGL                     Same as W32API

    Specifying the interface directly should not be needed except
    where there is some ambiguity in the available interfaces (i.e.
    you have FreeGLUT, GLUT, and GLX on your system).  If you have
    FreeGLUT and OpenGL installed, it should just work with the defaults.

    *Please* let us know if it doesn't.

    Makefile.PL will attempt to build and run a glversion utility to
    determine what version and extensions your OpenGL installation
    supports, and will create an gl_exclude.h header file to exclude
    APIs your libraries do not support.  You can manually edit this
    file to override excluded extensions.


    Note: glversion assumes libGL.so and libglut.so
    (opengl32.dll and freeglut.dll on Windows) - and that it will
    be run via a GUI window (eg. X11 on Unix).  This may impact
    automated build systems.


    For building POGL without extension exclusions, use:

        perl Makefile.PL dist=NO_EXCLUSIONS

    Note: NO_EXCLUSIONS is the default for Windows; this can be
    overridden by using the EXCLUSIONS option.


    To install in non-standard locations, use the INSTALL_BASE option
    when generating the Makefiles:

       perl Makefile.PL INSTALL_BASE=BASEPATH

    where BASEPATH is the path of the directory where you wish
    the module to be installed (e.g. binary executables in BASEPATH/bin,

Makefile.PL  view on Meta::CPAN

  {
    die "ERROR: multiple opengl interfaces requested: @interface_opts.\n";
  }

  ($interface_lib) = @interface_opts;
  print "User set interface to $interface_lib\n" if ($verbose && !$fallback);

  # Strip out interface args
  @ARGV = grep { !m/^interface=/i } @ARGV;
}
# Otherwise use available defaults
elsif ($IS_CYGWIN)
{
  if ($found_libs->{FREEGLUT})
  {
    $interface_lib = 'FREEGLUT'; # CYGWIN will use X11 interface by default
  }
  elsif($found_libs->{GLUT})
  {
    $interface_lib = 'GLUT';
  }
  elsif($found_libs->{GLUT32} || $found_libs->{FREEGLUT32})
  {
    $interface_lib = 'W32API';
  }
  else

README  view on Meta::CPAN

  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
      win32 perl platforms.


POGL provides access to most of the OpenGL 1.0, 1.1, and 1.2 APIs, and
many OpenGL Extensions, such as Framebuffer Objects (FBOs) and Vertex
Array Objects (VBOs).

README  view on Meta::CPAN

	Added MacOSX support

	Daiki Nomura
	Helped add FreeBSD support

0.54:	Martien Verbruggen fixed another Mesa limitation.
	#ifdef out unglob'ing: symbol not found on Solaris...

0.53:	Correct vertex_array detection in isosample.pl.
	Add more vertex_array constants (and move the definition earlier).
	Exchange (default) arguments for glp*: move display after window
	  (should not break old stuff, since there was/is no way to query
	   the display and window).
	New function $d = glpDisplay() (croaks on failure).
	Make glpOpenWindow() return the window handle.
	New functions with signatures
 void glpMoveResizeWindow(int x, int y, unsigned int width, unsigned int height, Window w, Display* display);
 void glpMoveWindow(int x, int y, Window w, Display* display);
 void glpResizeWindow(unsigned int width, unsigned int height, Window w, Display* display);
	  (w and display are optional).

Release_Notes  view on Meta::CPAN

 * OS/2 is no longer supported by POGL directly.


Highlights:

  * Paul Seamons contributed full tessellation support,
    documentation for OpenGL::Tessellation, and a *major* set
    of fixes and POD for the existing OpenGL::Array module.

  * The cygwin build of POGL now supports either the native
    win32 platform drivers or the X11/GLX bindings (default).
    Use interface=w32api or interface=wgl as args to the
    perl Makefile.PL to select.  NOTE: you have to pick one
    or the other.  If you change, any dependencies such as
    PDL::Graphics::TriD will need to be recompiled.

  * The included FreeGLUT DLL has been upgraded to 2.6.0
    thanks to Rob/sisyphus.

  * Prima::OpenGL has been released by Dmitry Karasik which
    adds support for Perl OpenGL to his cross-platform GUI

gl_util.c  view on Meta::CPAN


	case GL_TEXTURE_MAG_FILTER:
	case GL_TEXTURE_MIN_FILTER:
	case GL_TEXTURE_WRAP_S:
	case GL_TEXTURE_WRAP_T:
	case GL_TEXTURE_PRIORITY:
	case GL_TEXTURE_RESIDENT:
		return 1;
	case GL_TEXTURE_BORDER_COLOR:
		return 4;
	default:
		croak("Unknown texparameter parameter");
	}
	return 0;	// Just to make the compiler happy
}


int gl_texenv_count(GLenum pname)
{
	switch (pname) {
	case GL_TEXTURE_ENV_MODE:
		return 1;
	case GL_TEXTURE_ENV_COLOR:
		return 4;
	default:
		croak("Unknown texenv parameter");
	}
	return 0;	// Just to make the compiler happy
}

int gl_texgen_count(GLenum pname)
{
	switch (pname) {
	case GL_TEXTURE_GEN_MODE:
		return 1;
	case GL_OBJECT_PLANE:
	case GL_EYE_PLANE:
		return 4;
	default:
		croak("Unknown texgen parameter");
	}
	return 0;	// Just to make the compiler happy
}

int gl_material_count(GLenum pname)
{
	switch (pname) {
	case GL_AMBIENT:
	case GL_DIFFUSE:
	case GL_AMBIENT_AND_DIFFUSE:
	case GL_SPECULAR:
	case GL_EMISSION:
		return 4;
	case GL_COLOR_INDEXES:
		return 3;
	case GL_SHININESS:
		return 1;
	default:
		croak("Unknown material parameter");
	}
	return 0;	// Just to make the compiler happy
}


int gl_map_count(GLenum target, GLenum query)
{
	switch (query) {
	case GL_COEFF:

gl_util.c  view on Meta::CPAN

			return 3;
		case GL_MAP2_VERTEX_4:
		case GL_MAP2_COLOR_4:
		case GL_MAP2_TEXTURE_COORD_4:
			return 4;
		case GL_MAP2_TEXTURE_COORD_2:
			return 2;
		case GL_MAP2_INDEX:
		case GL_MAP2_TEXTURE_COORD_1:
			return 1;
		default:
			croak("Unknown map target");
		}
	case GL_ORDER:
		switch (target) {
		case GL_MAP1_VERTEX_3:
		case GL_MAP1_NORMAL:
		case GL_MAP1_TEXTURE_COORD_3:
		case GL_MAP1_VERTEX_4:
		case GL_MAP1_COLOR_4:
		case GL_MAP1_TEXTURE_COORD_4:

gl_util.c  view on Meta::CPAN

		case GL_MAP2_VERTEX_3:
		case GL_MAP2_NORMAL:
		case GL_MAP2_TEXTURE_COORD_3:
		case GL_MAP2_VERTEX_4:
		case GL_MAP2_COLOR_4:
		case GL_MAP2_TEXTURE_COORD_4:
		case GL_MAP2_TEXTURE_COORD_2:
		case GL_MAP2_INDEX:
		case GL_MAP2_TEXTURE_COORD_1:
			return 2;
		default:
			croak("Unknown map target");
		}
	case GL_DOMAIN:
		switch (target) {
		case GL_MAP1_VERTEX_3:
		case GL_MAP1_NORMAL:
		case GL_MAP1_TEXTURE_COORD_3:
		case GL_MAP1_VERTEX_4:
		case GL_MAP1_COLOR_4:
		case GL_MAP1_TEXTURE_COORD_4:

gl_util.c  view on Meta::CPAN

		case GL_MAP2_VERTEX_3:
		case GL_MAP2_NORMAL:
		case GL_MAP2_TEXTURE_COORD_3:
		case GL_MAP2_VERTEX_4:
		case GL_MAP2_COLOR_4:
		case GL_MAP2_TEXTURE_COORD_4:
		case GL_MAP2_TEXTURE_COORD_2:
		case GL_MAP2_INDEX:
		case GL_MAP2_TEXTURE_COORD_1:
			return 4;
		default:
			croak("Unknown map target");
		}
	default:
		croak("Unknown map query");
	}
	return 0;	// Just to make the compiler happy
}

int gl_light_count(GLenum pname)
{
	switch (pname) {
	case GL_AMBIENT:
	case GL_DIFFUSE:

gl_util.c  view on Meta::CPAN

	case GL_POSITION:
		return 4;
	case GL_SPOT_DIRECTION:
		return 3;
	case GL_SPOT_EXPONENT:
	case GL_SPOT_CUTOFF:
	case GL_CONSTANT_ATTENUATION:
	case GL_LINEAR_ATTENUATION:
	case GL_QUADRATIC_ATTENUATION:
		return 1;
	default:
		croak("Unknown light parameter");
	}
	return 0;	// Just to make the compiler happy
}

int gl_lightmodel_count(GLenum pname)
{
	switch (pname) {
	case GL_LIGHT_MODEL_AMBIENT:
		return 4;
	case GL_LIGHT_MODEL_LOCAL_VIEWER:
	case GL_LIGHT_MODEL_TWO_SIDE:
		return 1;
	default:
		croak("Unknown light model");
	}
	return 0;	// Just to make the compiler happy
}

int gl_fog_count(GLenum pname)
{
	switch (pname) {
	case GL_FOG_COLOR:
		return 4;
	case GL_FOG_MODE:
	case GL_FOG_DENSITY:
	case GL_FOG_START:
	case GL_FOG_END:
	case GL_FOG_INDEX:
		return 1;
	default:
		croak("Unknown fog parameter");
	}
	return 0;	// Just to make the compiler happy
}

int gl_get_count(GLenum param)
{

/* 3 */
#ifdef GL_EXT_polygon_offset

gl_util.c  view on Meta::CPAN

	case GL_FOG_COLOR:
	case GL_LIGHT_MODEL_AMBIENT:
	case GL_MAP2_GRID_DOMAIN:
	case GL_SCISSOR_BOX:
	case GL_VIEWPORT:
		return 4;
	case GL_MODELVIEW_MATRIX:
	case GL_PROJECTION_MATRIX:
	case GL_TEXTURE_MATRIX:
		return 16;
	default:
		{
			/* GL_LIGHTi = 1 */
			static GLint max_lights = 0;
			if (!max_lights)
				glGetIntegerv(GL_MAX_LIGHTS, &max_lights);
			if ((param > GL_LIGHT0) && (param <= (GLenum)(GL_LIGHT0 + max_lights)))
				return 1;
		}
		{
			/* GL_CLIP_PLANEi = 1 */

gl_util.c  view on Meta::CPAN

			return s;
		case GL_PIXEL_MAP_G_TO_G:
			glGetIntegerv(GL_PIXEL_MAP_G_TO_G_SIZE, &s);
			return s;
		case GL_PIXEL_MAP_B_TO_B:
			glGetIntegerv(GL_PIXEL_MAP_B_TO_B_SIZE, &s);
			return s;
		case GL_PIXEL_MAP_A_TO_A:
			glGetIntegerv(GL_PIXEL_MAP_A_TO_A_SIZE, &s);
			return s;
		default:
			croak("unknown pixelmap");
	}
	return 0;	// Just to make the compiler happy
}

int gl_state_count(GLenum state) {
	switch (state) {
		case GL_CURRENT_COLOR: return 4;
		case GL_CURRENT_INDEX: return 1;
	}

gl_util.c  view on Meta::CPAN

		case GL_BYTE: return  sizeof(GLbyte); break;
		case GL_UNSIGNED_SHORT: return sizeof(GLushort); break;
		case GL_SHORT: return sizeof(GLshort); break;
		case GL_UNSIGNED_INT: return sizeof(GLuint); break;
		case GL_INT: return sizeof(GLint); break;
		case GL_FLOAT: return  sizeof(GLfloat); break;
		case GL_DOUBLE: return  sizeof(GLdouble); break;
		case GL_2_BYTES: return 2;
		case GL_3_BYTES: return 3;
		case GL_4_BYTES: return 4;
	default:
		croak("unknown type");
	}
	return 0;	// Just to make the compiler happy
}

int gl_component_count(GLenum format, GLenum type)
{
	int n;
	switch (format) {
#ifdef GL_VERSION_1_2

gl_util.c  view on Meta::CPAN

		case GL_BLUE:
		case GL_ALPHA:
		case GL_LUMINANCE:
			n = 1; break;
		case GL_LUMINANCE_ALPHA:
			n = 2; break;
		case GL_RGB:
			n = 3; break;
		case GL_RGBA:
			n = 4; break;
		default:
			croak("unknown format");
	}

#ifdef GL_VERSION_1_2
	switch (type) {
		case GL_UNSIGNED_BYTE_3_3_2:
		case GL_UNSIGNED_BYTE_2_3_3_REV:
		case GL_UNSIGNED_SHORT_5_6_5:
		case GL_UNSIGNED_SHORT_5_6_5_REV:
		case GL_UNSIGNED_SHORT_4_4_4_4:

gl_util.c  view on Meta::CPAN

		(*(GLubyte*)*ptr) = (GLubyte)((v >> 24) & 0xff);
		(*(unsigned char**)ptr)++;
		(*(GLubyte*)*ptr) = (GLubyte)((v >> 16) & 0xff);
		(*(unsigned char**)ptr)++;
		(*(GLubyte*)*ptr) = (GLubyte)((v >> 8) & 0xff);
		(*(unsigned char**)ptr)++;
		(*(GLubyte*)*ptr) = (GLubyte)((v >> 0) & 0xff);
		(*ptr)++;
		break;
	}
	default:
		croak("Unable to set data with unknown type");
	}
#undef RIV
#undef RNV
}

SV * pgl_get_type(GLenum type, void ** ptr)
{
	SV * result = 0;
#define RIV(t)	\

gl_util.c  view on Meta::CPAN

		(*(unsigned char**)ptr)++;
		v |= (*(GLubyte*)*ptr) << 16;
		(*(unsigned char**)ptr)++;
		v |= (*(GLubyte*)*ptr) << 8;
		(*(unsigned char**)ptr)++;
		v |= (*(GLubyte*)*ptr) << 0;
		(*(unsigned char**)ptr)++;
		result = newSViv(v);
		break;
	}
	default:
		croak("Unable to get data with unknown type");
	}
	return result;
#undef RIV
#undef RNV
}

GLvoid * pack_image_ST(SV ** stack, int count, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, int mode)
{
	int i;

gl_util.h  view on Meta::CPAN

			{						\
			  ((GLfloat*)(dst))[i] = (GLfloat)SvNV(ST(i+(offset)));	\
			}						\
			break;						\
		case GL_DOUBLE:						\
			for (i=0;i<(count);i++)				\
			{						\
			  ((GLdouble*)(dst))[i] = (GLdouble)SvNV(ST(i+(offset)));	\
			}						\
			break;						\
		default:						\
			croak("unknown type");				\
	}								\
}


#ifndef GL_ADD
#define GL_ADD 0x0104
#endif

#ifndef GL_ADD_SIGNED_ARB

include/GL/freeglut_std.h  view on Meta::CPAN

 */
#ifdef _WIN32
/* #pragma may not be supported by some compilers.
 * Discussion by FreeGLUT developers suggests that
 * Visual C++ specific code involving pragmas may
 * need to move to a separate header.  24th Dec 2003
 */

/* Define FREEGLUT_LIB_PRAGMAS to 1 to include library
 * pragmas or to 0 to exclude library pragmas.
 * The default behavior depends on the compiler/platform.
 */
#   ifndef FREEGLUT_LIB_PRAGMAS
#       if ( defined(_MSC_VER) || defined(__WATCOMC__) ) && !defined(_WIN32_WCE)
#           define FREEGLUT_LIB_PRAGMAS 1
#       else
#           define FREEGLUT_LIB_PRAGMAS 0
#       endif
#   endif

#  ifndef WIN32_LEAN_AND_MEAN

include/GL/freeglut_std.h  view on Meta::CPAN


/* Comment from glut.h of classic GLUT:

   Win32 has an annoying issue where there are multiple C run-time
   libraries (CRTs).  If the executable is linked with a different CRT
   from the GLUT DLL, the GLUT DLL will not share the same CRT static
   data seen by the executable.  In particular, atexit callbacks registered
   in the executable will not be called if GLUT calls its (different)
   exit routine).  GLUT is typically built with the
   "/MD" option (the CRT with multithreading DLL support), but the Visual
   C++ linker default is "/ML" (the single threaded CRT).

   One workaround to this issue is requiring users to always link with
   the same CRT as GLUT is compiled with.  That requires users supply a
   non-standard option.  GLUT 3.7 has its own built-in workaround where
   the executable's "exit" function pointer is covertly passed to GLUT.
   GLUT then calls the executable's exit function pointer to ensure that
   any "atexit" calls registered by the application are called if GLUT
   needs to exit.

   Note that the __glut*WithExit routines should NEVER be called directly.

include/GL/glprocs.h  view on Meta::CPAN

#define wglBeginFrameTrackingI3D          (_GET_TLS_PROCTABLE()->BeginFrameTrackingI3D)
#define wglEndFrameTrackingI3D            (_GET_TLS_PROCTABLE()->EndFrameTrackingI3D)
#define wglQueryFrameTrackingI3D          (_GET_TLS_PROCTABLE()->QueryFrameTrackingI3D)
#endif /* _WIN32 */

#ifndef _APP_PROCTABLE

/*
 * Applications can replace the following function with its own function
 * for accessing thread local proc/context dependent proc table.
 * The following default function works for most applications which
 * are using the same device for all their contexts - even if 
 * the contexts are on different threads.
 */

static _inline _GLextensionProcs *_GET_TLS_PROCTABLE(void)

{
	extern _GLextensionProcs _extensionProcs;

	return (&_extensionProcs);

pogl_gl_Prog_Clam.xs  view on Meta::CPAN

				{
				  PUSHs(sv_2mortal(newSVnv(((GLfloat*)pointer)[i])));
				}
				break;
			case GL_DOUBLE: 
				for (i=0;i<count;i++)
				{
				  PUSHs(sv_2mortal(newSVnv(((GLdouble*)pointer)[i])));
				}
				break;
			default:
				croak("unknown type");
		}
	}

#endif


#ifdef GL_ARB_vertex_shader

#//# glBindAttribLocationARB($programObj, $index, $name);

pogl_gl_top.xs  view on Meta::CPAN

#  define NUM_ARG 7			/* Number of mandatory args to glpcOpenWindow */

Display *dpy;
int dpy_open;
XVisualInfo *vi;
Colormap cmap;
XSetWindowAttributes swa;
Window win;
GLXContext ctx;

static int default_attributes[] = { GLX_DOUBLEBUFFER, GLX_RGBA, None };

#endif	/* defined HAVE_GLpc */ 

static int DBUFFER_HACK = 0;
#define __had_dbuffer_hack() (DBUFFER_HACK)

#endif /* End IN_POGL_GLX_XS */



pogl_gl_top.xs  view on Meta::CPAN

    int	w
    int	h
    int	pw
    long	event_mask
    int	steal
    CODE:
{
    XEvent event;
    Window pwin = (Window)pw;
    unsigned int err;
    int *attributes = default_attributes + 1;
    int *a_buf = NULL;

    RETVAL = newHV(); /* Create hash to return GL Object info */

    if(items > NUM_ARG){
        int i;
        a_buf = (int *) malloc((items-NUM_ARG+2) * sizeof(int));
        a_buf[0] = GLX_DOUBLEBUFFER; /* Preallocate */
        attributes = a_buf + 1;
        for (i=NUM_ARG; i<items; i++) {

pogl_gl_top.xs  view on Meta::CPAN

    }
    XMapWindow(dpy, win);
#ifndef HAVE_GLX  /* For OS/2 GLX emulation stuff -chm 2009.09.14 */
    /* On OS/2: cannot create a context before mapping something... */
    /* create a GLX context */
    ctx = glXCreateContext(dpy, vi, 0, GL_TRUE);
    if (!ctx)
        croak("No context!\n");

    LastEventMask = event_mask;
#else	/* HAVE_GLX, this is the default branch */
    if ( (event_mask & StructureNotifyMask) && !steal ) {
        XIfEvent(dpy, &event, WaitForNotify, (char*)win);
    }
#endif	/* not defined HAVE_GLX */

    /* connect the context to the window */
    if (!glXMakeCurrent(dpy, win, ctx))
        croak("Non current");

    if (debug)

pogl_gl_top.xs  view on Meta::CPAN


#// glpResizeWindow($width, $height[, $winID[, $display]])
void
glpResizeWindow(width, height, w=win, d=dpy)
    void* d
    GLXDrawable w
    unsigned int width
    unsigned int height

# If glpOpenWindow was used then glXSwapBuffers should be called
# without parameters (i.e. use the default parameters)

#// glXSwapBuffers([$winID[, $display]])
void
glXSwapBuffers(w=win,d=dpy)
	void *	d
	GLXDrawable	w
	CODE:
	{
	    glXSwapBuffers(d,w);
	}

pogl_gl_top.xs  view on Meta::CPAN

				PUSHs(sv_2mortal(newSViv(event.xbutton.state)));
				break;
			case MotionNotify:
				EXTEND(sp,4);
				PUSHs(sv_2mortal(newSViv(event.type)));
				PUSHs(sv_2mortal(newSViv(event.xmotion.state)));
				PUSHs(sv_2mortal(newSViv(event.xmotion.x)));
				PUSHs(sv_2mortal(newSViv(event.xmotion.y)));
				break;
			case Expose:
			default:
				EXTEND(sp,1);
				PUSHs(sv_2mortal(newSViv(event.type)));
				break;
		}
	}

#// glpXQueryPointer([$winID[, $display]]);
void
glpXQueryPointer(w=win,d=dpy)
	void *	d

pogl_glu.xs  view on Meta::CPAN

			SvREFCNT_dec(tess->polygon_data); \
			tess->polygon_data = 0;           \
		}



#ifdef GLU_VERSION_1_2


/* Begin a named callback handler */
#define begin_tess_marshaller(name, type, params, croak_msg, default_handler) \
void CALLBACK _s_marshal_glu_t_callback_ ## name params			\
{                                                                       \
    dSP;                                                                \
    int i; int j = 3;                                                   \
    PGLUtess * t = (PGLUtess*)gl_polygon_data;                          \
    SV * handler = t-> type ## _callback;                               \
    if (!handler) croak(croak_msg);                                     \
    if (! SvROK(handler)) { /* default */                               \
      default_handler;                                                  \
      return;                                                           \
    }                                                                   \
    PUSHMARK(sp);

/* End a gluTess callback handler */
#define end_tess_marshaller()                                           \
	PUTBACK;                                                        \
	perl_call_sv(handler, G_DISCARD);                               \
}

pogl_glu.xs  view on Meta::CPAN

            for (i = 0; i < 4; i++) {
                PGLUtess* ot = (PGLUtess*)vertex_data[i];
                vd[i] = (GLdouble*)ot->vertex_data;
            }
	} else {
            *out_data = vertex;
            for (i = 0; i < 4; i++)
               vd[i] = (GLdouble*)vertex_data[i];
        }

        if (! SvROK(handler)) { /* default */
          vertex[0] = coords[0];
          vertex[1] = coords[1];
          vertex[2] = coords[2];
          if (t->do_colors) {
            int J = j + 4;
            for ( ; j < J; j++) {
              vertex[j] = 0;
              for (i = 0; i < 4; i++)
                if (weight[i]) vertex[j] += weight[i] * vd[i][j];
            }

pogl_rpn.xs  view on Meta::CPAN

          {
            //printf("RPN_DMP\n");
            rpn_dump(stack, i, j, ctx->store[j]);
            break;
          }
          case RPN_NOP:
          {
            //printf("RPN_NOP\n");
            break;
          }
          default:
          {
            croak("Unknown RPN op: %d\n",ops->op);
          }
        }

        ops = ops->next;
      }
      if (!flow) { /* RPNF_CONTINUE */
        ((GLfloat *)ctx->oga_list[0]->data)[r+j] = rpn_pop(stack);
      }

pogl_rpn.xs  view on Meta::CPAN

				(*(GLubyte*)offset) = (GLubyte)(v >> 24)& 0xff;
				offset++;
				(*(GLubyte*)offset) = (GLubyte)(v >> 16)& 0xff;
				offset++;
				(*(GLubyte*)offset) = (GLubyte)(v >> 8) & 0xff;
				offset++;
				(*(GLubyte*)offset) = (GLubyte)(v >> 0) & 0xff;
				offset++;
				break;
			}
			default:
				croak("unknown type");
			}
		}
	}

#//# $oga->assign_data($pos,(PACKED)data);
#//- Set OGA values by string, starting from offset
void
assign_data(oga, pos, data)
	OpenGL::Array	oga

pogl_rpn.xs  view on Meta::CPAN

				PUSHs(sv_2mortal(newSVnv( (*(GLfloat*)offset) )));
				offset += sizeof(GLfloat);
				break;
			case GL_DOUBLE: 
				PUSHs(sv_2mortal(newSVnv( (*(GLdouble*)offset) )));
				offset += sizeof(GLdouble);
				break;
			case GL_2_BYTES:
			case GL_3_BYTES:
			case GL_4_BYTES:
			default:
				croak("unknown type");
			}
		}
	}

#//# $data = $oga->retrieve_data($pos,$len);
#//- Get OGA data as packed string, by offset and length
SV *
retrieve_data(oga, ...)
	OpenGL::Array	oga

ppport.h  view on Meta::CPAN


=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
is to use C<Text::Diff>, when installed, and output unified
context diffs.

=head2 --compat-version=I<version>

Tell F<newppp.h> to check for compatibility with the given
Perl version. The default is to check for compatibility with Perl
version 5.003. You can use this option to reduce the output
of F<newppp.h> if you intend to be backward compatible only
down to a certain Perl version.

=head2 --cplusplus

Usually, F<newppp.h> will detect C++ style comments and
replace them with C style comments for portability reasons.
Using this option instructs F<newppp.h> to leave C++
comments untouched.

ppport.h  view on Meta::CPAN

Don't output any hints. Hints often contain useful portability
notes. Warnings will still be displayed.

=head2 --nochanges

Don't suggest any changes. Only give diagnostic output and hints
unless these are also deactivated.

=head2 --nofilter

Don't filter the list of input files. By default, files not looking
like source code (i.e. not *.xs, *.c, *.cc, *.cpp or *.h) are skipped.

=head2 --strip

Strip all script and documentation functionality from F<newppp.h>.
This reduces the size of F<newppp.h> dramatically and may be useful
if you want to include F<newppp.h> in smaller modules without
increasing their distribution size too much.

The stripped F<newppp.h> will have a C<--unstrip> option that allows

ppport.h  view on Meta::CPAN

    vnewSVpvf()               NEED_vnewSVpvf               NEED_vnewSVpvf_GLOBAL
    warner()                  NEED_warner                  NEED_warner_GLOBAL

To avoid namespace conflicts, you can change the namespace of the
explicitly exported functions / variables using the C<DPPP_NAMESPACE>
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

ppport.h  view on Meta::CPAN

		case '\v' : octbuf[1] = 'v'; break;
		case '\t' : octbuf[1] = 't'; break;
		case '\r' : octbuf[1] = 'r'; break;
		case '\n' : octbuf[1] = 'n'; break;
		case '\f' : octbuf[1] = 'f'; break;
                case '"'  : if (dq == '"')
				octbuf[1] = '"';
			    else
				chsize = 1;
			    break;
		default:    chsize = my_snprintf(octbuf, sizeof octbuf,
				pv < end && isDIGIT((U8)*(pv+readsize))
				? "%c%03o" : "%c%o", esc, c);
                }
            } else {
                chsize = 1;
            }
	}
	if (max && wrote + chsize > max) {
	    break;
        } else if (chsize > 1) {

utils/Makefile.cygwin  view on Meta::CPAN

#!make
# This Makefile was developed with GNU make on cygwin.

CC=gcc
LINK=g++

# For FreeGLUT over WGL
CCFLAGS=-DWIN32 -DHAVE_FREEGLUT -I/usr/include/opengl
LDFLAGS=-L../FreeGLUT -lopengl32 -lglu32 -lfreeglut

# For FreeGLUT over GLX (set default for now)
#### CCFLAGS=-DHAVE_FREEGLUT
#### LDFLAGS=-lGL -lglut

all: glversion.txt

clean:
	rm -f glversion.txt
	rm -f glversion.exe
	rm -f glversion.o

utils/makefile.mak  view on Meta::CPAN


clean:
	if exist glversion.txt del glversion.txt
	if exist glversion.exe del glversion.exe
	if exist glversion.obj del glversion.obj

glversion.txt: glversion.exe
	glversion > glversion.txt

glversion.exe: glversion.obj
	$(LINK) $(LDFLAGS) /defaultlib:$(GLUT_LIB).lib /out:"glversion.exe" glversion.obj

glversion.obj: glversion.c makefile.mak
	$(CC) $(CCFLAGS) /D $(GLUT_DEF) glversion.c



( run in 1.581 second using v1.01-cache-2.11-cpan-0a6323c29d9 )