basiliscos has asked for the wisdom of the Perl Monks concerning the following question:
Hello dear monks!
I got strange error, when I exit from by app:
pure virtual method called terminate called without an active exception
I was able to bisect the problem into the following minimal example:
use 5.0.12; use SDL; use SDLx::App; use SDL::Events; use SDL::Event; use OpenGL qw(:all); my ($SDLAPP, $WIDTH, $HEIGHT, $SDLEVENT); $| = 1; $WIDTH = 700; $HEIGHT = 500; $SDLAPP = SDLx::App->new( title => "OpenGL App", width => $WIDTH, height => $HEIGHT, gl => 1); $SDLEVENT = SDL::Event->new; glEnable(GL_DEPTH_TEST); glMatrixMode(GL_PROJECTION); glLoadIdentity; gluPerspective(60, $WIDTH / $HEIGHT, 1, 1000); glTranslatef(0, 0, -20); sub handlepolls { SDL::Events::pump_events(); while (SDL::Events::poll_event($SDLEVENT)) { my $type = $SDLEVENT->type(); if ($type == SDL_QUIT) { $cv_finish->send(1); } } }; my $refresh_world = sub { &handlepolls; glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glRasterPos2i(0, 0); # ~~~~~~~~~~~~~~~~~~~ - problematic call $SDLAPP->sync; }; $refresh_world->();
The problem is caused by glRasterPos2i, when it is commented no problem occurs (in my real-world program too).
So, my question is: where is the bug? How to deal with it? How to track it further?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: pure virtual method called? (SDL/OpenGL perl app)
by neilwatson (Priest) on Jun 20, 2014 at 13:16 UTC |