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 / Need some questions answered, some advice on DarkGDK

Author
Message
Dragon slayer
17
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 12th Jan 2013 23:37
Ok I was having some trouble getting my own functions to work. Kind of have that solved. When I start a project, I use the darkGDK-game option of the wizard and it sets up a default file with the proper header file, the sync options and a while loop.

I am only doing a text thing so I don't think I need those sync commands right?

I am guessing that the while loop would be the same as a do loop in DBP is that right? and do I have to use it or is there another option?

Will I ever need to use other header files with darkGDK or using namespace std;

Thanks
Dragonslayer
JohnA
12
Years of Service
User Offline
Joined: 20th Jul 2011
Location: The second star on the right
Posted: 13th Jan 2013 00:45
Dragon Slayer,
The dbsync commands are what draw the screen, so yes, they are needed anytime u want anything drawn to the screen.

2nd. The for loop is what needs to be at this place because it is what Dark GDK uses to control the main function. You generally need to program another loop, either for, do, or while, to serve as your game loop as well.

The header file, if I am understanding things correctly, is dark gdk, i mean that this is how we are able to use the library.

hope I have answered everything.

John

p.s. dragon slayer is a cool name

=Arkii=

Heres Johnny
Dragon slayer
17
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 13th Jan 2013 00:57
Thanks I thought the while loop was the game loop! So I don't really need to put anything in that loop but I can make another loop for a game loop, but that while loop needs to stay there.

I was wondering if I would ever need to include other header files like iostream
JTK
14
Years of Service
User Offline
Joined: 10th Feb 2010
Location:
Posted: 13th Jan 2013 03:16
Yes, you'll need to #include whatever other header files you'll need yourself. It could be <iostream>, <list>, <map> etc. if you need them, then you'll need to #include them yourself; with the exception of the basic <windows.h> and related file(s).

As for your while loop / game-loop distinction: whichever approach you take, you will need to call dbSync() in order to tell GDK to update the screen.

Regards,

JTK
JohnA
12
Years of Service
User Offline
Joined: 20th Jul 2011
Location: The second star on the right
Posted: 13th Jan 2013 03:22
The while loop, that is where u need to put the code of your program, which is any functions u need run and a game loop as well, so u can't ignore it, that is were your code goes.

u can include almost ANY library that u want to use, including iostream, sstring , any 3rd party libs as well, like nvidida Phsyx too. this is the power of c++, to be able to include practically anything u need/want to use.

=Arkii=

Heres Johnny
Dragon slayer
17
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 13th Jan 2013 03:32
Ok thanks!

Login to post a reply

Server time is: 2024-03-29 01:20:40
Your offset time is: 2024-03-29 01:20:40