Use int for texture size, otherwise it'd never equal to the actual texture size. 

Doesn't fix #2215, but it does fix an issue where textures are lost if the returned w or h is not a integer because the texture size is an int.