• Advertisement
Sign in to follow this  

bad fbo code .... / glDrawArrays throws GL_INVALID_OP

This topic is 3448 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm wondering what's wrong with this code. I'm limited it down to this call. The Code compiles fine and says that the FBO is complete. It's just when I call glDrawArrays(), I get an invalid operation. I've checked the few glBegin() / glEnd() call that I have and they are all complete. I've limited the error code down to this block of code.
  for( unsigned i = 0; i < MAX_SHADOW_MAPS; ++i )
  {
    ShadowMaps = CreateDepthTexture( SHADOW_MAP_WIDTH, SHADOW_MAP_HEIGHT );
  }

  // ---- Create the Depth Textures

  glGenFramebuffersEXT( 1, &DepthRenderFBO_id );

  glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, DepthRenderFBO_id );

  // ---- Bind a Single Depth Buffer
  glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, ShadowMaps[0], 0);

  // ---- Let's Add a Texture
  BlankTextureFBO_id = CreateBlankTexture( SHADOW_MAP_WIDTH, SHADOW_MAP_HEIGHT );
  
  glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, BlankTextureFBO_id, 0);

  GLenum buffers[] = { GL_COLOR_ATTACHMENT0_EXT };

  glDrawBuffers( 1, buffers );
  
  // --- Check for Completeness

  if (glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) != GL_FRAMEBUFFER_COMPLETE_EXT) 
    throw(std::runtime_error(std::string("Error Setting up a Frame Buffer Object")));

  glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, 0 );




Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement