i have been experimenting with SFML and my recent project compiles perfectly fine but it does not stay open.
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");
sf::Event Event;
sf::Input Input;
sf::Input &rInput = Input;
int Start_Menu();
int main()
{
App.Create(sf::VideoMode(800, 600, 32), "SFML Window");
bool Running = true;
while (Running)
{
App.Display();
while (App.IsOpened())
{
Start_Menu();
}
}
return EXIT_SUCCESS;
}
int Start_Menu()
{
const sf::Input& Input = App.GetInput();
unsigned int Start_X = Input.GetMouseX(), Start_Y = Input.GetMouseY();
if (Event.Type == sf::Event::Closed)
{
App.Close();
}
// Escape key pressed
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
{
App.Close();
}
return 0;
}
i put all the sf::(ect) up at the top so i do not have to call it in both functions.
i am running a 64bit vista if that is any help[/code]