1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
|
#include "SFML/Graphics.hpp"
int main()
{
sf::RenderWindow ventana2;
ventana2.Create(sf::VideoMode(800,600,32),"Ventana de Prueba");
bool Running = true;
while (Running)
{
sf::Event evento;
while (ventana2.GetEvent(evento))
{
if (evento.Type == sf::Event::Closed)
{Running = false;}
if ((evento.Type == sf::Event::KeyReleased) && (evento.Key.Code == sf::Key::Escape))
{Running = false;}
}
ventana2.Display();
sf::Shape Polygon;
Polygon.AddPoint(200, 200, sf::Color(255, 0, 0), sf::Color(0, 128, 128));
Polygon.AddPoint(230, 230, sf::Color(255, 85, 85), sf::Color(0, 128, 128));
Polygon.AddPoint(230, 260, sf::Color(255, 170, 170), sf::Color(0, 128, 128));
Polygon.AddPoint(200, 290, sf::Color(255, 255, 255), sf::Color(0, 128, 128));
Polygon.AddPoint(170, 260, sf::Color(255, 170, 170), sf::Color(0, 128, 128));
Polygon.AddPoint(170, 230, sf::Color(255, 85, 85), sf::Color(0, 128, 128));
ventana2.Draw(Polygon);
/* This is the old shape. It gets drawn as well
ventana2.Display();
sf::Shape Polygon;
Polygon.AddPoint(100, 100, sf::Color(255, 0, 0), sf::Color(0, 128, 128));
Polygon.AddPoint(130, 130, sf::Color(255, 85, 85), sf::Color(0, 128, 128));
Polygon.AddPoint(130, 160, sf::Color(255, 170, 170), sf::Color(0, 128, 128));
Polygon.AddPoint(100, 190, sf::Color(255, 255, 255), sf::Color(0, 128, 128));
Polygon.AddPoint(70, 160, sf::Color(255, 170, 170), sf::Color(0, 128, 128));
Polygon.AddPoint(70, 130, sf::Color(255, 85, 85), sf::Color(0, 128, 128));
ventana2.Draw(Polygon);
*** end of comment */
}
return EXIT_SUCCESS;
}
|