mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
OpenGL (Windows): Only trigger async update after first buffer swap
This fixes an issue where OpenGL would continuously repaint on Windows.
This commit is contained in:
parent
70652e3d23
commit
9c8a2b9609
1 changed files with 4 additions and 1 deletions
|
|
@ -142,6 +142,8 @@ public:
|
|||
void swapBuffers() noexcept
|
||||
{
|
||||
SwapBuffers (dc.get());
|
||||
|
||||
if (! std::exchange (haveBuffersBeenSwapped, true))
|
||||
triggerAsyncUpdate();
|
||||
}
|
||||
|
||||
|
|
@ -425,6 +427,7 @@ private:
|
|||
OpenGLContext* context = nullptr;
|
||||
void* sharedContext = nullptr;
|
||||
double nativeScaleFactor = 1.0;
|
||||
bool haveBuffersBeenSwapped = false;
|
||||
|
||||
//==============================================================================
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (NativeContext)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue