Пример #1
0
        private void PlatformInitialize()
        {
            _viewport = new Viewport(
                0, 0, PresentationParameters.BackBufferWidth, PresentationParameters.BackBufferHeight);

            // Ensure the vertex attributes are reset
            EnabledVertexAttributes.Clear();

            // Free all the cached shader programs.
            _programCache.Clear();
            _shaderProgram = null;

            _framebufferHelper = FramebufferHelper.Create(this);

            // Force resetting states
            PlatformApplyBlend(true);
            DepthStencilState.PlatformApplyState(this, true);
            RasterizerState.PlatformApplyState(this, true);

            _bufferBindingInfos = new BufferBindingInfo[_maxVertexBufferSlots];
            for (int i = 0; i < _bufferBindingInfos.Length; i++)
            {
                _bufferBindingInfos[i] = new BufferBindingInfo {
                    Vbo = default
                }
            }
            ;
        }
Пример #2
0
        /// <summary>
        /// 图形平台初始化
        /// </summary>
        private void PlatformInitialize()
        {
            _viewport = new Viewport(0, 0, PresentationParameters.BackBufferWidth, PresentationParameters.BackBufferHeight);
            _enabledVertexAttributes.Clear();
            _programCache.Clear();
            _shaderProgram = null;
            //if (GraphicsCapabilities.SupportsFramebufferObjectARB)
            //{
            //    framebufferHelper = new FramebufferHelper(this);
            //}
            framebufferHelper = FramebufferHelper.Create(this);

            //Force resetting states
            this.PlatformApplyBlend(true);
            this.DepthStencilState.PlatformApplyState(this, true);
            this.RasterizerState.PlatformApplyState(this, true);

            _maxVertexBufferSlots = 1;
        }
Пример #3
0
        private void PlatformInitialize()
        {
            _viewport = new Viewport(0, 0, PresentationParameters.BackBufferWidth, PresentationParameters.BackBufferHeight);

            // Ensure the vertex attributes are reset
            _enabledVertexAttributes.Clear();

            // Free all the cached shader programs.
            _programCache.Clear();
            _shaderProgram = null;

            framebufferHelper = FramebufferHelper.Create(this);

            // Force resetting states
            this.PlatformApplyBlend(true);
            this.DepthStencilState.PlatformApplyState(this, true);
            this.RasterizerState.PlatformApplyState(this, true);

            // TODO: Add support for multiple vertex buffers (SetVertexBuffers).
            _maxVertexBufferSlots = 1;
        }