TazGraph Project v0.1.0
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
LineRenderer Class Reference

Public Member Functions

void init ()
 
void begin ()
 
void end ()
 
void initBatchLines (size_t msize)
 
void initBatchSquares (size_t msize)
 
void initBatchBoxes (size_t msize)
 
void drawLine (size_t v_index, const glm::vec3 srcPosition, const glm::vec3 destPosition, const Color &srcColor, const Color &destColor)
 
void drawRectangle (size_t v_index, const glm::vec4 &destRect, const Color &color, float angle, float zIndex=0.0f)
 
void drawBox (size_t v_index, const glm::vec3 &origin, const glm::vec3 &size, const Color &color, float angle)
 
void drawCircle (const glm::vec2 &center, const Color &color, float radius)
 
void initBatchSize ()
 
void renderBatch (float lineWidth)
 
void dispose ()
 

Public Attributes

const char * VERT_SRC
 
const char * FRAG_SRC
 
int box_edgePairs [12][2]
 

Member Data Documentation

◆ box_edgePairs

int LineRenderer::box_edgePairs[12][2]
Initial value:
= {
{0, 1}, {1, 2}, {2, 3}, {3, 0},
{4, 5}, {5, 6}, {6, 7}, {7, 4},
{0, 4}, {1, 5}, {2, 6}, {3, 7}
}

◆ FRAG_SRC

const char* LineRenderer::FRAG_SRC
Initial value:
= R"(#version 400
in vec4 fragmentColor;
out vec4 color; //rgb value
void main() {
color = vec4(fragmentColor.rgb, fragmentColor.a);
})"

◆ VERT_SRC

const char* LineRenderer::VERT_SRC
Initial value:
= R"(#version 400
in vec3 vertexPosition; //vec3 is array of 3 floats
in vec4 vertexColor;
out vec4 fragmentColor;
uniform mat4 u_ViewProjection;
void main() {
gl_Position = u_ViewProjection * vec4(vertexPosition.xyz, 1.0);
fragmentColor = vertexColor;
})"

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