Maria GDK 5.0.0.738
Documentation of native code in develop branch
Loading...
Searching...
No Matches
STK::VertexBuffer2D Class Reference

#include <StkVertexBuffer2D.h>

Public Member Functions

 VertexBuffer2D (const std::vector< STK::Vector2f > &vertices, const std::vector< uint16_t > &indexes)
 
 VertexBuffer2D (const std::vector< STK::Vector2f > &vertices, const std::vector< STK::Vector2f > &uvs, const std::vector< uint16_t > &indexes)
 
uint32_t size () const
 
uint32_t getCurrOffset () const
 
void setVertices (const std::vector< STK::Vector2f > &vertices)
 
void setTexCoords (const std::vector< STK::Vector2f > &uv)
 
void setIndexes (const std::vector< uint16_t > &indexes)
 
void bind ()
 
int addTriangle (const STK::Vector2f &v1, const STK::Vector2f &v2, const STK::Vector2f &v3)
 
int addTexturedTriangle (const STK::Vector2f &v1, const STK::Vector2f &v2, const STK::Vector2f &v3, const STK::Vector2f &tc1, const STK::Vector2f &tc2, const STK::Vector2f &tc3)
 
int addQuad (const STK::Vector2f &v1, const STK::Vector2f &v2, const STK::Vector2f &v3, const STK::Vector2f &v4)
 
int addTexturedQuad (const STK::Vector2f &v1, const STK::Vector2f &v2, const STK::Vector2f &v3, const STK::Vector2f &v4, const STK::Vector2f &tc1, const STK::Vector2f &tc2, const STK::Vector2f &tc3, const STK::Vector2f &tc4)
 
void drawElements ()
 
void drawElements (int offset, int count)
 
void clearOpenGLBuffers ()
 

Detailed Description

StkVertexBuffer2D - Short description. Detailed description.

Member Function Documentation

◆ addQuad()

int VertexBuffer2D::addQuad ( const STK::Vector2f v1,
const STK::Vector2f v2,
const STK::Vector2f v3,
const STK::Vector2f v4 
)

Add quad vertices to the buffers. This method will add the vertices of a quad, as well as the indexes to render this quad as two triangles with glDrawElements.

Returns
the number of indexes added (6).

◆ addTexturedQuad()

int VertexBuffer2D::addTexturedQuad ( const STK::Vector2f v1,
const STK::Vector2f v2,
const STK::Vector2f v3,
const STK::Vector2f v4,
const STK::Vector2f tc1,
const STK::Vector2f tc2,
const STK::Vector2f tc3,
const STK::Vector2f tc4 
)

Add quad vertices to the buffers. This method will add the vertices and texture coordinates of a quad, as well as the indexes to render this quad as two triangles with glDrawElements.

Returns
the number of indexes added (6).

◆ addTexturedTriangle()

int VertexBuffer2D::addTexturedTriangle ( const STK::Vector2f v1,
const STK::Vector2f v2,
const STK::Vector2f v3,
const STK::Vector2f tc1,
const STK::Vector2f tc2,
const STK::Vector2f tc3 
)

Add triangle vertices to the buffers. This method will add the vertices and texture coordinates of a triangle, as well as the indexes to render this triangle with glDrawElements.

Returns
the number of indexes added (3).

◆ addTriangle()

int VertexBuffer2D::addTriangle ( const STK::Vector2f v1,
const STK::Vector2f v2,
const STK::Vector2f v3 
)

Add triangle vertices to the buffers. This method will add the vertices of a triangle, as well as the indexes to render this triangle with glDrawElements.

Returns
the number of indexes added (3).

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