Mono, OpenGL and GTK#

If you want to integrate OpenGL in your C# based Application you currently only have the option to use either FreeGLUT, SDL or the GtkGlArea Widget. In this example i show you how to use the GtkGlAreaSharp Widget to create the necessary OpenGL context and draw to it using Tao.OpenGl. Additionally we will insert a GTK Slider Widget to adjust the Zoom Level (using glTranslate)

In the end it should look like:

Please note that you have to satisfy some dependencies to make this work:

  • Tao.OpenGl (included) (=> Installed native OpenGL libraries required)
  • Tao.FreeGlut (included) (=> Installed native FreeGlut library required)
  • GtkGlAreaSharp (included) (=> Installed native GtkGlArea library required)

Download the Monodevelop Source here: gtkglareasharptest

原文地址:https://www.cnblogs.com/top5/p/1585279.html