VertexFormat.h
Go to the documentation of this file.
00001 /* 00002 * Copyright (c) 2008-2017, NVIDIA CORPORATION. All rights reserved. 00003 * 00004 * NVIDIA CORPORATION and its licensors retain all intellectual property 00005 * and proprietary rights in and to this software, related documentation 00006 * and any modifications thereto. Any use, reproduction, disclosure or 00007 * distribution of this software and related documentation without an express 00008 * license agreement from NVIDIA CORPORATION is strictly prohibited. 00009 */ 00010 00011 00012 #ifndef VERTEX_FORMAT_H 00013 #define VERTEX_FORMAT_H 00014 00020 #include "ApexUsingNamespace.h" 00021 #include "UserRenderResourceManager.h" 00022 #include "UserRenderVertexBufferDesc.h" 00023 00024 namespace nvidia 00025 { 00026 namespace apex 00027 { 00028 00029 PX_PUSH_PACK_DEFAULT 00030 00034 struct ColorRGBA 00035 { 00037 ColorRGBA() : r(0xFF), g(0xFF), b(0xFF), a(0xFF) {} 00039 ColorRGBA(uint8_t _r, uint8_t _g, uint8_t _b, uint8_t _a) : r(_r), g(_g), b(_b), a(_a) {} 00040 00042 uint8_t r; 00044 uint8_t g; 00046 uint8_t b; 00048 uint8_t a; 00049 }; 00050 00054 struct RenderDataAccess 00055 { 00059 enum Enum 00060 { 00061 STATIC = 0, 00062 DYNAMIC, 00063 STREAMING, 00064 00065 ACCESS_TYPE_COUNT 00066 }; 00067 }; 00068 00072 class VertexFormat 00073 { 00074 public: 00075 00076 enum 00077 { 00078 MAX_UV_COUNT = 4, 00079 MAX_BONE_PER_VERTEX_COUNT = 4, 00080 }; 00081 00083 typedef uint32_t BufferID; 00084 00085 00087 virtual void reset() = 0; 00088 00089 00091 virtual void setWinding(RenderCullMode::Enum winding) = 0; 00092 00094 virtual void setHasSeparateBoneBuffer(bool hasSeparateBoneBuffer) = 0; 00095 00097 virtual RenderCullMode::Enum getWinding() const = 0; 00098 00100 virtual bool hasSeparateBoneBuffer() const = 0; 00101 00102 00104 virtual const char* getSemanticName(RenderVertexSemantic::Enum semantic) const = 0; 00105 00107 virtual BufferID getSemanticID(RenderVertexSemantic::Enum semantic) const = 0; 00108 00111 virtual BufferID getID(const char* name) const = 0; 00112 00113 00118 virtual int32_t addBuffer(const char* name) = 0; 00119 00124 virtual bool bufferReplaceWithLast(uint32_t index) = 0; 00125 00126 00130 virtual bool setBufferFormat(uint32_t index, RenderDataFormat::Enum format) = 0; 00131 00135 virtual bool setBufferAccess(uint32_t index, RenderDataAccess::Enum access) = 0; 00136 00140 virtual bool setBufferSerialize(uint32_t index, bool serialize) = 0; 00141 00142 00146 virtual const char* getBufferName(uint32_t index) const = 0; 00147 00151 virtual RenderVertexSemantic::Enum getBufferSemantic(uint32_t index) const = 0; 00152 00156 virtual BufferID getBufferID(uint32_t index) const = 0; 00157 00161 virtual RenderDataFormat::Enum getBufferFormat(uint32_t index) const = 0; 00162 00166 virtual RenderDataAccess::Enum getBufferAccess(uint32_t index) const = 0; 00167 00171 virtual bool getBufferSerialize(uint32_t index) const = 0; 00172 00173 00175 virtual uint32_t getBufferCount() const = 0; 00176 00178 virtual uint32_t getCustomBufferCount() const = 0; 00179 00183 virtual int32_t getBufferIndexFromID(BufferID id) const = 0; 00184 00185 00186 protected: 00187 VertexFormat() {} 00188 virtual ~VertexFormat() {} 00189 }; 00190 00191 PX_POP_PACK 00192 00193 } 00194 } // end namespace nvidia::apex 00195 00196 #endif // VERTEX_FORMAT_H
Generated on Fri Dec 15 2017 13:58:35 Copyright © 2012-2017 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved.