SFML community forums
Help => Window => Topic started by: FrewCen on February 28, 2012, 07:35:01 am
-
Hi all.
Today I've started to use SFML Window package and in first tutorial I found problem (for me). My code:
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <iostream>
using namespace std;
using namespace sf;
int main()
{
sf::Window App(sf::VideoMode(800, 600, 32), "SFML Window");
App.Create(sf::VideoMode(800, 600, 32), "SFML Window", sf::Style::Fullscreen);
bool Running = true;
while (Running)
{
App.Display();
}
return EXIT_SUCCESS;
}
My error:
http://img401.imageshack.us/img401/3355/c608e44e56cc48108f3e1a6.png
And when I'm not using fullscreen:
http://img46.imageshack.us/img46/7518/76d5406b8dad48f2b90750a.png
Does anybody know how to repair it? Please help me.
-
It's the expected behaviour. Follow the next tutorial to get something more useful on screen.
-
I have done next tutoriasl, but I'm getting error with somethig like "debug hook" when I'm trying to do App.Clear(); metohod. What should I do now? It breaks my code everytime when I'm starting application.
-
Probably missing the libraries between debug and release..
-
Please give more details
http://www.sfml-dev.org/forum/viewtopic.php?p=36367#36367
-
Working code:
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <iostream>
#include <SFML/Graphics.hpp>
using namespace std;
using namespace sf;
int main()
{
sf::RenderWindow WND(sf::VideoMode(800, 600, 32), "Test WND");
while(WND.IsOpened())
{
sf::Event Event;
while(WND.GetEvent(Event))
{
if(Event.Type = sf::Event::Closed)
WND.Close();
}
WND.Display();
}
return 0;
}
Not working:
#include <SFML/System.hpp>
#include <SFML/Window.hpp>
#include <iostream>
#include <SFML/Graphics.hpp>
using namespace std;
using namespace sf;
int main()
{
sf::RenderWindow WND(sf::VideoMode(800, 600, 32), "Test WND");
while(WND.IsOpened())
{
sf::Event Event;
while(WND.GetEvent(Event))
{
if(Event.Type = sf::Event::Closed)
WND.Close();
}
WND.Clear();
WND.Display();
}
return 0;
}
Error:
(http://img17.imageshack.us/img17/1617/8423558f0aeb48dea61ba54.png)
-
You must recompile SFML if you use VC++ 2010, the binaries that you downloaded are for 2008.
-
And how and what should I recompile?
-
There are billions of posts about it on this forum, if you search enough you can even find video tutorials and precompiled libraries.