the tar.lzma contains everything you need, incl. headers.
main.cpp:
#include "Game.hpp"
#include "IntroState.hpp"
#include <iostream>
using namespace std;
int main(int argc, char **argv)
{
IntroState iSt;
Game game(800, 600, "Test");
game.changeState(&iSt);
while(game.isOpen()){
game.handleEvents();
game.draw();
}
}
Game.cpp:
#include "Game.hpp"
#include <SFML/Graphics.hpp>
#include <string>
#include <iostream>
using namespace std;
Game::Game(int x, int y, std::string label)
{
window = new sf::RenderWindow(sf::VideoMode(x, y), label);
}
Game::~Game()
{
delete window;
}
void Game::changeState(State *state)
{
currentState = state;
}
void Game::handleEvents()
{
currentState->handleEvents(window);
}
void Game::draw()
{
window->clear();
currentState->draw(window);
window->display();
cout << "displayed" << endl;
}
bool Game::isOpen()
{
return window->isOpen();
}
IntroState.cpp:
#include "IntroState.hpp"
#include <SFML/Graphics.hpp>
#include <iostream>
using namespace sf;
using namespace std;
IntroState::IntroState()
{
splashTex = new Texture();
splashTex->loadFromFile("splash.png");
splash = new Sprite(*splashTex);
}
IntroState::~IntroState()
{
delete splash;
delete splashTex;
}
void IntroState::handleEvents(sf::RenderWindow *window)
{
Event e;
while(window->pollEvent(e))
{
if(e.type == Event::Closed)
{
window->close();
cout << "closed" << endl;
}
}
}
void IntroState::draw(sf::RenderWindow *window)
{
cout << "will now draw..." << endl;
window->draw(*splash);
cout << "drawn" << endl;
}[code]
[attachment deleted by admin]