void Canvas::frameEntered( float _time ) { int width = mReqTexSize.width; int height = mReqTexSize.height; TextureUsage usage = getDefaultTextureUsage(); PixelFormat format = getDefaultTextureFormat(); validate( width, height, usage, format ); bool create = checkCreate( width, height ); if ( mTexResizeMode == TRM_PT_CONST_SIZE ) create = false; if ( create ) { createExactTexture( width, height, usage, format ); correctUV(); } else // I thought order is important { correctUV(); requestUpdateCanvas( this, Event( false, true, mInvalidateData ) ); } mInvalidateData = false; frameAdvise( false ); }
void Canvas::createTexture( int _width, int _height, TextureResizeMode _resizeMode, Ogre::TextureUsage _usage, Ogre::PixelFormat _format ) { MYGUI_ASSERT( _width >= 0 && _height >= 0, "negative size" ); if( mReqTexSize.empty() ) mReqTexSize = IntSize( _width, _height ); mTexResizeMode = _resizeMode; bool create = checkCreate( _width, _height ); validateSize( _width, _height ); if( create ) createExactTexture( _width, _height, _usage, _format ); }
void Canvas::createTexture( int _width, int _height, TextureResizeMode _resizeMode, TextureUsage _usage, PixelFormat _format ) { int width = std::max(1, _width); int height = std::max(1, _height); if ( mReqTexSize.empty() ) mReqTexSize = IntSize( width, height ); mTexResizeMode = _resizeMode; bool create = checkCreate( width, height ); width = Bitwise::firstPO2From(width); height = Bitwise::firstPO2From(height); if ( create ) createExactTexture( width, height, _usage, _format ); }
void Canvas::createTexture( int _width, int _height, TextureResizeMode _resizeMode, TextureUsage _usage, PixelFormat _format ) { mTexResizeMode = _resizeMode; int width = std::max(1, _width); int height = std::max(1, _height); if (_resizeMode == TRM_PT_CONST_SIZE) { mReqTexSize = IntSize(width, height); } else { mReqTexSize = IntSize(std::max(1, getWidth()), std::max(1, getHeight())); } bool create = checkCreate( width, height ); width = Bitwise::firstPO2From(width); height = Bitwise::firstPO2From(height); if ( create ) createExactTexture( width, height, _usage, _format ); }