Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8224139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:57:26+00:00 2026-06-07T14:57:26+00:00

According to the OpenGL documentation I should be able to set the source for

  • 0

According to the OpenGL documentation I should be able to set the source for pixel reading to any of GL_COLOR_ATTACHMENTi. However, when I try this, glGetError gives me a GL_INVALID_ENUM error. A subsequent glReadPixels simply reads the back buffer.

The version reported by glGetString(GL_VERSION) is 4.2.11627 Core Profile Forward-Compatible Context. I am running on linux and have the fglrx ati drivers installed (version 8.96.7-120312a-135598C-ATI).

I checked that my FBO is bound and complete. I also verified the glGetError was not set by a previous call.

It fails already on this (I would expect an error here, but rather INVALID_OPERATION than INVALID_ENUM):

#include <iostream>
#include "Window.h" // My own class based on sfml, but I am sure context creation works fine
#include <glload/gll.hpp>
#include <glload/gl_core.hpp>

int main()
{
    const unsigned int screenW = 1280, screenH = 720;
    Window w(screenW, screenH, 32, false);
    if (glload::LoadFunctions() == glload::LS_LOAD_FAILED)
    {
        std::cerr << "glload failed to load" << std::endl;
        return -1;
    }
    gl::ReadBuffer(gl::GL_COLOR_ATTACHMENT0);
    if( gl::GetError() == gl::GL_INVALID_ENUM)
    {
        std::cerr << "Invalid enum error" << std::endl;
        return -1;
    }
    return 0;
}

Is there another reason this call could trigger INVALID_ENUM or is it more likely that the OpenGL implementation I am using is bugged?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T14:57:28+00:00Added an answer on June 7, 2026 at 2:57 pm

    However, when I try this, glGetError gives me a GL_INVALID_ENUM error. A subsequent glReadPixels simply reads the back buffer.

    If you’re reading from the back buffer, then that means the default framebuffer is still bound. And glReadBuffer sets the reading buffer for the current framebuffer.

    The default framebuffer doesn’t have GL_COLOR_ATTACHMENTs. Therefore, setting one of these images to be the read buffer is an error. You have to bind the FBO first, then set the read buffer. Note that glReadBuffer sets the binding for the framebuffer bound to GL_READ_FRAMEBUFFER, not GL_DRAW_FRAMEBUFFER. So make sure it’s bound to the right place.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

According to this post in Recursive Descent vs. LALR , any LALR(k) can be
According to docs at http://code.google.com/p/minify/wiki/UriRewriting $min_serveOptions['rewriteCssUris'] = false; I should be able to add
It appears that glColorMaterial() is absent from OpenGL ES . According to this post
According to http://msdn.microsoft.com/en-us/library/ms535934(v=VS.85).aspx and http://msdn.microsoft.com/en-us/library/ms535262(v=VS.85).aspx , I should be able to do the following
I am trying to use opengl to make isometric drawings. According to: http://en.wikipedia.org/wiki/Isometric_projection#Mathematics this
I'm dealing with OBJ file with OpenGL 2.1. This is OBJ spec: http://www.martinreddy.net/gfx/3d/OBJ.spec According
According to this SO post: How to check the TEMPLATE_DEBUG flag in a django
According to this post , IDEA uses Osmorc to run OSGi frameworks. It, in
According this article , generic JPA DAO(Data Access Object) is a pretty nice pattern.
According to Hibernate documentation : After observing that arrays cannot be lazy , you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.