GLUTBITMAPCHARACTER(3)

πŸ“¦
version 3.8.0 Β· 2 versions
, in centos-stream 10, centos-stream 9, fedora 43, fedora 44, opensuse-leap 16.0

πŸ’– GLUTBITMAPCHARACTER(3) πŸ’–

okay so bestie, welcome to the glutBitmapCharacter page from the OpenGLUT manual β€” specifically the bitmapfont corner of the library. pull up a chair, grab a boba, we're drawing letters ✨


πŸŽ€ NAME πŸŽ€

glutBitmapCharacter β€” draw a bitmapped character. that's it. that's the whole job. she draws ONE character. one. a single lil glyph. πŸ’…


πŸ“š LIBRARY πŸ“š

OpenGLUT β€” the bitmapfont section, no cap.


✨ SYNOPSIS ✨

#include <openglut.h>

void
glutBitmapCharacter(void *font, int character);

like. look at her. two args. she's not complicated, she's just efficient. πŸ‘‘


🫢 PARAMETERS 🫢

  • font β€” a bitmapped font identifier. the vibe check of which font you're repping. πŸ¦‹
  • character β€” a character code. the actual glyph you want her to draw, as an int. πŸ“

🌸 DESCRIPTION 🌸

so here's the tea: glutBitmapCharacter draws a character at the current OpenGL raster position, using a bitmapped font. that's the whole move. slay.

and then β€” because she's a considerate queen β€” the raster position gets advanced by the width of the character. so if you call her again, you'll draw the next char right after. it's giving "typewriter energy" fr fr. πŸŽ€

now. the important part. the listen to me bestie part. literally nothing is drawn, and the raster position is left completely unaffected, when ANY of these three things happen:

  • character is out of range
  • font is not a valid OpenGLUT bitmap font
  • The current OpenGL raster position is invalid

so if you're staring at a blank screen wondering where your gorgeous little letter went... check those three. one of them ate your character. πŸ’€


⚠️ CAVEATS ⚠️

glutBitmapString() is generally more efficient for strings of characters. so if you're out here calling glutBitmapCharacter in a loop for a whole sentence, bestie... there's a better way. no cap. use the string one. 🫢


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the page!! periodt πŸ’…βœ¨

cute lil sign-off moment: this page is dated UNDATED, and the footer reads UNTITLED() β€” iconic honestly, she didn't even name herself, main character energy πŸŒˆπŸ’– go draw some letters bestie πŸ¦‹