I have a device with a resolution of 800x480. When I create a GLSurfaceView, I get an onSurfaceChanged call with 533x320 (apparently using 1.5 HDPI modifier) ββand the surface is scaled. Therefore, when I draw 1 pixel thickness, the line looks very bad, and I cannot achieve perfect pixel rendering.
I want to have a built-in resolution surface (800x480).
The view is created this way (for example, in the OpenGL NDK samples), in Activity 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 do not use any layouts, etc.
android android-ndk opengl-es scaling hdpi
Mark
source share