SFML community forums

Help => General => Topic started by: flaming_goose on March 06, 2011, 03:13:34 pm

Title: RenderWindow Runtime Error
Post by: flaming_goose on March 06, 2011, 03:13:34 pm
I'm using this code in visual studio 2010 with smfl 1.6 to show a blank window.

Code: [Select]

#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <iostream>

int main()
{
    // Create the main rendering window
    sf::RenderWindow App(sf::VideoMode::GetDesktopMode(), "Test Program", sf::Style::Resize|sf::Style::Close);
    App.SetSize(400, 200);
   
    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        // Clear the screen (fill it with black color)
        App.Clear();

        // Display window contents on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}


Instead i get a console which crashes straight away.

The debug message is as follows, "A buffer overrun has occurred in SFML Test.exe which has corrupted the program's internal state. Press Break to debug the program or Continue to terminate the program."

I'm using a windows vista laptop with a Mobile Intel 4 Series Express Family built-in gpu. I updated it's drivers about 6 months ago and it is compatible with shaders, etc.

I've linked all the libraries and followed this tutorial (http://www.sfml-dev.org/tutorials/1.6/start-vc.php) so why isn't it working?
Title: RenderWindow Runtime Error
Post by: flaming_goose on March 06, 2011, 03:40:22 pm
Nevermind, I recompiled the libraries as described here (http://ggammon.wordpress.com/2010/02/14/compiling-and-running-an-sfml-application-in-visual-studio-2010-rc/) and it works fine now :)