//deprectated in opengl 3.0 -will always create mipmaps automatically if lvl 0 changes
// gl.glTexParameteri( textureTarget, GL.GL_GENERATE_MIPMAP, GL.GL_TRUE );
if (this.forcedRectMipMaps){
//Resizes NPOT textures to POT
GLU glu = ((PGraphicsOpenGL)this.parent.g).glu;
glu.gluBuild2DMipmaps(textureTarget, internalFormat, this.width, this.height, glFormat, type, buffer);
}else{
if (this.fboSupported){ //Naive check if glGenerateMipmapEXT command is supported
gl.glTexSubImage2D(textureTarget, 0, 0, 0, this.width, this.height, glFormat, type, buffer);
gl.glGenerateMipmapEXT(textureTarget); //newer OpenGL 3.x method of creating mip maps //TODO problems on ATI? use gl.glEnable(textureTarget) first?
}else{