VSTGUI4 and pure opengl editor

A user interface toolkit mainly for audio plug-ins (VST, AudioUnit, etc).
Post Reply
aabyssx
Posts: 9
Joined: Sun Mar 18, 2018 4:36 pm
Contact:

VSTGUI4 and pure opengl editor

Post by aabyssx » Sat Apr 18, 2020 6:50 pm

I am looking into porting our plugin to VST3 and I would like to use VSTGUI to get a platform independent editor window where I can draw with pure OpenGL (maybe NanoVG).
I just need OpenGL functions, mouse and keyboard events. (No UI components from XML etc.) I cannot find examples on the internet.
How do I create my editor (which class to inherit from)?
How do I use the COpenGLView?
Could you please give me some pointers?

Arne Scheffler
Posts: 343
Joined: Mon Jun 20, 2016 7:53 am

Re: VSTGUI4 and pure opengl editor

Post by Arne Scheffler » Tue Apr 21, 2020 2:24 pm

Hi,
for this case, VSTGUI might be overkill. You just have to create a custom IPlugView implementation, where you add either a HWND or an NSView to the parent view which is provided to you in the attached call.

Cheers,
Arne

aabyssx
Posts: 9
Joined: Sun Mar 18, 2018 4:36 pm
Contact:

Re: VSTGUI4 and pure opengl editor

Post by aabyssx » Tue Apr 21, 2020 2:47 pm

Thank you for the answer. I agree that I would only use a very small part of VSTGUI.
But if it solves the window creation, opengl library loading, file open/save dialogs, and maybe some text edit controls on both Windows and OSX then I would still use VSTGUI rather than implementing these myself.
I started inheriting from VSTGUIEditor. I don't have it working yet and still don't understand how COpenGLView is meant to be used.
Could you please direct me to some examples?

aabyssx
Posts: 9
Joined: Sun Mar 18, 2018 4:36 pm
Contact:

Re: VSTGUI4 and pure opengl editor

Post by aabyssx » Tue Apr 21, 2020 8:56 pm

After experimenting I have a test GUI inherited from VSTGUIEditor and a view inherited from COpenGLView. I can have mouse and keyboard events, and I can add views like CTextEdits. I noticed that CTextEdits are covered by the COpenGLView.
I would like to add text edits on top of the opengl view. Is it possible?
vstguiopengl01.png
You do not have the required permissions to view the files attached to this post.

Arne Scheffler
Posts: 343
Joined: Mon Jun 20, 2016 7:53 am

Re: VSTGUI4 and pure opengl editor

Post by Arne Scheffler » Fri Apr 24, 2020 6:31 am

no, you cannot place anything atop the OpenGL view in VSTGUI.

Cheers,
Arne

aabyssx
Posts: 9
Joined: Sun Mar 18, 2018 4:36 pm
Contact:

Re: VSTGUI4 and pure opengl editor

Post by aabyssx » Mon Apr 27, 2020 1:17 am

Is there a way to add a bool isContextCurrent() method to IPlatformOpenGLView?

I am working with frame buffer objects, too and I need to make sure context is current many times.
Performance would benefit if there was a way to avoid calling makeContextCurrent() when the context is already current.

Arne Scheffler
Posts: 343
Joined: Mon Jun 20, 2016 7:53 am

Re: VSTGUI4 and pure opengl editor

Post by Arne Scheffler » Mon Apr 27, 2020 2:40 pm

It would be better if you organize your code so that you don't need to call makeCurrentContext more than needed.
There are currently no plans to add any changes to the OpenGL stuff as it is deprecated on macOS.

Cheers,
Arne

Post Reply