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