fixes and improvements in Texture and RenderState