0

I'm trying to follow this tutorial on OpenGL but instead of loading a raw image I'm using lodePNG.

The problem is that when I cann the function glTexImage2D I get an error on the last argument that it only takes a GLvoid* variable. LodePNG only outputs std::vector as the final image data. I cannot find any other resources on the matter.

How would I go about getting this function to work? The error just simply states it doesn't take this data type.

user82779
  • 65
  • 1
  • 3
  • 9

1 Answers1

6

vector::data() is your friend.

You will have to pass the raw data from the vector to the glTexImage function.

vector<...> image;
glTexImage2d(..., image.data());
Stian Svedenborg
  • 1,797
  • 11
  • 27