It is just a modified tutorial: "3D Objects" with a different model and the code I showed before.
// Dark GDK - The Game Creators - www.thegamecreators.com
// 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 );
// load a model for our sky
dbLoadObject ( "skybox2.x", 2 );
dbSetObjectLight ( 2, 0 );
dbSetObjectTexture ( 2, 3, 2 );
dbScaleObject ( 2, 5000, 5000, 5000 );
dbSync ( );
//dbLoadObject ( "Colonel-X.X", 1);
dbLoadObject ( "office extrude scale joined.x", 1 );
dbSetObjectCull(1, 0);
dbScaleObject ( 1, 5000, 5000, 5000 );
dbPositionCamera ( 0, 50, -80 );
//dbLoopObject ( 1 );
//dbSetObjectSpeed ( 1, 40 );
// camera variables
float fCameraAngleX = 0.0f;
float fCameraAngleY = 0.0f;
float fCameraPosX = dbCameraPositionX (0);
float fCameraPosY = dbCameraPositionY (0);
float fCameraPosZ = dbCameraPositionZ (0);
char buffer[800];
// our main loop
while ( LoopGDK ( ) )
{
fCameraPosX = dbCameraPositionX ();
fCameraPosY = dbCameraPositionY ();
fCameraPosZ = dbCameraPositionZ ();
dbSetCursor ( 0, 0 );
sprintf(buffer, "x:%f, y:%f, z:%f",fCameraPosX,fCameraPosY,fCameraPosZ);
dbPrint(buffer);
// move the camera using the arrow keys
dbControlCameraUsingArrowKeys ( 0, 1.0, 0.3f );
// create a rotation axis based on mouse movement
fCameraAngleX = dbWrapValue ( fCameraAngleX + dbMouseMoveY ( ) * 0.4f );
fCameraAngleY = dbWrapValue ( fCameraAngleY + dbMouseMoveX ( ) * 0.4f );
// rotate camera
dbXRotateCamera ( fCameraAngleX );
dbYRotateCamera ( fCameraAngleY );
// update the screen
dbSync ( );
}
// return back to windows
return;
}
And it is definitely the "buffer". When I comment the 3 occurrences out I dont get the overflow.
The strange thing is, that I get it on exit. Not when I write in the buffer.