1
Window / Windows Header Breaks Program
« on: December 04, 2010, 12:21:08 am »
I am following the first tutorial on how to display a window, however when I run the program no window appeared.
Using breakpoints I found that not a single line of code in my main function was run, so I think it is to do with the header file not working.
If somebody could help then I would be grateful.
In case it is something wrong with my code:
Using breakpoints I found that not a single line of code in my main function was run, so I think it is to do with the header file not working.
If somebody could help then I would be grateful.
In case it is something wrong with my code:
Code: [Select]
#include <SFML/Window.hpp>
int main()
{
// The Program Doesn't execute this line or any afterwards.
sf::Window window(sf::VideoMode(800, 600, 32), "Test");
bool running = true;
while(running)
{
sf::Event e;
while(window.GetEvent(e))
{
if(e.Type == sf::Event::Closed)
running = false;
if(e.Type == sf::Event::KeyPressed && e.Key.Code == sf::Key::Escape)
running = false;
}
window.Display();
}
return EXIT_SUCCESS;
}