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

Author Topic: RenderWindow.Clear() crashes  (Read 1618 times)

0 Members and 1 Guest are viewing this topic.

RHilton

  • Newbie
  • *
  • Posts: 1
    • View Profile
RenderWindow.Clear() crashes
« on: November 15, 2011, 04:32:29 am »
Hello,
really new to SFML, tried to do some of the tutorials but I'm getting a runtime crash. It compiles fine.

Project information
VC 10
Console Application -> Empty Project
Additional Dependancies
sfml-window.lib;sfml-graphics.lib;sfml-system.lib
Preprocessor Definitions-
SFML_DYNAMIC;WIN32;_DEBUG;_CONSOLE;


Code: [Select]
From the tutorial.


#include <SFML/Graphics.hpp>

int main()
{
    // Create the main rendering window
    sf::RenderWindow App;
App.Create(sf::VideoMode::GetMode(0), "SFML Window", sf::Style::Fullscreen);

bool Running = true;
while (Running)
{
sf::Event event;

while (App.GetEvent(event))
{
if (event.Type == sf::Event::Closed)
App.Close();
}

App.Clear(); // if i comment this line, i don't get the crash
   App.Display();
}
}



If i comment out the App.Clear() call it doesnt crash.
When it crashes it says the program expierenced a buffer overflow.


Any ideas?

OS is Win7 32 bit

Walker

  • Full Member
  • ***
  • Posts: 181
    • View Profile
RenderWindow.Clear() crashes
« Reply #1 on: November 15, 2011, 04:55:41 am »
You need to link debug libs in debug mode. I'd guess that's the problem.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
RenderWindow.Clear() crashes
« Reply #2 on: November 15, 2011, 07:32:44 am »
You also need to recompile SFML. The downloadable archive is for VC 2008.
Laurent Gomila - SFML developer