Sign in to follow this  
FlyingSolo

Window Resize Woes

Recommended Posts

Hi, My Ortho program works happily based on NeHe's window handling code. It works fine in it's native 1024x768 res, and if I hit F1, it goes fullscreen without any complaint. However! If I drag the corner of the window to resize it - all hell breaks loose. All my bitmapped textures remain their original size. Some bitmaps are copied from a 'sprite sheet' which is loaded at runtime. Other bitmaps are stored in display lists, including my fonts which DO resize ok. I've checked and double-checked that my window handling code is the same as NeHe's (which resizes perfectly) and can find no differences. Can anyone shed any light on why my bitmapped textures might not be resizing? Sincerest thanks.

Share this post


Link to post
Share on other sites
Bitmaps will never resize by themselves, they shouldn't be resized at all too. I guess that there is something wrong in the drawing routine, where pixel and fractal coordinates are mixed. Could you be more specific? (screenshots maybe)

Share this post


Link to post
Share on other sites

I thought that updating the viewport in the resize handler would take care of that?

I looked through NeHe's lesson 6 which is just a rotating cube which has a bitmap texture on each face. This resizes perfectly no matter what you do.

I can't think of anything I'm doing that could screw it all up. It's a very simple 2D openGL program.

Share this post


Link to post
Share on other sites
Problem Solved.

In my resize routine I was setting the ortho width & height to the same as the new viewport size. Doh. Don't know how I didn't spot that sooner.

Amazing how fresh eyes are better at finding bugs eh!?

Many thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this