NxVertexFormat.h
Go to the documentation of this file.
00001 // This code contains NVIDIA Confidential Information and is disclosed to you
00002 // under a form of NVIDIA software license agreement provided separately to you.
00003 //
00004 // Notice
00005 // NVIDIA Corporation and its licensors retain all intellectual property and
00006 // proprietary rights in and to this software and related documentation and
00007 // any modifications thereto. Any use, reproduction, disclosure, or
00008 // distribution of this software and related documentation without an express
00009 // license agreement from NVIDIA Corporation is strictly prohibited.
00010 //
00011 // ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES
00012 // NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO
00013 // THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT,
00014 // MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE.
00015 //
00016 // Information and code furnished is believed to be accurate and reliable.
00017 // However, NVIDIA Corporation assumes no responsibility for the consequences of use of such
00018 // information or for any infringement of patents or other rights of third parties that may
00019 // result from its use. No license is granted by implication or otherwise under any patent
00020 // or patent rights of NVIDIA Corporation. Details are subject to change without notice.
00021 // This code supersedes and replaces all information previously supplied.
00022 // NVIDIA Corporation products are not authorized for use as critical
00023 // components in life support devices or systems without express written approval of
00024 // NVIDIA Corporation.
00025 //
00026 // Copyright (c) 2008-2014 NVIDIA Corporation. All rights reserved.
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 } // end namespace physx::apex
00211 
00212 #endif // NX_VERTEX_FORMAT_H

Generated on Mon Apr 28 2014 08:01:35

Copyright © 2012-2014 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved.