Ejemplo n.º 1
0
 public OpenGLRenderControl(OpenTK.Graphics.GraphicsMode graphicsMode, int major, int minor, OpenTK.Graphics.GraphicsContextFlags graphicsContextFlags)
 {
     this.graphicsMode         = graphicsMode;
     this.graphicsContextFlags = graphicsContextFlags;
     this.major = major;
     this.minor = minor;
 }
Ejemplo n.º 2
0
        private void ConstructContext()
        {
            OpenTK.Graphics.GraphicsContextFlags flags = OpenTK.Graphics.GraphicsContextFlags.Default;
            int major = 1;
            int minor = 0;

            OpenTK.Platform.IWindowInfo windowInfo = Window.window.WindowInfo;
            if (System.Environment.OSVersion.Platform == PlatformID.Win32NT ||
                System.Environment.OSVersion.Platform == PlatformID.Win32S ||
                System.Environment.OSVersion.Platform == PlatformID.Win32Windows ||
                System.Environment.OSVersion.Platform == PlatformID.WinCE)
            {
                major = 4;
                minor = 4;
            }
            if (this.Context == null || this.Context.IsDisposed)
            {
                OpenTK.Graphics.ColorFormat colorFormat = new OpenTK.Graphics.ColorFormat(8, 8, 8, 8);
                int depth   = 24;//TODO: wth?
                int stencil = 8;
                int samples = 4;

                OpenTK.Graphics.GraphicsMode mode = new OpenTK.Graphics.GraphicsMode(colorFormat, depth, stencil, samples);
                try
                {
                    this.Context = new OpenTK.Graphics.GraphicsContext(mode, windowInfo, major, minor, flags);
                    //this.Context = Window.Context;
                }
                catch (Exception ex)
                {
                    mode         = OpenTK.Graphics.GraphicsMode.Default;
                    major        = 1;
                    minor        = 0;
                    flags        = OpenTK.Graphics.GraphicsContextFlags.Default;
                    this.Context = new OpenTK.Graphics.GraphicsContext(mode, windowInfo, major, minor, flags);
                }
            }

            this.Context.MakeCurrent(windowInfo);
            (this.Context as OpenTK.Graphics.IGraphicsContextInternal).LoadAll();
            ThreadingHelper.Initialize(windowInfo, major, minor, contextFlags);
            this.Context.MakeCurrent(windowInfo);
        }
Ejemplo n.º 3
0
 public CrowWindow(int width, int height, OpenTK.Graphics.GraphicsMode mode, string title, GameWindowFlags options, DisplayDevice device, int major, int minor, OpenTK.Graphics.GraphicsContextFlags flags)
     : base(width, height, mode, title, options, device, major, minor, flags)
 {
 }
Ejemplo n.º 4
0
        public OpenTKGameWindow(int width, int height, OpenTK.Graphics.GraphicsMode mode, string title, GameWindowFlags options, DisplayDevice device, int major, int minor, OpenTK.Graphics.GraphicsContextFlags flags)
            : base(width, height, mode, title, options, device, major, minor, flags)
        {
            CrowInterface = new Interface();

            Thread t = new Thread(interfaceThread);

            t.IsBackground = true;
            t.Start();
        }