Created
July 14, 2012 20:34
-
-
Save ngscheurich/3113245 to your computer and use it in GitHub Desktop.
Display a 2D graphic using SFML
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// @library SFML 2.0 RC | |
// Load the texture for the sprite | |
sf::Texture texture; | |
if (!texture.loadFromFile("file.png")) { | |
return EXIT_FAILURE; | |
} | |
// Make drawable sprite using texture | |
sf::Sprite sprite(texture); | |
while (window.isOpen()) { | |
window.clear(); | |
// Draw sprite | |
window.draw(sprite); | |
window.display(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment