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.