Hey I just recently started looking at the opengl library after I coded with allegro for a few months. I’m going to start by attempting a 2d tile map editor. I just figured out how to load jpeg images into a texture and I can map them easily to a quad. However, I can’t figure out how to size my quads. I have a 32x32 pixel jpeg image and I would like to map it to a 32x32 pixel quad. Working with the vertexes is new to me and i’m still a little confused. Any help?
There is one extra level of indirection in OpenGL, it has to do with modelview and projection transformation.
If fact, you can choose to work with float coordinates between 0 and 1 for x and y, to be resolution independent and let your 2D graphics scale easily.
Or use pixel coordinates if you really want to, see the links below :