rodecomp/Source/Render/Textures/Surface.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

37 lines
1 KiB
C++

#ifndef RAGNAROK_SOURCE_RENDER_TEXTURES_SURFACE_H
#define RAGNAROK_SOURCE_RENDER_TEXTURES_SURFACE_H
#include <cstdint>
#include <windows.h>
struct SurfaceLock {
bool success;
void* pixels;
int pitch;
std::uint32_t width;
std::uint32_t height;
int bitsPerPixel;
};
class CSurface {
public:
virtual ~CSurface();
virtual std::uint32_t Width() = 0;
virtual std::uint32_t Height() = 0;
virtual bool Resize(int width, int height) = 0;
virtual SurfaceLock Lock() = 0;
virtual void Unlock() = 0;
virtual bool GetDC(HDC* output) = 0;
virtual void ReleaseDC(HDC dc) = 0;
virtual void Upload(int x, int y, int width, int height, const std::uint32_t* pixels, int option, int sourceWidth) = 0;
virtual void Fill(const RECT* rectangle, std::uint32_t color) = 0;
virtual void Draw(int x, int y, int width, int height, std::uint32_t color) = 0;
virtual void Stretch(int x, int y, int width, int height) = 0;
};
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(CSurface) == 4);
static_assert(sizeof(SurfaceLock) == 24);
#endif
#endif