----- Original Message ----- 
From: "Chris Marshall" <[email protected]>

> win32 users, please test and report.

Nearly nice.

###################################
C:\temp\temp\PDL>perl -Mblib t/opengl.t
1..4
# Running under perl version 5.010001 for MSWin32
# Current time local: Thu Oct  1 09:19:39 2009
# Current time GMT:   Wed Sep 30 23:19:39 2009
# Using Test.pm version 1.25_02
ok 1
ok 2
Creating GLUT OO window
ok 3
Creating GLUT OO window
illegal glutInit() reinitialization attempt at
C:\temp\temp\PDL\blib\lib/PDL/Graphics/OpenGL/Perl/OpenGL.pm line 152.
###################################

When we exit the foreach loop (in t/opengl.t) for the first time, the window
that was created should go out of scope and be cleaned up. But that doesn't
happen - the window continues to exist. Furthermore, in the second iteration
of the foreach loop, "my $win=new PDL::Graphics::OpenGL::OO($opt);"
apparently calls glutInit() again.

In my playing around with OpenGL, it seems that glutInit() can be called
only once. If you want to open a second window you just call
glutCreateWindow() again. The following creates one window, then a 2nd
window one second later:

#####################
use warnings;
use OpenGL qw(:all);

     glutInit();

for(1 .. 2) {
     glutInitWindowSize(150 * $_, 200 * $_);
     glutCreateWindow("Test $_");
     sleep 1;
}
#####################

I haven't yet worked out how to destroy an exisiting window. (Do you know
how ?) The function that should do it is glutDestroyWindow(), but I haven't
worked out how to provide that function with the appropriate argument - in
either freeglut or OpenGL.

In feeglut you'd expect the following to work:

int windowID;
glutInit(&argc, argv);
glutInitWindowSize(200, 300);
windowID = glutCreateWindow("TEST");
glutDestroyWindow(windowID);

but the window persists ... apparently the return value of
glutCreateWindow() is *not* the appropriate argument to hand over to
glutDestroyWindow().

Similarly in OpenGL, if I do:

$handle = glutCreateWindow("TEST");
glutDestroyWindow($handle);

the window stays open.

Cheers,
Rob


_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl

Reply via email to