public RenderSession(GlContext ctx, IDisposable restoreContext, SizeSynchronizedLayerFbo fbo)
 {
     _ctx            = ctx;
     _restoreContext = restoreContext;
     _fbo            = fbo;
     Size            = new PixelSize(_fbo.Width, _fbo.Height);
     Scaling         = _fbo.Scaling;
     Context         = ctx;
 }
        public IGlPlatformSurfaceRenderTarget CreateGlRenderTarget()
        {
            CheckThread();
            var ctx = Platform.GlFeature.Context;

            using (ctx.MakeCurrent())
            {
                var fbo = new SizeSynchronizedLayerFbo(ctx.Context, ctx.GlInterface, _layer);
                if (!fbo.Sync())
                {
                    throw new InvalidOperationException("Unable to create render target");
                }
                return(new RenderTarget(ctx, fbo));
            }
        }
 public RenderTarget(GlContext ctx, SizeSynchronizedLayerFbo fbo)
 {
     _ctx = ctx;
     _fbo = fbo;
 }