mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 22:09:19 -07:00
ba94ffd51d
Given this is a base class, we should clearly state what the parameters to the functions in its exposed interface actually mean or represent. This avoids needing to hunt for the definition of the functions in cpp files. While we're at it, normalize said parameter names so they follow our naming guidelines.
74 lines
1.5 KiB
C++
74 lines
1.5 KiB
C++
// Copyright 2011 Dolphin Emulator Project
|
|
// Licensed under GPLv2+
|
|
// Refer to the license.txt file included.
|
|
|
|
#pragma once
|
|
|
|
#include <memory>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "Common/CommonTypes.h"
|
|
#include "VideoCommon/PerfQueryBase.h"
|
|
|
|
namespace MMIO
|
|
{
|
|
class Mapping;
|
|
}
|
|
class PointerWrap;
|
|
|
|
enum class FieldType
|
|
{
|
|
Odd,
|
|
Even,
|
|
};
|
|
|
|
enum class EFBAccessType
|
|
{
|
|
PeekZ,
|
|
PokeZ,
|
|
PeekColor,
|
|
PokeColor
|
|
};
|
|
|
|
class VideoBackendBase
|
|
{
|
|
public:
|
|
virtual ~VideoBackendBase() {}
|
|
virtual bool Initialize(void* window_handle) = 0;
|
|
virtual void Shutdown() = 0;
|
|
|
|
virtual std::string GetName() const = 0;
|
|
virtual std::string GetDisplayName() const { return GetName(); }
|
|
void ShowConfig(void* parent_handle);
|
|
virtual void InitBackendInfo() = 0;
|
|
|
|
void Video_ExitLoop();
|
|
|
|
void Video_BeginField(u32 xfb_addr, u32 fb_width, u32 fb_stride, u32 fb_height, u64 ticks);
|
|
|
|
u32 Video_AccessEFB(EFBAccessType type, u32 x, u32 y, u32 data);
|
|
u32 Video_GetQueryResult(PerfQueryType type);
|
|
u16 Video_GetBoundingBox(int index);
|
|
|
|
static void PopulateList();
|
|
static void ClearList();
|
|
static void ActivateBackend(const std::string& name);
|
|
|
|
// the implementation needs not do synchronization logic, because calls to it are surrounded by
|
|
// PauseAndLock now
|
|
void DoState(PointerWrap& p);
|
|
|
|
void CheckInvalidState();
|
|
|
|
protected:
|
|
void InitializeShared();
|
|
void ShutdownShared();
|
|
|
|
bool m_initialized = false;
|
|
bool m_invalid = false;
|
|
};
|
|
|
|
extern std::vector<std::unique_ptr<VideoBackendBase>> g_available_video_backends;
|
|
extern VideoBackendBase* g_video_backend;
|