GLUTSETCURSOR(3)

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

πŸ’– GLUTSETCURSOR(3) πŸ’–

okay bestie, so this is a page from the OpenGLUT manual β€” section 3, the library-call girlies β€” and it's all about the window side of things. it's called glutSetCursor, and honestly? it's giving "make the mouse pointer cute" energy. let's get into it πŸ¦‹


✨ NAME ✨

glutSetCursor β€” sets the cursor image that the current window is gonna be using, periodt.


πŸ“š LIBRARY πŸ“š

OpenGLUT β€” the window department, no cap.


🌸 SYNOPSIS 🌸

#include <openglut.h>

void
glutSetCursor(int cursorID);

like, that's the whole thing. one function, one argument, zero drama ✨


πŸŽ€ PARAMETERS πŸŽ€

  • cursorID β€” the name of the cursor you want, bestie. that's it, that's the tea.

πŸ’… DESCRIPTION πŸ’…

so for the current window, this bad boy sets the mouse-cursor to one of a bunch of predefined images. iconic behaviour, honestly.

the GLUT symbolic constant IDs you can pass in are these cuties:

  • GLUT_CURSOR_RIGHT_ARROW
  • GLUT_CURSOR_LEFT_ARROW
  • GLUT_CURSOR_INFO
  • GLUT_CURSOR_DESTROY
  • GLUT_CURSOR_HELP
  • GLUT_CURSOR_CYCLE
  • GLUT_CURSOR_SPRAY
  • GLUT_CURSOR_WAIT
  • GLUT_CURSOR_TEXT
  • GLUT_CURSOR_CROSSHAIR
  • GLUT_CURSOR_UP_DOWN
  • GLUT_CURSOR_LEFT_RIGHT
  • GLUT_CURSOR_TOP_SIDE
  • GLUT_CURSOR_BOTTOM_SIDE
  • GLUT_CURSOR_LEFT_SIDE
  • GLUT_CURSOR_RIGHT_SIDE
  • GLUT_CURSOR_TOP_LEFT_CORNER
  • GLUT_CURSOR_TOP_RIGHT_CORNER
  • GLUT_CURSOR_BOTTOM_RIGHT_CORNER
  • GLUT_CURSOR_BOTTOM_LEFT_CORNER

and then, on top of all of those, there are these three special cases that lowkey do their own thing:

  • GLUT_CURSOR_FULL_CROSSHAIR β€” where it's supported, this cursor draws a crosshair the full width and height of the display. so like, a whole vibe. but heads up: OpenGLUT may map it to GLUT_CURSOR_CROSSHAIR anyway. πŸ™ˆ
  • GLUT_CURSOR_NONE β€” turns the mouse cursor invisibile. poof, gone, she's not there.
  • GLUT_CURSOR_INHERIT β€” takes whatever cursor the parent window is providing. passing the aux cord, basically. 🎧

⚠️ CAVEATS ⚠️

okay so here's where we get real, bestie, because there are some things you need to know:

  • the X branch of OpenGLUT does not do thorough error checking. it's not doing a vibe check on your input, fr fr. 😭
  • the X branch of OpenGLUT always converts FULL_CROSSHAIR to CROSSHAIR. that's acceptable and all, but if a host system supports a fullscreen crosshair, it would be nice to support that. manifesting it for her ✨
  • out of range cursorID values generate warnings. so if you pass something cursed, she will say something. πŸ’€
  • it has no visible effect if the current window is of type GLUT_OFFSCREEN. like, nothing. zero. the cursor update is not coming to the function. 🫠

πŸ› BUGS πŸ›

some cursorID values are not yet supported on WIN32. not everything has been invited to that party yet, ngl.


🫢 cute little sign-off 🫢

this page is UNDATED, and the source/version line just says UNTITLED() β€” mysterious, undefined, a little enigmatic, main character energy honestly. anyway bestie, go set some cursors, you're gonna slay πŸ’–βœ¨πŸŽ€