I am trying the following code on my device which support OpenGL3 ("OpenGL version string: 3.3.0 NVIDIA 310.19"):
glBindFramebuffer(GL_FRAMEBUFFER, 0);
checkGlError();
glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_FRONT_LEFT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &ret);
checkGlError();
if (ret == GL_NONE)
throw std::runtime_error("something is really bad there or FRONT_LEFT isn't your default buffer. Check it!");
glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_FRONT_LEFT, GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE, &ret);
checkGlError();
checkGlError
is a macro that will check for OpenGL error and tell the line which occurred an error.
I tried initialized my context using Qt and SDL. Also, I used glew to get access to the function.
On the first call to glGetFramebufferAttachmentParameteriv
I get and INVALID_ENUM error. What can it be?