diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2011-07-01 17:20:53 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2011-07-02 18:10:14 +0200 |
commit | 75a90df8bf7f38e746e021c23248e1607931132c (patch) | |
tree | df2b4f48d5157f775c719192484188a2b0b8a04a /scene.h | |
parent | 90d570822f85f70c31f80789ad6791cebd904468 (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.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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(); }; |