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 / Console using Dark GDK?

Author
Message
RoF
12
Years of Service
User Offline
Joined: 22nd Mar 2012
Location:
Posted: 27th Mar 2012 00:07
Is it possible to use the console in conjunction with Dark GDK? (i.e. #include <iostream> and then use cout?)

Thus far I have used system("pause") in certain parts of my program and a console comes up, but I haven't been able to use cout.

I am asking this because I need an easier way to debug my programs, since it is difficult to display numbers on the game screen using dbText().

Is it possible to use a console? If not, is there an alternative way to display numbers that constantly change on the game screen using functions?

Thank you for your time.
Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 27th Mar 2012 01:20 Edited at: 27th Mar 2012 01:20
Yes, here is a nice class I added on to:



It allows you to open/close the console, clear the screen, and color the text.

You may have to set your code generation settings to "Multi-Threaded /MT"

If you want to display things on the screen use "dbText"
RoF
12
Years of Service
User Offline
Joined: 22nd Mar 2012
Location:
Posted: 28th Mar 2012 03:37
dbText only takes in the coordinates and a character array, but if I were to say, display the value of a variable over time as the loop loops, how would I get dbText to change with it? I created a function that could do such thing, but it showed extra symbols at the end of the number it displayed and it also crashed the program each time I ran it...
Mr Bigglesworth
16
Years of Service
User Offline
Joined: 4th Mar 2008
Location:
Posted: 28th Mar 2012 06:52 Edited at: 28th Mar 2012 06:56
Like this?

Login to post a reply

Server time is: 2024-04-19 12:49:34
Your offset time is: 2024-04-19 12:49:34