www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - DSFML2

reply Trass3r <un known.com> writes:
I've ported DSFML to the currently developed SFML v2.
It is included in its svn branch:  
http://sfml.svn.sourceforge.net/viewvc/sfml/branches/sfml2/

The packages system, window and graphics already work quite well. Audio  
package has been ported but the callbacks still need to be modified.

Supports D2. I tried to change as few as possible, so any tango-fetishist  
might get it to run by removing some const etc. and dealing with struct  
construction.
Jan 13 2010
next sibling parent Trass3r <un known.com> writes:
Ok, audio and network package compiles. Extensive tests are still due.
Jan 13 2010
prev sibling next sibling parent Bernard Helyer <b.helyer gmail.com> writes:
On 14/01/10 04:25, Trass3r wrote:
 I've ported DSFML to the currently developed SFML v2.
 It is included in its svn branch:
 http://sfml.svn.sourceforge.net/viewvc/sfml/branches/sfml2/

 The packages system, window and graphics already work quite well. Audio
 package has been ported but the callbacks still need to be modified.

 Supports D2. I tried to change as few as possible, so any
 tango-fetishist might get it to run by removing some const etc. and
 dealing with struct construction.

Excellent! Looking forward to trying it out. I'm having some trouble checking out the repository though: [src]$ svn co http://sfml.svn.sourceforge.net/viewvc/sfml/branches/sfml2/ svn: Repository moved temporarily to '/viewvc/sfml/branches/sfml2/'; please relocate I'm probably doing something stupid. Any library supporting D2 is good news, though. -Bernard.
Jan 13 2010
prev sibling next sibling parent Trass3r <un known.com> writes:
Yeah, sorry the correct repository is:

https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2/

The one I posted before is just the web version.
Jan 13 2010
prev sibling next sibling parent reply Bernard Helyer <b.helyer gmail.com> writes:
Okay, I got it to build and run. My hello world application segfaults if 
I quit with alt+f4 or escape, and sometimes if I just close it using the 
window manager.

(32 bit linux DMD 2.039, bernardh from #D)

hello.d:
------------------
module hello;

import std.stdio;

import dsfml.system.all;
import dsfml.window.all;
import dsfml.graphics.all;

void main()
{
     auto app = new RenderWindow(VideoMode(800, 600, 32), "DSFML Window");

     while (app.isOpened) {
         app.display();

         Event e;
         while (app.getEvent(e)) {
             if (e.Type == EventType.Closed ||
                 e.Type == EventType.KeyPressed && e.Key.Code == 
KeyCode.Escape) {
                 app.close();
             }
         }
     }
}
-----------------

Am I doing something bone-headed here?


Thanks,
-Bernard.
Jan 15 2010
parent Bernard Helyer <b.helyer gmail.com> writes:
On 18/01/10 15:35, Trass3r wrote:
 Probably some pointer issue.
 Could you debug it?

I can try. D:
Jan 17 2010
prev sibling next sibling parent Trass3r <un known.com> writes:
Probably some pointer issue.
Could you debug it?
Jan 17 2010
prev sibling next sibling parent reply Joel Christensen <joelcnz gmail.com> writes:
I've tried to build a progam using 32 bit Windows DMD 2.039:

C:\svn\sfml2\DSFML>dmd hello.d -Iimport
OPTLINK (R) for Win32  Release 8.00.2
Copyright (C) Digital Mars 1989-2009  All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
hello.obj(hello)
  Error 42: Symbol Undefined _D5dsfml8graphics3all12__ModuleInfoZ
hello.obj(hello)
  Error 42: Symbol Undefined _D5dsfml6window3all12__ModuleInfoZ
hello.obj(hello)
  Error 42: Symbol Undefined _D5dsfml6system3all12__ModuleInfoZ
hello.obj(hello)
  Error 42: Symbol Undefined 
_D5dsfml8graphics12renderwindow12RenderWindow7__Clas
sZ
hello.obj(hello)
  Error 42: Symbol Undefined 
_D5dsfml8graphics12renderwiÚow12RÇàÄWÇàÄ6__ctorMFSÇå
Á6ÇåÑ9videomoß9VÇäèMÇâèAyakÇĪ÷15ContextSettingsZCü½é
hello.obj(hello)
  Error 42: Symbol Undefined _D5dsfml6window5event5Event6__initZ
--- errorlevel 6

Thanks for any help.
Feb 15 2010
parent reply Michael P. <baseball.mjp gmail.com> writes:
Joel Christensen Wrote:

 I've tried to build a progam using 32 bit Windows DMD 2.039:
 
 C:\svn\sfml2\DSFML>dmd hello.d -Iimport
 OPTLINK (R) for Win32  Release 8.00.2
 Copyright (C) Digital Mars 1989-2009  All rights reserved.
 http://www.digitalmars.com/ctg/optlink.html
 hello.obj(hello)
   Error 42: Symbol Undefined _D5dsfml8graphics3all12__ModuleInfoZ
 hello.obj(hello)
   Error 42: Symbol Undefined _D5dsfml6window3all12__ModuleInfoZ
 hello.obj(hello)
   Error 42: Symbol Undefined _D5dsfml6system3all12__ModuleInfoZ
 hello.obj(hello)
   Error 42: Symbol Undefined 
 _D5dsfml8graphics12renderwindow12RenderWindow7__Clas
 sZ
 hello.obj(hello)
   Error 42: Symbol Undefined 
 _D5dsfml8graphics12renderwiÚow12RÇàÄWÇàÄ6__ctorMFSÇå
 Á6ÇåÑ9videomoß9VÇäèMÇâèAyakÇĪ÷15ContextSettingsZCü½é
 hello.obj(hello)
   Error 42: Symbol Undefined _D5dsfml6window5event5Event6__initZ
 --- errorlevel 6
 
 Thanks for any help.

Try using rebuild/dsss or bud. The libs for SFML probably aren't being linked. You could also do this with dmd, but it's easier with those tools.
Feb 15 2010
parent reply Joel Christensen <joelcnz gmail.com> writes:
Tried bud, it compiled but it filled my command prompt window with 
errors when I tried running it. When trying to run it it came up with 
'not a Win32 program'. I tried using ReBuild, but it didn't even compile.

(forgot about subject)
Mar 02 2010
next sibling parent Joel Christensen <joelcnz gmail.com> writes:
Hmm.. didn't know about xfBuild. I've tried it and it worked (on my 
game). Thanks Trass3r.

I'm not sure about compiling the latest csfml dlls.

Now I don't know what I'm doing :-/. Maybe later take another look.
Mar 03 2010
prev sibling parent reply Joel Christensen <joelcnz gmail.com> writes:
Trass3r wrote:
 Btw, xfBuild is better.

I've been trying xfBuild and have now found that I can't write to the command prompt, and there doesn't seem to be any flag to activate to do it. It seems faster though.
Mar 04 2010
parent reply Joel Christensen <joelcnz gmail.com> writes:
Trass3r wrote:
 Maybe he is looking for a way to pass some custom arguments to DMD and 
 couldn't find a way to do so via xfBuild?

compiler arguments are passed just as normal.

For example: writefln("Hello"); Wasn't having any effect. Seems to be working now though. But now I have other problems. If I put.. Start source: module xft; import std.stdio; void main() { writefln("Hello xfbuild World!"); } Finish source.


Thread 1: compiling 1 modules Thread 0: compiling 0 modules Error: unrecognized switch '-deps=xft.moduleDeps' Build failed: "dmd xfbuild.1660e00.rsp" returned 1 << And with Tango, using my one source code file and with the option +o it doesn't work. But every thing works with a bigger program, (only tried one though).
Mar 05 2010
parent Trass3r <un known.com> writes:
 C:\Jpro\dpro\small>xfbuild xft.d
 Thread 1: compiling 1 modules
 Thread 0: compiling 0 modules
 Error: unrecognized switch '-deps=xft.moduleDeps'
 Build failed: "dmd  xfbuild.1660e00.rsp" returned 1
 

Yeah it still has its quirks. Feel free to contact the authors/file an issue/etc.
Mar 08 2010
prev sibling next sibling parent Trass3r <un known.com> writes:
 Tried bud, it compiled but it filled my command prompt window with  
 errors when I tried running it. When trying to run it it came up with  
 'not a Win32 program'. I tried using ReBuild, but it didn't even compile.

Btw, xfBuild is better. My script simply looks like: xfbuild main.d +obin\OpenBB-d -debug -g cv2pdb -D2 bin\OpenBB-d.exe // for debugging also be sure to properly compile the latest csfml dlls. It seems like you can't use static CSFML libraries for this.
Mar 02 2010
prev sibling next sibling parent Trass3r <un known.com> writes:
 I'm not sure about compiling the latest csfml dlls.
 Now I don't know what I'm doing :-/. Maybe later take another look.

Well DSFML is just a wrapper around CSFML (which in turn is a C wrapper around SFML :D but hell, there's no other way except a complete port) So you need the CSFML shared libraries and since there are no prebuilt versions you need to compile them yourself. Works flawlessly with Visual Studio 2008 on Windows for me.
Mar 03 2010
prev sibling next sibling parent Trass3r <un known.com> writes:
 I've been trying xfBuild and have now found that I can't write to the  
 command prompt, and there doesn't seem to be any flag to activate to do  
 it.

Don't understand what you mean.
Mar 04 2010
prev sibling next sibling parent "Denis Koroskin" <2korden gmail.com> writes:
On Thu, 04 Mar 2010 15:48:19 +0300, Trass3r <un known.com> wrote:

 I've been trying xfBuild and have now found that I can't write to the  
 command prompt, and there doesn't seem to be any flag to activate to do  
 it.

Don't understand what you mean.

Maybe he is looking for a way to pass some custom arguments to DMD and couldn't find a way to do so via xfBuild?
Mar 04 2010
prev sibling parent Trass3r <un known.com> writes:
 Maybe he is looking for a way to pass some custom arguments to DMD and  
 couldn't find a way to do so via xfBuild?

compiler arguments are passed just as normal.
Mar 04 2010