<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
<!-- saved from url=(0013)about:internet -->
<?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="stylesheet" type="text/css" href="opengl-man.css" /><title>glTexBufferRange - OpenGL 4 Reference Pages</title><meta name="generator" content="DocBook XSL Stylesheets V1.69.1" /></head><body><div class="refentry" lang="en" xml:lang="en"><a id="glTexBufferRange"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glTexBufferRange — bind a range of a buffer's data store to a buffer texture</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0"><tr><td><code class="funcdef">void <b class="fsfunc">glTexBufferRange</b>(</code></td><td>GLenum  </td><td><var class="pdparam">target</var>, </td></tr><tr><td> </td><td>GLenum  </td><td><var class="pdparam">internalFormat</var>, </td></tr><tr><td> </td><td>GLuint  </td><td><var class="pdparam">buffer</var>, </td></tr><tr><td> </td><td>GLintptr  </td><td><var class="pdparam">offset</var>, </td></tr><tr><td> </td><td>GLsizeiptr  </td><td><var class="pdparam">size</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>target</code></em></span></dt><dd><p>
                    Specifies the target of the operation and must be <code class="constant">GL_TEXTURE_BUFFER</code>.
                </p></dd><dt><span class="term"><em class="parameter"><code>internalFormat</code></em></span></dt><dd><p>
                    Specifies the internal format of the data in the store belonging to <em class="parameter"><code>buffer</code></em>.
                </p></dd><dt><span class="term"><em class="parameter"><code>buffer</code></em></span></dt><dd><p>
                    Specifies the name of the buffer object whose storage to attach to the active buffer texture.
                </p></dd><dt><span class="term"><em class="parameter"><code>offset</code></em></span></dt><dd><p>
                    Specifies the offset of the start of the range of the buffer's data store to attach.
                </p></dd><dt><span class="term"><em class="parameter"><code>size</code></em></span></dt><dd><p>
                    Specifies the size of the range of the buffer's data store to attach.
                </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
            <code class="function">glTexBufferRange</code> attaches the a range of the data store of the buffer object named <em class="parameter"><code>buffer</code></em> to the active
            buffer texture, and specifies the internal format for the texel array found in the attached buffer object. If <em class="parameter"><code>buffer</code></em>
            is zero, any buffer object attached to the buffer texture is detached and no new buffer object is attached. If <em class="parameter"><code>buffer</code></em>
            is non-zero, it must be the name of an existing buffer object. <em class="parameter"><code>target</code></em> must be <code class="constant">GL_TEXTURE_BUFFER</code>.
            The start of the range is specified by <em class="parameter"><code>offset</code></em> and the size of the range is specified by <em class="parameter"><code>size</code></em>,
            both measured in basic machine units. <em class="parameter"><code>offset</code></em> must be greater than or equal to zero, <em class="parameter"><code>size</code></em> must be greater
            than zero, and the sum of <em class="parameter"><code>offset</code></em> and <em class="parameter"><code>size</code></em> not exceed the value
            of <code class="constant">GL_BUFFER_SIZE</code> for <em class="parameter"><code>buffer</code></em>. Furthermore, <em class="parameter"><code>offset</code></em> must be
            an integer multiple of the value of <code class="constant">GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT</code>.
            <em class="parameter"><code>internalformat</code></em> specifies the storage format, and must be one of the following sized internal formats:
        </p><div class="informaltable"><table border="1"><colgroup><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /><col align="left" /></colgroup><thead><tr><th rowspan="2" align="center"> </th><th rowspan="2" align="center"> </th><th rowspan="2" align="center"> </th><th rowspan="2" align="center"> </th><th colspan="4" align="left"><span class="bold"><strong>
                        Component
                        </strong></span></th></tr></thead><tbody><tr><td align="left"><span class="bold"><strong>Sized Internal Format</strong></span></td><td align="left"><span class="bold"><strong>Base Type</strong></span></td><td align="left"><span class="bold"><strong>Components</strong></span></td><td align="left"><span class="bold"><strong>Norm</strong></span></td><td align="center">0</td><td align="center">1</td><td align="center">2</td><td align="center">3</td></tr><tr><td align="left"><code class="constant">GL_R8</code></td><td align="left">ubyte</td><td align="left">1</td><td align="left">YES</td><td align="center">R</td><td align="center">0</td><td align="center">0</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_R16</code></td><td align="left">ushort</td><td align="left">1</td><td align="left">YES</td><td align="center">R</td><td align="center">0</td><td align="center">0</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_R16F</code></td><td align="left">half</td><td align="left">1</td><td align="left">NO</td><td align="center">R</td><td align="center">0</td><td align="center">0</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_R32F</code></td><td align="left">float</td><td align="left">1</td><td align="left">NO</td><td align="center">R</td><td align="center">0</td><td align="center">0</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_R8I</code></td><td align="left">byte</td><td align="left">1</td><td align="left">NO</td><td align="center">R</td><td align="center">0</td><td align="center">0</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_R16I</code></td><td align="left">short</td><td align="left">1</td><td align="left">NO</td><td align="center">R</td><td align="center">0</td><td align="center">0</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_R32I</code></td><td align="left">int</td><td align="left">1</td><td align="left">NO</td><td align="center">R</td><td align="center">0</td><td align="center">0</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_R8UI</code></td><td align="left">ubyte</td><td align="left">1</td><td align="left">NO</td><td align="center">R</td><td align="center">0</td><td align="center">0</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_R16UI</code></td><td align="left">ushort</td><td align="left">1</td><td align="left">NO</td><td align="center">R</td><td align="center">0</td><td align="center">0</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_R32UI</code></td><td align="left">uint</td><td align="left">1</td><td align="left">NO</td><td align="center">R</td><td align="center">0</td><td align="center">0</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_RG8</code></td><td align="left">ubyte</td><td align="left">2</td><td align="left">YES</td><td align="center">R</td><td align="center">G</td><td align="center">0</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_RG16</code></td><td align="left">ushort</td><td align="left">2</td><td align="left">YES</td><td align="center">R</td><td align="center">G</td><td align="center">0</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_RG16F</code></td><td align="left">half</td><td align="left">2</td><td align="left">NO</td><td align="center">R</td><td align="center">G</td><td align="center">0</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_RG32F</code></td><td align="left">float</td><td align="left">2</td><td align="left">NO</td><td align="center">R</td><td align="center">G</td><td align="center">0</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_RG8I</code></td><td align="left">byte</td><td align="left">2</td><td align="left">NO</td><td align="center">R</td><td align="center">G</td><td align="center">0</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_RG16I</code></td><td align="left">short</td><td align="left">2</td><td align="left">NO</td><td align="center">R</td><td align="center">G</td><td align="center">0</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_RG32I</code></td><td align="left">int</td><td align="left">2</td><td align="left">NO</td><td align="center">R</td><td align="center">G</td><td align="center">0</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_RG8UI</code></td><td align="left">ubyte</td><td align="left">2</td><td align="left">NO</td><td align="center">R</td><td align="center">G</td><td align="center">0</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_RG16UI</code></td><td align="left">ushort</td><td align="left">2</td><td align="left">NO</td><td align="center">R</td><td align="center">G</td><td align="center">0</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_RG32UI</code></td><td align="left">uint</td><td align="left">2</td><td align="left">NO</td><td align="center">R</td><td align="center">G</td><td align="center">0</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_RGB32F</code></td><td align="left">float</td><td align="left">3</td><td align="left">NO</td><td align="center">R</td><td align="center">G</td><td align="center">B</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_RGB32I</code></td><td align="left">int</td><td align="left">3</td><td align="left">NO</td><td align="center">R</td><td align="center">G</td><td align="center">B</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_RGB32UI</code></td><td align="left">uint</td><td align="left">3</td><td align="left">NO</td><td align="center">R</td><td align="center">G</td><td align="center">B</td><td align="center">1</td></tr><tr><td align="left"><code class="constant">GL_RGBA8</code></td><td align="left">uint</td><td align="left">4</td><td align="left">YES</td><td align="center">R</td><td align="center">G</td><td align="center">B</td><td align="center">A</td></tr><tr><td align="left"><code class="constant">GL_RGBA16</code></td><td align="left">short</td><td align="left">4</td><td align="left">YES</td><td align="center">R</td><td align="center">G</td><td align="center">B</td><td align="center">A</td></tr><tr><td align="left"><code class="constant">GL_RGBA16F</code></td><td align="left">half</td><td align="left">4</td><td align="left">NO</td><td align="center">R</td><td align="center">G</td><td align="center">B</td><td align="center">A</td></tr><tr><td align="left"><code class="constant">GL_RGBA32F</code></td><td align="left">float</td><td align="left">4</td><td align="left">NO</td><td align="center">R</td><td align="center">G</td><td align="center">B</td><td align="center">A</td></tr><tr><td align="left"><code class="constant">GL_RGBA8I</code></td><td align="left">byte</td><td align="left">4</td><td align="left">NO</td><td align="center">R</td><td align="center">G</td><td align="center">B</td><td align="center">A</td></tr><tr><td align="left"><code class="constant">GL_RGBA16I</code></td><td align="left">short</td><td align="left">4</td><td align="left">NO</td><td align="center">R</td><td align="center">G</td><td align="center">B</td><td align="center">A</td></tr><tr><td align="left"><code class="constant">GL_RGBA32I</code></td><td align="left">int</td><td align="left">4</td><td align="left">NO</td><td align="center">R</td><td align="center">G</td><td align="center">B</td><td align="center">A</td></tr><tr><td align="left"><code class="constant">GL_RGBA8UI</code></td><td align="left">ubyte</td><td align="left">4</td><td align="left">NO</td><td align="center">R</td><td align="center">G</td><td align="center">B</td><td align="center">A</td></tr><tr><td align="left"><code class="constant">GL_RGBA16UI</code></td><td align="left">ushort</td><td align="left">4</td><td align="left">NO</td><td align="center">R</td><td align="center">G</td><td align="center">B</td><td align="center">A</td></tr><tr><td align="left"><code class="constant">GL_RGBA32UI</code></td><td align="left">uint</td><td align="left">4</td><td align="left">NO</td><td align="center">R</td><td align="center">G</td><td align="center">B</td><td align="center">A</td></tr></tbody></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
            <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>target</code></em> is not
            <code class="constant">GL_TEXTURE_BUFFER</code>.
        </p><p>
            <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>offset</code></em> is less than zero.
        </p><p>
            <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>size</code></em> is less than or equal to zero.
        </p><p>
            <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>offset</code></em> + <em class="parameter"><code>size</code></em> is
            greater than the value of <code class="constant">GL_BUFFER_SIZE</code> for <em class="parameter"><code>buffer</code></em>.
        </p><p>
            <code class="constant">GL_INVALID_VALUE</code> is generated if <em class="parameter"><code>offset</code></em> is not
            an integer multiple of the value of <code class="constant">GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT</code>.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
            <a href="glGet.xml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT</code>
        </p><p>
            <a href="glGetTexLevelParameter.xml"><span class="citerefentry"><span class="refentrytitle">glGetTexLevelParameter</span></span></a> with arguments <code class="constant">GL_TEXTURE_BUFFER_OFFSET</code>
            or <code class="constant">GL_TEXTURE_BUFFER_SIZE</code>.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
            <a href="glTexBuffer.xml"><span class="citerefentry"><span class="refentrytitle">glTexBuffer</span></span></a>.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="Copyright"></a><h2>Copyright</h2><p>
            Copyright <span class="trademark"></span>© 2012 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.
            <a href="http://opencontent.org/openpub/" target="_top">http://opencontent.org/openpub/</a>.
        </p></div></div></body></html>
