/** @see com.googlecode.gwtquake.shared.client.Renderer#Init() */
  public boolean Init(int vid_xpos, int vid_ypos) {
    // pre init
    assert (GlConstants.SIN.length == 256) : "warpsin table bug";

    Window.Printf(Constants.PRINT_ALL, "ref_gl version: " + GlConstants.REF_VERSION + '\n');
    Images.Draw_GetPalette();
    GlConfig.init();

    Commands.addCommand(
        "imagelist",
        new ExecutableCommand() {
          public void execute() {
            Images.GL_ImageList_f();
          }
        });

    Commands.addCommand(
        "screenshot",
        new ExecutableCommand() {
          public void execute() {
            Misc.GL_ScreenShot_f();
          }
        });
    Commands.addCommand(
        "modellist",
        new ExecutableCommand() {
          public void execute() {
            Models.Mod_Modellist_f();
          }
        });
    Commands.addCommand(
        "gl_strings",
        new ExecutableCommand() {
          public void execute() {
            Misc.GL_Strings_f();
          }
        });

    // set our "safe" modes
    GlState.prev_mode = 3;

    // create the window and set up the context
    if (!R_SetMode()) {
      Window.Printf(Constants.PRINT_ALL, "ref_gl::R_Init() - could not R_SetMode()\n");
      return false;
    }

    // post init
    GlState.qglPointParameterfEXT = true;

    Misc.GL_SetDefaultState();

    Images.GL_InitImages();
    Models.Mod_Init();
    Particles.R_InitParticleTexture();
    Drawing.Draw_InitLocal();

    int err = GlState.gl.glGetError();
    if (err != Gl1Context.GL_NO_ERROR) {
      Window.Printf(
          Constants.PRINT_ALL,
          "glGetError() = 0x%x\n\t%s\n",
          new Vargs(2).add(err).add("" + GlState.gl.glGetString(err)));
      //	return false;
    }
    return true;
  }