RenderDebugInterface.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_DEBUG_INTERFACE_H 00013 #define RENDER_DEBUG_INTERFACE_H 00014 00020 #include "ApexDefs.h" 00021 #include "RenderDebugTyped.h" // include the header file containing the base class 00022 #include "ApexInterface.h" 00023 #include "Renderable.h" 00024 00025 #if PX_PHYSICS_VERSION_MAJOR == 3 00026 #include "common/PxRenderBuffer.h" 00027 #endif 00028 00030 #define RENDER_DEBUG_IFACE(ptr) ((ptr)->getRenderDebugInterface()) 00031 00032 namespace nvidia 00033 { 00034 00035 namespace apex 00036 { 00037 class UserRenderer; 00038 class UserRenderResourceManager; 00039 00040 PX_PUSH_PACK_DEFAULT 00041 00042 #if PX_PHYSICS_VERSION_MAJOR == 3 00043 00049 class PhysXRenderBuffer : public PxRenderBuffer 00050 { 00051 public: 00052 PhysXRenderBuffer() 00053 { 00054 clear(); 00055 } 00056 00060 virtual uint32_t getNbPoints() const 00061 { 00062 return mNbPoints; 00063 } 00064 00068 virtual const PxDebugPoint* getPoints() const 00069 { 00070 return mPoints; 00071 } 00072 00076 virtual uint32_t getNbLines() const 00077 { 00078 return mNbLines; 00079 } 00080 00084 virtual const PxDebugLine* getLines() const 00085 { 00086 return mLines; 00087 } 00088 00092 virtual uint32_t getNbTriangles() const 00093 { 00094 return mNbTriangles; 00095 } 00096 00100 virtual const PxDebugTriangle* getTriangles() const 00101 { 00102 return mTriangles; 00103 } 00104 00108 virtual uint32_t getNbTexts() const 00109 { 00110 return mNbTexts; 00111 } 00112 00116 virtual const PxDebugText* getTexts() const 00117 { 00118 return mTexts; 00119 } 00120 00124 virtual void append(const PxRenderBuffer& other) 00125 { 00126 PX_UNUSED(other); 00127 PX_ALWAYS_ASSERT(); // this method not implemented! 00128 } 00129 00133 virtual void clear() 00134 { 00135 mNbPoints = 0; 00136 mPoints = NULL; 00137 mNbLines = 0; 00138 mLines = NULL; 00139 mNbTriangles = 0; 00140 mTriangles = NULL; 00141 mNbTexts = 0; 00142 mTexts = NULL; 00143 } 00144 00148 uint32_t mNbPoints; 00152 PxDebugPoint *mPoints; 00156 uint32_t mNbLines; 00160 PxDebugLine *mLines; 00164 uint32_t mNbTriangles; 00168 PxDebugTriangle *mTriangles; 00172 uint32_t mNbTexts; 00176 PxDebugText *mTexts; 00177 }; 00178 #endif 00179 00183 class RenderDebugInterface : public ApexInterface, public Renderable 00184 { 00185 public: 00194 virtual void setUseDebugRenderable(bool state) = 0; 00195 00196 00197 #if PX_PHYSICS_VERSION_MAJOR == 3 00198 00206 virtual void getRenderBuffer(PhysXRenderBuffer& renderable) = 0; 00207 00216 virtual void getRenderBufferScreenSpace(PhysXRenderBuffer& renderable) = 0; 00217 00224 virtual void addDebugRenderable(const physx::PxRenderBuffer& renderBuffer) = 0; 00225 00226 #endif //PX_PHYSICS_VERSION_MAJOR == 3 00227 00228 virtual void release() = 0; 00229 00233 virtual RENDER_DEBUG::RenderDebugTyped* getRenderDebugInterface() = 0; 00234 00235 protected: 00236 00237 virtual ~RenderDebugInterface(void) { }; 00238 00239 }; 00240 00241 PX_POP_PACK 00242 00243 } 00244 } // end namespace nvidia::apex 00245 00246 #endif // RENDER_DEBUG_INTERFACE_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.