Acme-MITHALDU-BleedingOpenGL
view release on metacpan or search on metacpan
BleedingOpenGL.pm view on Meta::CPAN
KeymapNotify
Expose
GraphicsExpose
NoExpose
VisibilityNotify
CreateNotify
DestroyNotify
UnmapNotify
MapNotify
MapRequest
ReparentNotify
ConfigureNotify
ConfigureRequest
GravityNotify
ResizeRequest
CirculateNotify
CirculateRequest
PropertyNotify
SelectionClear
SelectionRequest
SelectionNotify
BleedingOpenGL.pm view on Meta::CPAN
KeymapNotify
Expose
GraphicsExpose
NoExpose
VisibilityNotify
CreateNotify
DestroyNotify
UnmapNotify
MapNotify
MapRequest
ReparentNotify
ConfigureNotify
ConfigureRequest
GravityNotify
ResizeRequest
CirculateNotify
CirculateRequest
PropertyNotify
SelectionClear
SelectionRequest
SelectionNotify
BleedingOpenGL.pm view on Meta::CPAN
*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'},
$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(@_) }
glx_const.h view on Meta::CPAN
i(KeymapNotify)
i(Expose)
i(GraphicsExpose)
i(NoExpose)
i(VisibilityNotify)
i(CreateNotify)
i(DestroyNotify)
i(UnmapNotify)
i(MapNotify)
i(MapRequest)
i(ReparentNotify)
i(ConfigureNotify)
i(ConfigureRequest)
i(GravityNotify)
i(ResizeRequest)
i(CirculateNotify)
i(CirculateRequest)
i(PropertyNotify)
i(SelectionClear)
i(SelectionRequest)
i(SelectionNotify)
include/GL/glxext.h view on Meta::CPAN
#ifndef GLX_SGI_video_sync
#define GLX_SGI_video_sync 1
typedef int ( *PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count);
typedef int ( *PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count);
#ifdef GLX_GLXEXT_PROTOTYPES
int glXGetVideoSyncSGI (unsigned int *count);
int glXWaitVideoSyncSGI (int divisor, int remainder, unsigned int *count);
#endif
#endif /* GLX_SGI_video_sync */
#ifndef GLX_SUN_get_transparent_index
#define GLX_SUN_get_transparent_index 1
typedef Status ( *PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
#ifdef GLX_GLXEXT_PROTOTYPES
Status glXGetTransparentIndexSUN (Display *dpy, Window overlay, Window underlay, long *pTransparentIndex);
#endif
#endif /* GLX_SUN_get_transparent_index */
#ifdef __cplusplus
}
#endif
#endif
#define KeymapNotify 11
#define Expose 12
#define GraphicsExpose 13
#define NoExpose 14
#define VisibilityNotify 15
#define CreateNotify 16
#define DestroyNotify 17
#define UnmapNotify 18
#define MapNotify 19
#define MapRequest 20
#define ReparentNotify 21
#define ConfigureNotify 22
#define ConfigureRequest 23
#define GravityNotify 24
#define ResizeRequest 25
#define CirculateNotify 26
#define CirculateRequest 27
#define PropertyNotify 28
#define SelectionClear 29
#define SelectionRequest 30
#define SelectionNotify 31
Display *display; /* Display the event was read from */
Window window;
int state; /* Visibility state */
} XVisibilityEvent;
typedef struct {
int type;
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 parent; /* parent of the window */
Window window; /* window id of window created */
int x, y; /* window location */
int width, height; /* size of window */
int border_width; /* border width */
Bool override_redirect; /* creation should be overridden */
} XCreateWindowEvent;
typedef struct {
int type;
unsigned long serial; /* # of last request processed by server */
Window event;
Window window;
Bool override_redirect; /* boolean, is override set... */
} XMapEvent;
typedef struct {
int type;
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 parent;
Window window;
} XMapRequestEvent;
typedef struct {
int type;
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 event;
Window window;
Window parent;
int x, y;
Bool override_redirect;
} XReparentEvent;
typedef struct {
int type;
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 event;
Window window;
int x, y;
int width, height;
Display *display; /* Display the event was read from */
Window window;
int width, height;
} XResizeRequestEvent;
typedef struct {
int type;
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 parent;
Window window;
int x, y;
int width, height;
int border_width;
Window above;
int detail; /* Above, Below, TopIf, BottomIf, Opposite */
unsigned long value_mask;
} XConfigureRequestEvent;
typedef struct {
Window event;
Window window;
int place; /* PlaceOnTop, PlaceOnBottom */
} XCirculateEvent;
typedef struct {
int type;
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 parent;
Window window;
int place; /* PlaceOnTop, PlaceOnBottom */
} XCirculateRequestEvent;
typedef struct {
int type;
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;
XFocusChangeEvent xfocus;
XExposeEvent xexpose;
XGraphicsExposeEvent xgraphicsexpose;
XNoExposeEvent xnoexpose;
XVisibilityEvent xvisibility;
XCreateWindowEvent xcreatewindow;
XDestroyWindowEvent xdestroywindow;
XUnmapEvent xunmap;
XMapEvent xmap;
XMapRequestEvent xmaprequest;
XReparentEvent xreparent;
XConfigureEvent xconfigure;
XGravityEvent xgravity;
XResizeRequestEvent xresizerequest;
XConfigureRequestEvent xconfigurerequest;
XCirculateEvent xcirculate;
XCirculateRequestEvent xcirculaterequest;
XPropertyEvent xproperty;
XSelectionClearEvent xselectionclear;
XSelectionRequestEvent xselectionrequest;
XSelectionEvent xselection;
pogl_gl_top.xs view on Meta::CPAN
vi->visual, AllocNone);
/* create a window */
swa.colormap = cmap;
swa.border_pixel = 0;
swa.event_mask = event_mask;
#endif /* defined HAVE_GLX */
if (!pwin) {
pwin = RootWindow(dpy, vi->screen);
if (debug) printf("Using root as parent window 0x%x\n", pwin);
}
if (steal) {
win = nativeWindowId(dpy, pwin); /* What about depth/visual */
} else {
win = XCreateWindow(dpy, pwin,
x, y, w, h,
0, vi->depth, InputOutput, vi->visual,
CWBorderPixel|CWColormap|CWEventMask, &swa);
/* NOTE: PDL code had CWBackPixel above */
}
if ( $t < $hole_size)
{
$tex .= pack "C", 255; # The dot itself is opaque.
}
elsif ($t < $hole_size + 100)
{
$tex .= pack "C", 128; # Give our dot an anti-aliased edge.
}
else
{
$tex .= pack "C", 0; # Outside of the dot, it's transparent.
}
}
}
$Tex_Pixels = OpenGL::Array->new_scalar(GL_UNSIGNED_BYTE,$tex,length($tex));
$Tex_Type = GL_RGBA8;
$Tex_Format = GL_RGBA;
$Tex_Size = GL_UNSIGNED_BYTE;
}
glLoadIdentity();
glOrtho(0,$Window_Width,0,$Window_Height,-1.0,1.0);
# Lit or textured text looks awful.
glDisable(GL_TEXTURE_2D);
glDisable(GL_LIGHTING);
# We don'$t want depth-testing either.
glDisable(GL_DEPTH_TEST);
# But, for fun, let's make the text partially transparent too.
glColor4f(0.6,1.0,0.6,.75);
$buf = sprintf "TIME TO EXIT: %.1fs", $time_to_exit;
my $bufwidth = 6 * length $buf;
glRasterPos2i($Window_Width-4-$bufwidth,2); ourPrintString(GLUT_BITMAP_HELVETICA_12,$buf);
# Render our various display mode settings.
$buf = sprintf "Mode: %s", $TexModesStr[$Curr_TexMode];
glRasterPos2i(2,2); ourPrintString(GLUT_BITMAP_HELVETICA_12,$buf);
( run in 0.253 second using v1.01-cache-2.11-cpan-4d50c553e7e )