Practical sessions
There are some additions you could make to the code:
- Add log lines with the
Logger
class to all the methods we implemented. This will help a lot if you need to debug problems, as you can also output values used in the methods. - Read the failure logs during shader compilation and linking. This is a bit tricky because you need to get the length of the log first, allocate a dynamic buffer (that is, by using
std::vector
), and get the log contents into this buffer. You will get a detailed error log and see the faulty line and operation or data type. - Add support for different file formats in the
Texture
class. Right now, there’s only support for PNGs in the RGBA component order. Try to also add other formats, such as JPG, or even more exotic variants such as ARGB or the reversed BGRA.