This ought to do what you want:
#include "DarkGDK.h"
void DarkGDK(void)
{
dbSyncOn();
dbSync();
float angleStore;
dbMakeObjectCube(1,5);
while(LoopGDK()){
dbCenterText(dbScreenWidth()/2,100,"Press Any Key to Rotate 90 Degrees");
dbSync();
dbWaitKey();
//The rotation is done like this:
angleStore=dbObjectAngleY(1); //Store current Y angle
while((dbObjectAngleY(1)<angleStore+90)&&(LoopGDK())){ //Start a loop that will run until the object is rotated 90 degrees
dbYRotateObject(1,dbObjectAngleY(1)+1); //Set the object's angle to its current value plus one
dbSync(); //Update the screen
}
//These two lines are just to clean up the angle, so that it doesn't get too large
while(dbObjectAngleY(1)>360)dbYRotateObject(1,-360);
while(dbObjectAngleY(1)<=0)dbYRotateObject(1,360);
}
dbWaitKey();
return;
}
I commented it well enough that you should be able to figure it out, but if you are still confused about something, just ask.
Oh, I see you wanted it as a function. That raises a couple of questions. Do you want the program to halt and wait for the object to rotate, or do you want to continue running while it does so?
My site, for various stuff that I make.