Using opengl to render each item in a list in android

I am trying to find a way to make some opengl based 3d animations for each item in the list. I know that with ICS you can use a TextureView in which you can display an opengl scene. Romain Guy responds in this thread explaining in detail how this can be done.

However, I can’t understand how this will work if the TextureView was part of the ListView? (Is there any other way to render an opengl database inside a list?)

There are two methods that I can think of.

  • For each texture in the list view, create an opengl context that will be displayed on that surface of the texture. (It seems very unbalanced to have a huge number of gl contexts, plus I think the limitation is hardware dependent)

  • Create one opengl context and share it on multiple surfaces. And carry out consistent calls to draw to different surfaces. (I don’t know how to do this, but listview controls what to show and hide, which makes it even more complicated).

So my question is ... Is there a way to do opengl-based rendering inside a ListView? And if so, how?

+4
source share
1 answer

ListView performs internal processing. Therefore, there will not be too many View objects: usually two or three more than can be seen at the same time.

+1
source

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


All Articles