kopia lustrzana https://github.com/jameshball/osci-render
Cleanly delete renderer
rodzic
f306c6af33
commit
d94cc3b935
|
@ -8,6 +8,10 @@ VisualiserOpenGLComponent::VisualiserOpenGLComponent(VisualiserSettings& setting
|
||||||
openGLContext.setContinuousRepainting(true);
|
openGLContext.setContinuousRepainting(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VisualiserOpenGLComponent::~VisualiserOpenGLComponent() {
|
||||||
|
openGLContext.detach();
|
||||||
|
}
|
||||||
|
|
||||||
void VisualiserOpenGLComponent::newOpenGLContextCreated() {
|
void VisualiserOpenGLComponent::newOpenGLContextCreated() {
|
||||||
using namespace juce::gl;
|
using namespace juce::gl;
|
||||||
|
|
||||||
|
@ -278,6 +282,21 @@ void VisualiserOpenGLComponent::newOpenGLContextCreated() {
|
||||||
setupArrays(1024);
|
setupArrays(1024);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VisualiserOpenGLComponent::openGLContextClosing() {
|
||||||
|
using namespace juce::gl;
|
||||||
|
|
||||||
|
glDeleteBuffers(1, &quadIndexBuffer);
|
||||||
|
glDeleteBuffers(1, &vertexIndexBuffer);
|
||||||
|
glDeleteBuffers(1, &vertexBuffer);
|
||||||
|
glDeleteFramebuffers(1, &frameBuffer);
|
||||||
|
glDeleteTextures(1, &lineTexture.id);
|
||||||
|
glDeleteTextures(1, &blur1Texture.id);
|
||||||
|
glDeleteTextures(1, &blur2Texture.id);
|
||||||
|
glDeleteTextures(1, &blur3Texture.id);
|
||||||
|
glDeleteTextures(1, &blur4Texture.id);
|
||||||
|
screenOpenGLTexture.release();
|
||||||
|
}
|
||||||
|
|
||||||
void VisualiserOpenGLComponent::renderOpenGL() {
|
void VisualiserOpenGLComponent::renderOpenGL() {
|
||||||
if (openGLContext.isActive()) {
|
if (openGLContext.isActive()) {
|
||||||
xSamples.clear();
|
xSamples.clear();
|
||||||
|
@ -300,8 +319,6 @@ void VisualiserOpenGLComponent::renderOpenGL() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void VisualiserOpenGLComponent::openGLContextClosing() {}
|
|
||||||
|
|
||||||
void VisualiserOpenGLComponent::resized() {
|
void VisualiserOpenGLComponent::resized() {
|
||||||
viewportChanged();
|
viewportChanged();
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ struct Texture {
|
||||||
class VisualiserOpenGLComponent : public juce::Component, public juce::OpenGLRenderer {
|
class VisualiserOpenGLComponent : public juce::Component, public juce::OpenGLRenderer {
|
||||||
public:
|
public:
|
||||||
VisualiserOpenGLComponent(VisualiserSettings& settings);
|
VisualiserOpenGLComponent(VisualiserSettings& settings);
|
||||||
|
~VisualiserOpenGLComponent() override;
|
||||||
|
|
||||||
void newOpenGLContextCreated() override;
|
void newOpenGLContextCreated() override;
|
||||||
void renderOpenGL() override;
|
void renderOpenGL() override;
|
||||||
|
|
Ładowanie…
Reference in New Issue