Are OpenGL textures more memory efficient than Android bitmaps?

I have a custom map application that deals with many bitmaps that have 256x256 images (png, jpg). I am currently using View 2d canvas and add all images as RGB_565. Although I am generally pleased with the performance of the applications, I have features that I would like to add that will require even more map fragments (Bitmaps). I was thinking about using opengl, but pretty new to this.

  • Could texture textures be more efficient memory than keeping bitmaps around? I assume you can load bitmap into texture and then remove bitmap

  • Is it acceptable practice in opengl to dynamically load many different textures at run time?

  • Do you need to cache textures or make a graphics processor for it?

UPDATE: I got a nice detailed answer to this question on GameStack.

+4
source share
1 answer
  • Loading a large instance of Bitmap into an application can sometimes cause OOM.
  • Loading data into a texture can be done in native code. It is more efficient than in the application, just call memcpy, you do not need a Bitmap instance.
  • you must generate the texture and explicitly it explicitly.
+1
source

Source: https://habr.com/ru/post/1398743/


All Articles