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

📄 texture.h

📁 小型的3D游戏引擎
💻 H
字号:
///////////////////////////////////////////////////
//												 //
// Handles the creation and binding of a texture //
//												 //
///////////////////////////////////////////////////

#ifndef _TEXTURE_H_
#define _TEXTURE_H_

#include <windows.h>
#include <gl/gl.h>
#include "global.h"

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

	// Load a texture
	bool Create(char *fileName);

	// Bind the texture (use it)
	void Bind() { glBindTexture(GL_TEXTURE_2D, texture); }

	// Width/Height
	uint Width()	{ return width; }
	uint Height()	{ return height; }

	bool IsLoaded() { return loaded; }

private:
	uint texture;
	uint width;
	uint height;
	bool loaded;
};

#endif

⌨️ 快捷键说明

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