Store driver name and description in MxDirect3D

This commit is contained in:
Anonymous Maarten 2025-06-09 15:58:10 +02:00
parent 9af819ab5b
commit 95750f456d
13 changed files with 19 additions and 37 deletions

View File

@ -580,14 +580,16 @@ MxResult IsleApp::SetupWindow()
LegoOmni::GetInstance()->GetInputManager()->SetUseJoystick(m_useJoystick);
LegoOmni::GetInstance()->GetInputManager()->SetJoystickIndex(m_joystickIndex);
}
IDirect3DRMMiniwinDevice* d3drmMiniwinDev = GetD3DRMMiniwinDevice();
if (d3drmMiniwinDev) {
char buffer[256];
if (SUCCEEDED(d3drmMiniwinDev->GetDescription(buffer, sizeof(buffer)))) {
SDL_Log("D3DRM device: %s", buffer);
}
d3drmMiniwinDev->Release();
MxDirect3D* d3d = LegoOmni::GetInstance()->GetVideoManager()->GetDirect3D();
if (d3d) {
SDL_Log(
"Direct3D driver name=\"%s\" description=\"%s\"",
d3d->GetDeviceName().c_str(),
d3d->GetDeviceDescription().c_str()
);
}
else {
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "Failed to get D3D device name and description");
}
}

View File

@ -312,6 +312,8 @@ BOOL MxDirect3D::SetDevice(MxDeviceEnumerate& p_deviceEnumerate, MxDriver* p_dri
d->m_desc = device.m_HELDesc;
}
m_deviceName = p_device->m_deviceName;
m_deviceDesc = p_device->m_deviceDesc;
m_currentDeviceInfo = d;
m_currentDevInfo = d->m_deviceInfo;
break;

View File

@ -6,6 +6,8 @@
#include "mxdirectxinfo.h"
#include "mxstl/stlcompat.h"
#include <string>
#ifdef MINIWIN
#include "miniwin/d3d.h"
#else
@ -44,6 +46,9 @@ class MxDirect3D : public MxDirectDraw {
BOOL SetDevice(MxDeviceEnumerate& p_deviceEnumerate, MxDriver* p_driver, Direct3DDeviceInfo* p_device);
const std::string& GetDeviceName() const { return m_deviceName; }
const std::string& GetDeviceDescription() const { return m_deviceDesc; }
protected:
BOOL D3DCreate();
BOOL D3DSetMode();
@ -60,6 +65,8 @@ class MxDirect3D : public MxDirectDraw {
IDirect3DDevice2* m_pDirect3dDevice; // 0x888
BOOL m_bTexturesDisabled; // 0x88c
undefined4 m_unk0x890; // 0x890
std::string m_deviceName;
std::string m_deviceDesc;
};
// GLOBAL: LEGO1 0x100dd1b0

View File

@ -5,5 +5,4 @@ DEFINE_GUID(IID_IDirect3DRMMiniwinDevice, 0x6eb09673, 0x8d30, 0x4d8a, 0x8d, 0x81
struct IDirect3DRMMiniwinDevice : virtual public IUnknown {
virtual float GetShininessFactor() = 0;
virtual HRESULT SetShininessFactor(float factor) = 0;
virtual HRESULT GetDescription(char* buffer, int bufferSize) = 0;
};

View File

@ -411,9 +411,3 @@ HRESULT OpenGL15Renderer::FinalizeFrame()
return DD_OK;
}
HRESULT OpenGL15Renderer::GetDescription(char* buffer, int bufferSize)
{
SDL_strlcpy(buffer, "Miniwin OpenGL 1.5 renderer", bufferSize);
return DD_OK;
}

View File

@ -772,9 +772,3 @@ HRESULT Direct3DRMSDL3GPURenderer::FinalizeFrame()
return DD_OK;
}
HRESULT Direct3DRMSDL3GPURenderer::GetDescription(char* buffer, int bufferSize)
{
SDL_strlcpy(buffer, "Miniwin SDL3_gpu renderer", bufferSize);
return DD_OK;
}

View File

@ -540,9 +540,3 @@ HRESULT Direct3DRMSoftwareRenderer::FinalizeFrame()
return DD_OK;
}
HRESULT Direct3DRMSoftwareRenderer::GetDescription(char* buffer, int bufferSize)
{
SDL_strlcpy(buffer, "Miniwin software renderer", bufferSize);
return DD_OK;
}

View File

@ -148,8 +148,3 @@ HRESULT Direct3DRMDevice2Impl::SetShininessFactor(float factor)
{
return m_renderer->SetShininessFactor(factor);
}
HRESULT Direct3DRMDevice2Impl::GetDescription(char* buffer, int bufferSize)
{
return m_renderer->GetDescription(buffer, bufferSize);
}

View File

@ -35,7 +35,6 @@ struct Direct3DRMDevice2Impl : public Direct3DRMObjectBaseImpl<IDirect3DRMDevice
// IDirect3DRMMiniwinDevice interface
float GetShininessFactor() override;
HRESULT SetShininessFactor(float factor) override;
HRESULT GetDescription(char* buffer, int bufferSize) override;
Direct3DRMRenderer* m_renderer;

View File

@ -60,7 +60,6 @@ class Direct3DRMRenderer : public IDirect3DDevice2 {
m_shininessFactor = factor;
return DD_OK;
}
virtual HRESULT GetDescription(char* buffer, int bufferSize) = 0;
protected:
float m_shininessFactor = 1.f;

View File

@ -39,7 +39,6 @@ class OpenGL15Renderer : public Direct3DRMRenderer {
const Appearance& appearance
) override;
HRESULT FinalizeFrame() override;
HRESULT GetDescription(char* buffer, int bufferSize) override;
private:
void AddTextureDestroyCallback(Uint32 id, IDirect3DRMTexture* texture);

View File

@ -56,7 +56,6 @@ class Direct3DRMSDL3GPURenderer : public Direct3DRMRenderer {
const Appearance& appearance
) override;
HRESULT FinalizeFrame() override;
HRESULT GetDescription(char* buffer, int bufferSize) override;
private:
Direct3DRMSDL3GPURenderer(

View File

@ -37,7 +37,6 @@ class Direct3DRMSoftwareRenderer : public Direct3DRMRenderer {
const Appearance& appearance
) override;
HRESULT FinalizeFrame() override;
HRESULT GetDescription(char* buffer, int bufferSize) override;
private:
void ClearZBuffer();