Using OpenGL with Rhino 5


I am trying to create a render for Rhino 5. It uses OpenGL to render. The way I currently have been using it is I have a GLControl which is from the OpenTK library and I am doing the rendering in the OnPaint event handler. My issue is this event is not being called enough to have frame rates that are usable. I have tried invalidating the Control each time the paint event is raise but this causes Rhino to freeze understandably. I am wondering if there is a method I can use that will cause the OnPaint method to be called more often or if there is a better path you could suggest I take in creating this render.

The reason I have chosen to implement this render as a panel instead of a RenderPlugin is from the documentation I cannot seem to find how to use OpenGL in the RenderPlugin, whereas OpenTK allows me to use it very easily. If the correct path is to use a RenderPlugin could you provide me with resources to get started using OpenGL in it?

Thank you,

Alexander McRae

Update for those wondering, If you add a event handler Application_Idle and add it to Rhino.RhinoApp you can invalidate your control each time its called and that is working pretty well.

If I someone believes this is still easier in a Rendering Plugin please let me know or point me to where to look!


Alexander McRae