diff options
author | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
commit | 15740faf9fe9fe4be08965098bbf2947e096aeeb (patch) | |
tree | a730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/Dynamics/nxmemorystream.h |
Diffstat (limited to 'Runtime/Dynamics/nxmemorystream.h')
-rw-r--r-- | Runtime/Dynamics/nxmemorystream.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Runtime/Dynamics/nxmemorystream.h b/Runtime/Dynamics/nxmemorystream.h new file mode 100644 index 0000000..80f8563 --- /dev/null +++ b/Runtime/Dynamics/nxmemorystream.h @@ -0,0 +1,34 @@ +#ifndef MEMORY_STREAM_H +#define MEMORY_STREAM_H + +#include "External/PhysX/builds/SDKs/Physics/include/NxPhysics.h" +#include "External/PhysX/builds/SDKs/Foundation/include/NxStream.h" + +class MemoryStream : public NxStream + { + public: + MemoryStream(NxU8* data,NxU32 len); + virtual ~MemoryStream(); + + virtual NxU8 readByte() const; + virtual NxU16 readWord() const; + virtual NxU32 readDword() const; + virtual float readFloat() const; + virtual double readDouble() const; + virtual void readBuffer(void* buffer, NxU32 size) const; + + virtual NxStream& storeByte(NxU8 b); + virtual NxStream& storeWord(NxU16 w); + virtual NxStream& storeDword(NxU32 d); + virtual NxStream& storeFloat(NxReal f); + virtual NxStream& storeDouble(NxF64 f); + virtual NxStream& storeBuffer(const void* buffer, NxU32 size); + + bool mMyAlloc; + mutable NxU32 mReadLoc; + NxU32 mWriteLoc; + NxU32 mLen; + NxU8* mBuffer; // buffer + }; + +#endif |