// https://en.wikipedia.org/wiki/Regular_icosahedron#Cartesian_coordinates
-float IcoSphereBuilder::base_vertices[12*3] =
+const float IcoSphereBuilder::base_vertices[12*3] =
{
0.0f, -0.5257311f, -0.8506508f,
0.0f, 0.5257311f, -0.8506508f,
0.5257311f, 0.8506508f, 0.0f
};
-unsigned IcoSphereBuilder::base_triangles[20*3] =
+const unsigned IcoSphereBuilder::base_triangles[20*3] =
{
0, 1, 6,
1, 0, 4,
float radius;
unsigned subdivision;
- static float base_vertices[];
- static unsigned base_triangles[];
+ static const float base_vertices[];
+ static const unsigned base_triangles[];
static unsigned base_edges[];
static unsigned base_tri_edges[];
namespace Msp {
namespace GL {
-int Texture::swizzle_orders[] =
+const int Texture::swizzle_orders[] =
{
GL_RED, GL_GREEN, GL_BLUE, GL_ALPHA,
GL_RED, GL_RED, GL_RED, GL_ONE,
bool auto_gen_mipmap;
std::string debug_name;
- static int swizzle_orders[];
+ static const int swizzle_orders[];
static Texture *scratch_binding;
Texture(GLenum, ResourceManager * = 0);
namespace Msp {
namespace GL {
-TextureCubeFace TextureCube::face_order[6] =
+const TextureCubeFace TextureCube::face_order[6] =
{
POSITIVE_X,
NEGATIVE_X,
NEGATIVE_Z
};
-Vector3 TextureCube::directions[6] =
+const Vector3 TextureCube::directions[6] =
{
Vector3(1, 0, 0),
Vector3(-1, 0, 0),
Vector3(0, 0, -1)
};
-unsigned TextureCube::orientations[12] =
+const unsigned TextureCube::orientations[12] =
{
5, 3,
4, 3,
unsigned size;
unsigned levels;
- static TextureCubeFace face_order[6];
- static Vector3 directions[6];
- static unsigned orientations[12];
+ static const TextureCubeFace face_order[6];
+ static const Vector3 directions[6];
+ static const unsigned orientations[12];
public:
TextureCube();
#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]));
void DumpTree::visit(ImageTypeDeclaration &type)
{
- static const char *dims[] = { "1D", "2D", "3D", "Cube" };
+ static const char *const dims[] = { "1D", "2D", "3D", "Cube" };
append(type, format("%%%d typedef %s", get_label(type), type.name));
const char *Stage::get_stage_name(Type type)
{
- static const char *names[] = { "shared", "vertex", "geometry", "fragment" };
+ static const char *const names[] = { "shared", "vertex", "geometry", "fragment" };
return names[type];
}
namespace Msp {
namespace GL {
-Matrix Object::identity_matrix;
+const Matrix Object::identity_matrix;
Object::Object():
lods(1),
Geometry::BoundingSphere<float, 3> bounding_sphere;
bool lod0_watched;
- static Matrix identity_matrix;
+ static const Matrix identity_matrix;
public:
Object();