1
Window / Window Not Opening
« on: February 03, 2012, 06:27:13 am »
That's fine. xD
I'll find another way for the time being.
Thanks for the help. ;3
I'll find another way for the time being.
Thanks for the help. ;3
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
int main()
{
// Create the main rendering window
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Window");
sf::Image SceneImage;
if (!SceneImage.LoadFromFile("Image.png"))
{
return EXIT_FAILURE;
}
sf::Sprite Scene(SceneImage);
// Start game loop
while (App.IsOpened())
{
// Process events
sf::Event Event;
while (App.GetEvent(Event))
{
// Close window : exit
if ((Event.Type == sf::Event::Closed) ||
((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape)))
{
App.Close();
break;
}
}
// Clear the screen (fill it with black color)
App.Clear();
App.Draw(Scene);
// Display window contents on screen
App.Display();
}
return EXIT_SUCCESS;
}