NvShapes.h File Reference

Basic shape rendering. More...

#include <NvFoundation.h>
#include "NV/NvPlatformGL.h"
#include "NV/NvMath.h"

Go to the source code of this file.

Functions

void NvDrawQuad (GLuint posIndex)
 Draw a 2D quad with a single vertex attribute.
void NvDrawQuad (GLint positionAttrib, GLint texcoordAttrib)
 Draw a 2D quad with positions and UVs.
void NvDrawCube (GLuint posIndex)
 Draw a cube with positions.
void NvDrawWireCube (GLuint posIndex)
 Draw a wireframe cube with positions.
void NvDrawPoint (nv::vec3f &pos, GLuint posIndex)
 Draw a single point with given position.


Detailed Description

Basic shape rendering.

Functions to draw basic shapes, allowing the application to provide its own shader.


Function Documentation

void NvDrawCube ( GLuint  posIndex  ) 

Draw a cube with positions.

Renders a normalized cube ([-1.0, 1.0] in X, Y, and Z) using the currently-bound shader Binds the vertex position array to the given attribute array index and draws the object using the bound shader

Parameters:
[in] posIndex the vertex attribute array index that represents position in the current shader

void NvDrawPoint ( nv::vec3f &  pos,
GLuint  posIndex 
)

Draw a single point with given position.

Renders a single point (GL_POINTS) using the currently-bound shader Binds the vertex position array to the given attribute array index and draws one point using the bound shader

Parameters:
[in] pos the point to be drawn
[in] posIndex the vertex attribute array index that represents position in the current shader

void NvDrawQuad ( GLint  positionAttrib,
GLint  texcoordAttrib 
)

Draw a 2D quad with positions and UVs.

Renders a normalized quad ([-1.0, 1.0] in X and Y) with normalized UVs [0.0, 1.0] using the currently-bound shader Binds the vertex position and UVs arrays to the given attribute array indices and draws the object using the bound shader

Parameters:
[in] positionAttrib the vertex attribute array index that represents position in the current shader
[in] texcoordAttrib the vertex attribute array index that represents 2D UVs in the current shader

void NvDrawQuad ( GLuint  posIndex  ) 

Draw a 2D quad with a single vertex attribute.

Renders a normalized quad ([-1.0, 1.0] in X and Y) using the currently-bound shader Binds the vertex position array to the given attribute array index and draws the object using the bound shader

Parameters:
[in] posIndex the vertex attribute array index that represents position in the current shader

void NvDrawWireCube ( GLuint  posIndex  ) 

Draw a wireframe cube with positions.

Renders a normalized cube ([-1.0, 1.0] in X, Y, and Z) as lines using the currently-bound shader Binds the vertex position array to the given attribute array index and draws the object using the bound shader

Parameters:
[in] posIndex the vertex attribute array index that represents position in the current shader