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

📄 decal.h

📁 hair solusion, c&#226 cs ádasda
💻 H
字号:
#if !defined(DECAL_H_)
#define DECAL_H_

#include <GL/glut.h>
#include <string.h>

#include "tga.h"
#include "utils.h"

#define HAIR_PYRAMID_WIDTH 0.01
#define HAIR_PYRAMID_HEIGHT 0.2

class Decal
{
public:
	float fPhysicalTextureWidth;
	float fPhysicalTextureHeight;

	float fCenterTextureX;
	float fCenterTextureY;

	float fSinglePixelSize;

	GLuint nPixelTextureWidth;
	GLuint nPixelTextureHeight;

	GLuint nDecalWidth;
	GLuint nDecalHeight;

	Decal();
	Decal(tgaInfo *psImageFile);
	Decal(char *sFileName);
	~Decal();

	void SetDecal(tgaInfo *psImageFile);
	void SetDecal(char *sFileName);

	void GetPixel(GLuint x, GLuint y, GLubyte &red, GLubyte &green, GLubyte &blue, GLubyte &alpha);

	void InitGLTexture();
	void Draw();
	void DoTransform();

private:

	GLuint texName;

	GLubyte *pData;

	void InitVariables();

	float fTexCoordWidth;
	float fTexCoordHeight;

	GLuint nOldDecalWidth;
	GLuint nOldDecalHeight;

	GLfloat fWhiteDif[4];
	GLfloat fBlackDif[4];
};

#endif // !defined(DECAL_H_)

⌨️ 快捷键说明

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