GLUS
glus_shape.h
Go to the documentation of this file.
1 /*
2  * GLUS - Modern OpenGL, OpenGL ES and OpenVG Utilities. Copyright (C) since 2010 Norbert Nopper
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef GLUS_SHAPE_H_
19 #define GLUS_SHAPE_H_
20 
24 typedef struct _GLUSshape
25 {
30 
35 
40 
45 
50 
55 
60 
65 
70 
78 
79 } GLUSshape;
80 
90 
100 GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateRectangularPlanef(GLUSshape* shape, const GLUSfloat horizontalExtend, const GLUSfloat verticalExtend);
101 
114 GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateRectangularGridPlanef(GLUSshape* shape, const GLUSfloat horizontalExtend, const GLUSfloat verticalExtend, const GLUSuint rows, const GLUSuint columns, const GLUSboolean triangleStrip);
115 
125 GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateDiscf(GLUSshape* shape, const GLUSfloat radius, const GLUSuint numberSectors);
126 
136 
146 GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateSpheref(GLUSshape* shape, const GLUSfloat radius, const GLUSuint numberSlices);
147 
157 GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateDomef(GLUSshape* shape, const GLUSfloat radius, const GLUSuint numberSlices);
158 
170 GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateTorusf(GLUSshape* shape, const GLUSfloat innerRadius, const GLUSfloat outerRadius, const GLUSuint numberSlices, const GLUSuint numberStacks);
171 
182 GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateCylinderf(GLUSshape* shape, const GLUSfloat halfExtend, const GLUSfloat radius, const GLUSuint numberSlices);
183 
195 GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateConef(GLUSshape* shape, const GLUSfloat halfExtend, const GLUSfloat radius, const GLUSuint numberSlices, const GLUSuint numberStacks);
196 
205 
215 
222 
223 #endif /* GLUS_SHAPE_H_ */
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateCylinderf(GLUSshape *shape, const GLUSfloat halfExtend, const GLUSfloat radius, const GLUSuint numberSlices)
Creates a cylinder.
Definition: glus_shape.c:914
GLUSuint numberVertices
Number of vertices.
Definition: glus_shape.h:64
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCopyf(GLUSshape *shape, const GLUSshape *source)
Copies the shape.
Definition: glus_shape.c:1462
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateRectangularPlanef(GLUSshape *shape, const GLUSfloat horizontalExtend, const GLUSfloat verticalExtend)
Creates a rectangular plane.
Definition: glus_shape.c:166
GLUSindex * indices
Indices.
Definition: glus_shape.h:59
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateDomef(GLUSshape *shape, const GLUSfloat radius, const GLUSuint numberSlices)
Creates a dome.
Definition: glus_shape.c:668
float GLUSfloat
Definition: glus_typedef.h:37
GLUSfloat * tangents
Tangents.
Definition: glus_shape.h:39
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCalculateTangentBitangentf(GLUSshape *shape)
Calculates and creates the tangent and bitangent vectors.
Definition: glus_shape.c:1287
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateConef(GLUSshape *shape, const GLUSfloat halfExtend, const GLUSfloat radius, const GLUSuint numberSlices, const GLUSuint numberStacks)
Creates a cone.
Definition: glus_shape.c:1126
void GLUSvoid
Definition: glus_typedef.h:51
GLUSfloat * allAttributes
All above values in one array.
Definition: glus_shape.h:54
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreatePlanef(GLUSshape *shape, const GLUSfloat halfExtend)
Creates a quadratic plane.
Definition: glus_shape.c:102
#define GLUSindex
Definition: glus_define_uint.h:24
unsigned int GLUSuint
Definition: glus_typedef.h:28
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateSpheref(GLUSshape *shape, const GLUSfloat radius, const GLUSuint numberSlices)
Creates a sphere.
Definition: glus_shape.c:570
GLUSuint numberIndices
Number of indices.
Definition: glus_shape.h:69
GLUSfloat * vertices
Vertices in homogeneous coordinates.
Definition: glus_shape.h:29
unsigned int GLUSenum
Definition: glus_typedef.h:33
GLUSfloat * bitangents
Bitangents.
Definition: glus_shape.h:44
GLUSfloat * normals
Normals.
Definition: glus_shape.h:34
Structure for holding geometry data.
Definition: glus_shape.h:24
#define GLUSAPI
Definition: glus_function.h:38
unsigned char GLUSboolean
Definition: glus_typedef.h:21
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateDiscf(GLUSshape *shape, const GLUSfloat radius, const GLUSuint numberSectors)
Creates a disc with the given radius and number sectors.
Definition: glus_shape.c:357
GLUSfloat * texCoords
Texture coordinates.
Definition: glus_shape.h:49
GLUSAPI GLUSvoid GLUSAPIENTRY glusShapeDestroyf(GLUSshape *shape)
Destroys the shape by freeing the allocated memory.
Definition: glus_shape.c:1558
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateRectangularGridPlanef(GLUSshape *shape, const GLUSfloat horizontalExtend, const GLUSfloat verticalExtend, const GLUSuint rows, const GLUSuint columns, const GLUSboolean triangleStrip)
Creates a rectangular plane organized as a grid with given number rows and columns.
Definition: glus_shape.c:230
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateTorusf(GLUSshape *shape, const GLUSfloat innerRadius, const GLUSfloat outerRadius, const GLUSuint numberSlices, const GLUSuint numberStacks)
Creates a torus / doughnut.
Definition: glus_shape.c:770
GLUSenum mode
Triangle render mode - could be either:
Definition: glus_shape.h:77
#define GLUSAPIENTRY
Definition: glus_function.h:31
struct _GLUSshape GLUSshape
Structure for holding geometry data.
GLUSAPI GLUSboolean GLUSAPIENTRY glusShapeCreateCubef(GLUSshape *shape, const GLUSfloat halfExtend)
Creates a cube.
Definition: glus_shape.c:464