Ejemplo n.º 1
0
    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 );
    }
Ejemplo n.º 2
0
	void Canvas::loadResource( Ogre::Resource* _resource )
	{
		if( mTexPtr.get() == _resource )
		{
			mTexPtr->createInternalResources();

			_setTextureName( mGenTexName );

			correctUV();

			requestUpdateCanvas( this, Event( true, true, false ) );
		}
	}
Ejemplo n.º 3
0
    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 ) );
    }