mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-23 06:10:03 -06:00
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
This commit is contained in:

committed by
GitHub

parent
88072a02c5
commit
4558be0d8e
11
src/GPU2D.h
11
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
|
||||
|
Reference in New Issue
Block a user