Пример #1
0
 public static EglGlPlatformFeature TryCreate()
 {
     try
     {
         var disp = new EglDisplay();
         var ctx  = disp.CreateContext(null);
         return(new EglGlPlatformFeature
         {
             Display = disp,
             ImmediateContext = ctx,
             DeferredContext = (EglContext)disp.CreateContext(ctx)
         });
     }
     catch (Exception e)
     {
         Logger.TryGet(LogEventLevel.Error)?.Log("OpenGL", null, "Unable to initialize EGL-based rendering: {0}", e);
         return(null);
     }
 }
Пример #2
0
 public IGlContext CreateContext()
 {
     return(_display.CreateContext(DeferredContext));
 }