aboutsummaryrefslogtreecommitdiff
path: root/src/GPU2D.h
diff options
context:
space:
mode:
authorJesse Talavera-Greenberg <jesse@jesse.tg>2023-11-09 15:54:51 -0500
committerGitHub <noreply@github.com>2023-11-09 21:54:51 +0100
commit4558be0d8eb79d276c89392b9410e6edb649db95 (patch)
tree3e2b37e31b38337adec64c5391e57ddf45af5d23 /src/GPU2D.h
parent88072a02c523e26390af6bd726608b3e567f996f (diff)
Refactor the GPU to be object-oriented (#1873)
* Refactor GPU3D to be an object - Who has two thumbs and is the sworn enemy of global state? This guy! * Refactor GPU itself to be an object - Wow, it's used in a lot of places - Also introduce a new `Melon` namespace for a few classes - I expect other classes will be moved into `Melon` over time * Change signature of Renderer3D::SetRenderSettings - Make it noexcept, and its argument const * Remove some stray whitespace
Diffstat (limited to 'src/GPU2D.h')
-rw-r--r--src/GPU2D.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/GPU2D.h b/src/GPU2D.h
index ffef57d..ad052bf 100644
--- a/src/GPU2D.h
+++ b/src/GPU2D.h
@@ -22,13 +22,20 @@
#include "types.h"
#include "Savestate.h"
+namespace Melon
+{
+class GPU;
+}
+
namespace GPU2D
{
class Unit
{
public:
- Unit(u32 num);
+ // take a reference to the GPU so we can access its state
+ // and ensure that it's not null
+ Unit(u32 num, Melon::GPU& gpu);
Unit(const Unit&) = delete;
Unit& operator=(const Unit&) = delete;
@@ -116,6 +123,8 @@ public:
u32 CaptureCnt;
u16 MasterBrightness;
+private:
+ Melon::GPU& GPU;
};
class Renderer2D