Add OpenGL support.

This commit is contained in:
LuisAntonRebollo 2014-11-08 17:41:17 +01:00
parent c354f59b72
commit dd08fd2e7d
55 changed files with 2957 additions and 802 deletions

View file

@ -24,6 +24,7 @@
#define _GFXGLPRIMITIVEBUFFER_H_
#include "gfx/gfxPrimitiveBuffer.h"
#include "gfx/gl/util/glFrameAllocatorLockableHelper.h"
/// This is a primitive buffer (index buffer to GL users) which uses VBOs.
class GFXGLPrimitiveBuffer : public GFXPrimitiveBuffer
@ -32,8 +33,8 @@ public:
GFXGLPrimitiveBuffer(GFXDevice *device, U32 indexCount, U32 primitiveCount, GFXBufferType bufferType);
~GFXGLPrimitiveBuffer();
virtual void lock(U32 indexStart, U32 indexEnd, void **indexPtr); ///< calls glMapBuffer, offets pointer by indexStart
virtual void unlock(); ///< calls glUnmapBuffer, unbinds the buffer
virtual void lock(U32 indexStart, U32 indexEnd, void **indexPtr); ///< only write lock are supported
virtual void unlock(); ///<
virtual void prepare(); ///< binds the buffer
virtual void finish(); ///< We're done with this buffer
@ -46,8 +47,12 @@ public:
private:
/// Handle to our GL buffer object
GLuint mBuffer;
U32 mBufferOffset;
U8* mZombieCache;
U32 lockedIndexEnd, lockedIndexStart;
FrameAllocatorLockableHelper mFrameAllocator;
};
#endif