Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - UltrasonicAfroPower

Pages: [1]
1
Wow, this code is really useless. Well, i guess using new and delete gives me illusion of more control on what program actually does  ???. Anyways, thanks for help, looks like it's time to move on.

2
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?

Pages: [1]
anything