Improving Zoom Box performance

Ive coded a Zoom Box routine for my app, it works very well. The only thing I dont like about it, is the corner of the box lags behind the cursor. Its really only noticable if you’re looking for it, but…

Would anyone be willing to look at my code to see where I might improve its performance. I could post just the logic, render, ect functions. I’ve only been using OpenGL a few months so I would appriciate the help.

Hey there,

I’ve done a zoom box once, and maybe this could help you; the way I did it was by using the XOR option in draw mode, which allows me not to use glutPostRedisplay(), so if the scene is quite complex, the only thing drawn is your zoom box, because nothing else moves.


Thats something I was wondering about, in a round about way. The render code for the box is called from the paint func. If I could make the box render locally that would shurly help. Thanks Moose, I’ll look up the boolean masks.

Thanks a bunch, Moose.
Works much better now.

Glad I could help, even if just a little.