Ocean
GLESTextures.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_TEXTURES_H
9 #define META_OCEAN_RENDERING_GLES_TEXTURES_H
10 
14 
16 
17 namespace Ocean
18 {
19 
20 namespace Rendering
21 {
22 
23 namespace GLESceneGraph
24 {
25 
26 /**
27  * This class implements a GLESceneGraph texture attributes object.
28  * @ingroup renderinggles
29  */
30 class OCEAN_RENDERING_GLES_EXPORT GLESTextures :
31  virtual public GLESAttribute,
32  virtual public Textures
33 {
34  friend class GLESFactory;
35 
36  public:
37 
38  /**
39  * Sets the texture and attribute for a specified texture layer.
40  * @see Textures::setTexture().
41  */
42  void setTexture(const TextureRef& texture, const unsigned int layerIndex) override;
43 
44  /**
45  * Binds this texture.
46  * @see GLESAttribute::bindAttribute().
47  */
48  void bindAttribute(const GLESFramebuffer& framebuffer, GLESShaderProgram& shaderProgram) override;
49 
50  /**
51  * Unbindes this attribute.
52  * @see GLESAttribute::unbindAttribute().
53  */
54  void unbindAttribute() override;
55 
56  /**
57  * Returns the shader type necessary to render an object with this attribute.
58  * @see GLESAttribute::necessaryShader().
59  */
60  ProgramType necessaryShader() const override;
61 
62  protected:
63 
64  /**
65  * Creates a new GLESceneGraph textures object.
66  */
68 
69  /**
70  * Destructs a GLESceneGraph textures objets.
71  */
72  ~GLESTextures() override;
73 };
74 
75 }
76 
77 }
78 
79 }
80 
81 #endif // META_OCEAN_RENDERING_GLES_TEXTURES_H
This class wraps a GLESceneGraph attribute object.
Definition: GLESAttribute.h:36
ProgramType
Definition of different shader functionalities.
Definition: GLESAttribute.h:43
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 implements a GLESceneGraph texture attributes object.
Definition: GLESTextures.h:33
void setTexture(const TextureRef &texture, const unsigned int layerIndex) override
Sets the texture and attribute for a specified texture layer.
void bindAttribute(const GLESFramebuffer &framebuffer, GLESShaderProgram &shaderProgram) override
Binds this texture.
void unbindAttribute() override
Unbindes this attribute.
GLESTextures()
Creates a new GLESceneGraph textures object.
~GLESTextures() override
Destructs a GLESceneGraph textures objets.
ProgramType necessaryShader() const override
Returns the shader type necessary to render an object with this attribute.
This class implements a smart rendering object reference.
Definition: rendering/ObjectRef.h:34
This class is the base class for all textures objects.
Definition: Textures.h:39
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15