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

📄 skybox.h

📁 3D游戏展示程序
💻 H
字号:
//--------------------------------------------------
//  Desc: SkyBox
//  Date: 2007.1.25 /update
//  Author: artsylee
//
//  Copyright (C) 2007 artsylee
//
//--------------------------------------------------

#ifndef _SKYBOX_
#define _SKYBOX_

#include <Windows.h>
#include <d3d9.h>
#include <d3dx9.h>

enum SKYBOXPLANE
{
	SBP_LEFT,
	SBP_FRONT,
	SBP_RIGHT,
	SBP_BACK,
	SBP_TOP,
	SBP_BOTTOM,
};

struct SkyBoxVertex
{
	float x, y, z;
	float u, v;
	SkyBoxVertex(){}
	SkyBoxVertex(float fx, float fy, float fz, float fu, float fv)
	{
		x = fx;
		y = fy;
		z = fz;
		u = fu;
		v = fv;
	}
	static const DWORD FVF;
};

class CSkyBox
{
public:
	CSkyBox();
	~CSkyBox();

	void	InitSkyBox(float x, float y, float z);
	void	DrawSkyBox();
	void	SetCenter(D3DXVECTOR3 center);

private:
	float	m_XLen;
	float	m_YLen;
	float	m_ZLen;
	DWORD	m_hSkyTex[6];
	D3DXVECTOR3	m_CenterPosition;
	LPDIRECT3DVERTEXBUFFER9 m_pBoxVB;
};

#endif // _SKYBOX_

⌨️ 快捷键说明

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