Hello there! I just wondering why I have to get the reference of a class when including certain SFML files within that class and not being able to directly copy it. For an example I have some code here:
#ifndef GAME_H
#define GAME_H
#include "Window.h"
class Game
{
public:
Game();
~Game();
void handleEvents();
void update();
void render();
Window* getWindow() { return &m_window; }
private:
bool m_isRunning;
Window m_window;
};
#endif // !GAME_H
#ifndef WINDOW_H
#define WINDOW_H
#include <SFML\Graphics.hpp>
#include <string>
class Window
{
public:
Window();
~Window();
void activateFullScreen();
void deactivateFullScreen();
void setup(const std::string& title, sf::Vector2f& windowSize);
void destroy() { m_window.close(); }
private:
sf::RenderWindow m_window;
sf::Vector2f m_windowSize;
std::string m_title;
bool m_fullScreen;
void create(); //Create window
};
#endif // !WINDOW_H
My line of thinking was because the m_window is being stored in the Game class, in theory I should of just been able to get the Window without the need of referencing but it but when attempting that it says "Attempting to reference a deleted function."
Would love for some to explain why. Thank you!