*/
  public RenderModeData render_mode (int mode) {

    RenderModeData d = new RenderModeData ();
    int new_mode = render_mode;
    RequestOutputStream o = display.out;
    synchronized (o) {
      o.begin_request (glx.major_opcode, 107, 3);
      o.write_int32 (tag);
      o.write_int32 (mode);
      if (render_mode == RENDER)
        o.send ();
      else {
        ResponseInputStream i = display.in;
        synchronized (i) {
          i.read_reply (o);
          i.skip (8);
          d.ret_val = i.read_int32 ();
          int num_data = i.read_int32 ();
          new_mode = i.read_int32 ();
          i.skip (12);
          if (render_mode == FEEDBACK) {
            d.feedback_data = new float [num_data];
            for (int j = 0; j < num_data; j++)
              d.feedback_data [j] = i.read_float32 ();
          } else if (render_mode == SELECT) {
            d.selection_data = new int [num_data];
            for (int j = 0; j < num_data; j++)
              d.selection_data [j] = i.read_int32 ();
          } else {
            assert false : "Should not get here";
          }
        }
        
      }
    }

    return d;
  }