Skip to content

Commit

Permalink
Merge pull request #98 from francotiveron/master
Browse files Browse the repository at this point in the history
  • Loading branch information
varon authored Feb 9, 2023
2 parents 63c65bf + f7a32f6 commit 2e91dcb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 1 addition & 7 deletions src/GLWpfControl/GLWpfControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public class GLWpfControl : FrameworkElement

[CanBeNull] private GLWpfControlSettings _settings;
[CanBeNull] private GLWpfControlRenderer _renderer;
private bool _needsRedraw;

// -----------------------------------
// Properties
Expand Down Expand Up @@ -93,7 +92,6 @@ public void Start(GLWpfControlSettings settings)
throw new InvalidOperationException($"{nameof(Start)} must only be called once for a given {nameof(GLWpfControl)}");
}
_settings = settings.Copy();
_needsRedraw = settings.RenderContinuously;
_renderer = new GLWpfControlRenderer(_settings);
_renderer.GLRender += timeDelta => Render?.Invoke(timeDelta);
_renderer.GLAsyncRender += () => AsyncRender?.Invoke();
Expand Down Expand Up @@ -183,11 +181,7 @@ private void OnCompTargetRender(object sender, EventArgs e)

_lastRenderTime = currentRenderTime.Value;

if (_needsRedraw) {
InvalidateVisual();
}

_needsRedraw = RenderContinuously;
if (RenderContinuously) InvalidateVisual();
}

protected override void OnRender(DrawingContext drawingContext) {
Expand Down
4 changes: 2 additions & 2 deletions src/GLWpfControl/GLWpfControl.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@

<ItemGroup>
<PackageReference Include="JetBrains.Annotations" Version="2021.3.0" />
<PackageReference Include="OpenTK" Version="4.7.1" />
<PackageReference Include="OpenTK" Version="4.7.5" />
</ItemGroup>

<PropertyGroup >
<PropertyGroup>
<OutputPath>bin\$(Configuration)\$(TargetFramework)</OutputPath>
</PropertyGroup>
</Project>

0 comments on commit 2e91dcb

Please sign in to comment.