Welcome to Dream.In.Code
Getting Help is Easy!

Join 107,647 Programmers for FREE! Ask your question and get quick answers from experts. There are 902 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



Dark GDK Problems

 
Reply to this topicStart new topic

Dark GDK Problems

Roujin
post 30 Jul, 2008 - 05:30 AM
Post #1


New D.I.C Head

*
Joined: 10 Apr, 2007
Posts: 7


My Contributions


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
User is offlineProfile CardPM

Go to the top of the page


BetaWar
post 30 Jul, 2008 - 08:59 AM
Post #2


#include <soul.h>

Group Icon
Joined: 7 Sep, 2006
Posts: 1,119



Thanked 38 times

Dream Kudos: 725
My Contributions


Are you recompiling it (inside of the editor) or just firing up the exe? If you are firing up the rexe you have to remember to copy the images used into the appropraite directory around the exe.

For instance when you are creating a game your images are in the same folder as the project files are. When you compile the game you have to manually move the images to be in the same folder as the exe is (they don't get movied/copied on their onw).

Hope that helps.
User is online!Profile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 8/29/08 08:26PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month