コード例 #1
0
        public IGL_SlimDX9()
        {
            if (_d3d == null)
            {
                _d3d = new Direct3D();
            }

            OpenTKConfigurator.EnsureConfigurated();

            // make an 'offscreen context' so we can at least do things without having to create a window
            _offscreenNativeWindow = new OpenTK.NativeWindow {
                ClientSize = new Size(8, 8)
            };

            CreateDevice();
            CreateRenderStates();
        }
コード例 #2
0
        public IGL_TK(int majorVersion, int minorVersion, bool forwardCompatible)
        {
            OpenTKConfigurator.EnsureConfigurated();

            //make an 'offscreen context' so we can at least do things without having to create a window
            OffscreenNativeWindow = new NativeWindow {
                ClientSize = new sd.Size(8, 8)
            };
            GraphicsContext = new GraphicsContext(GraphicsMode.Default, OffscreenNativeWindow.WindowInfo, majorVersion, minorVersion, forwardCompatible ? GraphicsContextFlags.ForwardCompatible : GraphicsContextFlags.Default);
            MakeDefaultCurrent();

            //this is important for reasons unknown
            GraphicsContext.LoadAll();

            //misc initialization
            CreateRenderStates();
            PurgeStateCache();
        }