GLPOLYGONMODE(3G)
π GLPOLYGONMODE π
okay so bestie, welcome to glPolygonMode from section 3G of the manual β yes, that's the OpenGL one, and it is literally the main character of "how do we even draw this polygon, though?" Sit down, this one's fun. π
β¨ NAME β¨
glPolygonMode β pick a polygon rasterization mode. that's it, that's the vibe check. π¦
β¨ C SPECIFICATION β¨
void glPolygonMode(GLenum face, GLenum mode);
she takes two args and she takes them seriously. periodt. π
β¨ PARAMETERS β¨
faceβ which polygons themodeapplies to. and ngl, it must beGL_FRONT_AND_BACKfor front- and back-facing polygons. no other option, the whole face card or nothing. π«Άmodeβ how those polygons get rasterized. accepted values areGL_POINT,GL_LINE, andGL_FILL. the initial value isGL_FILLfor both front- and back-facing polygons, which is lowkey the sane default. β
β¨ DESCRIPTION β¨
so glPolygonMode controls the interpretation of polygons for rasterization. and face tells it which polygons mode applies to: both front and back-facing polygons (GL_FRONT_AND_BACK). π
key thing, bestie β the polygon mode affects only the final rasterization of polygons. specifically: a polygon's vertices are lit, and the polygon is clipped and possibly culled before these modes are applied. so like, the lighting and clipping pipeline already did its thing by the time this shows up. she's the last stop on the glow-up train. πβ¨
three modes are defined and can be specified in mode:
πΈ GL_POINT
polygon vertices that are marked as the start of a boundary edge are drawn as points. point attributes such as GL_POINT_SIZE and GL_POINT_SMOOTH control the rasterization of the points. and here's the gag: polygon rasterization attributes other than GL_POLYGON_MODE have no effect. π
πΈ GL_LINE
boundary edges of the polygon are drawn as line segments. line attributes such as GL_LINE_WIDTH and GL_LINE_SMOOTH control the rasterization of the lines. same deal here: polygon rasterization attributes other than GL_POLYGON_MODE have no effect. π
πΈ GL_FILL
the interior of the polygon is filled. polygon attributes such as GL_POLYGON_SMOOTH control the rasterization of the polygon. this is the full-send, filled-in, no-notes version. π₯
β¨ EXAMPLES β¨
want a surface with outlined polygons? iconic, wireframe era, call this:
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
go off. π
β¨ NOTES β¨
vertices are marked as boundary or nonboundary with an edge flag. edge flags are generated internally by the GL when it decomposes triangle stips and fans. (yes, "stips" β that's the original's spelling, not me being chaotic for once. π)
β¨ ERRORS β¨
GL_INVALID_ENUM is generated if either face or mode is not an accepted value. so like, don't just make stuff up. the GL will clock you. π
β¨ ASSOCIATED GETS β¨
glGet() with argument GL_POLYGON_MODE β that's how you check what mood she's in. π§
β¨ VERSION SUPPORT β¨
the table said glPolygonMode has a β in every single column, and the columns were every OpenGL version from 2.0 all the way through 4.5. so: 2.0 β, 2.1 β, 3.0 β, 3.1 β, 3.2 β, 3.3 β, 4.0 β, 4.1 β, 4.2 β, 4.3 β, 4.4 β, 4.5 β. twelve out of twelve, flawless attendance, never missed a day in her life. ππ
the row was labeled both "Function / Feature Name" β that's how the original table had it, and yes glPolygonMode was the one and only function name listed. π
β¨ SEE ALSO β¨
glLineWidth()glPointSize()
go read those next, they're the supporting cast and they ate. π
β¨ COPYRIGHT β¨
Copyright Β© 1991-2006 Silicon Graphics, Inc. Copyright Β© 2010-2014 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/.
β¨ COPYRIGHT β¨
(this one's the encore, don't skip it π«Ά)
Copyright Β© 1991-2006 Silicon Graphics, Inc. Copyright Β© 2010-2014 Khronos Group
okay that's the whole page, bestie β source line says [FIXME: source] (still a FIXME, we love an unfinished icon π) and it's dated 08/09/2021. mwah, go draw some wireframes. π
π
π¦ where this page comes from
- centos-stream 9: gl-manpages 1.1-24.20190306.el9 Β· MIT and Open Publication
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms