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 / Debug info on screen

Author
Message
Funkbrotha10
15
Years of Service
User Offline
Joined: 2nd May 2009
Location:
Posted: 4th May 2009 22:23
How would you print things like the players position on the screen

I tried to use dbText but i soon found that you could not convert from int to char

How do you do it?

it was once said that a million monkeys at a million keyboards could re-produce the works of shakespear...
Now thanks to the internet we know that that is not true
ABXG
15
Years of Service
User Offline
Joined: 1st Apr 2009
Location: Canada
Posted: 4th May 2009 23:00
You can use one of the following commands:



------------------------------------
Currently 1300+ lines of code into an "over-the-shoulder" action RPG with combat based on rag-doll physics.
go2none
16
Years of Service
User Offline
Joined: 8th Oct 2008
Location: London
Posted: 4th May 2009 23:28
Or you can try:

ABXG
15
Years of Service
User Offline
Joined: 1st Apr 2009
Location: Canada
Posted: 5th May 2009 00:05
That is exactly what I suggested...

------------------------------------
Currently 1300+ lines of code into an "over-the-shoulder" action RPG with combat based on rag-doll physics.
AlexI
19
Years of Service
User Offline
Joined: 31st Dec 2004
Location: UK
jezza
16
Years of Service
User Offline
Joined: 8th Mar 2008
Location: Bham, UK
Posted: 5th May 2009 23:52
or always sprintf or sprintf_s... the way real men convert to strings.
stevebrit
15
Years of Service
User Offline
Joined: 6th Jan 2009
Location: Florida USA
Posted: 6th May 2009 03:44
Something i use to show me a variable i need to track is the function below. I guess you could show more than one if you get the variables you want into a char* to your string.
Iguess this is only for temporary use but ....

As long as you have a window it will show in top left of window bar.

:- Example showing width of bitmap I.D 2

dbSetWindowTitle(dbStr( dbBitmapWidth( 2 ) ));

Hope this is useful i have found that very useful.

Regards :- Steve

AMD Athlon64x2 3.1Ghz - Ram 4Gb DDR2 800Mhz - 500Gb HD
Ndivia 9600GT SLI - 24in LCD - WIN 7 - 64 bit BETA
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 7th May 2009 00:37
Quote: "dbSetWindowTitle(dbStr( dbBitmapWidth( 2 ) ));"


This creates a memory leak. You have to deallocate memory of the string returned by dbStr using delete[] after you have finished using it. This goes for all DarkGDK returned strings.

stevebrit
15
Years of Service
User Offline
Joined: 6th Jan 2009
Location: Florida USA
Posted: 7th May 2009 03:32
Thanks for the info there, am i right in saying as long as the memory for that string is dellocated its ok to use that means of viewing variables ??

By creating the string
deallocating that string and
creating another etc etc ....

Sorry for seeming to be a bit of a dunce here !~@#$
but it would be nice info to know, as its a nice way for me to view variables easily.

Many thanks for that :- Regards Steve

AMD Athlon64x2 3.1Ghz - Ram 4Gb DDR2 800Mhz - 500Gb HD
Ndivia 9600GT SLI - 24in LCD - WIN 7 - 64 bit BETA
Michael P
18
Years of Service
User Offline
Joined: 6th Mar 2006
Location: London (UK)
Posted: 7th May 2009 09:47
Yes, the below code example shows how to use dbStr:


sydbod
16
Years of Service
User Offline
Joined: 14th Jun 2008
Location: Just look at the picture
Posted: 7th May 2009 12:12 Edited at: 7th May 2009 14:58
If you are interested, here is a typical chunk of code doing what you require.
You should be able to adapt it to your needs.



EDIT: you will have to do a copy and paste back into your VisualC++ IDE to get the correct formatting of the code back. It looks like this code windows can not handle code that long on a line.

Login to post a reply

Server time is: 2024-11-05 18:41:32
Your offset time is: 2024-11-05 18:41:32