I want draw Text on OpenGL.
I try use Bitmap,Canvas,Paint.
public void GLText(GL10 gl) {
Bitmap bitmap = Bitmap.createBitmap(256, 256, Bitmap.Config.ARGB_4444);
Canvas canvas = new Canvas(bitmap);
bitmap.eraseColor(0);
Paint paint = new Paint();
paint.setTextSize(18);
paint.setAntiAlias(true);
paint.setARGB(0xff, 255, 0, 255);
paint.setTextAlign(Paint.Align.LEFT);
paint.setTextScaleX(0.5f);
canvas.drawColor(Color.BLUE);
canvas.drawText("testGLText", 10.f, 15.f, paint);
GLUtils.texImage2D(GL10.GL_TEXTURE_2D, 0, bitmap, 0);
}
and onDrawFrame
has call GLText
and I build my source
this source draw Text work.
but background color green.
I want only draw text. how to draw text on OpenGL?