GLCOPYTEXIMAGE1D(3G)
π GLCOPYTEXIMAGE1D π
okay bestie so this one lives in the 3G manual section and it's literally called glCopyTexImage1D β iconic name, iconic job. Let's get into it π«Ά
β¨ NAME β¨
glCopyTexImage1D β copy pixels into a 1D texture image. that's it, that's the whole vibe π
πΈ C SPECIFICATION πΈ
void glCopyTexImage1D(GLenum target, GLint level, GLenum internalformat,
GLint x, GLint y, GLsizei width, GLint border);
like, look at that signature. seven whole arguments. she's high-maintenance and she's worth it β¨
π PARAMETERS π
targetβ which texture you're aiming at. must beGL_TEXTURE_1D. no cap, that's the only one allowed.levelβ the level-of-detail number, aka which mipmap floor you're on. level0is the base image level, and level n is the *n*th mipmap reduction image. it's giving elevator floors but make it graphics πinternalformatβ what the texture is made of internally. must be one of these symbolic constants, and yes i'm listing every single one because we don't do half-measures here:
GL_COMPRESSED_RED, GL_COMPRESSED_RG, GL_COMPRESSED_RGB, GL_COMPRESSED_RGBA, GL_COMPRESSED_SRGB, GL_COMPRESSED_SRGB_ALPHA, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT32, GL_STENCIL_INDEX8, GL_RED, GL_RG, GL_RGB, GL_R3_G3_B2, GL_RGB4, GL_RGB5, GL_RGB8, GL_RGB10, GL_RGB12, GL_RGB16, GL_RGBA, GL_RGBA2, GL_RGBA4, GL_RGB5_A1, GL_RGBA8, GL_RGB10_A2, GL_RGBA12, GL_RGBA16, GL_SRGB, GL_SRGB8, GL_SRGB_ALPHA, GL_SRGB8_ALPHA8.
x,yβ the window coordinates of the left corner of the row of pixels you're copying. left corner, bestie. remember that π¦widthβ how wide the texture image is. and the height? it's1. always1. one-dimensional, babe, that's the whole point πborderβ must be0. that's not a suggestion, that's the rule π
π¦ DESCRIPTION π¦
glCopyTexImage1D defines a one-dimensional texture image, and the pixels come straight from the current GL_READ_BUFFER. like she's shopping directly out of the read buffer, no middleman π
the screen-aligned pixel row with its left corner at x y and a length of width is what defines the texture array at the mipmap level specified by level. and internalformat says what the internal format of that texture array is. simple as.
the pixels in that row get processed exactly as if glReadPixels() had been called β but the process stops just before final conversion. at that point, every pixel component value is clamped to the range 0 1 and then converted to the texture's internal format so it can be stored in the texel array. it's giving "almost done, one more step" energy β¨
pixel ordering goes like this: lower x screen coordinates correspond to lower texture coordinates. so like, left is left. slay.
β οΈ okay listen: if any of the pixels within the specified row of the current GL_READ_BUFFER are outside the window associated with the current rendering context, then the values you get for those pixels are undefined. not "probably fine", not "close enough" β undefined. do not test her π
glCopyTexImage1D defines a one-dimensional texture image with pixels from the current GL_READ_BUFFER. (yes she says it twice. she's thorough. let her live.)
when internalformat is one of the sRGB types, the GL does not automatically convert the source pixels to the sRGB color space. in that case, the glPixelMap function can be used to accomplish the conversion. so like, do it yourself bestie, she's not doing it for you π
π NOTES π
1,2,3, and4are not accepted values for internalformat. nope. not a thing. don't try it.- an image with
0width indicates aNULLtexture. zero width, zero texture, zero drama. GL_STENCIL_INDEX8is accepted for internalformat only if the GL version is4.4or higher. check your version first, i'm begging π«Ά
π₯ ERRORS π₯
like, the ways she can say no:
GL_INVALID_ENUMis generated if target is not one of the allowable values.GL_INVALID_VALUEis generated if level is less than0.GL_INVALID_VALUEmay be generated if level is greater thanlog 2 max, where max is the returned value ofGL_MAX_TEXTURE_SIZE.GL_INVALID_VALUEis generated if internalformat is not an allowable value.GL_INVALID_VALUEis generated if width is less than0or greater thanGL_MAX_TEXTURE_SIZE.GL_INVALID_VALUEis generated if border is not0.GL_INVALID_OPERATIONis generated if internalformat isGL_DEPTH_COMPONENT,GL_DEPTH_COMPONENT16,GL_DEPTH_COMPONENT24, orGL_DEPTH_COMPONENT32and there is no depth buffer. no depth buffer, no depth component, that's the deal π
β ASSOCIATED GETS β
glGetTexImage()
that's the one. that's the list. she's lowkey minimal here π
π VERSION SUPPORT π
the original had a whole big table, so here's the tea in a form that won't break your terminal: glCopyTexImage1D is supported in every single OpenGL version listed, β across the board. the columns were 2.0, 2.1, 3.0, 3.1, 3.2, 3.3, 4.0, 4.1, 4.2, 4.3, 4.4, 4.5 β and the function row? checkmarked in all twelve. she ate and left no crumbs π₯
(the table's row label was Function / Feature Name, and our function is glCopyTexImage1D. full transparency, bestie π)
π§ SEE ALSO π§
glCopyTexImage2D()glCopyTexSubImage1D()glCopyTexSubImage2D()glPixelStore()glTexImage1D()glTexImage2D()glTexSubImage1D()glTexSubImage2D()glTexParameter()
the whole friend group, honestly π«Ά
π COPYRIGHT π
Copyright Β© 1991-2006 Silicon Graphics, Inc. Copyright Β© 2012-2014 Khronos Group. This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB/.
π COPYRIGHT (again, yes really) π
Copyright Β© 2012-2014 Khronos Group
and that's the page, bestie β¨ sign-off time: the source line up top was literally [FIXME: source] (yes, an actual FIXME, we love a placeholder moment π) and this whole thing was dated 08/09/2021. catch you on the next manpage ππ¦π
π¦ 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