title: Raspberry Pi EGL - How to use fb1?
body: <p>I am trying to modify the hello_triangle example (<code>/opt/vc/src/hello_pi/hello_triangle</code>) on my Raspberry Pi to output to fb1 instead of fb0.</p>
  
  <p>I have searched everything I can think of with no answers (it could be I don't know what to search for).</p>
  
  <p>It seems like the line I need to modify is this line:</p>
  
  <pre><code>state-&gt;display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
  </code></pre>
  
  <p>The docs state the parameter is of type <code>NativeDisplayType</code> and "Specifies the display to connect to. EGL_DEFAULT_DISPLAY indicates the default display." However, it does not give any information on how to list/find available displays.</p>
  
  <p><code>EGL_DEFAULT_DISPLAY</code> is defined as <code>(NativeDisplayType)0</code> so I guessed that 0 referred to fb0, but using <code>(NativeDisplayType)1</code> for fb1 caused <code>eglGetDisplay</code> to return <code>EGL_NO_DISPLAY</code>.</p>
  
  <p>The original example outputs to fb0 as it should, no problems there.<br>
  I also know my display is working correctly as I can use <code>fbi</code> to display images on fb1 just fine.</p>