Can you make a simple Tic-Tac-Toe on OpenGL?

I’ve just finished tutorials from using glViewport, glBegin, glVertex2f, glEnd, Vertex Buffer Object, all the way up to GLSL shading language.

I’m wonder if I can build a simple and stupid Tic-Tac-Toe game on OpenGL. Thank you very much…

You absolutely can!

The simplest way would be to make a simple X and O texture (and maybe a texture for the grid, too, but it’s easy enough to draw with GL_LINES vertices, too).

Then you’ll want to make sure you’re drawing 2D stuff with the appropriate projection matrix, and then each frame, draw the grid, and whatever X and O fields have already been chosen.

“the appropriate projection matrix” is the hard part, but this is easy to learn about, and there are other tiny details to work out, but that’s the general idea.

SDL has to do this for its 2D rendering API; for older OpenGLs, it uses glOrtho, for OpenGL ES, it sets up the projection matrix itself.