#pragma once
#include "global.h"
#include "MyStructDef.h"
class CBrushPreview : public CDialog
{
	DECLARE_DYNAMIC(CBrushPreview)
	DECLARE_MESSAGE_MAP()
public:
	CBrushPreview(CWnd* pParent = nullptr);   // 标准构造函数
	virtual ~CBrushPreview();
	// 对话框数据
#ifdef AFX_DESIGN_TIME
	enum { IDD = IDD_CBRUSHPREVIEW };
#endif
	MyView* pBrushView = nullptr;
	void Draw();
	void Load(CString pxaName);//载入贴图png文件
	void ResetContext();
	void RefreshImage();
protected:
	void DoDataExchange(CDataExchange* pDX) override;
	BOOL OnInitDialog() override;
public:
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
	afx_msg void OnPaint();
private:
	//渲染器
	MyDX11Renderer pRenderer;
	//载入的贴图
	MyTextureAndSRV tas;
	MyTextureAndSRV tas_nullpxa;
	CString loadedPxaName;
};

