예제 #1
0
        public void Run()
        {
            using (var form = new Form())
            {
                form.ClientSize = new Size(800, 600);

                using (var renderWindow = new OpenTKRenderWindow(form))
                {
                    form.Controls[0].KeyPress +=
                        delegate(object sender, KeyPressEventArgs args)
                        {
                            if (args.KeyChar == 'p')
                            {
                                renderWindow.TakeScreenshot("testOpenTK.bmp");
                                Console.WriteLine("Successfully took screenshot!");
                            }
                        };

                    Application.Idle +=
                        delegate
                        {
                            renderWindow.StartRendering();

                            renderWindow.Render();

                            Application.DoEvents();
                        };

                    Application.Run(form);
                }
            }
        }
예제 #2
0
        public void Setup()
        {
            Form = new Form
            {
                ClientSize = new Size(800, 600)
            };

            RenderWindow = new OpenTKRenderWindow(Form);
        }