You're welcome.
I think Indiepath summed up the answer to the question about memory, and made the good point about trying to put all `frames` of an animation into a single texture. Reason being that when you have to switch to a different texture, for drawing, that takes extra time. And like Indie said, when you draw a pixmap, it uses a glDrawPixels() call which `uploads` the pixels to the backbuffer memory in video ram, using the CPU. When you actually draw an image, the gfx hardware is being used to zap it from video memory into the backbuffer, also in video mem. DrawImage can be 10-100 times faster than DrawPixmap, therefore.
Image=Texture=Backbuffer=Hardware-Accelerated=Video Memory Based
Pixmap=Bitmap=Array=CPU-Processed=Main Memory Based
I think that just generally you have to think about what you need to do to make your engine work. If you don't need to read from the background and you don't need to keep a permanent change that's not part of a tile map system, things are pretty easy. OpenGL is highly geared towards DRAWING stuff, it's really quite poor with regards to READING stuff. If you want to read stuff you are most likely better off reading it straight from main memory, rather than transfer it - which means keeping two versions of your game world - one `backup` in main memory, possibly featuring only the minimal amount of pixels/information you need for your purposes - and one `displayable` in video ram that you use to make something to phsyically look at.
I think Indiepath summed up the answer to the question about memory, and made the good point about trying to put all `frames` of an animation into a single texture. Reason being that when you have to switch to a different texture, for drawing, that takes extra time. And like Indie said, when you draw a pixmap, it uses a glDrawPixels() call which `uploads` the pixels to the backbuffer memory in video ram, using the CPU. When you actually draw an image, the gfx hardware is being used to zap it from video memory into the backbuffer, also in video mem. DrawImage can be 10-100 times faster than DrawPixmap, therefore.
Image=Texture=Backbuffer=Hardware-Accelerated=Video Memory Based
Pixmap=Bitmap=Array=CPU-Processed=Main Memory Based
I think that just generally you have to think about what you need to do to make your engine work. If you don't need to read from the background and you don't need to keep a permanent change that's not part of a tile map system, things are pretty easy. OpenGL is highly geared towards DRAWING stuff, it's really quite poor with regards to READING stuff. If you want to read stuff you are most likely better off reading it straight from main memory, rather than transfer it - which means keeping two versions of your game world - one `backup` in main memory, possibly featuring only the minimal amount of pixels/information you need for your purposes - and one `displayable` in video ram that you use to make something to phsyically look at.