1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-06 04:00:08 +00:00
JUCE/modules/juce_opengl
reuk f012f8c280
OpenGL: Keep track of previously-attached VAOs and buffers when creating additional GL-backed Graphics contexts
Previously, code such as the following (where MyGLComponent is rendering
using an OpenGLContext) could result in GL errors, as the destruction of
the inner context unbound the array buffer and element array buffer
after use, instead of setting them to the previous values set up by the
outer context.

Additionally, a VAO was only set up in the OpenGLContext, so rendering
into a GL-backed LowLevel graphics context could fail if no VAO was
bound.

    void MyGLComponent::paint (juce::Graphics& g)
    {
        juce::Image image { juce::Image::PixelFormat::ARGB, width, height, false, juce::OpenGLImageType() };

        {
            juce::Graphics innerContext { image };
            // draw into innerContext
        }

        g.drawImage (image, juce::Rectangle<float> { width, height });
    }
2023-06-08 15:26:24 +01:00
..
geometry Matrix3D: Fixed an ordering bug in the multiplication operator 2022-07-28 21:31:47 +01:00
native OpenGL: Avoid taking X lock when swapping buffers to reduce lock contention 2023-06-01 18:51:25 +01:00
opengl OpenGL: Keep track of previously-attached VAOs and buffers when creating additional GL-backed Graphics contexts 2023-06-08 15:26:24 +01:00
utils Update licensing banners to JUCE 7 2022-05-16 17:55:48 +01:00
juce_opengl.cpp Native: Rename all native files for improved consistency 2023-04-04 19:54:29 +01:00
juce_opengl.h BSD: Fix some compiler warnings 2023-02-14 17:00:02 +00:00
juce_opengl.mm Update licensing banners to JUCE 7 2022-05-16 17:55:48 +01:00