Subject: | error-less crash when 0.57 is used with coro |
A word ahead: Coro is a module that allows for parallelization without
using threads, something which is very valuable for me, since threading
in Perl is difficult to say the least, in regards to sharing data
between threads.
Under the latest ActivePerl 5.10.0.1004, i installed Coro 4.749, then
Microsoft Visual C++ 2008 Express Edition and after copying the
includes from http://graphcomp.com/opengl/GL.zip into the VC includes
directory, i could use the ActivePerl CPAN to install OpenGL 0.57. The
test included in the installer ran fine.
However when trying to run the code in the attached file, it prints out
"foo1foo2", draws one frame, then immediately quits. No errors appear
anywhere.
Removing the OpenGL package via PPM, then installing either 0.56 from
bribes or 0.56.1 from wxperl allows the attached file to execute
flawlessly again.
I'll happily help out in any manner i can, if you need information or
assistance.
Subject: | test_case.pl |
#!/usr/bin/perl -w
use strict;
use OpenGL qw/ :all /;
use Coro;
$|++;
sub cbRenderScene {
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(0,0,-5);
glBegin(GL_TRIANGLES);
glNormal3f( 0, 0, 1);
glColor4f( 1, 0, 0, 1); glVertex3f(-1, -1, 1);
glColor4f( 0, 1, 0, 1); glVertex3f( 1, -1, 1);
glColor4f( 0, 0, 1, 1); glVertex3f( 1, 1, 1);
glEnd();
glutSwapBuffers();
# and crash
cede();
}
glutInit();
glutInitDisplayMode( GLUT_DOUBLE );
glutCreateWindow( 'test' );
glutDisplayFunc(\&cbRenderScene);
glutIdleFunc(\&cbRenderScene);
glMatrixMode(GL_PROJECTION);
gluPerspective(45,1,1,100);
print "foo1";
# set up coro to do something after every frame
async {
while (1) {
print "foo2";
cede();
}
};
glutMainLoop();
__END__