mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-02-03 12:31:15 +00:00
Store driver name and description in MxDirect3D
This commit is contained in:
parent
9af819ab5b
commit
95750f456d
@ -580,14 +580,16 @@ MxResult IsleApp::SetupWindow()
|
|||||||
LegoOmni::GetInstance()->GetInputManager()->SetUseJoystick(m_useJoystick);
|
LegoOmni::GetInstance()->GetInputManager()->SetUseJoystick(m_useJoystick);
|
||||||
LegoOmni::GetInstance()->GetInputManager()->SetJoystickIndex(m_joystickIndex);
|
LegoOmni::GetInstance()->GetInputManager()->SetJoystickIndex(m_joystickIndex);
|
||||||
}
|
}
|
||||||
|
MxDirect3D* d3d = LegoOmni::GetInstance()->GetVideoManager()->GetDirect3D();
|
||||||
IDirect3DRMMiniwinDevice* d3drmMiniwinDev = GetD3DRMMiniwinDevice();
|
if (d3d) {
|
||||||
if (d3drmMiniwinDev) {
|
SDL_Log(
|
||||||
char buffer[256];
|
"Direct3D driver name=\"%s\" description=\"%s\"",
|
||||||
if (SUCCEEDED(d3drmMiniwinDev->GetDescription(buffer, sizeof(buffer)))) {
|
d3d->GetDeviceName().c_str(),
|
||||||
SDL_Log("D3DRM device: %s", buffer);
|
d3d->GetDeviceDescription().c_str()
|
||||||
}
|
);
|
||||||
d3drmMiniwinDev->Release();
|
}
|
||||||
|
else {
|
||||||
|
SDL_LogWarn(SDL_LOG_CATEGORY_APPLICATION, "Failed to get D3D device name and description");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -312,6 +312,8 @@ BOOL MxDirect3D::SetDevice(MxDeviceEnumerate& p_deviceEnumerate, MxDriver* p_dri
|
|||||||
d->m_desc = device.m_HELDesc;
|
d->m_desc = device.m_HELDesc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_deviceName = p_device->m_deviceName;
|
||||||
|
m_deviceDesc = p_device->m_deviceDesc;
|
||||||
m_currentDeviceInfo = d;
|
m_currentDeviceInfo = d;
|
||||||
m_currentDevInfo = d->m_deviceInfo;
|
m_currentDevInfo = d->m_deviceInfo;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -6,6 +6,8 @@
|
|||||||
#include "mxdirectxinfo.h"
|
#include "mxdirectxinfo.h"
|
||||||
#include "mxstl/stlcompat.h"
|
#include "mxstl/stlcompat.h"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#ifdef MINIWIN
|
#ifdef MINIWIN
|
||||||
#include "miniwin/d3d.h"
|
#include "miniwin/d3d.h"
|
||||||
#else
|
#else
|
||||||
@ -44,6 +46,9 @@ class MxDirect3D : public MxDirectDraw {
|
|||||||
|
|
||||||
BOOL SetDevice(MxDeviceEnumerate& p_deviceEnumerate, MxDriver* p_driver, Direct3DDeviceInfo* p_device);
|
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:
|
protected:
|
||||||
BOOL D3DCreate();
|
BOOL D3DCreate();
|
||||||
BOOL D3DSetMode();
|
BOOL D3DSetMode();
|
||||||
@ -60,6 +65,8 @@ class MxDirect3D : public MxDirectDraw {
|
|||||||
IDirect3DDevice2* m_pDirect3dDevice; // 0x888
|
IDirect3DDevice2* m_pDirect3dDevice; // 0x888
|
||||||
BOOL m_bTexturesDisabled; // 0x88c
|
BOOL m_bTexturesDisabled; // 0x88c
|
||||||
undefined4 m_unk0x890; // 0x890
|
undefined4 m_unk0x890; // 0x890
|
||||||
|
std::string m_deviceName;
|
||||||
|
std::string m_deviceDesc;
|
||||||
};
|
};
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100dd1b0
|
// GLOBAL: LEGO1 0x100dd1b0
|
||||||
|
|||||||
@ -5,5 +5,4 @@ DEFINE_GUID(IID_IDirect3DRMMiniwinDevice, 0x6eb09673, 0x8d30, 0x4d8a, 0x8d, 0x81
|
|||||||
struct IDirect3DRMMiniwinDevice : virtual public IUnknown {
|
struct IDirect3DRMMiniwinDevice : virtual public IUnknown {
|
||||||
virtual float GetShininessFactor() = 0;
|
virtual float GetShininessFactor() = 0;
|
||||||
virtual HRESULT SetShininessFactor(float factor) = 0;
|
virtual HRESULT SetShininessFactor(float factor) = 0;
|
||||||
virtual HRESULT GetDescription(char* buffer, int bufferSize) = 0;
|
|
||||||
};
|
};
|
||||||
|
|||||||
@ -411,9 +411,3 @@ HRESULT OpenGL15Renderer::FinalizeFrame()
|
|||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT OpenGL15Renderer::GetDescription(char* buffer, int bufferSize)
|
|
||||||
{
|
|
||||||
SDL_strlcpy(buffer, "Miniwin OpenGL 1.5 renderer", bufferSize);
|
|
||||||
return DD_OK;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -772,9 +772,3 @@ HRESULT Direct3DRMSDL3GPURenderer::FinalizeFrame()
|
|||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT Direct3DRMSDL3GPURenderer::GetDescription(char* buffer, int bufferSize)
|
|
||||||
{
|
|
||||||
SDL_strlcpy(buffer, "Miniwin SDL3_gpu renderer", bufferSize);
|
|
||||||
return DD_OK;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -540,9 +540,3 @@ HRESULT Direct3DRMSoftwareRenderer::FinalizeFrame()
|
|||||||
|
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT Direct3DRMSoftwareRenderer::GetDescription(char* buffer, int bufferSize)
|
|
||||||
{
|
|
||||||
SDL_strlcpy(buffer, "Miniwin software renderer", bufferSize);
|
|
||||||
return DD_OK;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -148,8 +148,3 @@ HRESULT Direct3DRMDevice2Impl::SetShininessFactor(float factor)
|
|||||||
{
|
{
|
||||||
return m_renderer->SetShininessFactor(factor);
|
return m_renderer->SetShininessFactor(factor);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT Direct3DRMDevice2Impl::GetDescription(char* buffer, int bufferSize)
|
|
||||||
{
|
|
||||||
return m_renderer->GetDescription(buffer, bufferSize);
|
|
||||||
}
|
|
||||||
|
|||||||
@ -35,7 +35,6 @@ struct Direct3DRMDevice2Impl : public Direct3DRMObjectBaseImpl<IDirect3DRMDevice
|
|||||||
// IDirect3DRMMiniwinDevice interface
|
// IDirect3DRMMiniwinDevice interface
|
||||||
float GetShininessFactor() override;
|
float GetShininessFactor() override;
|
||||||
HRESULT SetShininessFactor(float factor) override;
|
HRESULT SetShininessFactor(float factor) override;
|
||||||
HRESULT GetDescription(char* buffer, int bufferSize) override;
|
|
||||||
|
|
||||||
Direct3DRMRenderer* m_renderer;
|
Direct3DRMRenderer* m_renderer;
|
||||||
|
|
||||||
|
|||||||
@ -60,7 +60,6 @@ class Direct3DRMRenderer : public IDirect3DDevice2 {
|
|||||||
m_shininessFactor = factor;
|
m_shininessFactor = factor;
|
||||||
return DD_OK;
|
return DD_OK;
|
||||||
}
|
}
|
||||||
virtual HRESULT GetDescription(char* buffer, int bufferSize) = 0;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
float m_shininessFactor = 1.f;
|
float m_shininessFactor = 1.f;
|
||||||
|
|||||||
@ -39,7 +39,6 @@ class OpenGL15Renderer : public Direct3DRMRenderer {
|
|||||||
const Appearance& appearance
|
const Appearance& appearance
|
||||||
) override;
|
) override;
|
||||||
HRESULT FinalizeFrame() override;
|
HRESULT FinalizeFrame() override;
|
||||||
HRESULT GetDescription(char* buffer, int bufferSize) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void AddTextureDestroyCallback(Uint32 id, IDirect3DRMTexture* texture);
|
void AddTextureDestroyCallback(Uint32 id, IDirect3DRMTexture* texture);
|
||||||
|
|||||||
@ -56,7 +56,6 @@ class Direct3DRMSDL3GPURenderer : public Direct3DRMRenderer {
|
|||||||
const Appearance& appearance
|
const Appearance& appearance
|
||||||
) override;
|
) override;
|
||||||
HRESULT FinalizeFrame() override;
|
HRESULT FinalizeFrame() override;
|
||||||
HRESULT GetDescription(char* buffer, int bufferSize) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Direct3DRMSDL3GPURenderer(
|
Direct3DRMSDL3GPURenderer(
|
||||||
|
|||||||
@ -37,7 +37,6 @@ class Direct3DRMSoftwareRenderer : public Direct3DRMRenderer {
|
|||||||
const Appearance& appearance
|
const Appearance& appearance
|
||||||
) override;
|
) override;
|
||||||
HRESULT FinalizeFrame() override;
|
HRESULT FinalizeFrame() override;
|
||||||
HRESULT GetDescription(char* buffer, int bufferSize) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ClearZBuffer();
|
void ClearZBuffer();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user