I have a device with 800x480 res. When I create GLSurfaceView, I get an onSurfaceChanged
call with 533x320 (apparently with 1.5 HDPI modifier applied) and surface is upscaled. So when I draw 1 pixel thick line is looks really bad, and I can't have pixel-perfect rendering.
What I want to have is native resolution surface (800x480).
View is created in this manner (like in NDK OpenGL samples), in Activity's onCreate
:
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON |
WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD |
WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED |
WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON);
view = new MyGLSurfaceView(this);
setContentView(view);
I don't use any layouts etc.
I found the solution: when I add
<uses-sdk android:targetSdkVersion="8" android:minSdkVersion="8"/>
to AndroidManifest.xml, I get proper resolution.To be honest, Android is very strange platform for me after few years with iOS...
Solution found here: MonoDroid apps don't use correct density drawables
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With