smk::Vertex3D Struct Reference

#include <Vertex.hpp>

The vertex structure suitable for a 2D shader. More...

Description

The vertex structure suitable for a 2D shader.

Definition at line 21 of file Vertex.hpp.

Static Public Member Functions

static void Bind ()
 

Public Attributes

glm::vec3 space_position = {0.f, 0.f, 0.f}
 
glm::vec3 normal = {0.f, 0.f, 0.f}
 
glm::vec2 texture_position = {0.f, 0.f}
 

Member Function Documentation

◆ Bind()

void smk::Vertex3D::Bind ( )
static

Definition at line 24 of file Vertex.cpp.

24 {
25 glVertexAttribPointer(0, sizeof(Vertex3D::space_position) / sizeof(GL_FLOAT),
26 GL_FLOAT, false, sizeof(Vertex3D),
27 (void*)offsetof(Vertex3D, space_position)); // NOLINT
28 glEnableVertexAttribArray(1);
29 glVertexAttribPointer(1, sizeof(Vertex3D::normal) / sizeof(GL_FLOAT),
30 GL_FLOAT, false, sizeof(Vertex3D),
31 (void*)offsetof(Vertex3D, normal)); // NOLINT
32 glEnableVertexAttribArray(2);
33 glVertexAttribPointer(
34 2, sizeof(Vertex3D::texture_position) / sizeof(GL_FLOAT), GL_FLOAT, false,
35 sizeof(Vertex3D), (void*)offsetof(Vertex3D, texture_position)); // NOLINT
36}

Member Data Documentation

◆ normal

glm::vec3 smk::Vertex3D::normal = {0.f, 0.f, 0.f}

Definition at line 23 of file Vertex.hpp.

◆ space_position

glm::vec3 smk::Vertex3D::space_position = {0.f, 0.f, 0.f}

Definition at line 22 of file Vertex.hpp.

◆ texture_position

glm::vec2 smk::Vertex3D::texture_position = {0.f, 0.f}

Definition at line 24 of file Vertex.hpp.


The documentation for this struct was generated from the following files: