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.


Messages - BnMcG

Pages: [1]
1
Window / Re: Declaring SFML Window as a member in a class
« on: March 06, 2015, 06:42:07 pm »
You have to make sure that the class which contains the sf::Window does not get copied too (e.g. define your own copy constructor for the class (or delete it/make it private))

btw: a better thread name would be "Declaring SFML Window as a member in a class" or something like that.

AlexAUT

Thanks! I'll give this a go and report back. I've also updated the title, too.

2
Window / Declaring SFML Window as a member in a class
« on: March 06, 2015, 11:04:42 am »
Hi there,

I'm trying to declare my SFML window as a "class-wide" variable so that I can use it in all of the class' methods (forgive me if this isn't the correct way of doing things, I'm coming from Java!)

I tried adding it as a private variable in my header like so:

Quote
private:
        sf::Window windowMenu;

However my program then throws various errors about how Window is non-copyable? Is there any way to declare a window such that its scope is class-wide?

Pages: [1]