An apparatus for use in tracking an eye that is illuminated by infrared light having an infrared wavelength, the apparatus comprising: a waveguide that is transparent and includes an input-coupler and an output-coupler; the input-coupler comprising a stack of two or more electronically switchable diffractive gratings arranged parallel to one another; wherein each of the electronically switchable diffractive gratings has a respective lens power and a respective prismatic power; wherein the lens power of each of the electronically switchable diffractive gratings differ from one another such that each of the electronically switchable diffractive gratings has a different focal length; and wherein each of the electronically switchable diffractive gratings, when turned on, is adapted to receive infrared light having the infrared wavelength and couple the received infrared light into the waveguide, and further comprising: a sensor that images an eye in dependence on infrared light beams that exit the waveguide at the output-coupler; an input-coupler controller that controls when each of the electronically switchable diffractive gratings is turned on, such that only one of the electronically switchable diffractive gratings is turned on at a time; and an image analyzer that analyzes two or more images of an eye, obtained using the sensor, to determine which one of the electronically switchable diffractive gratings, when turned on, provides a best focused image of an eye or portion thereof; wherein the input-coupler controller causes the one of the electronically switchable diffractive gratings, which the image analysis module determines provides the best focused image of the eye, to be used for imaging the eye during eye tracking. a waveguide that is transparent and includes an input-coupler and an output-coupler; the input-coupler comprising a stack of two or more electronically switchable diffractive gratings arranged parallel to one another; wherein each of the electronically switchable diffractive gratings has a respective lens power and a respective prismatic power; wherein the lens power of each of the electronically switchable diffractive gratings differ from one another such that each of the electronically switchable diffractive gratings has a different focal length; and wherein each of the electronically switchable diffractive gratings, when turned on, is adapted to receive infrared light having the infrared wavelength and couple the received infrared light into the waveguide, and further comprising: a sensor that images an eye in dependence on infrared light beams that exit the waveguide at the output-coupler; an input-coupler controller that controls when each of the electronically switchable diffractive gratings is turned on, such that only one of the electronically switchable diffractive gratings is turned on at a time; and an image analyzer that analyzes two or more images of an eye, obtained using the sensor, to determine which one of the electronically switchable diffractive gratings, when turned on, provides a best focused image of an eye or portion thereof; wherein the input-coupler controller causes the one of the electronically switchable diffractive gratings, which the image analysis module determines provides the best focused image of the eye, to be used for imaging the eye during eye tracking. a sensor that images an eye in dependence on infrared light beams that exit the waveguide at the output-coupler; an input-coupler controller that controls when each of the electronically switchable diffractive gratings is turned on, such that only one of the electronically switchable diffractive gratings is turned on at a time; and an image analyzer that analyzes two or more images of an eye, obtained using the sensor, to determine which one of the electronically switchable diffractive gratings, when turned on, provides a best focused image of an eye or portion thereof; wherein the input-coupler controller causes the one of the electronically switchable diffractive gratings, which the image analysis module determines provides the best focused image of the eye, to be used for imaging the eye during eye tracking.