What I would like to do is within the same instance of the program fully initialize and delete an SDL+GLES instance twice within the run time of the same program. I have adapted the code base posted above to simply call the contents of main() twice with a slight pause in between. However on the second run SDL_CreateWindow() returns NULL. The error code returned is as follows: "Could not initialize OpenGL / GLES library".
I believe this is probably something to do with the way I am cleaning up SDL. Perhaps I am not cleaning it up properly. Here is the code I use to clean up SDL+Opengles (taken directly from the code base listed above):
Code: Select all
nk_sdl_shutdown();
SDL_GL_DeleteContext(glContext);
SDL_DestroyWindow(win);
SDL_Quit();