Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/render/draw.cc10
-rw-r--r--src/render/gl.cc10
-rw-r--r--src/render/gl.h5
3 files changed, 17 insertions, 8 deletions
diff --git a/src/render/draw.cc b/src/render/draw.cc
index 7d0242d..42b7d8c 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -591,10 +591,8 @@ void draw_model_fragments(model::Model *model,
bool use_env = false; // environment mapping
// TODO this should probably be initialized somewhere else
- glTexGeni(GL_S, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
- glTexGeni(GL_T, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
- glTexGeni(GL_R, GL_TEXTURE_GEN_MODE, GL_REFLECTION_MAP);
-
+ gl::texgeni(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
+ gl::texgeni(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP);
for (model::Model::Groups::iterator git = model->groups().begin(); git != model->groups().end(); git++) {
@@ -714,7 +712,6 @@ void draw_model_fragments(model::Model *model,
// enable env mapping
gl::enable(GL_TEXTURE_GEN_S);
gl::enable(GL_TEXTURE_GEN_T);
- gl::enable(GL_TEXTURE_GEN_R);
use_env = true;
}
@@ -724,7 +721,6 @@ void draw_model_fragments(model::Model *model,
// disable env mapping
gl::disable(GL_TEXTURE_GEN_S);
gl::disable(GL_TEXTURE_GEN_T);
- gl::disable(GL_TEXTURE_GEN_R);
use_env = false;
}
}
@@ -748,7 +744,6 @@ void draw_model_fragments(model::Model *model,
// disable env mapping
gl::disable(GL_TEXTURE_GEN_S);
gl::disable(GL_TEXTURE_GEN_T);
- gl::disable(GL_TEXTURE_GEN_R);
use_env = false;
}
@@ -784,7 +779,6 @@ void draw_model_fragments(model::Model *model,
// disable env mapping
gl::disable(GL_TEXTURE_GEN_S);
gl::disable(GL_TEXTURE_GEN_T);
- gl::disable(GL_TEXTURE_GEN_R);
use_env = false;
}
diff --git a/src/render/gl.cc b/src/render/gl.cc
index 355efab..d21065e 100644
--- a/src/render/gl.cc
+++ b/src/render/gl.cc
@@ -204,5 +204,15 @@ void frustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdou
glFrustum(left, right, bottom, top, znear, zfar);
}
+void texgeni(GLenum coord, GLenum param, GLenum value)
+{
+ glTexGeni(coord, param, value);
+}
+
+void texgenfv(GLenum coord, GLenum param, const GLfloat* value)
+{
+ glTexGenfv(coord, param, value);
+}
+
} // namespace gl
diff --git a/src/render/gl.h b/src/render/gl.h
index 5bd42b5..7d1857c 100644
--- a/src/render/gl.h
+++ b/src/render/gl.h
@@ -203,6 +203,11 @@ void loadidentity();
/// Perspective matrix
void frustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble znear, GLdouble zfar);
+
+/// Texture coordinate generation
+void texgeni(GLenum coord, GLenum param, GLenum value);
+
+void texgenfv(GLenum coord, GLenum param, const GLfloat* value);
}
#endif // __INCLUDED_RENDER_GL_H__