-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
bugSomething that is supposed to work, but doesn't. More severe than a "defect".Something that is supposed to work, but doesn't. More severe than a "defect".
Milestone
Description
If I start a JME application in windowed mode, I can switch to full-screen mode at any time, provided my settings match one of those supported by my graphic adapter.
However, if I start in full-screen mode, any attempt to switch to windowed mode crashes the application.
I see this issue with both JME 3.1.0-stable and JME 3.2.0-stable
Here is my test app:
package mygame;
import com.jme3.app.SimpleApplication;
import com.jme3.input.KeyInput;
import com.jme3.input.controls.ActionListener;
import com.jme3.input.controls.KeyTrigger;
public class Main extends SimpleApplication {
public static void main(String[] args) {
Main app = new Main();
app.start();
}
@Override
public void simpleInitApp() {
inputManager.addMapping("goWindowed", new KeyTrigger(KeyInput.KEY_P));
ActionListener listener = new ActionListener() {
@Override
public void onAction(String name, boolean keyPressed, float tpf) {
if (name.equals("goWindowed") && keyPressed) {
goWindowed();
}
}
};
inputManager.addListener(listener, "goWindowed");
}
void goWindowed() {
settings.setFullscreen(false);
setSettings(settings);
restart();
}
}
Here is typical output:
Jan 11, 2018 2:14:48 PM com.jme3.system.JmeDesktopSystem initialize
INFO: Running on jMonkeyEngine 3.1-stable
* Branch: HEAD
* Git Hash: af04bf9
* Build Date: 2017-02-13
Jan 11, 2018 2:14:49 PM com.jme3.system.lwjgl.LwjglContext printContextInitInfo
INFO: LWJGL 2.9.3 context running on thread jME3 Main
* Graphics Adapter: nvd3dumx,nvwgf2umx,nvwgf2umx
* Driver Version: 21.21.13.7633
* Scaling Factor: 1
Jan 11, 2018 2:14:50 PM com.jme3.renderer.opengl.GLRenderer loadCapabilitiesCommon
INFO: OpenGL Renderer Information
* Vendor: NVIDIA Corporation
* Renderer: GeForce GT 545/PCIe/SSE2
* OpenGL Version: 4.5.0 NVIDIA 376.33
* GLSL Version: 4.50 NVIDIA
* Profile: Compatibility
Jan 11, 2018 2:14:50 PM com.jme3.audio.openal.ALAudioRenderer initOpenAL
INFO: Audio Renderer Information
* Device: OpenAL Soft
* Vendor: OpenAL Community
* Renderer: OpenAL Soft
* Version: 1.1 ALSOFT 1.15.1
* Supported channels: 64
* ALC extensions: ALC_ENUMERATE_ALL_EXT ALC_ENUMERATION_EXT ALC_EXT_CAPTURE ALC_EXT_DEDICATED ALC_EXT_disconnect ALC_EXT_EFX ALC_EXT_thread_local_context ALC_SOFT_loopback
* AL extensions: AL_EXT_ALAW AL_EXT_DOUBLE AL_EXT_EXPONENT_DISTANCE AL_EXT_FLOAT32 AL_EXT_IMA4 AL_EXT_LINEAR_DISTANCE AL_EXT_MCFORMATS AL_EXT_MULAW AL_EXT_MULAW_MCFORMATS AL_EXT_OFFSET AL_EXT_source_distance_model AL_LOKI_quadriphonic AL_SOFT_buffer_samples AL_SOFT_buffer_sub_data AL_SOFTX_deferred_updates AL_SOFT_direct_channels AL_SOFT_loop_points AL_SOFT_source_latency
Jan 11, 2018 2:14:50 PM com.jme3.audio.openal.ALAudioRenderer initOpenAL
WARNING: Pausing audio device not supported.
Jan 11, 2018 2:14:50 PM com.jme3.audio.openal.ALAudioRenderer initOpenAL
INFO: Audio effect extension version: 1.0
Jan 11, 2018 2:14:50 PM com.jme3.audio.openal.ALAudioRenderer initOpenAL
INFO: Audio max auxiliary sends: 4
Jan 11, 2018 2:14:53 PM com.jme3.system.lwjgl.LwjglDisplay runLoop
SEVERE: Failed to set display settings!
org.lwjgl.LWJGLException: Could not make context current
at org.lwjgl.opengl.WindowsContextImplementation.nMakeCurrent(Native Method)
at org.lwjgl.opengl.WindowsContextImplementation.makeCurrent(WindowsContextImplementation.java:94)
at org.lwjgl.opengl.ContextGL.makeCurrent(ContextGL.java:194)
at org.lwjgl.opengl.DrawableGL.makeCurrent(DrawableGL.java:110)
at org.lwjgl.opengl.Display.makeCurrent(Display.java:706)
at org.lwjgl.opengl.Display.makeCurrentAndSetSwapInterval(Display.java:1025)
at org.lwjgl.opengl.Display.setDisplayModeAndFullscreenInternal(Display.java:512)
at org.lwjgl.opengl.Display.setFullscreen(Display.java:475)
at com.jme3.system.lwjgl.LwjglDisplay.createContext(LwjglDisplay.java:119)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:180)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:232)
at java.lang.Thread.run(Thread.java:745)
Jan 11, 2018 2:14:53 PM com.jme3.app.LegacyApplication handleError
SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
java.lang.IllegalStateException: Keyboard must be created before you can poll the device
at org.lwjgl.input.Keyboard.poll(Keyboard.java:386)
at com.jme3.input.lwjgl.LwjglKeyInput.update(LwjglKeyInput.java:79)
at com.jme3.input.InputManager.update(InputManager.java:896)
at com.jme3.app.LegacyApplication.update(LegacyApplication.java:725)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:227)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:193)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:232)
at java.lang.Thread.run(Thread.java:745)
AL lib: (EE) alc_cleanup: 1 device not closed
Exception: java.lang.RuntimeException thrown from the UncaughtExceptionHandler in thread "jME3 Main"
Metadata
Metadata
Assignees
Labels
bugSomething that is supposed to work, but doesn't. More severe than a "defect".Something that is supposed to work, but doesn't. More severe than a "defect".