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