Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[android] Make the correct GL context current
Browse files Browse the repository at this point in the history
  • Loading branch information
tmpsantos authored and jfirebaugh committed Apr 14, 2016
1 parent f696ecd commit 083739f
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions platform/android/src/native_map_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,6 @@ void NativeMapView::createSurface(ANativeWindow *window_) {
if (!firstTime) {
firstTime = true;

EGLDisplay oldDisplay = eglGetCurrentDisplay();
EGLSurface oldReadSurface = eglGetCurrentSurface(EGL_READ);
EGLSurface oldDrawSurface = eglGetCurrentSurface(EGL_DRAW);
EGLContext oldContext = eglGetCurrentContext();

if (!eglMakeCurrent(display, surface, surface, context)) {
mbgl::Log::Error(mbgl::Event::OpenGL, "eglMakeCurrent() returned error %d",
eglGetError());
Expand All @@ -391,21 +386,6 @@ void NativeMapView::createSurface(ANativeWindow *window_) {
mbgl::gl::InitializeExtensions([] (const char * name) {
return reinterpret_cast<mbgl::gl::glProc>(eglGetProcAddress(name));
});

if (oldDisplay == EGL_NO_DISPLAY) {
oldDisplay = display;
}

if (!eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)) {
mbgl::Log::Error(mbgl::Event::OpenGL,"eglMakeCurrent(EGL_NO_CONTEXT) returned error %d", eglGetError());
throw std::runtime_error("eglMakeCurrent() failed");
}

if (!eglMakeCurrent(oldDisplay, oldDrawSurface, oldReadSurface, oldContext)) {
mbgl::Log::Error(mbgl::Event::OpenGL,
"eglMakeCurrent(EGL_NO_CONTEXT) returned error %d", eglGetError());
throw std::runtime_error("eglMakeCurrent() failed");
}
}
}

Expand Down

0 comments on commit 083739f

Please sign in to comment.