Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Problem with compiling :S

Author
Message
Tona
14
Years of Service
User Offline
Joined: 9th Feb 2010
Location:
Posted: 10th Feb 2010 17:12
Hey guys, i have a problem when i try to compile ''hello world''
Its like this guy in the video, Note this vid is not mine

http://www.youtube.com/watch?v=LO1OzrIXsRQ
dark coder
21
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Japan
Posted: 10th Feb 2010 18:52
Okay?

binsky
15
Years of Service
User Offline
Joined: 6th Feb 2009
Location:
Posted: 10th Feb 2010 19:28
Could you please post your code, and the errors you get from the compilation??
Tona
14
Years of Service
User Offline
Joined: 9th Feb 2010
Location:
Posted: 10th Feb 2010 19:33
Yeah sure, I tried to compile this :
// Dark GDK - The Game Creators - www.thegamecreators.com

// in this program we're going to take an image and animate
// it on screen by using a sprite

// whenever using Dark GDK you must include the header file
#include "DarkGDK.h"

// the main entry point for the application is this function
void DarkGDK ( void )
{
// at the start of the program we will switch the sync rate on
// by using the function dbSyncOn, this means that we control
// when the screen is updated
dbSyncOn ( );

// now we're going to set the maximum amount of times per second
// that the program can update the screen, we set this to a
// value of 60 meaning this program will run at a potential
// frame rate of 60 frames per second
dbSyncRate ( 60 );

// now comes the part where we take our image and create a sprite
// for it, we achieve this by using the function dbCreateAnimatedSprite,
// this function takes 5 parameters, the first parameter is an ID number
// for the sprite, we can use any number from 1 upwards, this number is
// then used whenever we want to control the sprite in any way, the
// second parameter is the filename of the image to load, the third
// parameter is used to define how many frames of animation the image
// contains horizontally, in this case it is 4 frames, the fourth
// parameter defines how many vertical frames of animation are contained
// in the image, and finally the last parameter controls the ID number
// for the image we are loading, after calling this function we will
// have a sprite in memory that can be displayed and animated on screen
dbCreateAnimatedSprite ( 1, "animatedsprite.png", 4, 4, 1 );

// this is our main loop, it is a simple while loop that will call
// a GDK function named LoopGDK, this function will perform some internal
// routines, it is recommended to always base your main loop on this
// function call
while ( LoopGDK ( ) )
{
// inside our main loop we can control the logic of the program,
// we want to take our animated sprite and display it on screen,
// this can be achieved by calling the function dbPasteSprite, this
// function takes 3 parameters, the first parameter is an ID number
// of the sprite, earlier on when we created the sprite we used an
// ID number of 1, so when we call dbPasteSprite we pass in an ID of
// 1 to indicate the sprite we created, the next two parameters are
// X and Y coordinates, these are used to position the sprite at a
// specific location on screen, in our case we will position the
// sprite at 0, 0 which is the top left of the screen
dbPasteSprite ( 1, 0, 0 );

// our sprite is using an image that has multiple frames on, by default
// it will display frame 1, we want to cycle through all the images to
// show our animation, we can do this by calling dbPlaySprite, this
// function takes 4 parameters, the first is an ID number, we use ID number
// 1, the second parameter controls the start frame, we start from the
// beginning so use a value of 1, the third parameter defines the end
// frame, we have 16 frames of animation so pass in a value of 16, the
/// final parameter controls the delay between switching frames, we pass
// in a value of 200, lower values will make the frames change quickly
// while higher values will make the frames change slowly
dbPlaySprite ( 1, 1, 16, 200 );

// the final call in our main loop is to dbSync, this function will
// update the screen and draw any graphics
dbSync ( );
}

// return back to windows
return;
}

--------------------------------------------------------------
and i getted this : unable to start program'c;\documents and settings\MYNAME\Tutorials\Getting started\debug\getting started\getting started\debug\getting started\.'exe'.

The system cannot find the file specified.

The system cannot find the file specified.
IanM
Retired Moderator
22
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Feb 2010 19:39
While you are on post approval, please only post your message once - repeatedly posting the same message again and again only makes the approval process take longer. Thanks.

binsky
15
Years of Service
User Offline
Joined: 6th Feb 2009
Location:
Posted: 10th Feb 2010 19:43
dbCreateAnimatedSprite ( 1, "animatedsprite.png", 4, 4, 1 );


This line of code sticks out... make sure the animatedsprite.png is in both your project directory and your debug directory. Basically when you run your program, it cant find the file because you havnt placed it in your debug directory(where the exe) or your project directory.
Tona
14
Years of Service
User Offline
Joined: 9th Feb 2010
Location:
Posted: 10th Feb 2010 21:16
But i am trying to do the Dark GDK tutorials, but how i open them?
And wich one i open?
Sorry to ask all these stupid things guys, its just that im super noob at c++ and at game programming and i want to learn it.
Tona
14
Years of Service
User Offline
Joined: 9th Feb 2010
Location:
Posted: 10th Feb 2010 23:11
But how i open all my files in one project?
Sorry guys for all these stupid questions, im a noob at game programming, Sorry for it but i just want to learn it.
binsky
15
Years of Service
User Offline
Joined: 6th Feb 2009
Location:
Posted: 11th Feb 2010 00:13
Sorry, but i am just a little confused at what you are trying to ask? Btw did you get the program to work by doing what i said above?
Tona
14
Years of Service
User Offline
Joined: 9th Feb 2010
Location:
Posted: 11th Feb 2010 08:24
First off , sorry for double posting its just that its verry iritating that i have to wait for it till it post, and it tooked to long so i tought i had to do it again.

Okay here i tell my problem.
i want to know how can i open all my files in getting started.
Because when i try to open it i can only open one file?
I mainly open the main.cpp, but how i add all the other files like the image's and all that stuff?

By the way, im really thankfull that you are trying to help me
Lilith
16
Years of Service
User Offline
Joined: 12th Feb 2008
Location: Dallas, TX
Posted: 12th Feb 2010 05:35 Edited at: 12th Feb 2010 07:48
Quote: "c;\documents and settings\MYNAME\Tutorials\Getting started\debug\getting started\getting started\debug\getting started\.'exe"


This path looks totally bogus. Aside from having two debug folders it's also trying to execute a file with no name, only a .exe extension.

EDIT: c; ???

Did you hand enter that path or did you copy/paste it in for accuracy purposes?

Lilith, Night Butterfly
I'm not a programmer but I play one in the office
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 12th Feb 2010 07:43
okay, try this: dont run the tutorial's solution, open VC++ and go to file-> new project, a window will appear, on your left there are some templates, choose wizards then in the middle of the window you will see "DarkGDK Game" and 3d game and 2d game, you can choose "DarkGDK Game" and give any name for your project, it will create a new empty project, if you cant see your file, open solution explorer ( view -> solution explorer ) and choose main.cpp from the list, now, copy code from the tutorial you want and paste it in the project, after that, copy media and put it in "C:\Users\youname\Documents\Visual Studio 2008\Projects\projectname\projectname\", then press F5 in VC++

Tona
14
Years of Service
User Offline
Joined: 9th Feb 2010
Location:
Posted: 12th Feb 2010 09:24
Hassan, i got one question.
what do you mean with copy media?

Login to post a reply

Server time is: 2024-10-01 23:32:22
Your offset time is: 2024-10-01 23:32:22