Here is my all code... please identify error
#include "DarkGDK.h"
#include "SC_Collision.h"
int fCameraAngleX;
int fCameraAngleY;
float cX=51.7;
float cY=1.75;
float cZ=7.6;
void mouse(void);
void animateObject(int ID, int startFrame, int endFrame)
{
int curFrame = dbObjectFrame(ID);
if (curFrame < startFrame)
{
curFrame = startFrame;
}
else
{
++curFrame;
if (curFrame > endFrame) curFrame = startFrame;
}
dbSetObjectFrame(ID, curFrame);
}
void LoadMap()
{
dbLoadBSP ( "media//maps//DangerCity//Dangercity.pk3", "Dangercity.bsp" );
dbSetBSPCameraCollision ( 1, 0, 1.15, 0 );
}
void LoadPlayer()
{
dbLoadObject("media//Objects//fire2.x",10);
//dbPositionObject(10,51.7,1.25,7.6);
dbSetObjectFrame(10,70);
SC_SetupObject(10,0,1);
}
void LoadSky()
{
dbLoadObject ( "media//sky//skybox2.x", 2 );
dbSetObjectLight ( 2, 0 );
dbSetObjectTexture ( 2, 3, 2 );
dbScaleObject ( 2, 5000, 5000, 5000 );
}
void DarkGDK ( void )
{
dbSyncOn();
dbSyncRate(60);
//postion of spawn only for map DayAfter
//dbPositionCamera(cX,cY,cZ);
dbAutoCamOff();
LoadMap();
LoadSky();
SC_Start();
//dbMaximizeWindow();
//dbSetWindowOff();
LoadPlayer();
dbHideMouse();
dbLockObjectOn(10);
int prevTime = dbTimer();
int frameTime = 0;
/*int Desktop_Width;
int Desktop_Height;
int Dekstop_Depth = 32;
Desktop_Width=GetSystemMetrics(0);
Desktop_Height=GetSystemMetrics(1);
dbSetDisplayMode(Desktop_Width,Desktop_Height,Dekstop_Depth);
dbSetWindowOff();*/
while (LoopGDK( ) )
{
int curTime = dbTimer();
if (curTime - prevTime > frameTime)
{
prevTime = curTime;
animateObject(10, 1, 320);
// possible: animateObject(2, 64, 78);
}
//display and update the position of camera + Object
dbPrint(dbStr(dbCameraPositionX(0)));
dbPrint(dbStr(dbCameraPositionY(0)));
dbPrint(dbStr(dbCameraPositionZ(0)));
dbPrint(dbStr(dbTotalObjectFrames(10)));
dbSync ( );;
mouse();
//dbControlCameraUsingArrowKeys(0, 2.0f, 2.0f);
}
return;
}
void mouse(void)
{
if (dbKeyState (17))//(dbUpKey())
{
dbMoveCamera(0.05);
}
if (dbKeyState (31))//(dbDownKey())
{
dbMoveCamera(-0.05);
}
if (dbKeyState (30))//(dbLeftKey())
{
dbYRotateCamera ( 0 , dbCameraAngleY( 0 ) - 90 );
dbMoveCamera(0.05);
}
if (dbKeyState (32))//(dbRightKey())
{
dbYRotateCamera ( 0 , dbCameraAngleY( 0 ) + 90 );
dbMoveCamera(0.05);
}
fCameraAngleX = dbWrapValue ( fCameraAngleX + dbMouseMoveY ( ) * 0.3f );
fCameraAngleY = dbWrapValue ( fCameraAngleY + dbMouseMoveX ( ) * 0.3f );
//rotate camera
dbXRotateCamera ( fCameraAngleX );
dbYRotateCamera ( fCameraAngleY );
}