Exemplo n.º 1
0
        public void FixtureSetUp()
        {
            try {
#if GL_LOG_ENABLED
                // Set logging
                Gl.QueryLogContext();
                Wgl.QueryLogContext();
                KhronosApi.RegisterApplicationLogDelegate(delegate(string format, object[] args) {
                    Console.WriteLine(format, args);
                });
#endif

                // Create window on which tests are run
                _Window = new GraphicsWindow(800, 600);

                // Define window buffers
                GraphicsBuffersFormat graphicsBuffersFormat = new GraphicsBuffersFormat(PixelLayout.RGB24);

                graphicsBuffersFormat.DefineDepthBuffer(24, GraphicsBuffersFormat.BufferPolicy.RequiredAndDegradable);
                graphicsBuffersFormat.DefineDoubleBuffers(GraphicsBuffersFormat.BufferPolicy.RequiredAndDegradable);

                _Window.Create(graphicsBuffersFormat);
                // Create graphics context
                _Context = new GraphicsContext(_Window.GetDeviceContext(), null, null, GraphicsContextFlags.CompatibilityProfile);
            } catch {
                // Release resources manually
                FixtureTearDown();
                throw;
            }
        }