Ocean
GLESTriangleStrips.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Meta Platforms, Inc. and affiliates.
3  *
4  * This source code is licensed under the MIT license found in the
5  * LICENSE file in the root directory of this source tree.
6  */
7 
8 #ifndef META_OCEAN_RENDERING_GLES_TRIANGLE_STRIPS_H
9 #define META_OCEAN_RENDERING_GLES_TRIANGLE_STRIPS_H
10 
13 
15 
16 namespace Ocean
17 {
18 
19 namespace Rendering
20 {
21 
22 namespace GLESceneGraph
23 {
24 
25 /**
26  * This class implements a GLESceneGraph triangle strips object.
27  * @ingroup renderinggles
28  */
29 class OCEAN_RENDERING_GLES_EXPORT GLESTriangleStrips :
30  virtual public GLESStripPrimitive,
31  virtual public TriangleStrips
32 {
33  friend class GLESFactory;
34 
35  public:
36 
37  /**
38  * Returns the strips of this primitive object.
39  * @see StripPrimitive::strips().
40  */
41  VertexIndexGroups strips() const override;
42 
43  /**
44  * Returns the number of triangle strips defined in this primitive.
45  * @see StripPrimitive::numberStrips().
46  */
47  unsigned int numberStrips() const override;
48 
49  /**
50  * Sets the strips of this primitive object.
51  * @see StripPtrimitive::setStrips().
52  */
53  void setStrips(const VertexIndexGroups& strips) override;
54 
55  /**
56  * Renders the triangles defined by the associated vertex set and the defined triangle faces.
57  * @see Renderable::render().
58  */
59  void render(const GLESFramebuffer& framebuffer, const SquareMatrix4& projectionMatrix, const HomogenousMatrix4& camera_T_object, const HomogenousMatrix4& camera_T_world, const SquareMatrix3& normalMatrix, GLESAttributeSet& attributeSet, const Lights& lights) override;
60 
61  /**
62  * Renders the triangles defined by the associated vertex set and the defined triangle faces.
63  * @see Renderable::render().
64  */
65  void render(const SquareMatrix4& projectionMatrix, const HomogenousMatrix4& camera_T_object, const HomogenousMatrix4& camera_T_world, const SquareMatrix3& normalMatrix, GLESShaderProgram& shaderProgram) override;
66 
67  protected:
68 
69  /**
70  * Creates a new GLESceneGraph triangle strips object.
71  */
73 
74  /**
75  * Destructs a GLESceneGraph triangle strips object.
76  */
77  ~GLESTriangleStrips() override;
78 
79  /**
80  * Releases the internal vertex buffer object containing the triangle strips indices.
81  */
82  void release();
83 
84  /**
85  * Updates the bounding box of this primitive.
86  * @see GLESPrimitive::updateBoundingBox().
87  */
88  void updateBoundingBox() override;
89 
90  protected:
91 
92  /// Vertex buffer object for triangle indices.
93  GLuint vboIndices_ = 0u;
94 
95  /// Number of indices for all strips.
96  unsigned int numberIndices_ = 0u;
97 
98  /// The triangle strips.
100 };
101 
102 }
103 
104 }
105 
106 }
107 
108 #endif // META_OCEAN_RENDERING_GLES_TRIANGLE_STRIPS_H
This class implements a GLESceneGraph attribute set object.
Definition: GLESAttributeSet.h:40
This class implements a class factory for all GLESceneGraph objects.
Definition: GLESFactory.h:30
This class implements a base for all GLESceneGraph framebuffers.
Definition: rendering/glescenegraph/GLESFramebuffer.h:34
This class implements a container for an OpenGL ES shader program.
Definition: GLESShaderProgram.h:53
This class is the base class for all GLESceneGraph stripped primitives.
Definition: GLESStripPrimitive.h:32
This class implements a GLESceneGraph triangle strips object.
Definition: GLESTriangleStrips.h:32
void release()
Releases the internal vertex buffer object containing the triangle strips indices.
~GLESTriangleStrips() override
Destructs a GLESceneGraph triangle strips object.
void updateBoundingBox() override
Updates the bounding box of this primitive.
VertexIndexGroups strips() const override
Returns the strips of this primitive object.
void render(const GLESFramebuffer &framebuffer, const SquareMatrix4 &projectionMatrix, const HomogenousMatrix4 &camera_T_object, const HomogenousMatrix4 &camera_T_world, const SquareMatrix3 &normalMatrix, GLESAttributeSet &attributeSet, const Lights &lights) override
Renders the triangles defined by the associated vertex set and the defined triangle faces.
unsigned int numberStrips() const override
Returns the number of triangle strips defined in this primitive.
GLESTriangleStrips()
Creates a new GLESceneGraph triangle strips object.
VertexIndexGroups strips_
The triangle strips.
Definition: GLESTriangleStrips.h:99
void setStrips(const VertexIndexGroups &strips) override
Sets the strips of this primitive object.
void render(const SquareMatrix4 &projectionMatrix, const HomogenousMatrix4 &camera_T_object, const HomogenousMatrix4 &camera_T_world, const SquareMatrix3 &normalMatrix, GLESShaderProgram &shaderProgram) override
Renders the triangles defined by the associated vertex set and the defined triangle faces.
This class is the base for all rendering triangle strips.
Definition: TriangleStrips.h:36
std::vector< VertexIndices > VertexIndexGroups
Definition of a vector holding vertex indices.
Definition: rendering/Rendering.h:125
std::vector< LightPair > Lights
Definition of a set holding light sources.
Definition: GLESLightSource.h:44
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15