diff --git a/src/widgets/FramebufferWidget.cpp b/src/widgets/FramebufferWidget.cpp index 20e86fb4..4b73571b 100644 --- a/src/widgets/FramebufferWidget.cpp +++ b/src/widgets/FramebufferWidget.cpp @@ -39,6 +39,20 @@ void FramebufferWidget::draw(NVGcontext *vg) { // printf("xxx FramebufferWidget::draw: global_ui=%p\n", global_ui); #ifdef RACK_PLUGIN_SHARED bool bFBO = global_ui->b_fbo_shared; + + static bool bInit = false; + if(bFBO && !bInit) + { + printf("xxx FramebufferWidget::draw: lazy-init glew\n"); + glewExperimental = GL_TRUE; + bInit = true; + if(glewInit() != GLEW_OK) { + printf("Could not init glew.\n"); + return; + } + // GLEW generates GL error because it calls glGetString(GL_EXTENSIONS), we'll consume it here. + glGetError(); + } #else bool bFBO = global_ui->b_fbo; #endif // RACK_PLUGIN_SHARED diff --git a/vst2_bin/settings.json b/vst2_bin/settings.json index b284a782..b1be097b 100644 --- a/vst2_bin/settings.json +++ b/vst2_bin/settings.json @@ -14,7 +14,7 @@ "refreshRate": 30, "vsync": true, "fbo": true, - "fbo_shared": false, + "fbo_shared": true, "touchInput": false, "touchKbd": false, "oversampleFactor": 1.0,