1
Window / problem with closing a window
« on: September 05, 2009, 03:16:11 pm »
Hi Guys,
I´ve an problem:
First the code:
everything runs fine, but if i Close the window i´ll get this message:
Run-Time Check Failure #2 - Stack around the variable 'App' was corrupted.
what could i do to avoid this?
I´ve an problem:
First the code:
Code: [Select]
#include <SFML/Window.hpp>
#include <gl/glu.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){
sf::Window App(sf::VideoMode(800, 600, 32), " SFML Events");
while (App.IsOpened()){
sf::Event Event;
while (App.GetEvent(Event))
{
if (Event.Type == sf::Event::Closed)
App.Close();
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
App.Close();
/*if (Event.Type == sf::Event::Resized)
ReSizeGLScene(Event.Size.Width, Event.Size.Height);*/
}
//DrawGLScene();
App.Display();
}
return EXIT_SUCCESS;
}
everything runs fine, but if i Close the window i´ll get this message:
Run-Time Check Failure #2 - Stack around the variable 'App' was corrupted.
what could i do to avoid this?