We present a novel technique for producing a doughnut laser beam by use of a liquid-crystal cell. It is demonstrated that the liquid-crystal cell exhibits an efficiency in energy conversion near 100%. One of the main advantages of this method is its capability of dynamic switching between a Gaussian mode and a doughnut mode of different topological charges. The liquid-crystal cell is also dynamically tunable over the visible and near-infrared wavelength range. These advantages make the device appealing for laser trapping methods used in single-molecule biomechanics and for optical guiding of cold atoms.