cuboid.h

来自「3D俄罗斯方块源码.rar」· C头文件 代码 · 共 50 行

H
50
字号
#ifndef _CUBOID_H
#define _CUBOID_H
/********************************************************************
文件名: CUBOID.h
Copyright (c)2004  红孩儿工作室
创建人  : 卞安
创建时间: 2004-5-18 12:33:30
版本: 1.0
类名: CCuboid
说明:
	正方体类
********************************************************************/
#include <d3dx8.h>
#include "BASIC.h"
//---------------------------------------------------------------
#define CUBIOD_D3DFVF_CUSTOMVERTEX (D3DFVF_XYZ|D3DFVF_DIFFUSE|D3DFVF_TEX1)
class CCuboid  
{
public:
	bool SetTexture(const char* szTextureFilePath);
	bool SetPosition(float x, float y, float z);
	bool SetSize(float rWidth, float rHeight, float rDepth);
	bool Render();
	CCuboid(LPDIRECT3DDEVICE8 pD3DDevice);
	virtual ~CCuboid();

private:
	bool UpdateVertices();
	HRESULT CreateVertexBuffer();
	LPDIRECT3DDEVICE8 m_pD3DDevice;
	LPDIRECT3DVERTEXBUFFER8 m_pVertexBuffer;
	LPDIRECT3DTEXTURE8 m_pTexture;

	float m_rWidth;
	float m_rHeight;
	float m_rDepth;
	float m_rX;
	float m_rY;
	float m_rZ;

	struct CUBIOD_CUSTOMVERTEX
	{
		FLOAT x, y, z;	
		DWORD colour;	
		FLOAT tu, tv;	
	};
};

#endif 

⌨️ 快捷键说明

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