Hello,
I use FBO and GL_TEXTURE_RECTANGLE_ARB to generate a non-power-of-two sized texture and render it to cover the whole window. When users change the window size, I re-create a new texture with the new window size and render it to fulfill the window again.
It works flawlessly until I use shaders to render the texture. The screen looks fine when the program just launched. But if the window size is changed, the texture would get stretched, which doesn’t happen without shaders. So it seems like the problem is the coordinates of textures in shaders do not update correctly.
Here are my shaders
void main(){
gl_TexCoord[0] = gl_MultiTexCoord0;
gl_Position = ftransform();
}
uniform sampler2DRect source;
void main()
{
gl_FragColor = texture2DRect(source, gl_TexCoord[0].st);
}
ATI mobility radeon 9600, omega 3.8.360