Greetings, people!
I am developing a video game using SFML and nearly every drawable entity has its own class. There is also a somewhat engine class, containing my RenderWindow.
The problem is that in order to call window's draw() method in any drawable entity's entity_draw() method, I have to either pass a window reference to the entity_draw() method, or have a reference as a member of entity's class and initialise it in a constructor, obvioulsy passing RenderWindow reference to the constructor.
Both variants are very annoying and I am wondering whether there is a good way to "globalize" the RenderWindow somehow.
The best solution I found was creating another class, containing only the window and a videomode(MainWindow class) so they could be accessible from any project file. These two were private static members and constructor and destructor were also private, so I got somewhat of a static class. This however produced an
unresolved external symbol error and trying to initialise RenderWindow and VideoMode in different ways didn't produce any result.
Help?
Thank you.