Creating a plain object in DarkGDK

Posted by Rey Dacoco in

A plain is a mesh object that can be used as ground in your game scene. To create a plain object, use the dbMakeObjectPlain function.


dbMakeObjectPlain(object id,plain width,plain height);


By default an object is drawn in gray. You can add colors to your plain object by Using the dbColorObject function which has the following syntax:

dbColorObject(object id, color);

Colors can be defined by using the dbRGB function which has the following syntax:


Wherein red, green, and blue are numbers that ranges from 0-255.

The following codes demonstrates dbMakeObjectPlain and dbColorObject at work:

// Dark GDK - The Game Creators -

// the wizard has created a very simple project that uses Dark GDK
// it contains the basic code for a GDK application

// whenever using Dark GDK you must ensure you include the header file
#include "DarkGDK.h"

// the main entry point for the application is this function
void DarkGDK ( void )
// turn on sync rate and set maximum rate to 60 fps
dbSyncOn   ( );
dbSyncRate ( 60 );
//Creates a 400 X 200 plain object with an object id of 1 and 
//Applies a red color to our plain
//Positions the camera on the side of our object
// our main loop
while ( LoopGDK ( ) )
// update the screen
dbSync ( );
//deletes all objects
for ( int i = 1; i < 50; i++ )
dbDeleteObject ( i );
// return back to windows


Post a Comment


My photo
I am just a simple man with a simple mind. And this is my simple blog. New Posts will be available soon. Enjoy reading and never stop learning:)

Total Pageviews

Link List


Got questions? You can reach me here: