Ok, so I've been using sfml for the past 2 weeks, was awesome.
Starting making a BIG project, and all of a sudden my programs that use sfml went to sh*t.
It seems to crash at App.Clear() or App.Display()
I've used both Window and RenderWindow and before using RenderWindow works great.
I recently had a stable game, saved it. next day I go to load it and run it, it crashes on those lines, why?
Here's a sample code.
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow App(sf::VideoMode(800, 600, 32), "Test Program");
while (App.IsOpened())
{
sf::Event Event;
while (App.GetEvent(Event))
{
// Window closed
if (Event.Type == sf::Event::Closed)
App.Close();
// Escape key pressed
if ((Event.Type == sf::Event::KeyPressed) && (Event.Key.Code == sf::Key::Escape))
App.Close();
}
App.Clear(sf::Color(130, 130, 255));
App.Display();
}
App.Close();
return EXIT_SUCCESS;
}
I originally used CodeBlocks as my IDE, and it started crashing there.
Tried VC++ and it crashed there as well.
I am using -d libs for debugging.
and not using release for debug.
my libs are correct, and this suddenly started happening.
It's frustrating me to the point of not wanting to program anymore, please help!
//Edit if it helps any:
SFML-1.6
CodeBlocks
SFML-1.6 VC++ version, VC++2008
Windows vista, 3gb ram, dual core processor, yada-yada...