19 mTexResizeMode( TRM_PT_CONST_SIZE ),
22 mFrameAdvise( false ),
23 mInvalidateData(false)
38 int width = std::max(1, _size.
width);
39 int height = std::max(1, _size.
height);
46 int width = std::max(1, _width);
47 int height = std::max(1, _height);
76 int width = std::max(1, _width);
77 int height = std::max(1, _height);
130 _width = std::max(1, _width);
131 _height = std::max(1, _height);
199 mTexData = reinterpret_cast< uint8* >( data );
241 validate( width, height, usage, format );
void _setUVSet(const FloatRect &_rect)
EventHandle_CanvasPtrEvent requestUpdateCanvas
ITexture * getTexture() const
Reurns interface texture.
virtual void createManual(int _width, int _height, TextureUsage _usage, PixelFormat _format)=0
void frameEntered(float _time)
For updating once per frame.
void * lock(TextureUsage _usage=TextureUsage::Write)
Locks hardware pixel buffer.
EventHandle_FrameEventDelegate eventFrameStart
void unlock()
Unlocks hardware pixel buffer.
void frameAdvise(bool _advise)
For updating once per frame.
types::TSize< int > IntSize
int getTextureRealHeight() const
Returns real height of texture.
static PixelFormat getDefaultTextureFormat()
Returns default GUI texture format.
delegates::IDelegate0 * newDelegate(void(*_func)())
static RenderManager & getInstance()
bool mFrameAdvise
For updating once per frame. True state means updating before next frame starts.
int getTextureSrcWidth() const
Returns needed width while creating texture.
EventHandle_CanvasPtr eventPreTextureChanges
virtual void setSize(const IntSize &_value)
ITexture * mTexture
Current texture.
void correctUV()
Correct texture uv-coordinates.
void createExactTexture(int _width, int _height, TextureUsage _usage, PixelFormat _format)
Creates the texture itself.
int getTextureRealWidth() const
Returns real width of texture.
virtual void * lock(TextureUsage _access)=0
virtual bool isLocked()=0
bool isTextureSrcSize() const
Checks if the texture has the source (required by user) size, otherwise real texture size are bigger.
IntSize getTextureRealSize() const
Returns real _size of texture.
IntSize getTextureSrcSize() const
Returns needed sizes while creating texture.
void _setTextureName(const std::string &_texture)
virtual const std::string & getName() const =0
const std::string & getTextureName() const
Returns name of the current texture.
types::TCoord< int > IntCoord
bool isTextureCreated() const
Returns true if the texture was created (and exists), otherwise false.
void updateTexture()
Call user delegate update and removes old texture if it isn't original.
ISubWidgetRect * getSubWidgetMain()
virtual void initialiseOverride()
virtual void textureInvalidate(ITexture *_texture)
virtual void setCoord(const IntCoord &_value)
bool isTextureManaged() const
Returns true if we own the texture, otherwise false.
void createTexture(TextureResizeMode _resizeMode, TextureUsage _usage=getDefaultTextureUsage(), PixelFormat _format=getDefaultTextureFormat())
Creates texture.
static __inline Type firstPO2From(Type _value)
IntSize mReqTexSize
Requested bu user sizes.
virtual int getHeight()=0
std::string toString(T p)
static TextureUsage getDefaultTextureUsage()
Returns default GUI texture usage.
void validate(int &_width, int &_height, TextureUsage &_usage, PixelFormat &_format) const
Update entered parameters according to current texture resize mode(size) and restore (if can) paramet...
void resize(const IntSize &_size)
Calls when resize widget.
TextureResizeMode mTexResizeMode
Texture resize mode.
TextureResizeMode getResizeMode() const
Returns resize mode.
void setTextureManaged(bool _value)
Sets the texture managed.
bool checkCreate(int _width, int _height) const
Checks if we need to create a texture with such sizes.
types::TRect< float > FloatRect
virtual PixelFormat getFormat()=0
virtual TextureUsage getUsage()=0
bool isLocked() const
Checks lockness of hardware _pixel buffer.
void _destroyTexture(bool _sendEvent)
Destroys texture.
int getTextureSrcHeight() const
Returns needed height while creating texture.
void setResizeMode(TextureResizeMode _value)
Sets resize mode of texture.
virtual void shutdownOverride()
bool mTexManaged
true if we own the texture (can delete it or replace by another instance), otherwise false
PixelFormat getTextureFormat() const
Returns needed sizes while creating texture.
virtual void setInvalidateListener(ITextureInvalidateListener *_listener)
virtual ITexture * createTexture(const std::string &_name)=0
std::string mGenTexName
Generated texture name.
void destroyTexture()
Destroys texture.
uint8 * mTexData
Saved pointer from last calling lock.
virtual void destroyTexture(ITexture *_texture)=0