📄 texture.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 + -