Original Post
I am having problem using this code + if use GL_RGB in creating texture this piece of code works fine however with GL_LUMINANCE it is gives a run time error "invalid enumerant at the END " Can someone figure out what is wrong with the code glBindTexture(GL_TEXTURE_2D, _iTexture[0]); // (set texture parameters here) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP); //create the texture glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE, _iWidth, _iHeight, 0, GL_RGB, GL_LUMINANCE, 0); glGenFramebuffersEXT(1, &_mybuffer); glBindFramebufferEXT(GL_FRAMEBUFFER_EXT,_mybuffer); glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, _iTexture[0], 0);