Skip to content

Instantly share code, notes, and snippets.

@eXpl0it3r
Last active January 28, 2017 16:57
Show Gist options
  • Save eXpl0it3r/2790b94724fb7d25cb5574c75753a8d4 to your computer and use it in GitHub Desktop.
Save eXpl0it3r/2790b94724fb7d25cb5574c75753a8d4 to your computer and use it in GitHub Desktop.
Simple SFML Example - wglMakeCurrent
#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