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

@ -26,14 +26,14 @@
#ifndef _GFXVERTEXBUFFER_H_
#include "gfx/gfxVertexBuffer.h"
#endif
#ifndef GL_GGL_H
#include "gfx/gl/ggl/ggl.h"
#endif
#include "gfx/gl/tGL/tGL.h"
#include "gfx/gl/util/glFrameAllocatorLockableHelper.h"
/// This is a vertex buffer which uses GL_ARB_vertex_buffer_object.
class GFXGLVertexBuffer : public GFXVertexBuffer
{
public:
GFXGLVertexBuffer( GFXDevice *device,
U32 numVerts,
const GFXVertexFormat *vertexFormat,
@ -42,23 +42,32 @@ public:
~GFXGLVertexBuffer();
virtual void lock(U32 vertexStart, U32 vertexEnd, void **vertexPtr); ///< calls glMapBuffer and offsets the pointer by vertex start
virtual void unlock(); ///< calls glUnmapBuffer, unbinds the buffer
virtual void prepare(); ///< Binds the buffer
virtual void finish(); ///< We're done here
virtual void lock(U32 vertexStart, U32 vertexEnd, void **vertexPtr); ///< Only write lock are supported.
virtual void unlock(); ///<
virtual void prepare(); ///< Do nothing. Use void prepare(U32 stream, U32 divisor).
virtual void finish(); ///< Do nothing.
void prepare(U32 stream, U32 divisor);
GLvoid* getBuffer(); ///< returns NULL
// GFXResource interface
virtual void zombify();
virtual void resurrect();
private:
friend class GFXGLDevice;
/// GL buffer handle
GLuint mBuffer;
/// bytes offset in buffer
U32 mBufferOffset;
/// start vertex offset in buffer
U32 mBufferVertexOffset;
U8* mZombieCache;
FrameAllocatorLockableHelper mFrameAllocator;
};
#endif