Added viewport resizing and some fixes for textures