简体   繁体   中英

Using opengl to render each item in a listview in android

I am trying to find a way to do some opengl based 3d animations for each item in a listview. I know that as of ICS it is possible to use a TextureView in which you can render an opengl scene. Romain Guy's answer in this thread explains in detail how this can be done.

However I am not able to figure out how this will work if the TextureView was part of a ListView? (Is there any other way of performing opengl base rendering inside a listview?)

There are two methods I can think of.

  1. For every textureview in the listview create an opengl context which will render to that textureview's surface. (Seems very unelegant to have huge number of gl contexts, plus I think the limit is hardware dependent)

  2. Create one opengl context and share it across multiple surfaces. And do sequential drawing calls to different surfaces. (Don't know how this can be done, and listview manages what to show and hide which further complicates things)

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

ListView does internal recycling. Therefore, there won't be too many View objects: usually two or three more than are visible at the same time anyway.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM