ewol/ewol/resource/Texture.h

53 lines
1.3 KiB
C++

/**
* @author Edouard DUPIN
*
* @copyright 2011, Edouard DUPIN, all right reserved
*
* @license APACHE v2.0 (see license file)
*/
#ifndef __EWOL_TEXTURE_H__
#define __EWOL_TEXTURE_H__
#include <etk/types.h>
#include <ewol/debug.h>
#include <egami/Image.h>
#include <gale/resource/Texture.h>
namespace ewol {
namespace resource {
class Texture : public gale::resource::Texture {
protected:
// openGl Context propoerties :
egami::Image m_data;
// some image are not square == > we need to sqared it to prevent some openGl api error the the displayable size is not all the time 0.0 -> 1.0
vec2 m_endPointSize;
// internal state of the openGl system :
bool m_loaded;
// Public API:
protected:
void init(const std::string& _filename);
void init();
Texture();
public:
DECLARE_RESOURCE_FACTORY(Texture);
virtual ~Texture();
public:
// you must set the size here, because it will be set in multiple of pow(2)
void setImageSize(ivec2 newSize);
// get the reference on this image to draw nomething on it ...
inline egami::Image& get() {
return m_data;
};
// flush the data to send it at the openGl system
void flush();
void updateContext();
void removeContext();
void removeContextToLate();
};
};
};
#endif