Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OpenGL 3.2 GL_INVALID_ENUM on glTexImage2D( GL_PROXY_TEXTURE_2D ... )

Tags:

opengl

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
like image 388
Michael Labbé Avatar asked Feb 03 '26 08:02

Michael Labbé


2 Answers

Pass in a real internalFormat. I think the pure channel count method was deprecated at some point.

like image 85
genpfault Avatar answered Feb 05 '26 05:02

genpfault


Your internal format, "4", doesn't seem to be a valid format. For example, GL_RGBA is defined as 0x1908.

like image 26
chronospoon Avatar answered Feb 05 '26 03:02

chronospoon



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!