-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCube.h
More file actions
41 lines (40 loc) · 1017 Bytes
/
Cube.h
File metadata and controls
41 lines (40 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef __CUBE_H__
#define __CUBE_H__
#include <GL\glut.h>
#define BMP_Header_Length 54 //定义BMP文件头为54
class Cube
{
public:
Cube(float, float, float, float, GLuint, GLuint, GLuint);
void createCube();
static int power_of_two(int n);//静态函数不会被其他文件调用,其他文件可以有同名函数
static GLuint load_texture(const char *file_name);
static void initCubeTexture();
~Cube();
public:
float _x, _y, _z, _size;
public:
static GLuint texRedStone;
static GLuint texGrass;
static GLuint texSoil;
static GLuint texStone;
static GLuint texWater;
static GLuint texWood;
static GLuint texDirt;
static GLuint texBrick;
static GLuint texTabletop;
static GLuint texTableside;
static GLuint texDiamond;
static GLuint texTnttop;
static GLuint texTntside;
static GLuint texTreetop;
static GLuint texTreeside;
static GLuint texLeaf;
static GLuint texBookshelf;
static GLuint texRedSand;
static GLuint texSand;
protected:
Cube() {};
GLuint _top, _bot, _side;//用来存储方块顶面侧面地面的纹理
};
#endif