   Rendering large 2D map
  Hi, i am making a 2D game similar to Worms (i.e. a turn-based game where players aim and shoot at each other). Like Worms, i am going to have a deformable map where players can blow a hole in the ground, etc, and eventually have some sort of simple particle engine to make dirt fall down in a similar fashion to the Falling Sand Game (only much simpler to start with).So for that reason, i need one large map that is compiled from smaller tile images rather than drawing each tile when the map is drawn.I am also going to base this particle engine on the image pixels, i.e. i will loop through all pixels in an area which is falling and move each pixel down. So another constraint is that the map image can't be stretched to fit into a power-of-two texture (also, i don't think my video card supports NPOT textures).I currently use glDrawPixels to draw the raw image data but i am having a lot of trouble trying to use transparency with it (i posted in the OpenGL section). Also, glDrawPixels is slow and it would be much better to use a texture. So does anyone know how i can do this?thanks   
  Situations where the entire game field is built of an array of pixels like Worms can't really be improved by using OpenGL. Assuming you're on Windows, I recommend setting up the OpenGL context to work with a DIB Section and copy the pixels into there manually, BitBlt'ing it to the screen when you're ready. Not a pretty solution by any means, but OpenGL is meant as an interface between software and hardware, and your application requires a lot of work on the software side of things.   ;  Yeah, that's a pretty good explanation of my situation. In my case where i am doing a lot of calculations with the map data it is probably best to manually copy the image to the screen.I am using Windows but i was hoping to make it as cross-platform as possible, I am using SDL for everything except graphics. Maybe i could use an SDL_Surface, i could even use SDL for all of my graphics but i already have a nice little image loading library that uses OpenGL (SOIL), and with OGL i can draw images as texture mapped quads and i can stretch and tile them by simply changing the vertex and texture coords. I know that to use OGL with SDL you have to use the SDL_OPENGL flag with SDL_SetVideoMode but i'm not sure if you can also use SDL_Surfaces with it too.   ;  woah, im also writing exactly the same gameU played gunbound before? :POk, you could split the map up, that would worki reccomend you create textures and expand/shrink them to create an illusion of "movement" you could also use a random depthi dont reccomend u use a physics formula for this.You could probably get away with making a pre-drawn animation[Edited by - warthog518 on August 9, 2008 6:24:42 PM];  i don't know what you mean about "pre-drawn animation". Do you mean make an animation of dirt falling down or something? Because the effect i want is that the player can do something like blow a hole in the side of a cliff and dirt will fall down, possibly covering players below it. I have a terrain system where each pixel has a terrain type: DIRT, ROCK, and maybe others. ROCK will not fall down so maps can be made with platforms, etc, and DIRT will fall down.I also don't like the idea of breaking the map up into smaller textures (which i had considered). It would just be too hard to calculate dirt falling across two pieces.Another idea i had was to make a texture the size of the screen (1024x1024 texture but only using 800x600 of it) and update that texture with the portion of the map image that is on screen. But that would mean using the map image (anywhere up to 5000x1000) plus the texture (1024x1024) and copying each frame would be slow. The question is, is it slower than glDrawPixels (on Windows)?Also note that i would eventually optimise the drawing process by only updating the areas that need to be redrawn.   ;  Does anyone know how i can do this? It seems that glDrawPixels is the only way to do it but i am having problems with transparency using that method (see my other post here).   ;  Ok, i've made up my mind (i think). Since i don't intend to do all the map deformation and particle physics code until i have most of the game complete, i have decided that i might as well split the map up into smaller textures. I will need to figure out a way to work on areas of pixels that cross two or more "tiles"  but you guys can help me with that [grin]. The way i see it, it will be quite difficult to do map deformation and particle physics so while i'm at it i can make it work on tiles too.NOTE 1: When i say "tiles", i am talking about the small texture tiles, not the tiles that the map is created from. The map will be created from small tilable images that can be placed all over the map to create any shaped terrain, all those images will be written to a large buffer which will then be split up into the texture tiles which are all the same shape and form a grid.NOTE 2: The GIMP works on tiles in this manner. I haven't made any plug-ins for the GIMP but i read up on how to do it in the hope that one day i might be able to make one. I noticed that the plug-ins request one tile at a time to work with, maybe i can look at the code for some open source plug-ins.   