FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

New to Derelict2, some Guidance Please!

 
Post new topic   Reply to topic     Forum Index -> Derelict
View previous topic :: View next topic  
Author Message
RedShft



Joined: 15 Feb 2012
Posts: 12

PostPosted: Fri Feb 24, 2012 1:09 pm    Post subject: New to Derelict2, some Guidance Please! Reply with quote

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
View user's profile Send private message
mweber1488



Joined: 10 Jun 2008
Posts: 15

PostPosted: Fri Feb 24, 2012 2:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
RedShft



Joined: 15 Feb 2012
Posts: 12

PostPosted: Fri Feb 24, 2012 2:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
mweber1488



Joined: 10 Jun 2008
Posts: 15

PostPosted: Fri Feb 24, 2012 2:29 pm    Post subject: Reply with quote

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
View user's profile Send private message
mutable



Joined: 22 Jun 2010
Posts: 87

PostPosted: Fri Feb 24, 2012 3:45 pm    Post subject: Reply with quote

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
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Sat Feb 25, 2012 5:54 am    Post subject: Re: New to Derelict2, some Guidance Please! Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Derelict All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group