Question

I'm using GLOrtho to set up a 2D view that I can render textures onto. It works really well, up until I try to zoom in on the image. If I pass half the width and half the height of the viewport to GLOrtho, I end up with all my textures displayed twice as big as normal, which is exactly what I expect.

But then I try to draw a box around part of the image and it all falls apart. I call glBegin(GL_LINE_LOOP), place the four vertices, and call glEnd, and I expect to see the same thing I would see if I drew it at normal zoom level, doubled. Instead, I get lines that are all the right length, but they all come out one pixel wide, instead of two, and it looks really bad.

What am I missing?

Was it helpful?

Solution

Well you can either scale it yourself using glLineWidth or you can emulate the line as 2 triangles.

OTHER TIPS

glScale would be a better solution for scaling instead of changing glOrtho parameters. That way anything drawn will scale as expected.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top