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

Author Topic: Anybody using DSFML/DSFML2?  (Read 58639 times)

0 Members and 2 Guests are viewing this topic.

Trass3r

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Anybody using DSFML/DSFML2?
« on: March 04, 2010, 02:47:20 am »
Is anybody using DSFML for some bigger project?
I currently only use a small part of it and thus can't thoroughly test all of it.
Could use some feedback.

Also if someone gets some of the samples to work, tell me.


Just removed the csfml-system dependency. Use standard library features for threading, mutexes, time measurement and random number generation.

Future directions are:
- D1/Tango compatibility will be completely dropped, D2 is now frozen and fast approaching
- probably removing get/set prefixes in function names to make it more D-ish.
- gotta think about a more clever and more robust internal C pointer handling

Xeon06

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #1 on: March 04, 2010, 05:44:58 pm »
I absolutely love the D language and I would use this binding if it wasn't for the fact that the D community isn't very big and that whole thing about Phobos/Tango is making me wary of this language. Too bad really :(. Although I think you should keep on developing this, one day when D gets more fame surely this will come in handy!

Trass3r

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #2 on: March 04, 2010, 06:15:27 pm »
You should switch over to D2 now if you don't wanna miss the train.

D2 is frozen and will probably be released this summer when Andrei's book comes out.
The library developers will have to gradually port their stuff to D2, just as QtD and LuaD who recently dropped D1/Tango support, just as DSFML itself which will become unusable with D1 more and more.

And eventually even the douchebags behind Tango will be forced to switch, putting an end to the whole Phobos/Tango misery (if they don't go mad and use yet another incompatible runtime) :)

Xeon06

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #3 on: March 05, 2010, 06:19:02 am »
I think I'll wait till summer then, my engine is already quite advanced to port it all over, but I am really looking forward to the release of D2.

Trass3r

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #4 on: March 05, 2010, 01:58:17 pm »
hmm waiting might make sense if you want to buy the book and get to know D2 that way.
Nevertheless gradually porting is easier. replacing existing char[] with string, writing new code with D2 in mind etc.

What engine are you talking about?

Xeon06

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #5 on: March 06, 2010, 04:53:39 am »
My personal game engine. I'll finish this game in C#, then check out D2, as the advantages of D over C# (especially speed) are great.

AndrejM

  • Newbie
  • *
  • Posts: 29
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #6 on: August 23, 2010, 12:57:04 am »
I can almost get some of the samples working by manually fixing the calls to several property methods which have been renamed. But in many cases I end up with this particular call in the client code:

Code: [Select]
Input i = app.getInput();

where app is a RenderWindow object. There's no getInput or any similar methods in that class (and I've tried them all just to check), so I'm not sure what to call instead. I don't see an equivalent method in the Input class either.

Trass3r

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #7 on: August 23, 2010, 01:16:58 am »
Yeah most of the samples are horribly outdated :(
It should be app.input

If you get them to run, please post the diffs so I can commit them :)

AndrejM

  • Newbie
  • *
  • Posts: 29
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #8 on: August 23, 2010, 01:41:38 pm »
Yeah I'm just trying out the pong sample, I've fixed (hopefully) all the problems in the code, and the imports work fine. But I can't get optlink link with the libraries. I keep getting back undefined symbol errors.. so I guess I have to manually pass the lib directory to optlink, but I'm not having much success.

What's your build command (xfbuild/dmd), pretty please?

Trass3r

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #9 on: August 23, 2010, 02:58:17 pm »
Nothing fancy:
Code: [Select]
xfbuild main.d +v +xcore +xstd +obin\OpenBB-d -wi -unittest -debug -g
Since the CSFML dlls are loaded at runtime they can't be the problem.
Be sure to add +xcore and +xstd.

AndrejM

  • Newbie
  • *
  • Posts: 29
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #10 on: August 23, 2010, 07:38:27 pm »
This is kind of difficult to compile.  :)

So basically, CSFML is dependent on SFML, and DFSM is a wrapper for CSFML, have I got that right?

I can now compile with xfbuild but I get a runtime error:
Loading error. Reason : Symbol cannot be found in specified library (library : csfml-audio-d.dll, symbol : sfMusic_Create)
core.exception.AssertError@dsfml\system\vector.d(371): SSE length calculation failed

Grepping through the source finds these methods:
C:\sfml2\CSFML\include\SFML\Audio\Music.h:44:CSFML_API sfMusic* sfMusic_CreateFromFile(const char* filename);
C:\sfml2\CSFML\include\SFML\Audio\Music.h:55:CSFML_API sfMusic* sfMusic_CreateFromMemory(const void* data, size_t sizeInBytes);
C:\sfml2\CSFML\src\SFML\Audio\Music.cpp:36:sfMusic* sfMusic_CreateFromFile(const char* filename)
C:\sfml2\CSFML\src\SFML\Audio\Music.cpp:53:sfMusic* sfMusic_CreateFromMemory(const void* data, size_t sizeInBytes)

I'll try writing a simpler example, maybe I haven't built properly or something.

Trass3r

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #11 on: August 23, 2010, 08:04:46 pm »
Yeah, unfortunately. There's no way to access the SFML C++ code directly.
So CSFML provides C functions to access the internal SFML code.

That sfMusic error is known and actually no real error. The dll loading code is auto-generated.
The 2nd SSE error is a unittest failure cause the SSE sqrt is only a rough approximation. I need to loosen the checked condition.

Both errors shouldn't occur in release mode (i.e. with -release -O -inline instead of -debug -g -unittest).

AndrejM

  • Newbie
  • *
  • Posts: 29
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #12 on: August 23, 2010, 08:24:24 pm »
Quote from: "Trass3r"
Yeah, unfortunately. There's no way to access the SFML C++ code directly.
So CSFML provides C functions to access the internal SFML code.

That sfMusic error is known and actually no real error. The dll loading code is auto-generated.
The 2nd SSE error is a unittest failure cause the SSE sqrt is only a rough approximation. I need to loosen the checked condition.

Both errors shouldn't occur in release mode (i.e. with -release -O -inline instead of -debug -g -unittest).

Aha! It compiles and runs now. I had to copy the bin files with some data stuff but that's okay. I'll have to fix the module though, as soon as I run the game I loose the round, and at exit I get an invalid memory reference error.

But at least we're going somewhere.. Thanks for the help, I'll see if I can fix these samples somehow.

Trass3r

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #13 on: August 23, 2010, 09:32:55 pm »
Yeah you gotta be fast so you don't lose immediately :D

Do you have any details regarding the exiting error?
I think in some rare cases access violations occur. I couldn't really track it down yet. Order of static destructor calls could be one issue.

The whole internal csfml handling is a big issue I haven't really solved/decided yet.

AndrejM

  • Newbie
  • *
  • Posts: 29
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #14 on: August 23, 2010, 11:00:32 pm »
Quote from: "Trass3r"
Yeah you gotta be fast so you don't lose immediately :D


Hmm. Yeah it's weird I compiled it without xfbuild and it immediately makes me either loose or win. But I've recompiled again with xfbuild and I can actually play now (yay!).

Quote from: "Trass3r"

Do you have any details regarding the exiting error?
I think in some rare cases access violations occur. I couldn't really track it down yet. Order of static destructor calls could be one issue.

The whole internal csfml handling is a big issue I haven't really solved/decided yet.


Just this:
---------------------------
pong.exe - Application Error
---------------------------
The instruction at "0x6b6252ba" referenced memory at "0x01b1bb78". The memory could not be "read".

I haven't set up a debugger for D yet (not like there's much D2 debuggers out there), so I can't tell you more. Maybe I've screwed up some method call, I'll do a diff with the original and refactor again, this time properly renaming the methods, and I'll try other examples if they crash or not on exit.