/**
   * This initializes the engine and variables required by the engine.
   *
   * @throws E3DInvalidDisplayModeException
   * @throws LWJGLException
   * @throws Exception
   */
  private void initGame() throws E3DInvalidDisplayModeException, LWJGLException, Exception {
    // Initialize the engine
    engine.initEngine(width, height, 32, false, "Espresso3D TestBed");
    engine.getLogger().setDebug(true);
    // engine.setBackfaceCullingEnabled(true);

    // Setup the world
    world = new E3DWorld(engine, "worldOne"); // create the world and give it an ID
    world.loadTextureSet("espresso3d\\testbed\\media\\textures\\textureseta.txt");

    // Add the world to the engine itself.  The world MUST be added to the engine
    // before preloading of particles occur, otherwise textures will not be found for
    // the particles.
    engine.addWorld(world);

    // Preload all the potential actors that can be loaded from the mapfile
    // Preloading is a necessary step before the world is loaded.  Without preloading,
    // the world will have no idea how to load an actor that is in the mapfile
    world.addPreloadedParticleSystem("FIRE", new FireParticleSystem(engine));

    // Load the mapfile.  If there are actors in the mapfile, this must come after preloading the
    // actors
    world.loadWorld("espresso3d//testbed//media//maps//pongroom.e3m");

    // Setup the engine's viewport.  There can be many of these in an engine.
    //  A viewport is required to see anything.  The viewport specifies its dimensions and
    //  which world gets rendered in it.
    viewport =
        new E3DViewport(
            engine,
            0,
            0,
            width,
            height,
            "viewport1"); // create the viewport starting at 0,0 and extending to width, height (the
    // entire window)
    engine.getWindow().addViewport(viewport); // add the viewport to the engine.
    viewport.setWorld(world); // set the world we want the viewport to render in it

    // Bind all of our input handlers.  I do this in another class InputEvents
    inputEvents = new InputEvents(engine, world, this);
    inputEvents.bindInputEvents();
  }