Пример #1
0
 static MogreSpriteRenderer2D()
 {
     alphaBlendMode           = LayerBlendModeEx_NativePtr.Create();
     alphaBlendMode.alphaArg1 = 0;
     alphaBlendMode.source1   = LayerBlendSource.LBS_TEXTURE;
     alphaBlendMode.source2   = LayerBlendSource.LBS_MANUAL;
     alphaBlendMode.blendType = LayerBlendType.LBT_ALPHA;
     alphaBlendMode.operation = LayerBlendOperationEx.LBX_MODULATE;
 }
Пример #2
0
        public QuickGUIRenderer()
        {
            mQueueID = RenderQueueGroupID.RENDER_QUEUE_OVERLAY;
            unsafe
            {
                mVertexBufferPtr = null;
            }
            mRenderListDirty = false;

            mRenderSystem = Root.Singleton.RenderSystem;

            mRenderOperation = new RenderOperation();

            mRenderList = new List <QuickGUIQuad>();

            mTexelOffset.x = mRenderSystem.HorizontalTexelOffset;
            mTexelOffset.y = mRenderSystem.VerticalTexelOffset;

            // Initialise blending modes to be used. We use these every frame, so we'll set them up now to save time later.

            mColorBlendMode = LayerBlendModeEx_NativePtr.Create();

            mColorBlendMode.blendType = LayerBlendType.LBT_COLOUR;
            mColorBlendMode.source1   = LayerBlendSource.LBS_TEXTURE;
            mColorBlendMode.source2   = LayerBlendSource.LBS_DIFFUSE;
            mColorBlendMode.operation = LayerBlendOperationEx.LBX_MODULATE;

            mAlphaBlendMode = LayerBlendModeEx_NativePtr.Create();

            mAlphaBlendMode.blendType = LayerBlendType.LBT_ALPHA;
            mAlphaBlendMode.source1   = LayerBlendSource.LBS_TEXTURE;
            mAlphaBlendMode.source2   = LayerBlendSource.LBS_DIFFUSE;
            mAlphaBlendMode.operation = LayerBlendOperationEx.LBX_MODULATE;

            mTextureAddressMode.u = TextureUnitState.TextureAddressingMode.TAM_CLAMP;
            mTextureAddressMode.v = TextureUnitState.TextureAddressingMode.TAM_CLAMP;
            mTextureAddressMode.w = TextureUnitState.TextureAddressingMode.TAM_CLAMP;

            // set up buffer and tracking variables
            _createVertexBuffer(BUFFER_SIZE_INITIAL);

// For now, assume the first scene manager instance is the one in use.
// TODO: reparar esto
//Root.Singleton.GetSceneManagerIterator().Current.RenderQueueStarted += new RenderQueueListener.RenderQueueStartedHandler(Current_RenderQueueStarted);
        }