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 - zethos92

Pages: [1]
1
Window / problem with closing a window
« on: September 05, 2009, 03:16:11 pm »
Hi Guys,

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?

Pages: [1]
anything