Files
metin2-client/src/port/EterLib/GrpRenderTargetTexture.h
T
shenleiandClaude Opus 5.5 84404cf1f1 Model preview: AVA2 render-target window on a Vulkan colour target
Port of AVA2's CRenderTarget / GrpRenderTargetTexture / renderTarget module.
The host gains an RGBA8 offscreen colour pass for D3D colour render targets;
mt_preview shows wearable items on every allowed race and monsters with
motions, reached by X+click in the inventory and shop and from the wiki.
Player races are created as TYPE_PC so their parts exist.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 04:48:07 +09:00

44 lines
1.3 KiB
C++

#pragma once
// PORT: AVA2 CGraphicRenderTargetTexture (model preview). On the recording device a 32-bit render-target
// texture is a GPU colour target ("rt:<id>:<w>x<h>:c"); see platform/EterLib/RecordingDevice.cpp.
#include "GrpBase.h"
#include "GrpTexture.h"
class CGraphicRenderTargetTexture : public CGraphicTexture
{
public:
CGraphicRenderTargetTexture();
virtual ~CGraphicRenderTargetTexture();
public:
bool Create(int width, int height, D3DFORMAT texFormat, D3DFORMAT depthFormat);
void CreateTextures();
bool CreateRenderTexture(int width, int height, D3DFORMAT format);
bool CreateRenderDepthStencil(int width, int height, D3DFORMAT format);
void SetRenderTarget();
void ResetRenderTarget();
void SetRenderingRect(RECT* rect){ m_renderRect = *rect; }
RECT* GetRenderingRect(){ return &m_renderRect; }
LPDIRECT3DTEXTURE8 GetRenderTargetTexture() const { return m_lpd3dRenderTexture; }
void ReleaseTextures();
static void Clear();
void Render() const;
protected:
void Reset();
LPDIRECT3DTEXTURE8 m_lpd3dRenderTexture{};
LPDIRECT3DSURFACE8 m_lpd3dRenderTargetSurface{};
LPDIRECT3DSURFACE8 m_lpd3dDepthSurface{};
LPDIRECT3DSURFACE8 m_lpd3dOriginalRenderTarget{};
LPDIRECT3DSURFACE8 m_lpd3dOldDepthBufferSurface{};
D3DFORMAT m_d3dFormat;
D3DFORMAT m_depthStencilFormat;
RECT m_renderRect{};
};