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

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

0 Members and 5 Guests are viewing this topic.

AndrejM

  • Newbie
  • *
  • Posts: 29
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #15 on: August 23, 2010, 11:01:49 pm »
Btw I get ~6000 FPS on average. D is damn fast, eh? :lol:

Trass3r

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #16 on: August 23, 2010, 11:11:04 pm »
Quote from: "AndrejM"
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!).

That sounds completely weird. Could you post the dmd commandline you used?

Quote from: "AndrejM"
I haven't set up a debugger for D yet (not like there's much D2 debuggers out there)

On Windows you have cv2pdb and the upcoming Mago debugger.

Quote from: "AndrejM"
Btw I get ~6000 FPS on average. D is damn fast, eh? :lol:

Which OS/HW configuration?

AndrejM

  • Newbie
  • *
  • Posts: 29
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #17 on: August 23, 2010, 11:26:47 pm »
Quote from: "Trass3r"
Quote from: "AndrejM"
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!).

That sounds completely weird. Could you post the dmd commandline you used?


I'm not sure, I forgot to take a note, sorry. But I also recompiled the .dll's using the batch file that comes with SFML, so it was probably a mistake on my part when I was moving dll's round and about.

Quote from: "Trass3r"

Which OS/HW configuration?

XP32
AMD Athlon II X4 620 @ 2.6Ghz
3GB DDR2 400Mhz
GeForce 9600 GT

The GPU and Ram is pretty old already but I'm fine with that. A modern game like Dirt 2 runs perfectly fine on 1680x1050, which is my max resolution. It does get a little laggy with a lot of antialiasing, but that's expected with an older GPU I guess.

Trass3r

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #18 on: August 23, 2010, 11:49:40 pm »
Ok, btw Laurent is currently switching over to CMake.
At least the OpenGL example is still up-to-date :)

AndrejM

  • Newbie
  • *
  • Posts: 29
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #19 on: August 24, 2010, 07:13:51 pm »
Quote from: "Trass3r"
Ok, btw Laurent is currently switching over to CMake.


So this means DFSML will need those CMakeLists.txt files now? I've never used CMake before, right now I'm compiling like so:

Code: [Select]

xfbuild pong.d +v +xcore +xstd +o..\bin\ -release -O -inline -I..\..\..\import


I've noticed something in your debug build command you've posted earlier:
Quote from: "Trass3r"
Nothing fancy:
Code: [Select]
xfbuild main.d +v +xcore +xstd +obin\OpenBB-d -wi -unittest -debug -g


-d is a compiler switch that enables deprecated features. Did you want to compile with -d, or are you just using that extension as a naming convention for debug builds (the command above just glues -d to the name)?

Trass3r

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #20 on: August 24, 2010, 07:19:51 pm »
No, CMake is just used to build sfml and the csfml dlls on top of it.
Yeah the '-d' belongs to the filename, resulting in OpenBB-d.exe

AndrejM

  • Newbie
  • *
  • Posts: 29
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #21 on: August 24, 2010, 07:23:46 pm »
One more thing: Where did you find about those +xstd and +xcore flags? I don't see them listed when using xfbuild --help ?

Trass3r

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #22 on: August 24, 2010, 07:29:14 pm »
Dunno, at least they are listed there: http://bitbucket.org/h3r3tic/xfbuild/wiki/Home
Although they say it's +x=pck instead of +xpck :?:

AndrejM

  • Newbie
  • *
  • Posts: 29
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #23 on: August 24, 2010, 07:36:51 pm »
Quote from: "Trass3r"
Dunno, at least they are listed there: http://bitbucket.org/h3r3tic/xfbuild/wiki/Home
Although they say it's +x=pck instead of +xpck :?:

Oops, I thought those two were some options that enable multicore compilation or something, I didn't realize it's the package exclusion option.

I do compile fine without excluding those packages, at least in the pong example. Why do you exclude them?

Trass3r

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #24 on: August 24, 2010, 07:42:03 pm »
I had weird errors in some projects that were solved by excluding them.
Furthermore Phobos is already precompiled so I don't know if it makes any sense at all not to exclude them.

AndrejM

  • Newbie
  • *
  • Posts: 29
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #25 on: August 24, 2010, 07:46:24 pm »
Quote from: "Trass3r"
I had weird errors in some projects that were solved by excluding them.
Furthermore Phobos is already precompiled so I don't know if it makes any sense at all not to exclude them.

Ah, ok.

Is the network package operational? I can't get that to compile. And I saw some weird method definitions, such as:

Code: [Select]
void add(T socket)


I guess this was supossed to be a template but was never completed?

Trass3r

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #26 on: August 24, 2010, 08:07:57 pm »
No. It used to compile without errors but Laurent restructured the whole package some time ago.

Currently I'm not inclined to fix this as its future in DSFML is still undecided.

Phobos should provide a way to do network communication and probably has a more sophisticated solution anyway. On the other hand SFML's simplicity approach might be a good alternative. I can't assess that though since I haven't used any networking stuff whatsoever.

AndrejM

  • Newbie
  • *
  • Posts: 29
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #27 on: August 24, 2010, 08:14:13 pm »
Quote from: "Trass3r"
No. It used to compile without errors but Laurent restructured the whole package some time ago.

Currently I'm not inclined to fix this as its future in DSFML is still undecided.

Phobos should provide a way to do network communication and probably has a more sophisticated solution anyway. On the other hand SFML's simplicity approach might be a good alternative. I can't assess that though since I haven't used any networking stuff whatsoever.

Fair enough. Phobos is growing rapidly so that might be a good idea. I won't touch any examples with networking (if there are any).

AndrejM

  • Newbie
  • *
  • Posts: 29
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #28 on: August 25, 2010, 09:34:14 pm »
It seems to be an issue with OpenAl:

First-chance exception at 0x6b6252ba (openal32.dll) in pong.exe: 0xC0000005: Access violation reading location 0x01b2b7f0.
Unhandled exception at 0x6b6252ba (openal32.dll) in pong.exe: 0xC0000005: Access violation reading location 0x01b2b7f0.

Removing audio-related code in Pong will stop the app from crashing at exit. I couldn't hear the sound anyway so there's definitely something broken somewhere.

The same thing happens with the soundstream.d example, which compiles and runs but doesn't output any sound and crashes at exit.

In that example code [soundstream.d], there's a MySoundStream class that inherits from the abstract class SoundStream. I had to add the following method because I couldn't instantiate the class:

Code: [Select]
void onSeek()
{
}


The module import/dsfml/audio/soundstream.d defines the abstract  SoundStream and the onSeek() method has these comments:

Code: [Select]

/**
* Called each time the stream is seeked
*/
abstract void onSeek();

/**
* Called each time the stream needs new data.
* This method will be call by an other thread, take care of possible synchronisation issues.
*
* Params:
* data = array of samples to stream
*
* Returns:
* true to continue streaming, false to stop
*/


If it returns a bool, it can't have a void return type. I had to make the implementing class define this method as a void because I can't redefine the return value of a method, since that is an error.

Here's the sample modules which I've edited so they compile:
pong.d
soundstream.d

I've compiled with:
Code: [Select]
xfbuild FILE.d +v +xcore +xstd +o..\bin\ -release -O -inline -I..\..\..\import

Hope that helps..

Trass3r

  • Jr. Member
  • **
  • Posts: 91
    • View Profile
Anybody using DSFML/DSFML2?
« Reply #29 on: August 25, 2010, 10:41:25 pm »
Quote from: "AndrejM"
Removing audio-related code in Pong will stop the app from crashing at exit. I couldn't hear the sound anyway so there's definitely something broken somewhere.

Sound perfectly works for me.

Quote
In that example code [soundstream.d], there's a MySoundStream class that inherits from the abstract class SoundStream.

Well most of the code in audio is still from old DSFML1 times because I've only used sound and music so far.
The soundstream example compiles now but doesn't play anything. Probably need to fix the whole dsfml soundstream module.

Quote
The module import/dsfml/audio/soundstream.d defines the abstract  SoundStream and the onSeek() method has these comments:

Code: [Select]

/**
* Called each time the stream is seeked
*/
abstract void onSeek();

/**
* Called each time the stream needs new data.
* This method will be call by an other thread, take care of possible synchronisation issues.
*
* Params:
* data = array of samples to stream
*
* Returns:
* true to continue streaming, false to stop
*/


If it returns a bool, it can't have a void return type. I had to make the implementing class define this method as a void because I can't redefine the return value of a method, since that is an error.

The second comment belongs to onGetData.

Quote
Here's the sample modules which I've edited so they compile:
pong.d

Thanks. I've edited them to really account for the property syntax though. Check my commit.
Code: [Select]
End.characterSize = 60; and so on