public static GLTexture2D FromBitmap(Bitmap image) { GLTexture2D texture = new GLTexture2D(); texture.Target = TextureTarget.Texture2D; texture.Width = image.Width; texture.Height = image.Height; texture.LoadImage(image); return(texture); }
public static GLTexture2D FromBitmap(byte[] imageFile) { Bitmap image = (Bitmap)Bitmap.FromStream(new System.IO.MemoryStream(imageFile)); GLTexture2D texture = new GLTexture2D(); texture.Target = TextureTarget.Texture2D; texture.Width = image.Width; texture.Height = image.Height; texture.LoadImage(image); return(texture); }
public static GLTexture2D FromGeneric(STGenericTexture texture, ImageParameters parameters = null) { if (parameters == null) { parameters = new ImageParameters(); } GLTexture2D glTexture = new GLTexture2D(); glTexture.Target = TextureTarget.Texture2D; glTexture.Width = (int)texture.Width; glTexture.Height = (int)texture.Height; glTexture.LoadImage(texture, parameters); return(glTexture); }