GLTEXSTORAGE1D(3G)

    .SH "NAME" glTexStorage1D, glTextureStorage1D - simultaneously specify storage for all levels of a one-dimensional texture
    .SH "C SPECIFICATION"

            .HP u void glTexStorage1D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
            .HP u void glTextureStorage1D(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width);

    .SH "PARAMETERS"

        .PP target

                    Specifies the target to which the texture object is bound for glTexStorage1D. Must be one of GL_TEXTURE_1D or GL_PROXY_TEXTURE_1D.

            .RE
            .PP texture

                        Specifies the texture object name for glTextureStorage1D. The effective target of texture must be one of the valid non-proxy target values above.

                .RE
                .PP levels

                            Specify the number of texture levels.

                    .RE
                    .PP internalformat

                                Specifies the sized internal format to be used to store texture image data.

                        .RE
                        .PP width

                                    Specifies the width of the texture, in texels.

                            .RE

                        .SH "DESCRIPTION"
                            .PP glTexStorage1D and glTextureStorage1D specify the storage requirements for all levels of a one-dimensional texture simultaneously. Once a texture is specified with this command, the format and dimensions of all levels become immutable unless it is a proxy texture. The contents of the image may still be modified, however, its storage requirements may not change. Such a texture is referred to as an immutable-format texture.
                            .PP Calling glTexStorage1D is equivalent, assuming no errors are generated, to executing the following pseudo-code:

                            for (i = 0; i < levels; i++) {
                                glTexImage1D(target, i, internalformat, width, 0, format, type, NULL);
                                width = max(1, (width / 2));
                            }

                            .PP Calling glTextureStorage1D is equivalent to the above pseudo-code, where target is the effective target of texture and it is as if texture were bound to target for the purposes of glTexImage1D.
                            .PP Since no texture data is actually provided, the values used in the pseudo-code for format and type are irrelevant and may be considered to be any values that are legal for the chosen internalformat enumerant. internalformat must be one of the sized internal formats given in Table 1 below, one of the sized depth-component formats GL_DEPTH_COMPONENT32F, GL_DEPTH_COMPONENT24, or GL_DEPTH_COMPONENT16, one of the combined depth-stencil formats, GL_DEPTH32F_STENCIL8, or GL_DEPTH24_STENCIL8, or the stencil-only format, GL_STENCIL_INDEX8. Upon success, the value of GL_TEXTURE_IMMUTABLE_FORMAT becomes GL_TRUE. The value of GL_TEXTURE_IMMUTABLE_FORMAT may be discovered by calling glGetTexParameter() with pname set to GL_TEXTURE_IMMUTABLE_FORMAT. No further changes to the dimensions or format of the texture object may be made. Using any command that might alter the dimensions or format of the texture object (such as glTexImage1D() or another call to glTexStorage1D) will result in the generation of a GL_INVALID_OPERATION error, even if it would not, in fact, alter the dimensions or format of the object.
                            .PP <xi:include></xi:include>

                        .SH "NOTES"
                            .PP GL_STENCIL_INDEX8 is accepted for internalformat only if the GL version is 4.4 or higher.

                        .SH "ERRORS"
                            .PP GL_INVALID_OPERATION is generated by glTexStorage1D if zero is bound to target.
                            .PP GL_INVALID_OPERATION is generated by glTextureStorage1D if texture is not the name of an existing texture object.
                            .PP GL_INVALID_ENUM is generated if internalformat is not a valid sized internal format.
                            .PP GL_INVALID_ENUM is generated if target or the effective target of texture is not one of the accepted targets described above.
                            .PP GL_INVALID_VALUE is generated if width or levels are less than 1.
                            .PP GL_INVALID_OPERATION is generated if levels is greater than log 2 width + 1.

                        .SH "VERSION SUPPORT"
                            .TS allbox tab(:); l l l l l l l l l l l l l l l l l l l l l l l l l l. T{ glTexStorage1D T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T} T{ glTextureStorage1D T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}:T{ T}

                        .SH "SEE ALSO"
                            .PP glTexImage1D(), glTexStorage2D(), glTexStorage3D().

                        .SH "COPYRIGHT"
                            .PP Copyright © 2011-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

COPYRIGHT
Copyright © 2011-2014 Khronos Group