]> git.tdb.fi Git - libs/gl.git/blobdiff - source/effects/environmentmap.cpp
Make the TextureCubeFace enum independent of OpenGL constants
[libs/gl.git] / source / effects / environmentmap.cpp
index 8770aba5f2e1fcf19a5de76599c0a5f77a7afb71..a675f7e249291d759bda1de98417a463874cca91 100644 (file)
@@ -48,7 +48,7 @@ void EnvironmentMap::init(unsigned s, PixelFormat f, unsigned l)
        depth_buf.storage(DEPTH_COMPONENT32F, size, size, 1);
        for(unsigned i=0; i<6; ++i)
        {
-               TextureCubeFace face = TextureCube::enumerate_faces(i);
+               TextureCubeFace face = static_cast<TextureCubeFace>(i);
                faces[i].fbo.set_format((COLOR_ATTACHMENT,f, DEPTH_ATTACHMENT,DEPTH_COMPONENT32F));
                faces[i].fbo.attach(COLOR_ATTACHMENT, env_tex, face, 0);
                faces[i].fbo.attach(DEPTH_ATTACHMENT, depth_buf);
@@ -75,7 +75,7 @@ void EnvironmentMap::init(unsigned s, PixelFormat f, unsigned l)
                LinAl::Matrix<float, 3, 3> face_matrices[6];
                for(unsigned i=0; i<6; ++i)
                {
-                       GL::TextureCubeFace face = GL::TextureCube::enumerate_faces(i);
+                       GL::TextureCubeFace face = static_cast<TextureCubeFace>(i);
                        GL::Vector3 columns[3];
                        columns[0] = GL::TextureCube::get_s_direction(face);
                        columns[1] = GL::TextureCube::get_t_direction(face);
@@ -186,7 +186,7 @@ void EnvironmentMap::set_debug_name(const string &name)
 #ifdef DEBUG
        env_tex.set_debug_name(name+"/environment.texcb");
        depth_buf.set_debug_name(name+"/environment_depth.rbuf");
-       static const char *face_names[] = { "X+", "X-", "Y+", "Y-", "Z+", "Z-" };
+       static const char *const face_names[] = { "X+", "X-", "Y+", "Y-", "Z+", "Z-" };
        for(unsigned i=0; i<6; ++i)
        {
                faces[i].fbo.set_debug_name(format("%s [FBO:%s]", name, face_names[i]));