public static int Main(string[] argc) { Application.Init (); ObjectPickExample example = new ObjectPickExample(); // Create a new Pyramid object, translate it a bit left and add it to our gl window Pyramid pyramid = new Pyramid(); pyramid.Translate(-1.5,0.0,-3); example.glw.AddGLObject( pyramid ); pyramid.SelectedEvent += Throb; // Create a new Cube object, translate it a bit right and add it to our gl window Cube cube = new GtkGL.Cube(); cube.Translate(1.5,0.0,-3); example.glw.AddGLObject( cube ); cube.SelectedEvent += Throb; // Show GL Window // Is this a bug? Shouldn't ShowAll do what these two commands do? // engine.window.ShowAll(); example.window.Show(); example.glw.Show(); Application.Run (); return 0; }
public static int Main(string[] argc) { Application.Init (); GtkGL.GladeExample gladeWindow = new GtkGL.GladeExample(); // Create a new Triangle object, translate it a bit and add it to our gl window pyramid = new Pyramid(); pyramid.Translate(-1.5,0.0,-3); gladeWindow.glw.AddGLObject( pyramid ); // Create a new Square object, translate it a bit and add it to our gl window cube = new Cube(); cube.Translate(1.5,0.0,-3); gladeWindow.glw.AddGLObject( cube ); // Show GL Window // Is this a bug? Shouldn't ShowAll do what these two commands do? // gladeWindow.glwidget.ShowAll(); gladeWindow.glwidget.Show(); gladeWindow.glw.Show(); // Rotate (and draw) our objects once evry 50 ms GLib.Timeout.Add (50, new GLib.TimeoutHandler (NeHe.Lesson05.RotateObjects)); Application.Run (); return 0; }