APEX Framework: RenderMesh.h Source File

NVIDIA APEX

RenderMesh.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 RENDER_MESH_H
00013 #define RENDER_MESH_H
00014 
00020 #include "ApexUsingNamespace.h"
00021 #include "VertexFormat.h"
00022 
00023 namespace nvidia
00024 {
00025 namespace apex
00026 {
00027 
00028 PX_PUSH_PACK_DEFAULT
00029 
00030 class RenderMeshActor;
00031 class Context;
00032 struct VertexUV;
00033 
00034 
00038 class VertexBuffer
00039 {
00040 public:
00044     virtual uint32_t                getVertexCount() const = 0;
00045 
00049     virtual const VertexFormat&     getFormat() const = 0;
00050 
00054     virtual VertexFormat&           getFormatWritable() = 0;
00055 
00060     virtual const void*             getBuffer(uint32_t bufferIndex) const = 0;
00061 
00065     virtual const void*             getBufferAndFormat(RenderDataFormat::Enum& format, uint32_t bufferIndex) const = 0;
00066 
00070     virtual void*                   getBufferAndFormatWritable(RenderDataFormat::Enum& format, uint32_t bufferIndex) = 0;
00071 
00079     virtual bool                    getBufferData(void* dstBuffer, nvidia::RenderDataFormat::Enum dstBufferFormat, uint32_t dstBufferStride, uint32_t bufferIndex,
00080                                                   uint32_t startVertexIndex, uint32_t elementCount) const = 0;
00081 
00082 protected:
00083     /* Do not allow class to be created directly */
00084     VertexBuffer() {}
00085 };
00086 
00087 
00091 class RenderSubmesh
00092 {
00093 public:
00094     virtual                         ~RenderSubmesh() {}
00095 
00099     virtual uint32_t                getVertexCount(uint32_t partIndex) const = 0;
00100 
00104     virtual const VertexBuffer&     getVertexBuffer() const = 0;
00105 
00109     virtual VertexBuffer&           getVertexBufferWritable() = 0;
00110 
00115     virtual uint32_t                getFirstVertexIndex(uint32_t partIndex) const = 0;
00116 
00120     virtual uint32_t                getIndexCount(uint32_t partIndex) const = 0;
00121 
00125     virtual const uint32_t*         getIndexBuffer(uint32_t partIndex) const = 0;
00126 
00132     virtual const uint32_t*         getSmoothingGroups(uint32_t partIndex) const = 0;
00133 
00134 protected:
00135     RenderSubmesh() {}
00136 };
00137 
00138 PX_POP_PACK
00139 
00140 }
00141 } // end namespace nvidia::apex
00142 
00143 #endif // RENDER_MESH_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.