Skip to content

Instantly share code, notes, and snippets.

@xaxxon
Created April 7, 2016 07:02
Show Gist options
  • Save xaxxon/f93d4559b976f4810b0a2b1e1d8dd152 to your computer and use it in GitHub Desktop.
Save xaxxon/f93d4559b976f4810b0a2b1e1d8dd152 to your computer and use it in GitHub Desktop.
allocating an array off a constexpr
struct LineSegment {
struct Vertex {
glm::vec2 position;
glm::vec2 normal;
float width;
uint32_t color;
Vertex() = default;
Vertex(const Vertex &) = delete;
};
static constexpr int VERTEX_COUNT = 2;
Vertex vertices[VERTEX_COUNT];
void set(const glm::vec2 & start_position,
const glm::vec2 & end_position,
float width,
uint32_t color = 0xffffffff);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment