1
General discussions / Platform Tutorial or Source code?
« on: February 05, 2011, 09:38:24 am »
Anyone?
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.
#include <SFML/Graphics.hpp>
#include <SFML/Audio.hpp>
int main()
{
//Start the SFML display window
sf::RenderWindow Splash(sf::VideoMode(1024, 768, 32), "Splash Screen Test 0.1");
//Load the images for each individual screen (only one for now)
sf::Image SplashOpenAL;
if(!SplashOpenAL.LoadFromFile("Data/OpenAL.png"))
return EXIT_FAILURE;
sf::Sprite OpenALSprite(SplashOpenAL);
while (Splash.IsOpened())
{
sf::Event Event;
while (Splash.GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
Splash.Close();
if (Event.Type == sf::Event::KeyPressed)
{
// Escape key : exit
if (Event.Key.Code == sf::Key::Escape)
Splash.Close();
}
Splash.Clear();
Splash.Draw(OpenALSprite);
Splash.Display();
}
}
return EXIT_SUCCESS;
}