GLUTDEVICEGET(3)

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

πŸ’– glutDeviceGet β€” the manual page, but make it cute πŸ’–

okay bestie, welcome to glutDeviceGet from the OpenGLUT manual (section 3, the inputstate corner of the library 🫢). This is the girl who tells you what your devices are doing. Let's get into it ✨


🌈 LIBRARY 🌈

OpenGLUT β€” specifically the inputstate part of it. she lives there πŸ’…


✨ SYNOPSIS ✨

#include <openglut.h>

int
glutDeviceGet(GLenum eWhat);

like, one function, one arg, so simple, iconic behavior honestly πŸ‘‘


πŸŽ€ PARAMETERS πŸŽ€

  • eWhat β€” the enumerated parameter ID. basically you're telling her which device question you want answered. pick your fighter 🎯

πŸ’… DESCRIPTION πŸ’…

So the vibe is: you call her, she goes and fetches system-specific info about the devices attached to your machine. She's nosy in the best way. Here are all the device queries she supports, no cap, all of them:

  • GLUT_HAS_JOYSTICK β€” returns non-zero if there's a joystick. πŸ•ΉοΈ
  • GLUT_HAS_KEYBOARD β€” returns non-zero if there's a keyboard. ⌨️
  • GLUT_HAS_MOUSE β€” returns non-zero if there's a mouse. 🐭
  • GLUT_HAS_SPACEBALL β€” returns non-zero if there's a spaceball. πŸͺ
  • GLUT_JOYSTICK_AXES β€” returns the number of axes the joystick has.
  • GLUT_JOYSTICK_POLL_RATE β€” returns the rate (in GLUT timer ticks?) at which the joystick is polled. yes bestie, the question mark is in the original, she's unsure too 😭
  • GLUT_NUM_MOUSE_BUTTONS β€” returns how many buttons the user's mouse has. click click click πŸ–±οΈ
  • GLUT_OWNS_JOYSTICK β€” returns non-zero if OpenGLUT believes it has successfully acquired access to the joystick. manifesting that ownership fr fr ✨
  • GLUT_DEVICE_IGNORE_KEY_REPEAT β€” returns non-zero if the current window is set to disable key repeating.
  • GLUT_DEVICE_KEY_REPEAT β€” described as returning the key repeat rate in one place, but actually returns a key repeat mode. the way she lied a little πŸ™ˆ
  • GLUT_HAS_DIAL_AND_BUTTON_BOX β€” returns non-zero if a dials-and-buttons box is present.
  • GLUT_HAS_TABLET β€” returns non-zero if a tablet is present. ✍️
  • GLUT_NUM_BUTTON_BOX_BUTTONS β€” returns the number of buttons on a dials-and-buttons box, if any.
  • GLUT_NUM_DIALS β€” returns the number of dials on a dials-and-buttons box, if any.
  • GLUT_NUM_SPACEBALL_BUTTONS β€” returns the number of buttons on a spaceball, if any.
  • GLUT_NUM_TABLET_BUTTONS β€” returns the number of buttons on a tablet, if any.

🌸 TODO 🌸

stuff she knows she needs to work on, and honestly, growth πŸ’œ

  • Only supports querying for one joystick. one. singular. monogamous joystick energy.
  • Consider moving to a table-based approach rather than a switch(), letting us move to modular functions. glow-up pending ✨

πŸ’€ BUGS πŸ’€

okay girlies, sit down, this is the part where we're honest:

  • Keyboards are optional, but OpenGLUT doesn't detect their absence. she just assumes. bold of her.
  • Mice are optional, but OpenGLUT is only able to check for them under WIN32.
  • Mice can have a varying number of buttons, but OpenGLUT assumes exactly 3 on UNIX_X11. exactly three. no more, no less, apparently. 😭
  • Not all joystick queries are implemented yet. WIP, we love a WIP 🚧
  • GLUT_DEVICE_KEY_REPEAT returns the key repeat mode, but the comment says it returns the rate. the comment is lying bestie, iykyk πŸ™ˆ
  • Some things, like joystick poll rates, seem to have insufficient context. Which joystick? Which window? Maybe we assume the current window and the current joystick (or the first one)? she's asking the real questions πŸ€”
  • GLUT_DEVICE_KEY_REPEAT should probably return ogState.KeyRepeat. just saying. put it on the vision board πŸ“

πŸ¦‹ SEE ALSO πŸ¦‹


k bye bestie, that's the whole page πŸ’– this one came out UNDATED and honestly the title field is just UNTITLED() β€” she's mysterious like that πŸŽ€ go forth and query your devices, you ate πŸ’…βœ¨