When you do this:
void makeObjects ( void ); //This my function
you're not actually calling the function, you're just declaring it. You should take that declaration out of the DarkGDK() function and add this:
So you're new code would look like this:
#include "DarkGDK.h"
void makeObjects ( void ); //This my function
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 0 );
dbRandomize ( dbTimer ( ) );
makeObjects();
dbPositionCamera ( 10, 10, -20 );
while ( LoopGDK ( ) )
{
dbText ( 0, 0, "Use the up and down arrow keys to move the camera" );
if ( dbUpKey ( ) )
dbMoveCamera ( 1 );
if ( dbDownKey ( ) )
dbMoveCamera ( -1 );
for ( int i = 1; i < 50; i++ )
dbRotateObject ( i, dbObjectAngleX ( i ) + 0.1, dbObjectAngleY ( i ) + 0.2, dbObjectAngleZ ( i ) + 0.3 );
dbSync ( );
}
for ( int i = 1; i < 50; i++ )
dbDeleteObject ( i );
return;
}
void makeObjects ( void ) // This is the original code put into a function.
{
for ( int i = 1; i < 50; i++ )
{
dbMakeObjectSphere ( i, 1 );
dbPositionObject ( i, dbRnd ( 20 ), dbRnd ( 20 ), dbRnd ( 20 ) );
dbScaleObject ( i, 100 + dbRnd ( 400 ), 100 + dbRnd ( 400 ), 100 + dbRnd ( 400 ) );
dbColorObject ( i, dbRgb ( dbRnd ( 255 ), dbRnd ( 255 ), dbRnd ( 255 ) ) );
dbSetObjectSpecularPower ( i, 255 );
dbSetObjectAmbient ( i, 0 );
}
}
i like orange