diff options
| author | Adrian Ulbrich <adrian.ulbrich.2003@gmail.com> | 2019-11-10 15:03:02 +0100 |
|---|---|---|
| committer | Adrian Ulbrich <adrian.ulbrich.2003@gmail.com> | 2019-11-10 15:03:02 +0100 |
| commit | b1a66306b44e200fd8c396b9456b553f22c4b8a0 (patch) | |
| tree | b40df44b1837040a45ac7bc01b4106e170e2a5c8 | |
| parent | 52a942a38066557250f9a0bedbd820f1e004bcea (diff) | |
| download | Unicity-b1a66306b44e200fd8c396b9456b553f22c4b8a0.tar.gz Unicity-b1a66306b44e200fd8c396b9456b553f22c4b8a0.tar.bz2 Unicity-b1a66306b44e200fd8c396b9456b553f22c4b8a0.zip | |
Added support for enabling/disabling drawing the window while resizing
| -rw-r--r-- | Unicity.Game/Unicity.Game.csproj | 2 | ||||
| -rw-r--r-- | Unicity.Renderer/RenderWindow.cs | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/Unicity.Game/Unicity.Game.csproj b/Unicity.Game/Unicity.Game.csproj index 01f81ba..a396e52 100644 --- a/Unicity.Game/Unicity.Game.csproj +++ b/Unicity.Game/Unicity.Game.csproj @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> +<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> <PropertyGroup> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> diff --git a/Unicity.Renderer/RenderWindow.cs b/Unicity.Renderer/RenderWindow.cs index 823d866..8307f47 100644 --- a/Unicity.Renderer/RenderWindow.cs +++ b/Unicity.Renderer/RenderWindow.cs @@ -17,6 +17,8 @@ namespace Unicity.Renderer public string Title { get => window.Title; set => window.Title = value; } + public bool UpdateOnResize = false; + bool disposed = false; public RenderWindow(int width, int height, string title) @@ -36,7 +38,10 @@ namespace Unicity.Renderer { GL.Viewport(0, 0, Width, Height); - Window_RenderFrame(this, new FrameEventArgs()); + if (UpdateOnResize) + { + Window_RenderFrame(this, new FrameEventArgs()); + } } private void Window_UpdateFrame(object sender, FrameEventArgs e) |
