Texture can be applied on triangle in the fragment shader processing.

<aside> 🧠 OpenGL is optimized to better handle images that have size of power of 2 such as 512 * 512 or 4096 * 4096

</aside>

Stbi

In order to load the images, the library stbi can be really useful.

https://github.com/nothings/stb

//OpenGL is reading in the oposite direction verticaly. So, we swap here
stbi_set_flip_vertically_on_load(true);

unsigned char* img = stbi_load(path, widht, height, color_channels, 0);
// The zero designated the desired number of color channels
// widht height and color channels are int pointersss
stbi_image_free(img);