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);
241 validate( width, height, usage, format );
int getTextureSrcWidth() const
Returns needed width while creating texture.
void _setUVSet(const FloatRect &_rect)
EventHandle_CanvasPtrEvent requestUpdateCanvas
bool isLocked() const
Checks lockness of hardware _pixel buffer.
bool checkCreate(int _width, int _height) const
Checks if we need to create a texture with such sizes.
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
int getTextureRealHeight() const
Returns real height of texture.
void unlock()
Unlocks hardware pixel buffer.
void frameAdvise(bool _advise)
For updating once per frame.
types::TSize< int > IntSize
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.
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.
virtual void * lock(TextureUsage _access)=0
virtual bool isLocked()=0
void _setTextureName(const std::string &_texture)
virtual const std::string & getName() const =0
TextureResizeMode getResizeMode() const
Returns resize mode.
types::TCoord< int > IntCoord
int getTextureSrcHeight() const
Returns needed height while creating texture.
void updateTexture()
Call user delegate update and removes old texture if it isn't original.
ISubWidgetRect * getSubWidgetMain()
PixelFormat getTextureFormat() const
Returns needed sizes while creating texture.
virtual void initialiseOverride()
virtual void textureInvalidate(ITexture *_texture)
virtual void setCoord(const IntCoord &_value)
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
IntSize getTextureSrcSize() const
Returns needed sizes while creating texture.
bool isTextureCreated() const
Returns true if the texture was created (and exists), otherwise false.
std::string toString(T p)
static TextureUsage getDefaultTextureUsage()
Returns default GUI texture usage.
void resize(const IntSize &_size)
Calls when resize widget.
TextureResizeMode mTexResizeMode
Texture resize mode.
void setTextureManaged(bool _value)
Sets the texture managed.
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.
types::TRect< float > FloatRect
int getTextureRealWidth() const
Returns real width of texture.
virtual PixelFormat getFormat()=0
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...
virtual TextureUsage getUsage()=0
void _destroyTexture(bool _sendEvent)
Destroys texture.
bool isTextureManaged() const
Returns true if we own the texture, otherwise false.
void setResizeMode(TextureResizeMode _value)
Sets resize mode of texture.
const std::string & getTextureName() const
Returns name of the current texture.
virtual void shutdownOverride()
bool mTexManaged
true if we own the texture (can delete it or replace by another instance), otherwise false ...
virtual void setInvalidateListener(ITextureInvalidateListener *_listener)
virtual ITexture * createTexture(const std::string &_name)=0
ITexture * getTexture() const
Reurns interface texture.
std::string mGenTexName
Generated texture name.
void destroyTexture()
Destroys texture.
uint8 * mTexData
Saved pointer from last calling lock.
virtual void destroyTexture(ITexture *_texture)=0