I am converting an engine from OpenGL 1.1 to OpenGL 3.2. The following throws a GL_INVALID_ENUM, but I cannot figure out why.
I am calling glGetError() prior to glTexImage2D() to clear it. When I am done, glGetError() is returning GL_INVALID_ENUM.
glActiveTexture( GL_TEXTURE0 );
glTexImage2D( GL_PROXY_TEXTURE_2D, // target
0, // level
4, // internalformat
32, 32, // width & height
0, // border
GL_RGBA, // format
GL_UNSIGNED_BYTE, // type
NULL ); // pixels
Pass in a real internalFormat. I think the pure channel count method was deprecated at some point.
Your internal format, "4", doesn't seem to be a valid format. For example, GL_RGBA is defined as 0x1908.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With