Page 1 of 1

Question about VDP_showFPS

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

Re: Question about VDP_showFPS

Posted: Fri Oct 19, 2018 2:04 am
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

Re: Question about VDP_showFPS

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

Re: Question about VDP_showFPS

Posted: Sun Oct 21, 2018 6:31 am
by cero
Bool doesn't exist in older C standards, and in newer it's just an alias for u8 usually.

Re: Question about VDP_showFPS

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

Re: Question about VDP_showFPS

Posted: Mon Oct 22, 2018 3:18 am
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.

Re: Question about VDP_showFPS

Posted: Mon Oct 22, 2018 3:58 pm
by billybob884
Ah, I see. Was a little confused why mixing types wasn't throwing a warning in the compiler. That makes sense, thanks