Question about VDP_showFPS

SGDK only sub forum

Moderator: Stef

Post Reply
billybob884
Interested
Posts: 18
Joined: Tue Aug 21, 2018 1:03 pm

Question about VDP_showFPS

Post by billybob884 »

Hello, I have a quick question about the VDP_showFPS command. Is there any way to make VDP_showFPS draw to plane B instead of A? Or to set the coordinates?

Thank you for your help.
Chilly Willy
Very interested
Posts: 2993
Joined: Fri Aug 17, 2007 9:33 pm

Re: Question about VDP_showFPS

Post by Chilly Willy »

The routines use the current text plane for drawing the fps. Use VDP_setTextPlan() to change the text plane before showing the fps.

The coords are fixed in the source. You can alter your local copy of SGDK by changing the line

Code: Select all

    // display FPS
    VDP_drawText(str, 1, 1);
Change the 1, 1 to whatever x/y you want. Um - edit the VDP_clearText() values as well so you clear the right place. :D
billybob884
Interested
Posts: 18
Joined: Tue Aug 21, 2018 1:03 pm

Re: Question about VDP_showFPS

Post by billybob884 »

Ah, thank you! The coordinates aren't as important (I was just curious), but for testing it's easier for my project to disable the background scrolling (plane B) to keep the FPS on screen.
Also on a side note, the "float_display" parameter should kind of be a bool instead of an int, shouldn't it?
cero
Very interested
Posts: 340
Joined: Mon Nov 30, 2015 1:55 pm

Re: Question about VDP_showFPS

Post by cero »

Bool doesn't exist in older C standards, and in newer it's just an alias for u8 usually.
billybob884
Interested
Posts: 18
Joined: Tue Aug 21, 2018 1:03 pm

Re: Question about VDP_showFPS

Post by billybob884 »

Should I not be using them? The only reason I ask is I've seen bool types used in other functions (TILE_ATTR_FULL, for instance).
Grind
Very interested
Posts: 69
Joined: Fri Jun 13, 2014 1:26 pm
Location: US
Contact:

Re: Question about VDP_showFPS

Post by Grind »

TRUE and FALSE are an alias for 1 and 0 in SGDK (in types.h iirc) so they can work as an int of any size.
billybob884
Interested
Posts: 18
Joined: Tue Aug 21, 2018 1:03 pm

Re: Question about VDP_showFPS

Post by billybob884 »

Ah, I see. Was a little confused why mixing types wasn't throwing a warning in the compiler. That makes sense, thanks
Post Reply