# GL\_INVALID\_ENUM occurs in glGetFramebufferAttachme

**URL:** <https://forums.imgtec.com/t/gl-invalid-enum-occurs-in-glgetframebufferattachme/1126>\
**Category:** PowerVR Insider\
**Created:** [July 7, 2011, 8:28am UTC](https://forums.imgtec.com/t/gl-invalid-enum-occurs-in-glgetframebufferattachme/1126 "2011-07-07T08:28:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pencyot3](https://avatars.discourse-cdn.com/v4/letter/p/b3f665/32.png) [@pencyot3](https://forums.imgtec.com/u/pencyot3)\
**Post date:** [July 7, 2011, 8:28am UTC](https://forums.imgtec.com/t/gl-invalid-enum-occurs-in-glgetframebufferattachme/1126/1 "2011-07-07T08:28:32Z")

</div>

A GL\_INVALID\_ENUM error occurred when I acquired an object type for the attachment point that an object was not installed.  
  
It occurs in the following source codes.  
  
&nbsp; GLuint renderbuffer = 0;  
&nbsp; glGenRenderbuffers( 1, &renderbuffer );  
&nbsp; glBindRenderbuffer( GL\_RENDERBUFFER, renderbuffer );  
&nbsp; glRenderbufferStorage( GL\_RENDERBUFFER, GL\_DEPTH\_COMPONENT16, 256, 256 );  
  
&nbsp; GLuint framebuffer;  
&nbsp; glGenFramebuffers( 1, &framebuffer );  
&nbsp; glBindFramebuffer( GL\_FRAMEBUFFER, framebuffer );  
&nbsp; glFramebufferRenderbuffer( GL\_FRAMEBUFFER, GL\_DEPTH\_ATTACHMENT, GL\_RENDERBUFFER, renderbuffer );  
  
&nbsp; if ( glCheckFramebufferStatus( GL\_FRAMEBUFFER ) == GL\_FRAMEBUFFER\_COMPLETE ) {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GLint type = 0;  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; glGetFramebufferAttachmentParameteriv( GL\_FRAMEBUFFER, GL\_COLOR\_ATTACHMENT0,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GL\_FRAMEBUFFER\_ATTACHMENT\_OBJECT\_TYPE,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &type );  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; GLenum error = glGetError();  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ( error != GL\_NO\_ERROR ) {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOGE( “glGetError() == 0x%04xn”, error );  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }  
&nbsp; }  
  
When I ran this, “glGetError() == 0x0500” was output. (GL\_INVALID\_ENUM)  
  
GL\_NONE should be returned to _type_ without an error occurring.  
  
I tested it in Galaxy S (SC-02B Android 2.3.3 GINGERBREAD.OMKE3).

---

<div class="post-metadata">

**Author:** ![tobias](https://avatars.discourse-cdn.com/v4/letter/t/c67d28/32.png) [@tobias](https://forums.imgtec.com/u/tobias)\
**Post date:** [July 7, 2011, 8:43am UTC](https://forums.imgtec.com/t/gl-invalid-enum-occurs-in-glgetframebufferattachme/1126/2 "2011-07-07T08:43:38Z")

</div>

Hi PenCyot3,  
  
Is the error definitely generated at this point? Have you tried putting earlier error checks to see if it’s another call that might be doing this?  
  
Thanks,  
  
Tobias

---

<div class="post-metadata">

**Author:** ![pencyot3](https://avatars.discourse-cdn.com/v4/letter/p/b3f665/32.png) [@pencyot3](https://forums.imgtec.com/u/pencyot3)\
**Post date:** [July 7, 2011, 11:51am UTC](https://forums.imgtec.com/t/gl-invalid-enum-occurs-in-glgetframebufferattachme/1126/3 "2011-07-07T11:51:04Z")

</div>

The error was generated only at a place of glGetFramebufferAttachmentParameteriv().  
  
  
  
I did the error check of all the GL commands in early stage, but erased other glGetError() to do a code clearly.
