Question about VDP_showFPS
Moderator: Stef
-
- Interested
- Posts: 18
- Joined: Tue Aug 21, 2018 1:03 pm
Question about VDP_showFPS
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.
Thank you for your help.
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
Re: Question about VDP_showFPS
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
Change the 1, 1 to whatever x/y you want. Um - edit the VDP_clearText() values as well so you clear the right place.
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);
-
- Interested
- Posts: 18
- Joined: Tue Aug 21, 2018 1:03 pm
Re: Question about VDP_showFPS
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?
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
Bool doesn't exist in older C standards, and in newer it's just an alias for u8 usually.
-
- Interested
- Posts: 18
- Joined: Tue Aug 21, 2018 1:03 pm
Re: Question about VDP_showFPS
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
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.
-
- Interested
- Posts: 18
- Joined: Tue Aug 21, 2018 1:03 pm
Re: Question about VDP_showFPS
Ah, I see. Was a little confused why mixing types wasn't throwing a warning in the compiler. That makes sense, thanks