Login  Register

Re: Impossible to retrieve the current mode until GLWindow is visible

Posted by Sven Gothel on Dec 01, 2012; 9:01am
URL: https://forum.jogamp.org/Impossible-to-retrieve-the-current-mode-until-GLWindow-is-visible-tp4027351p4027352.html

On 12/01/2012 09:52 AM, gouessej [via jogamp] wrote:

> Hi
>
> When I call Screen.getCurrentScreenMode() on the screen used by the GLWindow
> before it becomes visible, I get that:
> Exception in thread "main" java.lang.InternalError:
> ScreenModeStatus.getScreenModeStatus(.x11_:0-1-s0) == null
>         at jogamp.newt.ScreenImpl.getScreenModeStatus(ScreenImpl.java:328)
>         at jogamp.newt.ScreenImpl.getCurrentScreenMode(ScreenImpl.java:340)
>         at
> com.jme3.system.jogl.JoglNewtDisplay.applySettings(JoglNewtDisplay.java:131)
>         at
> com.jme3.system.jogl.JoglNewtDisplay.createGLFrame(JoglNewtDisplay.java:64)
>         at
> com.jme3.system.jogl.JoglNewtDisplay.privateInit(JoglNewtDisplay.java:142)
>         at com.jme3.system.jogl.JoglNewtDisplay.create(JoglNewtDisplay.java:163)
>         at com.jme3.app.Application.start(Application.java:390)
>         at com.jme3.app.Application.start(Application.java:367)
>         at com.jme3.app.SimpleApplication.start(SimpleApplication.java:130)
>         at jme3test.input.TestCameraNode.main(TestCameraNode.java:63)
>
> Is it the expected behaviour?
Yes, since NEWT favors lazy native creation (like JOGL etc).
This allows one to have the Java objects floating around w/o an actual native counterpart (window, GL ctx, ..) until 1st use.

Here I have described how to use ScreenMode before window creation:
  <http://forum.jogamp.org/Centering-a-Newt-window-td4026458.html#a4026504>
It's also available in one of the *ScreenMode* unit tests.

~Sven




signature.asc (909 bytes) Download Attachment