I was trying to figure out how to use the image library in vlib, in which there was a variable C
:
pub fn (img Image) tex_image_2d() {
mut rgb_flag := GL_RGB
if img.ext == 'png' {
rgb_flag = GL_RGBA
}
C.glTexImage2D(GL_TEXTURE_2D, 0, rgb_flag, img.width,
img.height, 0, rgb_flag, GL_UNSIGNED_BYTE, img.data)
}
On the 6th line the function calls a method that belongs to the variable C
. What kind of object is C
, and where could I find the source code for it?
Thanks in advance!
It's a C function call from imported #include "stb_image.h"
See the code here for example