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 - AndrejM

Pages: [1] 2
1
D / Anybody using DSFML/DSFML2?
« on: September 08, 2010, 07:37:05 pm »
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:

Code: [Select]

@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%

2
D / Anybody using DSFML/DSFML2?
« on: September 08, 2010, 06:30:29 pm »
Quote from: "Trass3r"
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. :)

3
D / up-to-date D bindings for the v1.5 C API
« on: September 03, 2010, 04:39:34 pm »
Quote from: "hide"
What's the difference between a wrapper and bindings ?

AFAIK a wrapper will take care of some things for you, e.g. initialization/cleaning, conversion between specific types from C to D and vice-versa. With a binding, you have to do these things yourself. But correct me if I'm wrong, Trass3r :)

4
D / Anybody using DSFML/DSFML2?
« on: August 28, 2010, 05:36:29 pm »
I've fixed the syntax errors for DFLSample, but I'm having build errors:

Code: [Select]

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

5
D / Anybody using DSFML/DSFML2?
« on: August 26, 2010, 09:45:02 pm »
Quote from: "Trass3r"
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:

Code: [Select]
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

6
D / Anybody using DSFML/DSFML2?
« on: August 26, 2010, 08:59:18 pm »
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:

Code: [Select]

@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..

7
D / Anybody using DSFML/DSFML2?
« on: August 26, 2010, 07:31:59 pm »
Quote from: "Trass3r"

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.

Quote
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.

8
D / Anybody using DSFML/DSFML2?
« on: August 26, 2010, 06:29:03 pm »
dsfml\window\event.d has a typo,
line 111 in the enum KeyCode:
Code: [Select]
Substract,
should be
Code: [Select]
Subtract,


dsfml\window\context.d has an import to a missing file at line 29:
Code: [Select]
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:

    Code: [Select]
    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:
    Code: [Select]
    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:
    Code: [Select]
    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:

    Code: [Select]

    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

    9
    D / Anybody using DSFML/DSFML2?
    « on: August 26, 2010, 01:04:31 am »
    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.

    10
    D / Anybody using DSFML/DSFML2?
    « on: August 26, 2010, 12:35:53 am »
    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. ^^

    11
    D / Anybody using DSFML/DSFML2?
    « on: August 26, 2010, 12:25:39 am »
    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.

    12
    D / Anybody using DSFML/DSFML2?
    « on: August 25, 2010, 11:38:38 pm »
    Quote from: "Trass3r"

    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.

    13
    D / Anybody using DSFML/DSFML2?
    « on: August 25, 2010, 11:07:59 pm »
    Quote from: "Trass3r"

    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?

    Quote from: "Trass3r"

    The second comment belongs to onGetData.

    My bad! :)

    Quote from: "Trass3r"
    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.

    14
    D / Anybody using DSFML/DSFML2?
    « 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..

    15
    D / Anybody using DSFML/DSFML2?
    « 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).

    Pages: [1] 2
    anything