Ocean
GLESTexture2D.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_TEXTURE_2D_H
9 #define META_OCEAN_RENDERING_GLES_TEXTURE_2D_H
10 
13 
16 
17 namespace Ocean
18 {
19 
20 namespace Rendering
21 {
22 
23 namespace GLESceneGraph
24 {
25 
26 /**
27  * This class wraps a GLESceneGraph texture object.
28  * @ingroup renderinggles
29  */
30 class OCEAN_RENDERING_GLES_EXPORT GLESTexture2D :
31  virtual public GLESTexture,
32  virtual public Texture2D,
33  virtual protected DynamicObject
34 {
35  friend class GLESFactory;
36 
37  public:
38 
39  /**
40  * Returns the texture wrap type in s direction.
41  * @see Texture2D::wrapTypeS().
42  */
43  WrapType wrapTypeS() const override;
44 
45  /**
46  * Returns the texture wrap type in t direction.
47  * @see Texture2D::wrapTypeT().
48  */
49  WrapType wrapTypeT() const override;
50 
51  /**
52  * Sets the texture wrap type in s direction.
53  * @see Texture2D::setWrapTypeS().
54  */
55  bool setWrapTypeS(const WrapType type) override;
56 
57  /**
58  * Sets the texture wrap type in t direction.
59  * @see Texture2D::setWrapTypeT().
60  */
61  bool setWrapTypeT(const WrapType type) override;
62 
63  protected:
64 
65  /**
66  * Creates a new GLESceneGraph texture 2D object.
67  */
69 
70  /**
71  * Destructs a GLESceneGraph texture 2D object.
72  */
73  ~GLESTexture2D() override;
74 
75  /**
76  * Determines the alignment for a plane.
77  * @param planeStrideBytes The stride of the plane in bytes, with range [1, infinity)
78  * @param rowLength The resulting row length, with range [1, infinity)
79  * @param byteAlignment The resulting byte alignment, either 1, 2, or 4
80  * @return True, if succeeded
81  */
82  static bool determineAlignment(const unsigned int planeStrideBytes, unsigned int& rowLength, unsigned int& byteAlignment);
83 
84  protected:
85 
86  /// The texture wrap s type.
88 
89  /// The texture wrap t type.
91 };
92 
93 }
94 
95 }
96 
97 }
98 
99 #endif // META_OCEAN_RENDERING_GLES_TEXTURE_2D_H
This class is the base class for all dynamic scene graph objects.
Definition: DynamicObject.h:40
This class implements a class factory for all GLESceneGraph objects.
Definition: GLESFactory.h:30
This class wraps a GLESceneGraph texture object.
Definition: GLESTexture2D.h:34
static bool determineAlignment(const unsigned int planeStrideBytes, unsigned int &rowLength, unsigned int &byteAlignment)
Determines the alignment for a plane.
GLESTexture2D()
Creates a new GLESceneGraph texture 2D object.
bool setWrapTypeT(const WrapType type) override
Sets the texture wrap type in t direction.
WrapType wrapTypeS() const override
Returns the texture wrap type in s direction.
WrapType wrapTypeT() const override
Returns the texture wrap type in t direction.
bool setWrapTypeS(const WrapType type) override
Sets the texture wrap type in s direction.
WrapType wrapTypeS_
The texture wrap s type.
Definition: GLESTexture2D.h:87
~GLESTexture2D() override
Destructs a GLESceneGraph texture 2D object.
WrapType wrapTypeT_
The texture wrap t type.
Definition: GLESTexture2D.h:90
This class is the base class for all GLESceneGraph texture objects.
Definition: GLESTexture.h:37
This class is the base class for all 2D textures.
Definition: Texture2D.h:38
WrapType
Definition of different texture wrapping types.
Definition: rendering/Texture.h:96
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15