Login  Register

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

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

On 12/01/2012 10:22 AM, gouessej [via jogamp] wrote:

>     Sven Gothel wrote
>     Here I have described how to use ScreenMode before window creation:
>      
>     <http://forum.jogamp.org/Centering-a-Newt-window-td4026458.html#a4026504>
>     <http://forum.jogamp.org/Centering-a-Newt-window-td4026458.html#a4026504%3E>
>     It's also available in one of the *ScreenMode* unit tests.
>
> Ok but can I just call GLWindow.getScreen().addReference() before
> GLWindow.setVisible(true) to achieve that in my case? Is it the right way of
> using a Screen instance?
As long you remove the reference afterwards (at best after window visibility
to avoid a redundant lifecycle) your lifecycle would be complete.

Otherwise the Screen and it's Display would be kept open .. I guess I have
described it in this thread - and it's visible in the unit tests.

In the end - your choice ofc.

~Sven




signature.asc (909 bytes) Download Attachment