I use openGL´s SOIL to load images and SOIL_load_image() returns an unsigned char*, which is then used by openGL to color all the width*height pixels.
I would like to be able to pass my own unsigned char* to represent one single color. How do I represent color in a string/char*?
This is what I am thinking about:
GLuint createTextureID(std::string texturePath) {
int width, height;
GLuint texID = 0;
unsigned char* texData = nullptr;
//currently, all my file paths begin with "..//"
if (texturePath.at(0) != '.')
{
texData = texturePath.c_str();
width = 1;
height = 1;
}
else
{
texData = SOIL_load_image(texturePath.c_str(), &width, &height, 0, SOIL_LOAD_RGBA);
}
//UPLOAD texData TO OPENGL
}