vpGetLight(3)

πŸ’‘ vpGetLight β€” get lighting properties πŸ’‘

okay bestie, welcome to the vpGetLight(3) page, living in the Library Functions Manual section of your fave little graphics library πŸŽ€ she's the chill, read-only sibling of vpSetLight, and she's here to spill the tea on what your lights are actually doing.


✨ SYNOPSIS ✨

#include <volpack.h>

vpResult
vpGetLight(vpc, light_num, property, n0_ptr, n1_ptr, n2_ptr)
    vpContext *vpc;
    int light_num;
    int property;
    double *n0_ptr, *n1_ptr, *n2_ptr;

🫢 ARGUMENTS 🫢

  • vpc β€” your VolPack context, the one you got from vpCreateContext. the main character, honestly.
  • light_num β€” a constant that picks out one specific light source: VP_LIGHT0, VP_LIGHT1, ..., all the way up to VP_LIGHT5. yes bestie, six whole lights, we're rich πŸ’…
  • property β€” a constant naming one lighting property: either VP_COLOR or VP_DIRECTION. pick one, she's not doing combos.
  • n0_ptr, n1_ptr, n2_ptr β€” the spots where the result gets stashed: the components of an RGB color (when it's VP_COLOR) or a direction vector (when it's VP_DIRECTION). so like, three doubles, and you're passing pointers to where they live.

🌸 DESCRIPTION 🌸

vpGetLight is literally just here to get the properties of a light source. that's it. that's the job. iconic behavior.

the arguments are exactly analogous to vpSetLight β€” same shape, same vibes β€” except the last three arguments aren't values you're setting, they're pointers to locations for storing the lighting properties. so instead of handing her the tea, you're handing her an empty mug and she fills it. πŸ“


😭 ERRORS 😭

the normal return value is VP_OK. like, that's the dream. but these error return values are possible, and we must respect them:

  • VPERROR_LIMIT_EXCEEDED β€” the light number is invalid, or it exceeds an implementation limit. you asked for a light that does not exist, bestie. πŸ™ˆ
  • VPERROR_BAD_OPTION β€” the property argument is invalid. not a real property, no cap.
lowkey always check your return value. she's not gonna text you back about it. πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, periodt. this lil gem comes to you courtesy of VolPack β€” go get your lighting info, bestie, and may all your return values be VP_OK. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from