
Super Lazy OpenTK Initialization
Posted Friday, 16 March, 2012 - 19:34 by flopolocoThis is a simple test I make just to test delegates and having a glimpse of C# Lamba glamour. I don't know if it useful but it's for sure very easy and minimalistic.
using System; using System.Drawing; using OpenTK; using OpenTK.Graphics; using OpenTK.Graphics.OpenGL; using OpenTK.Input; namespace LearningOpenTK { // Super Lazy class Program { public static void Main(string[] args) { GameWindow g = new GameWindow(800, 600); g.KeyPress += delegate { g.Exit(); }; g.Load += delegate { GL.ClearColor(Color.Red); }; g.RenderFrame += delegate(object sender, FrameEventArgs e) { GL.Clear(ClearBufferMask.ColorBufferBit); System.Diagnostics.Debug.WriteLine(e.Time.ToString()); ((GameWindow)sender).SwapBuffers(); }; g.Run(); g.Dispose(); } } }
- flopoloco's blog
- Login or register to post comments


Comments
Re: Super Lazy OpenTK Initialization
Interesting! Thanks for sharing this!