Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="GlxContext" /> class.
 /// </summary>
 /// <param name="glx">The GLX.</param>
 /// <param name="handle">The handle.</param>
 /// <param name="display">The display.</param>
 /// <param name="x11">The X11.</param>
 /// <param name="defaultXid">The default xid.</param>
 public GlxContext(GlxInterface glx, IntPtr handle, GlxDisplay display, X11Info x11, IntPtr defaultXid)
 {
     Handle      = handle;
     Glx         = glx;
     _x11        = x11;
     _defaultXid = defaultXid;
     Display     = display;
 }
 /// <summary>
 /// Tries the create.
 /// </summary>
 /// <param name="x11">The X11.</param>
 /// <returns>GlxGlPlatformFeature.</returns>
 public static GlxGlPlatformFeature TryCreate(X11Info x11)
 {
     try
     {
         var disp = new GlxDisplay(x11);
         return(new GlxGlPlatformFeature
         {
             Display = disp,
             ImmediateContext = disp.ImmediateContext,
             DeferredContext = disp.DeferredContext
         });
     }
     catch (Exception e)
     {
         Logger.TryGet(LogEventLevel.Error)?.Log("OpenGL", null, "Unable to initialize GLX-based rendering: {0}", e);
         return(null);
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="GlxGlPlatformSurface" /> class.
 /// </summary>
 /// <param name="display">The display.</param>
 /// <param name="context">The context.</param>
 /// <param name="info">The information.</param>
 public GlxGlPlatformSurface(GlxDisplay display, GlxContext context, EglGlPlatformSurface.IEglWindowGlPlatformSurfaceInfo info)
 {
     _display = display;
     _context = context;
     _info    = info;
 }