mirror of
https://github.com/DrBeef/Raze.git
synced 2024-12-02 00:52:56 +00:00
6e49f0bf8f
Bone model support in GLES and ZScript quaternions.
46 lines
1.1 KiB
C++
46 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "tarray.h"
|
|
#include "hwrenderer/data/buffers.h"
|
|
#include "common/utility/matrix.h"
|
|
#include <atomic>
|
|
#include <mutex>
|
|
|
|
class FRenderState;
|
|
|
|
class BoneBuffer
|
|
{
|
|
IDataBuffer *mBuffer;
|
|
IDataBuffer* mBufferPipeline[HW_MAX_PIPELINE_BUFFERS];
|
|
int mPipelineNbr;
|
|
int mPipelinePos = 0;
|
|
|
|
bool mBufferType;
|
|
std::atomic<unsigned int> mIndex;
|
|
unsigned int mBlockAlign;
|
|
unsigned int mBlockSize;
|
|
unsigned int mBufferSize;
|
|
unsigned int mByteSize;
|
|
unsigned int mMaxUploadSize;
|
|
|
|
public:
|
|
BoneBuffer(int pipelineNbr = 1);
|
|
~BoneBuffer();
|
|
|
|
void Clear();
|
|
int UploadBones(const TArray<VSMatrix> &bones);
|
|
void Map() { mBuffer->Map(); }
|
|
void Unmap() { mBuffer->Unmap(); }
|
|
unsigned int GetBlockSize() const { return mBlockSize; }
|
|
bool GetBufferType() const { return mBufferType; }
|
|
int GetBinding(unsigned int index, size_t* pOffset, size_t* pSize);
|
|
|
|
// Only for GLES to determin how much data is in the buffer
|
|
int GetCurrentIndex() { return mIndex; };
|
|
|
|
// OpenGL needs the buffer to mess around with the binding.
|
|
IDataBuffer* GetBuffer() const
|
|
{
|
|
return mBuffer;
|
|
}
|
|
};
|