예제 #1
0
 public void RenderLoop()
 {
     while (running)
     {
         try
         {
             if (resized)
             {
                 reset();
             }
             device.Clear(ClearFlags.Target, Color.Transparent, 0, 0);
             device.SetRenderState(RenderState.AlphaBlendEnable, true);
             device.SetRenderState(RenderState.CullMode, Cull.Clockwise);
             device.BeginScene();
             fontRenderer.Begin();
             textureRenderer.Begin();
             try
             {
                 Render.SafeInvoke();
             }
             finally
             {
                 textureRenderer.End();
                 fontRenderer.End();
                 device.EndScene();
                 device.Present();
             }
         }
         catch (SharpDXException) { }
     }
     renderLocker.Set();
 }
예제 #2
0
 public void TryRender()
 {
     try
     {
         if (resized)
         {
             reset();
         }
         device.Clear(ClearFlags.Target, Color.Transparent, 0, 0);
         device.SetRenderState(RenderState.AlphaBlendEnable, true);
         device.SetRenderState(RenderState.CullMode, Cull.Clockwise);
         device.BeginScene();
         fontRenderer.Begin();
         textureRenderer.Begin();
         try
         {
             imguiRenderer.GetNewFrame();
             Render.SafeInvoke();
             imguiRenderer.Draw();
         }
         finally
         {
             textureRenderer.End();
             fontRenderer.End();
             device.EndScene();
             device.Present();
         }
         renderLocker.Set();
     }
     catch (SharpDXException)
     {
     }
 }