Don't set common globals from Video Backends

This commit is contained in:
Scott Mansell
2023-01-28 14:53:19 +13:00
parent d37f83ffeb
commit 58b70b2fb2
7 changed files with 65 additions and 35 deletions

View File

@ -18,6 +18,12 @@ class Mapping;
}
class PointerWrap;
class AbstractGfx;
class BoundingBox;
class Renderer;
class TextureCacheBase;
class VertexManagerBase;
enum class FieldType
{
Odd,
@ -71,7 +77,19 @@ public:
void DoState(PointerWrap& p);
protected:
void InitializeShared();
// For hardware backends
bool InitializeShared(std::unique_ptr<AbstractGfx> gfx,
std::unique_ptr<VertexManagerBase> vertex_manager,
std::unique_ptr<PerfQueryBase> perf_query,
std::unique_ptr<BoundingBox> bounding_box);
// For software and null backends. Allows overriding the default Renderer and Texture Cache
bool InitializeShared(std::unique_ptr<AbstractGfx> gfx,
std::unique_ptr<VertexManagerBase> vertex_manager,
std::unique_ptr<PerfQueryBase> perf_query,
std::unique_ptr<BoundingBox> bounding_box,
std::unique_ptr<Renderer> renderer,
std::unique_ptr<TextureCacheBase> texture_cache);
void ShutdownShared();
bool m_initialized = false;