Last active
January 28, 2017 16:57
-
-
Save eXpl0it3r/2790b94724fb7d25cb5574c75753a8d4 to your computer and use it in GitHub Desktop.
Simple SFML Example - wglMakeCurrent
This file contains hidden or 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
#include <SFML/Audio.hpp> | |
#include <SFML/Graphics.hpp> | |
int main() | |
{ | |
// Errors happening in the following line (failed to deactivate, created version 0.0, failed to activate, failed to activate): | |
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window", 7, sf::ContextSettings(24, 8, 0, 2, 0)); | |
sf::Texture texture; | |
// Errors also happening in the following line: | |
if (!texture.loadFromFile("walls.png")) | |
return EXIT_FAILURE; | |
sf::Sprite sprite(texture); | |
while (window.isOpen()) | |
{ | |
sf::Event event; | |
while (window.pollEvent(event)) | |
{ | |
if (event.type == sf::Event::Closed) | |
window.close(); | |
} | |
window.clear(); | |
window.draw(sprite); | |
window.display(); | |
} | |
return EXIT_SUCCESS; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment