Login  Register

Re: Frame briefly opening and closing during Java3D init

Posted by philjord on Jul 14, 2016; 10:50am
URL: https://forum.jogamp.org/Frame-briefly-opening-and-closing-during-Java3D-init-tp4036912p4036913.html

runiter,
This code is before my time, but I've never seen a way to get the best graphic configuration with having the frame display, I think it's because most windowing system can't query the hardware capabilities without reserving actual screen real estate. Certainly plenty of c++ coded applications put up a tiny blank window before resizing to the desired resolution.

The only other option I can think of to use if you really want to get rid of the flashing square is
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gd = ge.getDefaultScreenDevice();
GraphicsConfiguration[] gcs =  gd.getConfigurations();

Then pick the configuration that matches what you want

But of course knowing what the user wants requires a pile of display selection dialog code etc.
Then you also want to ask full screen or not, pixel depth, AA, anisotropic, stereo, possibly stencil bits, z bits etc.

I've got some code that does some of teh screen resoltion detection and dialog options here:
https://bitbucket.org/philjord/3dtoolsdesktop/src/08001308ea04dbc5b995ddfd86124d8379889858/3DToolsDesktop/src/awt/tools3d/resolution/?at=master

But it's only about half way to what you'd need.