37 lines
775 B
C
37 lines
775 B
C
|
#ifndef VOXELGAME_H
|
||
|
#define VOXELGAME_H
|
||
|
|
||
|
#include <vector>
|
||
|
#include "GreedyMesher.h"
|
||
|
|
||
|
class VoxelGame {
|
||
|
public:
|
||
|
VoxelGame();
|
||
|
~VoxelGame();
|
||
|
|
||
|
// Initialize textures, voxel data, and mesher
|
||
|
bool init();
|
||
|
|
||
|
// Game loop functions
|
||
|
void update(float deltaTime);
|
||
|
void render();
|
||
|
void debugUI();
|
||
|
|
||
|
private:
|
||
|
// 3D voxel data (0 = empty, 1 = grass, 2 = dirt, 3 = wood)
|
||
|
std::vector<std::vector<std::vector<int>>> voxelData;
|
||
|
// Mesh quads produced by the greedy mesher
|
||
|
std::vector<Quad> meshQuads;
|
||
|
|
||
|
// OpenGL texture IDs for each block type
|
||
|
unsigned int textureGrass;
|
||
|
unsigned int textureDirt;
|
||
|
unsigned int textureWood;
|
||
|
|
||
|
bool loadTextures();
|
||
|
void generateVoxelData();
|
||
|
void generateMesh();
|
||
|
};
|
||
|
|
||
|
#endif // VOXELGAME_H
|