Originally, in the period around 2040 and before, when television was still a common form of media entertainment; videogames were shown in 2D on TV or computer screens. However, as holographic technology progressed, videogames were more commonly in 3D.
In the 2270s, there were games in the recreation room of the USS Enterprise, some of which appeared to be videogames. Matt Decker showed some of these games to the probe that was a duplicate of his deceased girlfriend Ilia. (Star Trek: The Motion Picture)
In 2285, there was a small arcade inside the San Francisco bar that had a holographic videogame that involved aviation warfare. The players got to control airplanes with joysticks that allowed them to fly around and shoot at each other. (Star Trek III: The Search for Spock)
In 2286, when Spock was taking a memory test on Vulcan, he played a videogame of Chess on what appeared to be a spherical chess board. He also solved a number of puzzles. (Star Trek IV: The Voyage Home)