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 / Hey, i am a newbie at C++ and I need a bit of help

Author
Message
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 19th Apr 2008 18:49
I am pretty good with python programing, so I decided to work on c++
Now, I need a lot of help with c++

for the beggining of the program-

// Dark GDK - The Game Creators - www.thegamecreators.com

// the wizard has created a very simple project that uses Dark GDK
// it contains the basic code for a GDK application

// 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 );

// our main loop
while ( LoopGDK ( ) )
{
// update the screen
dbSync ( );
}

// return back to windows
return;
}

could someone explain all of that-- the tutorials barely explained it....
TyroN
16
Years of Service
User Offline
Joined: 3rd Apr 2008
Location: Canada
Posted: 19th Apr 2008 20:10
learn the basics of c++ then start using GDK, will be much better for you.
jinzai
18
Years of Service
User Offline
Joined: 19th Aug 2006
Location: USA
Posted: 19th Apr 2008 21:03
When posting code, it is better to use the code blocks, which preserves the indentation. No biggie, just it will tend to get you more help, and less complaining about unreadable code.

That's not C++, its C. C++ builds on C...its a superset of C.

That's just a shell, really. DarkGDK is where that application is initialized. The part....our main loop is the game loop. That is where your game code goes. It keeps looping until you exit. Ususally (and by default) that is by using the system menu/button, or pressing escape.

The include file statement is where all of the names of the various functions are made visible to your code. If you follow it, you will see that alot more files are included by that statement.

dbSyncOn...turns on the sync mechanism, used to control updating the screen.
dbSyncRate(60)...requests 60 updates per second.

Not really sure what you are looking for in terms of explanation. It really only sets the thing up so that it creates a Window, and loops until asked to stop. There really isn't much to explain, unless you care to know how to initialize DirectX, or Windows. Both of those are best explained by Microsoft's documentation. Certainly both are beyond the scope of the GDK documentation. Its very involved in both cases.
programing maniac
16
Years of Service
User Offline
Joined: 19th Apr 2008
Location: Bawk, Bawkity
Posted: 14th May 2008 03:18
The game-- For Russell, if you don't understand why this thread is here, it is so I can send a game to a friend!

~~Its not about what you know, its about how you figure it out.~~

Attachments

Login to view attachments
Cheize
16
Years of Service
User Offline
Joined: 13th May 2008
Location: In the world of Narnia?
Posted: 14th May 2008 06:04 Edited at: 14th May 2008 15:23
Well, when you downloaded the files you should have gotten some Adobe Reader files. Use those because they explain the whole concept. If those are the tutorials you are referring to then I'll do my best to explain.

//This is nothing. Basically // means you can write after it without interference to the code.

#include DarkGDK.h - Notice if you open it, this!



I'm not going to go into detail. Have you noticed something though?
Try opening another project, what does it say to include?

#include DarkSDK.h right? If you oepn that you should understand why. It's like the source of what you want.

Void begins the section I believe.

dbSync is nothing to worry about, just leave it at 60.

If you really are lost and confused try buying a book from a local mall.

Your signature has been erased by a mod - please reduce it to 600x120

Login to post a reply

Server time is: 2024-11-20 09:22:19
Your offset time is: 2024-11-20 09:22:19