我有一个问题,让我的纹理透明。我是OpentTK的新手所以请有人帮助我。我正在使用ES11。这是我加载纹理的代码。
GL.BindTexture (All.Texture2D, tex_id);
GL.TexParameterx (All.Texture2D, All.TextureMagFilter, (int)All.Linear);
GL.TexParameterx (All.Texture2D, All.TextureMinFilter, (int)All.Linear);
GL.TexParameterx (All.Texture2D, All.TextureWrapS, (int)All.ClampToEdge);
GL.TexParameterx (All.Texture2D, All.TextureWrapT, (int)All.ClampToEdge);
Bitmap text = Bitmap.CreateBitmap(400, 200, Bitmap.Config.Argb8888);
Canvas canvas = new Canvas(text);
Paint p = new Paint {
AntiAlias = true,
Color = Color.Rgb(0x55, 0x55, 0xff)
};
p.SetXfermode (new PorterDuffXfermode (PorterDuff.Mode.Src));
p.TextSize = 60;
p.TextAlign = Paint.Align.Center;
Paint.FontMetrics fm = p.GetFontMetrics ();
canvas.DrawText ( string1, 200, 60, p);
canvas.DrawText ( string2, 200, 130, p);
Android.Opengl.GLUtils.TexImage2D ((int)All.Texture2D, 0, text, 0);