title: EGL: EGL_SURFACE_TYPE and rendering to a texture
body: <p>I am writing an head-less Linux application which uses EGL interface to perform OpenGL drawing. I use "render to a texture" approach, i.e. I don't create any pbuffers or pixmaps inside EGL world. Instead, I call <code>eglMakeCurrent()</code> as the following:</p>
  
  <pre><code>eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, context);
  </code></pre>
  
  <p>and then attach a texture to the framebuffer.</p>
  
  <p>Now, I wonder what is the proper (most portable) way to specify required <code>EGL_SURFACE_TYPE</code> value in <code>configAttribs</code> when I do <code>eglChooseConfig()</code>?</p>
  
  <p><a href="https://www.khronos.org/registry/EGL/sdk/docs/man/html/eglChooseConfig.xhtml" rel="nofollow noreferrer">eglChooseConfig() documentation</a> says that the default <code>EGL_SURFACE_TYPE</code> is <code>EGL_WINDOW_BIT</code>. At the same time it says about masking, i.e. looking for configs supporting both <code>EGL_WINDOW_BIT | EGL_PIXMAP_BIT</code>. It is unclear to me whether <code>0</code> is a valid mask value here? Or <code>0</code> is defaulted to <code>EGL_WINDOW_BIT</code>? The second question if <code>EGL</code> standard prescribes that the some surface type must be always supported by arbitrary implementation? So, what should I do to always find a config?</p>