Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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 |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
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[])
Julien Gouesse | Personal blog | Website
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
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> > .. and have a look at the related getter methods, i.e. the whole interface: <http://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/javax/media/nativewindow/ScalableSurface.html> as well as the differentiation of: getSurface[Width|Height]() get[Width|Height]() <http://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/javax/media/opengl/GLDrawable.html#getSurfaceWidth%28%29> <http://jogamp.org/deployment/jogamp-next/javadoc/jogl/javadoc/javax/media/nativewindow/NativeSurface.html#getSurfaceWidth%28%29> |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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... |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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 |
Free forum by Nabble | Edit this page |