Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report for Bug 51542 on
Developer Community or GitHub if you have new
information to add and do not yet see a matching new report.
If the latest results still closely match this report, you can use the
In special cases on GitHub you might also want the comments:
GitHub Markdown with public comments
In the OpenGL's glTexImage2D function, the pixel format can normally be GL_BGRA: https://developer.apple.com/reference/opengles/1617448-glteximage2d in the "format" parameter.
In Xamarin, it's mapped to an OpenTK.Graphics.ES20.PixelFormat enum, which does not define Bgra.
Is it possible to add this value, please?
Your link does not include any information about what Apple allows (or not) for the `format` parameter.
The usage of `GL_BGRA` seems to be valid for OpenGL but not for OpenGLES 2 (ES20) or even 3 (ES30) .
Sorry, I forgot to put the actual OpenGL documentation :(
However, I was indeed looking at the full OpenGL and not OpenGL ES, so you're right.
But... this works:
GL.TexImage2D(All.Texture2D, 0, (int)All.Rgba, width, height, 0, All.BgraExt, All.UnsignedByte, pixels);
Because Apple added an OpenGL ES extension for that:
And there is a discussion here:
So, it seems that the actual format that could be added is "BGRA_EXT". I couldn't find any other extra format.
Please note that it's only a "format" (7th parameter) and not an "internalFormat" (3rd parameter), otherwise it causes an error.
I hope this helps,
Can you clarify this part:
"So, it seems that the actual format that could be added is "BGRA_EXT". I couldn't find any other extra format."
I'm not sure what's you're suggesting / expecting.
There is `OpenTK.Graphics.ES20.All.BgraExt` right, so what would we be missing?
Yes, but it is not part of the OpenTK.Graphics.ES20.PixelFormat enumeration. So it cannot be used as an argument for the strongly typed version of OpenTK.Graphics.ES20.GL.TexImage2D. And the use of the weakly typed version is marked as obsolete.
Okay now I understand your request, sorry for the delay (;
Indeed we could likely spice up these PixelFormat enums especially since the overloads that are not using it are obsolete.
@radek any comment on this?