2014-07-30 22:44:22 +00:00
|
|
|
#ifndef __GL_LIGHTBUFFER_H
|
|
|
|
#define __GL_LIGHTBUFFER_H
|
|
|
|
|
|
|
|
#include "tarray.h"
|
|
|
|
struct FDynLightData;
|
|
|
|
|
|
|
|
class FLightBuffer
|
|
|
|
{
|
2014-08-19 12:18:21 +00:00
|
|
|
TArray<int> mIndices;
|
2014-08-01 18:59:39 +00:00
|
|
|
unsigned int mBufferId;
|
|
|
|
float * mBufferPointer;
|
|
|
|
|
2014-07-30 22:44:22 +00:00
|
|
|
unsigned int mBufferType;
|
|
|
|
unsigned int mIndex;
|
2014-08-19 12:18:21 +00:00
|
|
|
unsigned int mUploadIndex;
|
2014-08-01 18:59:39 +00:00
|
|
|
unsigned int mLastMappedIndex;
|
|
|
|
unsigned int mBlockAlign;
|
|
|
|
unsigned int mBlockSize;
|
2014-08-19 12:18:21 +00:00
|
|
|
unsigned int mBufferSize;
|
|
|
|
unsigned int mByteSize;
|
2014-07-30 22:44:22 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
FLightBuffer();
|
|
|
|
~FLightBuffer();
|
|
|
|
void Clear();
|
2014-08-01 18:59:39 +00:00
|
|
|
int UploadLights(FDynLightData &data);
|
2014-08-19 12:18:21 +00:00
|
|
|
void Begin();
|
2014-07-30 22:44:22 +00:00
|
|
|
void Finish();
|
2014-08-01 18:59:39 +00:00
|
|
|
int BindUBO(unsigned int index);
|
|
|
|
unsigned int GetBlockSize() const { return mBlockSize; }
|
|
|
|
unsigned int GetBufferType() const { return mBufferType; }
|
2014-08-19 12:18:21 +00:00
|
|
|
unsigned int GetIndexPtr() const { return mIndices.Size(); }
|
|
|
|
void StoreIndex(int index) { mIndices.Push(index); }
|
|
|
|
int GetIndex(int i) const { return mIndices[i]; }
|
2014-07-30 22:44:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|