jubilant-funicular
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
nta::Vertex2D Struct Reference

represents a vertex in 2 dimensions More...

#include <Vertex.h>

Collaboration diagram for nta::Vertex2D:
Collaboration graph
[legend]

Public Member Functions

 Vertex2D ()
 Initializes an "empty" vertex.
 
 Vertex2D (crvec2 p)
 Initializes a white, textureless vertex with given position.
 
 Vertex2D (crvec2 p, crvec4 c)
 Initializes textureless, colorful vertex.
 
 Vertex2D (crvec2 p, crvec4 c, crvec2 u, float t=1.0)
 Initializes a vertex with everything.
 
 Vertex2D (crvec4 c, crvec2 u, float t=1.0)
 Initializes vertex with everything except position.
 
void setPosition (float x, float y)
 sets the position of the vertex
 
void setColor (float r, float g, float b, float a)
 sets the color of the vertex
 
void setColor (crvec3 c)
 
void setUV (float u, float v)
 sets the uv coordinates of the vertex
 

Public Attributes

glm::vec2 pos
 the vertex's position, color, and uv coordinates, respectively
 
glm::vec4 color
 
glm::vec2 uv
 
float hasTexture
 

Static Public Attributes

static const VertexAttrib attribs [4]
 

Detailed Description

represents a vertex in 2 dimensions

Definition at line 26 of file Vertex.h.

Member Data Documentation

◆ attribs

const VertexAttrib nta::Vertex2D::attribs
static
Initial value:
= {
{0, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex2D), (void*)offsetof(Vertex2D, pos)},
{1, 4, GL_FLOAT, GL_TRUE, sizeof(Vertex2D), (void*)offsetof(Vertex2D, color)},
{2, 2, GL_FLOAT, GL_FALSE, sizeof(Vertex2D), (void*)offsetof(Vertex2D, uv)},
{3, 1, GL_FLOAT, GL_FALSE, sizeof(Vertex2D), (void*)offsetof(Vertex2D, hasTexture)}
}

Definition at line 71 of file Vertex.h.


The documentation for this struct was generated from the following files:
nta::Vertex2D::Vertex2D
Vertex2D()
Initializes an "empty" vertex.
Definition: Vertex.h:28
nta::Vertex2D::pos
glm::vec2 pos
the vertex's position, color, and uv coordinates, respectively
Definition: Vertex.h:66