Anyone here familliar with Dark GDK?
Im playing around with a tutorial attempting to allow keyboard interaction (arrow keys) as well as the mouse
I got it working and then when I opened it again it didnt. Sounds weird I cant explain it as if it works once it should always work. also the code for the arrow keys is only for foward and back (i pinched the keyboard code out of another tutorial) If someone could clue me in on how to put a strafe function in i would be greatful
*** This is not my homework im unemployed and about to do a truck driving course ***
This is my hobby
here is the code
CODE
// 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 );
// Loading the media folder
SetCurrentDirectory ( "media" );
dbLoadObject ( "universe.dbo", 1 );
dbSetObjectLight ( 1, 0 );
// creating a skybox
dbLoadObject ( "skybox2.x", 2 );
dbSetObjectLight ( 2, 0 );
dbSetObjectTexture ( 2, 3, 2 );
dbScaleObject ( 2, 5000, 5000, 5000 );
// camera setup
dbPositionCamera ( 434, 42, -517 );
float fCameraAngleX = 0.0f;
float fCameraAngleY = 0.0f;
// our main loop
while ( LoopGDK ( ) )
{
// let the user move the camera around with the arrow keys
// the 1 at the start is for level it was originally 0 and the cam was at feet level
// so i changed it to 1
dbControlCameraUsingArrowKeys ( 1, 0.4f, 0.4f );
// allow the user to use mouse to view 360
fCameraAngleX = dbWrapValue ( fCameraAngleX + dbMouseMoveY () * 0.4f );
fCameraAngleY = dbWrapValue ( fCameraAngleY + dbMouseMoveX () * 0.4f );
dbXRotateCamera ( fCameraAngleX );
dbYRotateCamera ( fCameraAngleY );
// update the screen
dbSync ( );
}
// return back to windows
return;
}
Thank You