Skip to content

Commit

Permalink
Define GlFormatChannels for GL_BGR and GL_BGRA
Browse files Browse the repository at this point in the history
  • Loading branch information
caselitz authored and stevenlovegrove committed Oct 4, 2019
1 parent 8491d9f commit d33757d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion include/pangolin/gl/gl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ inline size_t GlDataTypeBytes(GLenum type)

inline size_t GlFormatChannels(GLenum data_layout)
{
return format_channels[data_layout - GL_RED];
if (data_layout == GL_BGR) return 3;
if (data_layout == GL_BGRA) return 4;
return format_channels[data_layout - GL_RED];
}

//template<typename T>
Expand Down

0 comments on commit d33757d

Please sign in to comment.