Skip to content

Instantly share code, notes, and snippets.

Created December 17, 2013 04:08
Show Gist options
  • Save anonymous/cf5fba97fbc84a544055 to your computer and use it in GitHub Desktop.
Save anonymous/cf5fba97fbc84a544055 to your computer and use it in GitHub Desktop.
struct Vertex
{
glm::vec3 position;
glm::vec3 normal;
glm::vec2 uv;
};
// This works
MeshVertex mv = { glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f), glm::vec2(0.0f, 0.0f) };
// Error: too many initializer values, wtf!?
std::array<MeshVertex, 4> vertices =
{
{ glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f), glm::vec2(0.0f, 0.0f) },
{ glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f), glm::vec2(0.0f, 0.0f) },
{ glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f), glm::vec2(0.0f, 0.0f) },
{ glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f), glm::vec2(0.0f, 0.0f) }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment