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,7 +24,8 @@
#define _GFXGLTEXTUREOBJECT_H
#include "gfx/gfxTextureObject.h"
#include "gfx/gl/ggl/ggl.h"
#include "gfx/gl/tGL/tGL.h"
#include "gfx/gfxStateBlock.h"
class GFXGLDevice;
@ -32,9 +33,10 @@ class GFXGLTextureObject : public GFXTextureObject
{
public:
GFXGLTextureObject(GFXDevice * aDevice, GFXTextureProfile *profile);
virtual ~GFXGLTextureObject();
~GFXGLTextureObject();
void release();
void reInit();
inline GLuint getHandle() const { return mHandle; }
inline GLenum getBinding() const { return mBinding; }
@ -45,7 +47,7 @@ public:
/// Binds the texture to the given texture unit
/// and applies the current sampler state because GL tracks
/// filtering and wrapper per object, while GFX tracks per sampler.
void bind(U32 textureUnit) const;
void bind(U32 textureUnit);
/// @return An array containing the texture data
/// @note You are responsible for deleting the returned data! (Use delete[])
@ -73,6 +75,8 @@ public:
virtual void zombify();
virtual void resurrect();
virtual const String describeSelf() const;
void initSamplerState(const GFXSamplerStateDesc &ssd);
private:
friend class GFXGLTextureManager;
@ -80,7 +84,8 @@ private:
/// Internal GL object
GLuint mHandle;
GLuint mBuffer;
bool mNeedInitSamplerState;
GFXSamplerStateDesc mSampler;
GLenum mBinding;
U32 mBytesPerTexel;
@ -94,6 +99,13 @@ private:
U8* mZombieCache;
void copyIntoCache();
//FrameAllocator
U32 mFrameAllocatorMark;
#if TORQUE_DEBUG
U32 mFrameAllocatorMarkGuard;
#endif
U8 *mFrameAllocatorPtr;
};
#endif