SFML community forums
Help => Graphics => Topic started by: Groogy on February 27, 2009, 09:54:59 pm
-
Yo! While trying some stuff on Vista I get this error when exiting the application (When the sf::Image object is being destroyed)
Runtime Error!
Program: {Path to application}
R6025
- pure virtual function call
Return value of this is 255 (0xFF).
I've tried to isolate a special case though I'm not sure but I think it is when I don't use the image and just create it. But then if I have two images, each with an own sprite and then draw them, the exact same error is back.
** UPDATE **
This only happens when I load the image data from a file. Gonna try what happens if I change file and fileformat.
** UPDATE **
I tried changing file and format, no change in behaviour.
** UPDATE **
Only happens after I have loaded the image from a file.
-
Minimal example code to reproduce your issue would be helpful.
-
sf::Image img;
img.LoadFromFile("image.png");
I know it's weird, it worked before, but suddenly yesterday it stopped working???
Though my vista has been acting weird lately... gonna try out the same code in Linux soon.
-
I had that problem once, it's usually when an Image is invalid or something. (for me it happened when I moved from loading an Image directly and then through a reference returned by a resource manager).
Are you sure the LoadFromFile does not return false? (IE the image exists)?
Maybe its a directory issue? (what IDE are you using?)
-
The image is correct and it finds it and it can set it to a sprite and draws it correctly. Everything works perfectly until it comes to the sf::Image::~Image() or whatever, when it destroys the image.
I'm using Codeblocks, I'm in Linux right now and about to try out the exact same source code and see what happens.
** UPDATE **
I tried it on linux and no error whatsoever appeared.
Everything worked perfectly. So it's a Windows/Vista specific error. I have tried to reinstall it with no success.
-
It seems as if the destructor of your image is being called after the OpenGL context has been deleted.
Make sure your sf::Image instance does not exceed the lifetime of your sf::RenderWindow instance.
-
It seems as if the destructor of your image is being called after the OpenGL context has been deleted.
Make sure your sf::Image instance does not exceed the lifetime of your sf::RenderWindow instance.
This shouldn't be a problem with SFML, the lifetime of resources is not tied to the window, even if they depend on an OpenGL context.
-
It seems as if the destructor of your image is being called after the OpenGL context has been deleted.
Make sure your sf::Image instance does not exceed the lifetime of your sf::RenderWindow instance.
This shouldn't be a problem with SFML, the lifetime of resources is not tied to the window, even if they depend on an OpenGL context.
Yeah seems like that, since it works in Linux.
Could be that it's just my Vista being strange. Hmppf... Unix is da zhizzle