示例#1
0
        public IGlContext CreateContext(IGlContext share)
        {
            var shareCtx = (EglContext)share;
            var ctx      = _egl.CreateContext(_display, _config, shareCtx?.Context ?? IntPtr.Zero, _contextAttributes);

            if (ctx == IntPtr.Zero)
            {
                throw OpenGlException.GetFormattedException("eglCreateContext", _egl);
            }
            var surf = _egl.CreatePBufferSurface(_display, _config, new[]
            {
                EGL_WIDTH, 1,
                EGL_HEIGHT, 1,
                EGL_NONE
            });

            if (surf == IntPtr.Zero)
            {
                throw OpenGlException.GetFormattedException("eglCreatePBufferSurface", _egl);
            }
            var rv = new EglContext(this, _egl, ctx, surf);

            rv.MakeCurrent(null);
            return(rv);
        }
示例#2
0
        public EglContext CreateContext(IGlContext share)
        {
            if ((_surfaceType | EGL_PBUFFER_BIT) == 0)
            {
                throw new InvalidOperationException("Platform doesn't support PBUFFER surfaces");
            }
            var shareCtx = (EglContext)share;
            var ctx      = _egl.CreateContext(_display, _config, shareCtx?.Context ?? IntPtr.Zero, _contextAttributes);

            if (ctx == IntPtr.Zero)
            {
                throw OpenGlException.GetFormattedException("eglCreateContext", _egl);
            }
            var surf = _egl.CreatePBufferSurface(_display, _config, new[]
            {
                EGL_WIDTH, 1,
                EGL_HEIGHT, 1,
                EGL_NONE
            });

            if (surf == IntPtr.Zero)
            {
                throw OpenGlException.GetFormattedException("eglCreatePBufferSurface", _egl);
            }
            var rv = new EglContext(this, _egl, ctx, new EglSurface(this, _egl, surf));

            rv.MakeCurrent(null);
            return(rv);
        }
 public RenderTarget(EglDisplay display, EglContext context,
                     EglSurface glSurface, IEglWindowGlPlatformSurfaceInfo info)
 {
     _display     = display;
     _context     = context;
     _glSurface   = glSurface;
     _info        = info;
     _initialSize = info.Size;
 }
 public Session(EglDisplay display, EglContext context,
                EglSurface glSurface, IEglWindowGlPlatformSurfaceInfo info,
                IDisposable @lock)
 {
     _context   = context;
     _display   = display;
     _glSurface = glSurface;
     _info      = info;
     _lock      = @lock;
 }
示例#5
0
        public EglContext CreateContext(EglContext share, EglSurface offscreenSurface)
        {
            var ctx = _egl.CreateContext(_display, _config, share?.Context ?? IntPtr.Zero, _contextAttributes);

            if (ctx == IntPtr.Zero)
            {
                throw OpenGlException.GetFormattedException("eglCreateContext", _egl);
            }
            var rv = new EglContext(this, _egl, ctx, offscreenSurface);

            rv.MakeCurrent(null);
            return(rv);
        }
 public Session(EglDisplay display, EglContext context,
                EglSurface glSurface, EglGlPlatformSurfaceBase.IEglWindowGlPlatformSurfaceInfo info,
                IDisposable @lock, IDisposable restoreContext, Action onFinish, bool isYFlipped)
 {
     IsYFlipped      = isYFlipped;
     _context        = context;
     _display        = display;
     _glSurface      = glSurface;
     _info           = info;
     _lock           = @lock;
     _restoreContext = restoreContext;
     _onFinish       = onFinish;
 }
示例#7
0
 public RenderTarget(EglContext context, EglSurface glSurface, IEglWindowGlPlatformSurfaceInfo info)
 {
     _context   = context;
     _glSurface = glSurface;
     _info      = info;
 }
示例#8
0
 public EglGlPlatformSurface(EglDisplay display, EglContext context, IEglWindowGlPlatformSurfaceInfo info)
 {
     _display = display;
     _context = context;
     _info    = info;
 }
示例#9
0
 public EglGlPlatformSurface(EglContext context, IEglWindowGlPlatformSurfaceInfo info) : base()
 {
     _display = context.Display;
     _context = context;
     _info    = info;
 }
示例#10
0
 protected EglPlatformSurfaceRenderTargetBase(EglDisplay display, EglContext context)
 {
     _display = display;
     _context = context;
 }