Microsoft.Xna.Framework.Graphics.ESTexture2D.InitWithBitmapGL20 C# (CSharp) Метод

InitWithBitmapGL20() публичный Метод

public InitWithBitmapGL20 ( Bitmap imageSource, OpenTK.Graphics.ES20 filter ) : void
imageSource System.Drawing.Bitmap
filter OpenTK.Graphics.ES20
Результат void
        public void InitWithBitmapGL20(Bitmap imageSource, GL20.All filter)
        {
            //TODO:  Android.Opengl.GLUtils.GetInternalFormat()
            //Android.Opengl.GLUtils.GetInternalFormat(imageSource);
            openGLVersion = GLContextVersion.Gles2_0;

            _format = SurfaceFormat.Color;
            if (imageSource.HasAlpha)
                _format = SurfaceFormat.Color;

            _width = imageSource.Width;
            _height = imageSource.Height;

            _size.Width = imageSource.Width;
            _size.Height = imageSource.Height;

            GL20.GL.GenTextures(1, ref _name);
            GL20.GL.BindTexture(GL20.All.Texture2D, _name);

            GL20.GL.TexParameter( GL20.All.Texture2D, GL20.All.TextureMinFilter, (int)filter);
            GL20.GL.TexParameter( GL20.All.Texture2D, GL20.All.TextureMagFilter, (int)filter);
            GL20.GL.TexParameter( GL20.All.Texture2D, GL20.All.TextureWrapS, (int)GL20.All.ClampToEdge);
            GL20.GL.TexParameter( GL20.All.Texture2D, GL20.All.TextureWrapT, (int)GL20.All.ClampToEdge);

            Android.Opengl.GLUtils.TexImage2D((int)GL20.All.Texture2D, 0, imageSource, 0);
            imageSource.Recycle();

            //int errAndroidGL = Android.Opengl.GLES20.GlGetError();
            //GL20.All errGenericGL = GL20.GL.GetError();
            //if(errAndroidGL != Android.Opengl.GLES20.GlNoError || errGenericGL != GL20.All.NoError )
            //    Console.WriteLine(string.Format("OpenGL-ES 2.0:\n\tAndroid:{0,10:X}\n\tGeneric:{0, 10:X}", errAndroidGL, errGenericGL));

            _maxS = _size.Width / (float)_width;
            _maxT = _size.Height / (float)_height;
        }