So, I'm kind-of new to SFML, and have been using it for a few days. I got the examples working, so I know libraries work. I'm on Debian 6.0 (Sqeeze). I'm working on the event's section of the SFML, and it keeps saying it does not exist (the functions).
This is my header file.
#ifndef _APP_H_
#define _APP_H_
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
class App{
private: // Here is the Game Stuff
sf::Window gameScreen;
public: // Game Starting Methods
App();
int Execute();
// Game Loop Methods
bool Init();
void Event();
void Loop();
void Render();
void Cleanup();
};
#endif
And this is the main problem file:
#include "app.h"
App::App(){
// Set up basic game stuff.
gameScreen.Create(sf::VideoMode(800, 600), "Lazeroids!");
}
int App::Execute(){
if (Init() == false)
return -1;
sf::Event event;
while(gameScreen.isOpen()){
while(gameScreen.pollEvent(event)){
Event();
}
Loop();
Render();
}
Cleanup();
return 0;
}
int main(int argc, char *argv[]){
// Create the actual game object.
// Only 3 lines here.
// Oh, and don't forgot to call the game to run.
App game;
return game.Execute();
}
The problem is in the section of code that has these lines:
while(gameScreen.isOpen()){
while(gameScreen.pollEvent(event)){
Event();
}
The error comes up saying:
app.cpp: In member function ‘int App::Execute()’:
app.cpp:12: error: ‘class sf::Window’ has no member named ‘isOpen’
app.cpp:13: error: ‘class sf::Window’ has no member named ‘pollEvent’
I've tried a few different function capitalization ways, and even included <SFML/Event.hpp> (Which doesn't seem to exist?)
What am I doing wrong.
P.S. How would I have a function that accepts an event? (Like in the arguments)