I have tried setting the line size to 1 using glLineWidthf and also
glLineWidthx. Other attempts (see below) use glLineWidthx value of
0x10000 (1 in Android GL fixed point)
Some lines simply do not render, others blow up really big on larger
scales. It is clearly scaling the lines.
I put all the OGL code in one place (below) - Anyone know what I'm
doing wrong?
@Override
public void onDrawFrame(GL10 gl) {
gl.glClearColor(0,0,.2f, 1f);
gl.glDisable(GL10.GL_CULL_FACE);
gl.glShadeModel(GL10.GL_FLAT);
gl.glDisable(GL10.GL_DEPTH_TEST);
gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT);
gl.glMatrixMode(GL10.GL_PROJECTION);
gl.glLoadIdentity();
gl.glViewport(0, 0, MyApp._width, MyApp._height);
gl.glEnable(GL10.GL_BLEND);
gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
gl.glEnable(GL10.GL_LINE_SMOOTH);
gl.glDisableClientState(GL10.GL_COLOR_ARRAY);
_hgt2width = (float) MyApp._width / MyApp._height;
gl.glOrthof(-_hgt2width, _hgt2width, -1, 1, 0, 0);
gl.glScalef(1, _hgt2width, 1);
// gl.glEnable(GL10.GL_DITHER);
// gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT,
GL10.GL_FASTEST);
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
gl.glOrthof(-_hgt2width, _hgt2width, -1, 1, 0, 0);
float lscale = .002f*MyApp._curScale; // default _curScale = 2f
gl.glPushMatrix();
gl.glColor4f(1f, 1f, 0f, 1f);
gl.glTranslatef(.25f, .5f, 0f);
gl.glScalef( lscale, lscale, 1f);
gl.glVertexPointer(2, GL10.GL_FIXED, 0, _lineVertices);
gl.glLineWidthx(0x10000);
// gl.glDrawArrays(GL10.GL_LINE_STRIP, 0, numLines);
drawArrays(gl);
gl.glPopMatrix();
}
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en