OpenGL ES SDK for Android
ARM Developer Center
|
Abstract class that draws torus on the screen. It stores generic data describing the drawn torus: More...
#include <Torus.h>
Public Member Functions | |
virtual | ~Torus (void) |
Frees allocated memory. More... | |
virtual void | draw (float *rotationVector)=0 |
Draw the torus model. More... | |
void | setProjectionMatrix (MaliSDK::Matrix *projectionMatrix) |
Pass the correctly defined projection matrix to the program related to the torus model. More... | |
Static Public Member Functions | |
static void | setResourceDirectory (std::string requiredResourceDirectory) |
Set the resource directory for all tori. More... | |
Protected Member Functions | |
Torus (void) | |
Protected constructor used to do intialization general to all torus objects. More... | |
virtual bool | initializeVertexAttribs ()=0 |
Initialize vertex attribute arrays and buffer objects coresponding to them. Make sure that programID has been set before this function is called. More... | |
void | setColor (float red, float green, float blue, float alpha) |
Sets the uniform color of the drawn torus. More... | |
void | setupGraphics (const std::string vertexShaderPath, const std::string fragmentShaderPath) |
Initialize constant OpenGL components such as program, shaders and constant matrices. More... | |
Protected Attributes | |
float | torusRadius |
Distance between the center of torus and the center of its tube. More... | |
float | circleRadius |
Radius of circles that model the tube. More... | |
GLuint | programID |
ID of a program linked to the torus model. More... | |
GLuint | vaoID |
ID of a vertex array object that stores pointers to vertex data sources used to rasterize given mesh. More... | |
Static Protected Attributes | |
static std::string | resourceDirectory |
static const unsigned int | vertexComponentsCount = 4 |
Number of coordinates for one vertex. More... | |
static const unsigned int | circlesCount = 12 |
Number of circles in torus model. More... | |
static const unsigned int | pointsPerCircleCount = 12 |
Number of points in one circle. More... | |
static const unsigned int | torusVerticesCount = pointsPerCircleCount * circlesCount |
Total number of vertices in torus model. More... | |
static const unsigned int | componentsCount = torusVerticesCount * vertexComponentsCount |
Total number of components in torus model, needed to determine the size of vertex arrays. More... | |
Abstract class that draws torus on the screen. It stores generic data describing the drawn torus:
|
protected |
Draw the torus model.
rotationVector | Vector with rotation parameters to be passed to the vertex shader. |
Implemented in InstancedSolidTorus, and WireframeTorus.
|
protectedpure virtual |
Initialize vertex attribute arrays and buffer objects coresponding to them. Make sure that programID has been set before this function is called.
Implemented in InstancedSolidTorus, and WireframeTorus.
void Torus::setProjectionMatrix | ( | MaliSDK::Matrix * | projectionMatrix | ) |
|
static |
|
protected |
|
protected |
|
staticprotected |
|
staticprotected |
|
staticprotected |
|
protected |
|
staticprotected |
|
protected |
|
staticprotected |
|
protected |
|
staticprotected |