Skip to content

Commit

Permalink
Example code for select functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
BSVino committed Aug 18, 2014
1 parent af30afd commit 4a08ee6
Show file tree
Hide file tree
Showing 1,443 changed files with 2,786 additions and 597 deletions.
29 changes: 29 additions & 0 deletions compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import time
import sys
import argparse
import re

import opengl
import shared
Expand Down Expand Up @@ -321,6 +322,34 @@ def spew_category(name, commands, current_command):
if args.buildmode == 'full':
command_html = command_html.decode('utf8')

command_html = command_html.replace("{$pipelinestall}", "")

if command in opengl.example_functions:
examples = "<div class='refsect1' id='examples'><h2>Examples</h2>"
for example in opengl.example_functions[command]:
code = opengl.examples[example]['code']

def replace_alias(matchobj):
alias = matchobj.groups()[0]
command = alias
if alias in opengl.function_aliases:
command = opengl.function_aliases[alias]

return "<a href='../" + version_dir + r"/" + command + "'>" + alias + "</a>"

code = re.sub(r"\{%([a-zA-Z_][a-zA-Z_0-9]*?)\}", replace_alias, code).replace("\t", " ")

examples += "<div class='example'>"
examples += opengl.examples[example]['description']
examples += "<pre class='programlisting'>"
examples += code
examples += "</pre>"
examples += "</div>"
examples += "</div>"
command_html = command_html.replace("{$examples}", examples)
else:
command_html = command_html.replace("{$examples}", "")

output_html = header_for_command + command_html + footer_for_command

output = open(output_dir + version_dir + "/" + command, "w")
Expand Down
4 changes: 3 additions & 1 deletion es2/glActiveTexture.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
where i ranges from 0 to (<code class="constant">GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS</code> - 1).
</p></div><div class="refsect1"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_ACTIVE_TEXTURE</code> or <code class="constant">GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS</code>
</p></div><div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
</p></div>
{$pipelinestall}{$examples}
<div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
<a class="citerefentry" href="glTexParameter"><span class="citerefentry"><span class="refentrytitle">glTexParameter</span></span></a>
</p></div><div class="refsect1"><div id="Copyright"><h2>Copyright</h2><p>
Copyright <span class="trademark"></span>© 1991-2006
Expand Down
4 changes: 3 additions & 1 deletion es2/glAttachShader.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@
<em class="parameter"><code>program</code></em>, or if another shader object of
the same type as <em class="parameter"><code>shader</code></em> is already attached
to <em class="parameter"><code>program</code></em>.</p></div><div class="refsect1"><a id="associatedgets"></a><h2>Associated Gets</h2><p><a class="citerefentry" href="glGetAttachedShaders"><span class="citerefentry"><span class="refentrytitle">glGetAttachedShaders</span></span></a>
with the handle of a valid program object</p><p><a class="citerefentry" href="glIsProgram"><span class="citerefentry"><span class="refentrytitle">glIsProgram</span></span></a></p><p><a class="citerefentry" href="glIsShader"><span class="citerefentry"><span class="refentrytitle">glIsShader</span></span></a></p></div><div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p><a class="citerefentry" href="glCompileShader"><span class="citerefentry"><span class="refentrytitle">glCompileShader</span></span></a>,
with the handle of a valid program object</p><p><a class="citerefentry" href="glIsProgram"><span class="citerefentry"><span class="refentrytitle">glIsProgram</span></span></a></p><p><a class="citerefentry" href="glIsShader"><span class="citerefentry"><span class="refentrytitle">glIsShader</span></span></a></p></div>
{$pipelinestall}{$examples}
<div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p><a class="citerefentry" href="glCompileShader"><span class="citerefentry"><span class="refentrytitle">glCompileShader</span></span></a>,
<a class="citerefentry" href="glDetachShader"><span class="citerefentry"><span class="refentrytitle">glDetachShader</span></span></a>,
<a class="citerefentry" href="glLinkProgram"><span class="citerefentry"><span class="refentrytitle">glLinkProgram</span></span></a>,
<a class="citerefentry" href="glShaderSource"><span class="citerefentry"><span class="refentrytitle">glShaderSource</span></span></a>,
Expand Down
4 changes: 3 additions & 1 deletion es2/glBindAttribLocation.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@
with argument <code class="constant">GL_MAX_VERTEX_ATTRIBS</code></p><p><a class="citerefentry" href="glGetActiveAttrib"><span class="citerefentry"><span class="refentrytitle">glGetActiveAttrib</span></span></a>
with argument <em class="parameter"><code>program</code></em></p><p><a class="citerefentry" href="glGetAttribLocation"><span class="citerefentry"><span class="refentrytitle">glGetAttribLocation</span></span></a>
with arguments <em class="parameter"><code>program</code></em> and
<em class="parameter"><code>name</code></em></p><p><a class="citerefentry" href="glIsProgram"><span class="citerefentry"><span class="refentrytitle">glIsProgram</span></span></a></p></div><div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p><a class="citerefentry" href="glDisableVertexAttribArray"><span class="citerefentry"><span class="refentrytitle">glDisableVertexAttribArray</span></span></a>,
<em class="parameter"><code>name</code></em></p><p><a class="citerefentry" href="glIsProgram"><span class="citerefentry"><span class="refentrytitle">glIsProgram</span></span></a></p></div>
{$pipelinestall}{$examples}
<div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p><a class="citerefentry" href="glDisableVertexAttribArray"><span class="citerefentry"><span class="refentrytitle">glDisableVertexAttribArray</span></span></a>,
<a class="citerefentry" href="glEnableVertexAttribArray"><span class="citerefentry"><span class="refentrytitle">glEnableVertexAttribArray</span></span></a>,
<a class="citerefentry" href="glUseProgram"><span class="citerefentry"><span class="refentrytitle">glUseProgram</span></span></a>,
<a class="citerefentry" href="glVertexAttrib"><span class="citerefentry"><span class="refentrytitle">glVertexAttrib</span></span></a>,
Expand Down
4 changes: 3 additions & 1 deletion es2/glBindBuffer.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_ARRAY_BUFFER_BINDING</code>
</p><p>
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_ELEMENT_ARRAY_BUFFER_BINDING</code>
</p></div><div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
</p></div>
{$pipelinestall}{$examples}
<div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
<a class="citerefentry" href="glDeleteBuffers"><span class="citerefentry"><span class="refentrytitle">glDeleteBuffers</span></span></a>,
<a class="citerefentry" href="glGenBuffers"><span class="citerefentry"><span class="refentrytitle">glGenBuffers</span></span></a>,
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a>,
Expand Down
4 changes: 3 additions & 1 deletion es2/glBindFramebuffer.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@
<code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>target</code></em> is not <code class="constant">GL_FRAMEBUFFER</code>.
</p></div><div class="refsect1"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_FRAMEBUFFER_BINDING</code>
</p></div><div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
</p></div>
{$pipelinestall}{$examples}
<div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
<a class="citerefentry" href="glDeleteFramebuffers"><span class="citerefentry"><span class="refentrytitle">glDeleteFramebuffers</span></span></a>,
<a class="citerefentry" href="glFramebufferRenderbuffer"><span class="citerefentry"><span class="refentrytitle">glFramebufferRenderbuffer</span></span></a>,
<a class="citerefentry" href="glFramebufferTexture2D"><span class="citerefentry"><span class="refentrytitle">glFramebufferTexture2D</span></span></a>,
Expand Down
4 changes: 3 additions & 1 deletion es2/glBindRenderbuffer.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
<code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>target</code></em> is not <code class="constant">GL_RENDERBUFFER</code>.
</p></div><div class="refsect1"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_RENDERBUFFER_BINDING</code>
</p></div><div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
</p></div>
{$pipelinestall}{$examples}
<div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
<a class="citerefentry" href="glDeleteRenderbuffers"><span class="citerefentry"><span class="refentrytitle">glDeleteRenderbuffers</span></span></a>,
<a class="citerefentry" href="glFramebufferRenderbuffer"><span class="citerefentry"><span class="refentrytitle">glFramebufferRenderbuffer</span></span></a>,
<a class="citerefentry" href="glGenRenderbuffers"><span class="citerefentry"><span class="refentrytitle">glGenRenderbuffers</span></span></a>,
Expand Down
4 changes: 3 additions & 1 deletion es2/glBindTexture.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
that doesn't match that of <em class="parameter"><code>target</code></em>.
</p></div><div class="refsect1"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_TEXTURE_BINDING_2D</code> or <code class="constant">GL_TEXTURE_BINDING_CUBE_MAP</code>
</p></div><div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
</p></div>
{$pipelinestall}{$examples}
<div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
<a class="citerefentry" href="glDeleteTextures"><span class="citerefentry"><span class="refentrytitle">glDeleteTextures</span></span></a>,
<a class="citerefentry" href="glGenTextures"><span class="citerefentry"><span class="refentrytitle">glGenTextures</span></span></a>,
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a>,
Expand Down
4 changes: 3 additions & 1 deletion es2/glBlendColor.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
Initially the <code class="constant">GL_BLEND_COLOR</code> is set to (0, 0, 0, 0).
</p></div><div class="refsect1"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with an argument of <code class="constant">GL_BLEND_COLOR</code>
</p></div><div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
</p></div>
{$pipelinestall}{$examples}
<div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
<a class="citerefentry" href="glBlendEquation"><span class="citerefentry"><span class="refentrytitle">glBlendEquation</span></span></a>,
<a class="citerefentry" href="glBlendFunc"><span class="citerefentry"><span class="refentrytitle">glBlendFunc</span></span></a>,
<a class="citerefentry" href="glGetString"><span class="citerefentry"><span class="refentrytitle">glGetString</span></span></a>
Expand Down
4 changes: 3 additions & 1 deletion es2/glBlendEquation.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,9 @@
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with an argument of <code class="constant">GL_BLEND_EQUATION_RGB</code>
</p><p>
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with an argument of <code class="constant">GL_BLEND_EQUATION_ALPHA</code>
</p></div><div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
</p></div>
{$pipelinestall}{$examples}
<div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
<a class="citerefentry" href="glGetString"><span class="citerefentry"><span class="refentrytitle">glGetString</span></span></a>,
<a class="citerefentry" href="glBlendColor"><span class="citerefentry"><span class="refentrytitle">glBlendColor</span></span></a>,
<a class="citerefentry" href="glBlendEquationSeparate"><span class="citerefentry"><span class="refentrytitle">glBlendEquationSeparate</span></span></a>,
Expand Down
4 changes: 3 additions & 1 deletion es2/glBlendEquationSeparate.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,9 @@
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with an argument of <code class="constant">GL_BLEND_EQUATION_RGB</code>
</p><p>
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with an argument of <code class="constant">GL_BLEND_EQUATION_ALPHA</code>
</p></div><div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
</p></div>
{$pipelinestall}{$examples}
<div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
<a class="citerefentry" href="glGetString"><span class="citerefentry"><span class="refentrytitle">glGetString</span></span></a>,
<a class="citerefentry" href="glBlendColor"><span class="citerefentry"><span class="refentrytitle">glBlendColor</span></span></a>,
<a class="citerefentry" href="glBlendEquation"><span class="citerefentry"><span class="refentrytitle">glBlendEquation</span></span></a>,
Expand Down
4 changes: 3 additions & 1 deletion es2/glBlendFunc.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -824,7 +824,9 @@
</p><p>
<a class="citerefentry" href="glIsEnabled"><span class="citerefentry"><span class="refentrytitle">glIsEnabled</span></span></a> with argument <code class="constant">GL_BLEND</code>
</p><p>
</p></div><div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
</p></div>
{$pipelinestall}{$examples}
<div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
<a class="citerefentry" href="glBlendColor"><span class="citerefentry"><span class="refentrytitle">glBlendColor</span></span></a>,
<a class="citerefentry" href="glBlendEquation"><span class="citerefentry"><span class="refentrytitle">glBlendEquation</span></span></a>,
<a class="citerefentry" href="glBlendEquationSeparate"><span class="citerefentry"><span class="refentrytitle">glBlendEquationSeparate</span></span></a>,
Expand Down
4 changes: 3 additions & 1 deletion es2/glBlendFuncSeparate.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,9 @@
</p><p>
<a class="citerefentry" href="glIsEnabled"><span class="citerefentry"><span class="refentrytitle">glIsEnabled</span></span></a> with argument <code class="constant">GL_BLEND</code>
</p><p>
</p></div><div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
</p></div>
{$pipelinestall}{$examples}
<div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
<a class="citerefentry" href="glBlendColor"><span class="citerefentry"><span class="refentrytitle">glBlendColor</span></span></a>,
<a class="citerefentry" href="glBlendEquation"><span class="citerefentry"><span class="refentrytitle">glBlendEquation</span></span></a>,
<a class="citerefentry" href="glBlendEquationSeparate"><span class="citerefentry"><span class="refentrytitle">glBlendEquationSeparate</span></span></a>,
Expand Down
4 changes: 3 additions & 1 deletion es2/glBufferData.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@
<code class="constant">GL_OUT_OF_MEMORY</code> is generated if the GL is unable to create a data store with the specified <em class="parameter"><code>size</code></em>.
</p></div><div class="refsect1"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
<a class="citerefentry" href="glGetBufferParameteriv"><span class="citerefentry"><span class="refentrytitle">glGetBufferParameteriv</span></span></a> with argument <code class="constant">GL_BUFFER_SIZE</code> or <code class="constant">GL_BUFFER_USAGE</code>
</p></div><div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
</p></div>
{$pipelinestall}{$examples}
<div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
<a class="citerefentry" href="glBindBuffer"><span class="citerefentry"><span class="refentrytitle">glBindBuffer</span></span></a>,
<a class="citerefentry" href="glBufferSubData"><span class="citerefentry"><span class="refentrytitle">glBufferSubData</span></span></a>
</p></div><div class="refsect1"><div id="Copyright"><h2>Copyright</h2><p>
Expand Down
4 changes: 3 additions & 1 deletion es2/glBufferSubData.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
that extends beyond the buffer object's allocated data store.
</p><p>
<code class="constant">GL_INVALID_OPERATION</code> is generated if the reserved buffer object name 0 is bound to <em class="parameter"><code>target</code></em>.
</p></div><div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
</p></div>
{$pipelinestall}{$examples}
<div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
<a class="citerefentry" href="glBindBuffer"><span class="citerefentry"><span class="refentrytitle">glBindBuffer</span></span></a>,
<a class="citerefentry" href="glBufferData"><span class="citerefentry"><span class="refentrytitle">glBufferData</span></span></a>
</p></div><div class="refsect1"><div id="Copyright"><h2>Copyright</h2><p>
Expand Down
4 changes: 3 additions & 1 deletion es2/glCheckFramebufferStatus.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@
Additionally, if an error occurs, zero is returned.
</p></div><div class="refsect1"><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_FRAMEBUFFER</code>.
</p></div><div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
</p></div>
{$pipelinestall}{$examples}
<div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
<a class="citerefentry" href="glBindRenderbuffer"><span class="citerefentry"><span class="refentrytitle">glBindRenderbuffer</span></span></a>,
<a class="citerefentry" href="glCopyTexImage2D"><span class="citerefentry"><span class="refentrytitle">glCopyTexImage2D</span></span></a>,
<a class="citerefentry" href="glCopyTexSubImage2D"><span class="citerefentry"><span class="refentrytitle">glCopyTexSubImage2D</span></span></a>,
Expand Down
4 changes: 3 additions & 1 deletion es2/glClear.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_COLOR_CLEAR_VALUE</code>
</p><p>
<a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_STENCIL_CLEAR_VALUE</code>
</p></div><div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
</p></div>
{$pipelinestall}{$examples}
<div class="refsect1"><a id="seealso"></a><h2>See Also</h2><p>
<a class="citerefentry" href="glClearColor"><span class="citerefentry"><span class="refentrytitle">glClearColor</span></span></a>,
<a class="citerefentry" href="glClearDepthf"><span class="citerefentry"><span class="refentrytitle">glClearDepthf</span></span></a>,
<a class="citerefentry" href="glClearStencil"><span class="citerefentry"><span class="refentrytitle">glClearStencil</span></span></a>,
Expand Down
Loading

0 comments on commit 4a08ee6

Please sign in to comment.