#!/usr/bin/perl -w use warnings ; use strict ; use lib ('blib') ; use Tk ; # OpenGL: need r:all for glGetIntegerv_p, need :old for glpOpen Window use OpenGL qw(:all :old) ; my $arg = shift ; my $MW = new MainWindow ; # craps out if $border = 0 my $border = 1 ; my ( $w, $h ) = ( 100, 100 ) ; my $glwin ; my @attributes = [ GLX_RGBA, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 1 ] ; my $id = $MW->WindowId ; my $depth = glGetIntegerv_p( GL_DEPTH_BITS ) ; print "Depth Before = $depth\n" ; $glwin = glpOpenWindow ( x => $border, y => $border, width => $w, height => $h, parent => $$id ) if $arg eq 'A' ; $glwin = glpOpenWindow ( x => $border, y => $border, width => $w, height => $h, parent => $$id, attributes => \@attributes ) if $arg eq 'B' ; $glwin = glpcOpenWindow ( $border, $border, $w, $h, $$id, 0, \@attributes ) if $arg eq 'C' ; $depth = glGetIntegerv_p( GL_DEPTH_BITS ) ; print "Depth After = $depth\n" ;