TGAImage spin    = loadImage(spinFilename); TGAImage droplet = loadImage(dropletFilename);  gl.glGenTextures(CA_NUM_STATIC_TEXTURES, staticTextureIDs, 0); gl.glGenTextures(CA_NUM_DYNAMIC_TEXTURES, dynamicTextureIDs, 0);   createTextureObject(gl, staticTextureIDs[CA_TEXTURE_INITIAL_MAP], initialMap, true);  createTextureObject(gl, staticTextureIDs[CA_TEXTURE_SPIN], spin, true);  createTextureObject(gl, staticTextureIDs[CA_TEXTURE_DROPLET], droplet, false);
initialMapTex = TextureIO.newTexture(initialMapData); spinTex       = TextureIO.newTexture(getClass().getClassLoader().getResourceAsStream(spinFilename), false, TextureIO.getFileSuffix(spinFilename)); dropletTex    = TextureIO.newTexture(getClass().getClassLoader().getResourceAsStream(dropletFilename), false, TextureIO.getFileSuffix(dropletFilename));
  private void loadTextures(GL gl,                            String spinFilename,                            String dropletFilename,                            String cubeMapFilenamePattern) {    if (initialMap == null) {      throw new GLException("Must call loadInitialTexture ahead of time");    }    TGAImage spin    = loadImage(spinFilename);    TGAImage droplet = loadImage(dropletFilename);    gl.glGenTextures(CA_NUM_STATIC_TEXTURES, staticTextureIDs, 0);     gl.glGenTextures(CA_NUM_DYNAMIC_TEXTURES, dynamicTextureIDs, 0); // also create intermediate texture object    // upload the initial map texture    createTextureObject(gl, staticTextureIDs[CA_TEXTURE_INITIAL_MAP], initialMap, true);    createTextureObject(gl, staticTextureIDs[CA_TEXTURE_SPIN], spin, true);    createTextureObject(gl, staticTextureIDs[CA_TEXTURE_DROPLET], droplet, false);    // load the cubemap texture    loadCubeMap(gl, staticTextureIDs[CA_TEXTURE_CUBEMAP], cubeMapFilenamePattern, true);    for (int i = 0; i < CA_NUM_DYNAMIC_TEXTURES; i++) {      // now create a dummy intermediate textures from the initial map texture      createTextureObject(gl, dynamicTextureIDs[i], initialMap, false);    }    initialMap = null;    texHeightInput    = staticTextureIDs [CA_TEXTURE_INITIAL_MAP];      // initial height map.    texHeightOutput   = dynamicTextureIDs[CA_TEXTURE_HEIGHT_TARGET];    // next height map.        texVelocityInput  = dynamicTextureIDs[CA_TEXTURE_VELOCITY_SOURCE];  // initial velocity.    texVelocityOutput = dynamicTextureIDs[CA_TEXTURE_VELOCITY_TARGET];  // next velocity.  }