What do I need to do to bring back the console on the screen (and quitting OpenGL)?
My use case: If some error (exception) occurs, I want to shut down OpenGL and EGL and initialize the console again (consoleInit) and show the error message on the screen. I'm testing using the Suyu emulator on Linux.
I tried various variations of deinitializing EGL and initializing the console, and this is my code so far:
Code: Select all
// "error" occurred
// doing consoleInit(NULL) has no effect here
eglMakeCurrent(eglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
// doing consoleInit(NULL) has no effect here
eglDestroyContext(eglDisplay, eglContext);
// doing consoleInit(NULL) has no effect here
// the following line causes the Suyu emulator to crash in Vulkan mode with "VK_ERROR_INITIALIZATION_FAILED" error
// using OpenGL, it shows "QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined" warning, but keeps running
eglDestroySurface(eglDisplay, eglSurface);
// doing consoleInit(NULL) has some kind of effect, but it appears so switch between normal white and small green text every frame
// this does not seem to work as expected
// eglTerminate(eglDisplay);
consoleInit(NULL);
printf("the error message\n");
while (appletMainLoop()) {
consoleUpdate(NULL);
}