Here is a little example i did with your snippet:
#include "DarkGDK.h"
int iObject = 1;
float fAngleX;
float fTargetAngleX;
float fAngleXDifference;
void Initialize();
void ShowInfo(int iX,int iY);
void Float2Text(int iX,int iY,float fValue);
void RotateCameraAngleX(float fIncrement);
void DarkGDK ( void )
{
dbSyncOn ( );
dbSyncRate ( 60 );
Initialize();
while ( LoopGDK ( ) )
{
ShowInfo(10,10);
if(dbSpaceKey())
RotateCameraAngleX(0.5f);
dbSync ( );
}
return;
}
void Initialize()
{
dbMakeObjectBox(iObject,8,4,4);
fAngleX= dbCameraAngleX();
fTargetAngleX = 270;
}
void ShowInfo(int iX,int iY)
{
Float2Text(iX,iY,dbCameraAngleX());
Float2Text(iX,iY+20,fAngleX);
Float2Text(iX,iY+30,fTargetAngleX);
}
void Float2Text(int iX,int iY,float fValue)
{
char* pstrTemp;
pstrTemp = dbStr(fValue);
dbText(iX,iY,pstrTemp);
delete pstrTemp;
}
void RotateCameraAngleX(float fIncrement)
{
fAngleXDifference = dbAbs(fTargetAngleX - fAngleX);
if(fAngleXDifference < 180)
{
if(fTargetAngleX>fAngleX) fAngleX+=fIncrement;
if(fTargetAngleX<fAngleX) fAngleX-=fIncrement;
}
else if(fAngleXDifference > 180)
{
if(fTargetAngleX>fAngleX) fAngleX-=fIncrement;
if(fTargetAngleX<fAngleX) fAngleX+=fIncrement;
}
dbRotateCamera(fAngleX,dbCameraAngleY(),dbCameraAngleZ());
fAngleX=dbWrapValue(fAngleX);
}