OpenGL ES SDK for Android ARM Developer Center
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
WireframeTorus.h
Go to the documentation of this file.
1 /* Copyright (c) 2012-2017, ARM Limited and Contributors
2  *
3  * SPDX-License-Identifier: MIT
4  *
5  * Permission is hereby granted, free of charge,
6  * to any person obtaining a copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation the rights to
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
9  * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
14  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
16  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
17  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19  */
20 
21 #ifndef WIREFRAME_TORUS_H
22 #define WIREFRAME_TORUS_H
23 
24 #include "Torus.h"
25 
32 class WireframeTorus : public Torus
33 {
34 private:
35 
36  /* Number of indices needed for a single glDrawElements() call. */
37  static const unsigned int indicesCount = 4 * circlesCount * pointsPerCircleCount;
38 
39  /* Index of a GL_ELEMENT_ARRAY_BUFFER buffer, to store determined indices. */
41 
45  void initializeBufferForIndices(void);
46 
47  bool initializeVertexAttribs(void);
48 
49 public:
50 
58 
59  ~WireframeTorus(void);
60 
61  void draw(float* rotationVector);
62 };
63 
64 #endif /* WIREFRAME_TORUS_H */
static const unsigned int indicesCount
static const unsigned int pointsPerCircleCount
Number of points in one circle.
Definition: Torus.h:57
bool initializeVertexAttribs(void)
Initialize vertex attribute arrays and buffer objects coresponding to them. Make sure that programID ...
float torusRadius
Distance between the center of torus and the center of its tube.
Definition: Torus.h:70
void initializeBufferForIndices(void)
Determine indices needed for a single glDrawElements() call in GL_LINES mode.
Class derived from the Torus abstract class. It manages drawing of a rotating wireframed unicolor tor...
static const unsigned int circlesCount
Number of circles in torus model.
Definition: Torus.h:53
void draw(float *rotationVector)
Draw the torus model.
float circleRadius
Radius of circles that model the tube.
Definition: Torus.h:74
Abstract class that draws torus on the screen. It stores generic data describing the drawn torus: ...
Definition: Torus.h:39
WireframeTorus(float torusRadius, float circleRadius)
Instantiates a representation of a solid torus, using user-provided radius and tube radius...
GLuint indicesBufferID
typedef GLuint(GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRPROC)(GLuint count