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 #ifndef NX_VERTEX_FORMAT_H
00029 #define NX_VERTEX_FORMAT_H
00030
00036 #include "NxApexUsingNamespace.h"
00037 #include "NxUserRenderResourceManager.h"
00038 #include "NxUserRenderVertexBufferDesc.h"
00039
00040 namespace physx
00041 {
00042 namespace apex
00043 {
00044
00045 PX_PUSH_PACK_DEFAULT
00046
00050 struct PxColorRGBA
00051 {
00053 PxColorRGBA() : r(0xFF), g(0xFF), b(0xFF), a(0xFF) {}
00055 PxColorRGBA(PxU8 _r, PxU8 _g, PxU8 _b, PxU8 _a) : r(_r), g(_g), b(_b), a(_a) {}
00056
00058 PxU8 r;
00060 PxU8 g;
00062 PxU8 b;
00064 PxU8 a;
00065 };
00066
00070 struct NxRenderDataAccess
00071 {
00075 enum Enum
00076 {
00077 STATIC = 0,
00078 DYNAMIC,
00079 STREAMING,
00080
00081 ACCESS_TYPE_COUNT
00082 };
00083 };
00084
00088 class NxVertexFormat
00089 {
00090 public:
00091
00092 enum
00093 {
00094 MAX_UV_COUNT = 4,
00095 MAX_BONE_PER_VERTEX_COUNT = 4,
00096 };
00097
00099 typedef physx::PxU32 BufferID;
00100
00101
00103 virtual void reset() = 0;
00104
00105
00107 virtual void setWinding(NxRenderCullMode::Enum winding) = 0;
00108
00110 virtual void setHasSeparateBoneBuffer(bool hasSeparateBoneBuffer) = 0;
00111
00113 virtual NxRenderCullMode::Enum getWinding() const = 0;
00114
00116 virtual bool hasSeparateBoneBuffer() const = 0;
00117
00118
00120 virtual const char* getSemanticName(NxRenderVertexSemantic::Enum semantic) const = 0;
00121
00123 virtual BufferID getSemanticID(NxRenderVertexSemantic::Enum semantic) const = 0;
00124
00127 virtual BufferID getID(const char* name) const = 0;
00128
00129
00134 virtual physx::PxI32 addBuffer(const char* name) = 0;
00135
00140 virtual bool bufferReplaceWithLast(physx::PxU32 index) = 0;
00141
00142
00146 virtual bool setBufferFormat(physx::PxU32 index, NxRenderDataFormat::Enum format) = 0;
00147
00151 virtual bool setBufferAccess(physx::PxU32 index, NxRenderDataAccess::Enum access) = 0;
00152
00156 virtual bool setBufferSerialize(physx::PxU32 index, bool serialize) = 0;
00157
00158
00162 virtual const char* getBufferName(physx::PxU32 index) const = 0;
00163
00167 virtual NxRenderVertexSemantic::Enum getBufferSemantic(physx::PxU32 index) const = 0;
00168
00172 virtual BufferID getBufferID(physx::PxU32 index) const = 0;
00173
00177 virtual NxRenderDataFormat::Enum getBufferFormat(physx::PxU32 index) const = 0;
00178
00182 virtual NxRenderDataAccess::Enum getBufferAccess(physx::PxU32 index) const = 0;
00183
00187 virtual bool getBufferSerialize(physx::PxU32 index) const = 0;
00188
00189
00191 virtual physx::PxU32 getBufferCount() const = 0;
00192
00194 virtual physx::PxU32 getCustomBufferCount() const = 0;
00195
00199 virtual physx::PxI32 getBufferIndexFromID(BufferID id) const = 0;
00200
00201
00202 protected:
00203 NxVertexFormat() {}
00204 virtual ~NxVertexFormat() {}
00205 };
00206
00207 PX_POP_PACK
00208
00209 }
00210 }
00211
00212 #endif // NX_VERTEX_FORMAT_H