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.


Topics - Enyss

Pages: [1]
1
Hello,

 I have a strange error when I try to return a RenderWindow reference from a singleton class:

 Error C2280 'sf::RenderWindow::RenderWindow(const sf::RenderWindow &)': attempting to reference a deleted function.

Minimal code :

#include <SFML\Graphics.hpp>

class RenderManager
{
public:
        RenderManager();
        static RenderManager & rm();

        sf::RenderWindow & getWindow();
private:
        sf::RenderWindow window;
};

RenderManager::RenderManager()
{
        window.create(sf::VideoMode(800, 600), "Realms of Dream");
        tileSet.loadFromFile("gfx/tileset.png");
}

RenderManager & RenderManager::rm()
{
        static RenderManager rm;
        return rm;
}

sf::RenderWindow & RenderManager::getWindow()
{
        return window;
}

Thanks.

Pages: [1]