Glteximage2d (m_texturetarget, 0, Gl_rgba, M_image.columns (), M_image.rows (), 0, Gl_rgba, Gl_unsigned_byte, M_blob.data ());
This is the code in the Ogldev, the author in the tutorial proposed to change the 3rd parameter to gl_red test, the results show that only the output of red.
I changed the 7th parameter to gl_red, and it turned out to be a complete change.
First, the last three parameters represent the format, type, and pointer of the source data passed in to the texture object, respectively.
Secondly, the author calls the Magick library when reading the texture, and magick::image the data in the format "RGBA" into the Magick::bolb, if the Bolb format is set here, So why do you need to write a second Gl_rgba in glteximage2d?
The author describes the Blob as a certain description:
The BLOB (Binary Large Object) is a useful mechanism for storing an encoded image in memory in a-the-it can be used B y external programs. (BLOB is an effective mechanism that can be called by an external program to store encoded images in memory) However, this is only a description of the function, without stating the substance. The answer to the mother's degree is as follows:
BLOB (Binary large object), binary large, is a container that can store binary files.
If the bolb is just a bunch of binary numbers, then it needs to specify the format and type when it is used as the data source for the image.
Finally, I understand that:
The 7th parameter describes the texture object to establish several color channels, such as: gl_red 1, Gl_rgb 3
The 3rd parameter describes the values of which channels the texture object passes to pipeline.
(There is no further verification, it is probably wrong, and then perfect it.) )