New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds GL_BGRA format #3867
Adds GL_BGRA format #3867
Conversation
+1 =) |
@@ -253,6 +255,8 @@ int ofGetGlTypeFromInternal(int glInternalFormat){ | |||
|
|||
case GL_STENCIL_INDEX: | |||
return GL_UNSIGNED_BYTE; | |||
case GL_BGRA: | |||
return GL_BGRA; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure that should say GL_BGRA
? i believe it should say GL_UNSIGNED_BYTE
, in which case you could add it above next to GL_RGB
etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. Fixed!
The internal format of a texture can't be Then you upload using |
this: 70ab62c should fix it, now you can do |
Ah, you're right! The trick was to allocate ofTexture as well: texture.allocate(w, h, GL_RGBA);
buffer.allocate(w, h, OF_PIXELS_BGRA); Don't know why, but explicitly allocating it as |
yes the autoallocate in loadData is kind of handy for very basic things but as soon as you want to do something slightly different is not very reliable. it passes the format as internal which in lots of cases is not correct. i added a TODO some days ago to fix it by adding a function that guesses the internal from the format |
Makes possible to draw Cairo or other BGRA swizzled images without calling super expensive
swapRgb
function.