title: How to wrap pixel data for use with glDrawPixels() or textures
body: <p>I am trying to render a simple jpg image using JOGL.  However, I'm not sure how to wrap the pixel array data so that glDrawPixels will accept it.  Here's the relevant pieces I have so far:</p>
  
  <pre><code>//In Main() Method
  private static float[] pixels = {
      0.f, 1.f, 0.f,
      1.f, 0.f, 1.f,
      0.f, 1.f, 0.f
  };
  
  //In Render() Method
  gl.glRasterPos3f(12.0f, 12.0f, 5.0f);
  gl.glDrawPixels(3, 3, GL.GL_RGBA, GL.GL_FLOAT, pixels);
  </code></pre>
  
  <p>Eclipse tells me that glDrawPixels takes in a buffer and not a float array, so I guess I need to throw the pixels into a buffer first and specify the buffer, but I'm not sure how to do this, or which buffer to use.  Do I need to use glPixelStore*()?  Any help would be much appreciated.  Thank you!</p>
  
  <p>--Edit--</p>
  
  <p>I tried to throw the information into a FloatBuffer and the method accepted it, but nothing shows up on the screen.  Am I wrapping the array into a buffer correctly, or is the issue with my calls to the gl functions?  Here's the updated code:</p>
  
  <pre><code>private static float[] pixels = {
      0.f, 1.f, 0.f,
      1.f, 0.f, 1.f,
      0.f, 1.f, 0.f
  };
  
  static FloatBuffer buf; 
  
  //In Main() Method
  buf.wrap(pixels);
  
  //In Render() method
  gl.glRasterPos3f(0.0f, 0.0f, 0.0f);
  gl.glPixelZoom(50.0f, 50.0f);
  gl.glDrawPixels(3, 3, GL.GL_RGBA, GL.GL_FLOAT, buf);
  </code></pre>
  
  <p>When I run the program, it just shows a black screen.</p>