Skip to content

Commit

Permalink
Initialize EGL in GraphicsAdapter (#1584)
Browse files Browse the repository at this point in the history
  • Loading branch information
nkast authored May 20, 2024
1 parent 2fc34f6 commit 8841555
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions MonoGame.Framework/Platform/Cardboard/AndroidSurfaceView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,6 @@ void ProcessStateResumed()
// do not run game if surface is not available
if (_isAndroidSurfaceAvailable)
{
if (OGL_DROID.Current == null)
OGL_DROID.Initialize();

var adapter = ((IPlatformGraphicsAdapter)GraphicsAdapter.DefaultAdapter).Strategy.ToConcrete<ConcreteGraphicsAdapter>();
var GL = adapter.Ogl;

Expand Down Expand Up @@ -310,7 +307,7 @@ protected void CreateGLSurface()
var GL = adapter.Ogl;

/* Cardboard: Surface was created by GLSurfaceView.
_eglSurface = GL.Egl.EglCreateWindowSurface(_eglDisplay, _eglConfig, (Java.Lang.Object)this.Holder, null);
_eglSurface = GL.Egl.EglCreateWindowSurface(adapter.EglDisplay, _eglConfig, (Java.Lang.Object)this.Holder, null);
if (_eglSurface == EGL10.EglNoSurface)
_eglSurface = null;
if (_eglSurface == null)
Expand All @@ -332,7 +329,7 @@ private void MakeCurrentGLContext()
var GL = adapter.Ogl;

/* Cardboard: Surface was created by GLSurfaceView.
if (!GL.Egl.EglMakeCurrent(_eglDisplay, _eglSurface, _eglSurface, _eglContext))
if (!GL.Egl.EglMakeCurrent(adapter.EglDisplay, _eglSurface, _eglSurface, _eglContext))
throw new Exception("Could not make EGL current" + GL.GetEglErrorAsString());
*/
}
Expand Down

0 comments on commit 8841555

Please sign in to comment.