GLNORMALPOINTER(3G)
π GLNORMALPOINTER(3G) π
okay bestie, welcome to the glNormalPointer page from the 3G manual section β yes it's the OpenGL girlies' corner of the docs and we're gonna get you fluent in normals, no cap β¨
β¨ NAME β¨
glNormalPointer β define an array of normals πΈ (yes that's the whole job, she's focused, she's serving)
π C SPECIFICATION π
void glNormalPointer( GLenum type,
GLsizei stride,
const GLvoid *ptr )
three args, that's it, she's low maintenance π
π¦ PARAMETERS π¦
typeβ the data type of each coordinate in the array. The accepted symbolic constants areGL_BYTE,GL_SHORT,GL_INT,GL_FLOAT, andGL_DOUBLE. The initial value isGL_FLOAT.strideβ the byte offset between consecutive normals. Ifstrideis0β which is the initial value β the normals are understood to be tightly packed in the array. The initial value is0.ptrβ a pointer to the first coordinate of the first normal in the array. The initial value is0.
π DESCRIPTION π
so basically glNormalPointer specifies the location and data of an array of normals to use when rendering. type specifies the data type of the normal coordinates, and stride gives the byte stride from one normal to the next β which is the whole reason you can pack vertices and attributes into a single array, or keep them in separate arrays. (heads up: single-array storage may be more efficient on some implementations; see glInterleavedArrays.) And when a normal array is specified, type, stride, and ptr get saved as client-side state. periodt π
To enable and disable the normal array, you call glEnableClientState and glDisableClientState with the argument GL_NORMAL_ARRAY. If it's enabled, the normal array gets used when glDrawArrays, glDrawElements, or glArrayElement is called. π
Use glDrawArrays to construct a sequence of primitives (all of the same type) from prespecified vertex and vertex attribute arrays. Use glArrayElement to specify primitives by indexing vertices and vertex attributes, and glDrawElements to construct a sequence of primitives by indexing vertices and vertex attributes. three different girlies, three different strategies, all iconic π«Ά
β NOTES β
glNormalPointeris available only if the GL version is1.1or greater. so if you're on something older... not me being the bearer of bad news π- The normal array is initially disabled and isn't accessed when
glArrayElement,glDrawElements, orglDrawArraysis called. - > bestie listen. Execution of
glNormalPointeris not allowed betweenglBeginand the correspondingglEnd, but an error may or may not be generated. If an error is not generated, the operation is undefined. that's the scary kind of undefined, not the fun kind π glNormalPointeris typically implemented on the client side.- Since the normal array parameters are client-side state, they are not saved or restored by
glPushAttribandglPopAttrib. UseglPushClientAttribandglPopClientAttribinstead. wrong function, wrong energy, we don't do that here π
π ERRORS π
GL_INVALID_ENUMis generated iftypeis not an accepted value.GL_INVALID_VALUEis generated ifstrideis negative.
(negative stride? in this economy? no ma'am. it's giving invalid value fr fr)
π₯ ASSOCIATED GETS π₯
glIsEnabledwith argumentGL_NORMAL_ARRAYglGetwith argumentGL_NORMAL_ARRAY_TYPEglGetwith argumentGL_NORMAL_ARRAY_STRIDEglGetPointervwith argumentGL_NORMAL_ARRAY_POINTER
the receipts, the proof, the vibe check πΈ
π SEE ALSO π
glArrayElement(3G), glColorPointer(3G), glDrawArrays(3G), glDrawElements(3G), glEdgeFlagPointer(3G), glEnable(3G), glGetPointerv(3G), glIndexPointer(3G), glInterleavedArrays(3G), glPopClientAttrib(3G), glPushClientAttrib(3G), glTexCoordPointer(3G), glVertexPointer(3G)
the whole pointer friend group, all linked, all slaying π§π
and that's the page!! this is the GLNORMALPOINTER(3G) entry, straight out of the 3G manual β it's the one with no date on it, just the title chillin' at the bottom, so consider this your official sign-off: GLNORMALPOINTER(3G), and yes, she ate π
β¨π
π¦ where this page comes from
- opensuse-leap 16.0: Mesa-libGL-devel 24.1.7-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- opensuse-leap 16.0: Mesa-libGL-devel 24.3.3-160000.3.1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms