SFML community forums
Bindings - other languages => D => Topic started by: Trass3r 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
-
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!
-
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) :)
-
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.
-
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?
-
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.
-
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:
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.
-
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 :)
-
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?
-
Nothing fancy:
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.
-
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.
-
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).
-
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.
-
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.
-
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!).
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.
-
Btw I get ~6000 FPS on average. D is damn fast, eh? :lol:
-
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 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.
Btw I get ~6000 FPS on average. D is damn fast, eh? :lol:
Which OS/HW configuration?
-
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.
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.
-
Ok, btw Laurent is currently switching over to CMake.
At least the OpenGL example is still up-to-date :)
-
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:
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:
Nothing fancy:
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)?
-
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
-
One more thing: Where did you find about those +xstd and +xcore flags? I don't see them listed when using xfbuild --help ?
-
Dunno, at least they are listed there: http://bitbucket.org/h3r3tic/xfbuild/wiki/Home
Although they say it's +x=pck instead of +xpck :?:
-
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?
-
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.
-
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:
void add(T socket)
I guess this was supossed to be a template but was never completed?
-
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.
-
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).
-
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:
void onSeek()
{
}
The module import/dsfml/audio/soundstream.d defines the abstract SoundStream and the onSeek() method has these comments:
/**
* 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 (http://pastebin.com/Sf8CM64w)
soundstream.d (http://pastebin.com/wPj9PwDH)
I've compiled with:
xfbuild FILE.d +v +xcore +xstd +o..\bin\ -release -O -inline -I..\..\..\import
Hope that helps..
-
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.
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.
The module import/dsfml/audio/soundstream.d defines the abstract SoundStream and the onSeek() method has these comments:
/**
* 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.
Here's the sample modules which I've edited so they compile:
pong.d (http://pastebin.com/Sf8CM64w)
Thanks. I've edited them to really account for the property syntax though. Check my commit.
End.characterSize = 60;
and so on
-
Sound perfectly works for me.
Wait, you're right. I must of had the volume muted. :x
But the soundstream module doesn't make a sound, just like you've confirmed.
Do the examples crash for you as well?
The second comment belongs to onGetData.
My bad! :)
I've edited them to really account for the property syntax though. Check my commit.
This makes the code much more readable, imo. All those parentheses are a thorn in the eye. :)
I'll see if I can get more examples to compile. I'm pretty new to SFML so I'm just blindly replacing calls with new properties.
-
Do the examples crash for you as well?
Not so far. Do they always crash?
This makes the code much more readable, imo. All those parentheses are a thorn in the eye. :)
Yep, that's why I chose this path :)
-
Not so far. Do they always crash?
On exit, yeah.
I'm compiling SFML & CSFML with TDM-GCC, so maybe that has something to do with it. I could try compiling with VS2008 and see if it makes a difference.
-
Here's view.d:http://pastebin.com/UfmRMutf
There's some weird indentation next to if statements, but I left that as it is. I've replaced (hopefully all) calls to properties with the syntax obj.property and obj.property = value.
This one doesn't crash at exit.
Edit: Btw, is Pastebin an ok place to put these files? I don't know where else to host them.. I could use dropbox if you prefer that.
-
Any idea what "PostFX" has been renamed to? It appears to be some global variable somewhere in graphics/system/window but searching "post" or "fx" doesn't find it.
Speaking of which, is there a way in D to get all the names defined in a module and output it in some text file? Well I guess I would need an IDE for that.. but I prefer a text editor. ^^
-
Here's sound3d.d:
http://pastebin.com/eZT3rk8S
The sound seems to loop for a while, but after a few seconds it stops. The app crashes on exit like the other audio modules. Otherwise it seems to work ok, I can move the car left-right and hear the stereo effect.
-
Any idea what "PostFX" has been renamed to?
Shader
Speaking of which, is there a way in D to get all the names defined in a module and output it in some text file? Well I guess I would need an IDE for that.. but I prefer a text editor. ^^
Yep, Descent shows a list of all members while programming.
Here's view.d:http://pastebin.com/UfmRMutf
There's some weird indentation next to if statements, but I left that as it is. I've replaced (hopefully all) calls to properties with the syntax obj.property and obj.property = value.
Thanks :D
The frame is incorrect though. The mouse is more in the middle of it when you drag. I fixed it, was a bug due to changed Rect layout.
is Pastebin an ok place to put these files? I don't know where else to host them.. I could use dropbox if you prefer that.
Totally ok.
Here's sound3d.d:
http://pastebin.com/eZT3rk8S
The sound seems to loop for a while, but after a few seconds it stops. The app crashes on exit like the other audio modules. Otherwise it seems to work ok, I can move the car left-right and hear the stereo effect.
Indeed it stops :x
-
dsfml\window\event.d has a typo,
line 111 in the enum KeyCode:
Substract,
should be
Subtract,
dsfml\window\context.d has an import to a missing file at line 29:
import dsfml.window.common;
Removing it compiles the libraries (I have removed that before when I compiled the lib but I forgot to mention it).
I've done a partial fix of the PostFX sample. I have a few problems however:
1. I had to change the EFFECTS type to string[5]. This was a char[][5] type before, but I couldn't compile the lines that called Text.text(), which takes a string as it's argument, for example:
curFXStr.text("Current effect is " ~ EFFECTS[actualIndex]);
The literal is a string type (array of immutable chars), but EFFECTS would be a char[], and the compiler can't convert this to a string implicitly. An alternative is to use to!string from std.conv, but that's overkill imo.
This is one of those things that's different between D1 and D2. Are you still keeping D1 compatibility?
2. At line 110 in my fix there was this call:
app.draw(currentEffect);
I haven't found a draw method that directly takes a shader, and the one I found needs an IDrawable as a first argument. So I tried to pass it the background, which makes the code compile:
app.draw(background, currentEffect);
But I don't know if this is correct.
3. The example crashes on entry, and I seem to get almost chopped out text (e.g. "framebuffe" instead of "framebuffer") in the errors:
C:\sfml2\DSFML\samples\dsfml\bin>postfx
Failed to compile shader:
0(4) : error C0000: syntax error, unexpected '{' at token "{"
0() : error C0501: type name expected at token "{"
0(4) : warning 7022: unrecognized profile specifier "effect"
0(4) : warning C702: unrecognized profile specifier "framebuffer"
0(4) : warning C022: unrecognized profile specifier "texture"
0(6) : error C0000 syntax error, unexpected '}' at token "}"
0(6) : error C0501: tpe name expected at token "}"
Failed to compile shader:
0(2) : warning C7022: unrecognized profile specifier "framebuffe"
0(2) : warning C7022: unrecognized profile specifier "texture"0(2) : error C0502: syntax er
ror at token "texture"
0(4) : errorC0000: syntax error, unexpected identifier, expecting ',' or ';'at token "effec
t"
0(4) : error C0501: type name expected at toke "effect"
0(4) : error C1014: "effect" is not a function
(15) : atal error C9999: *** exception during compilation ***
Failed to compile shader:
0(2) : warning C7022: unrecognized profile specifier "framebuffe"
0(2) : warning C7022: unrecognized profile specifier "texture"0(2) : error C0502: syntax er
ror at token "texture"
0(4) : errorC0000: syntax error, unexpected identifier, expecting ',' or ';'at token "effec
t"
0(4) : error C0501: type name expected at toke "effect"
0(4) : error C1014: "effect" is not a function
(9) : ftal error C9999: *** exception during compilation ***
Failed to compile shader:
0(2) : warning C7022: unrecognized profile specifier "framebuffe"
0(2) : warning C7022: unrecognized profile specifier "texture"0(2) : error C0502: syntax er
ror at token "texture"
0(4) : errorC0000: syntax error, unexpected identifier, expecting ',' or ';'at token "effec
t"
0(4) : error C0501: type name expected at toke "effect"
0(4) : error C1014: "effect" is not a function
0(6) : rror C1115: unable to find compatible overloaded function "distace(error, vec2)"
(11) : fatal error C9999: *** exception during ompilation ***
Failed to compile shader:
0(3) : warning C7022: unrecognized profile specifier "wave"
0(3): warning C7022: unrecognized profile specifier "texture"
0(3) :warning C7022: unrecognized profile specifier "framebuffer"
0(3): error C0502: syntax error at token "framebuffer"
0(5) : error 0000: syntax error, unexpected identifier, expecting ',' or ';' t token "effec
t"
0(5) : error C0501: type name expected at token"effect"
0(5) : error C1014: "effect" is not a function
(11) : ftal error C9999: *** exception during compilation ***
object.Error: Access Violation
[/list]
Here's the sample module (you'll have to fix the 2 lib files as above and recompile the lib before compiling the example):
http://pastebin.com/d6fedtzY
-
I've done a partial fix of the PostFX sample. I have a few problems however:
I haven't dealt with such things yet. Here's Laurent's explanation:
http://www.sfml-dev.org/forum/viewtopic.php?t=1791
This is one of those things that's different between D1 and D2. Are you still keeping D1 compatibility?
Nope. Also the few version(Tango) parts are just remains and probably don't even compile anymore.
At line 110 in my fix there was this call:
app.draw(currentEffect);
I haven't found a draw method that directly takes a shader, and the one I found needs an IDrawable as a first argument. So I tried to pass it the background, which makes the code compile:
app.draw(background, currentEffect);
But I don't know if this is correct.
Well all that Drawable and render() stuff is a little bit hacky :roll:
-
I haven't dealt with such things yet. Here's Laurent's explanation:
http://www.sfml-dev.org/forum/viewtopic.php?t=1791
Ok I'll have a look.
This is one of those things that's different between D1 and D2. Are you still keeping D1 compatibility?
Well all that Drawable and render() stuff is a little bit hacky :roll:
Hehe, ok.
The OpenGL example compiles and runs fine (it needs Derelict, and works with the latest revision). I'm having a look at the dfl.d example but I need to compile DFL first.
I don't know what to do about the socket and voip examples. I have *no* experience with networking, and Phobos is in a state of flux so it might break these examples for each new release of Phobos.
-
Just leave the network samples alone for now.
Phobos usage examples don't belong in dsfml anyway :wink:
-
If anyone else is having a hard time building the libs with that cranky xfbuild, I'm using this silly - but working - batch file which I run from the DSFML\import dir:
@echo off
setlocal EnableDelayedExpansion
@echo on
@echo off
set "files="
for %%i in (dsfml\audio\*.d) do set files=!files! %%i
@echo on
dmd -lib -ofdsfml-audio.lib -I%cd%\dsfml\audio -I%cd%\dsfml\graphics -I%cd%\dsfml\system -I%cd%\dsfml\window %files%
cd..
copy %cd%\import\dsfml-audio.lib %cd%\lib
cd import
@echo off
set "files="
for %%i in (dsfml\graphics\*.d) do set files=!files! %%i
@echo on
dmd -lib -ofdsfml-graphics.lib -I%cd%\dsfml\audio -I%cd%\dsfml\graphics -I%cd%\dsfml\system -I%cd%\dsfml\window %files%
cd..
copy %cd%\import\dsfml-graphics.lib %cd%\lib
cd import
@echo off
set "files="
for %%i in (dsfml\system\*.d) do set files=!files! %%i
@echo on
dmd -lib -ofdsfml-system.lib -I%cd%\dsfml\audio -I%cd%\dsfml\graphics -I%cd%\dsfml\system -I%cd%\dsfml\window %files%
cd..
copy %cd%\import\dsfml-system.lib %cd%\lib
cd import
@echo off
set "files="
for %%i in (dsfml\window\*.d) do set files=!files! %%i
@echo on
dmd -lib -ofdsfml-window.lib -I%cd%\dsfml\audio -I%cd%\dsfml\graphics -I%cd%\dsfml\system -I%cd%\dsfml\window %files%
cd..
copy %cd%\import\dsfml-window.lib %cd%\lib
Otherwise I can't use xfbuild for building the lib. Either it doesn't link the object files, or it enters an infinite loop. Beats me what's going wrong..
-
Why would you want to build it?
I thought building the samples with xfbuild worked for you?
I get an OutOfMemoryError sometimes from it, but if I compile again it mostly works.
-
Why would you want to build it?
I thought building the samples with xfbuild worked for you?
No, they do. But there was a DSSS script in there for building a static library.
In any case, xfbuild gets so unstable for me. Sometimes I get back things like:
openwindoopwe.ndw(i2n5d)o:w .Edr(r2o5r):: uEnrdreofri:n eudn diedfeinnteidf iiedre nb
taicfkigerro ubnadc
kgroundo
penwindoopwe.ndw(i2n6d)o:w .Edr(r2o6r):: uEnrdreofri:n eudn diedfeinnteidf iiedre nst
tirf,i edri ds tyro,u dmieda ny oium pmoeratn sitmdp?o
rt std?
openwinodpoewn.wdi(n2d7o)w:. dE(r2r7o)r:: Eurnrdoerf:i nuendd eifdiennetdi fiideern t
si,f ideird sy,o ud imde ayno ui mmpeoarnt ismtpdo?r
t std?
openwoipnednowwi.ndd(o2w7.)d:( 2E7r)r:o rE:r ruonrd:e fuinndeedf iindeedn tiidfeinetri
fsi,e rd isd, ydoiud myeoaun miemapno ritm psotrdt?
std?
Build failed: 'dmd @xfbuild.a00e00.rsp' returned 1.
2010-08-26 21:35:07,172 Info [root] - Build failed: 'dmd @xfbuild.a27a00.rsp' returned
1.
Because I made a mistake in naming a variable. /end rant
-
I've fixed the syntax errors for DFLSample, but I'm having build errors:
xfbuild DFLSample.d +v +xcore +xstd +o..\bin\ -release -O -inline -I..\..\..\import -IC:\dfl\import\
..\..\..\import\Derelict\opengl\gl.di: Error: module derelict.opengl.gl from
file ..\..\..\import\Derelict\opengl\gl.di conflicts with another module gl from
file ..\..\..\import\Derelict\opengl\gl.di
..\..\..\import\Derelict\opengl\glu.di: Error: module derelict.opengl.glu from
file ..\..\..\import\Derelict\opengl\glu.di conflicts with another module glu from
file ..\..\..\import\Derelict\opengl\glu.di
Maybe you could make it work, I'm tired of building errors. :p
Here's the new DFLSample.d
http://pastebin.com/Sic5KcLe
-
Why would you want to build it?
I thought building the samples with xfbuild worked for you?
Sorry for that brainfart. I initially thought I needed an import library, but DSFML uses dynamic loading but on application startup (is that correct?).
So I don't need to create any import libraries (and really I wasn't creating an import lib, that build script only creates a static library..).
It's really interesting how you've combined the use of mixins with DLL loading. :)
-
The build errors for the dfl example seem to be coming from DFL unable to link to DSFML modules, I dunno why.. But expanding the build call from dfl and using it with xfbuild instead will compile the example.
I get a window with a nice 3d cube, and I can select mouse or keyboard input, but nothing seems to react to the mouse or keyboard. But at least the example doesn't crash. :)
Anyway, here's my batch file to build samples\dfl\dflsample.d:
@echo off
setlocal EnableDelayedExpansion
set "files="
set "derelict_libfiles="
REM ~ Configure these as needed:
set "dfl_import=C:\dfl\import"
set "dfl_lib=C:\DMD\dmd2\windows\lib\dfl.lib"
set "derelict_dir=..\..\..\lib\derelict"
for %%i in (*.d) do set files=!files! %%i
for %%i in (%derelict_dir%\*.lib) do set derelict_libfiles=!derelict_libfiles! %%i
@echo on
xfbuild %files% +v +xcore +xstd +o..\bin\ -release -O -inline -I..\..\..\import -I%dfl_import% -L/exet:nt/su:windows:4.0 %dfl_lib% -version=DFL_EXE %derelict_libfiles%
-
Sorry for that brainfart. I initially thought I needed an import library, but DSFML uses dynamic loading but on application startup (is that correct?).
So I don't need to create any import libraries (and really I wasn't creating an import lib, that build script only creates a static library..).
It's really interesting how you've combined the use of mixins with DLL loading. :)
Yeah, dll loading is done dynamically at program startup. It's a bit of a construction site. Some time ago I thought about replacing it with static linking but in the end I do need function pointers to do the magic behind simulated class inheritance (see Drawable implementation)
Thank you for your work on the DFL example. I don't have much time at the moment but while still try to fold your changes in :)
-
Hi
I'm starting to get interested in trying to make something in D.
I wanted to use something like SFML so it's a good thing that there is a port!
Now I just need to know if it's compatible with the last dmd? I want to get with D2.
-
It's targeted at D2.
-
Perfect! Thanks!
-
Although I think you should keep on developing this, one day when D gets more fame surely this will come in handy!