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 / Frames Per Second Display Problem

Author
Message
CokeBoi
15
Years of Service
User Offline
Joined: 19th Jun 2009
Location:
Posted: 13th Oct 2009 07:25
Hi! I have a problem that when I run the following code:


char szFPS [ 256 ] = "";
strcpy ( szFPS, "fps = " );
strcat ( szFPS, dbStr ( dbScreenFPS ( ) ) );
dbText ( dbScreenWidth ( ) - 20 - dbTextWidth ( szFPS ), dbScreenHeight ( ) - 40, szFPS );



It shows on the screen "fps = 0" which is good. Then, it seems to move a few pixels to the left and starts over-lapping with the original "fps = 0". Anyone know why? (Attached a picture of it)

LOL

Attachments

Login to view attachments
CokeBoi
15
Years of Service
User Offline
Joined: 19th Jun 2009
Location:
Posted: 13th Oct 2009 07:26
Sorry bout the pic. Heres the viewable one

LOL

Attachments

Login to view attachments
Jeff032
17
Years of Service
User Offline
Joined: 13th Aug 2007
Location:
Posted: 13th Oct 2009 07:49
It overlaps because you aren't clearing the screen before redrawing the fps.

It moves to the left because

dbTextWidth( szFPS )

increase when the fps goes from 0 to a two-digit number.

-Jeff

SFCBias
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location: Hephzibah, GA, USA
Posted: 13th Oct 2009 07:54
also use dbCLS() or any likenesses to clear and refresh the text

if(You.AddCode.toPost)TGC.Users.CanHelp = true;
else return NoCodeMessage;
CokeBoi
15
Years of Service
User Offline
Joined: 19th Jun 2009
Location:
Posted: 13th Oct 2009 08:51
TY It's working now . Out of curiosity, if I add in a terrain and 3D models and all, does dbCLS clear the entire screen, or just the text?

LOL
entomophobiac
21
Years of Service
User Offline
Joined: 1st Nov 2002
Location: United States
Posted: 13th Oct 2009 10:23
If you have 3D in your scene, the 3D device will clear the screen every refresh and make dbCLS() quite redundant.
Ultimate_H
15
Years of Service
User Offline
Joined: 11th Mar 2009
Location: A place that is neither here nor there
Posted: 13th Oct 2009 10:26
I'm not sure what actually happens, but when you use dbCLS in 3d mode, it clears away the 3d picture. meaning you are left with just the text and a black background.

my guess is that it clears the image the camera(s) return or something as well(when does that actually happen?). But it only goes blank when you use the command, and returns to normal the next frame(if you don't call it that time).

But, if you use any positioning text(If you use something like dbprint(), it will go to the bottom and give you a nice black border and cut off the top), then you don't even need to use dbCLS() in 3d because all the previous stuff is overwritten by the new image returned from the camera(s), and then the text is pasted on top of that.

I guess I should shut up now. That's my basic thoughts(haven't really dug into how things work in GDK, just guesstimating).

The not-so-ultimate Ultimate_H
SFCBias
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location: Hephzibah, GA, USA
Posted: 13th Oct 2009 19:14
To avoid any of this, Im pretty sure that you can use dbPrint() and do tha same

if(You.AddCode.toPost)TGC.Users.CanHelp = true;
else return NoCodeMessage;
CokeBoi
15
Years of Service
User Offline
Joined: 19th Jun 2009
Location:
Posted: 13th Oct 2009 21:51
Well, It doesn't over-lap but now it sorta "dominates" the entire right side of my screen.



(attached picture)



Help ?

LOL

Attachments

Login to view attachments
Ultimate_H
15
Years of Service
User Offline
Joined: 11th Mar 2009
Location: A place that is neither here nor there
Posted: 13th Oct 2009 22:20
not sure what is happening. but if you are running it in 3d mode(that's what your planning right?), then it stays in position without "dominating"(if you get a black bar, just raise the subtractor (the one from the screen height)).

If I sound like I know what I am talking about, then I most likely have no idea what I am saying.

If I sound like i have no idea what I am saying, then I most likely know what I am talking about.
CokeBoi
15
Years of Service
User Offline
Joined: 19th Jun 2009
Location:
Posted: 13th Oct 2009 22:59 Edited at: 13th Oct 2009 23:02
It Just made it worse


Main.cpp



commands.cpp



Help xD? (If you need anymore info let me know)

Edit: I know about the matrix in the loop. I moved it out of the loop and i got the same results.

LOL

Attachments

Login to view attachments
Ultimate_H
15
Years of Service
User Offline
Joined: 11th Mar 2009
Location: A place that is neither here nor there
Posted: 13th Oct 2009 23:34
I would suggest keeping the matrix outside the loop(visual studio was complaining about overloaded buffers or something). As for the display issue, I really dont know what's wrong, cause it runs fine when I compile it(copy/paste the commands). All I can suggest is trying with just a basic sphere(dbMakeObjectSphere("ID", "radius", "rings", "segments")) instead of a matrix and see what happens then.

If I sound like I know what I am talking about, then I most likely have no idea what I am saying.

If I sound like i have no idea what I am saying, then I most likely know what I am talking about.
CokeBoi
15
Years of Service
User Offline
Joined: 19th Jun 2009
Location:
Posted: 14th Oct 2009 00:37
I found out what it was. I had dbBackdropOff() enabled so it would keep repeating . However, now that I have the black bar at the bottom of the screen, is there a way where I can make it smaller perhaps? It's just taking up too much space for my liking (Even though it will only be used when BETA testing I still would like to make the bar smaller so I get a feel of what it will be like without debug mode on). Also, how do I fit my FPS in that black bar? TYVM so far

LOL
Ultimate_H
15
Years of Service
User Offline
Joined: 11th Mar 2009
Location: A place that is neither here nor there
Posted: 14th Oct 2009 01:38
actually, what the black bar is, is when the image from the camera gets pushed upwards(usually from a print command or such), what I did(when copy/pasted) is changed "dbScreenHeight ( ) - 40" to "dbScreenHeight ( ) - 100" and it got rid of the black bar.

If I sound like I know what I am talking about, then I most likely have no idea what I am saying.

If I sound like i have no idea what I am saying, then I most likely know what I am talking about.
CokeBoi
15
Years of Service
User Offline
Joined: 19th Jun 2009
Location:
Posted: 14th Oct 2009 02:01
OK, everything is working now. Thank you very much

LOL
SFCBias
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location: Hephzibah, GA, USA
Posted: 14th Oct 2009 04:13
Sorry , use dbPrint but make sure before your game loop you call dbSetCursor(x,y); and set x and y to where ever

if(You.AddCode.toPost)TGC.Users.CanHelp = true;
else return NoCodeMessage;
luke810
18
Years of Service
User Offline
Joined: 4th Sep 2006
Location: United States
Posted: 14th Oct 2009 07:01
Or you can just use dbText( x, y, char* )...

SFCBias
15
Years of Service
User Offline
Joined: 8th Aug 2009
Location: Hephzibah, GA, USA
Posted: 14th Oct 2009 22:11 Edited at: 14th Oct 2009 22:12
He waz using that but there were problems with the textclear and all that good stuff also i think it would be better to use sprintf rather than strcat and strcpy

if(You.AddCode.toPost)TGC.Users.CanHelp = true;
else return NoCodeMessage;

Login to post a reply

Server time is: 2024-10-01 14:26:46
Your offset time is: 2024-10-01 14:26:46