/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2008.
     ssss    gggg x   x         Steven Goodwin. All Rights Reserved.
    
This version has been released under the GNU Public License v2.0.

Please see the license files for details.

File: include/sgx/graphics/dynamic_texture.hpp

*/

#ifndef SGX_GFX_DYNAMIC_TEXTURE_HPP
#define SGX_GFX_DYNAMIC_TEXTURE_HPP	1

class CDynamicTexture {
public:
	CDynamicTexture(const tUINT32 width, const tUINT32 height, const CImageData::tFormat format);
	virtual ~CDynamicTexture();
	virtual void	initialize();
	virtual void	reset();
	virtual void	update(const tREAL32 telaps);
	virtual	tBOOL	frameLimitedUpdate(const tREAL32 telaps, const tREAL32 max_fps);
	virtual void	rebuild();
	
	SGX_INLINE CImageData *Data()			{ return m_pData; }
	SGX_INLINE CSGXTexture *GetTexturePtr() { return m_pTexture; }

protected:
	CSGXTexture				*m_pTexture;
	CImageData				*m_pData;

	// Timing helpers. Not strictly part of the base class
	// but so very useful, is saves a lot of repeated code
	// and has virtually no memory impact, when compared to
	// the texture size, and number of dynamic textures
	// present.
	tREAL32					m_fTimecum;
	tREAL32					m_fTimeFrame;
};

#endif /* SGX_GFX_DYNAMIC_TEXTURE_HPP */
