I'm working on a mostly two-dimensional, tile-based game. I've already written a working map editor in C++ (I already had some of it written before I learned about LWJGL, so I just didn't bother to port it) which uses a master tileset image (260 tiles in all, and with 32x32 tiles, it's 416x640 pixels). The map editor, which uses a very small directx wrapper that I didn't write myself, has support for drawing only a small rectangle of the larger image (s single 32x32 tile, obviously) on the screen. The editor then saves the map as data that can be read from my java app.
I've examined some of the sample code available on the lwjgl website, specifically the Space Invaders example, and I've adapted the two-dimensional converting code (even though I don't really understand it ... if anyone has tips on 2d adaptions I'd appreciate it), but I can't figure out how to draw only a specific section of the image that I've loaded. After messing with the rendering code for a while, all I was able to do was scale the image (not really useful).
I'm sure there's a way. Does anyone know it? I really don't want to chop up my 416x640 image in Paint or Photoshop and save 260 tiles individually (and I am planning to make this dynamic for even larger tilesets, not to mention that I'd like to easily make changes to the graphic).