Sleeping Wombat Graphic API  1.010
swGraphicAPI
IBuffer.h
Go to the documentation of this file.
1 #pragma once
2 
10 #include "ResourcePtr.h"
11 
12 #include "swCommonLib/Common/MemoryChunk.h"
13 #include "swCommonLib/System/Path.h"
14 
15 
20 class ShaderInputLayout;
21 
22 
25 enum class BufferType : uint8
26 {
27  VertexBuffer,
28  IndexBuffer,
30 };
31 
32 
35 struct BufferInfo
36 {
37  uint32 NumElements;
38  uint32 ElementSize;
39  rttr::type DataType;
42  filesystem::Path Name;
43 
47 
53 
58 
60  BufferInfo()
61  : DataType( rttr::type::get_by_name( "" ) ) // Set invalid type.
62  {}
63 
64  std::string GetName () const { return Name.String(); }
65 };
66 
67 
71 class IBuffer : public ResourceObject
72 {
73  RTTR_ENABLE( ResourceObject )
74 private:
75 
76 protected:
77  IBuffer() : ResourceObject( 0 ) {}
78  virtual ~IBuffer() = default;
79 public:
80  virtual MemoryChunk CopyData () = 0;
81  virtual const BufferInfo& GetDescriptor () const = 0;
82 };
83 
Definition: ResourcePtr.h:116
BufferType
Type of buffer.
Definition: IBuffer.h:25
BufferType BufferType
Vertex, index or constant buffer.
Definition: IBuffer.h:41
Base class for buffers.
Definition: IBuffer.h:71
ResourceObject(int id)
Definition: ResourceObject.h:44
uint32 NumElements
Number of elements of type BufferDescriptor::DataType.
Definition: IBuffer.h:37
bool Use4BytesIndex
Definition: IBuffer.h:57
virtual const BufferInfo & GetDescriptor() const =0
Returns buffer descriptor.
Descriptor of buffer.
Definition: IBuffer.h:35
virtual MemoryChunk CopyData()=0
Kopiuje dane z bufora i umieszcza je w zwracanym MemoryChunku.
rttr::type DataType
[Optional] Type of single element in buffer.
Definition: IBuffer.h:39
ResourceUsage
Specyfikuje typ dostępu do pamięci danego zasobu.
Definition: GraphicAPIConstants.h:72
filesystem::Path Name
Buffer name or file path.
Definition: IBuffer.h:42
uint32 ElementSize
Size of single element in buffer.
Definition: IBuffer.h:38
ResourceUsage Usage
Usage of resource by graphic card.
Definition: IBuffer.h:40
Klasa przechowuje layout wierzchołka trafiającego do vertex shadera.
Definition: MeshResources.h:334
ResourcePtr< ShaderInputLayout > VertexLayout
Definition: IBuffer.h:52
Plik zawiera deklarację i definicję klasy ResourceObject służącą do zliczania odwołań do obiektu...
Klasa ułatwiająca zarządzanie odwołaniami do assetów.Obiekty assetów (np. MaterialObject, TextureObject, VertexShader, PixelShader itp.) wymagają jakiegoś systemu zapewniającego współdzielenie między innymi obiektami.
Definition: ResourceObject.h:30
PrimitiveTopology Topology
Definition: IBuffer.h:46
PrimitiveTopology
Topologia wierzchołków.
Definition: GraphicAPIConstants.h:84