Hi. I started using SFML (version is 1.6) and found that there is no Release-like function for SFML resources (like in SDL). I know, that resources in SFML are freed as soon as they go out of scope, but i need to be able to load and delete images when and where i want. So i decided to make this class
class texture
{
private:
sf::Image image;
public:
texture(char* destination)
{
image.LoadFromFile(destination);
};
~texture()
{
//do nothing
}
sf::Image* get_pImage()
{
return ℑ
}
};
to be able to locate and free memory using new and delete on texture objects (yeah, i know, this is awful).
The sprite correctly draws on the screen, but when i try to draw it after deleting texture it shows only a white rectangle of image size. So the question is: is image actually deleting when i use delete, or it just screws up connection with sprite?
And the second question: can i use one sprite to display all images on the screen (like when using directx) or it will cause low performance?