main.cpp
#include "Game.hpp"
#include <SFML/Graphics.hpp>
#include "Game.cpp"
int main()
{
Game pac;
return EXIT_SUCCESS;
}
Game.cpp
#include "Game.hpp"
#include <SFML/Graphics.hpp>
Game::Game()
// Creation of Render Window with Video Mode
{
m_window(sf::VideoMode(640,480));
}
void Game::run()
{
while(m_window.isOpen())
{
///calling event function
sf::Event event;
while(m_window.pollEvent(event))
{
if(event.type == sf::Event::Closed)
{
m_window.close();
}
}
window.clear();
window.display();
}
}
Game.hpp
#ifndef GAME_HPP_INCLUDED
#define GAME_HPP_INCLUDED
#include <SFML/Graphics.hpp>
class Game
{
public:
Game();
void run();
private:
sf::RenderWindow m_window;
};
#endif // GAME_HPP_INCLUDED
///Please help me out