1

I'm using the GLSurfaceView class to do OpenGL ES rendring. I'd like to have 2 rendering contexts, associated with the same view. I didn't find any way to create an additional context.

genpfault
  • 51,148
  • 11
  • 85
  • 139
Yaron Cohen-Tal
  • 2,005
  • 1
  • 15
  • 26
  • 2
    My answer to this question contains full code for creating and setting up contexts: http://stackoverflow.com/q/26985858/3530129. – Reto Koradi Apr 14 '15 at 02:50
  • Thanx @Reto. However, in your code u create a context associated with a pbuffer, whereas I'd like to create a context associated with a window surface - the same surface I'm already using with my first context (the one GLSurfaceView creates automatically). So I was thinking of using `eglGetCurrentDisplay` and `eglGetCurrentSurface` to create a context associated with that same surface. However, I don't know what to use for `config` in `eglCreateContext`. – Yaron Cohen-Tal Apr 14 '15 at 10:14
  • (cont) I want the new context to have exactly the same configuration as the current context/surface, but I don't see any function that returns the configuration for an existing context/surface. Another solution that I consider is not to use GLSurfaceView at all, but create both of my contexts, as well as their window surface, from scratch. The first question that then comes to my mind is where I get the window from? `eglCreateWindowSurface` gets an `Object win` parameter. Should I pass `Activity.getWindow()` for `win`, or something else? – Yaron Cohen-Tal Apr 14 '15 at 10:14

0 Answers0