示例#1
0
        public override void Present()
        {
            GraphicsDevice.Begin();

            // If we made a fake render target to avoid OpenGL limitations on window-provided back buffer, let's copy the rendering result to it
            if (backBuffer != GraphicsDevice.windowProvidedRenderTexture)
            {
                GraphicsDevice.CopyScaler2D(backBuffer, GraphicsDevice.windowProvidedRenderTexture,
                                            new Rectangle(0, 0, backBuffer.Width, backBuffer.Height),
                                            new Rectangle(0, 0, GraphicsDevice.windowProvidedRenderTexture.Width, GraphicsDevice.windowProvidedRenderTexture.Height), true);
            }

            gameWindow.SwapBuffers();

            GraphicsDevice.End();
        }
示例#2
0
        public override void Present()
        {
            GraphicsDevice.Begin();

            var androidGameView = (AndroidGameView)Description.DeviceWindowHandle.NativeHandle;

            GraphicsDevice.windowProvidedRenderTexture.InternalSetSize(androidGameView.Width, androidGameView.Height);

            // If we made a fake render target to avoid OpenGL limitations on window-provided back buffer, let's copy the rendering result to it
            if (backBuffer != GraphicsDevice.windowProvidedRenderTexture)
            {
                GraphicsDevice.CopyScaler2D(backBuffer, GraphicsDevice.windowProvidedRenderTexture,
                                            new Rectangle(0, 0, backBuffer.Width, backBuffer.Height),
                                            new Rectangle(0, 0, GraphicsDevice.windowProvidedRenderTexture.Width, GraphicsDevice.windowProvidedRenderTexture.Height), false);
            }
            var graphicsContext = androidGameView.GraphicsContext;

            ((AndroidGraphicsContext)graphicsContext).Swap();

            GraphicsDevice.End();
        }