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.


Messages - Alis

Pages: [1]
1
Graphics / Crash after closing rendering window
« on: March 09, 2012, 04:03:00 pm »
Hi :)

Im trying to create a simple 2d game with fullscreen mode. Everything works fine until i close application (under some conditions). System crashes only when i switch my rendering window to fullscreen mode with current resolution settings, using GetDesktopMode. If i work in any windowed mode or in fullscreen mode with diffrent resolution, game quits normally.

Constructor for CProgram, which inherits from sf::RenderingWindow
Code: [Select]
CProgram::CProgram()
{
    Display = sf::VideoMode::GetDesktopMode();
    width = Display.Width;
    height = Display.Height;
    Create(Display, "title", sf::Style::Fullscreen);
    Quit = 0;
    Input = &GetInput();
    //MainLayer = new CMainLayer(width, height, this);
   //ActiveLayer = MainLayer;
}


Here is my main loop:
Code: [Select]
void CProgram::Run()
{
    sf::Event Event;
    while(!Quit)
    {
        while(GetEvent(Event)){}
        if(Input->IsKeyDown(sf::Key::Escape))
            Quit = 1;
        Clear(sf::Color(0, 0, 0));
       // ActiveLayer->DoLogic();
        //ActiveLayer->Draw();
        Display();
    }
    Close();
}


One thing more is, that Application closes fine, if i change GetDesktopMode to GetMode(x), if GetMode(x) != GetDesktopMode.

Im using sfml 1.6 now.

Can anyone say what's the problem here?

Pages: [1]