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 » Thu Oct 18, 2018 11:07 pm

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: 2760
Joined: Fri Aug 17, 2007 9:33 pm

Re: Question about VDP_showFPS

Post by Chilly Willy » Fri Oct 19, 2018 2:04 am

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 » Sat Oct 20, 2018 9:43 pm

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: 255
Joined: Mon Nov 30, 2015 1:55 pm

Re: Question about VDP_showFPS

Post by cero » Sun Oct 21, 2018 6:31 am

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 » Sun Oct 21, 2018 6:38 pm

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: 63
Joined: Fri Jun 13, 2014 1:26 pm
Location: US
Contact:

Re: Question about VDP_showFPS

Post by Grind » Mon Oct 22, 2018 3:18 am

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 » Mon Oct 22, 2018 3:58 pm

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

Post Reply