コード例 #1
0
 public GlDisplay(IAvnGlDisplay display, GlInterface glInterface, int sampleCount, int stencilSize)
 {
     _display    = display;
     SampleCount = sampleCount;
     StencilSize = stencilSize;
     GlInterface = glInterface;
 }
コード例 #2
0
ファイル: GlPlatformFeature.cs プロジェクト: yahiheb/Avalonia
        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);
        }
コード例 #3
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);
        }
コード例 #4
0
 public GlDisplay(IAvnGlDisplay display)
 {
     _display    = display;
     GlInterface = new GlInterface((name, optional) =>
     {
         var rv = _display.GetProcAddress(name);
         if (rv == IntPtr.Zero && !optional)
         {
             throw new OpenGlException($"{name} not found in system OpenGL");
         }
         return(rv);
     });
 }
コード例 #5
0
 public GlDisplay(IAvnGlDisplay display, int sampleCount, int stencilSize)
 {
     _display    = display;
     SampleCount = sampleCount;
     StencilSize = stencilSize;
     GlInterface = new GlInterface((name, optional) =>
     {
         var rv = _display.GetProcAddress(name);
         if (rv == IntPtr.Zero && !optional)
         {
             throw new OpenGlException($"{name} not found in system OpenGL");
         }
         return(rv);
     });
 }