I’m trying to do some smooth scrolling for an overhead tile type of game. I sucessfully did it using Allegro a long time ago in DOS and felt like updating things and using OpenGL this time. Here’s my problem: I’ve got an 800x600 window. If I try to start drawing a tile at anything negative (in the X direction, not testing Y yet), the entire tile doesn’t show up at all. What I want to have happen, is for just part of the tile to show. So if a tile is 16x16, and instead of being drawn at (0, 32) it now needs to be shoved left by 6 pixels, I would want to start drawing at (-6, 32), and that way only 16-6=10 pixels would ideally wind up showing on the screen. But this is not happening. As soon as I do a glTranslatef(…) with a value less than 0 for the X direction, the entire image doesn’t get shown. Here’s how I’ve set up my viewing volume:
glOrtho(0, width, 0, height, __z_near, __z_far);
Is the problem with the viewing volume?