Isle
Loading...
Searching...
No Matches
device.cpp
Go to the documentation of this file.
1#include "impl.h"
2
3#include <assert.h>
4#include <d3drmwin.h>
5
6using namespace TglImpl;
7
8// FUNCTION: LEGO1 0x100a2bf0
9// FUNCTION: BETA10 0x1016ddf0
11{
12 return reinterpret_cast<void*>(&m_data);
13}
14
15// FUNCTION: LEGO1 0x100a2c00
16unsigned long DeviceImpl::GetWidth()
17{
18 return m_data->GetWidth();
19}
20
21// FUNCTION: LEGO1 0x100a2c10
22unsigned long DeviceImpl::GetHeight()
23{
24 return m_data->GetHeight();
25}
26
27// FUNCTION: LEGO1 0x100a2c20
29{
30 return Success;
31}
32
33// FUNCTION: BETA10 0x1016e020
34inline Result DeviceSetShadingModel(IDirect3DRMDevice2* pDevice, ShadingModel model)
35{
36 D3DRMRENDERQUALITY renderQuality = Translate(model);
37 return ResultVal(pDevice->SetQuality(renderQuality));
38}
39
40// FUNCTION: LEGO1 0x100a2c30
41// FUNCTION: BETA10 0x1016dfc0
43{
44 assert(m_data);
45
46 return DeviceSetShadingModel(m_data, model);
47}
48
49// FUNCTION: LEGO1 0x100a2ca0
50Result DeviceImpl::SetShadeCount(unsigned long shadeCount)
51{
52 return ResultVal(m_data->SetShades(shadeCount));
53}
54
55// FUNCTION: LEGO1 0x100a2cc0
57{
58 return ResultVal(m_data->SetDither(dither));
59}
60
61// FUNCTION: LEGO1 0x100a2ce0
63{
64 // Device argument is intentionally unused.
65 IDirect3DRMWinDevice* winDevice;
66 if (ResultVal(m_data->QueryInterface(IID_IDirect3DRMWinDevice, (LPVOID*) &winDevice))) {
67 winDevice->HandleActivate(wParam);
68 winDevice->Release();
69 }
70}
71
72// FUNCTION: LEGO1 0x100a2d20
74{
75 IDirect3DRMWinDevice* winDevice;
76 if (SUCCEEDED(m_data->QueryInterface(IID_IDirect3DRMWinDevice, (LPVOID*) &winDevice))) {
77 winDevice->HandlePaint(p_dc);
78 winDevice->Release();
79 }
80}
81
82// FUNCTION: LEGO1 0x100a2d60
84{
85 return ResultVal(m_data->Update());
86}
87
88// GLOBAL: LEGO1 0x100dd1d0
89// IID_IDirect3DRMWinDevice
void HandleActivate(WORD) override
Handles application/window activation event [AI].
Definition: device.cpp:62
void * ImplementationDataPtr() override
Returns Direct3DRMDevice2 pointer as a generic implementation data pointer [AI].
Definition: device.cpp:10
unsigned long GetHeight() override
Returns the current device height in pixels [AI].
Definition: device.cpp:22
Result Update() override
Submits any pending updates to the device [AI].
Definition: device.cpp:83
Result SetDither(int) override
Enables or disables dithering [AI].
Definition: device.cpp:56
void HandlePaint(HDC) override
Handles window paint event [AI].
Definition: device.cpp:73
unsigned long GetWidth() override
Returns the current device width in pixels [AI].
Definition: device.cpp:16
Result SetShadingModel(ShadingModel) override
Sets the shading model (flat, Gouraud, etc.) [AI].
Definition: device.cpp:42
Result SetShadeCount(unsigned long) override
Sets number of shades [AI].
Definition: device.cpp:50
Result SetColorModel(ColorModel) override
Sets the color model used for rendering [AI].
Definition: device.cpp:28
LPSTR LPSTR LPVOID
Definition: d3dcaps.h:216
DWORD D3DRMRENDERQUALITY
Definition: d3drmdef.h:88
Result DeviceSetShadingModel(IDirect3DRMDevice2 *pDevice, ShadingModel model)
Definition: device.cpp:34
[AI] Forward declaration for Direct3DRMTexture interface [AI]
Definition: impl.h:23
Result ResultVal(HRESULT result)
Returns a Tgl Result value for HRESULT [AI].
Definition: impl.h:35
D3DRMRENDERQUALITY Translate(ShadingModel tglShadingModel)
Converts Tgl shading model enum to D3DRM enum [AI].
Definition: impl.h:1398
ShadingModel
[AI] Represents shading models available for rendering geometry.
Definition: tgl.h:29
Result
[AI] Result type used throughout the Tgl API to report operation success or failure.
Definition: tgl.h:126
@ Success
[AI] Operation succeeded. [AI]
Definition: tgl.h:128
ColorModel
[AI] Represents available color models for rendering.
Definition: tgl.h:18