diff options
Diffstat (limited to 'src/video_core/renderer_base.h')
| -rw-r--r-- | src/video_core/renderer_base.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/video_core/renderer_base.h b/src/video_core/renderer_base.h new file mode 100644 index 000000000..94748d690 --- /dev/null +++ b/src/video_core/renderer_base.h | |||
| @@ -0,0 +1,58 @@ | |||
| 1 | // Copyright 2014 Citra Emulator Project | ||
| 2 | // Licensed under GPLv2 | ||
| 3 | // Refer to the license.txt file included. | ||
| 4 | |||
| 5 | #pragma once | ||
| 6 | |||
| 7 | #include "common.h" | ||
| 8 | #include "hash.h" | ||
| 9 | |||
| 10 | class RendererBase { | ||
| 11 | public: | ||
| 12 | |||
| 13 | /// Used to reference a framebuffer | ||
| 14 | enum kFramebuffer { | ||
| 15 | kFramebuffer_VirtualXFB = 0, | ||
| 16 | kFramebuffer_EFB, | ||
| 17 | kFramebuffer_Texture | ||
| 18 | }; | ||
| 19 | |||
| 20 | RendererBase() : m_current_fps(0), m_current_frame(0) { | ||
| 21 | } | ||
| 22 | |||
| 23 | ~RendererBase() { | ||
| 24 | } | ||
| 25 | |||
| 26 | /// Swap buffers (render frame) | ||
| 27 | virtual void SwapBuffers() = 0; | ||
| 28 | |||
| 29 | /** | ||
| 30 | * Set the emulator window to use for renderer | ||
| 31 | * @param window EmuWindow handle to emulator window to use for rendering | ||
| 32 | */ | ||
| 33 | virtual void SetWindow(EmuWindow* window) = 0; | ||
| 34 | |||
| 35 | /// Initialize the renderer | ||
| 36 | virtual void Init() = 0; | ||
| 37 | |||
| 38 | /// Shutdown the renderer | ||
| 39 | virtual void ShutDown() = 0; | ||
| 40 | |||
| 41 | // Getter/setter functions: | ||
| 42 | // ------------------------ | ||
| 43 | |||
| 44 | f32 GetCurrentframe() const { | ||
| 45 | return m_current_fps; | ||
| 46 | } | ||
| 47 | |||
| 48 | int current_frame() const { | ||
| 49 | return m_current_frame; | ||
| 50 | } | ||
| 51 | |||
| 52 | protected: | ||
| 53 | f32 m_current_fps; ///< Current framerate, should be set by the renderer | ||
| 54 | int m_current_frame; ///< Current frame, should be set by the renderer | ||
| 55 | |||
| 56 | private: | ||
| 57 | DISALLOW_COPY_AND_ASSIGN(RendererBase); | ||
| 58 | }; | ||