OpenGL rendering is something different from OpenGL drawing and interaction.
OpenGL rendering is done through the “OpenGL Render Suite”. This is what Shadertoy and TestOpenGL examples do
OpenGL Interaction (i.e. drawing and mouse interaction, as you would do with GLUT) is done through Overlay interacts interacts. See the CornerPin plugin source for how to use interacts, or ContactSheet for a much simpler interaction. When the user is done editing, he/she wants to get rid of the interact and see the render. This can easily be done using a boolean param with the label “Show Interact”. At the beginning of each Interact function (draw, penUp, penDown, penUp), if this param is false the function should do nothing and return false (indicating it did nothing).
Another completely different is to have your plugin launch a different process which will create its own GUI and communicate with the plugin via a socket for example. This has to be is a separate process, and this is what make things complicated. I think NeatVideo does this.
i checked the testOpenGL plugin. For my purpose i will need to include glew.h.I successfully compile the TestOpenGL Plugin with glew.h included, but as soon as i start the plugin in natron, natron gets stucked.
Do you have any idea how to use the openGL function from glew.h in openfx?
openfx plugins should not depend too much on external libraries. glew should be fine. glad is fine too. Just make sure whether you want OpenGL rendering or an openGL interact (see my messages above and the openfx documentation)
I went with the approach to launch an external application and share data between the application and OFX with boost::interprocess. Thanks for the advice Frédéric.
Now I need to find a way to trigger the host render call, whenever my external application has changed the data. Any ideas? I created a new topic for this question