Main.cpp
#include <SFML\Graphics.hpp>
#include <iostream>
using namespace std;
int main()
{
//Creo mi ventana
sf::RenderWindow window(sf::VideoMode(640 , 480), "Version OpenGL en SFML");
window.setFramerateLimit(60);
sf::ContextSettings settings = window.getSettings();
cout << "Version OpenGL: " << settings.majorVersion << "." << settings.minorVersion << endl;
//GameLoop
while (window.isOpen())
{
window.clear();
//Eventos
sf::Event event;
//Se manejan los eventos
while (window.pollEvent(event))
{
//Creo una sentencia switch para controlar muchos eventos
switch (event.type)
{
//Cierra la ventana
case sf :: Event::EventType::Closed:
window.close();
break;
default:
break;
}
}
window.display();
}
return 0;
}
No hay comentarios:
Publicar un comentario