# EGL window Handle error

**URL:** https://forums.imgtec.com/t/egl-window-handle-error/1194
**Category:** PowerVR Insider
**Created:** [September 27, 2011, 12:03pm UTC](https://forums.imgtec.com/t/egl-window-handle-error/1194 "2011-09-27T12:03:04Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![arc](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/arc/32/131_2.png) [@arc](https://forums.imgtec.com/u/arc)
#### Post date: [September 27, 2011, 12:03pm UTC](https://forums.imgtec.com/t/egl-window-handle-error/1194/1 "2011-09-27T12:03:04Z")

</div>

Well, I’m trying to draw over a gtk# window in Linux Embedded. The fact is that Egl/openglesv2 only starts if :

1. eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share\_context, int[] attrib\_list) with **“dpy”** = 0  
  
  
2. CreateWindowSurface(EGLDisplay dpy, EGLConfig config, IntPtr win, int[] attrib\_list) with **“win”** pointing to a 0

  
  
  
  
  
  
But in this case, the window opened is not over the GTK# window.  
  
  
  
  
  
If the display for eglCreateContext or the windowhandle for eglCreateWindowSurface are obtained from gdk (X11), the execution of createContext and createWindowSurface always returns the errors about  
  
  
  
  
  
EGL\_BAD\_DISPLAY or EGL\_BAD\_NATIVE\_WINDOW (respectively)  
  
  
  
  
  
So, How can I do to start the openglesv2 app over a gtk window?  
  
  
  
  
  
Can I use the display or the window handle pointing to a different place than zero for initializing EGL (context and surface)??  
  
  
  
  
  
aRc2011-09-27 14:04:36
