Jump to page: 1 2
Thread overview
dmedia.dprogramming.com - two new tutorials
May 07, 2006
Tom S
May 07, 2006
Hasan Aljudy
May 07, 2006
Tom S
May 07, 2006
Hasan Aljudy
May 07, 2006
Tom S
May 08, 2006
DBloke
May 08, 2006
Tom S
May 09, 2006
DBloke
May 10, 2006
Tom S
May 07, 2006
I have written two new tutorials for DMedia
( http://dmedia.dprogramming.com/ )

- Getting started with OpenGL - creating a window
- Drawing basic primitives using OpenGL

Grab them while they're hot ;)


Disclaimer: I'm not a native speaker so if you encounter any language errors, please report them to the email given in the Contact section: http://dmedia.dprogramming.com/Main/Contact


-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d-pu s+: a-->----- C+++$>++++ UL P+ L+ E--- W++ N++ o? K? w++ !O !M V? PS- PE- Y PGP t 5 X? R tv-- b DI- D+ G e>+++ h>++ !r !y
------END GEEK CODE BLOCK------

Tomasz Stachowiak  /+ a.k.a. h3r3tic +/
May 07, 2006
Tom S wrote:
> I have written two new tutorials for DMedia
> ( http://dmedia.dprogramming.com/ )
> 
> - Getting started with OpenGL - creating a window
> - Drawing basic primitives using OpenGL
> 
> Grab them while they're hot ;)
> 
> 
> Disclaimer: I'm not a native speaker so if you encounter any language errors, please report them to the email given in the Contact section: http://dmedia.dprogramming.com/Main/Contact
> 
> 

Nice! I just started reading, and noticed you're using toStringz for strings.
I've tried using SDL with D before, and I noticed that you don't need to use toStringz at all, for example, this works just fine:

SDL_WM_SetCaption("My SDL Window", null);

at least it worked when I tried it.
May 07, 2006
Hasan Aljudy wrote:
> Nice! I just started reading, and noticed you're using toStringz for strings.
> I've tried using SDL with D before, and I noticed that you don't need to use toStringz at all, for example, this works just fine:
> 
> SDL_WM_SetCaption("My SDL Window", null);
> 
> at least it worked when I tried it.

Please, please, please read the whole thing before you write comments like this one :S
Quote from my article:

`But then if you know the D specification inside-out, you might say “Hey, but when the compiler allocates space for string literals, it inserts an additional zero just after that memory range !”. Calm down, please, you can remove the toStringz function call and its associated import if you know what you're doing. But if someone wanted to have a window with some dynamically - generated caption, they would be in some serious trouble.`


-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d-pu s+: a-->----- C+++$>++++ UL P+ L+ E--- W++ N++ o? K? w++ !O !M V? PS- PE- Y PGP t 5 X? R tv-- b DI- D+ G e>+++ h>++ !r !y
------END GEEK CODE BLOCK------

Tomasz Stachowiak  /+ a.k.a. h3r3tic +/
May 07, 2006
Tom S wrote:
> Hasan Aljudy wrote:
> 
>> Nice! I just started reading, and noticed you're using toStringz for strings.
>> I've tried using SDL with D before, and I noticed that you don't need to use toStringz at all, for example, this works just fine:
>>
>> SDL_WM_SetCaption("My SDL Window", null);
>>
>> at least it worked when I tried it.
> 
> 
> Please, please, please read the whole thing before you write comments like this one :S
> Quote from my article:
> 
> `But then if you know the D specification inside-out, you might say “Hey, but when the compiler allocates space for string literals, it inserts an additional zero just after that memory range !”. Calm down, please, you can remove the toStringz function call and its associated import if you know what you're doing. But if someone wanted to have a window with some dynamically - generated caption, they would be in some serious trouble.`
> 
> 

oops, my mistake.
I apologize :(
May 07, 2006
"Hasan Aljudy" <hasan.aljudy@gmail.com> wrote in message news:e3lqt1$2h1f$1@digitaldaemon.com...
> I've tried using SDL with D before, and I noticed that you don't need to use toStringz at all, for example, this works just fine:
>
> SDL_WM_SetCaption("My SDL Window", null);
>
> at least it worked when I tried it.

That works because string literals in D are implicitly null-terminated, although the literal length won't reflect that.  The problem arises when you try to pass in a dynamically created string, which is usually not null-terminated.


May 07, 2006
"Jarrett Billingsley" <kb3ctd2@yahoo.com> wrote in message news:e3lv9h$30du$1@digitaldaemon.com...
> That works because string literals in D are implicitly null-terminated, although the literal length won't reflect that.  The problem arises when you try to pass in a dynamically created string, which is usually not null-terminated.

Damn crossposted topic.  I hate these.


May 07, 2006
Jarrett Billingsley wrote:
> Damn crossposted topic.  I hate these. 

Per one suggestion from some time ago, I postedo to D.announce and D.learn so people can see the announcement and reply to D.learn... Not many do this though, I'll have to include explicit instructions ;)


-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d-pu s+: a-->----- C+++$>++++ UL P+ L+ E--- W++ N++ o? K? w++ !O !M V? PS- PE- Y PGP t 5 X? R tv-- b DI- D+ G e>+++ h>++ !r !y
------END GEEK CODE BLOCK------

Tomasz Stachowiak  /+ a.k.a. h3r3tic +/
May 08, 2006
Tom,
Well done on this site, the tutorials are a little basic but are good for anyone wanting to get started with SDL & OpenGL.

I had to do a Geometry refresh for tutorial 3 :) .

How about in the future a simple but effective 2D or 3D killer Game for D written in D, SDL &| OpenGL?

Keep up the excellent work
DBloke
May 08, 2006
> Tom,
> Well done on this site, the tutorials are a little basic but are good for anyone wanting to get started with SDL & OpenGL.

That's what I intended... I didn't want to send people over to NeHe, especially because I didn't like some of their explanations, like "we're going to discuss it in later tutorials" - expanations never came ;)
My tutorials are still lacking some images and descriptions but I hope I'll get there ;)


> I had to do a Geometry refresh for tutorial 3 :) .

That's pretty inevitable when doing 3d graphics ;)


> How about in the future a simple but effective 2D or 3D killer Game for D written in D, SDL &| OpenGL?

Hmmm... If you have any cool ideas, visit #dmedia on the irc.freenode.net server. I'm just going to sleep (my timezone is GMT+1) but I'll be there tomorrow ;) Maybe making a Pong or something like it would work...

as for a simple (but not simple enough for a tutorial) game:
<shamelessPlug> http://www.mat.uni.torun.pl/~h3r3tic/STFU.zip </shamelessPlug>


> Keep up the excellent work

Thanks ! :)


-- 
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/M d-pu s+: a-->----- C+++$>++++ UL P+ L+ E--- W++ N++ o? K? w++ !O !M V? PS- PE- Y PGP t 5 X? R tv-- b DI- D+ G e>+++ h>++ !r !y
------END GEEK CODE BLOCK------

Tomasz Stachowiak  /+ a.k.a. h3r3tic +/
May 09, 2006
> That's what I intended... I didn't want to send people over to NeHe, especially because I didn't like some of their explanations, like "we're going to discuss it in later tutorials" - expanations never came ;)
> My tutorials are still lacking some images and descriptions but I hope I'll get there ;)
> 
Looking good so far ;)
> 
>> I had to do a Geometry refresh for tutorial 3 :) .
> 
> That's pretty inevitable when doing 3d graphics ;)
> 
Sadly this seems to be the case, I hate Geometry but like 3D how much does that suck? ;)

> Hmmm... If you have any cool ideas, visit #dmedia on the irc.freenode.net server. I'm just going to sleep (my timezone is GMT+1) but I'll be there tomorrow ;) Maybe making a Pong or something like it would work...
Pong could be could, in 3D would be quite interesting no?
> 
> as for a simple (but not simple enough for a tutorial) game:
> <shamelessPlug> http://www.mat.uni.torun.pl/~h3r3tic/STFU.zip </shamelessPlug>

I played this it was simple but effective and could be a great way to do a quiz type thing at the end of a tutorial, the game made me laugh and the comments and assertions in the code made me laugh more, like the sense of humour :) it definitely helps when coding for sure.

> 
> Thanks ! :)
> 

U R Welcome, keep up the work
DBLoke
« First   ‹ Prev
1 2