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

Author Topic: getting started DSFML?  (Read 41603 times)

0 Members and 1 Guest are viewing this topic.

michaelp

  • Newbie
  • *
  • Posts: 18
    • View Profile
getting started DSFML?
« on: August 21, 2008, 12:00:25 am »
Okay, so I'd like to know what I have to do to get DSFML working with D.
Right now, I have DMD 1.034, without anything else installed. (No Derelict, dsss, build, etc )
On the download page, I saw the download for D. Is that all I need to download to get DSFML working with D? Or do I need some of the other packages too?
Also, are there any tutorials, or am I just gonna have to learn from the samples that are provided?
Thanks in advance.
-michaelp

edit: I'm on Windows XP SP2, if that matters.
D Programming Language

SirJulio

  • Full Member
  • ***
  • Posts: 241
    • View Profile
getting started DSFML?
« Reply #1 on: August 21, 2008, 12:46:19 am »
Hi Michael,

DSFML is a wrapper written 'from scratch' (except Tango or Phobos of course), I choose to not use Derelict so you don't need it. All you need is a minimal D environment (aka dmd and phobos | tango)

For DSSS, you could actually use DSFML without it but i hope you like very long compiler command line =p

To start using DSFML, i recommend to download DSSS, place it in your dmd folder, and install DSFML in a folder on your hdd. You can build samples by typing "dsss build" in the samples folder of dsfml.

Using DSFML with rebuild/DSSS is pretty easy, just create a dsss.conf file in the root directory of your project and add this in it :

Code: [Select]
[yourMainFile.d]
buildflags += -I{{path of the dsfml import folder}} -S{{path of dsfml/extlibs/lib folder}}


To build your project, dsss build and that's all. =) Don't forget to paste the CSFML dll with your application.

I've written a tutorial in french for DSFML installation, i will translate it as soon as i'm back from vacation. For other tutorial, you can see the C++ SFML tutorial, i try to keep the same API of the original SFML (except for pointer + size function type which is replaced by dynamic array and other stuff : see the doc included for precision).

NB : I haven't tested yet DSFML with dmd 1.034 (and vector "SSEed" operation etc), but you shouldn't have any problem.

michaelp

  • Newbie
  • *
  • Posts: 18
    • View Profile
getting started DSFML?
« Reply #2 on: August 21, 2008, 01:21:37 am »
Okay thanks, I'll edit this post when I've done all that.
And the only thing I need to download is the D libraries, right?
And I live in Ontario, so I know some French. :P

edit: 2 quick questions:
When you said download DSSS, did you mean:

dsss-0.75-dmd-win.zip

or:

dsss-0.75.zip

from:

http://svn.dsource.org/projects/dsss/downloads/0.75/


And, a question about the conf file you told me to make:
Code: [Select]
[yourMainFile.d]
buildflags += -I{{path of the dsfml import folder}} -S{{path of dsfml/extlibs/lib folder}}


Do I keep the curly brackets, and is do I leave buildflags as it is, or do I have to actually put something there?
And when I put the DSSS files in my dmd folder, I overwrite the folders right?
All for now,
-michaelp
D Programming Language

SirJulio

  • Full Member
  • ***
  • Posts: 241
    • View Profile
getting started DSFML?
« Reply #3 on: August 21, 2008, 05:20:19 pm »
Yes, the only thing needed is the DSFML libs.

For DSSS, i can't remember but i thing dsss-0.75-dmd-win is the correct one.

For conf file, the pattern of buildflags variables is the same than the compiler command line (here you don't paste double braces just insert your path instead eg. :

Code: [Select]
[yourMainFile.d]
buildflags += -Ic:\blabla\DSFML\import -Sc:\blabla\DSFML\extlibs\lib


[] characters mean something for dsss that's why i used {{}}, see here =)

For dsss install, dsss doesn't change any file in your D folder (well, when i install it myself =p), i you prefer you can install wherever you want, just make sure dmd executables (D compiler) and rebuild/DSSS executables is reachable through the path system variable (windows config panel => System => advanced => environment variables => system variable => PATH)

michaelp

  • Newbie
  • *
  • Posts: 18
    • View Profile
getting started DSFML?
« Reply #4 on: August 21, 2008, 07:53:56 pm »
Okay, so SFML and DSSS are now installed.
Next thing:
I've got the pong example compiling, and a test piece of code that I found in the documentation. But, when I run the program, I get an Access Violation error. No line, just says access violation.
I have the .dlls in the folder, but I get an access violation error.
Could this be due to me having DMD 1.034?

edit: I got rid of the access violation error by adding some build flags.
But, pong and the test example still don't work.
Other ones do though. :S
For the ones that don't work, I quickly see a Window pop up, then close.
D Programming Language

SirJulio

  • Full Member
  • ***
  • Posts: 241
    • View Profile
getting started DSFML?
« Reply #5 on: August 21, 2008, 08:30:13 pm »
hmmm, hard to say with a simple violation. Maybe problem come from 1.34, maybe not (=D)...

Try to install ddbg (actually the only efficient debugger for D) and compile sample in debug (just "dsss build -g -debug -full" for building the sample).

After that, go to the bin folder (where sample executables is located) and in a console : ddbg pong. Run the debuggee with "r" in the prompt and paste here the console output (not the loaded module and dll). Callstack can be output with "us".

NB : i'm sorry to ask you all of that, but i can't do it myself currently. =)


edit :

by curiosity, what buildflags have you added ?

edit2 :

Launch your sample by using a console (not double clicking executable), like that you can see any path, or other errors as the console didn't vanish after an error. =)

michaelp

  • Newbie
  • *
  • Posts: 18
    • View Profile
getting started DSFML?
« Reply #6 on: August 21, 2008, 08:38:03 pm »
-L/EXETYPE:NT -L/SUBSYSTEM:WINDOWS
First thing that I tried was making my own dsss.conf file in the pong/test folders, then I added that cuz I saw it in the .conf file that compiles all of the test examples, outside of the samples folder.

DSFML\SFML-1.3\DSFML\samples\dsfml

There is .conf file in there, which is what I am referring to.
Will install the debugger.

Also, just saw your edit as making the reply. There is no console output when I launch it from the console, will get some screens ASAP.

edit: Here comes the debug stuff...
This is what happened when I got the debug stuff for the test file: (BTW, this is the code that is in the release notes, it is under quick start.)

Code: [Select]
C:\D\DSFML\samples\dsfml\test>ddbg test
Ddbg 0.11.3 beta - D Debugger
Copyright (c) 2007 Jascha Wetzel
see http://ddbg.mainia.de/doc.html for documentation

Loading symbols from test.exe
->r
No symbols available from ntdll.dll
ntdll.dll loaded at 0x7c900000
No symbols available from KERNEL32.dll
KERNEL32.dll loaded at 0x7c800000
No symbols available from csfml-graphics.dll
csfml-graphics.dll loaded at 0x10000000
No symbols available from WINMM.dll
WINMM.dll loaded at 0x76b40000
No symbols available from USER32.dll
USER32.dll loaded at 0x77d40000
No symbols available from GDI32.dll
GDI32.dll loaded at 0x77f10000
No symbols available from ADVAPI32.dll
ADVAPI32.dll loaded at 0x77dd0000
No symbols available from RPCRT4.dll
RPCRT4.dll loaded at 0x77e70000
No symbols available from OPENGL32.dll
OPENGL32.dll loaded at 0x5ed00000
No symbols available from msvcrt.dll
msvcrt.dll loaded at 0x77c10000
No symbols available from GLU32.dll
GLU32.dll loaded at 0x68b20000
No symbols available from DDRAW.dll
DDRAW.dll loaded at 0x73760000
No symbols available from DCIMAN32.dll
DCIMAN32.dll loaded at 0x73bc0000
No symbols available from csfml-window.dll
csfml-window.dll loaded at 0x00330000
No symbols available from csfml-system.dll
csfml-system.dll loaded at 0x00390000
Unknown breakpoint hit at ntdll.dll (0x7c901230) thread(548)
No symbols available from DINPUT.dll
DINPUT.dll loaded at 0x72280000
No symbols available from HID.DLL
HID.DLL loaded at 0x688f0000
No symbols available from SETUPAPI.dll
SETUPAPI.dll loaded at 0x77920000
No symbols available from WINTRUST.dll
WINTRUST.dll loaded at 0x76c30000
No symbols available from CRYPT32.dll
CRYPT32.dll loaded at 0x77a80000
No symbols available from MSASN1.dll
MSASN1.dll loaded at 0x77b20000
No symbols available from IMAGEHLP.dll
IMAGEHLP.dll loaded at 0x76c90000
No symbols available from MCD32.dll
MCD32.dll loaded at 0x61dd0000
No symbols available from nncore.dll
nncore.dll loaded at 0x02170000
No symbols available from WININET.dll
WININET.dll loaded at 0x771b0000
No symbols available from SHLWAPI.dll
SHLWAPI.dll loaded at 0x77f60000
No symbols available from OLEAUT32.dll
OLEAUT32.dll loaded at 0x77120000
No symbols available from ole32.dll
ole32.dll loaded at 0x774e0000
No symbols available from WS2_32.dll
WS2_32.dll loaded at 0x71ab0000
No symbols available from WS2HELP.dll
WS2HELP.dll loaded at 0x71aa0000
No symbols available from MPR.dll
MPR.dll loaded at 0x71b20000
No symbols available from SHELL32.dll
SHELL32.dll loaded at 0x7c9c0000
No symbols available from COMCTL32.dll
COMCTL32.dll loaded at 0x773d0000
No symbols available from COMCTL32.dll
COMCTL32.dll loaded at 0x5d090000
Unhandled Exception: EXCEPTION_ACCESS_VIOLATION(0xc0000005) at (0x00000000) thre
ad(548)
->us
#0 ?? () at C:\D\DSFML\import\dsfml\graphics\renderwindow.d:68
#1 0x100ac80c in ?? () at C:\D\DSFML\import\dsfml\graphics\renderwindow.d:68 fro
m csfml-graphics.dll
#2 0x100a8dc6 in ?? () at C:\D\DSFML\import\dsfml\graphics\renderwindow.d:68 fro
m csfml-graphics.dll
#3 0x100a4c57 in ?? () at C:\D\DSFML\import\dsfml\graphics\renderwindow.d:68 fro
m csfml-graphics.dll
#4 0x10003ce1 in ?? () at C:\D\DSFML\import\dsfml\graphics\renderwindow.d:68 fro
m csfml-graphics.dll
#5 0x00405a46 in  dsfml.graphics.renderwindow.RenderWindow dsfml.graphics.render
window.RenderWindow._ctor () at C:\D\DSFML\import\dsfml\graphics\renderwindow.d:
68
#6 0x0040307a in _Dmain () at C:\D\DSFML\import\dsfml\graphics\renderwindow.d:66

#7 0x0040956c in _main () from dmain2
#8 0x00422d1d in _mainCRTStartup () from constart
#9 0x7c816d4f in ?? () from KERNEL32.dll
->


Image:



Next is the pong information:
Code: [Select]
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Default>cd c:\d\dsfml\samples\dsfml\pong

C:\D\DSFML\samples\dsfml\pong>ddbg pong
Ddbg 0.11.3 beta - D Debugger
Copyright (c) 2007 Jascha Wetzel
see http://ddbg.mainia.de/doc.html for documentation

Loading symbols from pong.exe
->r
No symbols available from ntdll.dll
ntdll.dll loaded at 0x7c900000
No symbols available from KERNEL32.dll
KERNEL32.dll loaded at 0x7c800000
No symbols available from csfml-window.dll
csfml-window.dll loaded at 0x10000000
No symbols available from WINMM.dll
WINMM.dll loaded at 0x76b40000
No symbols available from USER32.dll
USER32.dll loaded at 0x77d40000
No symbols available from GDI32.dll
GDI32.dll loaded at 0x77f10000
No symbols available from ADVAPI32.dll
ADVAPI32.dll loaded at 0x77dd0000
No symbols available from RPCRT4.dll
RPCRT4.dll loaded at 0x77e70000
No symbols available from OPENGL32.dll
OPENGL32.dll loaded at 0x5ed00000
No symbols available from msvcrt.dll
msvcrt.dll loaded at 0x77c10000
No symbols available from GLU32.dll
GLU32.dll loaded at 0x68b20000
No symbols available from DDRAW.dll
DDRAW.dll loaded at 0x73760000
No symbols available from DCIMAN32.dll
DCIMAN32.dll loaded at 0x73bc0000
No symbols available from csfml-system.dll
csfml-system.dll loaded at 0x00330000
No symbols available from csfml-graphics.dll
csfml-graphics.dll loaded at 0x004b0000
No symbols available from csfml-audio.dll
csfml-audio.dll loaded at 0x00380000
No symbols available from libsndfile-1.dll
libsndfile-1.dll loaded at 0x6f140000
No symbols available from openal32.dll
openal32.dll loaded at 0x00660000
No symbols available from DSOUND.dll
DSOUND.dll loaded at 0x73f10000
No symbols available from ole32.dll
ole32.dll loaded at 0x774e0000
No symbols available from VERSION.dll
VERSION.dll loaded at 0x77c00000
No symbols available from MSVCR80.dll
MSVCR80.dll loaded at 0x78130000
Unknown breakpoint hit at ntdll.dll (0x7c901230) thread(880)
No symbols available from DINPUT.dll
DINPUT.dll loaded at 0x72280000
No symbols available from HID.DLL
HID.DLL loaded at 0x688f0000
No symbols available from SETUPAPI.dll
SETUPAPI.dll loaded at 0x77920000
No symbols available from WINTRUST.dll
WINTRUST.dll loaded at 0x76c30000
No symbols available from CRYPT32.dll
CRYPT32.dll loaded at 0x77a80000
No symbols available from MSASN1.dll
MSASN1.dll loaded at 0x77b20000
No symbols available from IMAGEHLP.dll
IMAGEHLP.dll loaded at 0x76c90000
No symbols available from MCD32.dll
MCD32.dll loaded at 0x61dd0000
No symbols available from nncore.dll
nncore.dll loaded at 0x026d0000
No symbols available from WININET.dll
WININET.dll loaded at 0x771b0000
No symbols available from SHLWAPI.dll
SHLWAPI.dll loaded at 0x77f60000
No symbols available from OLEAUT32.dll
OLEAUT32.dll loaded at 0x77120000
No symbols available from WS2_32.dll
WS2_32.dll loaded at 0x71ab0000
No symbols available from WS2HELP.dll
WS2HELP.dll loaded at 0x71aa0000
No symbols available from MPR.dll
MPR.dll loaded at 0x71b20000
No symbols available from SHELL32.dll
SHELL32.dll loaded at 0x7c9c0000
No symbols available from COMCTL32.dll
COMCTL32.dll loaded at 0x773d0000
No symbols available from COMCTL32.dll
COMCTL32.dll loaded at 0x5d090000
Unhandled Exception: EXCEPTION_ACCESS_VIOLATION(0xc0000005) at (0x00000000) thre
ad(880)
->us
#0 ?? () at C:\D\DSFML\import\dsfml\graphics\renderwindow.d:68
#1 0x0055c80c in ?? () at C:\D\DSFML\import\dsfml\graphics\renderwindow.d:68 fro
m csfml-graphics.dll
#2 0x00558dc6 in ?? () at C:\D\DSFML\import\dsfml\graphics\renderwindow.d:68 fro
m csfml-graphics.dll
#3 0x00554c57 in ?? () at C:\D\DSFML\import\dsfml\graphics\renderwindow.d:68 fro
m csfml-graphics.dll
#4 0x004b3ce1 in ?? () at C:\D\DSFML\import\dsfml\graphics\renderwindow.d:68 fro
m csfml-graphics.dll
#5 0x00409bf6 in  dsfml.graphics.renderwindow.RenderWindow dsfml.graphics.render
window.RenderWindow._ctor () at C:\D\DSFML\import\dsfml\graphics\renderwindow.d:
68
#6 0x0040408e in _Dmain () at C:\D\DSFML\import\dsfml\graphics\renderwindow.d:66

#7 0x0040def8 in _main () from dmain2
#8 0x004300ad in _mainCRTStartup () from constart
#9 0x7c816d4f in ?? () from KERNEL32.dll
->


And images:


This shows that no messages popped up when I ran the program from the command prompt.



Next:


This is what happened when I first typed 'r' for the pong debugging. As you can see, there is an error there.


And finally:


When I typed 'us', what came up afterwards.


As you can see in some of the images, there is something on the Windows bar, but there is no actual window that shows up.
Hope this helps,
-michaelp
D Programming Language

SirJulio

  • Full Member
  • ***
  • Posts: 241
    • View Profile
getting started DSFML?
« Reply #7 on: August 21, 2008, 11:09:15 pm »
That's weird, I try download 1.034 and compile all samples, and all works fine.

The only difference, I can find from your log is that msvcr71.dll is not loaded for your application. Have you an other computer where you can test your executable ? Did you past the release notes code without modification ?

michaelp

  • Newbie
  • *
  • Posts: 18
    • View Profile
getting started DSFML?
« Reply #8 on: August 22, 2008, 12:25:12 am »
Okay, I just tested it on the computer I am currently on(the other one does not have internet, and is quite old, but it has worked for me up till now), and the pong sample worked fine.
I can test it on 2 other computers too.
And I did not make any modifications to the release logs.
I have disabled lots of services on the computer, could that be a possible reason why that dll isn't being loaded?
Should I go up to SP3? ( :P )

edit: Right now, I'm scanning\searching the computer that the pong works on for msvcr71.dll. I'll also scan for that on the other one, and see if it is the C:\WINDOWS\system32 path, cuz it's in lots of places on this computer. :P
D Programming Language

SirJulio

  • Full Member
  • ***
  • Posts: 241
    • View Profile
getting started DSFML?
« Reply #9 on: August 22, 2008, 12:32:07 am »
Good news (actually for me =p).

Deactivation of service may be the origin of the problem (don't ask me how), try to reactivate what you just disable to see if that change anything. You could also try to repair your system file (and/or install SP3).

Good luck and let me know if you have any issue with DSFML. =)

michaelp

  • Newbie
  • *
  • Posts: 18
    • View Profile
getting started DSFML?
« Reply #10 on: August 22, 2008, 12:50:25 am »
How would I repair my system files? Any easy thing to do? Or should I just install SP3?
And when I searched for the msvcr71.dll file, it was in the WINDOWS\system32 folder, so it's there. :|

Also, just tried activating a lot of services, then playing pong, but no luck.  :?

edit: I'm installing SP3 right now. :P
And it didn't work.  :(
So, this repairing system files thing, good idea?  :wink:
D Programming Language

SirJulio

  • Full Member
  • ***
  • Posts: 241
    • View Profile
getting started DSFML?
« Reply #11 on: August 22, 2008, 05:21:32 pm »
I don't know, i never had to use it. =)

Maybe the problem is not related to msvcr71.dll, that's the problem sometimes with windows : all goes wrong, but you don't know why or how ....

"Good luck" =)

michaelp

  • Newbie
  • *
  • Posts: 18
    • View Profile
getting started DSFML?
« Reply #12 on: August 22, 2008, 06:42:27 pm »
Well, I've got this problem posted on the D newsgroups, so I hope that they will be able to help me.
The only thing that doesn't work is the windows, some of the things that ran from the console worked okay, but the when it came to windows, nope.
Anyways, thanks for all the help. At least I've got a debugger and DSSS set up now. :D
D Programming Language

michaelp

  • Newbie
  • *
  • Posts: 18
    • View Profile
getting started DSFML?
« Reply #13 on: August 23, 2008, 03:26:26 am »
Sorry for double post, but I just tried it on one of the other computers in our house, and it didn't work there either. :|
Could it be hardware related since the computers it doesn't work on are quite a bit older?
And I am gonna try it on the last computer in our house, and see if it works. That computer is the newest one in our house.
D Programming Language

SirJulio

  • Full Member
  • ***
  • Posts: 241
    • View Profile
getting started DSFML?
« Reply #14 on: August 23, 2008, 06:30:51 pm »
Maybe the age of your computer could be the problem.

Try to download and compile CSFML 1.3 on your computer (first compile SFML in release static and after that compile CSFML in release DLL, you can keep *.lib provided with DSFML to link).

You can also try to compile a sample project of C++ SFML to see if you can reproduce the problem (it seems that the problem is not related to D binding, error happens in the C or C++ dll).