# GLES2MakeCurrentGC: Invalid drawable

**URL:** <https://forums.imgtec.com/t/gles2makecurrentgc-invalid-drawable/1290>\
**Category:** PowerVR Insider\
**Created:** [January 16, 2012, 11:09am UTC](https://forums.imgtec.com/t/gles2makecurrentgc-invalid-drawable/1290 "2012-01-16T11:09:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rudolf](https://avatars.discourse-cdn.com/v4/letter/r/5daacb/32.png) [@rudolf](https://forums.imgtec.com/u/rudolf)\
**Post date:** [January 16, 2012, 11:09am UTC](https://forums.imgtec.com/t/gles2makecurrentgc-invalid-drawable/1290/1 "2012-01-16T11:09:11Z")

</div>

Hi all,  
  
I try to create an offscreen render context on a Galaxy Nexus (SGX 540) @Android 4.0.1. This is my code:  
  
EGLDisplay display =&nbsp; eglGetDisplay(EGL\_DEFAULT\_DISPLAY);  
if (display == EGL\_NO\_DISPLAY) {} // ok, no error  
  
if (eglInitialize(\_display, &majorVersion, &minorVersion) != EGL\_TRUE) {} // ok, no error  
  
const EGLint attribList[] =   
{  
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EGL\_SURFACE\_TYPE, EGL\_PBUFFER\_BIT,  
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EGL\_RED\_SIZE, 8,  
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EGL\_GREEN\_SIZE, 8,  
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EGL\_BLUE\_SIZE, 8,  
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EGL\_ALPHA\_SIZE, 8,  
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EGL\_DEPTH\_SIZE, 0,  
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EGL\_STENCIL\_SIZE, 0,   
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EGL\_RENDERABLE\_TYPE, EGL\_OPENGL\_ES2\_BIT,  
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EGL\_NONE  
};  
  
EGLConfig configs[1];  
EGLint num\_config = 0;  
&nbsp;&nbsp;&nbsp;   
if (eglChooseConfig(\_display, attribList, configs, 1, &num\_config) != EGL\_TRUE || num\_config == 0) {} // ok, no error  
  
EGLSurface surface = eglCreatePbufferSurface(display, configs[0], NULL);  
if (surface == EGL\_NO\_SURFACE) {} // ok, no error  
  
const EGLint attribListContext[] =   
&nbsp;&nbsp;&nbsp; {  
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EGL\_CONTEXT\_CLIENT\_VERSION, 2,   
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; EGL\_NONE  
&nbsp;&nbsp;&nbsp; };  
  
EGLContext context = eglCreateContext(display, configs[0], sharegroup, attribListContext);  
if (context == EGL\_NO\_CONTEXT) {} // ok, no error  
  
if (eglMakeCurrent(display, surface, surface,context) != EGL\_TRUE) {} // always returns EGL\_TRUE, no error

* * *
  
  
Now, when I try to make the context current - eglMakeCurrent returns always EGL\_TRUE,&nbsp; an error message is printed to logcat and then nothing works :(   
01-28 03:42:21.295: E/IMGSRV(2617): :0: GLES2MakeCurrentGC: Invalid drawable - what do we do?  
  

* * *
  
  
Any ideas, thoughts ? Thanks.  
Me.
