summaryrefslogtreecommitdiff
path: root/scene.h
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-07-01 17:20:53 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2011-07-02 18:10:14 +0200
commit75a90df8bf7f38e746e021c23248e1607931132c (patch)
treedf2b4f48d5157f775c719192484188a2b0b8a04a /scene.h
parent90d570822f85f70c31f80789ad6791cebd904468 (diff)
Import and render tree models.
Trees are loaded from the new trees.blend using assimp. Tree objects are then received from the server and rendered on the given terrain locations. Each chunk now holds a list of objects and coordinates, which can be used to easily add other models as well. Also moded the GLSL fog code to its own shader which can be linked in different programs.
Diffstat (limited to 'scene.h')
-rw-r--r--scene.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/scene.h b/scene.h
index 247b52c..6c75c91 100644
--- a/scene.h
+++ b/scene.h
@@ -9,8 +9,13 @@
#include "tool.h"
#include "scripting.h"
#include "player.h"
+#include "model.h"
#include <FTGL/ftgl.h>
+#include <assimp/assimp.hpp>
+#include <assimp/aiScene.h>
+
+using models::Model;
class Scene {
public:
@@ -46,8 +51,15 @@ class Scene {
GLShaderProgram terrain_program;
GLShaderProgram water_program;
+ GLShaderProgram tree_program;
GLuint grass_texture, rock_texture, soil_texture, water_texture, marker_texture, placeholder_texture;
+ std::map<std::string, GLuint> scene_textures;
+
+ Assimp::Importer ai_importer;
+ const aiScene *tree_scene;
+
+ Model *tree;
Scene();
~Scene();
@@ -59,6 +71,7 @@ class Scene {
void events();
void render();
GLuint load_texture(const char *filename);
+ GLuint load_texture(aiTexture *texture);
void sort_players();
};