⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 panel.h

📁 对游戏编程感兴趣的 朋友可以 下载下来看看 对DX讲解的很很详细
💻 H
字号:
// Panel.h: interface for the CPanel class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PANEL_H__22B0FAAD_937B_41CF_848E_C899BC8CEF50__INCLUDED_)
#define AFX_PANEL_H__22B0FAAD_937B_41CF_848E_C899BC8CEF50__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "Base.h"

#define PANEL_D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1)

class CPanel : public CBase  
{
private:
	//Define a custom vertex for our panel
	struct PANEL_CUSTOMVERTEX
	{
		FLOAT x, y, z;		//Position of vertex
		DWORD colour;		//Colour of vertex
		FLOAT u, v;			//Texture coordinates
	};

public:
	void MoveTo(int x, int y);
	DWORD Render();
	CPanel(LPDIRECT3DDEVICE8 pD3DDevice, int nWidth, int nHeight, int nScreenWidth, int nScreenHeight, DWORD dwColour = -1);
	virtual ~CPanel();
	bool SetTexture(const char *szTextureFilePath, DWORD dwKeyColour = 0);

private:
	bool UpdateVertices();
	bool CreateVertexBuffer();
	LPDIRECT3DDEVICE8 m_pD3DDevice;
	LPDIRECT3DVERTEXBUFFER8 m_pVertexBuffer;
	LPDIRECT3DTEXTURE8 m_pTexture;
	int m_nWidth;
	int m_nHeight;
	int m_nScreenWidth;
	int m_nScreenHeight;
	DWORD m_dwColour;

};

#endif // !defined(AFX_PANEL_H__22B0FAAD_937B_41CF_848E_C899BC8CEF50__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -