@@ -44,9 +44,11 @@ public: | |||||
Ticker::Unref(m_camera); | Ticker::Unref(m_camera); | ||||
} | } | ||||
struct vertex { vec3 pos, color; }; | |||||
virtual bool init_draw() override | virtual bool init_draw() override | ||||
{ | { | ||||
array<vec3, vec3> mesh | |||||
array<vertex> mesh | |||||
{ | { | ||||
// Front vertices/colors | // Front vertices/colors | ||||
{ vec3(-1.0, -1.0, 1.0), vec3(1.0, 0.0, 1.0) }, | { vec3(-1.0, -1.0, 1.0), vec3(1.0, 0.0, 1.0) }, | ||||
@@ -100,9 +100,11 @@ public: | |||||
m_matrix = proj * view * model * anim; | m_matrix = proj * view * model * anim; | ||||
} | } | ||||
struct vertex { vec3 pos, color; }; | |||||
virtual bool init_draw() override | virtual bool init_draw() override | ||||
{ | { | ||||
array<vec3, vec3> mesh | |||||
array<vertex> mesh | |||||
{ | { | ||||
// Front vertices/colors | // Front vertices/colors | ||||
{ vec3(-1.0, -1.0, 1.0), vec3(1.0, 0.0, 1.0) }, | { vec3(-1.0, -1.0, 1.0), vec3(1.0, 0.0, 1.0) }, | ||||
@@ -444,6 +444,14 @@ class array : public array_base<std::tuple<T...>, array<T...>> | |||||
private: | private: | ||||
using array_base<std::tuple<T...>, array<T...>>::array_base; | using array_base<std::tuple<T...>, array<T...>>::array_base; | ||||
// Mark these as private: it’s dangerous to use data() with arrays of | |||||
// tuples because no assumption should be made about the tuple layout, | |||||
// not even the order of its members in memory. | |||||
inline void data() {} | |||||
inline void data() const {} | |||||
inline void bytes() {} | |||||
inline void bytes() const {} | |||||
public: | public: | ||||
// GCC needs this but Clang doesn’t | // GCC needs this but Clang doesn’t | ||||
typedef std::tuple<T...> element_t; | typedef std::tuple<T...> element_t; | ||||