Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: allow to re-do the sequence SDL_init / SDL_quit #7591

Open
1bsyl opened this issue Apr 8, 2023 · 2 comments
Open

Android: allow to re-do the sequence SDL_init / SDL_quit #7591

1bsyl opened this issue Apr 8, 2023 · 2 comments
Assignees
Milestone

Comments

@1bsyl
Copy link
Contributor

1bsyl commented Apr 8, 2023

It should be possible to re-do

SDL_init 
...
SDL_quit
SDL_init
...
SDL_quit
19:12:39.485  E  [SurfaceView[org.libsdl.app/org.libsdl.app.SDLActivity]#1(BLAST Consumer)1](id:4a6c00000001,api:1,p:19052,c:19052) connect: already connected (cur=1 req=1)
19:12:39.486  E  eglCreateWindowSurface: native_window_api_connect (win=0x704449f810) failed (0xffffffea) (already connected to another API?)
19:12:39.486  E  eglCreateWindowSurfaceTmpl:676 error 3003 (EGL_BAD_ALLOC)
19:12:39.486  I  pixel format wanted SDL_PIXELFORMAT_RGBA8888 (1), got SDL_PIXELFORMAT_RGBA8888 (1)
19:12:39.529  D  Compat change id reported: 171228096; UID 10437; state: ENABLED
19:12:39.605  V  onWindowFocusChanged(): false

Currently it fails to re-initiale GLES2, because
19:12:39.486 E eglCreateWindowSurface: native_window_api_connect (win=0x704449f810) failed (0xffffffea) (already connected to another API?)

surfaceView hasn't been destroyed, and is somehow still connected.

workaround is to minimize the window:

  • SDL_MinimizeWindow(w);
  • SDL_Delay(1000);
    SDL_DestroyWindow(w);

(see #7585 #7567 )

@1bsyl
Copy link
Contributor Author

1bsyl commented Apr 8, 2023

Commenting out:

src/video/android/SDL_androidvideo.c:
//     device->GL_UnloadLibrary = Android_GLES_UnloadLibrary;

seems to allow do multiple Init/Quit/Init...

@slouken
Copy link
Collaborator

slouken commented Oct 6, 2024

We are scoping work for the SDL 3.2.0 release, so please let us know if this is a showstopper for you.

@slouken slouken modified the milestones: 3.2.0, 3.x Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants