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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - NordCoder

Pages: [1]
1
General / Undefined references when linking statically
« on: May 13, 2011, 08:05:48 am »
Quote
Which is for dynamic link, not static ;)


It may not have been clear what I was trying to say but I only used the define when I compiled dynamically :)

Switching the path under Settings -> Compiler and debugger... -> Global compiler settings -> Toolchain executables -> Compiler's installation directory to the path of the MingW version you suggest in the tutorial makes it work flawlessly for static linking :D I also managed to circumvent the fps issues (very low delta-times) I experienced on my laptop a while back. Maybe I need to update my drivers or OpenGL version?

Anyway, thank you for your help :)

2
General / Undefined references when linking statically
« on: May 12, 2011, 12:02:31 am »
I am trying to link SFML 1.6 to my project in Code::Blocks 10.05 with MingW 4.4.1

I followed this tutorial and used the same source code used as an example.

I am getting the following errors:
Code: [Select]

||=== SFML_test, Debug ===|
E:\Tools\SFML\SFML-1.6\lib\libsfml-system-s-d.a(Clock.o):Clock.cpp:(.eh_frame+0x11)||undefined reference to `__gxx_personality_v0'|
E:\Tools\SFML\SFML-1.6\lib\libsfml-system-s-d.a(Sleep.o):Sleep.cpp:(.eh_frame+0x11)||undefined reference to `__gxx_personality_v0'|
E:\Tools\SFML\SFML-1.6\lib\libsfml-system-s-d.a(Platform.o):D:\dev\sfml\sdk\SFML-1.6\src\SFML\System\Win32\Platform.cpp|42|undefined reference to `_Unwind_Resume'|
E:\Tools\SFML\SFML-1.6\lib\libsfml-system-s-d.a(Platform.o):Platform.cpp:(.eh_frame+0x12)||undefined reference to `__gxx_personality_v0'|
||=== Build finished: 4 errors, 0 warnings ===|


I know this question has probably been asked a dozen times or more but before posting I: Reread the tutorial, searched the internet and double-checked the settings/options in Code::Blocks.

Additionally, I added the SFML_DYNAMIC define and "-lsfml-system-s-d" and copied "libgcc_s_dw2-1.dll" and "sfml-system-d.dll" to my project executable's directory and got it to work (in Debug configuration). I should also mention that "libgcc_s_dw2-1.dll" was to located in the MingW version I have (found "libgcc_s_sjlj-1.dll" instead). I got this .dll from the download suggested in the beginning of the tutorial. I still want to make it work with the static libraries though :)

3
Graphics / GetFrameTime returns values in the order of 0.15 seconds
« on: November 06, 2010, 10:18:08 pm »
It's just updating which images should be drawn and so on. I already tried commenting out the Update function without any success. I am beginning to think the problem maybe lies in the versions of OpenGL (no idea..)/SFML (1.6)?

I will continue to look through the code and test it out.

Thanks for your input so far :)

4
Graphics / GetFrameTime returns values in the order of 0.15 seconds
« on: November 06, 2010, 11:21:50 am »
I checked my code again and I don't see that I am copying images anywhere.

Here's the updating and drawing part of my Game class:

Code: [Select]

void Game::Think()
{
if(States.back())
States.back()->Update(renderWindow.GetFrameTime());
}


Code: [Select]

void Game::Draw()
{
renderWindow.Clear();

if(States.back())
{
if(States.back()->IsPopup() && States.size() > 1)
{
if(States[States.size() - 2])
States[States.size() - 2]->Draw();
}

States.back()->Draw();
}

renderWindow.Display();
}


and the loading of the IntroState class (checked that it is only called once):

Code: [Select]

bool IntroState::Load()
{
if(!Fader.LoadFromFile("./Graphics/Images/Fader.png"))
return false;

if(!StormGamesLogo.LoadFromFile("./Graphics/Images/StormGamesLogo.png"))
return false;

if(!SfmlLogo.LoadFromFile("./Graphics/Images/SDLlogo.png"))
return false;

if(!LuaLogo.LoadFromFile("./Graphics/Images/StormGamesLogo.png"))
return false;

FaderSprite.SetImage(Fader);
StormGamesLogoSprite.SetImage(StormGamesLogo);
SfmlLogoSprite.SetImage(SfmlLogo);
LuaLogoSprite.SetImage(LuaLogo);

FaderSprite.SetColor(sf::Color(255, 255, 255, alpha * 255));

return true;
}


I'm using a type of state management where each state is a mini-application. The Game class manages a std::vector<GameState*> container. Hope it all makes sense :)

5
Graphics / GetFrameTime returns values in the order of 0.15 seconds
« on: November 05, 2010, 10:17:33 pm »
Hi Groogy,

One of the images is just black and I simply change its alpha value. I tried commenting out the update function which changes the alpha value, but it did not improve. If it has any relevance, I'm changing the alpha value with the following call:

Code: [Select]

FaderSprite.SetColor(sf::Color(255, 255, 255, alpha * 255));

6
Graphics / GetFrameTime returns values in the order of 0.15 seconds
« on: November 05, 2010, 09:22:40 pm »
Hi all,

First up, I would like to congratulate the creators of SFML on a very good job!

This is my first time using SFML. I have had experience with SDL (+OpenGL) and C#/XNA. I am using MSVC++ 2008 on a laptop (Graphics: Mobile Intel(R) 965 Express Chipset Family and Processor: Intel(R) Core(TM)2 Duo CPU T7300 @ 2.00GHz)

Anyways, I tried creating a small intro to a space shooter (with logos fading in and out etc.). I create 4 images and 4 sprites and set each image to their respective sprite. The code was taken from another project of mine.

I ran the program and saw that it was running very slowly. I printed out the values returned by RenderWindow::GetFrameTime() and they were in the order of ~0.15 seconds. I tried running it in Release mode, but only got a small improvement at ~0.13-0.14 seconds. I then tried copying the executable to my gaming computer and the values were on the order of ~0.001 (that computer just broke down just now though :( but I'm pretty sure it was around those values).

It seems my computer is too slow, but I can run games like WC3 and SDL + OpenGL projects without issues. Maybe there is another problem?

I tried commenting out my draw code and the speed went up to the order of running in Release mode. Here is my drawing code (I used to pass a reference to my render window, but that is now public/static for global access):

Code: [Select]

if(currentLogo == 1)
Game::renderWindow.Draw(StormGamesLogoSprite);
else if(currentLogo == 2)
Game::renderWindow.Draw(SfmlLogoSprite);
else
Game::renderWindow.Draw(LuaLogoSprite);

Game::renderWindow.Draw(FaderSprite);

Pages: [1]
anything