SFML community forums
Help => General => Topic started by: aSpookyMan on June 28, 2020, 05:51:42 am
-
class UIManager
{
public:
RenderWindow window;
Event event;
UIManager( const RenderWindow& win, const Event& e) : window(win), event(e)
{
}
};
The code above is giving me an error "sf::RenderWindow::RenderWindow(const sf::RenderWindow &)"
when I set window = win. Is this happening because I have not yet defined window? And if so how can I fix this? I had thought about making a global RenderWindow variable, but from what I've read that's not optimal.
I need help!
-
I just realized I didn't type out the error lol. Sorry about that
function "sf::RenderWindow(const sf::RenderWindow &)"(declared implicitly) cannot be referenced -- it is a deleted function
-
I got the error fixed with the help of a dude on discord. I just had to remove const and set the RenderWindow variable as a reference, pretty simple mistake.