SDL 1.3 Pinch Zoom

Hello,

SDL 1.3 is used in many iOS apps now. Many of these apps will want to
support pinch zoom. Aside from handling the pinch gesture, what is the best
way to support zooming in with SDL 1.3. Assuming we’re using OpenGL or
GLES, I imagine that some GL viewport management is called for, but as a GL
ignoramus, have no idea where to begin. Anyone solve this before? Any
advice?

Thanks for your attention,
Jeremy Jurksztowicz

There are two approaches to zooming (in 2D). The first is to simply make
everything larger, effectively scale the entire scene, including the
distances between objects, etc. The second is to simply take a smaller
rectangle that you are looking at and make it “fullscreen” so to speak. If
you are using an orthographic projection to give the rectangle of say,
(0,0) to (1250,1250), then if you wanted to zoom near the origin, you
simply do glOrtho() again, but with (0,0), (500,500). In effect, you taking
the smaller 500x500 region and making it fit entirely on the screen.

The viewport is the actual region within the window/surface/etc that you
are rendering to. This would be used if you wanted to render an area that
was just in say, the upper-left corner of the screen, or if you wanted to
render the scene 4x times to make a splitscreen game or something. It would
not be what you’re looking to do.On Thu, Nov 3, 2011 at 3:10 AM, Jeremy Jurksztowicz wrote:

Hello,

SDL 1.3 is used in many iOS apps now. Many of these apps will want to
support pinch zoom. Aside from handling the pinch gesture, what is the best
way to support zooming in with SDL 1.3. Assuming we’re using OpenGL or
GLES, I imagine that some GL viewport management is called for, but as a GL
ignoramus, have no idea where to begin. Anyone solve this before? Any
advice?

Thanks for your attention,
Jeremy Jurksztowicz


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org