mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Remove InitGraphics/ShutdownGraphics from Host, except for headless
This commit is contained in:
parent
2786786c9f
commit
47f063550a
15 changed files with 10 additions and 47 deletions
|
@ -27,9 +27,6 @@ class Host {
|
||||||
public:
|
public:
|
||||||
virtual ~Host() {}
|
virtual ~Host() {}
|
||||||
|
|
||||||
virtual bool InitGraphics(std::string *error_string, GraphicsContext **ctx) = 0;
|
|
||||||
virtual void ShutdownGraphics() = 0;
|
|
||||||
|
|
||||||
virtual void UpdateSound() {} // still needed for libretro, will need a proper effort.
|
virtual void UpdateSound() {} // still needed for libretro, will need a proper effort.
|
||||||
virtual void PollControllers() {}
|
virtual void PollControllers() {}
|
||||||
virtual void ToggleDebugConsoleVisibility() {}
|
virtual void ToggleDebugConsoleVisibility() {}
|
||||||
|
|
|
@ -31,9 +31,6 @@ public:
|
||||||
mainWindow = mainWindow_;
|
mainWindow = mainWindow_;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool InitGraphics(std::string *error_message, GraphicsContext **ctx) override { return true; }
|
|
||||||
void ShutdownGraphics() override {}
|
|
||||||
|
|
||||||
void UpdateSound() override {}
|
void UpdateSound() override {}
|
||||||
|
|
||||||
bool AttemptLoadSymbolMap() override {
|
bool AttemptLoadSymbolMap() override {
|
||||||
|
|
|
@ -24,9 +24,6 @@ class NativeHost : public Host {
|
||||||
public:
|
public:
|
||||||
NativeHost() {}
|
NativeHost() {}
|
||||||
|
|
||||||
bool InitGraphics(std::string *error_message, GraphicsContext **ctx) override { return true; }
|
|
||||||
void ShutdownGraphics() override {}
|
|
||||||
|
|
||||||
void UpdateSound() override {}
|
void UpdateSound() override {}
|
||||||
|
|
||||||
bool AttemptLoadSymbolMap() override {return false;}
|
bool AttemptLoadSymbolMap() override {return false;}
|
||||||
|
|
|
@ -54,15 +54,6 @@ void UWPHost::SetConsolePosition() {
|
||||||
void UWPHost::UpdateConsolePosition() {
|
void UWPHost::UpdateConsolePosition() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool UWPHost::InitGraphics(std::string *error_message, GraphicsContext **ctx) {
|
|
||||||
// Done elsewhere
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void UWPHost::ShutdownGraphics() {
|
|
||||||
// Done elsewhere
|
|
||||||
}
|
|
||||||
|
|
||||||
void UWPHost::SetWindowTitle(const char *message) {
|
void UWPHost::SetWindowTitle(const char *message) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,10 +12,7 @@ public:
|
||||||
UWPHost();
|
UWPHost();
|
||||||
~UWPHost();
|
~UWPHost();
|
||||||
|
|
||||||
// If returns false, will return a null context
|
|
||||||
bool InitGraphics(std::string *error_message, GraphicsContext **ctx) override;
|
|
||||||
void PollControllers() override;
|
void PollControllers() override;
|
||||||
void ShutdownGraphics() override;
|
|
||||||
|
|
||||||
void UpdateSound() override;
|
void UpdateSound() override;
|
||||||
|
|
||||||
|
|
|
@ -109,13 +109,6 @@ void WindowsHost::UpdateConsolePosition() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WindowsHost::InitGraphics(std::string *error_message, GraphicsContext **ctx) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WindowsHost::ShutdownGraphics() {
|
|
||||||
}
|
|
||||||
|
|
||||||
void WindowsHost::SetWindowTitle(const char *message) {
|
void WindowsHost::SetWindowTitle(const char *message) {
|
||||||
#ifdef GOLD
|
#ifdef GOLD
|
||||||
const char *name = "PPSSPP Gold ";
|
const char *name = "PPSSPP Gold ";
|
||||||
|
|
|
@ -32,10 +32,7 @@ public:
|
||||||
UpdateConsolePosition();
|
UpdateConsolePosition();
|
||||||
}
|
}
|
||||||
|
|
||||||
// If returns false, will return a null context
|
|
||||||
bool InitGraphics(std::string *error_message, GraphicsContext **ctx) override;
|
|
||||||
void PollControllers() override;
|
void PollControllers() override;
|
||||||
void ShutdownGraphics() override;
|
|
||||||
|
|
||||||
void UpdateSound() override;
|
void UpdateSound() override;
|
||||||
|
|
||||||
|
@ -50,8 +47,6 @@ public:
|
||||||
void NotifyUserMessage(const std::string &message, float duration = 1.0f, u32 color = 0x00FFFFFF, const char *id = nullptr) override;
|
void NotifyUserMessage(const std::string &message, float duration = 1.0f, u32 color = 0x00FFFFFF, const char *id = nullptr) override;
|
||||||
void SendUIMessage(const std::string &message, const std::string &value) override;
|
void SendUIMessage(const std::string &message, const std::string &value) override;
|
||||||
|
|
||||||
GraphicsContext *GetGraphicsContext() { return gfx_; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SetConsolePosition();
|
void SetConsolePosition();
|
||||||
void UpdateConsolePosition();
|
void UpdateConsolePosition();
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit b34f619e1c85810dcb3c578107d2e48ba4ee2b37
|
Subproject commit 77551c429f86c0e077f26552b7c1c0f12a9f235e
|
|
@ -409,12 +409,11 @@ int main(int argc, const char* argv[])
|
||||||
g_threadManager.Init(cpu_info.num_cores, cpu_info.logical_cpu_count);
|
g_threadManager.Init(cpu_info.num_cores, cpu_info.logical_cpu_count);
|
||||||
|
|
||||||
HeadlessHost *headlessHost = getHost(gpuCore);
|
HeadlessHost *headlessHost = getHost(gpuCore);
|
||||||
headlessHost->SetGraphicsCore(gpuCore);
|
|
||||||
host = headlessHost;
|
host = headlessHost;
|
||||||
|
|
||||||
std::string error_string;
|
std::string error_string;
|
||||||
GraphicsContext *graphicsContext = nullptr;
|
GraphicsContext *graphicsContext = nullptr;
|
||||||
bool glWorking = host->InitGraphics(&error_string, &graphicsContext);
|
bool glWorking = ((HeadlessHost *)host)->InitGraphics(&error_string, &graphicsContext, gpuCore);
|
||||||
|
|
||||||
CoreParameter coreParameter;
|
CoreParameter coreParameter;
|
||||||
coreParameter.cpuCore = cpuCore;
|
coreParameter.cpuCore = cpuCore;
|
||||||
|
@ -578,7 +577,7 @@ int main(int argc, const char* argv[])
|
||||||
ShutdownWebServer();
|
ShutdownWebServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
host->ShutdownGraphics();
|
((HeadlessHost *)host)->ShutdownGraphics();
|
||||||
delete host;
|
delete host;
|
||||||
host = nullptr;
|
host = nullptr;
|
||||||
headlessHost = nullptr;
|
headlessHost = nullptr;
|
||||||
|
|
|
@ -165,7 +165,7 @@ bool GLDummyGraphicsContext::InitFromRenderThread(std::string *errorMessage) {
|
||||||
return success;
|
return success;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SDLHeadlessHost::InitGraphics(std::string *error_message, GraphicsContext **ctx) {
|
bool SDLHeadlessHost::InitGraphics(std::string *error_message, GraphicsContext **ctx, GPUCore core) {
|
||||||
GraphicsContext *graphicsContext = new GLDummyGraphicsContext();
|
GraphicsContext *graphicsContext = new GLDummyGraphicsContext();
|
||||||
*ctx = graphicsContext;
|
*ctx = graphicsContext;
|
||||||
gfx_ = graphicsContext;
|
gfx_ = graphicsContext;
|
||||||
|
|
|
@ -30,7 +30,7 @@ typedef void *SDL_GLContext;
|
||||||
class SDLHeadlessHost : public HeadlessHost
|
class SDLHeadlessHost : public HeadlessHost
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool InitGraphics(std::string *error_message, GraphicsContext **ctx) override;
|
bool InitGraphics(std::string *error_message, GraphicsContext **ctx, GPUCore core) override;
|
||||||
void ShutdownGraphics() override;
|
void ShutdownGraphics() override;
|
||||||
|
|
||||||
void SwapBuffers() override;
|
void SwapBuffers() override;
|
||||||
|
|
|
@ -23,12 +23,10 @@
|
||||||
#include "Core/Host.h"
|
#include "Core/Host.h"
|
||||||
#include "Core/Debugger/SymbolMap.h"
|
#include "Core/Debugger/SymbolMap.h"
|
||||||
|
|
||||||
// TODO: Get rid of this junk
|
|
||||||
class HeadlessHost : public Host {
|
class HeadlessHost : public Host {
|
||||||
public:
|
public:
|
||||||
void SetGraphicsCore(GPUCore core) { gpuCore_ = core; }
|
virtual bool InitGraphics(std::string *error_message, GraphicsContext **ctx, GPUCore core) {return false;}
|
||||||
bool InitGraphics(std::string *error_message, GraphicsContext **ctx) override {return false;}
|
virtual void ShutdownGraphics() {}
|
||||||
void ShutdownGraphics() override {}
|
|
||||||
|
|
||||||
void UpdateSound() override {}
|
void UpdateSound() override {}
|
||||||
|
|
||||||
|
|
|
@ -72,8 +72,9 @@ void WindowsHeadlessHost::SendDebugOutput(const std::string &output)
|
||||||
OutputDebugStringUTF8(output.c_str());
|
OutputDebugStringUTF8(output.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WindowsHeadlessHost::InitGraphics(std::string *error_message, GraphicsContext **ctx) {
|
bool WindowsHeadlessHost::InitGraphics(std::string *error_message, GraphicsContext **ctx, GPUCore core) {
|
||||||
hWnd = CreateHiddenWindow();
|
hWnd = CreateHiddenWindow();
|
||||||
|
gpuCore_ = core;
|
||||||
|
|
||||||
if (WINDOW_VISIBLE) {
|
if (WINDOW_VISIBLE) {
|
||||||
ShowWindow(hWnd, TRUE);
|
ShowWindow(hWnd, TRUE);
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
class WindowsHeadlessHost : public HeadlessHost
|
class WindowsHeadlessHost : public HeadlessHost
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
bool InitGraphics(std::string *error_message, GraphicsContext **ctx) override;
|
bool InitGraphics(std::string *error_message, GraphicsContext **ctx, GPUCore core) override;
|
||||||
void ShutdownGraphics() override;
|
void ShutdownGraphics() override;
|
||||||
|
|
||||||
void SwapBuffers() override;
|
void SwapBuffers() override;
|
||||||
|
|
|
@ -386,8 +386,6 @@ class LibretroHost : public Host
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LibretroHost() {}
|
LibretroHost() {}
|
||||||
bool InitGraphics(std::string *error_message, GraphicsContext **ctx) override { return true; }
|
|
||||||
void ShutdownGraphics() override {}
|
|
||||||
void UpdateSound() override
|
void UpdateSound() override
|
||||||
{
|
{
|
||||||
int hostAttemptBlockSize = __AudioGetHostAttemptBlockSize();
|
int hostAttemptBlockSize = __AudioGetHostAttemptBlockSize();
|
||||||
|
|
Loading…
Add table
Reference in a new issue