How to resize FBO?

The FBO is used in my Mobile 3D viewer.(iPhone)
The base of this application is from the book ‘iPhone 3D Programming Developing Graphical Applications with OpenGL ES’.

The anti-aliasing is also implemented as the book introduced.(Super Sampling)

These day, I’m trying to apply it to iPad.

Then,…how can I resize the FBO for horizontal display?(Landscape mode)
At first, I tried a tricky way to rotate camera as ±90deg. :stuck_out_tongue:

but, it is just tricky and has many limitations to use UI that is automatically rotated.
:cry:
Remove all FBO, and then remake all of them horizontally again?

Any comments would be helpful for me.
Thank you. :smiley:

I think the best solution is to allocate your FBOs for a worst case size that accommodates both landscape and portrait orientations. Then, rather than resizing them to change between orientations, simply change the set of texture coordinates that you use with the textures that are attached to the FBOs. The area specified by the texture coordinates should be reduced so that the excess area of the textures is ignored when rendering frames. This approach does waste some memory, but will be much faster than deleting and recreating the FBOs and textures.

Regards, Clay

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.