digitalmars.D.announce - dmedia.dprogramming.com - two new tutorials
- Tom S (15/15) May 07 2006 I have written two new tutorials for DMedia
- Hasan Aljudy (7/21) May 07 2006 Nice! I just started reading, and noticed you're using toStringz for
- Tom S (18/26) May 07 2006 Please, please, please read the whole thing before you write comments
- Hasan Aljudy (3/28) May 07 2006 oops, my mistake.
- Jarrett Billingsley (6/10) May 07 2006 That works because string literals in D are implicitly null-terminated,
- Jarrett Billingsley (3/7) May 07 2006 Damn crossposted topic. I hate these.
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/ContactNice! 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:oops, my mistake. I apologize :(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.`
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 07 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 workThanks ! :) -- -----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
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 ;)Sadly this seems to be the case, I hate Geometry but like 3D how much does that suck? ;)I had to do a Geometry refresh for tutorial 3 :) .That's pretty inevitable when doing 3d graphics ;)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
May 09 2006
DBloke wrote:Looking good so far ;)Thanks. But as I said, these tutorials need more love anyway ;)Depends on what kind of geometry you hate... I didn't enjoy the geometry I had at school very much, but the stuff you use for 3d graphics can get really interesting. And there's a big difference between learning for yourself and learning for the classes. It shouldn't be very hard to get comfortable with the basics required for some cool 3d apps :)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? ;)That might be a good idea, yet I think that introducing more basics before taking on a game will be a wise move ;)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?Like if there were many comments ! :P I didn't have the time to comment for this project :> and considering that it would need it for just a moment, it wasn't really worth it :) I've got the experience from writing it and it's enough hehe :) But as for the humor in naming conventions - I couldn't stand writing dull code ;D -- -----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 +/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.
May 10 2006