SFML community forums
Help => Window => Topic started by: danthebeliever on February 07, 2011, 10:11:20 pm
-
Hello,
Is it possible to declare a window variable in a class?
Right now I have
class dumbClass{
sf::Window App;
};
And it gives me errors about NonCopyable. Clearly I am doing something wrong.
edit: I figured out the problem. Doesn't want me to instantiate without it's constructor, so I just made a pointer to the window. (sf::Window * app)
-
You can have a non-pointer sf::Window member. You did something wrong, but it's not shown in these 2 lines of code.
Can you please post the complete example, and the exact error message?
-
Just a thought:
class dumbClass {
sf::Window App:
};
is fine. However,
dumbClass obj;
obj.App = sf::Window(...);
Would not be, as sf::Window can't be copied (using sf::Window::Open could then solve the problem).
-
Thanks Mon, I think that is it.
However, I am fine with pointers! Thanks all, I really appreciate it.