Diligent Engine API Reference: D:/GitHub/DiligentEngine/DiligentCore/Graphics/GraphicsEngine/interface/BufferView.h Source File

Diligent Engine API Reference

BufferView.h
1 /* Copyright 2015-2018 Egor Yusov
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
10 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF ANY PROPRIETARY RIGHTS.
12 *
13 * In no event and under no legal theory, whether in tort (including negligence),
14 * contract, or otherwise, unless required by applicable law (such as deliberate
15 * and grossly negligent acts) or agreed to in writing, shall any Contributor be
16 * liable for any damages, including any direct, indirect, special, incidental,
17 * or consequential damages of any character arising as a result of this License or
18 * out of the use or inability to use the software (including but not limited to damages
19 * for loss of goodwill, work stoppage, computer failure or malfunction, or any and
20 * all other commercial damages or losses), even if such Contributor has been advised
21 * of the possibility of such damages.
22 */
23
24 #pragma once
25
28
29 #include "DeviceObject.h"
30
31 namespace Diligent
32 {
33
34 // {E2E83490-E9D2-495B-9A83-ABB413A38B07}
35 static constexpr INTERFACE_ID IID_BufferView =
36 { 0xe2e83490, 0xe9d2, 0x495b, { 0x9a, 0x83, 0xab, 0xb4, 0x13, 0xa3, 0x8b, 0x7 } };
37
39 struct BufferViewDesc : DeviceObjectAttribs
40 {
42 BUFFER_VIEW_TYPE ViewType;
43
46 Uint32 ByteOffset;
47
49 Uint32 ByteWidth;
50
52
59 BufferViewDesc() :
60 ViewType( BUFFER_VIEW_UNDEFINED ),
61 ByteOffset(0),
62 ByteWidth(0)
63 {
64 }
65
67
74 bool operator == (const BufferViewDesc& RHS)const
75 {
76 // Name is primarily used for debug purposes and does not affect the view.
77 // It is ignored in comparison operation.
78 return //strcmp(Name, RHS.Name) == 0 &&
79 ViewType == RHS.ViewType &&
80 ByteOffset== RHS.ByteOffset &&
81 ByteWidth == RHS.ByteWidth;
82 }
83 };
84
86
91 class IBufferView : public IDeviceObject
92 {
93 public:
95 virtual void QueryInterface( const Diligent::INTERFACE_ID &IID, IObject **ppInterface ) = 0;
96
98 virtual const BufferViewDesc& GetDesc()const = 0;
99
101
104 virtual IBuffer* GetBuffer() = 0;
105 };
106
107 }
Diligent::IBufferView::GetBuffer
virtual IBuffer * GetBuffer()=0
Returns pointer to the referenced buffer object.
Diligent::BufferViewDesc::ViewType
BUFFER_VIEW_TYPE ViewType
View type. See Diligent::BUFFER_VIEW_TYPE for details.
Definition: BufferView.h:42
Diligent::IBufferView::GetDesc
virtual const BufferViewDesc & GetDesc() const =0
Returns the buffer view description used to create the object.
Diligent::BufferViewDesc
Buffer view description.
Definition: BufferView.h:39
Diligent::IDeviceObject
Base interface for all objects created by the render device Diligent::IRenderDevice.
Definition: DeviceObject.h:40
Diligent::BUFFER_VIEW_UNDEFINED
Undefined view type.
Definition: GraphicsTypes.h:222
Diligent
Namespace for the OpenGL implementation of the graphics engine.
Definition: BufferD3D11Impl.h:34
Diligent::BufferViewDesc::ByteOffset
Uint32 ByteOffset
Offset in bytes from the beginnig of the buffer to the start of the buffer region referenced by the v...
Definition: BufferView.h:46
Diligent::BufferViewDesc::operator==
bool operator==(const BufferViewDesc &RHS) const
Comparison operator tests if two structures are equivalent.
Definition: BufferView.h:74
Diligent::IBufferView::QueryInterface
virtual void QueryInterface(const Diligent::INTERFACE_ID &IID, IObject **ppInterface)=0
Queries the specific interface, see IObject::QueryInterface() for details.
Diligent::IBuffer
Buffer interface.
Definition: Buffer.h:200
Diligent::BufferViewDesc::ByteWidth
Uint32 ByteWidth
Size in bytes of the referenced buffer region.
Definition: BufferView.h:49
Diligent::DeviceObjectAttribs
Describes common device object attributes.
Definition: GraphicsTypes.h:900
Diligent::BufferViewDesc::BufferViewDesc
BufferViewDesc()
Initializes the structure members with default values.
Definition: BufferView.h:59
Diligent::IBufferView
Buffer view interface.
Definition: BufferView.h:91
Diligent::BUFFER_VIEW_TYPE
BUFFER_VIEW_TYPE
Buffer view type.
Definition: GraphicsTypes.h:219