GLPOLYGONSTIPPLE(3G)

πŸ“¦ version 1.1, in centos-stream 9, fedora 43, fedora 44

πŸ’– NAME πŸ’–

glPolygonStipple β€” bestie, this one sets the polygon stippling pattern ✨


πŸŽ€ C SPECIFICATION πŸŽ€

void glPolygonStipple( const GLubyte *mask )

🌸 PARAMETERS 🌸

  • mask β€” a pointer to a 32Γ—32 stipple pattern, and it gets unpacked out of memory exactly the same way glDrawPixels unpacks pixels. no cap.

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so. Polygon stippling is literally the polygon version of line stippling (peep glLineStipple for that one πŸ’…). What it does is mask out certain fragments that rasterization produces, so you get a pattern instead of a solid fill. And the way it works is independent of polygon antialiasing β€” they don't talk to each other, periodt.

So mask is a pointer to a 32Γ—32 stipple pattern, and it sits in memory just like the pixel data you'd hand to a glDrawPixels call where height and width are both equal to 32, the pixel is GL_COLOR_INDEX, and the data type is GL_BITMAP. Basically: the stipple pattern is a 32Γ—32 array of 1-bit color indices, packed into unsigned bytes. 🫢

And the glPixelStore parameters β€” things like GL_UNPACK_SWAP_BYTES and GL_UNPACK_LSB_FIRST β€” those absolutely affect how the bits get assembled into a stipple pattern. But listen: pixel transfer operations (shift, offset, pixel map) are NOT applied to the stipple image. nope. not happening. πŸ™ˆ

To turn polygon stippling on and off, you call glEnable and glDisable with the argument GL_POLYGON_STIPPLE. Out of the gate, polygon stippling is initially disabled. Now if it is enabled, here's the vibe check: a rasterized polygon fragment with window coordinates xw and yw gets sent to the next stage of the GL if and only if the (xw mod 32)th bit in the (yw mod 32)th row of the stipple pattern is 1 (one). And when polygon stippling is disabled? It's as if the stipple pattern is all 1's. iconic behavior honestly. πŸ‘‘


πŸ’€ ERRORS πŸ’€

  • GL_INVALID_OPERATION is generated if glPolygonStipple is executed between the execution of glBegin and the corresponding execution of glEnd. like, do not do that. 🚫

πŸ”₯ ASSOCIATED GETS πŸ”₯

  • glGetPolygonStipple
  • glIsEnabled with argument GL_POLYGON_STIPPLE

⭐ SEE ALSO ⭐

glDrawPixels(3G), glLineStipple(3G), glPixelStore(3G), glPixelTransfer(3G)


okay that's the whole page, bestie πŸ’– this came straight out of the GLPOLYGONSTIPPLE(3G) manual page, 3G energy and all β€” so if you ever forget the pattern bits, you know exactly where to find your girl. mwah. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from