rodecomp/Source/Render/DX9/SurfaceDX9.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

42 lines
1.3 KiB
C++

#ifndef RAGNAROK_SOURCE_RENDER_DX9_SURFACEDX9_H
#define RAGNAROK_SOURCE_RENDER_DX9_SURFACEDX9_H
#include "Render/Textures/Surface.h"
#include <d3d9.h>
struct SurfaceDX9Context {
IDirect3DDevice9* device;
D3DSURFACE_DESC backBufferDescription;
IDirect3DSurface9* backBuffer;
};
class CSurfaceDX9 : public CSurface {
public:
CSurfaceDX9(SurfaceDX9Context& context, int width, int height);
CSurfaceDX9(SurfaceDX9Context& context, IDirect3DSurface9* surface);
~CSurfaceDX9() override;
std::uint32_t Width() override;
std::uint32_t Height() override;
bool Resize(int width, int height) override;
SurfaceLock Lock() override;
void Unlock() override;
bool GetDC(HDC* output) override;
void ReleaseDC(HDC dc) override;
void Upload(int x, int y, int width, int height, const std::uint32_t* pixels, int option, int sourceWidth) override;
void Fill(const RECT* rectangle, std::uint32_t color) override;
void Draw(int x, int y, int width, int height, std::uint32_t color) override;
void Stretch(int x, int y, int width, int height) override;
protected:
/* 0004 */ SurfaceDX9Context* m_context;
/* 0008 */ std::uint32_t m_width;
/* 000C */ std::uint32_t m_height;
/* 0010 */ IDirect3DSurface9* m_surface;
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(CSurfaceDX9) == 20);
#endif
#endif