I think you means this :) 

int w = gstate.getTextureWidth(level);
int h = gstate.getTextureHeight(level);