fixed compatibility errors and added texture class in preparation for texture cache