switched texture to shared_ptr
fixed window to not use raw pointer