rodecomp/Source/Render/DX9/DeviceOwnerDX9.h
ragnarok-clanker a47d20f8be Reconstruct readable C++ and organize cohesive source subsystems
Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.

Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
2026-10-25 07:42:41 +00:00

57 lines
1.8 KiB
C++

#ifndef RAGNAROK_SOURCE_RENDER_DX9_DEVICEOWNERDX9_H
#define RAGNAROK_SOURCE_RENDER_DX9_DEVICEOWNERDX9_H
#include "Render/DX9/DeviceStateDX9.h"
#include "Render/DX9/SurfaceDX9.h"
#include "Render/DX9/TextureDX9.h"
struct DeviceOptionsDX9 {
const int& fullscreen;
const int& width;
const int& height;
const int& dynamicTextures;
};
class DeviceOwnerDX9 {
public:
DeviceOwnerDX9();
DeviceOwnerDX9(const DeviceOwnerDX9&) = delete;
DeviceOwnerDX9& operator=(const DeviceOwnerDX9&) = delete;
HRESULT Initialize(HWND window, UINT adapter, const DeviceOptionsDX9& options);
HRESULT CreateDevice(UINT adapter, const DeviceOptionsDX9& options);
HRESULT AcquireBackBuffer();
UINT* AdjustTextureDimensions(UINT* output, UINT width, UINT height) const;
HRESULT Close();
HRESULT Present(int unused);
HRESULT ClipFullscreenCursor();
HRESULT CheckState(class CRenderSystemBase* renderSystem);
bool Begin(CRenderSystemBase* renderSystem);
void End();
bool CaptureBackBuffer();
bool RestoreBackBuffer();
SurfaceDX9Context SurfaceContext() const;
TextureDX9Context
TextureContext(D3DX9Runtime& d3dx, class RenderPrimitivePool& primitives, RenderQueues& queues, bool depthAlpha, float depthStart, float depthEnd) const;
/* 0000 */ HWND window;
/* 0004 */ IDirect3D9Ex* direct3D;
/* 0008 */ IDirect3DDevice9Ex* device;
/* 000C */ DeviceStateDX9 state;
/* 04DC */ UINT adapter;
/* 04E0 */ D3DPRESENT_PARAMETERS presentation;
/* 0518 */ D3DDISPLAYMODEEX displayMode;
/* 0530 */ D3DSURFACE_DESC backBufferDescription;
/* 0550 */ D3DCAPS9 caps;
/* 0680 */ IDirect3DSurface9* backBuffer;
/* 0684 */ IDirect3DSurface9* capturedBackBuffer;
/* 0688 */ bool dynamicTextures;
unsigned char unknown_0689[3];
/* 068C */ HRESULT lastPresent;
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(DeviceOwnerDX9) == 0x690);
#endif
#endif