HiDPI/Retina support documentation/best practices anyone?

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

HiDPI/Retina support documentation/best practices anyone?

nyholku
Just moving to Java 8 and noticed my javax.media.opengl.awt.GLJPanel displays its contents in 1/4 corner of the panel. Right, obviously this is because Java 8 support HiDPI and I set my glViewport based on the Swing component size which is now half of the true pixel size on MacBook Pro Retina.

Now the question.

All the HiDPI related APIs (how to get the pixel size factor or what ever it is I need to apply) must be documented somewhere…

I'm surely not the only one who needs to do this so somewhere it is documented or outlined what needs to be changed when  moving to HiDPI with JOGL …

Probably there are different approaches with pro's and con's and so some is bound to have thought this out and written sort of best practice instructions …

But 30 minutes of googling and I'm no closer to finding that info … so please feel free to educate me.

(Probably something obvious but I escapes me…)

cheers Kusti
Reply | Threaded
Open this post in threaded view
|

Re: HiDPI/Retina support documentation/best practices anyone?

gouessej
Administrator
Reply | Threaded
Open this post in threaded view
|

Re: HiDPI/Retina support documentation/best practices anyone?

Sven Gothel
Administrator
Reply | Threaded
Open this post in threaded view
|

Re: HiDPI/Retina support documentation/best practices anyone?

nyholku
In reply to this post by gouessej
No had not found that, thanks.

Now I've tried this but it seems to do nothing.

Basically I know what I need to do but I don't know how I find if I need to do it i.e. if the display in question is HiDPI or not.

Must keep digging then I guess...
Reply | Threaded
Open this post in threaded view
|

Re: HiDPI/Retina support documentation/best practices anyone?

nyholku
In reply to this post by Sven Gothel
Ah thanks Sven, getSurfaceWidth/Height looks like the ticket!

Yep, the explanation matches my thinking and seems to work.

Thank you very much.
Reply | Threaded
Open this post in threaded view
|

Re: HiDPI/Retina support documentation/best practices anyone?

nyholku
In reply to this post by Sven Gothel
Ah thanks Sven, getSurfaceWidth/Height looks like the ticket!

Yep, the explanation matches my thinking and seems to work.

Thank you very much.
Reply | Threaded
Open this post in threaded view
|

Re: HiDPI/Retina support documentation/best practices anyone?

Sven Gothel
Administrator
In reply to this post by gouessej
On 11/12/2014 04:57 PM, Sven Gothel wrote:
> On 11/12/2014 04:48 PM, gouessej [via jogamp] wrote:
>> Hi
>>
>> Have you tried to use this method?
>> http://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/javax/media/opengl/awt/GLJPanel.html#setSurfaceScale(int[])
>> <http://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/javax/media/opengl/awt/GLJPanel.html#setSurfaceScale%28int[]%29>

We have a minor issue, see Bug 1102:
  <https://jogamp.org/bugzilla/show_bug.cgi?id=1102>
which will be fixed in next release.

Working demos:

- Try pressing 'x'
- Use commandline argument: '-pixelScale <scale>'

  AWT GLJPanel
    com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelAWT

  AWT GLCanvas
    com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT

  NEWT GLWindow
    com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT

  NEWT/AWT
    com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT

~Sven


signature.asc (828 bytes) Download Attachment