So I get this weird error:
||=== Build: Debug in test (compiler: GNU GCC Compiler) ===|
C:\Games\SFML Games\Test\main.cpp||In function 'int main()':|
C:\Games\SFML Games\Test\main.cpp|15|error: use of deleted function 'sf::RenderWindow::RenderWindow(const sf::RenderWindow&)'|
C:\Program Files\SFML-2.3.1\include\SFML\Graphics\RenderWindow.hpp|44|note: 'sf::RenderWindow::RenderWindow(const sf::RenderWindow&)' is implicitly deleted because the default definition would be ill-formed:|
C:\Program Files\SFML-2.3.1\include\SFML\Graphics\RenderWindow.hpp|44|error: use of deleted function 'sf::Window::Window(const sf::Window&)'|
C:\Program Files\SFML-2.3.1\include\SFML\Window\Window.hpp|57|note: 'sf::Window::Window(const sf::Window&)' is implicitly deleted because the default definition would be ill-formed:|
C:\Program Files\SFML-2.3.1\include\SFML\System\NonCopyable.hpp|67|error: 'sf::NonCopyable::NonCopyable(const sf::NonCopyable&)' is private|
C:\Program Files\SFML-2.3.1\include\SFML\Window\Window.hpp|57|error: within this context|
C:\Program Files\SFML-2.3.1\include\SFML\Graphics\RenderWindow.hpp|44|error: use of deleted function 'sf::RenderTarget::RenderTarget(const sf::RenderTarget&)'|
C:\Program Files\SFML-2.3.1\include\SFML\Graphics\RenderTarget.hpp|51|note: 'sf::RenderTarget::RenderTarget(const sf::RenderTarget&)' is implicitly deleted because the default definition would be ill-formed:|
C:\Program Files\SFML-2.3.1\include\SFML\System\NonCopyable.hpp|67|error: 'sf::NonCopyable::NonCopyable(const sf::NonCopyable&)' is private|
C:\Program Files\SFML-2.3.1\include\SFML\Graphics\RenderTarget.hpp|51|error: within this context|
C:\Games\SFML Games\Test\gameloop.hpp|10|error: initializing argument 1 of 'void MAIN_GAME_LOOP(sf::RenderWindow)'|
||=== Build failed: 8 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|
This is my code:
main.cpp:
#include <SFML/Graphics.hpp>
#include "states.hpp"
#include "menus.hpp"
#include "gameloop.hpp"
#define WINDOW_WIDTH 640
#define WINDOW_HEIGHT 480
int main()
{
sf::RenderWindow window(sf::VideoMode(WINDOW_WIDTH, WINDOW_HEIGHT), "Game");
INIT_MENUS();
MAIN_GAME_LOOP(window);
return EXIT_SUCCESS;
}
gameloop.cpp(where the MAIN_GAME_LOOP and INIT_MENUS functions come from)
#include "gameloop.hpp"
void INIT_MENUS()
{
Game::MenuButton start_button1("Start", 25, 150, 35, 20, Game::State::States::MAIN_MENU);
manager.addButton(start_button1);
}
void MAIN_GAME_LOOP(sf::RenderWindow w)
{
while (w.isOpen())
{
sf::Event e;
while (w.pollEvent(e))
{
if (e.type == sf::Event::Closed)
{
w.close();
}
}
manager.Update(w);
}
}
I have no idea why I get this error, help please?