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 - st3ph4n

Pages: [1]
1
Window / create a window from another method and returning it?
« on: February 26, 2022, 07:18:25 am »
i basically have a struct in other file that i have included, and inside its a method to

struct sfml {
        sf::RenderWindow& init_window() {
                globals.window.settings.antialiasingLevel = 8;
                sf::RenderWindow window = sf::RenderWindow(sf::VideoMode(sf::VideoMode::getDesktopMode().width, sf::VideoMode::getDesktopMode().height), globals.window.title, sf::Style::None, globals.window.settings);
                return window;
        }
} sfml;

but this doesnt work. the following error pops up in this file:
error C2280: 'sf::RenderWindow::RenderWindow(const sf::RenderWindow &)': attempting to reference a deleted function

in the main.cpp file:

sf::RenderWindow& window = sfml.init_window();

Pages: [1]
anything