Esempio n. 1
0
        private static void Draw()
        {
            // Begin() must be called before commands can be issued.
            _commandList.Begin();

            // We want to render directly to the output window.
            _commandList.SetFramebuffer(_graphicsDevice.SwapchainFramebuffer);
            _commandList.SetFullViewports();
            _commandList.ClearColorTarget(0, RgbaFloat.CornflowerBlue);

            _commandList.SetPipeline(_pipeline);

            // End() must be called before commands can be submitted for execution.
            _commandList.End();
            _graphicsDevice.SubmitCommands(_commandList);

            textRenderer.BeginDraw();
            text.DrawBatched();
            text2.DrawBatched();
            textRenderer.EndDraw();

            // Once commands have been submitted, the rendered image can be presented to the application window.
            _graphicsDevice.SwapBuffers();
        }
Esempio n. 2
0
 /// <summary>
 /// Render this text in a single draw call
 /// </summary>
 public void Draw()
 {
     _renderer.BeginDraw();
     DrawBatched();
     _renderer.EndDraw();
 }