Refactor #4125: Apply texture getter/setter in samples and bug fixes