Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Using same textures across different GLSurfaceVIews!

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2014

    Using same textures across different GLSurfaceVIews!

    I ve different GLSurfaceViews, four of them in a single activity in android. Is it possible to share a texture between all these surfaceviews. I am nt able to use the texture ID generated in one surfaceview in another. So it is creating the same texture in all four and taking 4 times the memory. Is there a sample code or way or somting to adddress this issue?

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Apr 2010
    I'm not familiar with GLSurfaceView, but presumably each of those create their own OpenGL context. If the API allows it you would have to set things up so that your GLSurfaceViews share the same OpenGL context (or the contexts are configured to share resources [1]). Depending on what you are doing it may be simpler to use one large GLSurfaceView and only render to portions of it using glViewport.

    [1] for GLX GLX_ARB_create_context this is the 'share_context' argument to glxCreateContextAttribsARB

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts