Hayer:
What are you talking about? The sync isn't "outside", it's right inside his main loop.
jontepd, the problem is that every time you call dbPlayObject( ) it resets the object back to its first frame. You need to call it once when you want to start the animation:
#include "DarkGDK.h"
bool isPlaying = false;
// 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 );
dbLoadObject("test.x", 1);
dbPositionCamera(0,20,-100);
// our main loop
while ( LoopGDK ( ) )
{
if (dbShiftKey())
{
dbMoveObject(1, 0.2);
if ( isPlaying == false ) {
isPlaying = true;
dbPlayObject( 1 );
}
}
else {
isPlaying = false;
dbStopObject( 1 );
}
// update the screen
dbSync ( );
}
// return back to windows
return;
}