LWJGL
May 18, 2013, 10:57:40 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: LWJGL 2.9.0 released!
 
   Home   Help Search Login Register  



Pages: [1]
  Print  
Author Topic: [BUG] OpenGL ES 2 fullscreen -> windowed = Failed EGL error: Bad EGL context  (Read 1401 times)
xranby
Newbie
*
Posts: 12


« on: October 13, 2011, 16:35:22 »

testcase: Run the FullScreenWindowedTest and then press w trigger the bug.

java -cp libs/lwjgles_test.jar:libs/lwjgles.jar:libs/lwjgl_util.jar -Djava.library.path=bin/lwjgles org.lwjgl.test.opengles.FullScreenWindowedTest
Change between fullscreen and windowed mode, by pressing F and W respectively
Move quad using arrowkeys, and change rotation using +/-
org.lwjgl.LWJGLException: Failed to change the current context. EGL error: Bad EGL context
   at org.lwjgl.opengles.EGL.throwEGLError(EGL.java:919)
   at org.lwjgl.opengles.EGL.eglMakeCurrent(EGL.java:677)
   at org.lwjgl.opengles.EGLContext.makeCurrent(EGLContext.java:104)
   at org.lwjgl.opengles.EGLContext.makeCurrent(EGLContext.java:100)
   at org.lwjgl.opengl.ContextGLES.makeCurrent(ContextGLES.java:145)
   at org.lwjgl.opengl.DrawableGLES.makeCurrent(DrawableGLES.java:190)
   at org.lwjgl.opengl.Display.makeCurrent(Display.java:731)
   at org.lwjgl.opengl.Display.makeCurrentAndSetSwapInterval(Display.java:1050)
   at org.lwjgl.opengl.Display.setDisplayModeAndFullscreenInternal(Display.java:538)
   at org.lwjgl.opengl.Display.setDisplayModeAndFullscreen(Display.java:516)
   at org.lwjgl.test.opengles.FullScreenWindowedTest.processKeyboard(FullScreenWindowedTest.java:200)
   at org.lwjgl.test.opengles.FullScreenWindowedTest.mainLoop(FullScreenWindowedTest.java:119)
   at org.lwjgl.test.opengles.FullScreenWindowedTest.execute(FullScreenWindowedTest.java:83)
   at org.lwjgl.test.opengles.FullScreenWindowedTest.main(FullScreenWindowedTest.java:324)
Exception in thread "main" java.lang.IllegalStateException: Keyboard must be created before you can query key state
   at org.lwjgl.input.Keyboard.isKeyDown(Keyboard.java:398)
   at org.lwjgl.test.opengles.FullScreenWindowedTest.processKeyboard(FullScreenWindowedTest.java:209)
   at org.lwjgl.test.opengles.FullScreenWindowedTest.mainLoop(FullScreenWindowedTest.java:119)
   at org.lwjgl.test.opengles.FullScreenWindowedTest.execute(FullScreenWindowedTest.java:83)
   at org.lwjgl.test.opengles.FullScreenWindowedTest.main(FullScreenWindowedTest.java:324)
xranby@trimslice:/media/go_/LWJGL-svn$
Logged
spasi
Nerdus Imperius
*****
Posts: 752



WWW
« Reply #1 on: October 14, 2011, 03:54:32 »

Switching between fullscreen and windowed mode is one thing that LWJGL doesn't handle properly for EGL. The problem is that LWJGL currently destroys and recreates the window when we switch display modes, which is a no-go for EGL. EGL contexts depend on EGL displays and EGL displays depend on the native window, so if the window is destroyed, everything is destroyed.

I have updated the FullScreenWindowedTest to destroy and recreate the Display on mode change. That means GL objects need to be recreated, which isn't a bad compromise, since users already need to be ready for EGL_CONTEXT_LOST events.

A proper fix for this needs to wait for LWJGL 3.0. We need to implement display mode switching without window destruction. We have window resizing now, so I guess we only need a cross-platform call to update window decorations.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
SMFAds for Free Forums
Valid XHTML 1.0! Valid CSS!