Ejemplo n.º 1
0
        public GlPlatformFeature(IAvnGlDisplay display)
        {
            _display = display;
            var immediate = display.CreateContext(null);
            var deferred  = display.CreateContext(immediate);


            int         major, minor;
            GlInterface glInterface;

            using (immediate.MakeCurrent())
            {
                var basic = new GlBasicInfoInterface(display.GetProcAddress);
                basic.GetIntegerv(GlConsts.GL_MAJOR_VERSION, out major);
                basic.GetIntegerv(GlConsts.GL_MINOR_VERSION, out minor);
                _version    = new GlVersion(GlProfileType.OpenGL, major, minor);
                glInterface = new GlInterface(_version, (name) =>
                {
                    var rv = _display.GetProcAddress(name);
                    return(rv);
                });
            }

            GlDisplay = new GlDisplay(display, glInterface, immediate.SampleCount, immediate.StencilSize);

            ImmediateContext = new GlContext(GlDisplay, immediate, _version);
            DeferredContext  = new GlContext(GlDisplay, deferred, _version);
        }
Ejemplo n.º 2
0
        public GlPlatformFeature(IAvnGlDisplay display)
        {
            var immediate = display.CreateContext(null);
            var deferred  = display.CreateContext(immediate);

            GlDisplay = new GlDisplay(display, immediate.SampleCount, immediate.StencilSize);

            ImmediateContext = new GlContext(Display, immediate);
            DeferredContext  = new GlContext(Display, deferred);
        }
 public IGlContext CreateSharedContext() => new GlContext(GlDisplay,
                                                          MainContext, _display.CreateContext(MainContext.Context), _version);
Ejemplo n.º 4
0
 public IGlContext CreateContext() => new GlContext(GlDisplay,
                                                    _display.CreateContext(((GlContext)ImmediateContext).Context), _version);