I am a beginner and have a src_buffer of RGB image 800x480 and dst_buffer of RGB image 720x480, want to scaler a RGB image with opengl API, here is my source code, but it doesn’t work:
glGenFramebuffers(1, &framebuffer);
glBindFramebuffer(GL_FRAMEBUFFER, framebuffer);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glEnable(GL_TEXTURE_2D);
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 800, 480, 0, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, src_buffer);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texture, 0);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glPushMatrix();
glScalef(0.9, 1.0, 1.0);
glPopMatrix();
glReadPixels(0, 0, 720, 480, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, dst_buffer);
But the data of dst_buffer is same as the data of src_buffer, could you point out where I am wrong?