Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added HDPI (retina) support to LWJGL backend. Use the LwjglApplicatio…
…nConfiguration.useHDPI switch
- Loading branch information
Showing
8 changed files
with
55 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
744aa85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey, i'm trying to use master branch after a long hiatus, but im getting a error in libgdx that might be related to this commit. Is there any chance i messed up or missing something?
Exception in thread "LWJGL Application" com.badlogic.gdx.utils.GdxRuntimeException: java.lang.NoSuchMethodError: org.lwjgl.opengl.Display.getPixelScaleFactor()F
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:121)
Caused by: java.lang.NoSuchMethodError: org.lwjgl.opengl.Display.getPixelScaleFactor()F
at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.getWidth(LwjglGraphics.java:91)
at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.setDisplayMode(LwjglGraphics.java:346)
at com.badlogic.gdx.backends.lwjgl.LwjglGraphics.setupDisplay(LwjglGraphics.java:139)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication.mainLoop(LwjglApplication.java:132)
at com.badlogic.gdx.backends.lwjgl.LwjglApplication$1.run(LwjglApplication.java:114)
744aa85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it's something related with this not being up to date (http://libgdx.badlogicgames.com/jglfw/nightlies/dist/) and me using a arcane build method. :)
744aa85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even the "old style builds" nightly from http://libgdx.badlogicgames.com/download.html is broken :(
744aa85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
744aa85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually the problem is that getPixelScaleFactor is only implemented on OS X as per http://wiki.lwjgl.org/index.php?title=Using_High_DPI_Mode
Im on windows, tried about everything even updated lwjgl manually only to find that out, so i think the build still broken on windows :)
Thats why GdxRuntimeException -> NoSuchMethodError
744aa85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
744aa85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
744aa85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well just tried a gradle sample, seems to be running just fine. So I'm at loss why my old project wont run without gradle.
744aa85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
744aa85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, replaced manually just to be sure and recompiled libgdx. I can even locate the Display.class from inside my project in gdx-backend-lwjgl.jar where I can see getPixelScaleFactor is defined. Natives updated too.
744aa85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
744aa85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only difference I can see is that in case of gradle there's both gdx-backend-lwjgl-1.5.2.jar without the lwjgl stuff and lwjgl-2.9.2.jar is included apart + natives.
On my project there's only gdx-backend-lwjgl.jar that includes everything (lwjgl stuff) the old way + natives.
My wild guess is that somehow the LwjglGraphics.getWidth cant find the org.lwjgl.opengl.Display.getPixelScaleFactor in the same package, but I have no clue why.
744aa85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
744aa85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
744aa85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, ill try to figure out :)
744aa85
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It turns out I had a deprecated long forgotten backend jogl that had a copy of lwjgl in the path that was causing problems. Now it works. :)