SFML community forums
Help => General => Topic started by: nevets_19 on January 06, 2011, 05:37:10 pm
-
Hello, i have recently being trying to install SFML as it looks good and i would like to start programing game i follow the tutorial on this website and the time sample thing works fine but when i try to open a window nothing comes up its just a blank console window and no screen, this is my code
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
int main ()
{
sf::RenderWindow Game(sf::VideoMode(800, 600, 32), "Game");
sf::Event Event;
while(Game.IsOpened())
{
while(Game.GetEvent(Event))
{
if(Event.Type == sf::Event::Closed)
Game.Close();
}
Game.Clear();
Game.Display();
}
return EXIT_SUCCESS;
}
thanks to anyone who can help ;D
-
You had forget the main loop.
Sorry, I did not see :oops:
-
yeah, i got this code off a you tube video, i am a n00b and know practically nothing and i hope to learn this main from online tutorials
i have been trying to get this to work for awhile now and i have been having soo much trouble setting it up, makes me wonder if i should just give up and try to learn something else
anyways is there anyway u could maybe give me some code that will successfully open a window XD
-
You had forget the main loop.
Sorry, I did not see :oops:
eh, dw about it maybe i'll just learn SDL or something i'll try the graphics-window.cpp file this website provides and see how that goes
-
hmm, nothing, it does the same thing, it has come to my attention that no one cares haha
-
And you really aren't impatient..
What machine are you running on? What OS? Give more information please.
The code looks like ok to me..
-
hmm, nothing, it does the same thing, it has come to my attention that no one cares haha
I check my regular forums way too often (SFML included) and I somehow missed your post. So sorry about that.
Oh wait, you went from "It's not working" to "no one cares" in under an hour. This will make people want to help less.
Anyway... OS? Hardware? SFML version? Followed the setup tutorial?
-
yeah, i didn't realize that people were gonna get angry about it, the reason for this is i am really frustrated as i have been trying o set this up and open a window several months and i'm on the brink of giving up.
i am running Windows 7 64bit
graphics card is ati radeon 5770 if that makes a difference
SFML version is 1.6
Code Blocks MinGW 4.4
and yes i followed the tutorial
-
SFML 1.6? I know that there is a problem with SFML2, ATI and Dynamic libraries. Don't know if that applies to 1.6 too.
Try the static libs and see if it works.
Also, check if anything happens if you draw to the window.
And are you using 64bit version of the library?
-
SFML 1.6? I know that there is a problem with SFML2, ATI and Dynamic libraries. Don't know if that applies to 1.6 too.
Try the static libs and see if it works.
Also, check if anything happens if you draw to the window.
And are you using 64bit version of the library?
I have No idea there even was a 64bit version of the library, as i stated b4 i am n00b
-
There isn't, not compiled. I just said it since it might affect. I don't know how Windows handles it
You will have too compile it yourself if it does matter. Anyway, try out SFML2 instead since you want to learn to work with SFML. SFML1.6 is more or less out-dated by now. So since your not going to develop anything real and publish it yet you can might as well do SFML2 instead.
-
i have installed SFMl 2.0 just now for visual c++ 2008 and now everything builds fine and its about to open (i think) and it come up with an error saying sfml-graphics.dll is missing from your computer and there is not sfml-graphics in the sfml 2.0 folder i know cause i searched it
-
Then everything couldn't have being built just fine, don't you think? Doesn't the VS build of SFML say at least one failed build?
Anyway the DLL is beside the point, you should be statically linking them since you are using ATI.
-
Then everything couldn't have being built just fine, don't you think? Doesn't the VS build of SFML say at least one failed build?
Anyway the DLL is beside the point, you should be statically linking them since you are using ATI.
thank you for all your help btw, i have made a screen shot of it so u can get a better understanding (u probably already understand but ah well)
http://img29.imageshack.us/f/errormessages.jpg/
u might need to zoom i on it its kinda small
-
Also, it should be asking for: sfml-graphics-d-2.dll if you are using SFML2
-
yeah thats Wat i was thinking, i was like wtf, that doesn't exist in the sfml2 folder :s
this is the output message from visual c++
'SFMl Game.exe': Loaded 'C:\Users\Gaming\Documents\Visual Studio 2008\Projects\SFMl Game\Debug\SFMl Game.exe', Symbols loaded.
'SFMl Game.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll'
'SFMl Game.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll'
'SFMl Game.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll'
'SFMl Game.exe': Loaded 'C:\Windows\system\sfml-graphics.dll', Binary was not built with debug information.
The program '[2868] SFMl Game.exe: Native' has exited with code -1073741515 (0xc0000135).
-
Anyway try cleaning your computer off anything that got to do with SFML and install SFML2 agan.
I can't help you more since I need to go to bed and sleep.
-
Anyway try cleaning your computer off anything that got to do with SFML and install SFML2 agan.
I can't help you more since I need to go to bed and sleep.
so long
-
With that information I might have figured out what was wrong. You were using release libraries while running the code in debug. Just so you think about it. The libraries with a -det are for debug.
-
so would that fix the sfml-graphics.dll and the sfml-system.dll problem
-
If you still want to use SFML 1.6 then probably. But you should also be getting a sfml-window problem.
Can you also tell me what you link and in what order?
-
oh, i thoguht i said i have got SFMl 2.0 aswell which i'm trying it on that atm
now it asks for
sfml-window-d.dll
sfml-graphics-d.dll
WHAT THE HELL I HAD THOSE FILES IN THERE!!!!!
-
You are still linking against sfml 1.6 but to fix that error just place the dll files in system32 or the same folder as the executable.
-
ok, i have no more compile error but i am back to my original problem, FML!
this is what i have in additional dependencies
sfml-window-d.lib
sfml-graphics-d.lib
sfml-system-d.lib
also i tryed the same code and stuff on codeblocks and the window still didn't come up, only a console box
i'm thinking its my computer thats the problem
-
OK, i fixed it, i made a partition on my drive and installed windows xp on it and used easybdc to dual boot them so now i have a partition for programming stuff (windows xp) and a partition for gaming (windows 7)
all good now ;D