Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - thejahooli

Pages: [1]
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:

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;
}

Pages: [1]
anything