Anyone know of an example of an opengl implementation of something like the Gallery widget? Basically, I am looking for an example of how to horizon开发者_如何学Gotally scroll a list of images using opengl. I have seen this behavior in the Gallery 3D app from cooliris but there is ALOT of code in that app and I haven't been able to figure out how it works exactly. I am new to using opengl.
What you are looking for is texture mapping. NeHe has the most complete collection of tutorials on OpenGL. I highly recommend you to take a look.
I don't think you're gonna be able to copy/paste code in this case without some understanding of how OpenGL works.
For specific example on how to load 2D textures you can check this one.
Step 1: Load thumbnails into a texture atlas. Look into bin packing for atlas layout ideas.
Step 2: Render a bunch of rectangles with texture coordinates that map into the correct parts of your texture atlas.
精彩评论