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::loadResource( Ogre::Resource* _resource ) { if( mTexPtr.get() == _resource ) { mTexPtr->createInternalResources(); _setTextureName( mGenTexName ); correctUV(); requestUpdateCanvas( this, Event( true, true, false ) ); } }
void Canvas::createExactTexture( int _width, int _height, TextureUsage _usage, PixelFormat _format ) { int width = std::max(1, _width); int height = std::max(1, _height); destroyTexture(); mTexture = RenderManager::getInstance().createTexture(mGenTexName); mTexture->setInvalidateListener(this); mTexture->createManual( width, height, _usage, _format ); mTexManaged = true; _setTextureName( mGenTexName ); correctUV(); requestUpdateCanvas( this, Event( true, true, mInvalidateData ) ); }
void Canvas::updateTexture() { requestUpdateCanvas( this, Event( false, false, true ) ); }