X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=src%2Fscreen.h;h=c76a5549b922908b95a139179bc9e0ebaa2b2386;hb=cfe7da763b5d8ef4252ddb94558abb080bbd893d;hp=d918dd1afc2a9fd0b604b46468939d1e4c247c7f;hpb=a851cf197844a2eb15fd5ee2c350ee296e415dca;p=ipdf%2Fcode.git diff --git a/src/screen.h b/src/screen.h index d918dd1..c76a554 100644 --- a/src/screen.h +++ b/src/screen.h @@ -59,6 +59,13 @@ namespace IPDF void ScreenShot(const char * filename) const; void RenderBMP(const char * filename) const; + void RenderPixels(int x, int y, int w, int h, uint8_t * pixels) const; + + + // Returns the CPU time (in seconds) it took to render the last completed frame. + double GetLastFrameTimeCPU() const { return m_last_frame_time / SDL_GetPerformanceFrequency(); } + // Returns the GPU time (in seconds) it took to render the last completed frame. + double GetLastFrameTimeGPU() const; private: void ResizeViewport(int width, int height); void DebugFontFlush(); @@ -67,6 +74,11 @@ namespace IPDF int m_last_mouse_x; int m_last_mouse_y; + double m_last_frame_time; + double m_frame_begin_time; + GLuint m_frame_gpu_timer; + GLuint m_last_frame_gpu_timer; + int m_viewport_width; int m_viewport_height; SDL_Window *m_window;