Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef VERTEX_FORMAT_H
00031 #define VERTEX_FORMAT_H
00032
00038 #include "ApexUsingNamespace.h"
00039 #include "UserRenderResourceManager.h"
00040 #include "UserRenderVertexBufferDesc.h"
00041
00042 namespace nvidia
00043 {
00044 namespace apex
00045 {
00046
00047 PX_PUSH_PACK_DEFAULT
00048
00052 struct ColorRGBA
00053 {
00055 ColorRGBA() : r(0xFF), g(0xFF), b(0xFF), a(0xFF) {}
00057 ColorRGBA(uint8_t _r, uint8_t _g, uint8_t _b, uint8_t _a) : r(_r), g(_g), b(_b), a(_a) {}
00058
00060 uint8_t r;
00062 uint8_t g;
00064 uint8_t b;
00066 uint8_t a;
00067 };
00068
00072 struct RenderDataAccess
00073 {
00077 enum Enum
00078 {
00079 STATIC = 0,
00080 DYNAMIC,
00081 STREAMING,
00082
00083 ACCESS_TYPE_COUNT
00084 };
00085 };
00086
00090 class VertexFormat
00091 {
00092 public:
00093
00094 enum
00095 {
00096 MAX_UV_COUNT = 4,
00097 MAX_BONE_PER_VERTEX_COUNT = 4,
00098 };
00099
00101 typedef uint32_t BufferID;
00102
00103
00105 virtual void reset() = 0;
00106
00107
00109 virtual void setWinding(RenderCullMode::Enum winding) = 0;
00110
00112 virtual void setHasSeparateBoneBuffer(bool hasSeparateBoneBuffer) = 0;
00113
00115 virtual RenderCullMode::Enum getWinding() const = 0;
00116
00118 virtual bool hasSeparateBoneBuffer() const = 0;
00119
00120
00122 virtual const char* getSemanticName(RenderVertexSemantic::Enum semantic) const = 0;
00123
00125 virtual BufferID getSemanticID(RenderVertexSemantic::Enum semantic) const = 0;
00126
00129 virtual BufferID getID(const char* name) const = 0;
00130
00131
00136 virtual int32_t addBuffer(const char* name) = 0;
00137
00142 virtual bool bufferReplaceWithLast(uint32_t index) = 0;
00143
00144
00148 virtual bool setBufferFormat(uint32_t index, RenderDataFormat::Enum format) = 0;
00149
00153 virtual bool setBufferAccess(uint32_t index, RenderDataAccess::Enum access) = 0;
00154
00158 virtual bool setBufferSerialize(uint32_t index, bool serialize) = 0;
00159
00160
00164 virtual const char* getBufferName(uint32_t index) const = 0;
00165
00169 virtual RenderVertexSemantic::Enum getBufferSemantic(uint32_t index) const = 0;
00170
00174 virtual BufferID getBufferID(uint32_t index) const = 0;
00175
00179 virtual RenderDataFormat::Enum getBufferFormat(uint32_t index) const = 0;
00180
00184 virtual RenderDataAccess::Enum getBufferAccess(uint32_t index) const = 0;
00185
00189 virtual bool getBufferSerialize(uint32_t index) const = 0;
00190
00191
00193 virtual uint32_t getBufferCount() const = 0;
00194
00196 virtual uint32_t getCustomBufferCount() const = 0;
00197
00201 virtual int32_t getBufferIndexFromID(BufferID id) const = 0;
00202
00203
00204 protected:
00205 VertexFormat() {}
00206 virtual ~VertexFormat() {}
00207 };
00208
00209 PX_POP_PACK
00210
00211 }
00212 }
00213
00214 #endif // VERTEX_FORMAT_H