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 / What is up with the dbInput () command

Author
Message
Dragon slayer
17
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 8th May 2013 00:48
Nothing in search was of any help! I remember talking a little about it in another thread but can't remember which thread or what was said! this command does not seem to work in DarkGDK I have tried to include iostream and use cin and that seems to mess up things. Does anyone know anything about this command and how to get it to work right?
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 8th May 2013 04:15
It might be, I haven't checked. It probably takes a pointer to a char buffer rather than return a string, but I'm sure you've figured that out already.

To be honest that function is pretty much useless for anything but really quick mockups. May I ask what you are trying to do; chances are there is a better way to go about it?

Quote: "I have tried to include iostream and use cin and that seems to mess up things."

That only works with console applications. You'll probably get linker errors if you try to compile that in a project that doesn't build to (or at least contain a) console.


"Why do programmers get Halloween and Christmas mixed up?"
Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 8th May 2013 06:22 Edited at: 8th May 2013 06:23
Quote: "That only works with console applications. You'll probably get linker errors if you try to compile that in a project that doesn't build to (or at least contain a) console."


They work fine I use them a lot to have a debug console with my game. Make sure your code generation is set to /MTdMulti-threaded debug or /MT Multi-threaded (based on your output settings) or you will get linker errors when you compile.
Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 9th May 2013 03:43
Quote: "They work fine"


Quote: "...have a debug console with my game"

Yeah, of course they work. Provided you have a console... as you apparently do


"Why do programmers get Halloween and Christmas mixed up?"
Dragon slayer
17
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 9th May 2013 16:18
I am just trying to get a simple choice.

1.
2.
3.

choice
dbInput()

switch(choice)
case 1:

I have tried many different ways, if statements only, switching the order of the code and where the input command is all I can get is if I hit enter twice I can get my choice to show on screen but then nothing but that is probably more my problem and the code. I have no idea why I would have to hit enter twice.
Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 9th May 2013 16:20
Oh

If you use the commands and you don't have a console then they will compile, they just won't do anything.
Dragon slayer
17
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 10th May 2013 16:17
I am learning to program in c++ anything I am doing now is in a console window. With DarkGdk all I am doing is a text program.
Boca
13
Years of Service
User Offline
Joined: 25th Nov 2010
Location:
Posted: 11th May 2013 04:23
Not sure if you use the default code generated with say a 2d game where the wizard puts the game loop and sync options and such.
I know if you have dbSyncOn(); then your text can get nerfed and not show, or show after you hit enter and such, as far as dbInput it does work.
for example

Dragon slayer
17
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 11th May 2013 15:37
I do use whatever the wizard puts in. I will comment those commands out and see what happens. What I am doing right now is text only with some 2D line commands to create a screen layout which I could do away with and be good!
Dragon slayer
17
Years of Service
User Offline
Joined: 3rd Nov 2006
Location: Bourbonnais Illinois
Posted: 11th May 2013 15:55
Ok that works somewhat. I can get my choices to work. When I go to close the program I get a error that says program stopped working, do I want to wait or close. I have to experiment more.

So if I don't use the sync commands what do you do in their place. Like I said I don't really need them ATM but I will down the road.

Login to post a reply

Server time is: 2024-04-18 18:16:33
Your offset time is: 2024-04-18 18:16:33