Archived

This topic is now archived and is closed to further replies.

Crispy

viewport

Recommended Posts

My program follows this scheme: 1) Render the scene at a "normal" 4/3 aspect ratio resolution (such as 800x600) 2) Set the viewport to something like 512x512 as a preparatory step for a frame buffer dump 3) Dump frame buffer to RAM using glReadPixels(.., 0,0,512,512, ..) 4) Render over the current screen (512x512) using the dumped image 5) Set the viewport back to a 4/3 aspect ratio 6) Swap buffers Why does glReadPixels() only capture a 512x512 pixel portion of the original (800x600) image even though the viewport has been resized to 512x512 (it''s as if it was still something like 800x600)? As I understand it, glReadPixels() reads from the back buffer, which is directly affected by glViewport() so this doesn''t make sense... The fundamental problem here is that I need to capture a size 2sup>n pixel image from the screen (to generate it into a normal GL texture) and paint it back onto the screen. The problem is that the captured image contents and frame buffer contents do not match in size. Are there any alternatives or some simple means to fix this problem? Cheers

Share this post


Link to post
Share on other sites