Updated GLES FullScreenWindowedTest to destroy/create Display on mode change.
This commit is contained in:
parent
758849ad4c
commit
4edf23428d
|
@ -101,7 +101,7 @@ abstract class DrawableGLES implements DrawableLWJGL {
|
|||
throw new LWJGLException("No EGLConfigs found for the specified PixelFormat.");
|
||||
|
||||
final EGLConfig eglConfig = pf.getBestMatch(configs);
|
||||
final EGLSurface eglSurface = eglDisplay.createWindowSurface(eglConfig, (int)window, null);
|
||||
final EGLSurface eglSurface = eglDisplay.createWindowSurface(eglConfig, window, null);
|
||||
pf.setSurfaceAttribs(eglSurface);
|
||||
|
||||
this.eglDisplay = eglDisplay;
|
||||
|
|
|
@ -172,7 +172,7 @@ public final class EGLDisplay extends PointerWrapperAbstract {
|
|||
*
|
||||
* @return the EGL surface
|
||||
*/
|
||||
public EGLSurface createWindowSurface(EGLConfig config, int window, IntBuffer attrib_list) throws LWJGLException {
|
||||
public EGLSurface createWindowSurface(EGLConfig config, long window, IntBuffer attrib_list) throws LWJGLException {
|
||||
checkInitialized();
|
||||
|
||||
if ( config.getDisplay() != this )
|
||||
|
|
|
@ -82,7 +82,6 @@ public class FullScreenWindowedTest {
|
|||
initialize();
|
||||
mainLoop();
|
||||
cleanup();
|
||||
Display.destroy();
|
||||
}
|
||||
|
||||
private void switchMode() throws LWJGLException {
|
||||
|
@ -99,18 +98,22 @@ public class FullScreenWindowedTest {
|
|||
try {
|
||||
//find displaymode
|
||||
switchMode();
|
||||
// start of in windowed mode
|
||||
Display.create(new PixelFormat());
|
||||
glInit();
|
||||
|
||||
quadPosition = new Vector2f(100f, 100f);
|
||||
quadVelocity = new Vector2f(1.0f, 1.0f);
|
||||
|
||||
renderer = new QuadRenderer();
|
||||
reinit();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void reinit() throws LWJGLException {
|
||||
Display.create(new PixelFormat());
|
||||
glInit();
|
||||
renderer = new QuadRenderer();
|
||||
}
|
||||
|
||||
/** Runs the main loop of the "test" */
|
||||
private void mainLoop() {
|
||||
while ( !Keyboard.isKeyDown(Keyboard.KEY_ESCAPE) && !Display.isCloseRequested() ) {
|
||||
|
@ -185,8 +188,7 @@ public class FullScreenWindowedTest {
|
|||
|
||||
switchMode();
|
||||
|
||||
glInit();
|
||||
renderer = new QuadRenderer();
|
||||
reinit();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -199,8 +201,7 @@ public class FullScreenWindowedTest {
|
|||
mode = new DisplayMode(800, 480);
|
||||
Display.setDisplayModeAndFullscreen(mode);
|
||||
|
||||
glInit();
|
||||
renderer = new QuadRenderer();
|
||||
reinit();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
@ -254,6 +255,8 @@ public class FullScreenWindowedTest {
|
|||
int_buffer.put(1, indices_buffer_id);
|
||||
|
||||
glDeleteBuffers(int_buffer);
|
||||
|
||||
Display.destroy();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue