View previous topic :: View next topic |
Author |
Message |
RedShft
Joined: 15 Feb 2012 Posts: 12
|
Posted: Fri Feb 24, 2012 1:09 pm Post subject: New to Derelict2, some Guidance Please! |
|
|
Hey everyone,
I've been learning D for a while, and I wanted to use SDL as a way to improve my skills with D in a fun way.
I currently have derelict2 so would this be the proper way to import and initialize SDL?
Code: |
import derelict2.sdl.sdl
void main()
{
DerelictSDK.Load();
//SDL Setup and everything else here
}
|
What version of SDL is in Derelict2?
Also, is SDLImage, SDLTTF, etc included?
Thank you for your time. |
|
Back to top |
|
|
mweber1488
Joined: 10 Jun 2008 Posts: 15
|
Posted: Fri Feb 24, 2012 2:02 pm Post subject: |
|
|
It would be more along the lines of:
Code: | import derelict.sdl.sdl;
void main()
{
DerelictSDL.load;
//now run your SDL code
} | The version of SDL is the version that you download. You have to go to SDL's website and download the library yourself. |
|
Back to top |
|
|
RedShft
Joined: 15 Feb 2012 Posts: 12
|
Posted: Fri Feb 24, 2012 2:22 pm Post subject: |
|
|
Right, small typo on my part. I meant to type DerelictSDL
Thanks for clearing up the part about downloading SDL.
After downloading SDL, does it matter where I put the files?
I mean, do I need to put the SDL files in C:\Dlang\dmd2\src\SDL (if this was my install directory for D.
or, Do I simply need to reference the library files in my VS2010 project linker properties? |
|
Back to top |
|
|
mweber1488
Joined: 10 Jun 2008 Posts: 15
|
Posted: Fri Feb 24, 2012 2:29 pm Post subject: |
|
|
All you need to do is put the .dll file into the working directory of the program or into your system32 folder. Derelict takes care of the rest. |
|
Back to top |
|
|
mutable
Joined: 22 Jun 2010 Posts: 87
|
Posted: Fri Feb 24, 2012 3:45 pm Post subject: |
|
|
The current version of DerelictSDL is the last stable version of SDL 1.2.
If you would use SDL 2.0 (1.3) use Derelict3. |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Sat Feb 25, 2012 5:54 am Post subject: Re: New to Derelict2, some Guidance Please! |
|
|
RedShft wrote: | Hey everyone,
I've been learning D for a while, and I wanted to use SDL as a way to improve my skills with D in a fun way.
I currently have derelict2 so would this be the proper way to import and initialize SDL? |
In addition to what the others said, you need to make sure you link to both the DerelictSDL and DerelictUtil libraries. They will end up in the (Derelict Directory)/lib folder after you build Derelict.
Quote: |
What version of SDL is in Derelict2? |
DerelictSDL is up to date with the latest SDL 1.2.15.
Quote: |
Also, is SDLImage, SDLTTF, etc included? |
Yes, all of the satellite libraries have bindings. You will need to import, load and link with them separately. Example:
Code: |
import derelict.sdl.sdl;
import derelict.sdl.image;
import derelict.sdl.mixer;
void main()
{
DerelictSDL.load();
DerelictSDLImage.load();
DerelictSDLMixer.load();
}
|
Although the documentation for all of Derelict 2 is incomplete, the important stuff (how to load the shared libraries, how to compile Derelict, and what to link with) is all there. The DerelictSDL docs are all there, too, detailing how to load each SDL satellite libraries. _________________ The One With D | The One With Aldacron | D Bits |
|
Back to top |
|
|
|