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,7 +142,9 @@ public:
|
||||||
void swapBuffers() noexcept
|
void swapBuffers() noexcept
|
||||||
{
|
{
|
||||||
SwapBuffers (dc.get());
|
SwapBuffers (dc.get());
|
||||||
triggerAsyncUpdate();
|
|
||||||
|
if (! std::exchange (haveBuffersBeenSwapped, true))
|
||||||
|
triggerAsyncUpdate();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool setSwapInterval (int numFramesPerSwap)
|
bool setSwapInterval (int numFramesPerSwap)
|
||||||
|
|
@ -425,6 +427,7 @@ private:
|
||||||
OpenGLContext* context = nullptr;
|
OpenGLContext* context = nullptr;
|
||||||
void* sharedContext = nullptr;
|
void* sharedContext = nullptr;
|
||||||
double nativeScaleFactor = 1.0;
|
double nativeScaleFactor = 1.0;
|
||||||
|
bool haveBuffersBeenSwapped = false;
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (NativeContext)
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (NativeContext)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue