Dark GDK Experimentation (OScoder's Worklog)

Log of my experiments using Dark GDK RSS Feed

Object class

Hi there!
Since I now have a computer worth running this on, I decided to take a look at DarkGDK, and what it can do. So, today I downloaded everything (visual c++ express, dark gdk, etx), and loaded it up. It'll be nice to try 3D programming with these simple functions, as opposed to the confusingness that is directX.

So, so far I haven't done much, just ported over an old class I used in a gamedev library (yet another failed project :-( ). This should make everything alot less complicated, as it has a functionality similar to DIV. One (virtual) function, frame(), gets called every frame, by the synchronisation function I wrote, which has a linked list of all the objects. Basically, this will mean that instead of putting something like this in my main game loop:
Code:
        for ( int i = 1; i < 50; i++ )
            dbRotateObject ( i, dbObjectAngleX ( i ) + 0.1, dbObjectAngleY ( i ) + 0.2, dbObjectAngleZ ( i ) + 0.3 );


I just put this:
Code:
        frame();


And this in the object class:
Code:
void c_object::frame()
{
  dbRotateObject (    db_object_id,
                    dbObjectAngleX(db_object_id) + 2,
                    dbObjectAngleY(db_object_id) + 0.2,
                    dbObjectAngleZ(db_object_id) + 0.3);
}


Just imagine how much simpler this will make things when I have multiple types of object that may or may not need running! The frame method is virtual as well, so I should be able to derive all my other classes from it too!

How good.
OScoder
(Posted on July, 6th 2009, 18:13)

Comments


Sandman said:
DarkGDK, eh.
(Posted on July, 7th 2009, 03:23)


DTM said:
good luck!
(Posted on July, 8th 2009, 21:49)

Post New Comment

You must log in or register to post comments.

Copyright © 2005 Booleansoup.com
Questions? Comments? Bug reports? Contact us!