public void initTextures(DrawContext dc) {

		if (isLoading())
			return;

		GL2 gl = dc.getGL().getGL2();
		textures = new HashMap<String, Texture>();
		try {
			display.initialize(gl);
		}
		catch (InitializationException e) {
			e.printStackTrace();
		}

		for (String key : bimages.keySet()) {
			Texture tex = null;
			try {
				tex = TextureIO.newTexture(bimages.get(key), false);
				tex.bind();
			}
			catch (GLException e) {
				e.printStackTrace();
			}
			catch (IOException e) {
				e.printStackTrace();
			}

			textures.put(key, tex);
		}
		
		if(bimages.size() > 0){
			Texture tex;
			try {
				tex = TextureIO.newTexture(bimages.get(bimages.keySet().iterator().next()), true);
				tex.bind();
			}
			catch (GLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}

			bimages.clear();
		}
		
		gl.glTexEnvf(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_MODULATE);
		gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR_MIPMAP_LINEAR);
		gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
		gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL.GL_CLAMP_TO_EDGE);
		gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, GL.GL_CLAMP_TO_EDGE);

		int[] maxAnisotropy = new int[1];
		gl.glGetIntegerv(GL.GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, maxAnisotropy, 0);
		gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAX_ANISOTROPY_EXT, maxAnisotropy[0]);

	}