1
Window / Re: Help required with windows and classes
« on: March 29, 2017, 05:01:59 pm »Hi
Please note that this is the SFML forum, we try to avoid generic C++ problems as much as possible. There are many better places where you can ask this kind of questions (stackoverflow, ...)
The solution is simple: if your function needs to access a variable that it doesn't know, pass it as an argument.void draw(sf::RenderTarget& target) // sf::RenderTarget is the base class of sf::RenderWindow
{
target.draw(...);
}
int main()
{
sf::RenderWindow window;
draw(window);
}
Thanks a lot! This worked perfectly!
Oh, and don't worry, next time I'll find something slightly more sfml related to ask about.
