Implement FPS display (F2 to toggle ON/OFF)

This commit is contained in:
Jonas Kulla 2013-10-06 07:05:01 +02:00
parent 41675859dd
commit 26843f2e51
3 changed files with 127 additions and 2 deletions

View file

@ -34,6 +34,8 @@
#include <QByteArray>
#include <QVector>
#include <stdint.h>
struct RGSSThreadData;
struct SDL_Thread;
struct SDL_Window;
@ -66,7 +68,7 @@ public:
void process(RGSSThreadData &rtData);
void cleanup();
/* Called from rgss thread */
/* Called from RGSS thread */
void requestFullscreenMode(bool mode);
void requestWindowResize(int width, int height);
void requestShowCursor(bool mode);
@ -78,13 +80,28 @@ public:
void showMessageBox(const char *body, int flags = 0);
/* RGSS thread calls this once per frame */
void notifyFrame();
private:
void resetInputStates();
void setFullscreen(SDL_Window *, bool mode);
void updateCursorState(bool inWindow);
bool fullscreen;
bool showCursor;
volatile bool msgBoxDone;
struct
{
uint64_t lastFrame;
uint64_t displayCounter;
bool displaying;
bool immInitFlag;
bool immFiniFlag;
uint64_t acc;
uint32_t accDiv;
} fps;
};
/* Used to asynchronously inform the rgss thread