Relative Content

Tag Archive for copenglglut

Displaying text in OpenGL (2024 update wanted)

I am trying hard to get text to display in OpenGL in any way, shape, or form. To start from something very simple, I grabbed this example from GeeksForGeeks. It runs, it displays a green circle. Then I went researching around and found several text drawing examples including the first answer here. The simple ones seem to converge on one strategy, which I implemented on lines 40-42. Unfortunately, no letter A appears.

glutBitmapCharacter worked in older version but no longer

I am reviving some legacy OpenGL code from 2004. Somewhere along the way, the display of lettering quit working. glutBitmapCharacter does not work, it fails silently and nothing appears. Obviously something has subtly shifted in the libraries in 20 years. Code using BeginDataStrip / EndDataStrip displays as it always has, but anything involving glutBitmapCharacter is invisible.