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(); }
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) { } }