I am using this SOIL function to load texture files in OpenGL. However i would like to access:
- Height and Width of the loaded image.
- Bpp (pixel value per bytes) of the image (8, 24 etc).
- The data pointer.
The given function does not return any of this characteristics. I would like some help on how to find these using this or any other similar SOIL function. This is the function i use.
GLuint loadSOIL(const char* imagePath) {
cout << "Reading image: " << imagePath << endl;
GLuint texture = 0;
//Load Image File Directly into an OpenGL Texture
texture = SOIL_load_OGL_texture
(
imagePath,
SOIL_LOAD_RGB,
SOIL_CREATE_NEW_ID,
SOIL_FLAG_TEXTURE_REPEATS
);
// error check
if (texture == 0) {
cout << "SOIL loading error: " << SOIL_last_result() << endl;
}
return texture;
}