added getFrame function to texture to avoid rectangle allocations