Diligent Engine  v.2.4.g
Texture2D_GL.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2019-2021 Diligent Graphics LLC
3  * Copyright 2015-2019 Egor Yusov
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  * In no event and under no legal theory, whether in tort (including negligence),
18  * contract, or otherwise, unless required by applicable law (such as deliberate
19  * and grossly negligent acts) or agreed to in writing, shall any Contributor be
20  * liable for any damages, including any direct, indirect, special, incidental,
21  * or consequential damages of any character arising as a result of this License or
22  * out of the use or inability to use the software (including but not limited to damages
23  * for loss of goodwill, work stoppage, computer failure or malfunction, or any and
24  * all other commercial damages or losses), even if such Contributor has been advised
25  * of the possibility of such damages.
26  */
27 
28 #pragma once
29 
30 #include "TextureBaseGL.hpp"
31 
32 namespace Diligent
33 {
34 
36 class Texture2D_GL final : public TextureBaseGL
37 {
38 public:
39  Texture2D_GL(IReferenceCounters* pRefCounters,
40  FixedBlockMemoryAllocator& TexViewObjAllocator,
41  class RenderDeviceGLImpl* pDeviceGL,
42  class GLContextState& GLState,
43  const TextureDesc& TexDesc,
44  const TextureData* pInitData = nullptr,
45  bool bIsDeviceInternal = false);
46 
47  Texture2D_GL(IReferenceCounters* pRefCounters,
48  FixedBlockMemoryAllocator& TexViewObjAllocator,
49  class RenderDeviceGLImpl* pDeviceGL,
50  class GLContextState& GLState,
51  const TextureDesc& TexDesc,
52  GLuint GLTextureHandle,
53  GLuint GLBindTarget,
54  bool bIsDeviceInternal = false);
55 
57  Texture2D_GL(IReferenceCounters* pRefCounters,
58  FixedBlockMemoryAllocator& TexViewObjAllocator,
59  class RenderDeviceGLImpl* pDeviceGL,
60  const TextureDesc& TexDesc,
61  bool bIsDeviceInternal = false);
62 
63  ~Texture2D_GL();
64 
66  virtual void UpdateData(class GLContextState& CtxState,
67  Uint32 MipLevel,
68  Uint32 Slice,
69  const Box& DstBox,
70  const TextureSubResData& SubresData) override final;
71 
73  virtual void AttachToFramebuffer(const struct TextureViewDesc& ViewDesc,
74  GLenum AttachmentPoint) override final;
75 };
76 
77 } // namespace Diligent
Diligent::IReferenceCounters
Base interface for a reference counter object that stores the number of strong and weak references an...
Definition: ReferenceCounters.h:44
Diligent::Box
Box.
Definition: GraphicsTypes.h:2407
Diligent::Texture2D_GL::~Texture2D_GL
~Texture2D_GL()
Definition: Texture2D_GL.cpp:175
Diligent::Texture2D_GL
2D texture implementation in OpenGL backend.
Definition: Texture2D_GL.hpp:36
Diligent::TextureDesc
Texture description.
Definition: Texture.h:47
TextureBaseGL.hpp
Diligent::TextureData
Describes the initial data to store in the texture.
Definition: Texture.h:221
Diligent::TextureBaseGL
Base implementation of a texture object in OpenGL backend.
Definition: TextureBaseGL.hpp:41
Diligent::Uint32
uint32_t Uint32
32-bit unsigned integer
Definition: BasicTypes.h:51
Diligent::RenderDeviceGLImpl
Render device implementation in OpenGL backend.
Definition: RenderDeviceGLImpl.hpp:45
Diligent::Texture2D_GL::AttachToFramebuffer
virtual void AttachToFramebuffer(const struct TextureViewDesc &ViewDesc, GLenum AttachmentPoint) override final
Implementation of TextureBaseGL::AttachToFramebuffer() for 2D texture.
Definition: Texture2D_GL.cpp:276
Diligent::GLContextState
Definition: GLContextState.hpp:39
Diligent::FixedBlockMemoryAllocator
Memory allocator that allocates memory in a fixed-size chunks.
Definition: FixedBlockMemoryAllocator.hpp:56
Diligent::Texture2D_GL::UpdateData
virtual void UpdateData(class GLContextState &CtxState, Uint32 MipLevel, Uint32 Slice, const Box &DstBox, const TextureSubResData &SubresData) override final
Implementation of TextureBaseGL::UpdateData() for 2D texture.
Definition: Texture2D_GL.cpp:179
Diligent::Texture2D_GL::Texture2D_GL
Texture2D_GL(IReferenceCounters *pRefCounters, FixedBlockMemoryAllocator &TexViewObjAllocator, class RenderDeviceGLImpl *pDeviceGL, class GLContextState &GLState, const TextureDesc &TexDesc, const TextureData *pInitData=nullptr, bool bIsDeviceInternal=false)
Definition: Texture2D_GL.cpp:40
Diligent::TextureViewDesc
Texture view description.
Definition: TextureView.h:80
Diligent
The library uses Direct3D-style math:
Definition: AdvancedMath.hpp:37
Diligent::TextureSubResData
Describes data for one subresource.
Definition: Texture.h:165