Merge pull request #764 from magcius/new-nogui-2

Rewrite GLInterface
This commit is contained in:
Lioncash
2014-08-21 14:14:54 -04:00
47 changed files with 449 additions and 1404 deletions

View File

@ -8,7 +8,7 @@ namespace DX11
class VideoBackend : public VideoBackendHardware
{
bool Initialize(void *&) override;
bool Initialize(void *) override;
void Shutdown() override;
std::string GetName() const override;
@ -19,7 +19,6 @@ class VideoBackend : public VideoBackendHardware
void ShowConfig(void* parent) override;
void UpdateFPSDisplay(const std::string&) override;
unsigned int PeekMessages() override;
void* m_window_handle;

View File

@ -51,12 +51,6 @@ unsigned int VideoBackend::PeekMessages()
return TRUE;
}
void VideoBackend::UpdateFPSDisplay(const std::string& text)
{
std::string str = StringFromFormat("%s | D3D | %s", scm_rev_str, text.c_str());
SetWindowTextA((HWND)m_window_handle, str.c_str());
}
std::string VideoBackend::GetName() const
{
return "D3D";
@ -141,7 +135,7 @@ void VideoBackend::ShowConfig(void *hParent)
Host_ShowVideoConfig(hParent, GetDisplayName(), "gfx_dx11");
}
bool VideoBackend::Initialize(void *&window_handle)
bool VideoBackend::Initialize(void *window_handle)
{
if (window_handle == nullptr)
return false;

View File

@ -25,11 +25,10 @@ protected:
u32 s_opengl_mode;
public:
virtual void Swap() {}
virtual void UpdateFPSDisplay(const std::string& text) {}
virtual void SetMode(u32 mode) { s_opengl_mode = GLInterfaceMode::MODE_OPENGL; }
virtual u32 GetMode() { return s_opengl_mode; }
virtual void* GetFuncAddress(const std::string& name) { return nullptr; }
virtual bool Create(void *&window_handle) { return true; }
virtual bool Create(void *window_handle) { return true; }
virtual bool MakeCurrent() { return true; }
virtual bool ClearCurrent() { return true; }
virtual void Shutdown() {}

View File

@ -26,12 +26,6 @@ unsigned int VideoBackend::PeekMessages()
return GLInterface->PeekMessages();
}
// Show the current FPS
void VideoBackend::UpdateFPSDisplay(const std::string& text)
{
return GLInterface->UpdateFPSDisplay(StringFromFormat("%s | %s | %s", scm_rev_str, GetDisplayName().c_str(), text.c_str()));
}
}
void InitInterface()
{

View File

@ -8,7 +8,7 @@ namespace OGL
class VideoBackend : public VideoBackendHardware
{
bool Initialize(void *&) override;
bool Initialize(void *) override;
void Shutdown() override;
std::string GetName() const override;
@ -19,7 +19,6 @@ class VideoBackend : public VideoBackendHardware
void ShowConfig(void* parent) override;
void UpdateFPSDisplay(const std::string&) override;
unsigned int PeekMessages() override;
};

View File

@ -155,7 +155,7 @@ void VideoBackend::ShowConfig(void *_hParent)
Host_ShowVideoConfig(_hParent, GetDisplayName(), "gfx_opengl");
}
bool VideoBackend::Initialize(void *&window_handle)
bool VideoBackend::Initialize(void *window_handle)
{
InitializeShared();
InitBackendInfo();

View File

@ -71,7 +71,7 @@ void VideoSoftware::ShowConfig(void *hParent)
Host_ShowVideoConfig(hParent, GetDisplayName(), "gfx_software");
}
bool VideoSoftware::Initialize(void *&window_handle)
bool VideoSoftware::Initialize(void *window_handle)
{
g_SWVideoConfig.Load((File::GetUserPath(D_CONFIG_IDX) + "gfx_software.ini").c_str());
@ -372,10 +372,4 @@ unsigned int VideoSoftware::PeekMessages()
return GLInterface->PeekMessages();
}
// Show the current FPS
void VideoSoftware::UpdateFPSDisplay(const std::string& text)
{
GLInterface->UpdateFPSDisplay(StringFromFormat("%s | Software | %s", scm_rev_str, text.c_str()));
}
}

View File

@ -10,7 +10,7 @@ namespace SW
class VideoSoftware : public VideoBackend
{
bool Initialize(void *&) override;
bool Initialize(void *window_handle) override;
void Shutdown() override;
std::string GetName() const override;
@ -48,7 +48,6 @@ class VideoSoftware : public VideoBackend
void RegisterCPMMIO(MMIO::Mapping* mmio, u32 base) override;
void UpdateFPSDisplay(const std::string&) override;
unsigned int PeekMessages() override;
void PauseAndLock(bool doLock, bool unpauseOnUnlock=true) override;