1
Window / Checking when window is ready for drawing
« on: January 08, 2012, 10:22:57 am »Quote from: "Laurent"
Have you tried to add event handling or not?
I tried adding event handling like this but no difference.
Code: [Select]
#include <stdint.h>
#include <iostream>
#include <SFML/Graphics.hpp>
int main() {
sf::RenderWindow window(sf::VideoMode(800, 800), "");
sf::Vertex points[2];
points[0].Position.y = 50;
points[0].Position.x = 50;
points[1].Position.y = 400;
points[1].Position.x = 500;
window.Draw(points, 2, sf::Lines);
window.Display();
sf::Event ev;
while(window.WaitEvent(ev)) {
if (ev.Type == sf::Event::Closed) break;
if (ev.Type == sf::Event::KeyPressed) break;
}
return 0;
}