mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-10 18:25:45 -04:00
More changes to accomodate Android - imgui/host display
This commit is contained in:

committed by
Connor McLaughlin

parent
f11d357ab9
commit
ea0b13a05c
@ -2,6 +2,7 @@
|
||||
#include "YBaseLib/Log.h"
|
||||
#include "YBaseLib/MD5Digest.h"
|
||||
#include "cpu_disasm.h"
|
||||
#include <cerrno>
|
||||
Log_SetChannel(BIOS);
|
||||
|
||||
namespace BIOS {
|
||||
@ -56,7 +57,7 @@ std::optional<Image> LoadImageFromFile(std::string_view filename)
|
||||
std::FILE* fp = std::fopen(filename_str.c_str(), "rb");
|
||||
if (!fp)
|
||||
{
|
||||
Log_ErrorPrintf("Failed to open BIOS image '%s'", filename_str.c_str());
|
||||
Log_ErrorPrintf("Failed to open BIOS image '%s', errno=%d", filename_str.c_str(), errno);
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
|
@ -34,8 +34,8 @@ bool GPU_HW_D3D11::Initialize(HostDisplay* host_display, System* system, DMA* dm
|
||||
if (!GPU_HW::Initialize(host_display, system, dma, interrupt_controller, timers))
|
||||
return false;
|
||||
|
||||
m_device = static_cast<ID3D11Device*>(host_display->GetHostRenderDevice());
|
||||
m_context = static_cast<ID3D11DeviceContext*>(host_display->GetHostRenderContext());
|
||||
m_device = static_cast<ID3D11Device*>(host_display->GetRenderDevice());
|
||||
m_context = static_cast<ID3D11DeviceContext*>(host_display->GetRenderContext());
|
||||
if (!m_device || !m_context)
|
||||
return false;
|
||||
|
||||
|
@ -29,8 +29,12 @@ public:
|
||||
virtual ~HostDisplay() {}
|
||||
|
||||
virtual RenderAPI GetRenderAPI() const = 0;
|
||||
virtual void* GetHostRenderDevice() const = 0;
|
||||
virtual void* GetHostRenderContext() const = 0;
|
||||
virtual void* GetRenderDevice() const = 0;
|
||||
virtual void* GetRenderContext() const = 0;
|
||||
virtual void* GetRenderWindow() const = 0;
|
||||
|
||||
/// Switches the render window, recreating the surface.
|
||||
virtual void ChangeRenderWindow(void* new_window) = 0;
|
||||
|
||||
/// Creates an abstracted RGBA8 texture. If dynamic, the texture can be updated with UpdateTexture() below.
|
||||
virtual std::unique_ptr<HostDisplayTexture> CreateTexture(u32 width, u32 height, const void* data, u32 data_stride,
|
||||
|
@ -78,16 +78,26 @@ HostDisplay::RenderAPI D3D11HostDisplay::GetRenderAPI() const
|
||||
return HostDisplay::RenderAPI::D3D11;
|
||||
}
|
||||
|
||||
void* D3D11HostDisplay::GetHostRenderDevice() const
|
||||
void* D3D11HostDisplay::GetRenderDevice() const
|
||||
{
|
||||
return m_device.Get();
|
||||
}
|
||||
|
||||
void* D3D11HostDisplay::GetHostRenderContext() const
|
||||
void* D3D11HostDisplay::GetRenderContext() const
|
||||
{
|
||||
return m_context.Get();
|
||||
}
|
||||
|
||||
void* D3D11HostDisplay::GetRenderWindow() const
|
||||
{
|
||||
return m_window;
|
||||
}
|
||||
|
||||
void D3D11HostDisplay::ChangeRenderWindow(void* new_window)
|
||||
{
|
||||
Panic("Not supported");
|
||||
}
|
||||
|
||||
std::unique_ptr<HostDisplayTexture> D3D11HostDisplay::CreateTexture(u32 width, u32 height, const void* data,
|
||||
u32 data_stride, bool dynamic)
|
||||
{
|
||||
|
@ -20,8 +20,11 @@ public:
|
||||
static std::unique_ptr<HostDisplay> Create(SDL_Window* window);
|
||||
|
||||
RenderAPI GetRenderAPI() const override;
|
||||
void* GetHostRenderDevice() const override;
|
||||
void* GetHostRenderContext() const override;
|
||||
void* GetRenderDevice() const override;
|
||||
void* GetRenderContext() const override;
|
||||
void* GetRenderWindow() const override;
|
||||
|
||||
void ChangeRenderWindow(void* new_window) override;
|
||||
|
||||
std::unique_ptr<HostDisplayTexture> CreateTexture(u32 width, u32 height, const void* data, u32 data_stride,
|
||||
bool dynamic) override;
|
||||
|
@ -80,16 +80,26 @@ HostDisplay::RenderAPI OpenGLHostDisplay::GetRenderAPI() const
|
||||
return m_is_gles ? HostDisplay::RenderAPI::OpenGLES : HostDisplay::RenderAPI::OpenGL;
|
||||
}
|
||||
|
||||
void* OpenGLHostDisplay::GetHostRenderDevice() const
|
||||
void* OpenGLHostDisplay::GetRenderDevice() const
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void* OpenGLHostDisplay::GetHostRenderContext() const
|
||||
void* OpenGLHostDisplay::GetRenderContext() const
|
||||
{
|
||||
return m_gl_context;
|
||||
}
|
||||
|
||||
void* OpenGLHostDisplay::GetRenderWindow() const
|
||||
{
|
||||
return m_window;
|
||||
}
|
||||
|
||||
void OpenGLHostDisplay::ChangeRenderWindow(void* new_window)
|
||||
{
|
||||
Panic("Not implemented");
|
||||
}
|
||||
|
||||
std::unique_ptr<HostDisplayTexture> OpenGLHostDisplay::CreateTexture(u32 width, u32 height, const void* data,
|
||||
u32 data_stride, bool dynamic)
|
||||
{
|
||||
|
@ -15,8 +15,11 @@ public:
|
||||
static std::unique_ptr<HostDisplay> Create(SDL_Window* window);
|
||||
|
||||
RenderAPI GetRenderAPI() const override;
|
||||
void* GetHostRenderDevice() const override;
|
||||
void* GetHostRenderContext() const override;
|
||||
void* GetRenderDevice() const override;
|
||||
void* GetRenderContext() const override;
|
||||
void* GetRenderWindow() const override;
|
||||
|
||||
void ChangeRenderWindow(void* new_window) override;
|
||||
|
||||
std::unique_ptr<HostDisplayTexture> CreateTexture(u32 width, u32 height, const void* data, u32 data_stride,
|
||||
bool dynamic) override;
|
||||
|
Reference in New Issue
Block a user