Merged gl4 branch into trunk

This commit is contained in:
the_fiddler 2010-12-04 21:51:40 +00:00
commit f9365a4cc4
297 changed files with 135616 additions and 81138 deletions

View file

@ -16,7 +16,7 @@ namespace Bind.CL
{
glTypemap = null;
wrappersFile = "CL.cs";
Settings.WrappersFile = "CL.cs";
Settings.FunctionPrefix = "cl";
Settings.ConstantPrefix = "CL_";

View file

@ -0,0 +1,477 @@
#region License
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2010 the Open Toolkit library.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using Bind.Structures;
namespace Bind
{
using Delegate = Bind.Structures.Delegate;
using Enum = Bind.Structures.Enum;
using Type = Bind.Structures.Type;
sealed class CSharpSpecWriter : ISpecWriter
{
readonly char[] numbers = "0123456789".ToCharArray();
#region WriteBindings
public void WriteBindings(IBind generator)
{
WriteBindings(generator.Delegates, generator.Wrappers, generator.Enums);
}
void WriteBindings(DelegateCollection delegates, FunctionCollection wrappers, EnumCollection enums)
{
Console.WriteLine("Writing bindings to {0}", Settings.OutputPath);
if (!Directory.Exists(Settings.OutputPath))
Directory.CreateDirectory(Settings.OutputPath);
string temp_enums_file = Path.GetTempFileName();
string temp_delegates_file = Path.GetTempFileName();
string temp_core_file = Path.GetTempFileName();
string temp_wrappers_file = Path.GetTempFileName();
// Enums
using (BindStreamWriter sw = new BindStreamWriter(temp_enums_file))
{
WriteLicense(sw);
sw.WriteLine("using System;");
sw.WriteLine();
if ((Settings.Compatibility & Settings.Legacy.NestedEnums) != Settings.Legacy.None)
{
sw.WriteLine("namespace {0}", Settings.OutputNamespace);
sw.WriteLine("{");
sw.Indent();
sw.WriteLine("static partial class {0}", Settings.OutputClass);
}
else
sw.WriteLine("namespace {0}", Settings.EnumsOutput);
sw.WriteLine("{");
sw.Indent();
WriteEnums(sw, enums);
sw.Unindent();
if ((Settings.Compatibility & Settings.Legacy.NestedEnums) != Settings.Legacy.None)
{
sw.WriteLine("}");
sw.Unindent();
}
sw.WriteLine("}");
}
// Delegates
using (BindStreamWriter sw = new BindStreamWriter(temp_delegates_file))
{
WriteLicense(sw);
sw.WriteLine("namespace {0}", Settings.OutputNamespace);
sw.WriteLine("{");
sw.Indent();
sw.WriteLine("using System;");
sw.WriteLine("using System.Text;");
sw.WriteLine("using System.Runtime.InteropServices;");
sw.WriteLine("#pragma warning disable 0649");
WriteDelegates(sw, delegates);
sw.Unindent();
sw.WriteLine("}");
}
// Core
using (BindStreamWriter sw = new BindStreamWriter(temp_core_file))
{
WriteLicense(sw);
sw.WriteLine("namespace {0}", Settings.OutputNamespace);
sw.WriteLine("{");
sw.Indent();
//specWriter.WriteTypes(sw, Bind.Structures.Type.CSTypes);
sw.WriteLine("using System;");
sw.WriteLine("using System.Text;");
sw.WriteLine("using System.Runtime.InteropServices;");
WriteImports(sw, delegates);
sw.Unindent();
sw.WriteLine("}");
}
// Wrappers
using (BindStreamWriter sw = new BindStreamWriter(temp_wrappers_file))
{
WriteLicense(sw);
sw.WriteLine("namespace {0}", Settings.OutputNamespace);
sw.WriteLine("{");
sw.Indent();
sw.WriteLine("using System;");
sw.WriteLine("using System.Text;");
sw.WriteLine("using System.Runtime.InteropServices;");
WriteWrappers(sw, wrappers, Type.CSTypes);
sw.Unindent();
sw.WriteLine("}");
}
string output_enums = Path.Combine(Settings.OutputPath, Settings.EnumsFile);
string output_delegates = Path.Combine(Settings.OutputPath, Settings.DelegatesFile);
string output_core = Path.Combine(Settings.OutputPath, Settings.ImportsFile);
string output_wrappers = Path.Combine(Settings.OutputPath, Settings.WrappersFile);
if (File.Exists(output_enums)) File.Delete(output_enums);
if (File.Exists(output_delegates)) File.Delete(output_delegates);
if (File.Exists(output_core)) File.Delete(output_core);
if (File.Exists(output_wrappers)) File.Delete(output_wrappers);
File.Move(temp_enums_file, output_enums);
File.Move(temp_delegates_file, output_delegates);
File.Move(temp_core_file, output_core);
File.Move(temp_wrappers_file, output_wrappers);
}
#endregion
#region WriteDelegates
public void WriteDelegates(BindStreamWriter sw, DelegateCollection delegates)
{
Trace.WriteLine(String.Format("Writing delegates to:\t{0}.{1}.{2}", Settings.OutputNamespace, Settings.OutputClass, Settings.DelegatesClass));
sw.WriteLine("#pragma warning disable 3019"); // CLSCompliant attribute
sw.WriteLine("#pragma warning disable 1591"); // Missing doc comments
sw.WriteLine();
sw.WriteLine("partial class {0}", Settings.OutputClass);
sw.WriteLine("{");
sw.Indent();
sw.WriteLine("internal static partial class {0}", Settings.DelegatesClass);
sw.WriteLine("{");
sw.Indent();
foreach (Delegate d in delegates.Values)
{
sw.WriteLine("[System.Security.SuppressUnmanagedCodeSecurity()]");
sw.WriteLine("internal {0};", d.ToString());
sw.WriteLine("internal {0}static {1} {2}{1};", // = null
d.Unsafe ? "unsafe " : "",
d.Name,
Settings.FunctionPrefix);
}
sw.Unindent();
sw.WriteLine("}");
sw.Unindent();
sw.WriteLine("}");
}
#endregion
#region WriteImports
public void WriteImports(BindStreamWriter sw, DelegateCollection delegates)
{
Trace.WriteLine(String.Format("Writing imports to:\t{0}.{1}.{2}", Settings.OutputNamespace, Settings.OutputClass, Settings.ImportsClass));
sw.WriteLine("#pragma warning disable 3019"); // CLSCompliant attribute
sw.WriteLine("#pragma warning disable 1591"); // Missing doc comments
sw.WriteLine();
sw.WriteLine("partial class {0}", Settings.OutputClass);
sw.WriteLine("{");
sw.Indent();
sw.WriteLine();
sw.WriteLine("internal static partial class {0}", Settings.ImportsClass);
sw.WriteLine("{");
sw.Indent();
//sw.WriteLine("static {0}() {1} {2}", Settings.ImportsClass, "{", "}"); // Disable BeforeFieldInit
sw.WriteLine();
foreach (Delegate d in delegates.Values)
{
sw.WriteLine("[System.Security.SuppressUnmanagedCodeSecurity()]");
sw.WriteLine(
"[System.Runtime.InteropServices.DllImport({0}.Library, EntryPoint = \"{1}{2}\"{3})]",
Settings.OutputClass,
Settings.FunctionPrefix,
d.Name,
d.Name.EndsWith("W") || d.Name.EndsWith("A") ? ", CharSet = CharSet.Auto" : ", ExactSpelling = true"
);
sw.WriteLine("internal extern static {0};", d.DeclarationString());
}
sw.Unindent();
sw.WriteLine("}");
sw.Unindent();
sw.WriteLine("}");
}
#endregion
#region WriteWrappers
public void WriteWrappers(BindStreamWriter sw, FunctionCollection wrappers, Dictionary<string, string> CSTypes)
{
Trace.WriteLine(String.Format("Writing wrappers to:\t{0}.{1}", Settings.OutputNamespace, Settings.OutputClass));
sw.WriteLine("#pragma warning disable 3019"); // CLSCompliant attribute
sw.WriteLine("#pragma warning disable 1591"); // Missing doc comments
sw.WriteLine("#pragma warning disable 1572"); // Wrong param comments
sw.WriteLine("#pragma warning disable 1573"); // Missing param comments
sw.WriteLine();
sw.WriteLine("partial class {0}", Settings.OutputClass);
sw.WriteLine("{");
sw.Indent();
//sw.WriteLine("static {0}() {1} {2}", className, "{", "}"); // Static init in GLHelper.cs
sw.WriteLine();
int current = 0;
foreach (string key in wrappers.Keys)
{
if (((Settings.Compatibility & Settings.Legacy.NoSeparateFunctionNamespaces) == Settings.Legacy.None) && key != "Core")
{
if (!Char.IsDigit(key[0]))
{
sw.WriteLine("public static partial class {0}", key);
}
else
{
// Identifiers cannot start with a number:
sw.WriteLine("public static partial class {0}{1}", Settings.ConstantPrefix, key);
}
sw.WriteLine("{");
sw.Indent();
}
wrappers[key].Sort();
foreach (Function f in wrappers[key])
{
current = WriteWrapper(sw, current, f);
}
if (((Settings.Compatibility & Settings.Legacy.NoSeparateFunctionNamespaces) == Settings.Legacy.None) && key != "Core")
{
sw.Unindent();
sw.WriteLine("}");
sw.WriteLine();
}
}
sw.Unindent();
sw.WriteLine("}");
}
int WriteWrapper(BindStreamWriter sw, int current, Function f)
{
if ((Settings.Compatibility & Settings.Legacy.NoDocumentation) == 0)
{
Console.WriteLine("Creating docs for #{0} ({1})", current++, f.Name);
WriteDocumentation(sw, f);
}
WriteMethod(sw, f);
return current;
}
private static void WriteMethod(BindStreamWriter sw, Function f)
{
if (f.Deprecated && Settings.IsEnabled(Settings.Legacy.AddDeprecationWarnings))
{
sw.WriteLine("[Obsolete(\"Deprecated in OpenGL {0}\")]", f.DeprecatedVersion);
}
if (!f.CLSCompliant)
{
sw.WriteLine("[System.CLSCompliant(false)]");
}
sw.WriteLine("[AutoGenerated(Category = \"{0}\", Version = \"{1}\", EntryPoint = \"{2}\")]",
f.Category, f.Version, Settings.FunctionPrefix + f.WrappedDelegate.Name);
sw.WriteLine("public static ");
sw.Write(f);
sw.WriteLine();
}
static DocProcessor processor = new DocProcessor(Path.Combine(Settings.DocPath, Settings.DocFile));
static Dictionary<string, string> docfiles;
void WriteDocumentation(BindStreamWriter sw, Function f)
{
if (docfiles == null)
{
docfiles = new Dictionary<string, string>();
foreach (string file in Directory.GetFiles(Settings.DocPath))
{
docfiles.Add(Path.GetFileName(file), file);
}
}
string docfile = null;
try
{
docfile = Settings.FunctionPrefix + f.WrappedDelegate.Name + ".xml";
if (!docfiles.ContainsKey(docfile))
docfile = Settings.FunctionPrefix + f.TrimmedName + ".xml";
if (!docfiles.ContainsKey(docfile))
docfile = Settings.FunctionPrefix + f.TrimmedName.TrimEnd(numbers) + ".xml";
string doc = null;
if (docfiles.ContainsKey(docfile))
{
doc = processor.ProcessFile(docfiles[docfile]);
}
if (doc == null)
{
doc = "/// <summary></summary>";
}
int summary_start = doc.IndexOf("<summary>") + "<summary>".Length;
string warning = "[deprecated: v{0}]";
string category = "[requires: {0}]";
if (f.Deprecated)
{
warning = String.Format(warning, f.DeprecatedVersion);
doc = doc.Insert(summary_start, warning);
}
if (f.Extension != "Core" && !String.IsNullOrEmpty(f.Category))
{
category = String.Format(category, f.Category);
doc = doc.Insert(summary_start, category);
}
else if (!String.IsNullOrEmpty(f.Version))
{
if (f.Category.StartsWith("VERSION"))
category = String.Format(category, "v" + f.Version);
else
category = String.Format(category, "v" + f.Version + " and " + f.Category);
doc = doc.Insert(summary_start, category);
}
sw.WriteLine(doc);
}
catch (Exception e)
{
Console.WriteLine("[Warning] Error processing file {0}: {1}", docfile, e.ToString());
}
}
#endregion
#region WriteTypes
public void WriteTypes(BindStreamWriter sw, Dictionary<string, string> CSTypes)
{
sw.WriteLine();
foreach (string s in CSTypes.Keys)
{
sw.WriteLine("using {0} = System.{1};", s, CSTypes[s]);
}
}
#endregion
#region WriteEnums
public void WriteEnums(BindStreamWriter sw, EnumCollection enums)
{
//sw.WriteLine("#pragma warning disable 3019"); // CLSCompliant attribute
sw.WriteLine("#pragma warning disable 1591"); // Missing doc comments
sw.WriteLine();
if ((Settings.Compatibility & Settings.Legacy.NestedEnums) != Settings.Legacy.None)
Trace.WriteLine(String.Format("Writing enums to:\t{0}.{1}.{2}", Settings.OutputNamespace, Settings.OutputClass, Settings.NestedEnumsClass));
else
Trace.WriteLine(String.Format("Writing enums to:\t{0}", Settings.EnumsOutput));
if ((Settings.Compatibility & Settings.Legacy.ConstIntEnums) == Settings.Legacy.None)
{
if ((Settings.Compatibility & Settings.Legacy.NestedEnums) != Settings.Legacy.None &&
!String.IsNullOrEmpty(Settings.NestedEnumsClass))
{
sw.WriteLine("public class Enums");
sw.WriteLine("{");
sw.Indent();
}
foreach (Enum @enum in enums.Values)
{
sw.Write(@enum);
sw.WriteLine();
}
if ((Settings.Compatibility & Settings.Legacy.NestedEnums) != Settings.Legacy.None &&
!String.IsNullOrEmpty(Settings.NestedEnumsClass))
{
sw.Unindent();
sw.WriteLine("}");
}
}
else
{
// Tao legacy mode: dump all enums as constants in GLClass.
foreach (Constant c in enums[Settings.CompleteEnumName].ConstantCollection.Values)
{
// Print constants avoiding circular definitions
if (c.Name != c.Value)
{
sw.WriteLine(String.Format(
"public const int {0} = {2}((int){1});",
c.Name.StartsWith(Settings.ConstantPrefix) ? c.Name : Settings.ConstantPrefix + c.Name,
Char.IsDigit(c.Value[0]) ? c.Value : c.Value.StartsWith(Settings.ConstantPrefix) ? c.Value : Settings.ConstantPrefix + c.Value,
c.Unchecked ? "unchecked" : ""));
}
else
{
}
}
}
}
#endregion
#region WriteLicense
public void WriteLicense(BindStreamWriter sw)
{
sw.WriteLine(File.ReadAllText(Path.Combine(Settings.InputPath, Settings.LicenseFile)));
sw.WriteLine();
}
#endregion
}
}

View file

@ -0,0 +1,248 @@
#region License
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2010 the Open Toolkit library.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using Bind.Structures;
namespace Bind
{
using Delegate = Bind.Structures.Delegate;
using Enum = Bind.Structures.Enum;
using Type = Bind.Structures.Type;
sealed class CppSpecWriter : ISpecWriter
{
readonly char[] numbers = "0123456789".ToCharArray();
#region WriteBindings
public void WriteBindings(IBind generator)
{
WriteBindings(generator.Delegates, generator.Wrappers, generator.Enums);
}
void WriteBindings(DelegateCollection delegates, FunctionCollection wrappers, EnumCollection enums)
{
Console.WriteLine("Writing bindings to {0}", Settings.OutputPath);
if (!Directory.Exists(Settings.OutputPath))
Directory.CreateDirectory(Settings.OutputPath);
string temp_core_file = Path.GetTempFileName();
using (BindStreamWriter sw = new BindStreamWriter(temp_core_file))
{
WriteLicense(sw);
sw.WriteLine("namespace {0}", "gl");
sw.WriteLine("{");
sw.Indent();
sw.Indent();
WriteEnums(sw, enums);
sw.Unindent();
//WriteDelegates(sw, delegates);
WriteWrappers(sw, wrappers, Type.CSTypes);
sw.Unindent();
sw.WriteLine("}");
}
string output_core = Path.Combine(Settings.OutputPath, "gl.h");
if (File.Exists(output_core))
File.Delete(output_core);
File.Move(temp_core_file, output_core);
}
#endregion
#region WriteDelegates
public void WriteDelegates(BindStreamWriter sw, DelegateCollection delegates)
{
Trace.WriteLine(String.Format("Writing delegates to:\t{0}", Settings.OutputNamespace));
foreach (Delegate d in delegates.Values)
{
sw.WriteLine("extern {0} {1}({2});", d.ReturnType, d.Name, d.Parameters);
}
}
#endregion
#region WriteImports
public void WriteImports(BindStreamWriter sw, DelegateCollection delegates)
{
}
#endregion
#region WriteWrappers
public void WriteWrappers(BindStreamWriter sw, FunctionCollection wrappers, Dictionary<string, string> CSTypes)
{
foreach (string extension in wrappers.Keys)
{
if (extension != "Core")
{
sw.WriteLine("namespace {0}", extension);
sw.WriteLine("{");
sw.Indent();
}
foreach (Function f in wrappers[extension])
{
sw.WriteLine("static {0} (* p{1})({2});", f.ReturnType, f.TrimmedName, f.Parameters);
sw.WriteLine("extern p{0} {0};", f.TrimmedName);
}
if (extension != "Core")
{
sw.Unindent();
sw.WriteLine("}");
}
}
}
static DocProcessor processor = new DocProcessor(Path.Combine(Settings.DocPath, Settings.DocFile));
static Dictionary<string, string> docfiles;
void WriteDocumentation(BindStreamWriter sw, Function f)
{
if (docfiles == null)
{
docfiles = new Dictionary<string, string>();
foreach (string file in Directory.GetFiles(Settings.DocPath))
{
docfiles.Add(Path.GetFileName(file), file);
}
}
string docfile = null;
try
{
docfile = Settings.FunctionPrefix + f.WrappedDelegate.Name + ".xml";
if (!docfiles.ContainsKey(docfile))
docfile = Settings.FunctionPrefix + f.TrimmedName + ".xml";
if (!docfiles.ContainsKey(docfile))
docfile = Settings.FunctionPrefix + f.TrimmedName.TrimEnd(numbers) + ".xml";
string doc = null;
if (docfiles.ContainsKey(docfile))
{
doc = processor.ProcessFile(docfiles[docfile]);
}
if (doc == null)
{
doc = "/// <summary></summary>";
}
int summary_start = doc.IndexOf("<summary>") + "<summary>".Length;
string warning = "[deprecated: v{0}]";
string category = "[requires: {0}]";
if (f.Deprecated)
{
warning = String.Format(warning, f.DeprecatedVersion);
doc = doc.Insert(summary_start, warning);
}
if (f.Extension != "Core" && !String.IsNullOrEmpty(f.Category))
{
category = String.Format(category, f.Category);
doc = doc.Insert(summary_start, category);
}
else if (!String.IsNullOrEmpty(f.Version))
{
if (f.Category.StartsWith("VERSION"))
category = String.Format(category, "v" + f.Version);
else
category = String.Format(category, "v" + f.Version + " and " + f.Category);
doc = doc.Insert(summary_start, category);
}
sw.WriteLine(doc);
}
catch (Exception e)
{
Console.WriteLine("[Warning] Error processing file {0}: {1}", docfile, e.ToString());
}
}
#endregion
#region WriteTypes
public void WriteTypes(BindStreamWriter sw, Dictionary<string, string> CSTypes)
{
sw.WriteLine();
foreach (string s in CSTypes.Keys)
{
sw.WriteLine("typedef {0} {1};", s, CSTypes[s]);
}
}
#endregion
#region WriteEnums
public void WriteEnums(BindStreamWriter sw, EnumCollection enums)
{
foreach (Enum @enum in enums.Values)
{
sw.Write("enum ");
sw.Write(@enum.Name);
sw.Write("{");
sw.Indent();
foreach (var c in @enum.ConstantCollection.Values)
{
sw.Write(c);
sw.WriteLine(",");
}
sw.Unindent();
sw.WriteLine("};");
sw.WriteLine();
}
}
#endregion
#region WriteLicense
public void WriteLicense(BindStreamWriter sw)
{
sw.WriteLine(File.ReadAllText(Path.Combine(Settings.InputPath, Settings.LicenseFile)));
sw.WriteLine();
}
#endregion
}
}

View file

@ -8,12 +8,16 @@ namespace Bind
{
class DocProcessor
{
static readonly Regex remove_mathml = new Regex(@"<(mml:math)[^>]*?>(?:.|\n)*?</\s*\1\s*>",
static readonly Regex remove_mathml = new Regex(
@"<(mml:math|inlineequation)[^>]*?>(?:.|\n)*?</\s*\1\s*>",
RegexOptions.Compiled | RegexOptions.Multiline | RegexOptions.IgnorePatternWhitespace);
static readonly XslCompiledTransform xslt = new XslCompiledTransform();
static readonly XmlReaderSettings settings = new XmlReaderSettings();
string Text;
string LastFile;
public DocProcessor(string transform_file)
{
xslt.Load(transform_file);
@ -27,35 +31,54 @@ namespace Bind
// Todo: Some files include more than 1 function - find a way to map these extra functions.
public string ProcessFile(string file)
{
string text = File.ReadAllText(file);
if (LastFile == file)
return Text;
Match m = remove_mathml.Match(text);
LastFile = file;
Text = File.ReadAllText(file);
Match m = remove_mathml.Match(Text);
while (m.Length > 0)
{
string removed = text.Substring(m.Index, m.Length);
text = text.Remove(m.Index, m.Length);
string removed = Text.Substring(m.Index, m.Length);
Text = Text.Remove(m.Index, m.Length);
int equation = removed.IndexOf("eqn");
if (equation > 0)
{
text = text.Insert(m.Index,
"<![CDATA[" +
removed.Substring(equation + 4, removed.IndexOf(":-->") - equation - 4) +
"]]>");
// Find the start and end of the equation string
int eqn_start = equation + 4;
int eqn_end = removed.IndexOf(":-->") - equation - 4;
if (eqn_end < 0)
{
// Note: a few docs from man4 delimit eqn end with ": -->"
eqn_end = removed.IndexOf(": -->") - equation - 4;
}
if (eqn_end < 0)
{
Console.WriteLine("[Warning] Failed to find equation for mml.");
goto next;
}
string eqn_substring = removed.Substring(eqn_start, eqn_end);
Text = Text.Insert(m.Index, "<![CDATA[" + eqn_substring + "]]>");
}
m = remove_mathml.Match(text);
next:
m = remove_mathml.Match(Text);
}
XmlReader doc = null;
try
{
// The pure XmlReader is ~20x faster than the XmlTextReader.
doc = XmlReader.Create(new StringReader(text), settings);
doc = XmlReader.Create(new StringReader(Text), settings);
//doc = new XmlTextReader(new StringReader(text));
using (StringWriter sw = new StringWriter())
{
xslt.Transform(doc, null, sw);
return sw.ToString().TrimEnd('\n');
Text = sw.ToString().TrimEnd('\n');
return Text;
}
}
catch (XmlException e)

View file

@ -25,135 +25,17 @@ namespace Bind.ES
enumSpecExt = String.Empty;
glSpec = dirName + "/signatures.xml";
glSpecExt = String.Empty;
functionOverridesFile = dirName + "/overrides.xml";
Settings.OverridesFile = dirName + "/overrides.xml";
importsFile = "Core.cs";
delegatesFile = "Delegates.cs";
enumsFile = "Enums.cs";
wrappersFile = "ES.cs";
Settings.ImportsFile = "Core.cs";
Settings.DelegatesFile = "Delegates.cs";
Settings.EnumsFile = "Enums.cs";
Settings.WrappersFile = "ES.cs";
Settings.ImportsClass = "Core";
Settings.DelegatesClass = "Delegates";
Settings.OutputClass = "GL";
Settings.OutputNamespace = "OpenTK.Graphics." + nsName;
Settings.OutputPath = Path.Combine(Settings.OutputPath, dirName);
}
public override DelegateCollection ReadDelegates(StreamReader specFile)
{
DelegateCollection delegates = new DelegateCollection();
XPathDocument specs = new XPathDocument(specFile);
XPathDocument overrides = new XPathDocument(new StreamReader(Path.Combine(Settings.InputPath, functionOverridesFile)));
foreach (XPathNavigator nav in new XPathNavigator[] {
specs.CreateNavigator().SelectSingleNode("/signatures"),
overrides.CreateNavigator().SelectSingleNode("/overrides/add") })
{
if (nav != null)
{
foreach (XPathNavigator node in nav.SelectChildren("function", String.Empty))
{
var name = node.GetAttribute("name", String.Empty);
// Check whether we are adding to an existing delegate or creating a new one.
Delegate d = null;
if (delegates.ContainsKey(name))
{
d = delegates[name];
}
else
{
d = new Delegate();
d.Name = name;
d.Version = node.GetAttribute("version", String.Empty);
d.Category = node.GetAttribute("category", String.Empty);
}
foreach (XPathNavigator param in node.SelectChildren(XPathNodeType.Element))
{
switch (param.Name)
{
case "returns":
d.ReturnType.CurrentType = param.GetAttribute("type", String.Empty);
break;
case "param":
Parameter p = new Parameter();
p.CurrentType = param.GetAttribute("type", String.Empty);
p.Name = param.GetAttribute("name", String.Empty);
string element_count = param.GetAttribute("elementcount", String.Empty);
if (!String.IsNullOrEmpty(element_count))
p.ElementCount = Int32.Parse(element_count);
p.Flow = Parameter.GetFlowDirection(param.GetAttribute("flow", String.Empty));
d.Parameters.Add(p);
break;
}
}
d.Translate(overrides);
delegates.Add(d);
}
}
}
return delegates;
}
public override Dictionary<string, string> ReadTypeMap(StreamReader specFile)
{
return base.ReadTypeMap(specFile);
}
public override Dictionary<string, string> ReadCSTypeMap(StreamReader specFile)
{
return base.ReadCSTypeMap(specFile);
}
public override EnumCollection ReadEnums(StreamReader specFile)
{
// First, read all enum definitions from spec and override file.
// Afterwards, read all token/enum overrides from overrides file.
// Every single enum is merged into
EnumCollection enums = new EnumCollection();
Enum all = new Enum() { Name = Settings.CompleteEnumName };
XPathDocument specs = new XPathDocument(specFile);
XPathDocument overrides = new XPathDocument(new StreamReader(Path.Combine(Settings.InputPath, functionOverridesFile)));
foreach (XPathNavigator nav in new XPathNavigator[] {
specs.CreateNavigator().SelectSingleNode("/signatures"),
overrides.CreateNavigator().SelectSingleNode("/overrides/add") })
{
if (nav != null)
{
foreach (XPathNavigator node in nav.SelectChildren("enum", String.Empty))
{
Enum e = new Enum()
{
Name = node.GetAttribute("name", String.Empty),
Type = node.GetAttribute("type", String.Empty)
};
if (String.IsNullOrEmpty(e.Name))
throw new InvalidOperationException(String.Format("Empty name for enum element {0}", node.ToString()));
foreach (XPathNavigator param in node.SelectChildren(XPathNodeType.Element))
{
Constant c = new Constant(param.GetAttribute("name", String.Empty), param.GetAttribute("value", String.Empty));
Utilities.Merge(all, c);
try { e.ConstantCollection.Add(c.Name, c); }
catch (ArgumentException ex) { Console.WriteLine("[Warning] Failed to add constant {0} to enum {1}: {2}", c.Name, e.Name, ex.Message); }
}
Utilities.Merge(enums, e);
}
}
}
Utilities.Merge(enums, all);
enums.Translate(overrides);
return enums;
}
}
}

View file

@ -0,0 +1,320 @@
#region License
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2010 the Open Toolkit library.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using System.Xml.XPath;
using Bind.Structures;
using Enum = Bind.Structures.Enum;
using System.Globalization;
namespace Bind
{
class EnumProcessor
{
const string Path = "/overrides/replace/enum[@name='{0}']";
XPathDocument Overrides { get; set; }
public EnumProcessor(XPathDocument overrides)
{
if (overrides == null)
throw new ArgumentNullException("overrides");
Overrides = overrides;
}
public EnumCollection Process(EnumCollection enums)
{
var nav = Overrides.CreateNavigator();
enums = ProcessNames(enums, nav);
enums = ProcessConstants(enums, nav);
return enums;
}
static EnumCollection ProcessNames(EnumCollection enums, XPathNavigator nav)
{
EnumCollection processed_enums = new EnumCollection();
foreach (var e in enums.Values)
{
// Note that we cannot modify a collection while iterating over it,
// so we keep a list of modified enums and remove/readd the
// modified items to refresh their keys.
string name = e.Name;
name = ReplaceName(nav, name);
name = TranslateEnumName(name);
e.Name = name;
processed_enums.Add(e.Name, e);
}
return processed_enums;
}
static string ReplaceName(XPathNavigator nav, string name)
{
var enum_override = nav.SelectSingleNode(String.Format(Path, name));
if (enum_override != null)
{
var name_override = enum_override.SelectSingleNode("name");
if (name_override != null)
{
name = name_override.Value;
}
}
return name;
}
public static string TranslateEnumName(string name)
{
if (Utilities.Keywords.Contains(name))
return name;
if (Char.IsDigit(name[0]))
name = Settings.ConstantPrefix + name;
StringBuilder translator = new StringBuilder(name.Length);
// Process according to these rules:
// 1. if current char is '_', '-' remove it and make next char uppercase
// 2. if current char is or '0-9' keep it and make next char uppercase.
// 3. if current character is uppercase make next char lowercase.
bool is_after_underscore_or_number = true;
bool is_previous_uppercase = false;
foreach (char c in name)
{
char char_to_add;
if (c == '_' || c == '-')
{
is_after_underscore_or_number = true;
continue; // skip this character
}
else if (Char.IsDigit(c))
{
is_after_underscore_or_number = true;
}
if (is_after_underscore_or_number)
char_to_add = Char.ToUpper(c);
else if (is_previous_uppercase)
char_to_add = Char.ToLower(c);
else
char_to_add = c;
translator.Append(char_to_add);
is_previous_uppercase = Char.IsUpper(c);
is_after_underscore_or_number = false;
}
// First letter should always be uppercase in order
// to conform to .Net style guidelines.
translator[0] = Char.ToUpper(translator[0]);
// Replace a number of words that do not play well
// with the previous process (i.e. they have two
// consecutive uppercase letters).
translator.Replace("Pname", "PName");
translator.Replace("AttribIp", "AttribIP");
translator.Replace("SRgb", "Srgb");
name = translator.ToString();
if (name.StartsWith(Settings.EnumPrefix))
name = name.Substring(Settings.EnumPrefix.Length);
return name;
}
static EnumCollection ProcessConstants(EnumCollection enums, XPathNavigator nav)
{
foreach (var e in enums.Values)
{
var processed_constants = new Dictionary<string, Constant>(e.ConstantCollection.Count);
foreach (Constant c in e.ConstantCollection.Values)
{
c.Name = TranslateConstantName(c.Name, false);
c.Value = TranslateConstantValue(c.Value);
if (!processed_constants.ContainsKey(c.Name))
processed_constants.Add(c.Name, c);
}
e.ConstantCollection = processed_constants;
var enum_override = nav.SelectSingleNode(String.Format(Path, e.Name));
foreach (Constant c in e.ConstantCollection.Values)
{
ReplaceConstant(enum_override, c);
ResolveBareAlias(c, enums);
}
}
foreach (var e in enums.Values)
{
ResolveAliases(e, enums);
}
return enums;
}
static void ReplaceConstant(XPathNavigator enum_override, Constant c)
{
if (enum_override != null)
{
XPathNavigator constant_override = enum_override.SelectSingleNode(String.Format("token[@name='{0}']", c.PreviousName)) ??
enum_override.SelectSingleNode(String.Format("token[@name={0}]", c.Name));
if (constant_override != null)
{
foreach (XPathNavigator node in constant_override.SelectChildren(XPathNodeType.Element))
{
switch (node.Name)
{
case "name": c.Name = (string)node.TypedValue; break;
case "value": c.Value = (string)node.TypedValue; break;
}
}
}
}
}
public static string TranslateConstantName(string s, bool isValue)
{
StringBuilder translator = new StringBuilder(s.Length);
// Translate the constant's name to match .Net naming conventions
bool name_is_all_caps = s.AsEnumerable().All(c => Char.IsLetter(c) ? Char.IsUpper(c) : true);
bool name_contains_underscore = s.Contains("_");
if ((Settings.Compatibility & Settings.Legacy.NoAdvancedEnumProcessing) == Settings.Legacy.None &&
(name_is_all_caps || name_contains_underscore))
{
bool next_char_uppercase = true;
bool is_after_digit = false;
if (!isValue && Char.IsDigit(s[0]))
s = Settings.ConstantPrefix + s;
foreach (char c in s)
{
if (c == '_' || c == '-')
{
next_char_uppercase = true;
continue; // do not add these chars to output
}
else if (Char.IsDigit(c))
{
translator.Append(c);
is_after_digit = true;
}
else
{
// Check for common 'digit'-'letter' abbreviations:
// 2D, 3D, R3G3B2, etc. The abbreviated characters
// should be made upper case.
if (is_after_digit && (c == 'D' || c == 'R' || c == 'G' || c == 'B' || c == 'A'))
{
next_char_uppercase = true;
}
translator.Append(next_char_uppercase ? Char.ToUpper(c) : Char.ToLower(c));
is_after_digit = next_char_uppercase = false;
}
}
translator[0] = Char.ToUpper(translator[0]);
}
else
translator.Append(s);
return translator.ToString();
}
public static string TranslateConstantValue(string value)
{
if (value.ToLower() == " 0xffffffffffffffff") System.Diagnostics.Debugger.Break();
// Remove decorations to get a pure number (e.g. 0x80u -> 80).
if (value.ToLower().StartsWith("0x"))
{
// Trim the unsigned or long specifiers used in C constants ('u' or 'ull').
if (value.ToLower().EndsWith("ull"))
value = value.Substring(0, value.Length - 3);
if (value.ToLower().EndsWith("u"))
value = value.Substring(0, value.Length - 1);
}
// Strip the prefix, if any.
if (value.StartsWith(Settings.ConstantPrefix))
value = value.Substring(Settings.ConstantPrefix.Length);
return TranslateConstantName(value, IsValue(value));
}
// There are cases when a value is an aliased constant, with no enum specified.
// (e.g. FOG_COORD_ARRAY_TYPE = GL_FOG_COORDINATE_ARRAY_TYPE)
// In this case try searching all enums for the correct constant to alias (stupid opengl specs).
// This turns every bare alias into a normal alias that is processed afterwards.
static void ResolveBareAlias(Constant c, EnumCollection enums)
{
// Constants are considered bare aliases when they don't have a reference and
// their values are non-numeric.
if (String.IsNullOrEmpty(c.Reference) && !Char.IsDigit(c.Value[0]))
{
// Skip generic GLenum, as this doesn't help resolve references.
foreach (Enum e in enums.Values.Where(e => e.Name != "GLenum"))
{
if (e.ConstantCollection.ContainsKey(c.Value))
{
c.Reference = e.Name;
break;
}
}
}
}
// Resolve 'use' tokens by searching and replacing the correct
// value from the enum collection.
// Tokens that can't be resolved are removed.
static void ResolveAliases(Enum e, EnumCollection enums)
{
// Note that we have the removal must be a separate step, since
// we cannot modify a collection while iterating with foreach.
var broken_references = e.ConstantCollection.Values
.Where(c => !Constant.TranslateConstantWithReference(c, enums, null))
.Select(c => c).ToList();
foreach (var c in broken_references)
{
Console.WriteLine("[Warning] Reference {0} not found for token {1}.", c.Reference, c);
e.ConstantCollection.Remove(c.Name);
}
}
static bool IsValue(string test)
{
ulong number;
// Check if the result is a number.
return UInt64.TryParse(test.ToLower().Replace("0x", String.Empty),
NumberStyles.AllowHexSpecifier, null, out number);
}
}
}

View file

@ -0,0 +1,689 @@
#region License
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2010 the Open Toolkit library.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text.RegularExpressions;
using System.Xml.XPath;
using Bind.Structures;
using Delegate = Bind.Structures.Delegate;
namespace Bind
{
class FuncProcessor
{
const string Path = "/overrides/replace/function[@name='{0}' and @extension='{1}']";
static readonly Regex Endings =
new Regex(@"((((d|f|fi)|u?[isb])_?v?)|v)", RegexOptions.Compiled | RegexOptions.RightToLeft);
static readonly Regex EndingsNotToTrim =
new Regex("(ib|[tdrey]s|[eE]n[vd]|bled|Flag|Tess|Status|Pixels|Instanced|Indexed|Varyings|Boolean|IDs)", RegexOptions.Compiled | RegexOptions.RightToLeft);
static readonly Regex EndingsAddV = new Regex("^0", RegexOptions.Compiled);
XPathDocument Overrides { get; set; }
public FuncProcessor(XPathDocument overrides)
{
if (overrides == null)
throw new ArgumentNullException("overrides");
Overrides = overrides;
}
public FunctionCollection Process(DelegateCollection delegates, EnumCollection enums)
{
Console.WriteLine("Processing delegates.");
var nav = Overrides.CreateNavigator();
foreach (var d in delegates.Values)
{
TranslateReturnType(nav, d, enums);
TranslateParameters(nav, d, enums);
}
Console.WriteLine("Generating wrappers.");
var wrappers = CreateWrappers(delegates, enums);
Console.WriteLine("Creating CLS compliant overloads.");
wrappers = CreateCLSCompliantWrappers(wrappers, enums);
Console.WriteLine("Removing non-CLS compliant duplicates.");
return MarkCLSCompliance(wrappers);
}
// Trims unecessary suffices from the specified OpenGL function name.
static string TrimName(string name, bool keep_extension)
{
string trimmed_name = Utilities.StripGL2Extension(name);
string extension = Utilities.GetGL2Extension(name);
// Note: some endings should not be trimmed, for example: 'b' from Attrib.
// Check the endingsNotToTrim regex for details.
Match m = EndingsNotToTrim.Match(trimmed_name);
if ((m.Index + m.Length) != trimmed_name.Length)
{
m = Endings.Match(trimmed_name);
if (m.Length > 0 && m.Index + m.Length == trimmed_name.Length)
{
// Only trim endings, not internal matches.
if (m.Value[m.Length - 1] == 'v' && EndingsAddV.IsMatch(name) &&
!name.StartsWith("Get") && !name.StartsWith("MatrixIndex"))
{
// Only trim ending 'v' when there is a number
trimmed_name = trimmed_name.Substring(0, m.Index) + "v";
}
else
{
if (!trimmed_name.EndsWith("xedv"))
{
trimmed_name = trimmed_name.Substring(0, m.Index);
}
else
{
trimmed_name = trimmed_name.Substring(0, m.Index + 1);
}
}
}
}
return trimmed_name;
}
static XPathNavigator GetFuncOverride(XPathNavigator nav, Delegate d)
{
string name = TrimName(d.Name, false);
string ext = d.Extension;
var function_override =
nav.SelectSingleNode(String.Format(Path, name, ext)) ??
nav.SelectSingleNode(String.Format(Path, d.Name, ext)) ??
nav.SelectSingleNode(String.Format(Path, Utilities.StripGL2Extension(d.Name), ext));
return function_override;
}
// Translates the opengl return type to the equivalent C# type.
//
// First, we use the official typemap (gl.tm) to get the correct type.
// Then we override this, when it is:
// 1) A string (we have to use Marshal.PtrToStringAnsi, to avoid heap corruption)
// 2) An array (translates to IntPtr)
// 3) A generic object or void* (translates to IntPtr)
// 4) A GLenum (translates to int on Legacy.Tao or GL.Enums.GLenum otherwise).
// Return types must always be CLS-compliant, because .Net does not support overloading on return types.
static void TranslateReturnType(XPathNavigator nav, Delegate d, EnumCollection enums)
{
var function_override = GetFuncOverride(nav, d);
if (function_override != null)
{
XPathNavigator return_override = function_override.SelectSingleNode("returns");
if (return_override != null)
{
d.ReturnType.CurrentType = return_override.Value;
}
}
d.ReturnType.Translate(nav, d.Category, enums);
if (d.ReturnType.CurrentType.ToLower().Contains("void") && d.ReturnType.Pointer != 0)
{
d.ReturnType.QualifiedType = "System.IntPtr";
d.ReturnType.WrapperType = WrapperTypes.GenericReturnType;
}
if (d.ReturnType.CurrentType.ToLower().Contains("string"))
{
d.ReturnType.QualifiedType = "System.IntPtr";
d.ReturnType.WrapperType = WrapperTypes.StringReturnType;
}
if (d.ReturnType.CurrentType.ToLower() == "object")
{
d.ReturnType.QualifiedType = "System.IntPtr";
d.ReturnType.WrapperType |= WrapperTypes.GenericReturnType;
}
if (d.ReturnType.CurrentType.Contains("GLenum"))
{
if ((Settings.Compatibility & Settings.Legacy.ConstIntEnums) == Settings.Legacy.None)
d.ReturnType.QualifiedType = String.Format("{0}.{1}", Settings.EnumsOutput, Settings.CompleteEnumName);
else
d.ReturnType.QualifiedType = "int";
}
d.ReturnType.CurrentType = d.ReturnType.GetCLSCompliantType();
}
static void TranslateParameters(XPathNavigator nav, Delegate d, EnumCollection enums)
{
var function_override = GetFuncOverride(nav, d);
for (int i = 0; i < d.Parameters.Count; i++)
{
if (function_override != null)
{
XPathNavigator param_override = function_override.SelectSingleNode(
String.Format("param[@name='{0}']", d.Parameters[i].Name));
if (param_override != null)
{
foreach (XPathNavigator node in param_override.SelectChildren(XPathNodeType.Element))
{
switch (node.Name)
{
case "type":
d.Parameters[i].CurrentType = (string)node.TypedValue;
break;
case "name":
d.Parameters[i].Name = (string)node.TypedValue;
break;
case "flow":
d.Parameters[i].Flow = Parameter.GetFlowDirection((string)node.TypedValue);
break;
}
}
}
}
d.Parameters[i].Translate(nav, d.Category, enums);
if (d.Parameters[i].CurrentType == "UInt16" && d.Name.Contains("LineStipple"))
d.Parameters[i].WrapperType = WrapperTypes.UncheckedParameter;
}
}
static FunctionCollection CreateWrappers(DelegateCollection delegates, EnumCollection enums)
{
var wrappers = new FunctionCollection();
foreach (var d in delegates.Values)
{
wrappers.AddRange(CreateNormalWrappers(d, enums));
}
return wrappers;
}
static FunctionCollection CreateCLSCompliantWrappers(FunctionCollection functions, EnumCollection enums)
{
// If the function is not CLS-compliant (e.g. it contains unsigned parameters)
// we need to create a CLS-Compliant overload. However, we should only do this
// iff the opengl function does not contain unsigned/signed overloads itself
// to avoid redefinitions.
var wrappers = new FunctionCollection();
foreach (var list in functions.Values)
{
foreach (var f in list)
{
wrappers.AddChecked(f);
if (!f.CLSCompliant)
{
Function cls = new Function(f);
cls.Body.Clear();
CreateBody(cls, true, enums);
bool modified = false;
for (int i = 0; i < f.Parameters.Count; i++)
{
cls.Parameters[i].CurrentType = cls.Parameters[i].GetCLSCompliantType();
if (cls.Parameters[i].CurrentType != f.Parameters[i].CurrentType)
modified = true;
}
if (modified)
wrappers.AddChecked(cls);
}
}
}
return wrappers;
}
static FunctionCollection MarkCLSCompliance(FunctionCollection collection)
{
//foreach (var w in
// (from list in collection
// from w1 in list.Value
// from w2 in list.Value
// where
// w1.TrimmedName == w2.TrimmedName &&
// w1.Parameters.Count == w2.Parameters.Count &&
// ParametersDifferOnlyInReference(w1.Parameters, w2.Parameters)
// select !w1.Parameters.HasReferenceParameters ? w1 : w2))
// {
// results.Add(w);
// }
foreach (List<Function> wrappers in collection.Values)
{
restart:
for (int i = 0; i < wrappers.Count; i++)
{
for (int j = i + 1; j < wrappers.Count; j++)
{
if (wrappers[i].TrimmedName == wrappers[j].TrimmedName && wrappers[i].Parameters.Count == wrappers[j].Parameters.Count)
{
bool function_i_is_problematic = false;
bool function_j_is_problematic = false;
int k;
for (k = 0; k < wrappers[i].Parameters.Count; k++)
{
if (wrappers[i].Parameters[k].CurrentType != wrappers[j].Parameters[k].CurrentType)
break;
if (wrappers[i].Parameters[k].DiffersOnlyOnReference(wrappers[j].Parameters[k]))
if (wrappers[i].Parameters[k].Reference)
function_i_is_problematic = true;
else
function_j_is_problematic = true;
}
if (k == wrappers[i].Parameters.Count)
{
if (function_i_is_problematic)
wrappers.RemoveAt(i);
//wrappers[i].CLSCompliant = false;
if (function_j_is_problematic)
wrappers.RemoveAt(j);
//wrappers[j].CLSCompliant = false;
if (function_i_is_problematic || function_j_is_problematic)
goto restart;
}
}
}
}
}
return collection;
}
static IEnumerable<Function> CreateNormalWrappers(Delegate d, EnumCollection enums)
{
Function f = new Function(d);
WrapReturnType(f);
foreach (var wrapper in WrapParameters(f, enums))
{
yield return wrapper;
}
}
public static IEnumerable<Function> WrapParameters(Function func, EnumCollection enums)
{
Function f;
if (func.Parameters.HasPointerParameters)
{
Function _this = new Function(func);
// Array overloads
foreach (Parameter p in _this.Parameters)
{
if (p.WrapperType == WrapperTypes.ArrayParameter && p.ElementCount != 1)
{
p.Reference = false;
p.Array++;
p.Pointer--;
}
}
f = new Function(_this);
CreateBody(f, false, enums);
yield return f;
foreach (var w in WrapVoidPointers(new Function(f), enums))
yield return w;
_this = new Function(func);
// Reference overloads
foreach (Parameter p in _this.Parameters)
{
if (p.WrapperType == WrapperTypes.ArrayParameter)
{
p.Reference = true;
p.Array--;
p.Pointer--;
}
}
f = new Function(_this);
CreateBody(f, false, enums);
yield return f;
foreach (var w in WrapVoidPointers(new Function(f), enums))
yield return w;
_this = func;
// Pointer overloads
// Should be last to work around Intellisense bug, where
// array overloads are not reported if there is a pointer overload.
foreach (Parameter p in _this.Parameters)
{
if (p.WrapperType == WrapperTypes.ArrayParameter)
{
p.Reference = false;
//p.Array--;
//p.Pointer++;
}
}
f = new Function(_this);
CreateBody(f, false, enums);
yield return f;
foreach (var w in WrapVoidPointers(new Function(f), enums))
yield return w;
}
else
{
f = new Function(func);
CreateBody(f, false, enums);
yield return f;
}
}
static int index;
static IEnumerable<Function> WrapVoidPointers(Function func, EnumCollection enums)
{
if (index >= 0 && index < func.Parameters.Count)
{
if (func.Parameters[index].WrapperType == WrapperTypes.GenericParameter)
{
// Recurse to the last parameter
++index;
foreach (var w in WrapVoidPointers(func, enums))
yield return w;
--index;
// On stack rewind, create generic wrappers
func.Parameters[index].Reference = true;
func.Parameters[index].Array = 0;
func.Parameters[index].Pointer = 0;
func.Parameters[index].Generic = true;
func.Parameters[index].CurrentType = "T" + index.ToString();
func.Parameters[index].Flow = FlowDirection.Undefined;
func.Parameters.Rebuild = true;
CreateBody(func, false, enums);
yield return new Function(func);
func.Parameters[index].Reference = false;
func.Parameters[index].Array = 1;
func.Parameters[index].Pointer = 0;
func.Parameters[index].Generic = true;
func.Parameters[index].CurrentType = "T" + index.ToString();
func.Parameters[index].Flow = FlowDirection.Undefined;
func.Parameters.Rebuild = true;
CreateBody(func, false, enums);
yield return new Function(func);
func.Parameters[index].Reference = false;
func.Parameters[index].Array = 2;
func.Parameters[index].Pointer = 0;
func.Parameters[index].Generic = true;
func.Parameters[index].CurrentType = "T" + index.ToString();
func.Parameters[index].Flow = FlowDirection.Undefined;
func.Parameters.Rebuild = true;
CreateBody(func, false, enums);
yield return new Function(func);
func.Parameters[index].Reference = false;
func.Parameters[index].Array = 3;
func.Parameters[index].Pointer = 0;
func.Parameters[index].Generic = true;
func.Parameters[index].CurrentType = "T" + index.ToString();
func.Parameters[index].Flow = FlowDirection.Undefined;
func.Parameters.Rebuild = true;
CreateBody(func, false, enums);
yield return new Function(func);
}
else
{
// Recurse to the last parameter
++index;
foreach (var w in WrapVoidPointers(func, enums))
yield return w;
--index;
}
}
}
static void WrapReturnType(Function func)
{
switch (func.ReturnType.WrapperType)
{
case WrapperTypes.StringReturnType:
func.ReturnType.QualifiedType = "String";
break;
}
}
readonly static List<string> handle_statements = new List<string>();
readonly static List<string> handle_release_statements = new List<string>();
readonly static List<string> fixed_statements = new List<string>();
readonly static List<string> assign_statements = new List<string>();
// For example, if parameter foo has indirection level = 1, then it
// is consumed as 'foo*' in the fixed_statements and the call string.
readonly static string[] indirection_levels = new string[] { "", "*", "**", "***", "****" };
static void CreateBody(Function func, bool wantCLSCompliance, EnumCollection enums)
{
Function f = new Function(func);
f.Body.Clear();
handle_statements.Clear();
handle_release_statements.Clear();
fixed_statements.Clear();
assign_statements.Clear();
// Obtain pointers by pinning the parameters
foreach (Parameter p in f.Parameters)
{
if (p.NeedsPin)
{
if (p.WrapperType == WrapperTypes.GenericParameter)
{
// Use GCHandle to obtain pointer to generic parameters and 'fixed' for arrays.
// This is because fixed can only take the address of fields, not managed objects.
handle_statements.Add(String.Format(
"{0} {1}_ptr = {0}.Alloc({1}, GCHandleType.Pinned);",
"GCHandle", p.Name));
handle_release_statements.Add(String.Format("{0}_ptr.Free();", p.Name));
// Due to the GCHandle-style pinning (which boxes value types), we need to assign the modified
// value back to the reference parameter (but only if it has an out or in/out flow direction).
if ((p.Flow == FlowDirection.Out || p.Flow == FlowDirection.Undefined) && p.Reference)
{
assign_statements.Add(String.Format(
"{0} = ({1}){0}_ptr.Target;",
p.Name, p.QualifiedType));
}
// Note! The following line modifies f.Parameters, *not* this.Parameters
p.Name = "(IntPtr)" + p.Name + "_ptr.AddrOfPinnedObject()";
}
else if (p.WrapperType == WrapperTypes.PointerParameter ||
p.WrapperType == WrapperTypes.ArrayParameter ||
p.WrapperType == WrapperTypes.ReferenceParameter)
{
// A fixed statement is issued for all non-generic pointers, arrays and references.
fixed_statements.Add(String.Format(
"fixed ({0}{3} {1} = {2})",
wantCLSCompliance && !p.CLSCompliant ? p.GetCLSCompliantType() : p.QualifiedType,
p.Name + "_ptr",
p.Array > 0 ? p.Name : "&" + p.Name,
indirection_levels[p.IndirectionLevel]));
if (p.Name == "pixels_ptr")
System.Diagnostics.Debugger.Break();
// Arrays are not value types, so we don't need to do anything for them.
// Pointers are passed directly by value, so we don't need to assign them back either (they don't change).
if ((p.Flow == FlowDirection.Out || p.Flow == FlowDirection.Undefined) && p.Reference)
{
assign_statements.Add(String.Format("{0} = *{0}_ptr;", p.Name));
}
p.Name = p.Name + "_ptr";
}
else
{
throw new ApplicationException("Unknown parameter type");
}
}
}
// Automatic OpenGL error checking.
// See OpenTK.Graphics.ErrorHelper for more information.
// Make sure that no error checking is added to the GetError function,
// as that would cause infinite recursion!
if ((Settings.Compatibility & Settings.Legacy.NoDebugHelpers) == 0)
{
if (f.TrimmedName != "GetError")
{
f.Body.Add("#if DEBUG");
f.Body.Add("using (new ErrorHelper(GraphicsContext.CurrentContext))");
f.Body.Add("{");
if (f.TrimmedName == "Begin")
f.Body.Add("GraphicsContext.CurrentContext.ErrorChecking = false;");
f.Body.Add("#endif");
}
}
if (!f.Unsafe && fixed_statements.Count > 0)
{
f.Body.Add("unsafe");
f.Body.Add("{");
f.Body.Indent();
}
if (fixed_statements.Count > 0)
{
f.Body.AddRange(fixed_statements);
f.Body.Add("{");
f.Body.Indent();
}
if (handle_statements.Count > 0)
{
f.Body.AddRange(handle_statements);
f.Body.Add("try");
f.Body.Add("{");
f.Body.Indent();
}
// Hack: When creating untyped enum wrappers, it is possible that the wrapper uses an "All"
// enum, while the delegate uses a specific enum (e.g. "TextureUnit"). For this reason, we need
// to modify the parameters before generating the call string.
// Note: We cannot generate a callstring using WrappedDelegate directly, as its parameters will
// typically be different than the parameters of the wrapper. We need to modify the parameters
// of the wrapper directly.
if ((Settings.Compatibility & Settings.Legacy.KeepUntypedEnums) != 0)
{
int parameter_index = -1; // Used for comparing wrapper parameters with delegate parameters
foreach (Parameter p in f.Parameters)
{
parameter_index++;
if (IsEnum(p.Name, enums) && p.QualifiedType != f.WrappedDelegate.Parameters[parameter_index].QualifiedType)
{
p.QualifiedType = f.WrappedDelegate.Parameters[parameter_index].QualifiedType;
}
}
}
if (assign_statements.Count > 0)
{
// Call function
string method_call = f.CallString();
if (f.ReturnType.CurrentType.ToLower().Contains("void"))
f.Body.Add(String.Format("{0};", method_call));
else if (func.ReturnType.CurrentType.ToLower().Contains("string"))
f.Body.Add(String.Format("{0} {1} = null; unsafe {{ {1} = new string((sbyte*){2}); }}",
func.ReturnType.QualifiedType, "retval", method_call));
else
f.Body.Add(String.Format("{0} {1} = {2};", f.ReturnType.QualifiedType, "retval", method_call));
// Assign out parameters
f.Body.AddRange(assign_statements);
// Return
if (!f.ReturnType.CurrentType.ToLower().Contains("void"))
{
f.Body.Add("return retval;");
}
}
else
{
// Call function and return
if (f.ReturnType.CurrentType.ToLower().Contains("void"))
f.Body.Add(String.Format("{0};", f.CallString()));
else if (func.ReturnType.CurrentType.ToLower().Contains("string"))
f.Body.Add(String.Format("unsafe {{ return new string((sbyte*){0}); }}",
f.CallString()));
else
f.Body.Add(String.Format("return {0};", f.CallString()));
}
// Free all allocated GCHandles
if (handle_statements.Count > 0)
{
f.Body.Unindent();
f.Body.Add("}");
f.Body.Add("finally");
f.Body.Add("{");
f.Body.Indent();
f.Body.AddRange(handle_release_statements);
f.Body.Unindent();
f.Body.Add("}");
}
if (!f.Unsafe && fixed_statements.Count > 0)
{
f.Body.Unindent();
f.Body.Add("}");
}
if (fixed_statements.Count > 0)
{
f.Body.Unindent();
f.Body.Add("}");
}
if ((Settings.Compatibility & Settings.Legacy.NoDebugHelpers) == 0)
{
if (f.TrimmedName != "GetError")
{
f.Body.Add("#if DEBUG");
if (f.TrimmedName == "End")
f.Body.Add("GraphicsContext.CurrentContext.ErrorChecking = true;");
f.Body.Add("}");
f.Body.Add("#endif");
}
}
func.Body = f.Body;
}
static bool IsEnum(string s, EnumCollection enums)
{
return enums.ContainsKey(s);
}
}
}

View file

@ -0,0 +1,59 @@
#region License
//
// The Open Toolkit Library License
//
// Copyright (c) 2006 - 2010 the Open Toolkit library.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights to
// use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
// the Software, and to permit persons to whom the Software is furnished to do
// so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
// OTHER DEALINGS IN THE SOFTWARE.
//
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Bind.GL2
{
class GL4Generator : ES.ESGenerator
{
public GL4Generator(string name, string dirname)
: base(name, dirname)
{
glTypemap = "GL2/gl.tm";
csTypemap = "csharp.tm";
enumSpec = "GL2/signatures.xml";
enumSpecExt = String.Empty;
glSpec = "GL2/signatures.xml";
glSpecExt = String.Empty;
Settings.OverridesFile = "GL2/gloverrides.xml";
Settings.ImportsFile = "GLCore.cs";
Settings.DelegatesFile = "GLDelegates.cs";
Settings.EnumsFile = "GLEnums.cs";
Settings.WrappersFile = "GL.cs";
Settings.ImportsClass = "Core";
Settings.DelegatesClass = "Delegates";
Settings.OutputClass = "GL";
}
}
}

View file

@ -20,7 +20,7 @@ namespace Bind.GL2
{
class Generator : IBind
{
#region --- Fields ---
#region Fields
protected static string glTypemap = "GL2/gl.tm";
protected static string csTypemap = "csharp.tm";
@ -29,22 +29,18 @@ namespace Bind.GL2
protected static string glSpec = "GL2/gl.spec";
protected static string glSpecExt = "";
protected static string importsFile = "GLCore.cs";
protected static string delegatesFile = "GLDelegates.cs";
protected static string enumsFile = "GLEnums.cs";
protected static string wrappersFile = "GL.cs";
protected static string functionOverridesFile = "GL2/gloverrides.xml";
protected static string loadAllFuncName = "LoadAll";
protected static Regex enumToDotNet = new Regex("_[a-z|A-Z]?", RegexOptions.Compiled);
protected static readonly char[] numbers = "0123456789".ToCharArray();
//protected static readonly Dictionary<string, string> doc_replacements;
protected ISpecReader SpecReader = new XmlSpecReader();
#endregion
#region --- Constructors ---
#region Constructors
public Generator()
{
@ -57,775 +53,38 @@ namespace Bind.GL2
{
// Defaults
}
Settings.ImportsFile = "GLCore.cs";
Settings.DelegatesFile = "GLDelegates.cs";
Settings.EnumsFile = "GLEnums.cs";
Settings.WrappersFile = "GL.cs";
}
#endregion
#region public void Process()
#region IBind Members
public DelegateCollection Delegates { get; private set; }
public EnumCollection Enums { get; private set; }
public FunctionCollection Wrappers { get; private set; }
public virtual void Process()
{
// Matches functions that cannot have their trailing 'v' trimmed for CLS-Compliance reasons.
// Built through trial and error :)
//Function.endingsAddV =
// new Regex(@"(Coord1|Attrib(I?)1(u?)|Stream1|Uniform2(u?)|(Point|Convolution|Transform|Sprite|List|Combiner|Tex)Parameter|Fog(Coord)?.*|VertexWeight|(Fragment)?Light(Model)?|Material|ReplacementCodeu?b?|Tex(Gen|Env)|Indexu?|TextureParameter.v)",
// RegexOptions.Compiled);
var overrides = new XPathDocument(Path.Combine(Settings.InputPath, Settings.OverridesFile));
Type.Initialize(glTypemap, csTypemap);
Enum.Initialize(enumSpec, enumSpecExt);
Enum.GLEnums.Translate(new XPathDocument(Path.Combine(Settings.InputPath, functionOverridesFile)));
Function.Initialize();
Delegate.Initialize(glSpec, glSpecExt);
using (StreamReader sr = Utilities.OpenSpecFile(Settings.InputPath, glTypemap))
Type.GLTypes = SpecReader.ReadTypeMap(sr);
using (StreamReader sr = Utilities.OpenSpecFile(Settings.InputPath, csTypemap))
Type.CSTypes = SpecReader.ReadCSTypeMap(sr);
using (var sr = new StreamReader(Path.Combine(Settings.InputPath, enumSpec)))
Enums = SpecReader.ReadEnums(sr);
using (var sr = new StreamReader(Path.Combine(Settings.InputPath, glSpec)))
Delegates = SpecReader.ReadDelegates(sr);
WriteBindings(
Delegate.Delegates,
Function.Wrappers,
Enum.GLEnums);
Enums = new EnumProcessor(overrides).Process(Enums);
Wrappers = new FuncProcessor(overrides).Process(Delegates, Enums);
}
#endregion
#region private void Translate()
#if false
protected virtual void Translate()
{
Bind.Structures.Enum.GLEnums.Translate();
}
#endif
#endregion
#region ISpecReader Members
#region public virtual DelegateCollection ReadDelegates(StreamReader specFile)
public virtual DelegateCollection ReadDelegates(StreamReader specFile)
{
Console.WriteLine("Reading function specs.");
DelegateCollection delegates = new DelegateCollection();
XPathDocument function_overrides = new XPathDocument(Path.Combine(Settings.InputPath, functionOverridesFile));
do
{
string line = NextValidLine(specFile);
if (String.IsNullOrEmpty(line))
break;
while (line.Contains("(") && !specFile.EndOfStream)
{
// Get next OpenGL function
Delegate d = new Delegate();
// Get function name:
d.Name = line.Split(Utilities.Separators, StringSplitOptions.RemoveEmptyEntries)[0];
do
{
// Get function parameters and return value
line = specFile.ReadLine();
List<string> words = new List<string>(
line.Replace('\t', ' ').Split(Utilities.Separators, StringSplitOptions.RemoveEmptyEntries)
);
if (words.Count == 0)
break;
// Identify line:
switch (words[0])
{
case "return": // Line denotes return value
d.ReturnType.CurrentType = words[1];
break;
case "param": // Line denotes parameter
Parameter p = new Parameter();
p.Name = Utilities.Keywords.Contains(words[1]) ? "@" + words[1] : words[1];
p.CurrentType = words[2];
p.Pointer += words[4].Contains("array") ? 1 : 0;
p.Pointer += words[4].Contains("reference") ? 1 : 0;
if (p.Pointer != 0 && words.Count > 5 && words[5].Contains("[1]"))
p.ElementCount = 1;
p.Flow = words[3] == "in" ? FlowDirection.In : FlowDirection.Out;
d.Parameters.Add(p);
break;
// GetTexParameterIivEXT and GetTexParameterIuivEXT define two(!) versions (why?)
case "version": // Line denotes function version (i.e. 1.0, 1.2, 1.5)
d.Version = words[1];
break;
case "category":
d.Category = words[1];
break;
}
}
while (!specFile.EndOfStream);
d.Translate(function_overrides);
delegates.Add(d);
}
}
while (!specFile.EndOfStream);
return delegates;
}
#endregion
#region public virtual EnumCollection ReadEnums(StreamReader specFile)
public virtual EnumCollection ReadEnums(StreamReader specFile)
{
Trace.WriteLine("Reading opengl enumerant specs.");
Trace.Indent();
EnumCollection enums = new EnumCollection();
// complete_enum contains all opengl enumerants.
Enum complete_enum = new Enum();
complete_enum.Name = Settings.CompleteEnumName;
do
{
string line = NextValidLine(specFile);
if (String.IsNullOrEmpty(line))
break;
line = line.Replace('\t', ' ');
// We just encountered the start of a new enumerant:
while (!String.IsNullOrEmpty(line) && line.Contains("enum"))
{
string[] words = line.Split(Utilities.Separators, StringSplitOptions.RemoveEmptyEntries);
if (words.Length == 0)
continue;
// Declare a new enumerant
Enum e = new Enum();
e.Name = Char.IsDigit(words[0][0]) ? Settings.ConstantPrefix + words[0] : words[0];
// And fill in the values for this enumerant
do
{
line = NextValidLine(specFile);
if (String.IsNullOrEmpty(line) || line.StartsWith("#"))
continue;
if (line.Contains("enum:") || specFile.EndOfStream)
break;
line = line.Replace('\t', ' ');
words = line.Split(Utilities.Separators, StringSplitOptions.RemoveEmptyEntries);
if (words.Length == 0)
continue;
// If we reach this point, we have found a new value for the current enumerant
Constant c = new Constant();
if (line.Contains("="))
{
// Trim the name's prefix, but only if not in Tao compat mode.
if (Settings.Compatibility == Settings.Legacy.Tao)
{
}
else
{
if (words[0].StartsWith(Settings.ConstantPrefix))
words[0] = words[0].Substring(Settings.ConstantPrefix.Length);
if (Char.IsDigit(words[0][0]))
words[0] = Settings.ConstantPrefix + words[0];
}
c.Name = words[0];
c.Value = words[2];
}
else if (words[0] == "use")
{
// Trim the prefix.
if (words[2].StartsWith(Settings.ConstantPrefix))
words[2] = words[2].Substring(Settings.ConstantPrefix.Length);
// If the remaining string starts with a digit, we were wrong above.
// Re-add the "GL_"
if (Char.IsDigit(words[2][0]))
words[2] = Settings.ConstantPrefix + words[2];
c.Name = words[2];
c.Reference = words[1];
c.Value = words[2];
}
else
{
// Typical cause is hand-editing the specs and forgetting to add an '=' sign.
throw new InvalidOperationException(String.Format(
"[Error] Invalid constant definition: \"{0}\"", line));
}
//if (!String.IsNullOrEmpty(c.Name) && !e.Members.Contains.Contains(c))
//SpecTranslator.Merge(e.Members, c);
if (!e.ConstantCollection.ContainsKey(c.Name))
e.ConstantCollection.Add(c.Name, c);
else
Trace.WriteLine(String.Format(
"Spec error: Constant {0} defined twice in enum {1}, discarding last definition.",
c.Name, e.Name));
// Insert the current constant in the list of all constants.
//SpecTranslator.Merge(complete_enum.Members, c);
complete_enum = Utilities.Merge(complete_enum, c);
}
while (!specFile.EndOfStream);
// At this point, the complete value list for the current enumerant has been read, so add this
// enumerant to the list.
//e.StartDirectives.Add(new CodeRegionDirective(CodeRegionMode.Start, "public enum " + e.Name));
//e.EndDirectives.Add(new CodeRegionDirective(CodeRegionMode.End, "public enum " + e.Name));
// (disabled) Hack - discard Boolean enum, it fsucks up the fragile translation code ahead.
//if (!e.Name.Contains("Bool"))
//Utilities.Merge(enums, e);
//e.Translate();
if (!enums.ContainsKey(e.Name))
enums.Add(e.Name, e);
else
{
// The enum already exists, merge constants.
foreach (Constant t in e.ConstantCollection.Values)
Utilities.Merge(enums[e.Name], t);
}
}
}
while (!specFile.EndOfStream);
enums.Add(complete_enum.Name, complete_enum);
Trace.Unindent();
return enums;
}
#endregion
#region public virtual Dictionary<string, string> ReadTypeMap(StreamReader specFile)
public virtual Dictionary<string, string> ReadTypeMap(StreamReader specFile)
{
Console.WriteLine("Reading opengl types.");
Dictionary<string, string> GLTypes = new Dictionary<string, string>();
if (specFile == null)
return GLTypes;
do
{
string line = specFile.ReadLine();
if (String.IsNullOrEmpty(line) || line.StartsWith("#"))
continue;
string[] words = line.Split(" ,*\t".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
if (words[0].ToLower() == "void")
{
// Special case for "void" -> "". We make it "void" -> "void"
GLTypes.Add(words[0], "void");
}
else if (words[0] == "VoidPointer" || words[0] == "ConstVoidPointer")
{
// "(Const)VoidPointer" -> "void*"
GLTypes.Add(words[0], "void*");
}
else if (words[0] == "CharPointer" || words[0] == "charPointerARB")
{
// The typematching logic cannot handle pointers to pointers, e.g. CharPointer* -> char** -> string* -> string[].
// Hence we give it a push.
// Note: When both CurrentType == "String" and Pointer == true, the typematching is hardcoded to use
// String[] or StringBuilder[].
GLTypes.Add(words[0], "String");
}
/*else if (words[0].Contains("Pointer"))
{
GLTypes.Add(words[0], words[1].Replace("Pointer", "*"));
}*/
else if (words[1].Contains("GLvoid"))
{
GLTypes.Add(words[0], "void");
}
else
{
GLTypes.Add(words[0], words[1]);
}
}
while (!specFile.EndOfStream);
return GLTypes;
}
#endregion
#region public virtual Dictionary<string, string> ReadCSTypeMap(StreamReader specFile)
public virtual Dictionary<string, string> ReadCSTypeMap(StreamReader specFile)
{
Dictionary<string, string> CSTypes = new Dictionary<string, string>();
Console.WriteLine("Reading C# types.");
while (!specFile.EndOfStream)
{
string line = specFile.ReadLine();
if (String.IsNullOrEmpty(line) || line.StartsWith("#"))
continue;
string[] words = line.Split(" ,\t".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
if (words.Length < 2)
continue;
if (((Settings.Compatibility & Settings.Legacy.NoBoolParameters) != Settings.Legacy.None) && words[1] == "bool")
words[1] = "Int32";
CSTypes.Add(words[0], words[1]);
}
return CSTypes;
}
#endregion
#region private string NextValidLine(StreamReader sr)
private string NextValidLine(StreamReader sr)
{
string line;
do
{
if (sr.EndOfStream)
return null;
line = sr.ReadLine().Trim();
if (String.IsNullOrEmpty(line) ||
line.StartsWith("#") || // Disregard comments.
line.StartsWith("passthru") || // Disregard passthru statements.
line.StartsWith("required-props:") ||
line.StartsWith("param:") ||
line.StartsWith("dlflags:") ||
line.StartsWith("glxflags:") ||
line.StartsWith("vectorequiv:") ||
//line.StartsWith("category:") ||
line.StartsWith("version:") ||
line.StartsWith("glxsingle:") ||
line.StartsWith("glxropcode:") ||
line.StartsWith("glxvendorpriv:") ||
line.StartsWith("glsflags:") ||
line.StartsWith("glsopcode:") ||
line.StartsWith("glsalias:") ||
line.StartsWith("wglflags:") ||
line.StartsWith("extension:") ||
line.StartsWith("alias:") ||
line.StartsWith("offset:"))
continue;
return line;
}
while (true);
}
#endregion
#endregion
#region ISpecWriter Members
#region void WriteBindings
public void WriteBindings(DelegateCollection delegates, FunctionCollection functions, EnumCollection enums)
{
Console.WriteLine("Writing bindings to {0}", Settings.OutputPath);
if (!Directory.Exists(Settings.OutputPath))
Directory.CreateDirectory(Settings.OutputPath);
string temp_enums_file = Path.GetTempFileName();
string temp_delegates_file = Path.GetTempFileName();
string temp_core_file = Path.GetTempFileName();
string temp_wrappers_file = Path.GetTempFileName();
// Enums
using (BindStreamWriter sw = new BindStreamWriter(temp_enums_file))
{
WriteLicense(sw);
sw.WriteLine("using System;");
sw.WriteLine();
if ((Settings.Compatibility & Settings.Legacy.NestedEnums) != Settings.Legacy.None)
{
sw.WriteLine("namespace {0}", Settings.OutputNamespace);
sw.WriteLine("{");
sw.Indent();
sw.WriteLine("static partial class {0}", Settings.OutputClass);
}
else
sw.WriteLine("namespace {0}", Settings.EnumsOutput);
sw.WriteLine("{");
sw.Indent();
WriteEnums(sw, Enum.GLEnums);
sw.Unindent();
if ((Settings.Compatibility & Settings.Legacy.NestedEnums) != Settings.Legacy.None)
{
sw.WriteLine("}");
sw.Unindent();
}
sw.WriteLine("}");
}
// Delegates
using (BindStreamWriter sw = new BindStreamWriter(temp_delegates_file))
{
WriteLicense(sw);
sw.WriteLine("namespace {0}", Settings.OutputNamespace);
sw.WriteLine("{");
sw.Indent();
sw.WriteLine("using System;");
sw.WriteLine("using System.Text;");
sw.WriteLine("using System.Runtime.InteropServices;");
sw.WriteLine("#pragma warning disable 0649");
WriteDelegates(sw, Delegate.Delegates);
sw.Unindent();
sw.WriteLine("}");
}
// Core
using (BindStreamWriter sw = new BindStreamWriter(temp_core_file))
{
WriteLicense(sw);
sw.WriteLine("namespace {0}", Settings.OutputNamespace);
sw.WriteLine("{");
sw.Indent();
//specWriter.WriteTypes(sw, Bind.Structures.Type.CSTypes);
sw.WriteLine("using System;");
sw.WriteLine("using System.Text;");
sw.WriteLine("using System.Runtime.InteropServices;");
WriteImports(sw, Delegate.Delegates);
sw.Unindent();
sw.WriteLine("}");
}
// Wrappers
using (BindStreamWriter sw = new BindStreamWriter(temp_wrappers_file))
{
WriteLicense(sw);
sw.WriteLine("namespace {0}", Settings.OutputNamespace);
sw.WriteLine("{");
sw.Indent();
sw.WriteLine("using System;");
sw.WriteLine("using System.Text;");
sw.WriteLine("using System.Runtime.InteropServices;");
WriteWrappers(sw, Function.Wrappers, Type.CSTypes);
sw.Unindent();
sw.WriteLine("}");
}
string output_enums = Path.Combine(Settings.OutputPath, enumsFile);
string output_delegates = Path.Combine(Settings.OutputPath, delegatesFile);
string output_core = Path.Combine(Settings.OutputPath, importsFile);
string output_wrappers = Path.Combine(Settings.OutputPath, wrappersFile);
if (File.Exists(output_enums)) File.Delete(output_enums);
if (File.Exists(output_delegates)) File.Delete(output_delegates);
if (File.Exists(output_core)) File.Delete(output_core);
if (File.Exists(output_wrappers)) File.Delete(output_wrappers);
File.Move(temp_enums_file, output_enums);
File.Move(temp_delegates_file, output_delegates);
File.Move(temp_core_file, output_core);
File.Move(temp_wrappers_file, output_wrappers);
}
#endregion
#region void WriteDelegates
public virtual void WriteDelegates(BindStreamWriter sw, DelegateCollection delegates)
{
Trace.WriteLine(String.Format("Writing delegates to:\t{0}.{1}.{2}", Settings.OutputNamespace, Settings.OutputClass, Settings.DelegatesClass));
sw.WriteLine("#pragma warning disable 3019"); // CLSCompliant attribute
sw.WriteLine("#pragma warning disable 1591"); // Missing doc comments
sw.WriteLine();
sw.WriteLine("partial class {0}", Settings.OutputClass);
sw.WriteLine("{");
sw.Indent();
sw.WriteLine("internal static partial class {0}", Settings.DelegatesClass);
sw.WriteLine("{");
sw.Indent();
foreach (Delegate d in delegates.Values)
{
sw.WriteLine("[System.Security.SuppressUnmanagedCodeSecurity()]");
sw.WriteLine("internal {0};", d.ToString());
sw.WriteLine("internal {0}static {1} {2}{1};", // = null
d.Unsafe ? "unsafe " : "",
d.Name,
Settings.FunctionPrefix);
}
sw.Unindent();
sw.WriteLine("}");
sw.Unindent();
sw.WriteLine("}");
}
#endregion
#region void WriteImports
public virtual void WriteImports(BindStreamWriter sw, DelegateCollection delegates)
{
Trace.WriteLine(String.Format("Writing imports to:\t{0}.{1}.{2}", Settings.OutputNamespace, Settings.OutputClass, Settings.ImportsClass));
sw.WriteLine("#pragma warning disable 3019"); // CLSCompliant attribute
sw.WriteLine("#pragma warning disable 1591"); // Missing doc comments
sw.WriteLine();
sw.WriteLine("partial class {0}", Settings.OutputClass);
sw.WriteLine("{");
sw.Indent();
sw.WriteLine();
sw.WriteLine("internal static partial class {0}", Settings.ImportsClass);
sw.WriteLine("{");
sw.Indent();
//sw.WriteLine("static {0}() {1} {2}", Settings.ImportsClass, "{", "}"); // Disable BeforeFieldInit
sw.WriteLine();
foreach (Delegate d in delegates.Values)
{
sw.WriteLine("[System.Security.SuppressUnmanagedCodeSecurity()]");
sw.WriteLine(
"[System.Runtime.InteropServices.DllImport({0}.Library, EntryPoint = \"{1}{2}\"{3})]",
Settings.OutputClass,
Settings.FunctionPrefix,
d.Name,
d.Name.EndsWith("W") || d.Name.EndsWith("A") ? ", CharSet = CharSet.Auto" : ", ExactSpelling = true"
);
sw.WriteLine("internal extern static {0};", d.DeclarationString());
}
sw.Unindent();
sw.WriteLine("}");
sw.Unindent();
sw.WriteLine("}");
}
#endregion
#region void WriteWrappers
public void WriteWrappers(BindStreamWriter sw, FunctionCollection wrappers, Dictionary<string, string> CSTypes)
{
Trace.WriteLine(String.Format("Writing wrappers to:\t{0}.{1}", Settings.OutputNamespace, Settings.OutputClass));
sw.WriteLine("#pragma warning disable 3019"); // CLSCompliant attribute
sw.WriteLine("#pragma warning disable 1591"); // Missing doc comments
sw.WriteLine("#pragma warning disable 1572"); // Wrong param comments
sw.WriteLine("#pragma warning disable 1573"); // Missing param comments
sw.WriteLine();
sw.WriteLine("partial class {0}", Settings.OutputClass);
sw.WriteLine("{");
sw.Indent();
//sw.WriteLine("static {0}() {1} {2}", className, "{", "}"); // Static init in GLHelper.cs
sw.WriteLine();
int current = 0;
foreach (string key in wrappers.Keys)
{
if (((Settings.Compatibility & Settings.Legacy.NoSeparateFunctionNamespaces) == Settings.Legacy.None) && key != "Core")
{
if (!Char.IsDigit(key[0]))
{
sw.WriteLine("public static partial class {0}", key);
}
else
{
// Identifiers cannot start with a number:
sw.WriteLine("public static partial class {0}{1}", Settings.ConstantPrefix, key);
}
sw.WriteLine("{");
sw.Indent();
}
wrappers[key].Sort();
foreach (Function f in wrappers[key])
{
current = WriteWrapper(sw, current, f);
}
if (((Settings.Compatibility & Settings.Legacy.NoSeparateFunctionNamespaces) == Settings.Legacy.None) && key != "Core")
{
sw.Unindent();
sw.WriteLine("}");
sw.WriteLine();
}
}
sw.Unindent();
sw.WriteLine("}");
}
private static int WriteWrapper(BindStreamWriter sw, int current, Function f)
{
if ((Settings.Compatibility & Settings.Legacy.NoDocumentation) == 0)
{
Console.WriteLine("Creating docs for #{0} ({1})", current++, f.Name);
WriteDocumentation(sw, f);
}
WriteMethod(sw, f);
return current;
}
private static void WriteMethod(BindStreamWriter sw, Function f)
{
if (!f.CLSCompliant)
{
sw.WriteLine("[System.CLSCompliant(false)]");
}
sw.WriteLine("[AutoGenerated(Category = \"{0}\", Version = \"{1}\", EntryPoint = \"{2}\")]",
f.Category, f.Version, Settings.FunctionPrefix + f.WrappedDelegate.Name);
sw.WriteLine("public static ");
sw.Write(f);
sw.WriteLine();
}
private static void WriteDocumentation(BindStreamWriter sw, Function f)
{
try
{
string path = Path.Combine(Settings.DocPath, Settings.FunctionPrefix + f.WrappedDelegate.Name + ".xml");
if (!File.Exists(path))
path = Path.Combine(Settings.DocPath, Settings.FunctionPrefix +
f.TrimmedName + ".xml");
if (!File.Exists(path))
path = Path.Combine(Settings.DocPath, Settings.FunctionPrefix + f.TrimmedName.TrimEnd(numbers) + ".xml");
if (File.Exists(path))
{
DocProcessor doc_processor = new DocProcessor(Path.Combine(Settings.DocPath, Settings.DocFile));
sw.WriteLine(doc_processor.ProcessFile(path));
}
}
catch (FileNotFoundException)
{ }
}
#endregion
#region void WriteTypes
public void WriteTypes(BindStreamWriter sw, Dictionary<string, string> CSTypes)
{
sw.WriteLine();
foreach (string s in CSTypes.Keys)
{
sw.WriteLine("using {0} = System.{1};", s, CSTypes[s]);
}
}
#endregion
#region void WriteEnums
public void WriteEnums(BindStreamWriter sw, EnumCollection enums)
{
//sw.WriteLine("#pragma warning disable 3019"); // CLSCompliant attribute
sw.WriteLine("#pragma warning disable 1591"); // Missing doc comments
sw.WriteLine();
if ((Settings.Compatibility & Settings.Legacy.NestedEnums) != Settings.Legacy.None)
Trace.WriteLine(String.Format("Writing enums to:\t{0}.{1}.{2}", Settings.OutputNamespace, Settings.OutputClass, Settings.NestedEnumsClass));
else
Trace.WriteLine(String.Format("Writing enums to:\t{0}", Settings.EnumsOutput));
if ((Settings.Compatibility & Settings.Legacy.ConstIntEnums) == Settings.Legacy.None)
{
if ((Settings.Compatibility & Settings.Legacy.NestedEnums) != Settings.Legacy.None &&
!String.IsNullOrEmpty(Settings.NestedEnumsClass))
{
sw.WriteLine("public class Enums");
sw.WriteLine("{");
sw.Indent();
}
foreach (Enum @enum in enums.Values)
{
sw.Write(@enum);
sw.WriteLine();
}
if ((Settings.Compatibility & Settings.Legacy.NestedEnums) != Settings.Legacy.None &&
!String.IsNullOrEmpty(Settings.NestedEnumsClass))
{
sw.Unindent();
sw.WriteLine("}");
}
}
else
{
// Tao legacy mode: dump all enums as constants in GLClass.
foreach (Constant c in enums[Settings.CompleteEnumName].ConstantCollection.Values)
{
// Print constants avoiding circular definitions
if (c.Name != c.Value)
{
sw.WriteLine(String.Format(
"public const int {0} = {2}((int){1});",
c.Name.StartsWith(Settings.ConstantPrefix) ? c.Name : Settings.ConstantPrefix + c.Name,
Char.IsDigit(c.Value[0]) ? c.Value : c.Value.StartsWith(Settings.ConstantPrefix) ? c.Value : Settings.ConstantPrefix + c.Value,
c.Unchecked ? "unchecked" : ""));
}
else
{
}
}
}
}
#endregion
#region void WriteLicense
public void WriteLicense(BindStreamWriter sw)
{
sw.WriteLine(File.ReadAllText(Path.Combine(Settings.InputPath, Settings.LicenseFile)));
sw.WriteLine();
}
#endregion
#endregion
}
}

View file

@ -122,6 +122,10 @@
<Compile Include="..\GlobalAssemblyInfo.cs">
<Link>Properties\GlobalAssemblyInfo.cs</Link>
</Compile>
<Compile Include="CppSpecWriter.cs" />
<Compile Include="CSharpSpecWriter.cs" />
<Compile Include="FuncProcessor.cs" />
<Compile Include="GL2\GL4Generator.cs" />
<Compile Include="IBind.cs">
<SubType>Code</SubType>
</Compile>
@ -137,6 +141,7 @@
<Compile Include="BindStreamWriter.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="EnumProcessor.cs" />
<Compile Include="Utilities.cs">
<SubType>Code</SubType>
</Compile>
@ -179,24 +184,11 @@
<Compile Include="ES\ESGenerator.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Glx\Generator.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Glu\Generator.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Wgl\Generator.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="XmlSpecReader.cs" />
<None Include="..\..\OpenTK.snk">
<Link>OpenTK.snk</Link>
</None>
<None Include="Specifications\GL2\enum.spec">
</None>
<None Include="Specifications\GL2\gl.spec">
</None>
<None Include="Specifications\GL2\enumext.spec">
</None>
<None Include="Specifications\GL2\gl.tm" />
<None Include="Specifications\Glx\glx.spec">
</None>
<None Include="Specifications\Glx\glxenum.spec">
@ -219,8 +211,6 @@
</None>
<None Include="Specifications\csharp.tm">
</None>
<None Include="Specifications\GL2\gl.tm">
</None>
<None Include="Specifications\Glx\glx.tm">
</None>
<None Include="Specifications\Glu\glu.tm">
@ -926,6 +916,127 @@
<None Include="Specifications\License.txt">
</None>
</ItemGroup>
<ItemGroup>
<None Include="Specifications\Docs\glActiveShaderProgram.xml" />
<None Include="Specifications\Docs\glBeginConditionalRender.xml" />
<None Include="Specifications\Docs\glBeginQueryIndexed.xml" />
<None Include="Specifications\Docs\glBeginTransformFeedback.xml" />
<None Include="Specifications\Docs\glBindBufferBase.xml" />
<None Include="Specifications\Docs\glBindBufferRange.xml" />
<None Include="Specifications\Docs\glBindFragDataLocation.xml" />
<None Include="Specifications\Docs\glBindFragDataLocationIndexed.xml" />
<None Include="Specifications\Docs\glBindFramebuffer.xml" />
<None Include="Specifications\Docs\glBindProgramPipeline.xml" />
<None Include="Specifications\Docs\glBindRenderbuffer.xml" />
<None Include="Specifications\Docs\glBindSampler.xml" />
<None Include="Specifications\Docs\glBindTransformFeedback.xml" />
<None Include="Specifications\Docs\glBindVertexArray.xml" />
<None Include="Specifications\Docs\glBlitFramebuffer.xml" />
<None Include="Specifications\Docs\glCheckFramebufferStatus.xml" />
<None Include="Specifications\Docs\glClampColor.xml" />
<None Include="Specifications\Docs\glClearBuffer.xml" />
<None Include="Specifications\Docs\glClientWaitSync.xml" />
<None Include="Specifications\Docs\glCopyBufferSubData.xml" />
<None Include="Specifications\Docs\glCreateShaderProgram.xml" />
<None Include="Specifications\Docs\glDeleteFramebuffers.xml" />
<None Include="Specifications\Docs\glDeleteProgramPipelines.xml" />
<None Include="Specifications\Docs\glDeleteRenderbuffers.xml" />
<None Include="Specifications\Docs\glDeleteSamplers.xml" />
<None Include="Specifications\Docs\glDeleteSync.xml" />
<None Include="Specifications\Docs\glDeleteTransformFeedbacks.xml" />
<None Include="Specifications\Docs\glDeleteVertexArrays.xml" />
<None Include="Specifications\Docs\glDepthRangeArray.xml" />
<None Include="Specifications\Docs\glDepthRangeIndexed.xml" />
<None Include="Specifications\Docs\glDrawArraysIndirect.xml" />
<None Include="Specifications\Docs\glDrawArraysInstanced.xml" />
<None Include="Specifications\Docs\glDrawElementsBaseVertex.xml" />
<None Include="Specifications\Docs\glDrawElementsIndirect.xml" />
<None Include="Specifications\Docs\glDrawElementsInstanced.xml" />
<None Include="Specifications\Docs\glDrawElementsInstancedBaseVertex.xml" />
<None Include="Specifications\Docs\glDrawRangeElementsBaseVertex.xml" />
<None Include="Specifications\Docs\glDrawTransformFeedback.xml" />
<None Include="Specifications\Docs\glDrawTransformFeedbackStream.xml" />
<None Include="Specifications\Docs\glFenceSync.xml" />
<None Include="Specifications\Docs\glFlushMappedBufferRange.xml" />
<None Include="Specifications\Docs\glFramebufferRenderbuffer.xml" />
<None Include="Specifications\Docs\glFramebufferTexture.xml" />
<None Include="Specifications\Docs\glFramebufferTextureFace.xml" />
<None Include="Specifications\Docs\glFramebufferTextureLayer.xml" />
<None Include="Specifications\Docs\glGenerateMipmap.xml" />
<None Include="Specifications\Docs\glGenFramebuffers.xml" />
<None Include="Specifications\Docs\glGenProgramPipelines.xml" />
<None Include="Specifications\Docs\glGenRenderbuffers.xml" />
<None Include="Specifications\Docs\glGenSamplers.xml" />
<None Include="Specifications\Docs\glGenTransformFeedbacks.xml" />
<None Include="Specifications\Docs\glGenVertexArrays.xml" />
<None Include="Specifications\Docs\glGetActiveSubroutineName.xml" />
<None Include="Specifications\Docs\glGetActiveSubroutineUniform.xml" />
<None Include="Specifications\Docs\glGetActiveSubroutineUniformName.xml" />
<None Include="Specifications\Docs\glGetActiveUniformBlock.xml" />
<None Include="Specifications\Docs\glGetActiveUniformBlockName.xml" />
<None Include="Specifications\Docs\glGetActiveUniformName.xml" />
<None Include="Specifications\Docs\glGetBufferParameter.xml" />
<None Include="Specifications\Docs\glGetFragDataIndex.xml" />
<None Include="Specifications\Docs\glGetFragDataLocation.xml" />
<None Include="Specifications\Docs\glGetFramebufferAttachmentParameter.xml" />
<None Include="Specifications\Docs\glGetMultisample.xml" />
<None Include="Specifications\Docs\glGetProgramBinary.xml" />
<None Include="Specifications\Docs\glGetProgramPipeline.xml" />
<None Include="Specifications\Docs\glGetProgramPipelineInfoLog.xml" />
<None Include="Specifications\Docs\glGetProgramStage.xml" />
<None Include="Specifications\Docs\glGetQueryIndexed.xml" />
<None Include="Specifications\Docs\glGetRenderbufferParameter.xml" />
<None Include="Specifications\Docs\glGetSamplerParameter.xml" />
<None Include="Specifications\Docs\glGetShaderPrecisionFormat.xml" />
<None Include="Specifications\Docs\glGetSubroutineIndex.xml" />
<None Include="Specifications\Docs\glGetSubroutineUniformLocation.xml" />
<None Include="Specifications\Docs\glGetSync.xml" />
<None Include="Specifications\Docs\glGetTransformFeedbackVarying.xml" />
<None Include="Specifications\Docs\glGetUniformBlockIndex.xml" />
<None Include="Specifications\Docs\glGetUniformIndices.xml" />
<None Include="Specifications\Docs\glGetUniformSubroutine.xml" />
<None Include="Specifications\Docs\glIsFramebuffer.xml" />
<None Include="Specifications\Docs\glIsProgramPipeline.xml" />
<None Include="Specifications\Docs\glIsRenderbuffer.xml" />
<None Include="Specifications\Docs\glIsSampler.xml" />
<None Include="Specifications\Docs\glIsSync.xml" />
<None Include="Specifications\Docs\glIsTransformFeedback.xml" />
<None Include="Specifications\Docs\glIsVertexArray.xml" />
<None Include="Specifications\Docs\glMapBufferRange.xml" />
<None Include="Specifications\Docs\glMultiDrawElementsBaseVertex.xml" />
<None Include="Specifications\Docs\glPatchParameter.xml" />
<None Include="Specifications\Docs\glPauseTransformFeedback.xml" />
<None Include="Specifications\Docs\glPrimitiveRestartIndex.xml" />
<None Include="Specifications\Docs\glProgramBinary.xml" />
<None Include="Specifications\Docs\glProgramParameter.xml" />
<None Include="Specifications\Docs\glProgramUniform.xml" />
<None Include="Specifications\Docs\glProvokingVertex.xml" />
<None Include="Specifications\Docs\glQueryCounter.xml" />
<None Include="Specifications\Docs\glReleaseShaderCompiler.xml" />
<None Include="Specifications\Docs\glRenderbufferStorage.xml" />
<None Include="Specifications\Docs\glRenderbufferStorageMultisample.xml" />
<None Include="Specifications\Docs\glResumeTransformFeedback.xml" />
<None Include="Specifications\Docs\glSampleMaski.xml" />
<None Include="Specifications\Docs\glSamplerParameter.xml" />
<None Include="Specifications\Docs\glScissorArray.xml" />
<None Include="Specifications\Docs\glScissorIndexed.xml" />
<None Include="Specifications\Docs\glShaderBinary.xml" />
<None Include="Specifications\Docs\glTexBuffer.xml" />
<None Include="Specifications\Docs\glTexImage2DMultisample.xml" />
<None Include="Specifications\Docs\glTexImage3DMultisample.xml" />
<None Include="Specifications\Docs\glTransformFeedbackVaryings.xml" />
<None Include="Specifications\Docs\glUniformBlockBinding.xml" />
<None Include="Specifications\Docs\glUniformSubroutines.xml" />
<None Include="Specifications\Docs\glUseProgramStages.xml" />
<None Include="Specifications\Docs\glValidateProgramPipeline.xml" />
<None Include="Specifications\Docs\glVertexAttribDivisor.xml" />
<None Include="Specifications\Docs\glViewportArray.xml" />
<None Include="Specifications\Docs\glViewportIndexed.xml" />
<None Include="Specifications\Docs\glWaitSync.xml" />
<None Include="Specifications\GL2\signatures.xml">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<PropertyGroup>

View file

@ -1,69 +0,0 @@
#region --- License ---
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
* See license.txt for license info
*/
#endregion
using System.Diagnostics;
using Bind.Structures;
namespace Bind.Glu
{
class Generator : GL2.Generator
{
string enumSpecAux = null;// = "GL2\\enum.spec";
#region --- Constructors ---
public Generator()
: base()
{
glTypemap = "Glu\\glu.tm";
csTypemap = "csharp.tm";
enumSpec = "Glu\\enumglu.spec";
enumSpecExt = "";
glSpec = "Glu\\glu.spec";
glSpecExt = "";
importsFile = "GluCore.cs";
delegatesFile = "GluDelegates.cs";
enumsFile = "GluEnums.cs";
wrappersFile = "Glu.cs";
Settings.OutputClass = "Glu";
Settings.FunctionPrefix = "glu";
Settings.ConstantPrefix = "GLU_";
if (Settings.Compatibility == Settings.Legacy.Tao)
{
Settings.OutputNamespace = "Tao.OpenGl";
//Settings.WindowsGDI = "Tao.Platform.Windows.Gdi";
}
else
{
//Settings.OutputNamespace = "OpenTK.Graphics.OpenGL";
}
Settings.CompleteEnumName = "AllGlu";
}
#endregion
public override void Process()
{
Type.Initialize(glTypemap, csTypemap);
Enum.Initialize(enumSpec, enumSpecExt, enumSpecAux);
Function.Initialize();
Delegate.Initialize(glSpec, glSpecExt);
// Process enums and delegates - create wrappers.
Trace.WriteLine("Processing specs, please wait...");
//this.Translate();
WriteBindings(
Delegate.Delegates,
Function.Wrappers,
Enum.GLEnums);
}
}
}

View file

@ -1,66 +0,0 @@
#region --- License ---
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
* See license.txt for license info
*/
#endregion
using System.Diagnostics;
using Bind.Structures;
namespace Bind.Glx
{
class Generator : GL2.Generator
{
#region --- Constructors ---
public Generator()
: base()
{
glTypemap = "Glx\\glx.tm";
csTypemap = "csharp.tm";
enumSpec = "Glx\\glxenum.spec";
enumSpecExt = "Glx\\glxenumext.spec";
glSpec = "Glx\\glx.spec";
glSpecExt = "Glx\\glxext.spec";
importsFile = "GlxCore.cs";
delegatesFile = "GlxDelegates.cs";
enumsFile = "GlxEnums.cs";
wrappersFile = "Glx.cs";
Settings.OutputClass = "Glx";
Settings.FunctionPrefix = "glX";
Settings.ConstantPrefix = "GLX_";
if (Settings.Compatibility == Settings.Legacy.Tao)
{
Settings.OutputNamespace = "Tao.Platform.Glx";
//Settings.WindowsGDI = "Tao.Platform.Windows.Gdi";
}
else
{
Settings.OutputNamespace = "OpenTK.Platform.X11";
}
}
#endregion
public override void Process()
{
Type.Initialize(glTypemap, csTypemap);
Enum.Initialize(enumSpec, enumSpecExt);
Function.Initialize();
Delegate.Initialize(glSpec, glSpecExt);
// Process enums and delegates - create wrappers.
Trace.WriteLine("Processing specs, please wait...");
//this.Translate();
WriteBindings(
Delegate.Delegates,
Function.Wrappers,
Enum.GLEnums);
}
}
}

View file

@ -4,10 +4,14 @@
*/
#endregion
using Bind.Structures;
namespace Bind
{
interface IBind : ISpecReader, ISpecWriter
interface IBind
{
DelegateCollection Delegates { get; }
EnumCollection Enums { get; }
FunctionCollection Wrappers { get; }
void Process();
}
}

View file

@ -11,8 +11,7 @@ namespace Bind
{
interface ISpecWriter
{
void WriteBindings(DelegateCollection delegates, FunctionCollection functions,
EnumCollection enums);
void WriteBindings(IBind generator);
void WriteDelegates(BindStreamWriter sw, DelegateCollection delegates);
void WriteWrappers(BindStreamWriter sw, FunctionCollection wrappers, Dictionary<string, string> CSTypes);
void WriteEnums(BindStreamWriter sw, EnumCollection enums);

View file

@ -25,15 +25,18 @@ namespace Bind
ES11,
ES20,
CL10,
[Obsolete] Wgl,
[Obsolete] Glx,
[Obsolete] Glu,
}
enum GeneratorLanguage
{
CSharp,
Cpp
}
static class MainClass
{
static GeneratorMode mode = GeneratorMode.GL2;
static GeneratorLanguage lang = GeneratorLanguage.CSharp;
static internal IBind Generator;
static void Main(string[] arguments)
@ -73,23 +76,28 @@ namespace Bind
case "output":
Settings.OutputPath = string.Join(Path.DirectorySeparatorChar.ToString(), b.Skip(1).ToArray());
break;
case "l":
case "lang":
case "language":
{
string arg = b[1].ToLower();
if (arg == "cpp" || arg == "c++" || arg == "c")
{
lang = GeneratorLanguage.Cpp;
Settings.DefaultOutputPath = "gl";
Settings.DefaultOutputNamespace = "gl";
Settings.EnumsNamespace = "gl";
}
break;
}
case "mode":
string arg = b[1].ToLower();
if (arg == "gl" || arg == "gl2")
mode = GeneratorMode.GL2;
else if (arg == "es10")
mode = GeneratorMode.ES10;
else if (arg == "es11")
mode = GeneratorMode.ES11;
else if (arg == "es20")
mode = GeneratorMode.ES20;
else if (arg=="cl" || arg == "cl10")
mode = GeneratorMode.CL10;
else
throw new NotImplementedException();
if (b.Length > 2)
dirName = b[2];
break;
{
string arg = b[1].ToLower();
SetGeneratorMode(dirName, arg);
if (b.Length > 2)
dirName = b[2];
break;
}
case "namespace":
case "ns":
Settings.OutputNamespace = b[1];
@ -137,8 +145,9 @@ namespace Bind
switch (mode)
{
case GeneratorMode.GL3:
case GeneratorMode.GL2:
Generator = new Generator();
Generator = new GL4Generator("OpenGL", dirName);
break;
case GeneratorMode.ES10:
@ -157,35 +166,37 @@ namespace Bind
Generator = new CLGenerator("CL10", dirName);
break;
case GeneratorMode.Wgl:
Generator = new Wgl.Generator();
break;
case GeneratorMode.Glu:
Generator = new Glu.Generator();
break;
case GeneratorMode.Glx:
Generator = new Glx.Generator();
break;
case GeneratorMode.GL3:
throw new NotImplementedException(String.Format("Mode {0} not implemented.", mode));
case GeneratorMode.Unknown:
default:
Console.WriteLine("Please specify a generator mode (use '-mode:gl2/gl3/glu/wgl/glx])'");
return;
}
Generator.Process();
ISpecWriter writer = null;
switch (lang)
{
case GeneratorLanguage.Cpp:
writer = new CppSpecWriter();
break;
case GeneratorLanguage.CSharp:
default:
writer = new CSharpSpecWriter();
break;
}
writer.WriteBindings(Generator);
ticks = DateTime.Now.Ticks - ticks;
Console.WriteLine();
Console.WriteLine("Bindings generated in {0} seconds.", ticks / (double)10000000.0);
Console.WriteLine();
if (Debugger.IsAttached)
{
Console.WriteLine("Press any key to continue...");
Console.ReadKey(true);
}
}
catch (SecurityException e)
{
@ -199,6 +210,44 @@ namespace Bind
}
}
private static void SetGeneratorMode(string dirName, string arg)
{
if (arg == "gl" || arg == "gl2" || arg == "gl3" || arg == "gl4")
{
mode = GeneratorMode.GL2;
Settings.DefaultOutputNamespace = "OpenTK.Graphics.OpenGL";
}
else if (arg == "es10")
{
mode = GeneratorMode.ES10;
Settings.DefaultOutputPath = Path.Combine(
Directory.GetParent(Settings.DefaultOutputPath).ToString(),
dirName);
}
else if (arg == "es11")
{
mode = GeneratorMode.ES11;
Settings.DefaultOutputPath = Path.Combine(
Directory.GetParent(Settings.DefaultOutputPath).ToString(),
dirName);
}
else if (arg == "es20")
{
mode = GeneratorMode.ES20;
Settings.DefaultOutputPath = Path.Combine(
Directory.GetParent(Settings.DefaultOutputPath).ToString(),
dirName);
}
else if (arg == "cl" || arg == "cl10")
{
mode = GeneratorMode.CL10;
}
else
{
throw new NotImplementedException();
}
}
private static void ShowHelp()
{
Console.WriteLine(

View file

@ -13,19 +13,22 @@ namespace Bind
// Disable BeforeFieldInit.
static Settings() { }
public const string DefaultInputPath = "../../../Source/Bind/Specifications";
public const string DefaultOutputPath = "../../../Source/OpenTK/Graphics/OpenGL";
public const string DefaultOutputNamespace = "OpenTK.Graphics.OpenGL";
public const string DefaultDocPath = "../../../Source/Bind/Specifications/Docs";
public const string DefaultDocFile = "ToInlineDocs.xslt";
public const string DefaultLicenseFile = "License.txt";
public static string DefaultInputPath = "../../../Source/Bind/Specifications";
public static string DefaultOutputPath = "../../../Source/OpenTK/Graphics/OpenGL";
public static string DefaultOutputNamespace = "OpenTK.Graphics.OpenGL";
public static string DefaultDocPath = "../../../Source/Bind/Specifications/Docs";
public static string DefaultDocFile = "ToInlineDocs.xslt";
public static string DefaultLicenseFile = "License.txt";
public static string DefaultOverridesFile = "GL2/gloverrides.xml";
public static string InputPath = DefaultInputPath;
public static string OutputPath = DefaultOutputPath;
public static string OutputNamespace = DefaultOutputNamespace;
public static string DocPath = DefaultDocPath;
public static string DocFile = DefaultDocFile;
public static string LicenseFile = DefaultLicenseFile;
static string inputPath, outputPath, outputNamespace, docPath, docFile, licenseFile, overridesFile;
public static string InputPath { get { return inputPath ?? DefaultInputPath; } set { inputPath = value; } }
public static string OutputPath { get { return outputPath ?? DefaultOutputPath; } set { outputPath = value; } }
public static string OutputNamespace { get { return outputNamespace ?? DefaultOutputNamespace; } set { outputNamespace = value; } }
public static string DocPath { get { return docPath ?? DefaultDocPath; } set { docPath = value; } }
public static string DocFile { get { return docFile ?? DefaultDocFile; } set { docFile = value; } }
public static string LicenseFile { get { return licenseFile ?? DefaultLicenseFile; } set { licenseFile = value; } }
public static string OverridesFile { get { return overridesFile ?? DefaultOverridesFile; } set { overridesFile = value; } }
public static string GLClass = "GL"; // Needed by Glu for the AuxEnumsClass. Can be set through -gl:"xxx".
public static string OutputClass = "GL"; // The real output class. Can be set through -class:"xxx".
@ -33,6 +36,11 @@ namespace Bind
public static string ConstantPrefix = "GL_";
public static string EnumPrefix = "";
public static string ImportsFile = "Core.cs";
public static string DelegatesFile = "Delegates.cs";
public static string EnumsFile = "Enums.cs";
public static string WrappersFile = "GL.cs";
// TODO: This code is too fragile.
// Old enums code:
public static string normalEnumsClassOverride = null;
@ -127,6 +135,8 @@ namespace Bind
NoDebugHelpers = 0x800,
/// <summary>Generate both typed and untyped ("All") signatures for enum parameters.</summary>
KeepUntypedEnums = 0x1000,
/// <summary>Marks deprecated functions as [Obsolete]</summary>
AddDeprecationWarnings = 0x2000,
Tao = ConstIntEnums |
NoAdvancedEnumProcessing |
NoPublicUnsafeFunctions |
@ -142,6 +152,24 @@ namespace Bind
/*GenerateAllPermutations,*/
}
// Returns true if flag is enabled.
public static bool IsEnabled(Legacy flag)
{
return (Compatibility & flag) != (Legacy)0;
}
// Enables the specified flag.
public static void Enable(Legacy flag)
{
Compatibility |= flag;
}
// Disables the specified flag.
public static void Disable(Legacy flag)
{
Compatibility &= ~flag;
}
/// <summary>True if multiple tokens should be dropped (e.g. FooARB, FooEXT and FooSGI).</summary>
public static bool DropMultipleTokens
{

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<overrides>
<signatures>
<replace>
<enum name="Unknown">
@ -48,4 +48,4 @@
</function>
</replace>
</overrides>
</signatures>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glActiveShaderProgram">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glActiveShaderProgram</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glActiveShaderProgram</refname>
<refpurpose>set the active program object for a program pipeline object</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glActiveShaderProgram</function></funcdef>
<paramdef>GLuint <parameter>pipeline</parameter></paramdef>
<paramdef>GLuint <parameter>program</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>pipeline</parameter></term>
<listitem>
<para>
Specifies the program pipeline object to set the active program object for.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>program</parameter></term>
<listitem>
<para>
Specifies the program object to set as the active program pipeline object <parameter>pipeline</parameter>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glActiveShaderProgram</function> sets the linked program named by <parameter>program</parameter>
to be the active program for the program pipeline object <parameter>pipeline</parameter>. The active
program in the active program pipeline object is the target of calls to <citerefentry><refentrytitle>glUniform</refentrytitle></citerefentry>
when no program has been made current through a call to <citerefentry><refentrytitle>glUseProgram</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>pipeline</parameter> is not
a name previously returned from a call to <citerefentry><refentrytitle>glGenProgramPipelines</refentrytitle></citerefentry>
or if such a name has been deleted by a call to
<citerefentry><refentrytitle>glDeleteProgramPipelines</refentrytitle></citerefentry>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>program</parameter> refers
to a program object that has not been successfully linked.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glGenProgramPipelines</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDeleteProgramPipelines</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIsProgramPipeline</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glUseProgram</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glUniform</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -34,10 +34,9 @@
Specifies which texture unit to make active. The number
of texture units is implementation dependent, but must be at least
two. <parameter>texture</parameter> must be one of
<constant>GL_TEXTURE</constant><inlineequation><mml:math><mml:mi mathvariant="italic">i</mml:mi></mml:math></inlineequation>,
<constant>GL_TEXTURE<emphasis>i</emphasis></constant>,
where
i ranges from 0 to the larger of (<constant>GL_MAX_TEXTURE_COORDS</constant> - 1)
and (<constant>GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS</constant> - 1).
<emphasis>i</emphasis> ranges from 0 (<constant>GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS</constant> - 1).
The initial value is <constant>GL_TEXTURE0</constant>.
</para>
</listitem>
@ -48,38 +47,47 @@
<para>
<function>glActiveTexture</function> selects which texture unit subsequent texture state calls will
affect. The number of texture units an implementation supports is
implementation dependent, but must be at least 2.
</para>
<para>
Vertex arrays are client-side GL resources, which are selected by the
<citerefentry><refentrytitle>glClientActiveTexture</refentrytitle></citerefentry> routine.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glActiveTexture</function> is only supported if the GL version is 1.3 or greater, or if
<code>ARB_multitexture</code> is included in the string returned by
<citerefentry><refentrytitle>glGetString</refentrytitle></citerefentry> when called with the argument <constant>GL_EXTENSIONS</constant>.
implementation dependent, but must be at least 48.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>texture</parameter> is not one of
<constant>GL_TEXTURE</constant><inlineequation><mml:math><mml:mi mathvariant="italic">i</mml:mi></mml:math></inlineequation>,
where i ranges from 0 to the larger of (<constant>GL_MAX_TEXTURE_COORDS</constant> - 1)
and (<constant>GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS</constant> - 1).
<constant>GL_TEXTURE<emphasis>i</emphasis></constant>,
where <emphasis>i</emphasis> ranges from 0 to (<constant>GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS</constant> - 1).
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_ACTIVE_TEXTURE</constant>, <constant>GL_MAX_TEXTURE_COORDS</constant>, or <constant>GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS</constant>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_ACTIVE_TEXTURE</constant>, or <constant>GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS</constant>.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glClientActiveTexture</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMultiTexCoord</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexParameter</refentrytitle></citerefentry>
<citerefentry><refentrytitle>glGenTextures</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBindTexture</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexSubImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexSubImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexSubImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDeleteTextures</refentrytitle></citerefentry>
<citerefentry><refentrytitle>glIsTexture</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage2DMultisample</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage3DMultisample</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexSubImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexSubImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexParameter</refentrytitle></citerefentry>,
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>

View file

@ -38,7 +38,7 @@
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>In order to create an executable, there must be a way to
<para>In order to create a complete shader program, there must be a way to
specify the list of things that will be linked together. Program
objects provide this mechanism. Shaders that are to be linked
together in a program object must first be attached to that
@ -64,10 +64,6 @@
is called to detach it from all program objects to which it is
attached.</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para><function>glAttachShader</function>
is available only if the GL version is 2.0 or greater.</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para><constant>GL_INVALID_VALUE</constant> is generated if either
<parameter>program</parameter> or <parameter>shader</parameter>
@ -83,26 +79,34 @@
<parameter>shader</parameter> is already attached to
<parameter>program</parameter>.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if
<function>glAttachShader</function> is executed between the
execution of
<citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of
<citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para><citerefentry><refentrytitle>glGetAttachedShaders</refentrytitle></citerefentry>
with the handle of a valid program object</para>
<para><citerefentry><refentrytitle>glIsProgram</refentrytitle></citerefentry></para>
<para><citerefentry><refentrytitle>glIsShader</refentrytitle></citerefentry></para>
<para>
<citerefentry><refentrytitle>glGetAttachedShaders</refentrytitle></citerefentry>
with the handle of a valid program object
</para>
<para>
<citerefentry><refentrytitle>glGetShaderInfoLog</refentrytitle></citerefentry>
</para>
<para>
<citerefentry><refentrytitle>glGetShaderSource</refentrytitle></citerefentry>
</para>
<para>
<citerefentry><refentrytitle>glIsProgram</refentrytitle></citerefentry>
</para>
<para>
<citerefentry><refentrytitle>glIsShader</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para><citerefentry><refentrytitle>glCompileShader</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDetachShader</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glShaderSource</refentrytitle></citerefentry></para>
<para>
<citerefentry><refentrytitle>glCompileShader</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCreateShader</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDeleteShader</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDetachShader</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glShaderSource</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>

View file

@ -0,0 +1,123 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glBeginConditionalRender">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glBeginConditionalRender</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glBeginConditionalRender</refname>
<refpurpose>start conditional rendering</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glBeginConditionalRender</function></funcdef>
<paramdef>GLuint <parameter>id</parameter></paramdef>
<paramdef>GLenum <parameter>mode</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>id</parameter></term>
<listitem>
<para>
Specifies the name of an occlusion query object whose results are used to determine if the rendering commands are discarded.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
Specifies how <function>glBeginConditionalRender</function> interprets the results of the occlusion query.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glEndConditionalRender</function></funcdef>
<paramdef><parameter>void</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="description"><title>Description</title>
<para>
Conditional rendering is started using <function>glBeginConditionalRender</function> and ended using <function>glEndConditionalRender</function>.
During conditional rendering, all vertex array commands, as well as <citerefentry><refentrytitle>glClear</refentrytitle></citerefentry> and
<citerefentry><refentrytitle>glClearBuffer</refentrytitle></citerefentry> have no effect if the (<constant>GL_SAMPLES_PASSED</constant>) result
of the query object <parameter>id</parameter> is zero, or if the (<constant>GL_ANY_SAMPLES_PASSED</constant>) result is <constant>GL_FALSE</constant>.
The results of commands setting the current vertex state, such as <citerefentry><refentrytitle>glVertexAttrib</refentrytitle></citerefentry> are
undefined. If the (<constant>GL_SAMPLES_PASSED</constant>) result is non-zero or if the (<constant>GL_ANY_SAMPLES_PASSED</constant>) result is
<constant>GL_TRUE</constant>, such commands are not discarded. The <parameter>id</parameter> parameter to <function>glBeginConditionalRender</function>
must be the name of a query object previously returned from a call to <citerefentry><refentrytitle>glGenQueries</refentrytitle></citerefentry>.
<parameter>mode</parameter> specifies how the results of the query object are to be interpreted. If <parameter>mode</parameter> is
<constant>GL_QUERY_WAIT</constant>, the GL waits for the results of the query to be available and then uses the results to determine if subsequent
rendering commands are discarded. If <parameter>mode</parameter> is <constant>GL_QUERY_NO_WAIT</constant>, the GL may choose to unconditionally
execute the subsequent rendering commands without waiting for the query to complete.
</para>
<para>
If <parameter>mode</parameter> is <constant>GL_QUERY_BY_REGION_WAIT</constant>, the GL will also wait for occlusion query results and discard
rendering commands if the result of the occlusion query is zero. If the query result is non-zero, subsequent rendering commands are executed,
but the GL may discard the results of the commands for any region of the framebuffer that did not contribute to the sample count in the specified
occlusion query. Any such discarding is done in an implementation-dependent manner, but the rendering command results may not be discarded for
any samples that contributed to the occlusion query sample count. If <parameter>mode</parameter> is <constant>GL_QUERY_BY_REGION_NO_WAIT</constant>,
the GL operates as in <constant>GL_QUERY_BY_REGION_WAIT</constant>, but may choose to unconditionally execute the subsequent rendering commands
without waiting for the query to complete.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glBeginConditionalRender</function> and <function>glEndConditionalRender</function> are available only if the GL version is 3.0 or greater.
</para>
<para>
The <constant>GL_ANY_SAMPLES_PASSED</constant> query result is available only if the GL version is 3.3 or greater.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>id</parameter> is not the name of an existing query object.
</para>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>mode</parameter> is not one of the accepted tokens.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glBeginConditionalRender</function> is called while conditional rendering is active,
or if <function>glEndConditionalRender</function> is called while conditional rendering is inactive.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>id</parameter> is the name of a query object with a target other than
<constant>GL_SAMPLES_PASSED</constant> or <constant>GL_ANY_SAMPLES_PASSED</constant>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>id</parameter> is the name of a query currently in progress.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glGenQueries</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDeleteQueries</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBeginQuery</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2009 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -34,7 +34,9 @@
<para>
Specifies the target type of query object established between
<function>glBeginQuery</function> and the subsequent <citerefentry><refentrytitle>glEndQuery</refentrytitle></citerefentry>.
The symbolic constant must be <constant>GL_SAMPLES_PASSED</constant>.
The symbolic constant must be one of <constant>GL_SAMPLES_PASSED</constant>, <constant>GL_ANY_SAMPLES_PASSED</constant>,
<constant>GL_PRIMITIVES_GENERATED</constant>, <constant>GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN</constant>, or
<constant>GL_TIME_ELAPSED</constant>.
</para>
</listitem>
</varlistentry>
@ -64,7 +66,9 @@
<listitem>
<para>
Specifies the target type of query object to be concluded.
The symbolic constant must be <constant>GL_SAMPLES_PASSED</constant>.
The symbolic constant must be one of <constant>GL_SAMPLES_PASSED</constant>, <constant>GL_ANY_SAMPLES_PASSED</constant>,
<constant>GL_PRIMITIVES_GENERATED</constant>, <constant>GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN</constant>, or
<constant>GL_TIME_ELAPSED</constant>.
</para>
</listitem>
</varlistentry>
@ -73,15 +77,62 @@
<refsect1 id="description"><title>Description</title>
<para>
<function>glBeginQuery</function> and <citerefentry><refentrytitle>glEndQuery</refentrytitle></citerefentry> delimit the
boundaries of a query object. If a query object with name <parameter>id</parameter> does not yet exist it is created.
boundaries of a query object. <parameter>query</parameter> must be a name previously returned from a call to
<citerefentry><refentrytitle>glGenQueries</refentrytitle></citerefentry>. If a query object with name <parameter>id</parameter>
does not yet exist it is created with the type determined by <parameter>target</parameter>. <parameter>target</parameter> must
be one of <constant>GL_SAMPLES_PASSED</constant>, <constant>GL_ANY_SAMPLES_PASSED</constant>, <constant>GL_PRIMITIVES_GENERATED</constant>,
<constant>GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN</constant>, or <constant>GL_TIME_ELAPSED</constant>. The behavior of the query
object depends on its type and is as follows.
</para>
<para>
If <parameter>target</parameter> is <constant>GL_SAMPLES_PASSED</constant>, <parameter>target</parameter> must be an unused name,
or the name of an existing occlusion query object.
When <function>glBeginQuery</function> is executed, the query object's samples-passed counter is reset to 0. Subsequent
rendering will increment the counter once for every sample that passes the depth test. When <function>glEndQuery</function>
rendering will increment the counter for every sample that passes the depth test. If the value of <constant>GL_SAMPLE_BUFFERS</constant>
is 0, then the samples-passed count is incremented by 1 for each fragment. If the value of <constant>GL_SAMPLE_BUFFERS</constant>
is 1, then the samples-passed count is incremented by the number of samples whose coverage bit is set. However, implementations, at their
discression may instead increase the samples-passed count by the value of <constant>GL_SAMPLES</constant> if any sample in the fragment
is covered. When <function>glEndQuery</function>
is executed, the samples-passed counter is assigned to the query object's result value. This value can be queried by
calling <citerefentry><refentrytitle>glGetQueryObject</refentrytitle></citerefentry> with <parameter>pname</parameter>
<constant>GL_QUERY_RESULT</constant>.
</para>
<para>
If <parameter>target</parameter> is <constant>GL_ANY_SAMPLES_PASSED</constant>, <parameter>target</parameter> must be an unused name,
or the name of an existing boolean occlusion query object.
When <function>glBeginQuery</function> is executed, the query object's samples-passed flag is reset to <constant>GL_FALSE</constant>.
Subsequent rendering causes the flag to be set to <constant>GL_TRUE</constant> if any sample passes the depth test. When
<function>glEndQuery</function> is executed, the samples-passed flag is assigned to the query object's result value. This value can
be queried by calling <citerefentry><refentrytitle>glGetQueryObject</refentrytitle></citerefentry> with <parameter>pname</parameter>
<constant>GL_QUERY_RESULT</constant>.
</para>
<para>
If <parameter>target</parameter> is <constant>GL_PRIMITIVES_GENERATED</constant>, <parameter>target</parameter> must be an unused
name, or the name of an existing primitive query object previously bound to the <constant>GL_PRIMITIVES_GENERATED</constant> query binding.
When <function>glBeginQuery</function> is executed, the query object's primitives-generated counter is reset to 0. Subsequent
rendering will increment the counter once for every vertex that is emitted from the geometry shader, or from the vertex shader if
no geometry shader is present. When <function>glEndQuery</function> is executed, the primitives-generated counter is assigned to
the query object's result value. This value can be queried by calling <citerefentry><refentrytitle>glGetQueryObject</refentrytitle></citerefentry> with <parameter>pname</parameter>
<constant>GL_QUERY_RESULT</constant>.
</para>
<para>
If <parameter>target</parameter> is <constant>GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN</constant>, <parameter>target</parameter> must be
an unused name, or the name of an existing primitive query object previously bound to the <constant>GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN</constant>
query binding. When <function>glBeginQuery</function> is executed, the query object's primitives-written counter is reset to 0. Subsequent
rendering will increment the counter once for every vertex that is written into the bound transform feedback buffer(s). If transform feedback
mode is not activated between the call to <function>glBeginQuery</function> and <function>glEndQuery</function>, the counter will not be
incremented. When <function>glEndQuery</function> is executed, the primitives-written counter is assigned to
the query object's result value. This value can be queried by calling <citerefentry><refentrytitle>glGetQueryObject</refentrytitle></citerefentry> with <parameter>pname</parameter>
<constant>GL_QUERY_RESULT</constant>.
</para>
<para>
If <parameter>target</parameter> is <constant>GL_TIME_ELAPSED</constant>, <parameter>target</parameter> must be
an unused name, or the name of an existing timer query object previously bound to the <constant>GL_TIME_ELAPSED</constant>
query binding. When <function>glBeginQuery</function> is executed, the query object's time counter is reset to 0. When <function>glEndQuery</function>
is executed, the elapsed server time that has passed since the call to <function>glBeginQuery</function> is written into the query object's
time counter. This value can be queried by calling <citerefentry><refentrytitle>glGetQueryObject</refentrytitle></citerefentry> with <parameter>pname</parameter>
<constant>GL_QUERY_RESULT</constant>.
</para>
<para>
Querying the <constant>GL_QUERY_RESULT</constant> implicitly flushes the GL pipeline until the rendering delimited by the
query object has completed and the result is available. <constant>GL_QUERY_RESULT_AVAILABLE</constant> can be queried to
@ -90,28 +141,29 @@
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
If the samples-passed count exceeds the maximum value representable in the number of available bits, as reported by
<citerefentry><refentrytitle>glGetQueryiv</refentrytitle></citerefentry> with <parameter>pname</parameter>
If the query target's count exceeds the maximum value representable in the number of available bits, as reported by
<citerefentry><refentrytitle>glGetQueryiv</refentrytitle></citerefentry> with <parameter>target</parameter> set to the
appropriate query target and <parameter>pname</parameter>
<constant>GL_QUERY_COUNTER_BITS</constant>, the count becomes undefined.
</para>
<para>
An implementation may support 0 bits in its samples-passed counter, in which case query results are always undefined
An implementation may support 0 bits in its counter, in which case query results are always undefined
and essentially useless.
</para>
<para>
When <constant>GL_SAMPLE_BUFFERS</constant> is 0, the samples-passed counter will increment once for each fragment that passes
the depth test. When <constant>GL_SAMPLE_BUFFERS</constant> is 1, an implementation may either increment the samples-passed
counter individually for each sample of a fragment that passes the depth test, or it may choose to increment the counter for
all samples of a fragment if any one of them passes the depth test.
When <constant>GL_SAMPLE_BUFFERS</constant> is 0, the samples-passed counter of an occlusion query will increment once for each
fragment that passes the depth test. When <constant>GL_SAMPLE_BUFFERS</constant> is 1, an implementation may either increment
the samples-passed counter individually for each sample of a fragment that passes the depth test, or it may choose to increment
the counter for all samples of a fragment if any one of them passes the depth test.
</para>
<para>
<function>glBeginQuery</function> and <citerefentry><refentrytitle>glEndQuery</refentrytitle></citerefentry>
are available only if the GL version is 1.5 or greater.
The query targets <constant>GL_ANY_SAMPLES_PASSED</constant>, and <constant>GL_TIME_ELAPSED</constant> are availale only if
the GL version is 3.3 or higher.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not <constant>GL_SAMPLES_PASSED</constant>.
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not one of the accepted tokens.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glBeginQuery</function> is executed while
@ -128,10 +180,8 @@
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>id</parameter> is the name of an already active query object.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glBeginQuery</function> or
<citerefentry><refentrytitle>glEndQuery</refentrytitle></citerefentry> is executed between the execution of
<citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding execution of
<citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>id</parameter> refers to an existing query object whose type
does not does not match <parameter>target</parameter>.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>

View file

@ -0,0 +1,244 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glBeginQueryIndexed">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group.</holder>
</copyright>
</refmetainfo>
<refentrytitle>glBeginQueryIndexed, glEndQueryIndexed</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glBeginQueryIndexed, glEndQueryIndexed</refname>
<refpurpose>delimit the boundaries of a query object on an indexed target</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glBeginQueryIndexed</function></funcdef>
<paramdef>GLenum <parameter>target</parameter></paramdef>
<paramdef>GLuint <parameter>index</parameter></paramdef>
<paramdef>GLuint <parameter>id</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<!-- eqn: ignoring delim $$ -->
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>target</parameter></term>
<listitem>
<para>
Specifies the target type of query object established between
<function>glBeginQueryIndexed</function> and the subsequent <citerefentry><refentrytitle>glEndQueryIndexed</refentrytitle></citerefentry>.
The symbolic constant must be one of <constant>GL_SAMPLES_PASSED</constant>, <constant>GL_ANY_SAMPLES_PASSED</constant>,
<constant>GL_PRIMITIVES_GENERATED</constant>, <constant>GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN</constant>, or
<constant>GL_TIME_ELAPSED</constant>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>index</parameter></term>
<listitem>
<para>
Specifies the index of the query target upon which to begin the query.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>id</parameter></term>
<listitem>
<para>
Specifies the name of a query object.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glEndQueryIndexed</function></funcdef>
<paramdef>GLenum <parameter>target</parameter></paramdef>
<paramdef>GLuint <parameter>index</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<!-- eqn: ignoring delim $$ -->
<refsect1 id="parameters2"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>target</parameter></term>
<listitem>
<para>
Specifies the target type of query object to be concluded.
The symbolic constant must be one of <constant>GL_SAMPLES_PASSED</constant>, <constant>GL_ANY_SAMPLES_PASSED</constant>,
<constant>GL_PRIMITIVES_GENERATED</constant>, <constant>GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN</constant>, or
<constant>GL_TIME_ELAPSED</constant>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>index</parameter></term>
<listitem>
<para>
Specifies the index of the query target upon which to end the query.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glBeginQueryIndexed</function> and <citerefentry><refentrytitle>glEndQueryIndexed</refentrytitle></citerefentry> delimit the
boundaries of a query object. <parameter>query</parameter> must be a name previously returned from a call to
<citerefentry><refentrytitle>glGenQueries</refentrytitle></citerefentry>. If a query object with name <parameter>id</parameter>
does not yet exist it is created with the type determined by <parameter>target</parameter>. <parameter>target</parameter> must
be one of <constant>GL_SAMPLES_PASSED</constant>, <constant>GL_ANY_SAMPLES_PASSED</constant>, <constant>GL_PRIMITIVES_GENERATED</constant>,
<constant>GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN</constant>, or <constant>GL_TIME_ELAPSED</constant>. The behavior of the query
object depends on its type and is as follows.
</para>
<para>
<parameter>index</parameter> specifies the index of the query target and must be between a <parameter>target</parameter>-specific
maximum.
</para>
<para>
If <parameter>target</parameter> is <constant>GL_SAMPLES_PASSED</constant>, <parameter>target</parameter> must be an unused name,
or the name of an existing occlusion query object.
When <function>glBeginQueryIndexed</function> is executed, the query object's samples-passed counter is reset to 0. Subsequent
rendering will increment the counter for every sample that passes the depth test. If the value of <constant>GL_SAMPLE_BUFFERS</constant>
is 0, then the samples-passed count is incremented by 1 for each fragment. If the value of <constant>GL_SAMPLE_BUFFERS</constant>
is 1, then the samples-passed count is incremented by the number of samples whose coverage bit is set. However, implementations, at their
discression may instead increase the samples-passed count by the value of <constant>GL_SAMPLES</constant> if any sample in the fragment
is covered. When <function>glEndQueryIndexed</function>
is executed, the samples-passed counter is assigned to the query object's result value. This value can be queried by
calling <citerefentry><refentrytitle>glGetQueryObject</refentrytitle></citerefentry> with <parameter>pname</parameter>
<constant>GL_QUERY_RESULT</constant>.
When <parameter>target</parameter> is <constant>GL_SAMPLES_PASSED</constant>, <parameter>index</parameter> must be zero.
</para>
<para>
If <parameter>target</parameter> is <constant>GL_ANY_SAMPLES_PASSED</constant>, <parameter>target</parameter> must be an unused name,
or the name of an existing boolean occlusion query object.
When <function>glBeginQueryIndexed</function> is executed, the query object's samples-passed flag is reset to <constant>GL_FALSE</constant>.
Subsequent rendering causes the flag to be set to <constant>GL_TRUE</constant> if any sample passes the depth test. When
<function>glEndQueryIndexed</function> is executed, the samples-passed flag is assigned to the query object's result value. This value can
be queried by calling <citerefentry><refentrytitle>glGetQueryObject</refentrytitle></citerefentry> with <parameter>pname</parameter>
<constant>GL_QUERY_RESULT</constant>.
When <parameter>target</parameter> is <constant>GL_ANY_SAMPLES_PASSED</constant>, <parameter>index</parameter> must be zero.
</para>
<para>
If <parameter>target</parameter> is <constant>GL_PRIMITIVES_GENERATED</constant>, <parameter>target</parameter> must be an unused
name, or the name of an existing primitive query object previously bound to the <constant>GL_PRIMITIVES_GENERATED</constant> query binding.
When <function>glBeginQueryIndexed</function> is executed, the query object's primitives-generated counter is reset to 0. Subsequent
rendering will increment the counter once for every vertex that is emitted from the geometry shader to the stream given by <parameter>index</parameter>,
or from the vertex shader if <parameter>index</parameter> is zero and no geometry shader is present.
When <function>glEndQueryIndexed</function> is executed, the primitives-generated counter for stream <parameter>index</parameter> is assigned to
the query object's result value. This value can be queried by calling <citerefentry><refentrytitle>glGetQueryObject</refentrytitle></citerefentry>
with <parameter>pname</parameter> <constant>GL_QUERY_RESULT</constant>.
When <parameter>target</parameter> is <constant>GL_PRIMITIVES_GENERATED</constant>, <parameter>index</parameter> must be
less than the value of <constant>GL_MAX_VERTEX_STREAMS</constant>.
</para>
<para>
If <parameter>target</parameter> is <constant>GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN</constant>, <parameter>target</parameter> must be
an unused name, or the name of an existing primitive query object previously bound to the <constant>GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN</constant>
query binding. When <function>glBeginQueryIndexed</function> is executed, the query object's primitives-written counter for the stream specified by
<parameter>index</parameter> is reset to 0. Subsequent rendering will increment the counter once for every vertex that is written into the bound
transform feedback buffer(s) for stream <parameter>index</parameter>. If transform feedback
mode is not activated between the call to <function>glBeginQueryIndexed</function> and <function>glEndQueryIndexed</function>, the counter will not be
incremented. When <function>glEndQueryIndexed</function> is executed, the primitives-written counter for stream <parameter>index</parameter> is assigned to
the query object's result value. This value can be queried by calling <citerefentry><refentrytitle>glGetQueryObject</refentrytitle></citerefentry> with <parameter>pname</parameter>
<constant>GL_QUERY_RESULT</constant>.
When <parameter>target</parameter> is <constant>GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN</constant>, <parameter>index</parameter> must be
less than the value of <constant>GL_MAX_VERTEX_STREAMS</constant>.
</para>
<para>
If <parameter>target</parameter> is <constant>GL_TIME_ELAPSED</constant>, <parameter>target</parameter> must be
an unused name, or the name of an existing timer query object previously bound to the <constant>GL_TIME_ELAPSED</constant>
query binding. When <function>glBeginQueryIndexed</function> is executed, the query object's time counter is reset to 0. When <function>glEndQueryIndexed</function>
is executed, the elapsed server time that has passed since the call to <function>glBeginQueryIndexed</function> is written into the query object's
time counter. This value can be queried by calling <citerefentry><refentrytitle>glGetQueryObject</refentrytitle></citerefentry> with <parameter>pname</parameter>
<constant>GL_QUERY_RESULT</constant>.
When <parameter>target</parameter> is <constant>GL_TIME_ELAPSED</constant>, <parameter>index</parameter> must be zero.
</para>
<para>
Querying the <constant>GL_QUERY_RESULT</constant> implicitly flushes the GL pipeline until the rendering delimited by the
query object has completed and the result is available. <constant>GL_QUERY_RESULT_AVAILABLE</constant> can be queried to
determine if the result is immediately available or if the rendering is not yet complete.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
If the query target's count exceeds the maximum value representable in the number of available bits, as reported by
<citerefentry><refentrytitle>glGetQueryiv</refentrytitle></citerefentry> with <parameter>target</parameter> set to the
appropriate query target and <parameter>pname</parameter>
<constant>GL_QUERY_COUNTER_BITS</constant>, the count becomes undefined.
</para>
<para>
An implementation may support 0 bits in its counter, in which case query results are always undefined
and essentially useless.
</para>
<para>
When <constant>GL_SAMPLE_BUFFERS</constant> is 0, the samples-passed counter of an occlusion query will increment once for each
fragment that passes the depth test. When <constant>GL_SAMPLE_BUFFERS</constant> is 1, an implementation may either increment
the samples-passed counter individually for each sample of a fragment that passes the depth test, or it may choose to increment
the counter for all samples of a fragment if any one of them passes the depth test.
</para>
<para>
Calling <citerefentry><refentrytitle>glBeginQuery</refentrytitle></citerefentry> or
<citerefentry><refentrytitle>glEndQuery</refentrytitle></citerefentry> is equivalent to
calling <citerefentry><refentrytitle>glBeginQueryIndexed</refentrytitle></citerefentry> or
<citerefentry><refentrytitle>glEndQueryIndexed</refentrytitle></citerefentry> with
<parameter>index</parameter> set to zero, respectively.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not one of the accepted tokens.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>index</parameter> is greater than the
query target-specific maximum.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glBeginQueryIndexed</function> is executed while
a query object of the same <parameter>target</parameter> is already active.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <citerefentry><refentrytitle>glEndQueryIndexed</refentrytitle></citerefentry>
is executed when a query object of the same <parameter>target</parameter> is not active.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>id</parameter> is 0.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>id</parameter> is the name of an already active query object.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>id</parameter> refers to an existing query object whose type
does not does not match <parameter>target</parameter>.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glDeleteQueries</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBeginQuery</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glEndQuery</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGenQueries</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGetQueryiv</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGetQueryObject</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIsQuery</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -0,0 +1,194 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glBeginTransformFeedback">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glBeginTransformFeedback</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glBeginTransformFeedback</refname>
<refpurpose>start transform feedback operation</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glBeginTransformFeedback</function></funcdef>
<paramdef>GLenum <parameter>primitiveMode</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>primitiveMode</parameter></term>
<listitem>
<para>
Specify the output type of the primitives that will be recorded into the
buffer objects that are bound for transform feedback.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glEndTransformFeedback</function></funcdef>
<paramdef><parameter>void</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="description"><title>Description</title>
<para>
Transform feedback mode captures the values of varying variables written by the vertex shader (or, if active, the geometry shader).
Transform feedback is said to be active after a call to <function>glBeginTransformFeedback</function>
until a subsequent call to <citerefentry><refentrytitle>glEndTransformFeedback</refentrytitle></citerefentry>.
Transform feedback commands must be paired.
</para>
<para>
If no geometry shader is present, while transform feedback is active the <parameter>mode</parameter> parameter to
<citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry> must match those specified
in the following table:
</para>
<informaltable frame="topbot">
<tgroup cols="2" align="left">
<colspec colwidth="1.1*" />
<colspec colwidth="1*" />
<thead>
<row>
<entry rowsep="1" align="left"><emphasis role="bold">
Transform Feedback <parameter>primitiveMode</parameter>
</emphasis></entry>
<entry rowsep="1" align="left"><emphasis role="bold">
Allowed Render Primitive <parameter>modes</parameter>
</emphasis></entry>
</row>
</thead>
<tbody>
<row>
<entry align="left">
<constant>GL_POINTS</constant>
</entry>
<entry align="left">
<constant>GL_POINTS</constant>
</entry>
</row>
<row>
<entry align="left">
<constant>GL_LINES</constant>
</entry>
<entry align="left">
<constant>GL_LINES</constant>, <constant>GL_LINE_LOOP</constant>, <constant>GL_LINE_STRIP</constant>,
<constant>GL_LINES_ADJACENCY</constant>, <constant>GL_LINE_STRIP_ADJACENCY</constant>
</entry>
</row>
<row>
<entry align="left">
<constant>GL_TRIANGLES</constant>
</entry>
<entry align="left">
<constant>GL_TRIANGLES</constant>, <constant>GL_TRIANGLE_STRIP</constant>, <constant>GL_TRIANGLE_FAN</constant>,
<constant>GL_TRIANGLES_ADJACENCY</constant>, <constant>GL_TRIANGLE_STRIP_ADJACENCY</constant>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para>
If a geometry shader is present, the output primitive type from the geometry shader must match those
provided in the following table:
<informaltable frame="topbot">
<tgroup cols="2" align="left">
<colspec colwidth="1.1*" />
<colspec colwidth="1*" />
<thead>
<row>
<entry rowsep="1" align="left"><emphasis role="bold">
Transform Feedback <parameter>primitiveMode</parameter>
</emphasis></entry>
<entry rowsep="1" align="left"><emphasis role="bold">
Allowed Geometry Shader Output Primitive Type
</emphasis></entry>
</row>
</thead>
<tbody>
<row>
<entry align="left">
<constant>GL_POINTS</constant>
</entry>
<entry align="left">
<constant>points</constant>
</entry>
</row>
<row>
<entry align="left">
<constant>GL_LINES</constant>
</entry>
<entry align="left">
<constant>line_strip</constant>
</entry>
</row>
<row>
<entry align="left">
<constant>GL_TRIANGLES</constant>
</entry>
<entry align="left">
<constant>triangle_strip</constant>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
Geometry shaders, and the <constant>GL_TRIANGLES_ADJACENCY</constant>, <constant>GL_TRIANGLE_STRIP_ADJACENCY</constant>,
<constant>GL_LINES_ADJACENCY</constant> and <constant>GL_LINE_STRIP_ADJACENCY</constant> primtive modes are available
only if the GL version is 3.2 or greater.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glBeginTransformFeedback</function> is executed
while transform feedback is active.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glEndTransformFeedback</function> is executed
while transform feedback is not active.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated by <citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry>
if no geometry shader is present, transform feedback is active and <parameter>mode</parameter> is not one of the allowed modes.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated by <citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry>
if a geometry shader is present, transform feedback is active and the output primitive type of the geometry shader does not
match the transform feedback <parameter>primitiveMode</parameter>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated by <function>glEndTransformFeedback</function> if any binding
point used in transform feedback mode does not have a buffer object bound.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated by <function>glEndTransformFeedback</function> if no binding
points would be used, either because no program object is active of because the active program object has specified
no varying variables to record.
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -1,189 +1,179 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glBindAttribLocation">
<refmeta>
<refentrytitle>glBindAttribLocation</refentrytitle>
<manvolnum>3G</manvolnum>
<refentrytitle>glBindAttribLocation</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glBindAttribLocation</refname>
<refpurpose>Associates a generic vertex attribute index with a named attribute variable</refpurpose>
<refname>glBindAttribLocation</refname>
<refpurpose>Associates a generic vertex attribute index with a named attribute variable</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glBindAttribLocation</function></funcdef>
<paramdef>GLuint <parameter>program</parameter></paramdef>
<paramdef>GLuint <parameter>index</parameter></paramdef>
<paramdef>const GLchar *<parameter>name</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glBindAttribLocation</function></funcdef>
<paramdef>GLuint <parameter>program</parameter></paramdef>
<paramdef>GLuint <parameter>index</parameter></paramdef>
<paramdef>const GLchar *<parameter>name</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>program</parameter></term>
<listitem>
<para>Specifies the handle of the program object in
which the association is to be made.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>index</parameter></term>
<listitem>
<para>Specifies the index of the generic vertex
attribute to be bound.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>name</parameter></term>
<listitem>
<para>Specifies a null terminated string containing
the name of the vertex shader attribute variable to
which <parameter>index</parameter> is to be
bound.</para>
</listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term><parameter>program</parameter></term>
<listitem>
<para>Specifies the handle of the program object in
which the association is to be made.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>index</parameter></term>
<listitem>
<para>Specifies the index of the generic vertex
attribute to be bound.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>name</parameter></term>
<listitem>
<para>Specifies a null terminated string containing
the name of the vertex shader attribute variable to
which <parameter>index</parameter> is to be
bound.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para><function>glBindAttribLocation</function> is used to
associate a user-defined attribute variable in the program
object specified by <parameter>program</parameter> with a
generic vertex attribute index. The name of the user-defined
attribute variable is passed as a null terminated string in
<parameter>name</parameter>. The generic vertex attribute index
to be bound to this variable is specified by
<parameter>index</parameter>. When
<parameter>program</parameter> is made part of current state,
values provided via the generic vertex attribute
<parameter>index</parameter> will modify the value of the
user-defined attribute variable specified by
<parameter>name</parameter>.</para>
<para><function>glBindAttribLocation</function> is used to
associate a user-defined attribute variable in the program
object specified by <parameter>program</parameter> with a
generic vertex attribute index. The name of the user-defined
attribute variable is passed as a null terminated string in
<parameter>name</parameter>. The generic vertex attribute index
to be bound to this variable is specified by
<parameter>index</parameter>. When
<parameter>program</parameter> is made part of current state,
values provided via the generic vertex attribute
<parameter>index</parameter> will modify the value of the
user-defined attribute variable specified by
<parameter>name</parameter>.</para>
<para>If <parameter>name</parameter> refers to a matrix
attribute variable, <parameter>index</parameter> refers to the
first column of the matrix. Other matrix columns are then
automatically bound to locations <parameter>index+1</parameter>
for a matrix of type mat2; <parameter>index+1</parameter> and
<parameter>index+2</parameter> for a matrix of type mat3; and
<parameter>index+1</parameter>, <parameter>index+2</parameter>,
and <parameter>index+3</parameter> for a matrix of type
mat4.</para>
<para>If <parameter>name</parameter> refers to a matrix
attribute variable, <parameter>index</parameter> refers to the
first column of the matrix. Other matrix columns are then
automatically bound to locations <parameter>index+1</parameter>
for a matrix of type <function>mat2</function>; <parameter>index+1</parameter> and
<parameter>index+2</parameter> for a matrix of type <function>mat3</function>; and
<parameter>index+1</parameter>, <parameter>index+2</parameter>,
and <parameter>index+3</parameter> for a matrix of type
<function>mat4</function>.</para>
<para>This command makes it possible for vertex shaders to use
descriptive names for attribute variables rather than generic
variables that are numbered from 0 to
<constant>GL_MAX_VERTEX_ATTRIBS</constant> -1. The values sent
to each generic attribute index are part of current state, just
like standard vertex attributes such as color, normal, and
vertex position. If a different program object is made current
by calling
<citerefentry><refentrytitle>glUseProgram</refentrytitle></citerefentry>,
the generic vertex attributes are tracked in such a way that the
same values will be observed by attributes in the new program
object that are also bound to
<parameter>index</parameter>.</para> <para>Attribute variable
name-to-generic attribute index bindings for a program object
can be explicitly assigned at any time by calling
<function>glBindAttribLocation</function>. Attribute bindings do
not go into effect until
<citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>
is called. After a program object has been linked successfully,
the index values for generic attributes remain fixed (and their
values can be queried) until the next link command
occurs.</para>
<para>This command makes it possible for vertex shaders to use
descriptive names for attribute variables rather than generic
variables that are numbered from 0 to
<constant>GL_MAX_VERTEX_ATTRIBS</constant> -1. The values sent
to each generic attribute index are part of current state.
If a different program object is made current by calling
<citerefentry><refentrytitle>glUseProgram</refentrytitle></citerefentry>,
the generic vertex attributes are tracked in such a way that the
same values will be observed by attributes in the new program
object that are also bound to
<parameter>index</parameter>.</para> <para>Attribute variable
name-to-generic attribute index bindings for a program object
can be explicitly assigned at any time by calling
<function>glBindAttribLocation</function>. Attribute bindings do
not go into effect until
<citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>
is called. After a program object has been linked successfully,
the index values for generic attributes remain fixed (and their
values can be queried) until the next link command
occurs.</para>
<para>Applications are not allowed to bind any of the standard
OpenGL vertex attributes using this command, as they are bound
automatically when needed. Any attribute binding that occurs
after the program object has been linked will not take effect
until the next time the program object is linked.</para>
<para>Any attribute binding that occurs after the program object has been linked will not take effect
until the next time the program object is linked.</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para><function>glBindAttribLocation</function> is available
only if the GL version is 2.0 or greater.</para>
<para><function>glBindAttribLocation</function> can be called
before any vertex shader objects are bound to the specified
program object. It is also permissible to bind a generic
attribute index to an attribute variable name that is never used
in a vertex shader.</para>
<para><function>glBindAttribLocation</function> can be called
before any vertex shader objects are bound to the specified
program object. It is also permissible to bind a generic
attribute index to an attribute variable name that is never used
in a vertex shader.</para>
<para>If <parameter>name</parameter> was bound previously, that
information is lost. Thus you cannot bind one user-defined
attribute variable to multiple indices, but you can bind
multiple user-defined attribute variables to the same
index.</para>
<para>If <parameter>name</parameter> was bound previously, that
information is lost. Thus you cannot bind one user-defined
attribute variable to multiple indices, but you can bind
multiple user-defined attribute variables to the same
index.</para>
<para>Applications are allowed to bind more than one
user-defined attribute variable to the same generic vertex
attribute index. This is called <emphasis>aliasing</emphasis>,
and it is allowed only if just one of the aliased attributes is
active in the executable program, or if no path through the
shader consumes more than one attribute of a set of attributes
aliased to the same location. The compiler and linker are
allowed to assume that no aliasing is done and are free to
employ optimizations that work only in the absence of aliasing.
OpenGL implementations are not required to do error checking to
detect aliasing.</para>
<para>Applications are allowed to bind more than one
user-defined attribute variable to the same generic vertex
attribute index. This is called <emphasis>aliasing</emphasis>,
and it is allowed only if just one of the aliased attributes is
active in the executable program, or if no path through the
shader consumes more than one attribute of a set of attributes
aliased to the same location. The compiler and linker are
allowed to assume that no aliasing is done and are free to
employ optimizations that work only in the absence of aliasing.
OpenGL implementations are not required to do error checking to
detect aliasing. Because there is no way to bind standard
attributes, it is not possible to alias generic attributes with
conventional ones (except for generic attribute 0).</para>
<para>Active attributes that are not explicitly bound will be
bound by the linker when
<citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>
is called. The locations assigned can be queried by calling
<citerefentry><refentrytitle>glGetAttribLocation</refentrytitle></citerefentry>.</para>
<para>Active attributes that are not explicitly bound will be
bound by the linker when
<citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>
is called. The locations assigned can be queried by calling
<citerefentry><refentrytitle>glGetAttribLocation</refentrytitle></citerefentry>.</para>
<para>OpenGL copies the <parameter>name</parameter> string when
<function>glBindAttribLocation</function> is called, so an
application may free its copy of the <parameter>name</parameter>
string immediately after the function returns.</para>
<para>OpenGL copies the <parameter>name</parameter> string when
<function>glBindAttribLocation</function> is called, so an
application may free its copy of the <parameter>name</parameter>
string immediately after the function returns.</para>
<para>Generic attribute locations may be specified in the shader source
text using a <function>location</function> layout qualifier. In this case,
the location of the attribute specified in the shader's source takes precedence
and may be queried by calling <citerefentry><refentrytitle>glGetAttribLocation</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para><constant>GL_INVALID_VALUE</constant> is generated if
<parameter>index</parameter> is greater than or equal to
<constant>GL_MAX_VERTEX_ATTRIBS</constant>.</para>
<para><constant>GL_INVALID_VALUE</constant> is generated if
<parameter>index</parameter> is greater than or equal to
<constant>GL_MAX_VERTEX_ATTRIBS</constant>.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if
<parameter>name</parameter> starts with the reserved prefix
&quot;gl_&quot;.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if
<parameter>name</parameter> starts with the reserved prefix
&quot;gl_&quot;.</para>
<para><constant>GL_INVALID_VALUE</constant> is generated if
<parameter>program</parameter> is not a value generated by
OpenGL.</para>
<para><constant>GL_INVALID_VALUE</constant> is generated if
<parameter>program</parameter> is not a value generated by
OpenGL.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if
<parameter>program</parameter> is not a program object.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if
<parameter>program</parameter> is not a program object.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if
<function>glBindAttribLocation</function> is executed between
the execution of
<citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of
<citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para><citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>
with argument <constant>GL_MAX_VERTEX_ATTRIBS</constant></para>
<para><citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>
with argument <constant>GL_MAX_VERTEX_ATTRIBS</constant></para>
<para><citerefentry><refentrytitle>glGetActiveAttrib</refentrytitle></citerefentry>
with argument <parameter>program</parameter></para>
<para><citerefentry><refentrytitle>glGetActiveAttrib</refentrytitle></citerefentry>
with argument <parameter>program</parameter></para>
<para><citerefentry><refentrytitle>glGetAttribLocation</refentrytitle></citerefentry>
with arguments <parameter>program</parameter> and
<parameter>name</parameter></para>
<para><citerefentry><refentrytitle>glGetAttribLocation</refentrytitle></citerefentry>
with arguments <parameter>program</parameter> and
<parameter>name</parameter></para>
<para><citerefentry><refentrytitle>glIsProgram</refentrytitle></citerefentry></para>
<para><citerefentry><refentrytitle>glIsProgram</refentrytitle></citerefentry></para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para><citerefentry><refentrytitle>glDisableVertexAttribArray</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glEnableVertexAttribArray</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glUseProgram</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glVertexAttrib</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glVertexAttribPointer</refentrytitle></citerefentry></para>
<para><citerefentry><refentrytitle>glDisableVertexAttribArray</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glEnableVertexAttribArray</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glUseProgram</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glVertexAttrib</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glVertexAttribPointer</refentrytitle></citerefentry></para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>

View file

@ -34,9 +34,14 @@
Specifies the target to which the buffer object is bound.
The symbolic constant must be
<constant>GL_ARRAY_BUFFER</constant>,
<constant>GL_COPY_READ_BUFFER</constant>,
<constant>GL_COPY_WRITE_BUFFER</constant>,
<constant>GL_ELEMENT_ARRAY_BUFFER</constant>,
<constant>GL_PIXEL_PACK_BUFFER</constant>, or
<constant>GL_PIXEL_UNPACK_BUFFER</constant>.
<constant>GL_PIXEL_PACK_BUFFER</constant>,
<constant>GL_PIXEL_UNPACK_BUFFER</constant>,
<constant>GL_TEXTURE_BUFFER</constant>,
<constant>GL_TRANSFORM_FEEDBACK_BUFFER</constant>, or
<constant>GL_UNIFORM_BUFFER</constant>.
</para>
</listitem>
</varlistentry>
@ -52,26 +57,24 @@
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glBindBuffer</function> lets you create or use a named buffer object. Calling <function>glBindBuffer</function> with
<parameter>target</parameter> set to
<constant>GL_ARRAY_BUFFER</constant>, <constant>GL_ELEMENT_ARRAY_BUFFER</constant>, <constant>GL_PIXEL_PACK_BUFFER</constant> or
<constant>GL_PIXEL_UNPACK_BUFFER</constant> and <parameter>buffer</parameter> set to the name
of the new buffer object binds the buffer object name to the target.
When a buffer object is bound to a target, the previous binding for that
<function>glBindBuffer</function> binds a buffer object to the specified buffer binding point. Calling <function>glBindBuffer</function> with
<parameter>target</parameter> set to one of the accepted symbolic constants and <parameter>buffer</parameter> set to the name
of a buffer object binds that buffer object name to the target. If no buffer object with name <parameter>buffer</parameter>
exists, one is created with that name. When a buffer object is bound to a target, the previous binding for that
target is automatically broken.
</para>
<para>
Buffer object names are unsigned integers. The value zero is reserved, but
there is no default buffer object for each buffer object target. Instead, <parameter>buffer</parameter> set to zero
effectively unbinds any buffer object previously bound, and restores client memory usage for that buffer object target.
effectively unbinds any buffer object previously bound, and restores client memory usage for that buffer object target (if supported for that target).
Buffer object names and the corresponding buffer object contents are local to
the shared display-list space (see <citerefentry><refentrytitle>glXCreateContext</refentrytitle></citerefentry>) of the current
the shared object space of the current
GL rendering context;
two rendering contexts share buffer object names only if they
also share display lists.
explicitly enable sharing between contexts through the appropriate GL windows interfaces functions.
</para>
<para>
You may use <citerefentry><refentrytitle>glGenBuffers</refentrytitle></citerefentry> to generate a set of new buffer object names.
<citerefentry><refentrytitle>glGenBuffers</refentrytitle></citerefentry> must be used to generate a set of unused buffer object names.
</para>
<para>
The state of a buffer object immediately after it is first bound is an unmapped zero-sized memory buffer with
@ -85,62 +88,63 @@
<constant>GL_INVALID_OPERATION</constant> error.
</para>
<para>
When vertex array pointer state is changed, for example by a call to
<citerefentry><refentrytitle>glNormalPointer</refentrytitle></citerefentry>,
the current buffer object binding (<constant>GL_ARRAY_BUFFER_BINDING</constant>) is copied into the
corresponding client state for the vertex array type being changed, for example
<constant>GL_NORMAL_ARRAY_BUFFER_BINDING</constant>. While a non-zero buffer object is bound to the
<constant>GL_ARRAY_BUFFER</constant> target, the vertex array pointer parameter that is traditionally
interpreted as a pointer to client-side memory is instead interpreted as an offset within the
When a non-zero buffer object is bound to the <constant>GL_ARRAY_BUFFER</constant> target,
the vertex array pointer parameter is interpreted as an offset within the
buffer object measured in basic machine units.
</para>
<para>
While a non-zero buffer object is bound to the <constant>GL_ELEMENT_ARRAY_BUFFER</constant> target,
the indices parameter of <citerefentry><refentrytitle>glDrawElements</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawRangeElements</refentrytitle></citerefentry>, or
<citerefentry><refentrytitle>glMultiDrawElements</refentrytitle></citerefentry> that is traditionally
interpreted as a pointer to client-side memory is instead interpreted as an offset within the
buffer object measured in basic machine units.
<citerefentry><refentrytitle>glDrawElementsInstanced</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawElementsBaseVertex</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawRangeElements</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawRangeElementsBaseVertex</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMultiDrawElements</refentrytitle></citerefentry>, or
<citerefentry><refentrytitle>glMultiDrawElementsBaseVertex</refentrytitle></citerefentry> is interpreted as an
offset within the buffer object measured in basic machine units.
</para>
<para>
While a non-zero buffer object is bound to the <constant>GL_PIXEL_PACK_BUFFER</constant> target,
the following commands are affected: <citerefentry><refentrytitle>glGetCompressedTexImage</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGetConvolutionFilter</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGetHistogram</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGetMinmax</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGetPixelMap</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGetPolygonStipple</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGetSeparableFilter</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGetTexImage</refentrytitle></citerefentry>, and
<citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry>. The pointer parameter that is
traditionally interpreted as a pointer to client-side memory where the pixels are to be packed is instead
<citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry>. The pointer parameter is
interpreted as an offset within the buffer object measured in basic machine units.
</para>
<para>
While a non-zero buffer object is bound to the <constant>GL_PIXEL_UNPACK_BUFFER</constant> target,
the following commands are affected: <citerefentry><refentrytitle>glBitmap</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glColorSubTable</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glColorTable</refentrytitle></citerefentry>,
the following commands are affected:
<citerefentry><refentrytitle>glCompressedTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexSubImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexSubImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexSubImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glConvolutionFilter1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glConvolutionFilter2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawPixels</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelMap</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPolygonStipple</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glSeparableFilter2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexSubImage2D</refentrytitle></citerefentry>, and
<citerefentry><refentrytitle>glTexSubImage3D</refentrytitle></citerefentry>. The pointer parameter that is
traditionally interpreted as a pointer to client-side memory from which the pixels are to be unpacked is
instead interpreted as an offset within the buffer object measured in basic machine units.
<citerefentry><refentrytitle>glTexSubImage3D</refentrytitle></citerefentry>. The pointer parameter is
interpreted as an offset within the buffer object measured in basic machine units.
</para>
<para>
The buffer targets <constant>GL_COPY_READ_BUFFER</constant> and <constant>GL_COPY_WRITE_BUFFER</constant>
are provided to allow <citerefentry><refentrytitle>glCopyBufferSubData</refentrytitle></citerefentry>
to be used without disturbing the state of other bindings. However, <citerefentry><refentrytitle>glCopyBufferSubData</refentrytitle></citerefentry>
may be used with any pair of buffer binding points.
</para>
<para>
The <constant>GL_TRANSFORM_FEEDBACK_BUFFER</constant> buffer binding point may be passed to <function>glBindBuffer</function>,
but will not directly affect transform feedback state. Instead, the indexed <constant>GL_TRANSFORM_FEEDBACK_BUFFER</constant>
bindings must be used through a call to <citerefentry><refentrytitle>glBindBufferBase</refentrytitle></citerefentry>
or <citerefentry><refentrytitle>glBindBufferRange</refentrytitle></citerefentry>. This will affect the generic
<constant>GL_TRANSFORM_FEEDABCK_BUFFER</constant> binding.
</para>
<para>
Likewise, the <constant>GL_UNIFORM_BUFFER</constant> buffer binding point may be used, but does not directly affect
uniform buffer state. <citerefentry><refentrytitle>glBindBufferBase</refentrytitle></citerefentry>
or <citerefentry><refentrytitle>glBindBufferRange</refentrytitle></citerefentry> must be used to bind a buffer to
an indexed uniform buffer binding point.
</para>
<para>
A buffer object binding created with <function>glBindBuffer</function> remains active until a different
@ -155,11 +159,8 @@
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glBindBuffer</function> is available only if the GL version is 1.5 or greater.
</para>
<para>
<constant>GL_PIXEL_PACK_BUFFER</constant> and <constant>GL_PIXEL_UNPACK_BUFFER</constant> are
available only if the GL version is 2.1 or greater.
The <constant>GL_COPY_READ_BUFFER</constant>, <constant>GL_UNIFORM_BUFFER</constant> and
<constant>GL_TEXTURE_BUFFER</constant> targets are available only if the GL version is 3.1 or greater.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
@ -168,15 +169,20 @@
values.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glBindBuffer</function> is executed
between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding
execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>buffer</parameter> is not a name previously returned
from a call to <citerefentry><refentrytitle>glGenBuffers</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_ARRAY_BUFFER_BINDING</constant>
</para>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_COPY_READ_BUFFER_BINDING</constant>
</para>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_COPY_WRITE_BUFFER_BINDING</constant>
</para>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_ELEMENT_ARRAY_BUFFER_BINDING</constant>
</para>
@ -186,11 +192,21 @@
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PIXEL_UNPACK_BUFFER_BINDING</constant>
</para>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_TRANSFORM_FEEDBACK_BUFFER_BINDING</constant>
</para>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_UNIFORM_BUFFER_BINDING</constant>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glDeleteBuffers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGenBuffers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBindBufferBase</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBindBufferRange</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMapBuffer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glUnmapBuffer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDeleteBuffers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIsBuffer</refentrytitle></citerefentry>
</para>

View file

@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glBindBufferBase">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glBindBufferBase</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glBindBufferBase</refname>
<refpurpose>bind a buffer object to an indexed buffer target</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glBindBufferBase</function></funcdef>
<paramdef>GLenum<parameter>target</parameter></paramdef>
<paramdef>GLuint<parameter>index</parameter></paramdef>
<paramdef>GLuint<parameter>buffer</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>target</parameter></term>
<listitem>
<para>
Specify the target of the bind operation. <parameter>target</parameter> must be
either <constant>GL_TRANSFORM_FEEDBACK_BUFFER</constant> or <constant>GL_UNIFORM_BUFFER</constant>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>index</parameter></term>
<listitem>
<para>
Specify the index of the binding point within the array specified by <parameter>target</parameter>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>buffer</parameter></term>
<listitem>
<para>
The name of a buffer object to bind to the specified binding point.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glBindBufferBase</function> binds the buffer object <parameter>buffer</parameter>
to the binding point at index <parameter>index</parameter> of the array of targets specified
by <parameter>target</parameter>. Each <parameter>target</parameter> represents an indexed
array of buffer binding points, as well as a single general binding point that can be used by
other buffer manipulation functions such as <citerefentry><refentrytitle>glBindBuffer</refentrytitle></citerefentry>
or <citerefentry><refentrytitle>glMapBuffer</refentrytitle></citerefentry>. In addition to binding
<parameter>buffer</parameter> to the indexed buffer binding target, <function>glBindBufferBase</function>
also binds <parameter>buffer</parameter> to the generic buffer binding point specified by <parameter>target</parameter>.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glBindBufferBase</function> is available only if the GL version is 3.0 or greater.
</para>
<para>
Calling <function>glBindBufferBase</function> is equivalent to calling
<citerefentry><refentrytitle>glBindBufferRange</refentrytitle></citerefentry> with <parameter>offset</parameter>
zero and <parameter>size</parameter> equal to the size of the buffer.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not
<constant>GL_TRANSFORM_FEEDBACK_BUFFER</constant> or <constant>GL_UNIFORM_BUFFER</constant>.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>index</parameter> is greater
than or equal to the number of <parameter>target</parameter>-specific indexed binding points.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glGenBuffers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDeleteBuffers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBindBuffer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBindBufferRange</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMapBuffer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glUnmapBuffer</refentrytitle></citerefentry>,
</para>
</refsect1> <refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -0,0 +1,131 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glBindBufferRange">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glBindBufferRange</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glBindBufferRange</refname>
<refpurpose>bind a range within a buffer object to an indexed buffer target</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glBindBufferRange</function></funcdef>
<paramdef>GLenum<parameter>target</parameter></paramdef>
<paramdef>GLuint<parameter>index</parameter></paramdef>
<paramdef>GLuint<parameter>buffer</parameter></paramdef>
<paramdef>GLintptr<parameter>offset</parameter></paramdef>
<paramdef>GLsizeiptr<parameter>size</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>target</parameter></term>
<listitem>
<para>
Specify the target of the bind operation. <parameter>target</parameter> must be
either <constant>GL_TRANSFORM_FEEDBACK_BUFFER</constant> or <constant>GL_UNIFORM_BUFFER</constant>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>index</parameter></term>
<listitem>
<para>
Specify the index of the binding point within the array specified by <parameter>target</parameter>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>buffer</parameter></term>
<listitem>
<para>
The name of a buffer object to bind to the specified binding point.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>offset</parameter></term>
<listitem>
<para>
The starting offset in basic machine units into the buffer object <parameter>buffer</parameter>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>size</parameter></term>
<listitem>
<para>
The amount of data in machine units that can be read from the buffet object while used as an indexed target.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glBindBufferRange</function> binds a range the buffer object <parameter>buffer</parameter>
represented by <parameter>offset</parameter> and <parameter>size</parameter> to the
binding point at index <parameter>index</parameter> of the array of targets specified by <parameter>target</parameter>.
Each <parameter>target</parameter> represents an indexed array of buffer binding points, as well
as a single general binding point that can be used by other buffer manipulation functions such as
<citerefentry><refentrytitle>glBindBuffer</refentrytitle></citerefentry> or
<citerefentry><refentrytitle>glMapBuffer</refentrytitle></citerefentry>. In addition to binding
a range of <parameter>buffer</parameter> to the indexed buffer binding target, <function>glBindBufferBase</function>
also binds the range to the generic buffer binding point specified by <parameter>target</parameter>.
</para>
<para>
<parameter>offset</parameter> specifies the offset in basic machine units into the buffer object
<parameter>buffer</parameter> and <parameter>size</parameter> specifies the amount of data that
can be read from the buffer object while used as an indexed target.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not
<constant>GL_TRANSFORM_FEEDBACK_BUFFER</constant> or <constant>GL_UNIFORM_BUFFER</constant>.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>index</parameter> is greater
than or equal to the number of <parameter>target</parameter>-specific indexed binding points.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>size</parameter> is less than
or equal to zero, or if <parameter>offset</parameter> + <parameter>size</parameter> is greater
than the value of <constant>GL_BUFFER_SIZE</constant>.
</para>
<para>
Additional errors may be generated if <parameter>offset</parameter> violates any
<parameter>target</parameter>-specific alignmemt restrictions.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glGenBuffers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDeleteBuffers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBindBuffer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBindBufferBase</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMapBuffer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glUnmapBuffer</refentrytitle></citerefentry>,
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -0,0 +1,127 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glBindFragDataLocation">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glBindFragDataLocation</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glBindFragDataLocation</refname>
<refpurpose>bind a user-defined varying out variable to a fragment shader color number</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glBindFragDataLocation</function></funcdef>
<paramdef>GLuint <parameter>program</parameter></paramdef>
<paramdef>GLuint <parameter>colorNumber</parameter></paramdef>
<paramdef>const char * <parameter>name</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>program</parameter></term>
<listitem>
<para>
The name of the program containing varying out variable whose binding to modify
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>colorNumber</parameter></term>
<listitem>
<para>
The color number to bind the user-defined varying out variable to
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>name</parameter></term>
<listitem>
<para>
The name of the user-defined varying out variable whose binding to modify
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glBindFragDataLocation</function> explicitly specifies the binding of the user-defined varying out variable
<parameter>name</parameter> to fragment shader color number <parameter>colorNumber</parameter> for program
<parameter>program</parameter>. If <parameter>name</parameter> was bound previously, its assigned binding is replaced
with <parameter>colorNumber</parameter>. <parameter>name</parameter> must be a null-terminated string. <parameter>colorNumber</parameter>
must be less than <constant>GL_MAX_DRAW_BUFFERS</constant>.
</para>
<para>
The bindings specified by <function>glBindFragDataLocation</function> have no effect until <parameter>program</parameter>
is next linked. Bindings may be specified at any time after <parameter>program</parameter> has been created. Specifically,
they may be specified before shader objects are attached to the program. Therefore, any name may be specified in <parameter>name</parameter>,
including a name that is never used as a varying out variable in any fragment shader object. Names beginning with <constant>gl_</constant> are
reserved by the GL.
</para>
<para>
In addition to the errors generated by <function>glBindFragDataLocation</function>, the
program <parameter>program</parameter> will fail to link if:
<itemizedlist>
<listitem>
<para>
The number of active outputs is greater than the value <constant>GL_MAX_DRAW_BUFFERS</constant>.
</para>
</listitem>
<listitem>
<para>
More than one varying out variable is bound to the same color number.
</para>
</listitem>
</itemizedlist>
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
Varying out varyings may have indexed locations assigned explicitly in the shader text using a <code>location</code>
layout qualifier. If a shader statically assigns a location to a varying out variable in the shader text,
that location is used and any location assigned with <function>glBindFragDataLocation</function> is ignored.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>colorNumber</parameter> is greater than or equal to <constant>GL_MAX_DRAW_BUFFERS</constant>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>name</parameter> starts with the reserved <constant>gl_</constant> prefix.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>program</function> is not the name of a program object.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGetFragDataLocation</refentrytitle></citerefentry> with a valid program object
and the the name of a user-defined varying out variable
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glCreateProgram</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGetFragDataLocation</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -0,0 +1,155 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glBindFragDataLocationIndexed">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glBindFragDataLocationIndexed</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glBindFragDataLocationIndexed</refname>
<refpurpose>bind a user-defined varying out variable to a fragment shader color number and index</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glBindFragDataLocationIndexed</function></funcdef>
<paramdef>GLuint <parameter>program</parameter></paramdef>
<paramdef>GLuint <parameter>colorNumber</parameter></paramdef>
<paramdef>GLuint <parameter>index</parameter></paramdef>
<paramdef>const char *<parameter>name</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>program</parameter></term>
<listitem>
<para>
The name of the program containing varying out variable whose binding to modify
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>colorNumber</parameter></term>
<listitem>
<para>
The color number to bind the user-defined varying out variable to
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>index</parameter></term>
<listitem>
<para>
The index of the color input to bind the user-defined varying out variable to
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>name</parameter></term>
<listitem>
<para>
The name of the user-defined varying out variable whose binding to modify
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glBindFragDataLocationIndexed</function> specifies that the varying out variable <parameter>name</parameter> in
<parameter>program</parameter> should be bound to fragment color <parameter>colorNumber</parameter> when the program is next
linked. <parameter>index</parameter> may be zero or one to specify that the color be used as either the first or second color
input to the blend equation, respectively.
</para>
<para>
The bindings specified by <function>glBindFragDataLocationIndexed</function> have no effect until <parameter>program</parameter>
is next linked. Bindings may be specified at any time after <parameter>program</parameter> has been created. Specifically,
they may be specified before shader objects are attached to the program. Therefore, any name may be specified in <parameter>name</parameter>,
including a name that is never used as a varying out variable in any fragment shader object. Names beginning with <constant>gl_</constant> are
reserved by the GL.
</para>
<para>
If <parameter>name</parameter> was bound previously, its assigned binding is replaced with <parameter>colorNumber</parameter> and
<parameter>index</parameter>. <parameter>name</parameter> must be a null-terminated string. <parameter>index</parameter> must be less than or equal to one,
and <parameter>colorNumber</parameter> must be less than the value of <constant>GL_MAX_DRAW_BUFFERS</constant> if <parameter>index</parameter>
is zero, and less than the value of <constant>GL_MAX_DUAL_SOURCE_DRAW_BUFFERS</constant> if index is greater than or equal to one.
</para>
<para>
In addition to the errors generated by <function>glBindFragDataLocationIndexed</function>, the
program <parameter>program</parameter> will fail to link if:
<itemizedlist>
<listitem>
<para>
The number of active outputs is greater than the value <constant>GL_MAX_DRAW_BUFFERS</constant>.
</para>
</listitem>
<listitem>
<para>
More than one varying out variable is bound to the same color number.
</para>
</listitem>
</itemizedlist>
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
Varying out varyings may have locations assigned explicitly in the shader text using a <code>location</code>
layout qualifier. If a shader statically assigns a location to a varying out variable in the shader text,
that location is used and any location assigned with <function>glBindFragDataLocation</function> is ignored.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>colorNumber</parameter> is greater than or equal to <constant>GL_MAX_DRAW_BUFFERS</constant>.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>colorNumber</parameter> is greater than or equal to <constant>GL_MAX_DUAL_SOURCE_DRAW_BUFERS</constant>
and <parameter>index</parameter> is greater than or equal to one.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>index</parameter> is greater than one.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>name</parameter> starts with the reserved <constant>gl_</constant> prefix.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>program</function> is not the name of a program object.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGetFragDataLocation</refentrytitle></citerefentry> with a valid program object
and the the name of a user-defined varying out variable
</para>
<para>
<citerefentry><refentrytitle>glGetFragDataIndex</refentrytitle></citerefentry> with a valid program object
and the the name of a user-defined varying out variable
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glCreateProgram</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>
<citerefentry><refentrytitle>glGetFragDataLocation</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGetFragDataIndex</refentrytitle></citerefentry>
<citerefentry><refentrytitle>glBindFragDataLocation</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glBindFramebuffer">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glBindFramebuffer</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glBindFramebuffer</refname>
<refpurpose>bind a framebuffer to a framebuffer target</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glBindFramebuffer</function></funcdef>
<paramdef>GLenum <parameter>target</parameter></paramdef>
<paramdef>GLuint <parameter>framebuffer</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>target</parameter></term>
<listitem>
<para>
Specifies the framebuffer target of the binding operation.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>framebuffer</parameter></term>
<listitem>
<para>
Specifies the name of the framebuffer object to bind.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glBindFramebuffer</function> binds the framebuffer object with name <parameter>framebuffer</parameter> to the framebuffer target specified
by <parameter>target</parameter>. <parameter>target</parameter> must be either <constant>GL_DRAW_FRAMEBUFFER</constant>,
<constant>GL_READ_FRAMEBUFFER</constant> or <constant>GL_FRAMEBUFFER</constant>. If a framebuffer object is bound to
<constant>GL_DRAW_FRAMEBUFFER</constant> or <constant>GL_READ_FRAMEBUFFER</constant>, it becomes the target for
rendering or readback operations, respectively, until it is deleted or another framebuffer is bound to the corresponding bind point.
Calling <function>glBindFramebuffer</function> with <parameter>target</parameter> set to <constant>GL_FRAMEBUFFER</constant> binds
<parameter>framebuffer</parameter> to both the read and draw framebuffer targets. <parameter>framebuffer</parameter> is the name of a framebuffer
object previously returned from a call to <citerefentry><refentrytitle>glGenFramebuffers</refentrytitle></citerefentry>, or zero to break the existing
binding of a framebuffer object to <parameter>target</parameter>.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not <constant>GL_DRAW_FRAMEBUFFER</constant>,
<constant>GL_READ_FRAMEBUFFER</constant> or <constant>GL_FRAMEBUFFER</constant>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>framebuffer</parameter> is not zero or the name of a framebuffer
previously returned from a call to <citerefentry><refentrytitle>glGenFramebuffers</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glGenFramebuffers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDeleteFramebuffers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glFramebufferRenderbuffer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glFramebufferTexture</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glFramebufferTexture1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glFramebufferTexture2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glFramebufferTexture3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glFramebufferTextureFace</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glFramebufferTextureLayer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIsFramebuffer</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glBindProgramPipeline">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glBindProgramPipeline</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glBindProgramPipeline</refname>
<refpurpose>bind a program pipeline to the current context</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glBindProgramPipeline</function></funcdef>
<paramdef>GLuint <parameter>pipeline</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>pipeline</parameter></term>
<listitem>
<para>
Specifies the name of the pipeline object to bind to the context.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glBindProgramPipeline</function> binds a program pipeline object to the current
context. <parameter>pipeline</parameter> must be a name previously returned from a call
to <citerefentry><refentrytitle>glGenProgramPipelines</refentrytitle></citerefentry>. If
no program pipeline exists with name <parameter>pipeline</parameter> then a new pipeline object
is created with that name and initialized to the default state vector.
</para>
<para>
When a program pipeline object is bound using <function>glBindProgramPipeline</function>, any previous
binding is broken and is replaced with a binding to the specified pipeline object. If <parameter>pipeline</parameter>
is zero, the previous binding is broken and is not replaced, leaving no pipeline object bound.
If no current program object has been established by <citerefentry><refentrytitle>glUseProgram</refentrytitle></citerefentry>,
the program objects used for each stage and for uniform updates are taken from the bound program
pipeline object, if any. If there is a current program object established by <citerefentry><refentrytitle>glUseProgram</refentrytitle></citerefentry>,
the bound program pipeline object has no effect on rendering or uniform updates. When a bound program
pipeline object is used for rendering, individual shader executables are taken from its program objects.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>pipeline</parameter> is not zero or
a name previously returned from a call to <citerefentry><refentrytitle>glGenProgramPipelines</refentrytitle></citerefentry>
or if such a name has been deleted by a call to
<citerefentry><refentrytitle>glDeleteProgramPipelines</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glCreateShader</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCreateProgram</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompileShader</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGenProgramPipelines</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDeleteProgramPipelines</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIsProgramPipeline</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glBindRenderbuffer">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glBindRenderbuffer</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glBindRenderbuffer</refname>
<refpurpose>bind a renderbuffer to a renderbuffer target</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glBindRenderbuffer</function></funcdef>
<paramdef>GLenum <parameter>target</parameter></paramdef>
<paramdef>GLuint <parameter>renderbuffer</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>target</parameter></term>
<listitem>
<para>
Specifies the renderbuffer target of the binding operation. <parameter>target</parameter> must be <constant>GL_RENDERBUFFER</constant>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>renderbuffer</parameter></term>
<listitem>
<para>
Specifies the name of the renderbuffer object to bind.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glBindRenderbuffer</function> binds the renderbuffer object with name <parameter>renderbuffer</parameter> to the renderbuffer target specified
by <parameter>target</parameter>. <parameter>target</parameter> must be <constant>GL_RENDERBUFFER</constant>. <parameter>renderbuffer</parameter>
is the name of a renderbuffer object previously returned from a call to <citerefentry><refentrytitle>glGenRenderbuffers</refentrytitle></citerefentry>,
or zero to break the existing binding of a renderbuffer object to <parameter>target</parameter>.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not <constant>GL_RENDERBUFFER</constant>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>renderbuffer</parameter> is not zero or the name of a renderbuffer
previously returned from a call to <citerefentry><refentrytitle>glGenRenderbuffers</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glGenRenderbuffers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDeleteRenderbuffers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glRenderbufferStorage</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glRenderbufferStorageMultisample</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIsRenderbuffer</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glBindSampler">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glBindSampler</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glBindSampler</refname>
<refpurpose>bind a named sampler to a texturing target</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glBindSampler</function></funcdef>
<paramdef>GLuint <parameter>unit</parameter></paramdef>
<paramdef>GLuint <parameter>sampler</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>unit</parameter></term>
<listitem>
<para>
Specifies the index of the texture unit to which the sampler is bound.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>sampler</parameter></term>
<listitem>
<para>
Specifies the name of a sampler.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glBindSampler</function> binds <parameter>sampler</parameter> to the texture unit at index <parameter>unit</parameter>.
<parameter>sampler</parameter> must be zero or the name of a sampler object previously returned from a call to
<citerefentry><refentrytitle>glGenSamplers</refentrytitle></citerefentry>. <parameter>unit</parameter> must be less than the value
of <constant>GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS</constant>.
</para>
<para>
When a sampler object is bound to a texture unit, its state supersedes that of
the texture object bound to that texture unit. If the sampler name zero is bound to
a texture unit, the currently bound texture's sampler state becomes active. A single
sampler object may be bound to multiple texture units simultaneously.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glBindSampler</function> is available only if the GL version is 3.3 or higher.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>unit</parameter> is greater than or equal to the value of
<constant>GL_MAX_COMBIED_TEXTURE_IMAGE_UNITS</constant>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>sampler</parameter> is not zero or a name previously
returned from a call to <citerefentry><refentrytitle>glGenSamplers</refentrytitle></citerefentry>, or if such a name has
been deleted by a call to <citerefentry><refentrytitle>glDeleteSamplers</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_SAMPLER_BINDING</constant>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glGenSamplers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDeleteSamplers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glSamplerParameter</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGetSamplerParameter</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGenTextures</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBindTexture</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDeleteTextures</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -36,7 +36,12 @@
<constant>GL_TEXTURE_1D</constant>,
<constant>GL_TEXTURE_2D</constant>,
<constant>GL_TEXTURE_3D</constant>, or
<constant>GL_TEXTURE_CUBE_MAP</constant>.
<constant>GL_TEXTURE_1D_ARRAY</constant>,
<constant>GL_TEXTURE_2D_ARRAY</constant>,
<constant>GL_TEXTURE_RECTANGLE</constant>,
<constant>GL_TEXTURE_CUBE_MAP</constant>,
<constant>GL_TEXTURE_2D_MULTISAMPLE</constant> or
<constant>GL_TEXTURE_2D_MULTISAMPLE_ARRAY</constant>.
</para>
</listitem>
</varlistentry>
@ -54,40 +59,41 @@
<para>
<function>glBindTexture</function> lets you create or use a named texture. Calling <function>glBindTexture</function> with
<parameter>target</parameter> set to
<constant>GL_TEXTURE_1D</constant>, <constant>GL_TEXTURE_2D</constant>, <constant>GL_TEXTURE_3D</constant> or
<constant>GL_TEXTURE_CUBE_MAP</constant> and <parameter>texture</parameter> set to the name
of the new texture binds the texture name to the target.
When a texture is bound to a target, the previous binding for that
target is automatically broken.
<constant>GL_TEXTURE_1D</constant>, <constant>GL_TEXTURE_2D</constant>, <constant>GL_TEXTURE_3D</constant>, or
<constant>GL_TEXTURE_1D_ARRAY</constant>, <constant>GL_TEXTURE_2D_ARRAY</constant>, <constant>GL_TEXTURE_RECTANGLE</constant>,
<constant>GL_TEXTURE_CUBE_MAP</constant>, <constant>GL_TEXTURE_2D_MULTISAMPLE</constant> or <constant>GL_TEXTURE_2D_MULTISAMPLE_ARRAY</constant>
and <parameter>texture</parameter> set to the name of the new texture binds the texture name to the target.
When a texture is bound to a target, the previous binding for that target is automatically broken.
</para>
<para>
Texture names are unsigned integers. The value zero is reserved to
represent the default texture for each texture target.
Texture names and the corresponding texture contents are local to
the shared display-list space (see <citerefentry><refentrytitle>glXCreateContext</refentrytitle></citerefentry>) of the current
GL rendering context;
the shared object space of the current GL rendering context;
two rendering contexts share texture names only if they
also share display lists.
explicitly enable sharing between contexts through the appropriate GL windows interfaces functions.
</para>
<para>
You may use <citerefentry><refentrytitle>glGenTextures</refentrytitle></citerefentry> to generate a set of new texture names.
You must use <citerefentry><refentrytitle>glGenTextures</refentrytitle></citerefentry> to generate a set of new texture names.
</para>
<para>
When a texture is first bound, it assumes the specified target:
A texture first bound to <constant>GL_TEXTURE_1D</constant> becomes one-dimensional texture, a
texture first bound to <constant>GL_TEXTURE_2D</constant> becomes two-dimensional texture, a
texture first bound to <constant>GL_TEXTURE_3D</constant> becomes three-dimensional texture, and a
texture first bound to <constant>GL_TEXTURE_CUBE_MAP</constant>
becomes a cube-mapped texture. The state of a one-dimensional texture
immediately after it is first bound is equivalent to the state of the
default <constant>GL_TEXTURE_1D</constant> at GL initialization, and similarly for two-
and three-dimensional textures and cube-mapped textures.
texture first bound to <constant>GL_TEXTURE_3D</constant> becomes three-dimensional texture, a
texture first bound to <constant>GL_TEXTURE_1D_ARRAY</constant> becomes one-dimensional array texture, a
texture first bound to <constant>GL_TEXTURE_2D_ARRAY</constant> becomes two-dimensional arary texture, a
texture first bound to <constant>GL_TEXTURE_RECTANGLE</constant> becomes rectangle texture, a,
texture first bound to <constant>GL_TEXTURE_CUBE_MAP</constant> becomes a cube-mapped texture, a
texture first bound to <constant>GL_TEXTURE_2D_MULTISAMPLE</constant> becomes a two-dimensional multisampled texture, and a
texture first bound to <constant>GL_TEXTURE_2D_MULTISAMPLE_ARRAY</constant> becomes a two-dimensional multisampled array texture.
The state of a one-dimensional texture immediately after it is first bound is equivalent to the state of the
default <constant>GL_TEXTURE_1D</constant> at GL initialization, and similarly for the other texture types.
</para>
<para>
While a texture is bound, GL operations on the target to which it is
bound affect the bound texture, and queries of the target to which it
is bound return state from the bound texture. If texture mapping is active
on the target to which a texture is bound, the bound texture is used.
is bound return state from the bound texture.
In effect, the texture targets become aliases for the textures currently
bound to them, and the texture name zero refers to the default textures
that were bound to them at initialization.
@ -101,20 +107,14 @@
Once created, a named texture may be re-bound to its same original target as often as needed.
It is usually much faster to use <function>glBindTexture</function> to bind an existing named
texture to one of the texture targets than it is to reload the texture image
using <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>, <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>, or <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>.
For additional control over performance, use
<citerefentry><refentrytitle>glPrioritizeTextures</refentrytitle></citerefentry>.
</para>
<para>
<function>glBindTexture</function> is included in display lists.
using <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>, <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry> or another similar function.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glBindTexture</function> is available only if the GL version is 1.1 or greater.
</para>
<para>
<constant>GL_TEXTURE_CUBE_MAP</constant> is available only if the GL version is 1.3 or greater.
The <constant>GL_TEXTURE_2D_MULTISAMPLE</constant> and <constant>GL_TEXTURE_2D_MULTISAMPLE_ARRAY</constant> targets are available
only if the GL version is 3.2 or higher.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
@ -123,37 +123,34 @@
values.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>texture</parameter> was previously created with a target
that doesn't match that of <parameter>target</parameter>.
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>target</parameter> is not a name returned from
a previous call to <citerefentry><refentrytitle>glGenTextures</refentrytitle></citerefentry>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glBindTexture</function> is executed
between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding
execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>texture</parameter> was previously created with a target
that doesn't match that of <parameter>target</parameter>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_BINDING_1D</constant>
</para>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_BINDING_2D</constant>
</para>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_BINDING_3D</constant>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_BINDING_1D</constant>,
<constant>GL_TEXTURE_BINDING_2D</constant>, <constant>GL_TEXTURE_BINDING_3D</constant>, <constant>GL_TEXTURE_BINDING_1D_ARRAY</constant>,
<constant>GL_TEXTURE_BINDING_2D_ARRAY</constant>, <constant>GL_TEXTURE_BINDING_RECTANGLE</constant>, <constant>GL_TEXTURE_BINDING_2D_MULTISAMPLE</constant>,
or <constant>GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY</constant>.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glAreTexturesResident</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDeleteTextures</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGenTextures</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGetTexParameter</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIsTexture</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPrioritizeTextures</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage2DMultisample</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage3DMultisample</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexParameter</refentrytitle></citerefentry>
</para>
</refsect1>

View file

@ -0,0 +1,112 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glBindTransformFeedback">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group.</holder>
</copyright>
</refmetainfo>
<refentrytitle>glBindTransformFeedback</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glBindTransformFeedback</refname>
<refpurpose>bind a transform feedback object</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glBindTransformFeedback</function></funcdef>
<paramdef>GLenum <parameter>target</parameter></paramdef>
<paramdef>GLuint <parameter>id</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<!-- eqn: ignoring delim $$ -->
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>target</parameter></term>
<listitem>
<para>
Specifies the target to which to bind the transform feedback object <parameter>id</parameter>. <parameter>target</parameter>
must be <constant>GL_TRANSFORM_FEEDBACK</constant>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>id</parameter></term>
<listitem>
<para>
Specifies the name of a transform feedback object reserved by <citerefentry><refentrytitle>glGenTransformFeedbacks</refentrytitle></citerefentry>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glBindTransformFeedback</function> binds the transform feedback object with name <parameter>id</parameter> to the current
GL state. <parameter>id</parameter> must be a name previously returned from a call to
<citerefentry><refentrytitle>glGenTransformFeedbacks</refentrytitle></citerefentry>. If <parameter>id</parameter> has not
previously been bound, a new transform feedback object with name <parameter>id</parameter> and initialized with with the
default transform state vector is created.
</para>
<para>
In the initial state, a default transform feedback object is bound and treated as
a transform feedback object with a name of zero. If the name zero is subsequently bound, the default
transform feedback object is again bound to the GL state.
</para>
<para>
While a transform feedback buffer object is bound, GL operations on the target
to which it is bound affect the bound transform feedback object, and queries of the
target to which a transform feedback object is bound return state from the bound
object. When buffer objects are bound for transform feedback, they are attached to
the currently bound transform feedback object. Buffer objects are used for trans-
form feedback only if they are attached to the currently bound transform feedback
object.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not <constant>GL_TRANSFORM_FEEDBACK</constant>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if the transform feedback operation is
active on the currently bound transform feedback object, and that operation is not paused.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>id</parameter> is not
zero or the name of a transform feedback object returned from a previous call to
<citerefentry><refentrytitle>glGenTransformFeedbacks</refentrytitle></citerefentry>, or
if such a name has been deleted by <citerefentry><refentrytitle>glDeleteTransformFeedbacks</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_TRANSFORM_FEEDBACK_BINDING</constant>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glGenTransformFeedbacks</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDeleteTransformFeedbacks</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIsTransformFeedback</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBeginTransformFeedback</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPauseTransformFeedback</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glResumeTransformFeedback</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glEndTransformFeedback</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glBindVertexArray">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glBindVertexArray</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glBindVertexArray</refname>
<refpurpose>bind a vertex array object</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glBindVertexArray</function></funcdef>
<paramdef>GLuint <parameter>array</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>array</parameter></term>
<listitem>
<para>
Specifies the name of the vertex array to bind.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glBindVertexArray</function> binds the vertex array object with name <parameter>array</parameter>. <parameter>array</parameter>
is the name of a vertex array object previously returned from a call to <citerefentry><refentrytitle>glGenVertexArrays</refentrytitle></citerefentry>,
or zero to break the existing vertex array object binding.
</para>
<para>
If no vertex array object with name <parameter>array</parameter> exists, one is created when <parameter>array</parameter> is first bound. If the bind
is successful no change is made to the state of the vertex array object, and any previous vertex array object binding is broken.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>array</parameter> is not zero or the name of a vertex array object
previously returned from a call to <citerefentry><refentrytitle>glGenVertexArrays</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glGenVertexArrays</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDeleteVertexArrays</refentrytitle></citerefentry>
<citerefentry><refentrytitle>glVertexAttribPointer</refentrytitle></citerefentry>
<citerefentry><refentrytitle>glEnableVertexAttribArray</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -48,7 +48,7 @@
The <constant>GL_BLEND_COLOR</constant> may be used to calculate the source and destination
blending factors. The color components are clamped to the range
<inlineequation><mml:math>
<!-- eqn: [0,1]:-->
<!-- eqn: [0,1]: -->
<mml:mfenced open="[" close="]">
<mml:mn>0</mml:mn>
<mml:mn>1</mml:mn>
@ -59,22 +59,6 @@
Initially the <constant>GL_BLEND_COLOR</constant> is set to (0, 0, 0, 0).
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glBlendColor</function> is part of the <code>ARB_imaging</code> subset. <function>glBlendColor</function> is present only
if <code>ARB_imaging</code> is returned when <citerefentry><refentrytitle>glGetString</refentrytitle></citerefentry> is called with
<constant>GL_EXTENSIONS</constant> as its argument.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glBlendColor</function> is executed
between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding
execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
<para>
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with an argument of <constant>GL_BLEND_COLOR</constant>

View file

@ -57,7 +57,7 @@
In the equations that follow, source and destination
color components are referred to as
<inlineequation><mml:math>
<!-- eqn: ( R sub s, G sub s, B sub s, A sub s ):-->
<!-- eqn: ( R sub s, G sub s, B sub s, A sub s ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
@ -75,7 +75,7 @@
</mml:math></inlineequation>
and
<inlineequation><mml:math>
<!-- eqn: ( R sub d, G sub d, B sub d, A sub d ):-->
<!-- eqn: ( R sub d, G sub d, B sub d, A sub d ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
@ -94,7 +94,7 @@
respectively.
The result color is referred to as
<inlineequation><mml:math>
<!-- eqn: ( R sub r, G sub r, B sub r, A sub r ):-->
<!-- eqn: ( R sub r, G sub r, B sub r, A sub r ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">r</mml:mi>
@ -112,7 +112,7 @@
</mml:math></inlineequation>.
The source and destination blend factors are denoted
<inlineequation><mml:math>
<!-- eqn: ( s sub R, s sub G, s sub B, s sub A ):-->
<!-- eqn: ( s sub R, s sub G, s sub B, s sub A ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
@ -130,7 +130,7 @@
</mml:math></inlineequation>
and
<inlineequation><mml:math>
<!-- eqn: ( d sub R, d sub G, d sub B, d sub A ):-->
<!-- eqn: ( d sub R, d sub G, d sub B, d sub A ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
@ -150,7 +150,7 @@
For these equations all color components are understood to have values
in the range
<inlineequation><mml:math>
<!-- eqn: [0,1]:-->
<!-- eqn: [0,1]: -->
<mml:mfenced open="[" close="]">
<mml:mn>0</mml:mn>
<mml:mn>1</mml:mn>
@ -182,100 +182,100 @@
</entry>
<entry align="left">
<informalequation><mml:math>
<!-- eqn: Rr = R sub s s sub R + R sub d d sub R :-->
<!-- eqn: Rr = R sub s s sub R + R sub d d sub R : -->
<mml:mrow>
<mml:mi mathvariant="italic">Rr</mml:mi>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
</mml:msub>
<mml:mo>+</mml:mo>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
</mml:msub>
<mml:mo>+</mml:mo>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mrow>
</mml:math></informalequation>
<informalequation><mml:math>
<!-- eqn: Gr = G sub s s sub G + G sub d d sub G :-->
<!-- eqn: Gr = G sub s s sub G + G sub d d sub G : -->
<mml:mrow>
<mml:mi mathvariant="italic">Gr</mml:mi>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">G</mml:mi>
</mml:msub>
<mml:mo>+</mml:mo>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">G</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">G</mml:mi>
</mml:msub>
<mml:mo>+</mml:mo>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">G</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mrow>
</mml:math></informalequation>
<informalequation><mml:math>
<!-- eqn: Br = B sub s s sub B + B sub d d sub B :-->
<!-- eqn: Br = B sub s s sub B + B sub d d sub B : -->
<mml:mrow>
<mml:mi mathvariant="italic">Br</mml:mi>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">B</mml:mi>
</mml:msub>
<mml:mo>+</mml:mo>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">B</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">B</mml:mi>
</mml:msub>
<mml:mo>+</mml:mo>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">B</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mrow>
</mml:math></informalequation>
</entry>
<entry align="left">
<informalequation><mml:math>
<!-- eqn: Ar = A sub s s sub A + A sub d d sub A :-->
<!-- eqn: Ar = A sub s s sub A + A sub d d sub A : -->
<mml:mrow>
<mml:mi mathvariant="italic">Ar</mml:mi>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
<mml:mo>+</mml:mo>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
<mml:mo>+</mml:mo>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mrow>
</mml:math></informalequation>
@ -287,100 +287,100 @@
</entry>
<entry align="left">
<informalequation><mml:math>
<!-- eqn: Rr = R sub s s sub R - R sub d d sub R :-->
<!-- eqn: Rr = R sub s s sub R - R sub d d sub R : -->
<mml:mrow>
<mml:mi mathvariant="italic">Rr</mml:mi>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
</mml:msub>
<mml:mo>-</mml:mo>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
</mml:msub>
<mml:mo>-</mml:mo>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mrow>
</mml:math></informalequation>
<informalequation><mml:math>
<!-- eqn: Gr = G sub s s sub G - G sub d d sub G :-->
<!-- eqn: Gr = G sub s s sub G - G sub d d sub G : -->
<mml:mrow>
<mml:mi mathvariant="italic">Gr</mml:mi>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">G</mml:mi>
</mml:msub>
<mml:mo>-</mml:mo>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">G</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">G</mml:mi>
</mml:msub>
<mml:mo>-</mml:mo>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">G</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mrow>
</mml:math></informalequation>
<informalequation><mml:math>
<!-- eqn: Br = B sub s s sub B - B sub d d sub B :-->
<!-- eqn: Br = B sub s s sub B - B sub d d sub B : -->
<mml:mrow>
<mml:mi mathvariant="italic">Br</mml:mi>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">B</mml:mi>
</mml:msub>
<mml:mo>-</mml:mo>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">B</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">B</mml:mi>
</mml:msub>
<mml:mo>-</mml:mo>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">B</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mrow>
</mml:math></informalequation>
</entry>
<entry align="left">
<informalequation><mml:math>
<!-- eqn: Ar = A sub s s sub A - A sub d d sub A :-->
<!-- eqn: Ar = A sub s s sub A - A sub d d sub A : -->
<mml:mrow>
<mml:mi mathvariant="italic">Ar</mml:mi>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
<mml:mo>-</mml:mo>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
<mml:mo>-</mml:mo>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mrow>
</mml:math></informalequation>
@ -392,100 +392,100 @@
</entry>
<entry align="left">
<informalequation><mml:math>
<!-- eqn: Rr = R sub d d sub R - R sub s s sub R :-->
<!-- eqn: Rr = R sub d d sub R - R sub s s sub R : -->
<mml:mrow>
<mml:mi mathvariant="italic">Rr</mml:mi>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
</mml:msub>
<mml:mo>-</mml:mo>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
</mml:msub>
<mml:mo>-</mml:mo>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mrow>
</mml:math></informalequation>
<informalequation><mml:math>
<!-- eqn: Gr = G sub d d sub G - G sub s s sub G :-->
<!-- eqn: Gr = G sub d d sub G - G sub s s sub G : -->
<mml:mrow>
<mml:mi mathvariant="italic">Gr</mml:mi>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">G</mml:mi>
</mml:msub>
<mml:mo>-</mml:mo>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">G</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">G</mml:mi>
</mml:msub>
<mml:mo>-</mml:mo>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">G</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mrow>
</mml:math></informalequation>
<informalequation><mml:math>
<!-- eqn: Br = B sub d d sub B - B sub s s sub B :-->
<!-- eqn: Br = B sub d d sub B - B sub s s sub B : -->
<mml:mrow>
<mml:mi mathvariant="italic">Br</mml:mi>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">B</mml:mi>
</mml:msub>
<mml:mo>-</mml:mo>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">B</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">B</mml:mi>
</mml:msub>
<mml:mo>-</mml:mo>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">B</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mrow>
</mml:math></informalequation>
</entry>
<entry align="left">
<informalequation><mml:math>
<!-- eqn: Ar = A sub d d sub A - A sub s s sub A :-->
<!-- eqn: Ar = A sub d d sub A - A sub s s sub A : -->
<mml:mrow>
<mml:mi mathvariant="italic">Ar</mml:mi>
<mml:mo>=</mml:mo>
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
<mml:mo>-</mml:mo>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
<mml:mo>-</mml:mo>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
<mml:mo>&it;</mml:mo>
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mrow>
</mml:math></informalequation>
@ -497,7 +497,7 @@
</entry>
<entry align="left">
<informalequation><mml:math>
<!-- eqn: Rr = min ( R sub s, R sub d):-->
<!-- eqn: Rr = min ( R sub s, R sub d): -->
<mml:mrow>
<mml:mi mathvariant="italic">Rr</mml:mi>
<mml:mo>=</mml:mo>
@ -520,7 +520,7 @@
</mml:mrow>
</mml:math></informalequation>
<informalequation><mml:math>
<!-- eqn: Gr = min ( G sub s, G sub d):-->
<!-- eqn: Gr = min ( G sub s, G sub d): -->
<mml:mrow>
<mml:mi mathvariant="italic">Gr</mml:mi>
<mml:mo>=</mml:mo>
@ -543,7 +543,7 @@
</mml:mrow>
</mml:math></informalequation>
<informalequation><mml:math>
<!-- eqn: Br = min ( B sub s, B sub d):-->
<!-- eqn: Br = min ( B sub s, B sub d): -->
<mml:mrow>
<mml:mi mathvariant="italic">Br</mml:mi>
<mml:mo>=</mml:mo>
@ -568,7 +568,7 @@
</entry>
<entry align="left">
<informalequation><mml:math>
<!-- eqn: Ar = min ( A sub s, A sub d):-->
<!-- eqn: Ar = min ( A sub s, A sub d): -->
<mml:mrow>
<mml:mi mathvariant="italic">Ar</mml:mi>
<mml:mo>=</mml:mo>
@ -598,7 +598,7 @@
</entry>
<entry align="left">
<informalequation><mml:math>
<!-- eqn: Rr = max ( R sub s, R sub d):-->
<!-- eqn: Rr = max ( R sub s, R sub d): -->
<mml:mrow>
<mml:mi mathvariant="italic">Rr</mml:mi>
<mml:mo>=</mml:mo>
@ -621,7 +621,7 @@
</mml:mrow>
</mml:math></informalequation>
<informalequation><mml:math>
<!-- eqn: Gr = max ( G sub s, G sub d):-->
<!-- eqn: Gr = max ( G sub s, G sub d): -->
<mml:mrow>
<mml:mi mathvariant="italic">Gr</mml:mi>
<mml:mo>=</mml:mo>
@ -644,7 +644,7 @@
</mml:mrow>
</mml:math></informalequation>
<informalequation><mml:math>
<!-- eqn: Br = max ( B sub s, B sub d):-->
<!-- eqn: Br = max ( B sub s, B sub d): -->
<mml:mrow>
<mml:mi mathvariant="italic">Br</mml:mi>
<mml:mo>=</mml:mo>
@ -669,7 +669,7 @@
</entry>
<entry align="left">
<informalequation><mml:math>
<!-- eqn: Ar = max ( A sub s, A sub d):-->
<!-- eqn: Ar = max ( A sub s, A sub d): -->
<mml:mrow>
<mml:mi mathvariant="italic">Ar</mml:mi>
<mml:mo>=</mml:mo>
@ -700,7 +700,7 @@
<para>
The results of these equations are clamped to the range
<inlineequation><mml:math>
<!-- eqn: [0,1]:-->
<!-- eqn: [0,1]: -->
<mml:mfenced open="[" close="]">
<mml:mn>0</mml:mn>
<mml:mn>1</mml:mn>
@ -732,11 +732,6 @@
<constant>GL_FUNC_ADD</constant>, <constant>GL_FUNC_SUBTRACT</constant>, <constant>GL_FUNC_REVERSE_SUBTRACT</constant>,
<constant>GL_MAX</constant>, or <constant>GL_MIN</constant>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glBlendEquation</function> is executed
between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding
execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
@ -748,7 +743,6 @@
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glGetString</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBlendColor</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBlendFunc</refentrytitle></citerefentry>
<citerefentry><refentrytitle>glBlendFuncSeparate</refentrytitle></citerefentry>

View file

@ -732,9 +732,6 @@
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glBlendEquationSeparate</function> is available only if the GL version is 2.0 or greater.
</para>
<para>
The <constant>GL_MIN</constant>, and <constant>GL_MAX</constant> equations do not use
the source or destination factors, only the source and destination colors.
@ -746,11 +743,6 @@
<constant>GL_FUNC_ADD</constant>, <constant>GL_FUNC_SUBTRACT</constant>, <constant>GL_FUNC_REVERSE_SUBTRACT</constant>,
<constant>GL_MAX</constant>, or <constant>GL_MIN</constant>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glBlendEquationSeparate</function> is executed
between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding
execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>

View file

@ -34,22 +34,6 @@
<para>
Specifies how the red, green, blue,
and alpha source blending factors are computed.
The following symbolic constants are accepted:
<constant>GL_ZERO</constant>,
<constant>GL_ONE</constant>,
<constant>GL_SRC_COLOR</constant>,
<constant>GL_ONE_MINUS_SRC_COLOR</constant>,
<constant>GL_DST_COLOR</constant>,
<constant>GL_ONE_MINUS_DST_COLOR</constant>,
<constant>GL_SRC_ALPHA</constant>,
<constant>GL_ONE_MINUS_SRC_ALPHA</constant>,
<constant>GL_DST_ALPHA</constant>,
<constant>GL_ONE_MINUS_DST_ALPHA</constant>,
<constant>GL_CONSTANT_COLOR</constant>,
<constant>GL_ONE_MINUS_CONSTANT_COLOR</constant>,
<constant>GL_CONSTANT_ALPHA</constant>,
<constant>GL_ONE_MINUS_CONSTANT_ALPHA</constant>, and
<constant>GL_SRC_ALPHA_SATURATE</constant>.
The initial value is <constant>GL_ONE</constant>.
</para>
</listitem>
@ -83,7 +67,7 @@
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
In RGBA mode, pixels can be drawn using a function that blends
Pixels can be drawn using a function that blends
the incoming (source) RGBA values with the RGBA values
that are already in the frame buffer (the destination values).
Blending is initially disabled.
@ -96,31 +80,68 @@
source color components.
<parameter>dfactor</parameter> specifies which method is used to scale the
destination color components.
Both parameters must be one of the following symbolic constants:
<constant>GL_ZERO</constant>,
<constant>GL_ONE</constant>,
<constant>GL_SRC_COLOR</constant>,
<constant>GL_ONE_MINUS_SRC_COLOR</constant>,
<constant>GL_DST_COLOR</constant>,
<constant>GL_ONE_MINUS_DST_COLOR</constant>,
<constant>GL_SRC_ALPHA</constant>,
<constant>GL_ONE_MINUS_SRC_ALPHA</constant>,
<constant>GL_DST_ALPHA</constant>,
<constant>GL_ONE_MINUS_DST_ALPHA</constant>,
<constant>GL_CONSTANT_COLOR</constant>,
<constant>GL_ONE_MINUS_CONSTANT_COLOR</constant>,
<constant>GL_CONSTANT_ALPHA</constant>,
<constant>GL_ONE_MINUS_CONSTANT_ALPHA</constant>,
<constant>GL_SRC_ALPHA_SATURATE</constant>,
<constant>GL_SRC1_COLOR</constant>,
<constant>GL_ONE_MINUS_SRC1_COLOR</constant>,
<constant>GL_SRC1_ALPHA</constant>, and
<constant>GL_ONE_MINUS_SRC1_ALPHA</constant>.
The possible methods are described in the following table.
Each method defines four scale factors,
one each for red, green, blue, and alpha.
In the table and in subsequent equations, source and destination
color components are referred to as
In the table and in subsequent equations, first source, second source
and destination color components are referred to as
<inlineequation><mml:math>
<!-- eqn: ( R sub s , G sub s , B sub s , A sub s ):-->
<!-- eqn: ( R sub s0 , G sub s0 , B sub s0 , A sub s0 ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
</mml:mfenced>
</mml:math></inlineequation>,
<inlineequation><mml:math>
<!-- eqn: ( R sub s1 , G sub s1 , B sub s1 , A sub s1 ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
</mml:mfenced>
</mml:math></inlineequation>
and
<inlineequation><mml:math>
<!-- eqn: ( R sub d , G sub d , B sub d , A sub d ):-->
<!-- eqn: ( R sub d , G sub d , B sub d , A sub d ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
@ -135,10 +156,10 @@
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
</mml:mfenced>
</mml:math></inlineequation>.
</mml:math></inlineequation>, respectively.
The color specified by <citerefentry><refentrytitle>glBlendColor</refentrytitle></citerefentry> is referred to as
<inlineequation><mml:math>
<!-- eqn: ( R sub c , G sub c , B sub c , A sub c ):-->
<!-- eqn: ( R sub c , G sub c , B sub c , A sub c ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">c</mml:mi>
@ -156,7 +177,7 @@
</mml:math></inlineequation>.
They are understood to have integer values between 0 and
<inlineequation><mml:math>
<!-- eqn: ( k sub R , k sub G , k sub B , k sub A ):-->
<!-- eqn: ( k sub R , k sub G , k sub B , k sub A ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
@ -177,7 +198,7 @@
<para>
<para>
<inlineequation><mml:math>
<!-- eqn: k sub c = 2 sup {m sub c} - 1:-->
<!-- eqn: k sub c = 2 sup {m sub c} - 1: -->
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">c</mml:mi>
@ -201,7 +222,7 @@
<para>
and
<inlineequation><mml:math>
<!-- eqn: ( m sub R , m sub G , m sub B , m sub A ):-->
<!-- eqn: ( m sub R , m sub G , m sub B , m sub A ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">m</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
@ -225,7 +246,7 @@
<para>
Source and destination scale factors are referred to as
<inlineequation><mml:math>
<!-- eqn: ( s sub R , s sub G , s sub B , s sub A ):-->
<!-- eqn: ( s sub R , s sub G , s sub B , s sub A ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
@ -243,7 +264,7 @@
</mml:math></inlineequation>
and
<inlineequation><mml:math>
<!-- eqn: ( d sub R , d sub G , d sub B , d sub A ):-->
<!-- eqn: ( d sub R , d sub G , d sub B , d sub A ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
@ -262,7 +283,7 @@
The scale factors described in the table,
denoted
<inlineequation><mml:math>
<!-- eqn: ( f sub R , f sub G , f sub B , f sub A ):-->
<!-- eqn: ( f sub R , f sub G , f sub B , f sub A ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">f</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
@ -281,7 +302,7 @@
represent either source or destination factors.
All scale factors have range
<inlineequation><mml:math>
<!-- eqn: [0,1]:-->
<!-- eqn: [0,1]: -->
<mml:mfenced open="[" close="]">
<mml:mn>0</mml:mn>
<mml:mn>1</mml:mn>
@ -301,7 +322,7 @@
</emphasis></entry>
<entry rowsep="1" align="left"><emphasis role="bold">
<inlineequation><mml:math>
<!-- eqn: ( f sub R , f sub G , f sub B , f sub A ):-->
<!-- eqn: ( f sub R , f sub G , f sub B , f sub A ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">f</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
@ -327,7 +348,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( 0, 0, 0, 0 ):-->
<!-- eqn: ( 0, 0, 0, 0 ): -->
<mml:mfenced open="(" close=")">
<mml:mn>0</mml:mn>
<mml:mn>0</mml:mn>
@ -343,7 +364,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( 1, 1, 1, 1 ):-->
<!-- eqn: ( 1, 1, 1, 1 ): -->
<mml:mfenced open="(" close=")">
<mml:mn>1</mml:mn>
<mml:mn>1</mml:mn>
@ -359,11 +380,11 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( R sub s / k sub R , G sub s / k sub G , B sub s / k sub B , A sub s / k sub A ):-->
<!-- eqn: ( R sub s0 / k sub R , G sub s0 / k sub G , B sub s0 / k sub B , A sub s0 / k sub A ): -->
<mml:mfenced open="(" close=")">
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
@ -371,7 +392,7 @@
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">G</mml:mi>
@ -379,7 +400,7 @@
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">B</mml:mi>
@ -387,7 +408,7 @@
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
@ -403,7 +424,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( 1, 1, 1, 1 ) - (R sub s / k sub R , G sub s / k sub G , B sub s / k sub B , A sub s / k sub A ):-->
<!-- eqn: ( 1, 1, 1, 1 ) - (R sub s0 / k sub R , G sub s0 / k sub G , B sub s0 / k sub B , A sub s0 / k sub A ): -->
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mn>1</mml:mn>
@ -415,7 +436,7 @@
<mml:mfenced open="(" close=")">
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
@ -423,7 +444,7 @@
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">G</mml:mi>
@ -431,7 +452,7 @@
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">B</mml:mi>
@ -439,7 +460,7 @@
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
@ -456,7 +477,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( R sub d / k sub R , G sub d / k sub G , B sub d / k sub B , A sub d / k sub A ):-->
<!-- eqn: ( R sub d / k sub R , G sub d / k sub G , B sub d / k sub B , A sub d / k sub A ): -->
<mml:mfenced open="(" close=")">
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
@ -500,7 +521,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( 1, 1, 1, 1 ) - (R sub d / k sub R , G sub d / k sub G , B sub d / k sub B , A sub d / k sub A ):-->
<!-- eqn: ( 1, 1, 1, 1 ) - (R sub d / k sub R , G sub d / k sub G , B sub d / k sub B , A sub d / k sub A ): -->
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mn>1</mml:mn>
@ -553,11 +574,11 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( A sub s / k sub A , A sub s / k sub A , A sub s / k sub A , A sub s / k sub A ):-->
<!-- eqn: ( A sub s0 / k sub A , A sub s0 / k sub A , A sub s0 / k sub A , A sub s0 / k sub A ): -->
<mml:mfenced open="(" close=")">
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
@ -565,7 +586,7 @@
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
@ -573,7 +594,7 @@
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
@ -581,7 +602,7 @@
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
@ -597,7 +618,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( 1, 1, 1, 1 ) - (A sub s / k sub A , A sub s / k sub A , A sub s / k sub A , A sub s / k sub A ):-->
<!-- eqn: ( 1, 1, 1, 1 ) - (A sub s0 / k sub A , A sub s0 / k sub A , A sub s0 / k sub A , A sub s0 / k sub A ): -->
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mn>1</mml:mn>
@ -609,7 +630,7 @@
<mml:mfenced open="(" close=")">
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
@ -617,7 +638,7 @@
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
@ -625,7 +646,7 @@
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
@ -633,7 +654,7 @@
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
@ -650,7 +671,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( A sub d / k sub A , A sub d / k sub A , A sub d / k sub A , A sub d / k sub A ):-->
<!-- eqn: ( A sub d / k sub A , A sub d / k sub A , A sub d / k sub A , A sub d / k sub A ): -->
<mml:mfenced open="(" close=")">
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
@ -694,7 +715,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( 1, 1, 1, 1 ) - ( A sub d / k sub A , A sub d / k sub A , A sub d / k sub A , A sub d / k sub A ):-->
<!-- eqn: ( 1, 1, 1, 1 ) - ( A sub d / k sub A , A sub d / k sub A , A sub d / k sub A , A sub d / k sub A ): -->
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mn>1</mml:mn>
@ -747,7 +768,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( R sub c, G sub c, B sub c, A sub c ):-->
<!-- eqn: ( R sub c, G sub c, B sub c, A sub c ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">c</mml:mi>
@ -771,7 +792,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( 1, 1, 1, 1 ) - ( R sub c, G sub c, B sub c, A sub c ):-->
<!-- eqn: ( 1, 1, 1, 1 ) - ( R sub c, G sub c, B sub c, A sub c ): -->
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mn>1</mml:mn>
@ -804,7 +825,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( A sub c, A sub c, A sub c, A sub c ):-->
<!-- eqn: ( A sub c, A sub c, A sub c, A sub c ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">c</mml:mi>
@ -828,7 +849,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( 1, 1, 1, 1 ) - ( A sub c, A sub c, A sub c, A sub c ):-->
<!-- eqn: ( 1, 1, 1, 1 ) - ( A sub c, A sub c, A sub c, A sub c ): -->
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mn>1</mml:mn>
@ -861,7 +882,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( i, i, i, 1 ):-->
<!-- eqn: ( i, i, i, 1 ): -->
<mml:mfenced open="(" close=")">
<mml:mi mathvariant="italic">i</mml:mi>
<mml:mi mathvariant="italic">i</mml:mi>
@ -871,6 +892,200 @@
</mml:math></inlineequation>
</entry>
</row>
<row>
<entry align="left">
<constant>GL_SRC1_COLOR</constant>
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( R sub s1 / k sub R , G sub s1 / k sub G , B sub s1 / k sub B , A sub s1 / k sub A ): -->
<mml:mfenced open="(" close=")">
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">G</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">B</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mfrac>
</mml:mfenced>
</mml:math></inlineequation>
</entry>
</row>
<row>
<entry align="left">
<constant>GL_ONE_MINUS_SRC1_COLOR</constant>
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( 1, 1, 1, 1 ) - (R sub s1 / k sub R , G sub s1 / k sub G , B sub s1 / k sub B , A sub s1 / k sub A ): -->
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mn>1</mml:mn>
<mml:mn>1</mml:mn>
<mml:mn>1</mml:mn>
<mml:mn>1</mml:mn>
</mml:mfenced>
<mml:mo>-</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">G</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">B</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mfrac>
</mml:mfenced>
</mml:mrow>
</mml:math></inlineequation>
</entry>
</row>
<row>
<entry align="left">
<constant>GL_SRC1_ALPHA</constant>
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( A sub s1 / k sub A , A sub s1 / k sub A , A sub s1 / k sub A , A sub s1 / k sub A ): -->
<mml:mfenced open="(" close=")">
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mfrac>
</mml:mfenced>
</mml:math></inlineequation>
</entry>
</row>
<row>
<entry align="left">
<constant>GL_ONE_MINUS_SRC1_ALPHA</constant>
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( 1, 1, 1, 1 ) - (A sub s1 / k sub A , A sub s1 / k sub A , A sub s1 / k sub A , A sub s1 / k sub A ): -->
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mn>1</mml:mn>
<mml:mn>1</mml:mn>
<mml:mn>1</mml:mn>
<mml:mn>1</mml:mn>
</mml:mfenced>
<mml:mo>-</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mfrac>
</mml:mfenced>
</mml:mrow>
</mml:math></inlineequation>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
@ -880,7 +1095,7 @@
<para>
<para>
<inlineequation><mml:math>
<!-- eqn: i = min (A sub s , k sub A - A sub d ) / k sub A:-->
<!-- eqn: i = min (A sub s , k sub A - A sub d ) / k sub A: -->
<mml:mrow>
<mml:mi mathvariant="italic">i</mml:mi>
<mml:mo>=</mml:mo>
@ -912,13 +1127,13 @@
</para>
</para>
<para>
To determine the blended RGBA values of a pixel when drawing in RGBA mode,
To determine the blended RGBA values of a pixel,
the system uses the following equations:
</para>
<para>
<para>
<inlineequation><mml:math>
<!-- eqn: R sub d = min ( k sub R, R sub s s sub R + R sub d d sub R ):-->
<!-- eqn: R sub d = min ( k sub R, R sub s s sub R + R sub d d sub R ): -->
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
@ -953,7 +1168,7 @@
</mml:mrow>
</mml:math></inlineequation>
<inlineequation><mml:math>
<!-- eqn: G sub d = min ( k sub G, G sub s s sub G + G sub d d sub G ):-->
<!-- eqn: G sub d = min ( k sub G, G sub s s sub G + G sub d d sub G ): -->
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
@ -988,7 +1203,7 @@
</mml:mrow>
</mml:math></inlineequation>
<inlineequation><mml:math>
<!-- eqn: B sub d = min ( k sub B, B sub s s sub B + B sub d d sub B ):-->
<!-- eqn: B sub d = min ( k sub B, B sub s s sub B + B sub d d sub B ): -->
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
@ -1023,7 +1238,7 @@
</mml:mrow>
</mml:math></inlineequation>
<inlineequation><mml:math>
<!-- eqn: A sub d = min ( k sub A, A sub s s sub A + A sub d d sub A ):-->
<!-- eqn: A sub d = min ( k sub A, A sub s s sub A + A sub d d sub A ): -->
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
@ -1072,14 +1287,14 @@
<parameter>dfactor</parameter> is <constant>GL_ONE_MINUS_SRC_ALPHA</constant>,
and
<inlineequation><mml:math>
<!-- eqn: A sub s:-->
<!-- eqn: A sub s: -->
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
</mml:math></inlineequation>
is equal to
<inlineequation><mml:math>
<!-- eqn: k sub A:-->
<!-- eqn: k sub A: -->
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
@ -1089,7 +1304,7 @@
<para>
<para>
<inlineequation><mml:math>
<!-- eqn: R sub d = R sub s:-->
<!-- eqn: R sub d = R sub s: -->
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
@ -1101,7 +1316,7 @@
</mml:mrow>
</mml:math></inlineequation>
<inlineequation><mml:math>
<!-- eqn: G sub d = G sub s:-->
<!-- eqn: G sub d = G sub s: -->
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
@ -1113,7 +1328,7 @@
</mml:mrow>
</mml:math></inlineequation>
<inlineequation><mml:math>
<!-- eqn: B sub d = B sub s:-->
<!-- eqn: B sub d = B sub s: -->
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
@ -1125,7 +1340,7 @@
</mml:mrow>
</mml:math></inlineequation>
<inlineequation><mml:math>
<!-- eqn: A sub d = A sub s:-->
<!-- eqn: A sub d = A sub s: -->
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
@ -1173,7 +1388,7 @@
Incoming (source) alpha is correctly thought of as a material opacity,
ranging from 1.0
(<inlineequation><mml:math>
<!-- eqn: K sub A:-->
<!-- eqn: K sub A: -->
<mml:msub><mml:mi mathvariant="italic">K</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
@ -1189,33 +1404,16 @@
(See <citerefentry><refentrytitle>glDrawBuffer</refentrytitle></citerefentry>.)
</para>
<para>
Blending affects only RGBA rendering.
It is ignored by color index renderers.
</para>
<para>
<constant>GL_CONSTANT_COLOR</constant>, <constant>GL_ONE_MINUS_CONSTANT_COLOR</constant>,
<constant>GL_CONSTANT_ALPHA</constant>, <constant>GL_ONE_MINUS_CONSTANT_ALPHA</constant> are available only
if the GL version is 1.4 or greater or if the <code>ARB_imaging</code> is
supported by your implementation.
</para>
<para>
<constant>GL_SRC_COLOR</constant> and <constant>GL_ONE_MINUS_SRC_COLOR</constant> are valid only for
<parameter>sfactor</parameter> if the GL version is 1.4 or greater.
</para>
<para>
<constant>GL_DST_COLOR</constant> and <constant>GL_ONE_MINUS_DST_COLOR</constant> are valid only for
<parameter>dfactor</parameter> if the GL version is 1.4 or greater.
When dual source blending is enabled (i.e., one of the blend factors requiring
the second color input is used), the maximum number of enabled draw buffers
is given by <constant>GL_MAX_DUAL_SOURCE_DRAW_BUFFERS</constant>, which may
be lower than <constant>GL_MAX_DRAW_BUFFERS</constant>.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if either <parameter>sfactor</parameter> or <parameter>dfactor</parameter> is not an
accepted value.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glBlendFunc</function>
is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
<constant>GL_INVALID_ENUM</constant> is generated if either <parameter>sfactor</parameter>
or <parameter>dfactor</parameter> is not an accepted value.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
@ -1233,7 +1431,6 @@
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glAlphaFunc</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBlendColor</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBlendEquation</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBlendFuncSeparate</refentrytitle></citerefentry>,
@ -1242,7 +1439,6 @@
<citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glLogicOp</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glStencilFunc</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>

View file

@ -35,22 +35,6 @@
<listitem>
<para>
Specifies how the red, green, and blue blending factors are computed.
The following symbolic constants are accepted:
<constant>GL_ZERO</constant>,
<constant>GL_ONE</constant>,
<constant>GL_SRC_COLOR</constant>,
<constant>GL_ONE_MINUS_SRC_COLOR</constant>,
<constant>GL_DST_COLOR</constant>,
<constant>GL_ONE_MINUS_DST_COLOR</constant>,
<constant>GL_SRC_ALPHA</constant>,
<constant>GL_ONE_MINUS_SRC_ALPHA</constant>,
<constant>GL_DST_ALPHA</constant>,
<constant>GL_ONE_MINUS_DST_ALPHA</constant>,
<constant>GL_CONSTANT_COLOR</constant>,
<constant>GL_ONE_MINUS_CONSTANT_COLOR</constant>,
<constant>GL_CONSTANT_ALPHA</constant>,
<constant>GL_ONE_MINUS_CONSTANT_ALPHA</constant>, and
<constant>GL_SRC_ALPHA_SATURATE</constant>.
The initial value is <constant>GL_ONE</constant>.
</para>
</listitem>
@ -60,21 +44,7 @@
<listitem>
<para>
Specifies how the red, green, and blue destination blending factors are
computed. The following symbolic constants are accepted:
<constant>GL_ZERO</constant>,
<constant>GL_ONE</constant>,
<constant>GL_SRC_COLOR</constant>,
<constant>GL_ONE_MINUS_SRC_COLOR</constant>,
<constant>GL_DST_COLOR</constant>,
<constant>GL_ONE_MINUS_DST_COLOR</constant>,
<constant>GL_SRC_ALPHA</constant>,
<constant>GL_ONE_MINUS_SRC_ALPHA</constant>,
<constant>GL_DST_ALPHA</constant>,
<constant>GL_ONE_MINUS_DST_ALPHA</constant>.
<constant>GL_CONSTANT_COLOR</constant>,
<constant>GL_ONE_MINUS_CONSTANT_COLOR</constant>,
<constant>GL_CONSTANT_ALPHA</constant>, and
<constant>GL_ONE_MINUS_CONSTANT_ALPHA</constant>.
computed.
The initial value is <constant>GL_ZERO</constant>.
</para>
</listitem>
@ -83,8 +53,7 @@
<term><parameter>srcAlpha</parameter></term>
<listitem>
<para>
Specified how the alpha source blending factor is computed. The same
symbolic constants are accepted as for <parameter>srcRGB</parameter>.
Specified how the alpha source blending factor is computed.
The initial value is <constant>GL_ONE</constant>.
</para>
</listitem>
@ -93,8 +62,7 @@
<term><parameter>dstAlpha</parameter></term>
<listitem>
<para>
Specified how the alpha destination blending factor is computed. The same
symbolic constants are accepted as for <parameter>dstRGB</parameter>.
Specified how the alpha destination blending factor is computed.
The initial value is <constant>GL_ZERO</constant>.
</para>
</listitem>
@ -103,7 +71,7 @@
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
In RGBA mode, pixels can be drawn using a function that blends
Pixels can be drawn using a function that blends
the incoming (source) RGBA values with the RGBA values
that are already in the frame buffer (the destination values).
Blending is initially disabled.
@ -124,28 +92,45 @@
one each for red, green, blue, and alpha.
</para>
<para>
In the table and in subsequent equations, source and destination
In the table and in subsequent equations, first source, second source and destination
color components are referred to as
<inlineequation><mml:math>
<!-- eqn: ( R sub s , G sub s , B sub s , A sub s ):-->
<!-- eqn: ( R sub s0 , G sub s0 , B sub s0 , A sub s0 ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
</mml:mfenced>
</mml:math></inlineequation>
</mml:math></inlineequation>,
<inlineequation><mml:math>
<!-- eqn: ( R sub s1 , G sub s1 , B sub s1 , A sub s1 ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
</mml:mfenced>
</mml:math></inlineequation>,
and
<inlineequation><mml:math>
<!-- eqn: ( R sub d , G sub d , B sub d , A sub d ):-->
<!-- eqn: ( R sub d , G sub d , B sub d , A sub d ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
@ -160,10 +145,10 @@
<mml:mi mathvariant="italic">d</mml:mi>
</mml:msub>
</mml:mfenced>
</mml:math></inlineequation>.
</mml:math></inlineequation>, respectively.
The color specified by <citerefentry><refentrytitle>glBlendColor</refentrytitle></citerefentry> is referred to as
<inlineequation><mml:math>
<!-- eqn: ( R sub c , G sub c , B sub c , A sub c ):-->
<!-- eqn: ( R sub c , G sub c , B sub c , A sub c ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">c</mml:mi>
@ -181,7 +166,7 @@
</mml:math></inlineequation>.
They are understood to have integer values between 0 and
<inlineequation><mml:math>
<!-- eqn: ( k sub R , k sub G , k sub B , k sub A ):-->
<!-- eqn: ( k sub R , k sub G , k sub B , k sub A ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
@ -202,7 +187,7 @@
<para>
<para>
<inlineequation><mml:math>
<!-- eqn: k sub c = 2 sup {m sub c} - 1:-->
<!-- eqn: k sub c = 2 sup {m sub c} - 1: -->
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">c</mml:mi>
@ -226,7 +211,7 @@
<para>
and
<inlineequation><mml:math>
<!-- eqn: ( m sub R , m sub G , m sub B , m sub A ):-->
<!-- eqn: ( m sub R , m sub G , m sub B , m sub A ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">m</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
@ -250,7 +235,7 @@
<para>
Source and destination scale factors are referred to as
<inlineequation><mml:math>
<!-- eqn: ( s sub R , s sub G , s sub B , s sub A ):-->
<!-- eqn: ( s sub R , s sub G , s sub B , s sub A ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
@ -268,7 +253,7 @@
</mml:math></inlineequation>
and
<inlineequation><mml:math>
<!-- eqn: ( d sub R , d sub G , d sub B , d sub A ):-->
<!-- eqn: ( d sub R , d sub G , d sub B , d sub A ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
@ -286,7 +271,7 @@
</mml:math></inlineequation>.
All scale factors have range
<inlineequation><mml:math>
<!-- eqn: [0,1]:-->
<!-- eqn: [0,1]: -->
<mml:mfenced open="[" close="]">
<mml:mn>0</mml:mn>
<mml:mn>1</mml:mn>
@ -320,7 +305,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( 0, 0, 0 ):-->
<!-- eqn: ( 0, 0, 0 ): -->
<mml:mfenced open="(" close=")">
<mml:mn>0</mml:mn>
<mml:mn>0</mml:mn>
@ -330,7 +315,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: 0:-->
<!-- eqn: 0: -->
<mml:mn>0</mml:mn>
</mml:math></inlineequation>
</entry>
@ -341,7 +326,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( 1, 1, 1 ):-->
<!-- eqn: ( 1, 1, 1 ): -->
<mml:mfenced open="(" close=")">
<mml:mn>1</mml:mn>
<mml:mn>1</mml:mn>
@ -351,7 +336,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: 1:-->
<!-- eqn: 1: -->
<mml:mn>1</mml:mn>
</mml:math></inlineequation>
</entry>
@ -362,11 +347,11 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( R sub s / k sub R , G sub s / k sub G , B sub s / k sub B ):-->
<!-- eqn: ( R sub s0 / k sub R , G sub s0 / k sub G , B sub s0 / k sub B ): -->
<mml:mfenced open="(" close=")">
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
@ -374,7 +359,7 @@
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">G</mml:mi>
@ -382,7 +367,7 @@
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">B</mml:mi>
@ -393,10 +378,10 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: A sub s / k sub A:-->
<!-- eqn: A sub s0 / k sub A: -->
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
@ -411,7 +396,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( 1, 1, 1, 1 ) - ( R sub s / k sub R , G sub s / k sub G , B sub s / k sub B ):-->
<!-- eqn: ( 1, 1, 1, 1 ) - ( R sub s0 / k sub R , G sub s0 / k sub G , B sub 0s / k sub B ): -->
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mn>1</mml:mn>
@ -423,7 +408,7 @@
<mml:mfenced open="(" close=")">
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
@ -431,7 +416,7 @@
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">G</mml:mi>
@ -439,7 +424,7 @@
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">B</mml:mi>
@ -451,13 +436,13 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: 1 - A sub s / k sub A:-->
<!-- eqn: 1 - A sub s0 / k sub A: -->
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>-</mml:mo>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
@ -473,7 +458,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( R sub d / k sub R , G sub d / k sub G , B sub d / k sub B ):-->
<!-- eqn: ( R sub d / k sub R , G sub d / k sub G , B sub d / k sub B ): -->
<mml:mfenced open="(" close=")">
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
@ -504,7 +489,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: A sub d / k sub A:-->
<!-- eqn: A sub d / k sub A: -->
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
@ -522,7 +507,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( 1, 1, 1 ) - ( R sub d / k sub R , G sub d / k sub G , B sub d / k sub B ):-->
<!-- eqn: ( 1, 1, 1 ) - ( R sub d / k sub R , G sub d / k sub G , B sub d / k sub B ): -->
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mn>1</mml:mn>
@ -561,7 +546,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: 1 - A sub d / k sub A:-->
<!-- eqn: 1 - A sub d / k sub A: -->
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>-</mml:mo>
@ -583,11 +568,11 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( A sub s / k sub A , A sub s / k sub A , A sub s / k sub A ):-->
<!-- eqn: ( A sub s0 / k sub A , A sub s0 / k sub A , A sub s0 / k sub A ): -->
<mml:mfenced open="(" close=")">
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
@ -595,7 +580,7 @@
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
@ -603,7 +588,7 @@
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
@ -614,10 +599,10 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: A sub s / k sub A:-->
<!-- eqn: A sub s / k sub A: -->
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
@ -632,7 +617,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( 1, 1, 1 ) - ( A sub s / k sub A , A sub s / k sub A , A sub s / k sub A ):-->
<!-- eqn: ( 1, 1, 1 ) - ( A sub s0 / k sub A , A sub s0 / k sub A , A sub s0 / k sub A ): -->
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mn>1</mml:mn>
@ -643,7 +628,7 @@
<mml:mfenced open="(" close=")">
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
@ -651,7 +636,7 @@
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
@ -659,7 +644,7 @@
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
@ -671,13 +656,13 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: 1 - A sub s / k sub A:-->
<!-- eqn: 1 - A sub s / k sub A: -->
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>-</mml:mo>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
<mml:mi mathvariant="italic">s0</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
@ -693,7 +678,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( A sub d / k sub A , A sub d / k sub A , A sub d / k sub A ):-->
<!-- eqn: ( A sub d / k sub A , A sub d / k sub A , A sub d / k sub A ): -->
<mml:mfenced open="(" close=")">
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
@ -724,7 +709,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: A sub d / k sub A:-->
<!-- eqn: A sub d / k sub A: -->
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
@ -742,7 +727,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( 1, 1, 1 ) - ( A sub d / k sub A , A sub d / k sub A , A sub d / k sub A ):-->
<!-- eqn: ( 1, 1, 1 ) - ( A sub d / k sub A , A sub d / k sub A , A sub d / k sub A ): -->
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mn>1</mml:mn>
@ -781,7 +766,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: 1 - A sub d / k sub A:-->
<!-- eqn: 1 - A sub d / k sub A: -->
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>-</mml:mo>
@ -803,7 +788,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( R sub c, G sub c, B sub c ):-->
<!-- eqn: ( R sub c, G sub c, B sub c ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">c</mml:mi>
@ -819,7 +804,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: A sub c:-->
<!-- eqn: A sub c: -->
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">c</mml:mi>
</mml:msub>
@ -832,7 +817,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( 1, 1, 1 ) - ( R sub c, G sub c, B sub c ):-->
<!-- eqn: ( 1, 1, 1 ) - ( R sub c, G sub c, B sub c ): -->
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mn>1</mml:mn>
@ -856,7 +841,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: 1 - A sub c:-->
<!-- eqn: 1 - A sub c: -->
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>-</mml:mo>
@ -873,7 +858,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( A sub c, A sub c, A sub c ):-->
<!-- eqn: ( A sub c, A sub c, A sub c ): -->
<mml:mfenced open="(" close=")">
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">c</mml:mi>
@ -889,7 +874,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: A sub c:-->
<!-- eqn: A sub c: -->
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">c</mml:mi>
</mml:msub>
@ -902,7 +887,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( 1, 1, 1 ) - ( A sub c, A sub c, A sub c ):-->
<!-- eqn: ( 1, 1, 1 ) - ( A sub c, A sub c, A sub c ): -->
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mn>1</mml:mn>
@ -926,7 +911,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: 1 - A sub c:-->
<!-- eqn: 1 - A sub c: -->
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>-</mml:mo>
@ -943,7 +928,7 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( i, i, i ):-->
<!-- eqn: ( i, i, i ): -->
<mml:mfenced open="(" close=")">
<mml:mi mathvariant="italic">i</mml:mi>
<mml:mi mathvariant="italic">i</mml:mi>
@ -953,11 +938,232 @@
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: 1:-->
<!-- eqn: 1: -->
<mml:mn>1</mml:mn>
</mml:math></inlineequation>
</entry>
</row>
<row>
<entry align="left">
<constant>GL_SRC1_COLOR</constant>
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( R sub s1 / k sub R , G sub s1 / k sub G , B sub s1 / k sub B ): -->
<mml:mfenced open="(" close=")">
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">G</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">B</mml:mi>
</mml:msub>
</mml:mfrac>
</mml:mfenced>
</mml:math></inlineequation>
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: A sub s0 / k sub A: -->
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mfrac>
</mml:math></inlineequation>
</entry>
</row>
<row>
<entry align="left">
<constant>GL_ONE_MINUS_SRC_COLOR</constant>
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( 1, 1, 1, 1 ) - ( R sub s1 / k sub R , G sub s1 / k sub G , B sub s1 / k sub B ): -->
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mn>1</mml:mn>
<mml:mn>1</mml:mn>
<mml:mn>1</mml:mn>
<mml:mn>1</mml:mn>
</mml:mfenced>
<mml:mo>-</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">R</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">G</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">B</mml:mi>
</mml:msub>
</mml:mfrac>
</mml:mfenced>
</mml:mrow>
</mml:math></inlineequation>
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: 1 - A sub s0 / k sub A: -->
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>-</mml:mo>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mfrac>
</mml:mrow>
</mml:math></inlineequation>
</entry>
</row>
<row>
<entry align="left">
<constant>GL_SRC1_ALPHA</constant>
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( A sub s1 / k sub A , A sub s1 / k sub A , A sub s1 / k sub A ): -->
<mml:mfenced open="(" close=")">
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mfrac>
</mml:mfenced>
</mml:math></inlineequation>
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: A sub s1 / k sub A: -->
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mfrac>
</mml:math></inlineequation>
</entry>
</row>
<row>
<entry align="left">
<constant>GL_ONE_MINUS_SRC_ALPHA</constant>
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: ( 1, 1, 1 ) - ( A sub s1 / k sub A , A sub s1 / k sub A , A sub s1 / k sub A ): -->
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mn>1</mml:mn>
<mml:mn>1</mml:mn>
<mml:mn>1</mml:mn>
</mml:mfenced>
<mml:mo>-</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mfrac>
</mml:mfenced>
</mml:mrow>
</mml:math></inlineequation>
</entry>
<entry align="left">
<inlineequation><mml:math>
<!-- eqn: 1 - A sub s1 / k sub A: -->
<mml:mrow>
<mml:mn>1</mml:mn>
<mml:mo>-</mml:mo>
<mml:mfrac>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s1</mml:mi>
</mml:msub>
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
</mml:mfrac>
</mml:mrow>
</mml:math></inlineequation>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
@ -967,7 +1173,7 @@
<para>
<para>
<inlineequation><mml:math>
<!-- eqn: i = min (A sub s , 1 - {A sub d}):-->
<!-- eqn: i = min (A sub s , 1 - {A sub d}): -->
<mml:mrow>
<mml:mi mathvariant="italic">i</mml:mi>
<mml:mo>=</mml:mo>
@ -994,13 +1200,13 @@
</para>
</para>
<para>
To determine the blended RGBA values of a pixel when drawing in RGBA mode,
To determine the blended RGBA values of a pixel,
the system uses the following equations:
</para>
<para>
<para>
<inlineequation><mml:math>
<!-- eqn: R sub d = min ( k sub R, R sub s s sub R + R sub d d sub R ):-->
<!-- eqn: R sub d = min ( k sub R, R sub s s sub R + R sub d d sub R ): -->
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
@ -1035,7 +1241,7 @@
</mml:mrow>
</mml:math></inlineequation>
<inlineequation><mml:math>
<!-- eqn: G sub d = min ( k sub G, G sub s s sub G + G sub d d sub G ):-->
<!-- eqn: G sub d = min ( k sub G, G sub s s sub G + G sub d d sub G ): -->
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
@ -1070,7 +1276,7 @@
</mml:mrow>
</mml:math></inlineequation>
<inlineequation><mml:math>
<!-- eqn: B sub d = min ( k sub B, B sub s s sub B + B sub d d sub B ):-->
<!-- eqn: B sub d = min ( k sub B, B sub s s sub B + B sub d d sub B ): -->
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
@ -1105,7 +1311,7 @@
</mml:mrow>
</mml:math></inlineequation>
<inlineequation><mml:math>
<!-- eqn: A sub d = min ( k sub A, A sub s s sub A + A sub d d sub A ):-->
<!-- eqn: A sub d = min ( k sub A, A sub s s sub A + A sub d d sub A ): -->
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
@ -1149,7 +1355,7 @@
reduces its multiplicand to 0. For example, when <parameter>srcRGB</parameter> is
<constant>GL_SRC_ALPHA</constant>, <parameter>dstRGB</parameter> is <constant>GL_ONE_MINUS_SRC_ALPHA</constant>, and
<inlineequation><mml:math>
<!-- eqn: A sub s:-->
<!-- eqn: A sub s: -->
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">s</mml:mi>
</mml:msub>
@ -1157,7 +1363,7 @@
is
equal to
<inlineequation><mml:math>
<!-- eqn: k sub A:-->
<!-- eqn: k sub A: -->
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
@ -1167,7 +1373,7 @@
<para>
<para>
<inlineequation><mml:math>
<!-- eqn: R sub d = R sub s:-->
<!-- eqn: R sub d = R sub s: -->
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
@ -1179,7 +1385,7 @@
</mml:mrow>
</mml:math></inlineequation>
<inlineequation><mml:math>
<!-- eqn: G sub d = G sub s:-->
<!-- eqn: G sub d = G sub s: -->
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
@ -1191,7 +1397,7 @@
</mml:mrow>
</mml:math></inlineequation>
<inlineequation><mml:math>
<!-- eqn: B sub d = B sub s:-->
<!-- eqn: B sub d = B sub s: -->
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
@ -1203,7 +1409,7 @@
</mml:mrow>
</mml:math></inlineequation>
<inlineequation><mml:math>
<!-- eqn: A sub d = A sub s:-->
<!-- eqn: A sub d = A sub s: -->
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
<mml:mi mathvariant="italic">d</mml:mi>
@ -1220,14 +1426,11 @@
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glBlendFuncSeparate</function> is available only if the GL version is 1.4 or greater.
</para>
<para>
Incoming (source) alpha is correctly thought of as a material opacity,
ranging from 1.0
(<inlineequation><mml:math>
<!-- eqn: K sub A:-->
<!-- eqn: K sub A: -->
<mml:msub><mml:mi mathvariant="italic">K</mml:mi>
<mml:mi mathvariant="italic">A</mml:mi>
</mml:msub>
@ -1243,22 +1446,10 @@
(See <citerefentry><refentrytitle>glDrawBuffer</refentrytitle></citerefentry>.)
</para>
<para>
Blending affects only RGBA rendering.
It is ignored by color index renderers.
</para>
<para>
<constant>GL_CONSTANT_COLOR</constant>, <constant>GL_ONE_MINUS_CONSTANT_COLOR</constant>,
<constant>GL_CONSTANT_ALPHA</constant>, <constant>GL_ONE_MINUS_CONSTANT_ALPHA</constant> are available only
if the GL version is 1.4 or greater or if the <code>ARB_imaging</code> is
supported by your implementation.
</para>
<para>
<constant>GL_SRC_COLOR</constant> and <constant>GL_ONE_MINUS_SRC_COLOR</constant> are valid only for
<parameter>srcRGB</parameter> if the GL version is 1.4 or greater.
</para>
<para>
<constant>GL_DST_COLOR</constant> and <constant>GL_ONE_MINUS_DST_COLOR</constant> are valid only for
<parameter>dstRGB</parameter> if the GL version is 1.4 or greater.
When dual source blending is enabled (i.e., one of the blend factors requiring
the second color input is used), the maximum number of enabled draw buffers
is given by <constant>GL_MAX_DUAL_SOURCE_DRAW_BUFFERS</constant>, which may
be lower than <constant>GL_MAX_DRAW_BUFFERS</constant>.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
@ -1266,11 +1457,6 @@
<constant>GL_INVALID_ENUM</constant> is generated if either <parameter>srcRGB</parameter> or <parameter>dstRGB</parameter> is not an
accepted value.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glBlendFuncSeparate</function>
is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
@ -1293,7 +1479,6 @@
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glAlphaFunc</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBlendColor</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBlendFunc</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBlendEquation</refentrytitle></citerefentry>,

View file

@ -0,0 +1,182 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glBindVertexArray">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glBlitFramebuffer</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glBlitFramebuffer</refname>
<refpurpose>copy a block of pixels from the read framebuffer to the draw framebuffer</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glBlitFramebuffer</function></funcdef>
<paramdef>GLint <parameter>srcX0</parameter></paramdef>
<paramdef>GLint <parameter>srcY0</parameter></paramdef>
<paramdef>GLint <parameter>srcX1</parameter></paramdef>
<paramdef>GLint <parameter>srcY1</parameter></paramdef>
<paramdef>GLint <parameter>dstX0</parameter></paramdef>
<paramdef>GLint <parameter>dstY0</parameter></paramdef>
<paramdef>GLint <parameter>dstX1</parameter></paramdef>
<paramdef>GLint <parameter>dstY1</parameter></paramdef>
<paramdef>GLbitfield <parameter>mask</parameter></paramdef>
<paramdef>GLenum <parameter>filter</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>srcX0</parameter></term>
<term><parameter>srcY0</parameter></term>
<term><parameter>srcX1</parameter></term>
<term><parameter>srcY1</parameter></term>
<listitem>
<para>
Specify the bounds of the source rectangle within the read buffer of the read framebuffer.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>dstX0</parameter></term>
<term><parameter>dstY0</parameter></term>
<term><parameter>dstX1</parameter></term>
<term><parameter>dstY1</parameter></term>
<listitem>
<para>
Specify the bounds of the destination rectangle within the write buffer of the write framebuffer.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>mask</parameter></term>
<listitem>
<para>
The bitwise OR of the flags indicating which buffers are to be copied. The allowed flags are
<constant>GL_COLOR_BUFFER_BIT</constant>, <constant>GL_DEPTH_BUFFER_BIT</constant> and <constant>GL_STENCIL_BUFFER_BIT</constant>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>filter</parameter></term>
<listitem>
<para>
Specifies the interpolation to be applied if the image is stretched. Must be <constant>GL_NEAREST</constant> or <constant>GL_LINEAR</constant>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glBlitFramebuffer</function> transfers a rectangle of pixel values from one region of the read framebuffer to another region in
the draw framebuffer. <parameter>mask</parameter> is the bitwise OR of a number of values indicating which buffers are
to be copied. The values are <constant>GL_COLOR_BUFFER_BIT</constant>, <constant>GL_DEPTH_BUFFER_BIT</constant>, and
<constant>GL_STENCIL_BUFFER_BIT</constant>. The pixels corresponding to these buffers are copied from the source rectangle bounded by the
locations (<parameter>srcX0</parameter>; <parameter>srcY0</parameter>) and (<parameter>srcX1</parameter>; <parameter>srcY1</parameter>)
to the destination rectangle bounded by the locations (<parameter>dstX0</parameter>; <parameter>dstY0</parameter>) and
(<parameter>dstX1</parameter>; <parameter>dstY1</parameter>). The lower bounds of the rectangle are inclusive, while the upper
bounds are exclusive.
</para>
<para>
The actual region taken from the read framebuffer is limited to the intersection of the source buffers being transferred, which may
include the color buffer selected by the read buffer, the depth buffer, and/or the stencil buffer depending on mask. The actual region
written to the draw framebuffer is limited to the intersection of the destination buffers being written, which may include multiple draw
buffers, the depth buffer, and/or the stencil buffer depending on mask. Whether or not the source or destination regions are altered due
to these limits, the scaling and offset applied to pixels being transferred is performed as though no such limits were present.
</para>
<para>
If the sizes of the source and destination rectangles are not equal, <parameter>filter</parameter> specifies the interpolation method that
will be applied to resize the source image , and must be <constant>GL_NEAREST</constant> or <constant>GL_LINEAR</constant>.
<constant>GL_LINEAR</constant> is only a valid interpolation method for the color buffer. If <parameter>filter</parameter> is not
<constant>GL_NEAREST</constant> and <parameter>mask</parameter> includes <constant>GL_DEPTH_BUFFER_BIT</constant> or
<constant>GL_STENCIL_BUFFER_BIT</constant>, no data is transferred and a <constant>GL_INVALID_OPERATION</constant> error is generated.
</para>
<para>
If <parameter>filter</parameter> is <constant>GL_LINEAR</constant> and the source rectangle would require sampling outside the bounds of
the source framebuffer, values are read as if the <constant>GL_CLAMP_TO_EDGE</constant> texture wrapping mode were applied.
</para>
<para>
When the color buffer is transferred, values are taken from the read buffer of the read framebuffer and written to each of the draw
buffers of the draw framebuffer.
</para>
<para>
If the source and destination rectangles overlap or are the same, and the read and draw buffers are the same, the result of the operation
is undefined.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glBindVertexArray</function> is available only if the GL version is 3.0 or greater.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>mask</parameter> contains any of the <constant>GL_DEPTH_BUFFER_BIT</constant>
or <constant>GL_STENCIL_BUFFER_BIT</constant> and <parameter>filter</parameter> is not <constant>GL_NEAREST</constant>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>mask</parameter> contains <constant>GL_COLOR_BUFFER_BIT</constant>
and any of the following conditions hold:
<itemizedlist>
<listitem>
<para>The read buffer contains fixed-point or floating-point values and any draw buffer contains
neither fixed-point nor floating-point values.</para>
</listitem>
<listitem>
<para>The read buffer contains unsigned integer values and any draw buffer does not contain unsigned
integer values.</para>
</listitem>
<listitem>
<para>The read buffer contains signed integer values and any draw buffer does not contain signed integer values.</para>
</listitem>
</itemizedlist>
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>mask</parameter> contains <constant>GL_DEPTH_BUFFER_BIT</constant> or
<constant>GL_DEPTH_BUFFER_BIT</constant> and the source and destination depth and stencil formats do not match.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>filter</parameter> is <constant>GL_LINEAR</constant> and the read buffer
contains integer data.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if the value of <parameter>GL_SAMPLES</parameter> for the read and draw buffers is
not identical.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>GL_SAMPLE_BUFFERS</parameter> for both read and draw buffers greater than
zero and the dimensions of the source and destination rectangles is not identical.
</para>
<para>
<constant>GL_INVALID_FRAMEBUFFER_OPERATION</constant> is generated if the objects bound to <constant>GL_DRAW_FRAMEBUFFER_BINDING</constant>
or <constant>GL_READ_FRAMEBUFFER_BINDING</constant> are not framebuffer complete.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry>
<citerefentry><refentrytitle>glCheckFramebufferStatus</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGenFramebuffers</refentrytitle></citerefentry>
<citerefentry><refentrytitle>glBindFramebuffer</refentrytitle></citerefentry>
<citerefentry><refentrytitle>glDeleteFramebuffers</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -35,10 +35,15 @@
<listitem>
<para>
Specifies the target buffer object.
The symbolic constant must be <constant>GL_ARRAY_BUFFER</constant>,
The symbolic constant must be <constant>GL_ARRAY_BUFFER</constant>,
<constant>GL_COPY_READ_BUFFER</constant>,
<constant>GL_COPY_WRITE_BUFFER</constant>,
<constant>GL_ELEMENT_ARRAY_BUFFER</constant>,
<constant>GL_PIXEL_PACK_BUFFER</constant>, or
<constant>GL_PIXEL_UNPACK_BUFFER</constant>.
<constant>GL_PIXEL_PACK_BUFFER</constant>,
<constant>GL_PIXEL_UNPACK_BUFFER</constant>,
<constant>GL_TEXTURE_BUFFER</constant>,
<constant>GL_TRANSFORM_FEEDBACK_BUFFER</constant>, or
<constant>GL_UNIFORM_BUFFER</constant>.
</para>
</listitem>
</varlistentry>
@ -148,13 +153,6 @@
</variablelist>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glBufferData</function> is available only if the GL version is 1.5 or greater.
</para>
<para>
Targets <constant>GL_PIXEL_PACK_BUFFER</constant> and <constant>GL_PIXEL_UNPACK_BUFFER</constant> are available
only if the GL version is 2.1 or greater.
</para>
<para>
If <parameter>data</parameter> is <constant>NULL</constant>, a data store of the specified size is still created,
but its contents remain uninitialized and thus undefined.
@ -169,8 +167,7 @@
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not
<constant>GL_ARRAY_BUFFER</constant>, <constant>GL_ELEMENT_ARRAY_BUFFER</constant>,
<constant>GL_PIXEL_PACK_BUFFER</constant>, or <constant>GL_PIXEL_UNPACK_BUFFER</constant>.
one of the accepted buffer targets.
</para>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>usage</parameter> is not
@ -187,19 +184,13 @@
<para>
<constant>GL_OUT_OF_MEMORY</constant> is generated if the GL is unable to create a data store with the specified <parameter>size</parameter>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glBufferData</function>
is executed between the execution of
<citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding execution of
<citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGetBufferSubData</refentrytitle></citerefentry>
</para>
<para>
<citerefentry><refentrytitle>glGetBufferParameteriv</refentrytitle></citerefentry> with argument <constant>GL_BUFFER_SIZE</constant> or <constant>GL_BUFFER_USAGE</constant>
<citerefentry><refentrytitle>glGetBufferParameter</refentrytitle></citerefentry> with argument <constant>GL_BUFFER_SIZE</constant> or <constant>GL_BUFFER_USAGE</constant>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>

View file

@ -35,10 +35,15 @@
<listitem>
<para>
Specifies the target buffer object.
The symbolic constant must be <constant>GL_ARRAY_BUFFER</constant>,
The symbolic constant must be <constant>GL_ARRAY_BUFFER</constant>,
<constant>GL_COPY_READ_BUFFER</constant>,
<constant>GL_COPY_WRITE_BUFFER</constant>,
<constant>GL_ELEMENT_ARRAY_BUFFER</constant>,
<constant>GL_PIXEL_PACK_BUFFER</constant>, or
<constant>GL_PIXEL_UNPACK_BUFFER</constant>.
<constant>GL_PIXEL_PACK_BUFFER</constant>,
<constant>GL_PIXEL_UNPACK_BUFFER</constant>,
<constant>GL_TEXTURE_BUFFER</constant>,
<constant>GL_TRANSFORM_FEEDBACK_BUFFER</constant>, or
<constant>GL_UNIFORM_BUFFER</constant>.
</para>
</listitem>
</varlistentry>
@ -79,13 +84,6 @@
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glBufferSubData</function> is available only if the GL version is 1.5 or greater.
</para>
<para>
Targets <constant>GL_PIXEL_PACK_BUFFER</constant> and <constant>GL_PIXEL_UNPACK_BUFFER</constant> are available
only if the GL version is 2.1 or greater.
</para>
<para>
When replacing the entire data store, consider using <function>glBufferSubData</function> rather
than completely recreating the data store with <function>glBufferData</function>. This avoids the cost of
@ -107,8 +105,7 @@
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not
<constant>GL_ARRAY_BUFFER</constant>, <constant>GL_ELEMENT_ARRAY_BUFFER</constant>,
<constant>GL_PIXEL_PACK_BUFFER</constant>, or <constant>GL_PIXEL_UNPACK_BUFFER</constant>.
one of the accepted buffer targets.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>offset</parameter> or
@ -121,12 +118,6 @@
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if the buffer object being updated is mapped.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glBufferSubData</function>
is executed between the execution of
<citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding execution of
<citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>

View file

@ -0,0 +1,131 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glCheckFramebufferStatus">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glCheckFramebufferStatus</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glCheckFramebufferStatus</refname>
<refpurpose>check the completeness status of a framebuffer</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>GLenum <function>glCheckFramebufferStatus</function></funcdef>
<paramdef>GLenum <parameter>target</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>target</parameter></term>
<listitem>
<para>
Specify the target of the framebuffer completeness check.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glCheckFramebufferStatus</function> queries the completeness status of the framebuffer object currently bound to <parameter>target</parameter>.
<parameter>target</parameter> must be <constant>GL_DRAW_FRAMEBUFFER</constant>, <constant>GL_READ_FRAMEBUFFER</constant> or <constant>GL_FRAMEBUFFER</constant>.
<constant>GL_FRAMEBUFFER</constant> is equivalent to <constant>GL_DRAW_FRAMEBUFFER</constant>.
</para>
<para>
The return value is <constant>GL_FRAMEBUFFER_COMPLETE</constant> if the framebuffer bound to <parameter>target</parameter> is complete. Otherwise,
the return value is determined as follows:
<itemizedlist>
<listitem>
<para>
<constant>GL_FRAMEBUFFER_UNDEFINED</constant> is returned if <parameter>target</parameter> is the default framebuffer, but the default framebuffer does not exist.
</para>
</listitem>
<listitem>
<para>
<constant>GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT</constant> is returned if any of the framebuffer attachment points are framebuffer incomplete.
</para>
</listitem>
<listitem>
<para>
<constant>GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT</constant> is returned if the framebuffer does not have at least one image attached to it.
</para>
</listitem>
<listitem>
<para>
<constant>GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER</constant> is returned if the value of <constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</constant>
is <constant>GL_NONE</constant> for any color attachment point(s) named by <constant>GL_DRAWBUFFERi</constant>.
</para>
</listitem>
<listitem>
<para>
<constant>GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER</constant> is returned if <constant>GL_READ_BUFFER</constant> is not <constant>GL_NONE</constant>
and the value of <constant>GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</constant> is <constant>GL_NONE</constant> for the color attachment point named
by <constant>GL_READ_BUFFER</constant>.
</para>
</listitem>
<listitem>
<para>
<constant>GL_FRAMEBUFFER_UNSUPPORTED</constant> is returned if the combination of internal formats of the attached images violates
an implementation-dependent set of restrictions.
</para>
</listitem>
<listitem>
<para>
<constant>GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE</constant> is returned if the value of <constant>GL_RENDERBUFFER_SAMPLES</constant> is not the same
for all attached renderbuffers; if the value of <constant>GL_TEXTURE_SAMPLES</constant> is the not same for all attached textures; or, if the attached
images are a mix of renderbuffers and textures, the value of <constant>GL_RENDERBUFFER_SAMPLES</constant> does not match the value of
<constant>GL_TEXTURE_SAMPLES</constant>.
</para>
</listitem>
<listitem>
<para>
<constant>GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE</constant> is also returned if the value of <constant>GL_TEXTURE_FIXED_SAMPLE_LOCATIONS</constant> is
not the same for all attached textures; or, if the attached images are a mix of renderbuffers and textures, the value of <constant>GL_TEXTURE_FIXED_SAMPLE_LOCATIONS</constant>
is not <constant>GL_TRUE</constant> for all attached textures.
</para>
</listitem>
<listitem>
<para>
<constant>GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS</constant> is returned if any framebuffer attachment is layered, and any populated attachment is not layered,
or if all populated color attachments are not from textures of the same target.
</para>
</listitem>
</itemizedlist>
</para>
<para>
Additionally, if an error occurs, zero is returned.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not <constant>GL_DRAW_FRAMEBUFFER</constant>,
<constant>GL_READ_FRAMEBUFFER</constant> or <constant>GL_FRAMEBUFFER</constant>.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glGenFramebuffers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDeleteFramebuffers</refentrytitle></citerefentry>
<citerefentry><refentrytitle>glBindFramebuffer</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glClampColor">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glClampColor</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glClampColor</refname>
<refpurpose>specify whether data read via <citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry> should be clamped</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glClampColor</function></funcdef>
<paramdef>GLenum <parameter>target</parameter></paramdef>
<paramdef>GLenum <parameter>clamp</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>target</parameter></term>
<listitem>
<para>
Target for color clamping. <parameter>target</parameter> must be <constant>GL_CLAMP_READ_COLOR</constant>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>clamp</parameter></term>
<listitem>
<para>
Specifies whether to apply color clamping. <parameter>clamp</parameter> must be <constant>GL_TRUE</constant> or <constant>GL_FALSE</constant>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glClampColor</function> controls color clamping that is performed during <citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry>.
<parameter>target</parameter> must be <constant>GL_CLAMP_READ_COLOR</constant>. If <parameter>clamp</parameter> is <constant>GL_TRUE</constant>,
read color clamping is enabled; if <parameter>clamp</parameter> is <constant>GL_FALSE</constant>, read color clamping is disabled. If
<parameter>clamp</parameter> is <constant>GL_FIXED_ONLY</constant>, read color clamping is enabled only if the selected read buffer has
fixed point components and disabled otherwise.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>target</parameter> is not
<constant>GL_CLAMP_READ_COLOR</constant>.
</para>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>clamp</parameter> is not <constant>GL_TRUE</constant> or <constant>GL_FALSE</constant>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_CLAMP_READ_COLOR</constant>.
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -31,10 +31,9 @@
<listitem>
<para>
Bitwise OR of masks that indicate the buffers to be cleared.
The four masks are
The three masks are
<constant>GL_COLOR_BUFFER_BIT</constant>,
<constant>GL_DEPTH_BUFFER_BIT</constant>,
<constant>GL_ACCUM_BUFFER_BIT</constant>, and
<constant>GL_DEPTH_BUFFER_BIT</constant>, and
<constant>GL_STENCIL_BUFFER_BIT</constant>.
</para>
</listitem>
@ -44,8 +43,8 @@
<refsect1 id="description"><title>Description</title>
<para>
<function>glClear</function> sets the bitplane area of the window to values previously selected
by <function>glClearColor</function>, <function>glClearIndex</function>, <function>glClearDepth</function>,
<function>glClearStencil</function>, and <function>glClearAccum</function>.
by <function>glClearColor</function>, <function>glClearDepth</function>, and
<function>glClearStencil</function>.
Multiple color buffers can be cleared simultaneously by selecting
more than one buffer at a time using <citerefentry><refentrytitle>glDrawBuffer</refentrytitle></citerefentry>.
</para>
@ -86,14 +85,6 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_ACCUM_BUFFER_BIT</constant></term>
<listitem>
<para>
Indicates the accumulation buffer.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_STENCIL_BUFFER_BIT</constant></term>
<listitem>
@ -116,25 +107,14 @@
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if any bit other than the four defined
<constant>GL_INVALID_VALUE</constant> is generated if any bit other than the three defined
bits is set in <parameter>mask</parameter>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glClear</function>
is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_ACCUM_CLEAR_VALUE</constant>
</para>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_DEPTH_CLEAR_VALUE</constant>
</para>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_INDEX_CLEAR_VALUE</constant>
</para>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_COLOR_CLEAR_VALUE</constant>
</para>
@ -144,10 +124,8 @@
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<function>glClearAccum</function>,
<function>glClearColor</function>,
<function>glClearDepth</function>,
<function>glClearIndex</function>,
<function>glClearStencil</function>,
<citerefentry><refentrytitle>glColorMask</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDepthMask</refentrytitle></citerefentry>,

View file

@ -0,0 +1,170 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glClearBuffer">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glClearBuffer</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glClearBuffer</refname>
<refpurpose>clear individual buffers of the currently bound draw framebuffer</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glClearBufferiv</function></funcdef>
<paramdef>GLenum <parameter>buffer</parameter></paramdef>
<paramdef>GLint <parameter>drawBuffer</parameter></paramdef>
<paramdef>const GLint * <parameter>value</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glClearBufferuiv</function></funcdef>
<paramdef>GLenum <parameter>buffer</parameter></paramdef>
<paramdef>GLint <parameter>drawBuffer</parameter></paramdef>
<paramdef>const GLuint * <parameter>value</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glClearBufferfv</function></funcdef>
<paramdef>GLenum <parameter>buffer</parameter></paramdef>
<paramdef>GLint <parameter>drawBuffer</parameter></paramdef>
<paramdef>const GLfloat * <parameter>value</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glClearBufferfi</function></funcdef>
<paramdef>GLenum <parameter>buffer</parameter></paramdef>
<paramdef>GLint <parameter>drawBuffer</parameter></paramdef>
<paramdef>GLfloat <parameter>depth</parameter></paramdef>
<paramdef>GLint <parameter>stencil</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>buffer</parameter></term>
<listitem>
<para>
Specify the buffer to clear.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>drawBuffer</parameter></term>
<listitem>
<para>
Specify a particular draw buffer to clear.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>value</parameter></term>
<listitem>
<para>
For color buffers, a pointer to a four-element vector specifying R, G, B and A values to clear the buffer to.
For depth buffers, a pointer to a single depth value to clear the buffer to.
For stencil buffers, a pointer to a single stencil value to clear the buffer to.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>depth</parameter></term>
<listitem>
<para>
The value to clear a depth render buffer to.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>stencil</parameter></term>
<listitem>
<para>
The value to clear a stencil render buffer to.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glClearBuffer*</function> clears the specified buffer to the specified value(s). If <parameter>buffer</parameter> is
<constant>GL_COLOR</constant>, a particular draw buffer <constant>GL_DRAWBUFFER<parameter>i</parameter></constant> is specified
by passing <parameter>i</parameter> as <parameter>drawBuffer</parameter>. In this case, <parameter>value</parameter> points to
a four-element vector specifying the R, G, B and A color to clear that draw buffer to. If <parameter>buffer</parameter> is
one of <constant>GL_FRONT</constant>, <constant>GL_BACK</constant>, <constant>GL_LEFT</constant>, <constant>GL_RIGHT</constant>,
or <constant>GL_FRONT_AND_BACK</constant>, identifying multiple buffers, each selected buffer is cleared to the same value.
Clamping and conversion for fixed-point color buffers are performed in the same fashion as
<citerefentry><refentrytitle>glClearColor</refentrytitle></citerefentry>.
</para>
<para>
If <parameter>buffer</parameter> is <constant>GL_DEPTH</constant>, <parameter>drawBuffer</parameter> must be zero, and <parameter>value</parameter>
points to a single value to clear the depth buffer to. Only <function>glClearBufferfv</function> should be used to clear
depth buffers. Clamping and conversion for fixed-point depth buffers are performed in the same fashion as
<citerefentry><refentrytitle>glClearDepth</refentrytitle></citerefentry>.
</para>
<para>
If <parameter>buffer</parameter> is <constant>GL_STENCIL</constant>, <parameter>drawBuffer</parameter> must be zero, and <parameter>value</parameter>
points to a single value to clear the stencil buffer to. Only <function>glClearBufferiv</function> should be used to clear
stencil buffers. Masing and type conversion are performed in the same fashion as
<citerefentry><refentrytitle>glClearStencil</refentrytitle></citerefentry>.
</para>
<para>
<function>glClearBufferfi</function> may be used to clear the depth and stencil buffers. <parameter>buffer</parameter> must be
<constant>GL_DEPTH_STENCIL</constant> and <parameter>drawBuffer</parameter> must be zero. <parameter>depth</parameter> and
<parameter>stencil</parameter> are the depth and stencil values, respectively.
</para>
<para>
The result of <function>glClearBuffer</function> is undefined if no conversion between the type of <parameter>value</parameter>
and the buffer being cleared is defined. However, this is not an error.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated by <function>glClearBufferif</function>, <function>glClearBufferfv</function>
and <function>glClearBufferuiv</function> if <parameter>buffer</parameter> is not <constant>GL_COLOR</constant>,
<constant>GL_FRONT</constant>, <constant>GL_BACK</constant>, <constant>GL_LEFT</constant>, <constant>GL_RIGHT</constant>,
<constant>GL_FRONT_AND_BACK</constant>, <constant>GL_DEPTH</constant> or <constant>GL_STENCIL</constant>.
</para>
<para>
<constant>GL_INVALID_ENUM</constant> is generated by <function>glClearBufferfi</function> if <parameter>buffer</parameter>
is not <constant>GL_DEPTH_STENCIL</constant>.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>buffer</parameter> is <constant>GL_COLOR</constant>,
<constant>GL_FRONT</constant>, <constant>GL_BACK</constant>, <constant>GL_LEFT</constant>, <constant>GL_RIGHT</constant>,
or <constant>GL_FRONT_AND_BACK</constant> and <parameter>drawBuffer</parameter> is greater than or equal to <constant>GL_MAX_DRAW_BUFFERS</constant>.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>buffer</parameter> is <constant>GL_DEPTH</constant>,
<constant>GL_STENCIL</constant> or <constant>GL_DEPTH_STENCIL</constant> and <parameter>drawBuffer</parameter> is not zero.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glClearColor</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glClearDepth</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glClearStencil</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glClear</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -52,7 +52,7 @@
and alpha values used by <citerefentry><refentrytitle>glClear</refentrytitle></citerefentry> to clear the color buffers.
Values specified by <function>glClearColor</function> are clamped to the range
<inlineequation><mml:math>
<!-- eqn: [0,1]:-->
<!-- eqn: [0,1]: -->
<mml:mfenced open="[" close="]">
<mml:mn>0</mml:mn>
<mml:mn>1</mml:mn>
@ -60,13 +60,6 @@
</mml:math></inlineequation>.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glClearColor</function>
is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_COLOR_CLEAR_VALUE</constant>

View file

@ -22,6 +22,10 @@
<funcdef>void <function>glClearDepth</function></funcdef>
<paramdef>GLclampd <parameter>depth</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>void <function>glClearDepthf</function></funcdef>
<paramdef>GLclampf <parameter>depth</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
@ -42,7 +46,7 @@
<function>glClearDepth</function> specifies the depth value used by <citerefentry><refentrytitle>glClear</refentrytitle></citerefentry> to clear the depth buffer.
Values specified by <function>glClearDepth</function> are clamped to the range
<inlineequation><mml:math>
<!-- eqn: [0,1]:-->
<!-- eqn: [0,1]: -->
<mml:mfenced open="[" close="]">
<mml:mn>0</mml:mn>
<mml:mn>1</mml:mn>
@ -50,13 +54,6 @@
</mml:math></inlineequation>.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glClearDepth</function>
is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_DEPTH_CLEAR_VALUE</constant>

View file

@ -43,7 +43,7 @@
<function>glClearStencil</function> specifies the index used by <citerefentry><refentrytitle>glClear</refentrytitle></citerefentry> to clear the stencil buffer.
<parameter>s</parameter> is masked with
<inlineequation><mml:math>
<!-- eqn: 2 sup m - 1:-->
<!-- eqn: 2 sup m - 1: -->
<mml:mrow>
<mml:msup><mml:mn>2</mml:mn>
<mml:mi mathvariant="italic">m</mml:mi>
@ -57,13 +57,6 @@
is the number of bits in the stencil buffer.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glClearStencil</function>
is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_STENCIL_CLEAR_VALUE</constant>

View file

@ -0,0 +1,119 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glClientWaitSync">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glClientWaitSync</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glClientWaitSync</refname>
<refpurpose>block and wait for a sync object to become signaled</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>GLenum <function>glClientWaitSync</function></funcdef>
<paramdef>GLsync <parameter>sync</parameter></paramdef>
<paramdef>GLbitfield <parameter>flags</parameter></paramdef>
<paramdef>GLuint64 <parameter>timeout</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>sync</parameter></term>
<listitem>
<para>
The sync object whose status to wait on.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>flags</parameter></term>
<listitem>
<para>
A bitfield controlling the command flushing behavior. <parameter>flags</parameter> may be <constant>GL_SYNC_FLUSH_COMMANDS_BIT</constant>.
</para>
</listitem>
</varlistentry>
</variablelist>
<varlistentry>
<term><parameter>timeout</parameter></term>
<listitem>
<para>
The timeout, specified in nanoseconds, for which the implementation should wait for <parameter>sync</parameter> to become signaled.
</para>
</listitem>
</varlistentry>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glClientWaitSync</function> causes the client to block and wait for the sync object specified by <parameter>sync</parameter> to become signaled. If
<parameter>sync</parameter> is signaled when <function>glClientWaitSync</function> is called, <function>glClientWaitSync</function> returns immediately, otherwise
it will block and wait for up to <parameter>timeout</parameter> nanoseconds for <parameter>sync</parameter> to become signaled.
</para>
<para>
The return value is one of four status values:
<itemizedlist>
<listitem>
<para>
<constant>GL_ALREADY_SIGNALED</constant> indicates that <parameter>sync</parameter> was signaled at the time that <function>glClientWaitSync</function>
was called.
</para>
</listitem>
<listitem>
<para>
<constant>GL_TIMEOUT_EXPIRED</constant> indicates that at least <parameter>timeout</parameter> nanoseconds passed and <parameter>sync</parameter> did not
become signaled.
</para>
</listitem>
<listitem>
<para>
<constant>GL_CONDITION_SATISFIED</constant> indicates that <parameter>sync</parameter> was signaled before the timeout expired.
</para>
</listitem>
<listitem>
<para>
<constant>GL_WAIT_FAILED</constant> indicates that an error occurred. Additionally, an OpenGL error will be generated.
</para>
</listitem>
</itemizedlist>
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glClientWaitSync</function> is available only if the GL version is 3.2 or greater.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>sync</parameter> is not the name of an existing sync object.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>flags</parameter> contains any unsupported flag.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glFenceSync</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIsSync</refentrytitle></citerefentry>
<citerefentry><refentrytitle>glWaitSync</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -61,30 +61,15 @@
changes are either enabled or disabled for entire color components.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glColorMask</function>
is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_COLOR_WRITEMASK</constant>
</para>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_RGBA_MODE</constant>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glClear</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glColor</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glColorPointer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDepthMask</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIndex</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIndexPointer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIndexMask</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glStencilMask</refentrytitle></citerefentry>
</para>
</refsect1>

View file

@ -1,87 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glCompileShader">
<refmeta>
<refentrytitle>glCompileShader</refentrytitle>
<manvolnum>3G</manvolnum>
<refentrytitle>glCompileShader</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glCompileShader</refname>
<refpurpose>Compiles a shader object</refpurpose>
<refname>glCompileShader</refname>
<refpurpose>Compiles a shader object</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glCompileShader</function></funcdef>
<paramdef>GLuint <parameter>shader</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glCompileShader</function></funcdef>
<paramdef>GLuint <parameter>shader</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>shader</parameter></term>
<listitem>
<para>Specifies the shader object to be
compiled.</para>
</listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term><parameter>shader</parameter></term>
<listitem>
<para>Specifies the shader object to be
compiled.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para><function>glCompileShader</function> compiles the source
code strings that have been stored in the shader object
specified by <parameter>shader</parameter>.</para>
<para><function>glCompileShader</function> compiles the source
code strings that have been stored in the shader object
specified by <parameter>shader</parameter>.</para>
<para>The compilation status will be stored as part of the
shader object's state. This value will be set to
<constant>GL_TRUE</constant> if the shader was compiled without
errors and is ready for use, and <constant>GL_FALSE</constant>
otherwise. It can be queried by calling
<citerefentry><refentrytitle>glGetShader</refentrytitle></citerefentry>
with arguments <parameter>shader</parameter> and
<constant>GL_COMPILE_STATUS</constant>.</para>
<para>The compilation status will be stored as part of the
shader object's state. This value will be set to
<constant>GL_TRUE</constant> if the shader was compiled without
errors and is ready for use, and <constant>GL_FALSE</constant>
otherwise. It can be queried by calling
<citerefentry><refentrytitle>glGetShader</refentrytitle></citerefentry>
with arguments <parameter>shader</parameter> and
<constant>GL_COMPILE_STATUS</constant>.</para>
<para>Compilation of a shader can fail for a number of reasons
as specified by the OpenGL Shading Language Specification.
Whether or not the compilation was successful, information about
the compilation can be obtained from the shader object's
information log by calling
<citerefentry><refentrytitle>glGetShaderInfoLog</refentrytitle></citerefentry>.</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para><function>glCompileShader</function>
is available only if the GL version is 2.0 or greater.</para>
<para>Compilation of a shader can fail for a number of reasons
as specified by the OpenGL Shading Language Specification.
Whether or not the compilation was successful, information about
the compilation can be obtained from the shader object's
information log by calling
<citerefentry><refentrytitle>glGetShaderInfoLog</refentrytitle></citerefentry>.</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para><constant>GL_INVALID_VALUE</constant> is generated if
<parameter>shader</parameter> is not a value generated by
OpenGL.</para>
<para><constant>GL_INVALID_VALUE</constant> is generated if
<parameter>shader</parameter> is not a value generated by
OpenGL.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if
<parameter>shader</parameter> is not a shader object.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if
<parameter>shader</parameter> is not a shader object.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if
<function>glCompileShader</function> is executed between the
execution of
<citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of
<citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para><citerefentry><refentrytitle>glGetShaderInfoLog</refentrytitle></citerefentry>
with argument <parameter>shader</parameter></para>
<para><citerefentry><refentrytitle>glGetShaderInfoLog</refentrytitle></citerefentry>
with argument <parameter>shader</parameter></para>
<para><citerefentry><refentrytitle>glGetShader</refentrytitle></citerefentry>
with arguments <parameter>shader</parameter> and
<constant>GL_COMPILE_STATUS</constant></para>
<para><citerefentry><refentrytitle>glIsShader</refentrytitle></citerefentry></para>
<para><citerefentry><refentrytitle>glGetShader</refentrytitle></citerefentry>
with arguments <parameter>shader</parameter> and
<constant>GL_COMPILE_STATUS</constant></para>
<para><citerefentry><refentrytitle>glIsShader</refentrytitle></citerefentry></para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para><citerefentry><refentrytitle>glCreateShader</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glShaderSource</refentrytitle></citerefentry></para>
<para><citerefentry><refentrytitle>glCreateShader</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glShaderSource</refentrytitle></citerefentry></para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>

View file

@ -64,25 +64,7 @@
<term><parameter>width</parameter></term>
<listitem>
<para>
Specifies the width of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be
<inlineequation><mml:math>
<!-- eqn: 2 sup n + 2 ( border ):-->
<mml:mrow>
<mml:msup><mml:mn>2</mml:mn>
<mml:mi mathvariant="italic">n</mml:mi>
</mml:msup>
<mml:mo>+</mml:mo>
<mml:mrow>
<mml:mn>2</mml:mn>
<mml:mo>&af;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mi mathvariant="italic">border</mml:mi>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math></inlineequation>
for some integer
<inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>.
Specifies the width of the texture image.
All implementations support texture images that are at least 64 texels wide. The height of the 1D texture image is 1.
</para>
</listitem>
@ -91,7 +73,7 @@
<term><parameter>border</parameter></term>
<listitem>
<para>
Specifies the width of the border. Must be either 0 or 1.
This value must be 0.
</para>
</listitem>
</varlistentry>
@ -115,19 +97,25 @@
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is enabled. To enable and disable one-dimensional texturing, call <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_1D</constant>.
Texturing allows elements of an image array to be read by shaders.
</para>
<para>
<function>glCompressedTexImage1D</function> loads a previously defined, and retrieved, compressed one-dimensional texture image if <parameter>target</parameter> is <constant>GL_TEXTURE_1D</constant> (see <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>).
<function>glCompressedTexImage1D</function> loads a previously defined, and retrieved, compressed
one-dimensional texture image if <parameter>target</parameter> is <constant>GL_TEXTURE_1D</constant>
(see <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>).
</para>
<para>
If <parameter>target</parameter> is <constant>GL_PROXY_TEXTURE_1D</constant>, no data is read from <parameter>data</parameter>, but
all of the texture image state is recalculated, checked for consistency, and checked against the implementation's capabilities. If the implementation cannot handle a texture of the requested texture size, it sets all of the image state to 0, but does not generate an error (see <citerefentry><refentrytitle>glGetError</refentrytitle></citerefentry>). To query for an entire mipmap array, use an image array level greater than or equal to 1.
</para>
<para>
<parameter>internalformat</parameter> must be extension-specified compressed-texture format. When a texture is loaded with <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry> using a generic compressed texture format (e.g., <constant>GL_COMPRESSED_RGB</constant>) the GL selects from one of
<parameter>internalformat</parameter> must be an extension-specified compressed-texture format.
When a texture is loaded with
<citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry> using a generic compressed texture format
(e.g., <constant>GL_COMPRESSED_RGB</constant>) the GL selects from one of
its extensions supporting compressed textures. In order to load the
compressed texture image using <function>glCompressedTexImage1D</function>, query the compressed texture image's size and format using <citerefentry><refentrytitle>glGetTexLevelParameter</refentrytitle></citerefentry>.
compressed texture image using <function>glCompressedTexImage1D</function>, query the compressed texture image's size and
format using <citerefentry><refentrytitle>glGetTexLevelParameter</refentrytitle></citerefentry>.
</para>
<para>
If a non-zero named buffer object is bound to the <constant>GL_PIXEL_UNPACK_BUFFER</constant> target
@ -135,25 +123,24 @@
specified, <parameter>data</parameter> is treated as a byte offset into the buffer object's data store.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glCompressedTexImage1D</function> is available only if the GL version is 1.3 or greater.
</para>
<para>
Non-power-of-two textures are supported if the GL version is 2.0 or greater, or if the implementation exports the <constant>GL_ARB_texture_non_power_of_two</constant> extension.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>internalformat</parameter> is one of the generic compressed internal formats: <constant>GL_COMPRESSED_ALPHA</constant>,
<constant>GL_COMPRESSED_LUMINANCE</constant>, <constant>GL_COMPRESSED_LUMINANCE_ALPHA</constant>,
<constant>GL_COMPRESSED_INTENSITY</constant>, <constant>GL_COMPRESSED_RGB</constant>, or
<constant>GL_COMPRESSED_RGBA</constant>.
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>internalformat</parameter> is not
a supported specific compressed internal formats, or is one of the generic
compressed internal formats:
<constant>GL_COMPRESSED_RED</constant>,
<constant>GL_COMPRESSED_RG</constant>,
<constant>GL_COMPRESSED_RGB</constant>,
<constant>GL_COMPRESSED_RGBA</constant>.
<constant>GL_COMPRESSED_SRGB</constant>, or
<constant>GL_COMPRESSED_SRGB_ALPHA</constant>.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>imageSize</parameter> is not consistent with
the format, dimensions, and contents of the specified compressed image
data.
the format, dimensions, and contents of the specified compressed image data.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>border</parameter> is not 0.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if parameter combinations are not
@ -169,11 +156,6 @@
<constant>GL_PIXEL_UNPACK_BUFFER</constant> target and the data would be unpacked from the buffer
object such that the memory reads required would exceed the data store size.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glCompressedTexImage1D</function>
is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
<para>
Undefined results, including abnormal program termination, are generated if
<parameter>data</parameter> is not encoded in a manner consistent with the extension
@ -187,6 +169,12 @@
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_COMPRESSED</constant>
</para>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_NUM_COMPRESSED_TEXTURE_FORMATS</constant>
</para>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_COMPRESSED_TEXTURE_FORMATS</constant>
</para>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PIXEL_UNPACK_BUFFER_BINDING</constant>
</para>
@ -194,32 +182,21 @@
<citerefentry><refentrytitle>glGetTexLevelParameter</refentrytitle></citerefentry> with arguments <constant>GL_TEXTURE_INTERNAL_FORMAT</constant>
and <constant>GL_TEXTURE_COMPRESSED_IMAGE_SIZE</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_1D</constant>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glActiveTexture</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glColorTable</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexSubImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexSubImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexSubImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glConvolutionFilter1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyPixels</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawPixels</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMatrixMode</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexEnv</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexGen</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>,

View file

@ -40,6 +40,7 @@
<para>
Specifies the target texture.
Must be <constant>GL_TEXTURE_2D</constant>, <constant>GL_PROXY_TEXTURE_2D</constant>,
<constant>GL_TEXTURE_1D_ARRAY</constant>, <constant>GL_PROXY_TEXTURE_1D_ARRAY</constant>,
<constant>GL_TEXTURE_CUBE_MAP_POSITIVE_X</constant>,
<constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_X</constant>,
<constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Y</constant>,
@ -72,27 +73,8 @@
<term><parameter>width</parameter></term>
<listitem>
<para>
Specifies the width of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be
<inlineequation><mml:math>
<!-- eqn: 2 sup n + 2 ( border ):-->
<mml:mrow>
<mml:msup><mml:mn>2</mml:mn>
<mml:mi mathvariant="italic">n</mml:mi>
</mml:msup>
<mml:mo>+</mml:mo>
<mml:mrow>
<mml:mn>2</mml:mn>
<mml:mo>&af;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mi mathvariant="italic">border</mml:mi>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math></inlineequation>
for some integer
<inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>.
All
implementations support 2D texture images that are at least 64 texels
Specifies the width of the texture image.
All implementations support 2D texture images that are at least 64 texels
wide and cube-mapped texture images that are at least 16 texels wide.
</para>
</listitem>
@ -101,28 +83,8 @@
<term><parameter>height</parameter></term>
<listitem>
<para>
Specifies the height of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be
Must be
<inlineequation><mml:math>
<!-- eqn: 2 sup n + 2 ( border ):-->
<mml:mrow>
<mml:msup><mml:mn>2</mml:mn>
<mml:mi mathvariant="italic">n</mml:mi>
</mml:msup>
<mml:mo>+</mml:mo>
<mml:mrow>
<mml:mn>2</mml:mn>
<mml:mo>&af;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mi mathvariant="italic">border</mml:mi>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math></inlineequation>
for some integer
<inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>.
All
implementations support 2D texture images that are at least 64 texels
Specifies the height of the texture image.
All implementations support 2D texture images that are at least 64 texels
high and cube-mapped texture images that are at least 16 texels high.
</para>
</listitem>
@ -131,8 +93,7 @@
<term><parameter>border</parameter></term>
<listitem>
<para>
Specifies the width of the border.
Must be either 0 or 1.
This value must be 0.
</para>
</listitem>
</varlistentry>
@ -157,28 +118,31 @@
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
Texturing maps a portion of a specified texture image onto each graphical
primitive for which texturing is enabled. To enable and disable
two-dimensional texturing, call <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry> with argument
<constant>GL_TEXTURE_2D</constant>. To enable and disable texturing using
cube-mapped textures, call <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry> with argument
<constant>GL_TEXTURE_CUBE_MAP</constant>.
Texturing allows elements of an image array to be read by shaders.
</para>
<para>
<function>glCompressedTexImage2D</function> loads a previously defined, and retrieved, compressed two-dimensional
texture image if <parameter>target</parameter> is <constant>GL_TEXTURE_2D</constant> (see <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>).
texture image if <parameter>target</parameter> is <constant>GL_TEXTURE_2D</constant>, or one of the
cube map faces such as <constant>GL_TEXTURE_CUBE_MAP_POSITIVE_X</constant>.
(see <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>).
</para>
<para>
If <parameter>target</parameter> is <constant>GL_PROXY_TEXTURE_2D</constant>, no data is read from <parameter>data</parameter>, but
If <parameter>target</parameter> is <constant>GL_TEXTURE_1D_ARRAY</constant>, <parameter>data</parameter>
is treated as an array of compressed 1D textures.
</para>
<para>
If <parameter>target</parameter> is <constant>GL_PROXY_TEXTURE_2D</constant>, <constant>GL_PROXY_TEXTURE_1D_ARRAY</constant>
or <constant>GL_PROXY_CUBE_MAP</constant>, no data is read from <parameter>data</parameter>, but
all of the texture image state is recalculated, checked for consistency,
and checked against the implementation's capabilities. If the
implementation cannot handle a texture of the requested texture size, it
sets all of the image state to 0, but does not generate an error (see
<citerefentry><refentrytitle>glGetError</refentrytitle></citerefentry>). To query for an entire mipmap array, use an image array level
greater than or equal to 1.
<citerefentry><refentrytitle>glGetError</refentrytitle></citerefentry>). To query for an entire mipmap array,
use an image array level greater than or equal to 1.
</para>
<para>
<parameter>internalformat</parameter> must be an extension-specified compressed-texture format.
<parameter>internalformat</parameter> must be a known compressed image format (such as <constant>GL_RGTC</constant>)
or an extension-specified compressed-texture format.
When a texture is loaded with <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry> using a generic compressed
texture format (e.g., <constant>GL_COMPRESSED_RGB</constant>), the GL selects from one of
its extensions supporting compressed textures. In order to load the
@ -191,26 +155,25 @@
specified, <parameter>data</parameter> is treated as a byte offset into the buffer object's data store.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glCompressedTexImage2D</function> is available only if the GL version is 1.3 or greater.
</para>
<para>
Non-power-of-two textures are supported if the GL version is 2.0 or greater, or if the implementation exports the <constant>GL_ARB_texture_non_power_of_two</constant> extension.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>internalformat</parameter> is one of the generic compressed internal formats: <constant>GL_COMPRESSED_ALPHA</constant>,
<constant>GL_COMPRESSED_LUMINANCE</constant>, <constant>GL_COMPRESSED_LUMINANCE_ALPHA</constant>,
<constant>GL_COMPRESSED_INTENSITY</constant>, <constant>GL_COMPRESSED_RGB</constant>, or
<constant>GL_COMPRESSED_RGBA</constant>.
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>internalformat</parameter> is not one of the generic
compressed internal formats:
<constant>GL_COMPRESSED_RED</constant>,
<constant>GL_COMPRESSED_RG</constant>,
<constant>GL_COMPRESSED_RGB</constant>,
<constant>GL_COMPRESSED_RGBA</constant>.
<constant>GL_COMPRESSED_SRGB</constant>, or
<constant>GL_COMPRESSED_SRGB_ALPHA</constant>.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>imageSize</parameter> is not consistent with
the format, dimensions, and contents of the specified compressed image
data.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>border</parameter> is not 0.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if parameter combinations are not
supported by the specific compressed internal format as specified in the
@ -225,11 +188,6 @@
<constant>GL_PIXEL_UNPACK_BUFFER</constant> target and the data would be unpacked from the buffer
object such that the memory reads required would exceed the data store size.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glCompressedTexImage2D</function>
is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
<para>
Undefined results, including abnormal program termination, are generated if
<parameter>data</parameter> is not encoded in a manner consistent with the extension
@ -250,32 +208,20 @@
<citerefentry><refentrytitle>glGetTexLevelParameter</refentrytitle></citerefentry> with arguments <constant>GL_TEXTURE_INTERNAL_FORMAT</constant>
and <constant>GL_TEXTURE_COMPRESSED_IMAGE_SIZE</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument
<constant>GL_TEXTURE_2D</constant> or <constant>GL_TEXTURE_CUBE_MAP</constant>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glActiveTexture</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glColorTable</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexSubImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexSubImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexSubImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glConvolutionFilter1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyPixels</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawPixels</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMatrixMode</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexEnv</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexGen</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>,

View file

@ -40,7 +40,8 @@
<listitem>
<para>
Specifies the target texture.
Must be <constant>GL_TEXTURE_3D</constant> or <constant>GL_PROXY_TEXTURE_3D</constant>.
Must be <constant>GL_TEXTURE_3D</constant>, <constant>GL_PROXY_TEXTURE_3D</constant>,
<constant>GL_TEXTURE_2D_ARRAY</constant> or <constant>GL_PROXY_TEXTURE_2D_ARRAY</constant>.
</para>
</listitem>
</varlistentry>
@ -66,28 +67,8 @@
<term><parameter>width</parameter></term>
<listitem>
<para>
Specifies the width of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be
<inlineequation><mml:math>
<!-- eqn: 2 sup n + 2 ( border ):-->
<mml:mrow>
<mml:msup><mml:mn>2</mml:mn>
<mml:mi mathvariant="italic">n</mml:mi>
</mml:msup>
<mml:mo>+</mml:mo>
<mml:mrow>
<mml:mn>2</mml:mn>
<mml:mo>&af;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mi mathvariant="italic">border</mml:mi>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math></inlineequation>
for some integer
<inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>.
All
implementations support 3D texture images that are at least 16 texels
wide.
Specifies the width of the texture image.
All implementations support 3D texture images that are at least 16 texels wide.
</para>
</listitem>
</varlistentry>
@ -95,27 +76,8 @@
<term><parameter>height</parameter></term>
<listitem>
<para>
Specifies the height of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be
<inlineequation><mml:math>
<!-- eqn: 2 sup n + 2 ( border ):-->
<mml:mrow>
<mml:msup><mml:mn>2</mml:mn>
<mml:mi mathvariant="italic">n</mml:mi>
</mml:msup>
<mml:mo>+</mml:mo>
<mml:mrow>
<mml:mn>2</mml:mn>
<mml:mo>&af;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mi mathvariant="italic">border</mml:mi>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math></inlineequation>
for some integer
<inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>.
All
implementations support 3D texture images that are at least 16 texels
Specifies the height of the texture image.
All implementations support 3D texture images that are at least 16 texels
high.
</para>
</listitem>
@ -124,27 +86,8 @@
<term><parameter>depth</parameter></term>
<listitem>
<para>
Specifies the depth of the texture image including the border if any. If the GL version does not support non-power-of-two sizes, this value must be
<inlineequation><mml:math>
<!-- eqn: 2 sup n + 2 ( border ):-->
<mml:mrow>
<mml:msup><mml:mn>2</mml:mn>
<mml:mi mathvariant="italic">n</mml:mi>
</mml:msup>
<mml:mo>+</mml:mo>
<mml:mrow>
<mml:mn>2</mml:mn>
<mml:mo>&af;</mml:mo>
<mml:mfenced open="(" close=")">
<mml:mi mathvariant="italic">border</mml:mi>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
</mml:math></inlineequation>
for some integer
<inlineequation><mml:math><mml:mi mathvariant="italic">n</mml:mi></mml:math></inlineequation>.
All
implementations support 3D texture images that are at least 16 texels
Specifies the depth of the texture image.
All implementations support 3D texture images that are at least 16 texels
deep.
</para>
</listitem>
@ -153,8 +96,7 @@
<term><parameter>border</parameter></term>
<listitem>
<para>
Specifies the width of the border.
Must be either 0 or 1.
This value must be 0.
</para>
</listitem>
</varlistentry>
@ -179,17 +121,19 @@
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
Texturing maps a portion of a specified texture image onto each graphical
primitive for which texturing is enabled. To enable and disable
three-dimensional texturing, call <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry> with argument
<constant>GL_TEXTURE_3D</constant>.
Texturing allows elements of an image array to be read by shaders.
</para>
<para>
<function>glCompressedTexImage3D</function> loads a previously defined, and retrieved, compressed three-dimensional
texture image if <parameter>target</parameter> is <constant>GL_TEXTURE_3D</constant> (see <citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>).
</para>
<para>
If <parameter>target</parameter> is <constant>GL_PROXY_TEXTURE_3D</constant>, no data is read from <parameter>data</parameter>, but
If <parameter>target</parameter> is <constant>GL_TEXTURE_2D_ARRAY</constant>, <parameter>data</parameter> is
treated as an array of compressed 2D textures.
</para>
<para>
If <parameter>target</parameter> is <constant>GL_PROXY_TEXTURE_3D</constant> or <constant>GL_PROXY_TEXTURE_2D_ARRAY</constant>,
no data is read from <parameter>data</parameter>, but
all of the texture image state is recalculated, checked for consistency,
and checked against the implementation's capabilities. If the
implementation cannot handle a texture of the requested texture size, it
@ -198,7 +142,8 @@
greater than or equal to 1.
</para>
<para>
<parameter>internalformat</parameter> must be an extension-specified compressed-texture format.
<parameter>internalformat</parameter> must be a known compressed image format (such as <constant>GL_RGTC</constant>)
or an extension-specified compressed-texture format.
When a texture is loaded with <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry> using a generic compressed
texture format (e.g., <constant>GL_COMPRESSED_RGB</constant>), the GL selects from one of
its extensions supporting compressed textures. In order to load the
@ -211,25 +156,24 @@
specified, <parameter>data</parameter> is treated as a byte offset into the buffer object's data store.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glCompressedTexImage3D</function> is available only if the GL version is 1.3 or greater.
</para>
<para>
Non-power-of-two textures are supported if the GL version is 2.0 or greater, or if the implementation exports the <constant>GL_ARB_texture_non_power_of_two</constant> extension.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>internalformat</parameter> is one of the generic compressed internal formats: <constant>GL_COMPRESSED_ALPHA</constant>,
<constant>GL_COMPRESSED_LUMINANCE</constant>, <constant>GL_COMPRESSED_LUMINANCE_ALPHA</constant>,
<constant>GL_COMPRESSED_INTENSITY</constant>, <constant>GL_COMPRESSED_RGB</constant>, or
<constant>GL_COMPRESSED_RGBA</constant>.
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>internalformat</parameter> is not one of the generic
compressed internal formats:
<constant>GL_COMPRESSED_RED</constant>,
<constant>GL_COMPRESSED_RG</constant>,
<constant>GL_COMPRESSED_RGB</constant>,
<constant>GL_COMPRESSED_RGBA</constant>.
<constant>GL_COMPRESSED_SRGB</constant>, or
<constant>GL_COMPRESSED_SRGB_ALPHA</constant>.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>imageSize</parameter> is not consistent with
the format, dimensions, and contents of the specified compressed image data.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>border</parameter> is not 0.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if parameter combinations are not
supported by the specific compressed internal format as specified in the
@ -244,11 +188,6 @@
<constant>GL_PIXEL_UNPACK_BUFFER</constant> target and the data would be unpacked from the buffer
object such that the memory reads required would exceed the data store size.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glCompressedTexImage3D</function>
is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
<para>
Undefined results, including abnormal program termination, are generated if <parameter>data</parameter> is not encoded in a manner consistent with the extension specification defining the internal compression format.
</para>
@ -267,31 +206,20 @@
<citerefentry><refentrytitle>glGetTexLevelParameter</refentrytitle></citerefentry> with arguments <constant>GL_TEXTURE_INTERNAL_FORMAT</constant>
and <constant>GL_TEXTURE_COMPRESSED_IMAGE_SIZE</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_3D</constant>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glActiveTexture</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glColorTable</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexSubImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexSubImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexSubImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glConvolutionFilter1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyPixels</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawPixels</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMatrixMode</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexEnv</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexGen</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>,

View file

@ -97,17 +97,14 @@
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
Texturing maps a portion of a specified texture image onto each graphical
primitive for which texturing is enabled. To enable and disable
one-dimensional texturing, call <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry> with argument
<constant>GL_TEXTURE_1D</constant>.
Texturing allows elements of an image array to be read by shaders.
</para>
<para>
<function>glCompressedTexSubImage1D</function> redefines a contiguous subregion of an existing one-dimensional
texture image. The texels referenced by <parameter>data</parameter> replace the portion of the
existing texture array with x indices <parameter>xoffset</parameter> and
<inlineequation><mml:math>
<!-- eqn: xoffset + width - 1:-->
<!-- eqn: xoffset + width - 1: -->
<mml:mrow>
<mml:mi mathvariant="italic">xoffset</mml:mi>
<mml:mo>+</mml:mo>
@ -122,8 +119,9 @@
specification has no effect.
</para>
<para>
<parameter>format</parameter> must be an extension-specified
compressed-texture format. The <parameter>format</parameter> of the compressed texture
<parameter>internalformat</parameter> must be a known compressed image format (such as <constant>GL_RGTC</constant>)
or an extension-specified compressed-texture format.
The <parameter>format</parameter> of the compressed texture
image is selected by the GL implementation that compressed it (see
<citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>), and should be queried at the time the texture was
compressed with <citerefentry><refentrytitle>glGetTexLevelParameter</refentrytitle></citerefentry>.
@ -134,25 +132,16 @@
specified, <parameter>data</parameter> is treated as a byte offset into the buffer object's data store.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glCompressedTexSubImage1D</function> is available only if the GL version is 1.3 or greater.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>format</parameter> is one of these generic compressed internal formats:
<constant>GL_COMPRESSED_ALPHA</constant>,
<constant>GL_COMPRESSED_LUMINANCE</constant>,
<constant>GL_COMPRESSED_LUMINANCE_ALPHA</constant>,
<constant>GL_COMPRESSED_INTENSITY</constant>,
<constant>GL_COMPRESSED_RGB</constant>,
<constant>GL_COMPRESSED_RGBA</constant>,
<constant>GL_COMPRESSED_SLUMINANCE</constant>,
<constant>GL_COMPRESSED_SLUMINANCE_ALPHA</constant>,
<constant>GL_COMPRESSED_SRGB</constant>,
<constant>GL_COMPRESSED_SRGBA</constant>, or
<constant>GL_COMPRESSED_SRGB_ALPHA</constant>.
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>internalformat</parameter> is not one of the generic
compressed internal formats:
<constant>GL_COMPRESSED_RED</constant>,
<constant>GL_COMPRESSED_RG</constant>,
<constant>GL_COMPRESSED_RGB</constant>,
<constant>GL_COMPRESSED_RGBA</constant>.
<constant>GL_COMPRESSED_SRGB</constant>, or
<constant>GL_COMPRESSED_SRGB_ALPHA</constant>.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>imageSize</parameter> is not consistent with
@ -173,11 +162,6 @@
<constant>GL_PIXEL_UNPACK_BUFFER</constant> target and the data would be unpacked from the buffer
object such that the memory reads required would exceed the data store size.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glCompressedTexSubImage1D</function>
is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
<para>
Undefined results, including abnormal program termination, are generated if
<parameter>data</parameter> is not encoded in a manner consistent with the extension
@ -198,32 +182,21 @@
<citerefentry><refentrytitle>glGetTexLevelParameter</refentrytitle></citerefentry> with arguments <constant>GL_TEXTURE_INTERNAL_FORMAT</constant>
and <constant>GL_TEXTURE_COMPRESSED_IMAGE_SIZE</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_1D</constant>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glActiveTexture</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glColorTable</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexSubImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexSubImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glConvolutionFilter1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyPixels</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawPixels</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMatrixMode</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexEnv</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexGen</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>,

View file

@ -121,19 +121,14 @@
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
Texturing maps a portion of a specified texture image onto each graphical
primitive for which texturing is enabled. To enable and disable
two-dimensional texturing, call <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry> with argument
<constant>GL_TEXTURE_2D</constant>. To enable and disable texturing using
cube-mapped texture, call <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry> with argument
<constant>GL_TEXTURE_CUBE_MAP</constant>.
Texturing allows elements of an image array to be read by shaders.
</para>
<para>
<function>glCompressedTexSubImage2D</function> redefines a contiguous subregion of an existing two-dimensional
texture image. The texels referenced by <parameter>data</parameter> replace the portion of the
existing texture array with x indices <parameter>xoffset</parameter> and
<inlineequation><mml:math>
<!-- eqn: xoffset + width - 1:-->
<!-- eqn: xoffset + width - 1: -->
<mml:mrow>
<mml:mi mathvariant="italic">xoffset</mml:mi>
<mml:mo>+</mml:mo>
@ -144,7 +139,7 @@
</mml:math></inlineequation>,
and the y indices <parameter>yoffset</parameter> and
<inlineequation><mml:math>
<!-- eqn: yoffset + height - 1:-->
<!-- eqn: yoffset + height - 1: -->
<mml:mrow>
<mml:mi mathvariant="italic">yoffset</mml:mi>
<mml:mo>+</mml:mo>
@ -160,8 +155,9 @@
specification has no effect.
</para>
<para>
<parameter>format</parameter> must be an extension-specified
compressed-texture format. The <parameter>format</parameter> of the compressed texture
<parameter>internalformat</parameter> must be a known compressed image format (such as <constant>GL_RGTC</constant>)
or an extension-specified compressed-texture format.
The <parameter>format</parameter> of the compressed texture
image is selected by the GL implementation that compressed it (see
<citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>) and should be queried at the time the texture was
compressed with <citerefentry><refentrytitle>glGetTexLevelParameter</refentrytitle></citerefentry>.
@ -172,35 +168,15 @@
specified, <parameter>data</parameter> is treated as a byte offset into the buffer object's data store.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glCompressedTexSubImage2D</function> is available only if the GL version is 1.3 or greater.
</para>
<para>
<constant>GL_TEXTURE_CUBE_MAP_POSITIVE_X</constant>,
<constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_X</constant>,
<constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Y</constant>,
<constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</constant>,
<constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Z</constant>,
<constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</constant>, or
<constant>GL_PROXY_TEXTURE_CUBE_MAP</constant> are available only if the GL version is 1.3
or greater.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>format</parameter> is one of these generic compressed internal formats:
<constant>GL_COMPRESSED_ALPHA</constant>,
<constant>GL_COMPRESSED_LUMINANCE</constant>,
<constant>GL_COMPRESSED_LUMINANCE_ALPHA</constant>,
<constant>GL_COMPRESSED_INTENSITY</constant>,
<constant>GL_COMPRESSED_RGB</constant>,
<constant>GL_COMPRESSED_RGBA</constant>,
<constant>GL_COMPRESSED_SLUMINANCE</constant>,
<constant>GL_COMPRESSED_SLUMINANCE_ALPHA</constant>,
<constant>GL_COMPRESSED_SRGB</constant>,
<constant>GL_COMPRESSED_SRGBA</constant>, or
<constant>GL_COMPRESSED_SRGB_ALPHA</constant>.
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>internalformat</parameter> is of the generic compressed internal formats:
<constant>GL_COMPRESSED_RED</constant>,
<constant>GL_COMPRESSED_RG</constant>,
<constant>GL_COMPRESSED_RGB</constant>,
<constant>GL_COMPRESSED_RGBA</constant>.
<constant>GL_COMPRESSED_SRGB</constant>, or
<constant>GL_COMPRESSED_SRGB_ALPHA</constant>.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>imageSize</parameter> is not consistent with
@ -221,11 +197,6 @@
<constant>GL_PIXEL_UNPACK_BUFFER</constant> target and the data would be unpacked from the buffer
object such that the memory reads required would exceed the data store size.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glCompressedTexSubImage2D</function>
is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
<para>
Undefined results, including abnormal program termination, are generated if
<parameter>data</parameter> is not encoded in a manner consistent with the extension
@ -246,32 +217,21 @@
<citerefentry><refentrytitle>glGetTexLevelParameter</refentrytitle></citerefentry> with arguments <constant>GL_TEXTURE_INTERNAL_FORMAT</constant>
and <constant>GL_TEXTURE_COMPRESSED_IMAGE_SIZE</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_2D</constant> or <constant>GL_TEXTURE_CUBE_MAP</constant>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glActiveTexture</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glColorTable</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexSubImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexSubImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glConvolutionFilter1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyPixels</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawPixels</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMatrixMode</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexEnv</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexGen</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>,

View file

@ -125,17 +125,14 @@
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
Texturing maps a portion of a specified texture image onto each graphical
primitive for which texturing is enabled. To enable and disable
three-dimensional texturing, call <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry> with argument
<constant>GL_TEXTURE_3D</constant>.
Texturing allows elements of an image array to be read by shaders.
</para>
<para>
<function>glCompressedTexSubImage3D</function> redefines a contiguous subregion of an existing three-dimensional
texture image. The texels referenced by <parameter>data</parameter> replace the portion of the
existing texture array with x indices <parameter>xoffset</parameter> and
<inlineequation><mml:math>
<!-- eqn: xoffset + width - 1:-->
<!-- eqn: xoffset + width - 1: -->
<mml:mrow>
<mml:mi mathvariant="italic">xoffset</mml:mi>
<mml:mo>+</mml:mo>
@ -146,7 +143,7 @@
</mml:math></inlineequation>,
and the y indices <parameter>yoffset</parameter> and
<inlineequation><mml:math>
<!-- eqn: yoffset + height - 1:-->
<!-- eqn: yoffset + height - 1: -->
<mml:mrow>
<mml:mi mathvariant="italic">yoffset</mml:mi>
<mml:mo>+</mml:mo>
@ -157,7 +154,7 @@
</mml:math></inlineequation>,
and the z indices <parameter>zoffset</parameter> and
<inlineequation><mml:math>
<!-- eqn: zoffset + depth - 1:-->
<!-- eqn: zoffset + depth - 1: -->
<mml:mrow>
<mml:mi mathvariant="italic">zoffset</mml:mi>
<mml:mo>+</mml:mo>
@ -172,8 +169,9 @@
but such a specification has no effect.
</para>
<para>
<parameter>format</parameter> must be an extension-specified
compressed-texture format. The <parameter>format</parameter> of the compressed texture
<parameter>internalformat</parameter> must be a known compressed image format (such as <constant>GL_RGTC</constant>)
or an extension-specified compressed-texture format.
The <parameter>format</parameter> of the compressed texture
image is selected by the GL implementation that compressed it (see
<citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>) and should be queried at the time the texture was
compressed with <citerefentry><refentrytitle>glGetTexLevelParameter</refentrytitle></citerefentry>.
@ -184,25 +182,15 @@
specified, <parameter>data</parameter> is treated as a byte offset into the buffer object's data store.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glCompressedTexSubImage3D</function> is available only if the GL version is 1.3 or greater.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>format</parameter> is one of these generic compressed internal formats:
<constant>GL_COMPRESSED_ALPHA</constant>,
<constant>GL_COMPRESSED_LUMINANCE</constant>,
<constant>GL_COMPRESSED_LUMINANCE_ALPHA</constant>,
<constant>GL_COMPRESSED_INTENSITY</constant>,
<constant>GL_COMPRESSED_RGB</constant>,
<constant>GL_COMPRESSED_RGBA</constant>,
<constant>GL_COMPRESSED_SLUMINANCE</constant>,
<constant>GL_COMPRESSED_SLUMINANCE_ALPHA</constant>,
<constant>GL_COMPRESSED_SRGB</constant>,
<constant>GL_COMPRESSED_SRGBA</constant>, or
<constant>GL_COMPRESSED_SRGB_ALPHA</constant>.
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>internalformat</parameter> is one of the generic compressed internal formats:
<constant>GL_COMPRESSED_RED</constant>,
<constant>GL_COMPRESSED_RG</constant>,
<constant>GL_COMPRESSED_RGB</constant>,
<constant>GL_COMPRESSED_RGBA</constant>.
<constant>GL_COMPRESSED_SRGB</constant>, or
<constant>GL_COMPRESSED_SRGB_ALPHA</constant>.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>imageSize</parameter> is not consistent with
@ -223,11 +211,6 @@
<constant>GL_PIXEL_UNPACK_BUFFER</constant> target and the data would be unpacked from the buffer
object such that the memory reads required would exceed the data store size.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glCompressedTexSubImage3D</function>
is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
<para>
Undefined results, including abnormal program termination, are generated if
<parameter>data</parameter> is not encoded in a manner consistent with the extension
@ -248,32 +231,21 @@
<citerefentry><refentrytitle>glGetTexLevelParameter</refentrytitle></citerefentry> with arguments <constant>GL_TEXTURE_INTERNAL_FORMAT</constant>
and <constant>GL_TEXTURE_COMPRESSED_IMAGE_SIZE</constant>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_3D</constant>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glActiveTexture</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glColorTable</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexSubImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompressedTexSubImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glConvolutionFilter1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyPixels</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawPixels</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glMatrixMode</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexEnv</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexGen</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>,

View file

@ -0,0 +1,143 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glCopyBufferSubData">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glCopyBufferSubData</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glCopyBufferSubData</refname>
<refpurpose>copy part of the data store of a buffer object to the data store of another buffer object</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glCopyBufferSubData</function></funcdef>
<paramdef>GLenum <parameter>readtarget</parameter></paramdef>
<paramdef>GLenum <parameter>writetarget</parameter></paramdef>
<paramdef>GLintptr <parameter>readoffset</parameter></paramdef>
<paramdef>GLintptr <parameter>writeoffset</parameter></paramdef>
<paramdef>GLsizeiptr <parameter>size</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<!-- eqn: ignoring delim $$ -->
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>readtarget</parameter></term>
<listitem>
<para>
Specifies the target from whose data store data should be read.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>writetarget</parameter></term>
<listitem>
<para>
Specifies the target to whose data store data should be written.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>readoffset</parameter></term>
<listitem>
<para>
Specifies the offset, in basic machine units, within the data store of <parameter>readtarget</parameter> from which data should be read.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>writeoffset</parameter></term>
<listitem>
<para>
Specifies the offset, in basic machine units, within the data store of <parameter>writetarget</parameter> to which data should be written.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>size</parameter></term>
<listitem>
<para>
Specifies the size, in basic machine units, of the data to be copied from <parameter>readtarget</parameter> to <parameter>writetarget</parameter>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glCopyBufferSubData</function> copies part of the data store attached to <parameter>readtarget</parameter> to the
data store attached to <parameter>writetarget</parameter>. The number of basic machine units indicated by <parameter>size</parameter>
is copied from the source, at offset <parameter>readoffset</parameter> to the destination at <parameter>writeoffset</parameter>,
also in basic machine units.
</para>
<para>
<parameter>readtarget</parameter> and <parameter>writetarget</parameter> must be <constant>GL_ARRAY_BUFFER</constant>,
<constant>GL_COPY_READ_BUFFER</constant>, <constant>GL_COPY_WRITE_BUFFER</constant>, <constant>GL_ELEMENT_ARRAY_BUFFER</constant>,
<constant>GL_PIXEL_PACK_BUFFER</constant>, <constant>GL_PIXEL_UNPACK_BUFFER</constant>, <constant>GL_TEXTURE_BUFFER</constant>,
<constant>GL_TRANSFORM_FEEDBACK_BUFFER</constant> or <constant>GL_UNIFORM_BUFFER</constant>. Any of these targets may be used,
although the targets <constant>GL_COPY_READ_BUFFER</constant> and <constant>GL_COPY_WRITE_BUFFER</constant> are provided
specifically to allow copies between buffers without disturbing other GL state.
</para>
<para>
<parameter>readoffset</parameter>, <parameter>writeoffset</parameter> and <parameter>size</parameter> must all be greater than or equal to
zero. Furthermore, <parameter>readoffset</parameter> + <parameter>size</parameter> must not exceeed the size of the buffer
object bound to <parameter>readtarget</parameter>, and <parameter>readoffset</parameter> + <parameter>size</parameter> must not exceeed the
size of the buffer bound to <parameter>writetarget</parameter>. If the same buffer object is bound to both <parameter>readtarget</parameter>
and <parameter>writetarget</parameter>, then the ranges specified by <parameter>readoffset</parameter>, <parameter>writeoffset</parameter>
and <parameter>size</parameter> must not overlap.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glCopyBufferSubData</function> is available only if the GL version is 3.1 or greater.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if any of <parameter>readoffset</parameter>, <parameter>writeoffset</parameter>
or <parameter>size</parameter> is negative, if <parameter>readoffset</parameter> + <parameter>size</parameter> exceeds the
size of the buffer object bound to <parameter>readtarget</parameter> or if <parameter>writeoffset</parameter> + <parameter>size</parameter>
exceeds the size of the buffer object bound to <parameter>writetarget</parameter>.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if the same buffer object is bound to both <parameter>readtarget</parameter>
and <parameter>writetarget</parameter> and the ranges [<parameter>readoffset</parameter>, <parameter>readoffset</parameter> +
<parameter>size</parameter>) and [<parameter>writeoffset</parameter>, <parameter>writeoffset</parameter> + <parameter>size</parameter>)
overlap.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if zero is bound to <parameter>readtarget</parameter> or <parameter>writetarget</parameter>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if the buffer object bound to either <parameter>readtarget</parameter> or <parameter>writetarget</parameter>
is mapped.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glGenBuffers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBindBuffer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBufferData</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBufferSubData</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGetBufferSubData</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -58,38 +58,18 @@
<para>
Specifies the internal format of the texture.
Must be one of the following symbolic constants:
<constant>GL_ALPHA</constant>,
<constant>GL_ALPHA4</constant>,
<constant>GL_ALPHA8</constant>,
<constant>GL_ALPHA12</constant>,
<constant>GL_ALPHA16</constant>,
<constant>GL_COMPRESSED_ALPHA</constant>,
<constant>GL_COMPRESSED_LUMINANCE</constant>,
<constant>GL_COMPRESSED_LUMINANCE_ALPHA</constant>,
<constant>GL_COMPRESSED_INTENSITY</constant>,
<constant>GL_COMPRESSED_RED</constant>,
<constant>GL_COMPRESSED_RG</constant>,
<constant>GL_COMPRESSED_RGB</constant>,
<constant>GL_COMPRESSED_RGBA</constant>,
<constant>GL_COMPRESSED_RGBA</constant>.
<constant>GL_COMPRESSED_SRGB</constant>,
<constant>GL_COMPRESSED_SRGB_ALPHA</constant>.
<constant>GL_DEPTH_COMPONENT</constant>,
<constant>GL_DEPTH_COMPONENT16</constant>,
<constant>GL_DEPTH_COMPONENT24</constant>,
<constant>GL_DEPTH_COMPONENT32</constant>,
<constant>GL_LUMINANCE</constant>,
<constant>GL_LUMINANCE4</constant>,
<constant>GL_LUMINANCE8</constant>,
<constant>GL_LUMINANCE12</constant>,
<constant>GL_LUMINANCE16</constant>,
<constant>GL_LUMINANCE_ALPHA</constant>,
<constant>GL_LUMINANCE4_ALPHA4</constant>,
<constant>GL_LUMINANCE6_ALPHA2</constant>,
<constant>GL_LUMINANCE8_ALPHA8</constant>,
<constant>GL_LUMINANCE12_ALPHA4</constant>,
<constant>GL_LUMINANCE12_ALPHA12</constant>,
<constant>GL_LUMINANCE16_ALPHA16</constant>,
<constant>GL_INTENSITY</constant>,
<constant>GL_INTENSITY4</constant>,
<constant>GL_INTENSITY8</constant>,
<constant>GL_INTENSITY12</constant>,
<constant>GL_INTENSITY16</constant>,
<constant>GL_RED</constant>,
<constant>GL_RG</constant>,
<constant>GL_RGB</constant>,
<constant>GL_R3_G3_B2</constant>,
<constant>GL_RGB4</constant>,
@ -106,10 +86,6 @@
<constant>GL_RGB10_A2</constant>,
<constant>GL_RGBA12</constant>,
<constant>GL_RGBA16</constant>,
<constant>GL_SLUMINANCE</constant>,
<constant>GL_SLUMINANCE8</constant>,
<constant>GL_SLUMINANCE_ALPHA</constant>,
<constant>GL_SLUMINANCE8_ALPHA8</constant>,
<constant>GL_SRGB</constant>,
<constant>GL_SRGB8</constant>,
<constant>GL_SRGB_ALPHA</constant>, or
@ -134,7 +110,7 @@
Specifies the width of the texture image.
Must be 0 or
<inlineequation><mml:math>
<!-- eqn: 2 sup n + 2 ( border ):-->
<!-- eqn: 2 sup n + 2 ( border ): -->
<mml:mrow>
<mml:msup><mml:mn>2</mml:mn>
<mml:mi mathvariant="italic">n</mml:mi>
@ -174,7 +150,7 @@
<para>
The screen-aligned pixel row with left corner at
<inlineequation><mml:math>
<!-- eqn: (x, y):-->
<!-- eqn: (x, y): -->
<mml:mfenced open="(" close=")">
<mml:mi mathvariant="italic">x</mml:mi>
<mml:mi mathvariant="italic">y</mml:mi>
@ -182,7 +158,7 @@
</mml:math></inlineequation>
and with a length of
<inlineequation><mml:math>
<!-- eqn: width + 2 ( border ):-->
<!-- eqn: width + 2 ( border ): -->
<mml:mrow>
<mml:mi mathvariant="italic">width</mml:mi>
<mml:mo>+</mml:mo>
@ -201,11 +177,11 @@
</para>
<para>
The pixels in the row are processed exactly as if
<citerefentry><refentrytitle>glCopyPixels</refentrytitle></citerefentry> had been called, but the process stops just before
<citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry> had been called, but the process stops just before
final conversion.
At this point all pixel component values are clamped to the range
<inlineequation><mml:math>
<!-- eqn: [0,1]:-->
<!-- eqn: [0,1]: -->
<mml:mfenced open="[" close="]">
<mml:mn>0</mml:mn>
<mml:mn>1</mml:mn>
@ -234,41 +210,12 @@
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glCopyTexImage1D</function> is available only if the GL version is 1.1 or greater.
</para>
<para>
Texturing has no effect in color index mode.
</para>
<para>
1, 2, 3, and 4 are not accepted values for <parameter>internalformat</parameter>.
</para>
<para>
An image with 0 width indicates a NULL texture.
</para>
<para>
When the <code>ARB_imaging</code> extension is supported, the RGBA components copied from the framebuffer may be processed by the imaging pipeline. See <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry> for specific details.
</para>
<para>
<constant>GL_DEPTH_COMPONENT</constant>, <constant>GL_DEPTH_COMPONENT16</constant>,
<constant>GL_DEPTH_COMPONENT24</constant>, and <constant>GL_DEPTH_COMPONENT32</constant> are available only
if the GL version is 1.4 or greater.
</para>
<para>
Non-power-of-two textures are supported if the GL version is 2.0 or greater, or if the implementation exports the <constant>GL_ARB_texture_non_power_of_two</constant> extension.
</para>
<para>
The
<constant>GL_SRGB</constant>,
<constant>GL_SRGB8</constant>,
<constant>GL_SRGB_ALPHA</constant>,
<constant>GL_SRGB8_ALPHA8</constant>,
<constant>GL_SLUMINANCE</constant>,
<constant>GL_SLUMINANCE8</constant>,
<constant>GL_SLUMINANCE_ALPHA</constant>, and
<constant>GL_SLUMINANCE8_ALPHA8</constant>
internal formats are only available if the GL version is 2.1 or greater. See <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry> for specific details about sRGB conversion.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
@ -281,7 +228,7 @@
<constant>GL_INVALID_VALUE</constant> may be generated if <parameter>level</parameter> is greater
than
<inlineequation><mml:math>
<!-- eqn: log sub 2 max:-->
<!-- eqn: log sub 2 max: -->
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">log</mml:mi>
<mml:mn>2</mml:mn>
@ -299,12 +246,12 @@
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>width</parameter> is less than 0 or greater than
2 + <constant>GL_MAX_TEXTURE_SIZE</constant>.
<constant>GL_MAX_TEXTURE_SIZE</constant>.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if non-power-of-two textures are not supported and the <parameter>width</parameter> cannot be represented as
<inlineequation><mml:math>
<!-- eqn: 2 sup n + 2 ( border ):-->
<!-- eqn: 2 sup n + 2 ( border ): -->
<mml:mrow>
<mml:msup><mml:mn>2</mml:mn>
<mml:mi mathvariant="italic">n</mml:mi>
@ -324,9 +271,6 @@
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>border</parameter> is not 0 or 1.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glCopyTexImage1D</function> is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>internalformat</parameter> is
<constant>GL_DEPTH_COMPONENT</constant>, <constant>GL_DEPTH_COMPONENT16</constant>,
@ -338,20 +282,13 @@
<para>
<citerefentry><refentrytitle>glGetTexImage</refentrytitle></citerefentry>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_1D</constant>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glCopyPixels</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexEnv</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexGen</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>,

View file

@ -65,38 +65,18 @@
<para>
Specifies the internal format of the texture.
Must be one of the following symbolic constants:
<constant>GL_ALPHA</constant>,
<constant>GL_ALPHA4</constant>,
<constant>GL_ALPHA8</constant>,
<constant>GL_ALPHA12</constant>,
<constant>GL_ALPHA16</constant>,
<constant>GL_COMPRESSED_ALPHA</constant>,
<constant>GL_COMPRESSED_LUMINANCE</constant>,
<constant>GL_COMPRESSED_LUMINANCE_ALPHA</constant>,
<constant>GL_COMPRESSED_INTENSITY</constant>,
<constant>GL_COMPRESSED_RED</constant>,
<constant>GL_COMPRESSED_RG</constant>,
<constant>GL_COMPRESSED_RGB</constant>,
<constant>GL_COMPRESSED_RGBA</constant>,
<constant>GL_COMPRESSED_RGBA</constant>.
<constant>GL_COMPRESSED_SRGB</constant>,
<constant>GL_COMPRESSED_SRGB_ALPHA</constant>.
<constant>GL_DEPTH_COMPONENT</constant>,
<constant>GL_DEPTH_COMPONENT16</constant>,
<constant>GL_DEPTH_COMPONENT24</constant>,
<constant>GL_DEPTH_COMPONENT32</constant>,
<constant>GL_LUMINANCE</constant>,
<constant>GL_LUMINANCE4</constant>,
<constant>GL_LUMINANCE8</constant>,
<constant>GL_LUMINANCE12</constant>,
<constant>GL_LUMINANCE16</constant>,
<constant>GL_LUMINANCE_ALPHA</constant>,
<constant>GL_LUMINANCE4_ALPHA4</constant>,
<constant>GL_LUMINANCE6_ALPHA2</constant>,
<constant>GL_LUMINANCE8_ALPHA8</constant>,
<constant>GL_LUMINANCE12_ALPHA4</constant>,
<constant>GL_LUMINANCE12_ALPHA12</constant>,
<constant>GL_LUMINANCE16_ALPHA16</constant>,
<constant>GL_INTENSITY</constant>,
<constant>GL_INTENSITY4</constant>,
<constant>GL_INTENSITY8</constant>,
<constant>GL_INTENSITY12</constant>,
<constant>GL_INTENSITY16</constant>,
<constant>GL_RED</constant>,
<constant>GL_RG</constant>,
<constant>GL_RGB</constant>,
<constant>GL_R3_G3_B2</constant>,
<constant>GL_RGB4</constant>,
@ -113,10 +93,6 @@
<constant>GL_RGB10_A2</constant>,
<constant>GL_RGBA12</constant>,
<constant>GL_RGBA16</constant>,
<constant>GL_SLUMINANCE</constant>,
<constant>GL_SLUMINANCE8</constant>,
<constant>GL_SLUMINANCE_ALPHA</constant>,
<constant>GL_SLUMINANCE8_ALPHA8</constant>,
<constant>GL_SRGB</constant>,
<constant>GL_SRGB8</constant>,
<constant>GL_SRGB_ALPHA</constant>, or
@ -141,7 +117,7 @@
Specifies the width of the texture image.
Must be 0 or
<inlineequation><mml:math>
<!-- eqn: 2 sup n + 2 ( border ):-->
<!-- eqn: 2 sup n + 2 ( border ): -->
<mml:mrow>
<mml:msup><mml:mn>2</mml:mn>
<mml:mi mathvariant="italic">n</mml:mi>
@ -168,7 +144,7 @@
Specifies the height of the texture image.
Must be 0 or
<inlineequation><mml:math>
<!-- eqn: 2 sup m + 2 ( border ):-->
<!-- eqn: 2 sup m + 2 ( border ): -->
<mml:mrow>
<mml:msup><mml:mn>2</mml:mn>
<mml:mi mathvariant="italic">m</mml:mi>
@ -209,7 +185,7 @@
The screen-aligned pixel rectangle with lower left corner at (<parameter>x</parameter>,
<parameter>y</parameter>) and with a width of
<inlineequation><mml:math>
<!-- eqn: width + 2 ( border ):-->
<!-- eqn: width + 2 ( border ): -->
<mml:mrow>
<mml:mi mathvariant="italic">width</mml:mi>
<mml:mo>+</mml:mo>
@ -224,7 +200,7 @@
</mml:math></inlineequation>
and a height of
<inlineequation><mml:math>
<!-- eqn: height + 2 ( border ):-->
<!-- eqn: height + 2 ( border ): -->
<mml:mrow>
<mml:mi mathvariant="italic">height</mml:mi>
<mml:mo>+</mml:mo>
@ -243,11 +219,11 @@
</para>
<para>
The pixels in the rectangle are processed exactly as if
<citerefentry><refentrytitle>glCopyPixels</refentrytitle></citerefentry> had been called, but the process stops just before
<citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry> had been called, but the process stops just before
final conversion.
At this point all pixel component values are clamped to the range
<inlineequation><mml:math>
<!-- eqn: [0,1]:-->
<!-- eqn: [0,1]: -->
<mml:mfenced open="[" close="]">
<mml:mn>0</mml:mn>
<mml:mn>1</mml:mn>
@ -278,48 +254,12 @@
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glCopyTexImage2D</function> is available only if the GL version is 1.1 or greater.
</para>
<para>
Texturing has no effect in color index mode.
</para>
<para>
1, 2, 3, and 4 are not accepted values for <parameter>internalformat</parameter>.
</para>
<para>
An image with height or width of 0 indicates a NULL texture.
</para>
<para>
When the <code>ARB_imaging</code> extension is supported, the RGBA components read from the framebuffer may be processed by the imaging pipeline. See <citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry> for specific details.
</para>
<para>
<constant>GL_TEXTURE_CUBE_MAP_POSITIVE_X</constant>,
<constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_X</constant>,
<constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Y</constant>,
<constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</constant>,
<constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Z</constant>,
<constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</constant>, or
<constant>GL_PROXY_TEXTURE_CUBE_MAP</constant> are available only if the GL version is 1.3
or greater.
</para>
<para>
<constant>GL_DEPTH_COMPONENT</constant>, <constant>GL_DEPTH_COMPONENT16</constant>, <constant>GL_DEPTH_COMPONENT24</constant>,
and <constant>GL_DEPTH_COMPONENT32</constant> are available only if the GL version is 1.4
or greater.
</para>
<para>
The
<constant>GL_SRGB</constant>,
<constant>GL_SRGB8</constant>,
<constant>GL_SRGB_ALPHA</constant>,
<constant>GL_SRGB8_ALPHA8</constant>,
<constant>GL_SLUMINANCE</constant>,
<constant>GL_SLUMINANCE8</constant>,
<constant>GL_SLUMINANCE_ALPHA</constant>, and
<constant>GL_SLUMINANCE8_ALPHA8</constant>
internal formats are only available if the GL version is 2.1 or greater. See <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry> for specific details about sRGB conversion.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
@ -338,7 +278,7 @@
<constant>GL_INVALID_VALUE</constant> may be generated if <parameter>level</parameter> is greater
than
<inlineequation><mml:math>
<!-- eqn: log sub 2 max:-->
<!-- eqn: log sub 2 max: -->
<mml:mrow>
<mml:msub><mml:mi mathvariant="italic">log</mml:mi>
<mml:mn>2</mml:mn>
@ -354,12 +294,12 @@
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>width</parameter> is less than 0
or greater than
2 + <constant>GL_MAX_TEXTURE_SIZE</constant>.
<constant>GL_MAX_TEXTURE_SIZE</constant>.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if non-power-of-two textures are not supported and the <parameter>width</parameter> or <parameter>depth</parameter> cannot be represented as
<inlineequation><mml:math>
<!-- eqn: 2 sup k + 2 ( border ):-->
<!-- eqn: 2 sup k + 2 ( border ): -->
<mml:mrow>
<mml:msup><mml:mn>2</mml:mn>
<mml:mi mathvariant="italic">k</mml:mi>
@ -384,11 +324,6 @@
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>internalformat</parameter> is not an
accepted format.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glCopyTexImage2D</function> is executed
between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding
execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>internalformat</parameter> is
<constant>GL_DEPTH_COMPONENT</constant>, <constant>GL_DEPTH_COMPONENT16</constant>,
@ -400,20 +335,13 @@
<para>
<citerefentry><refentrytitle>glGetTexImage</refentrytitle></citerefentry>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_2D</constant> or <constant>GL_TEXTURE_CUBE_MAP</constant>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glCopyPixels</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexEnv</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexGen</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexSubImage1D</refentrytitle></citerefentry>,

View file

@ -92,7 +92,7 @@
length <parameter>width</parameter> replaces the portion of the
texture array with x indices <parameter>xoffset</parameter> through
<inlineequation><mml:math>
<!-- eqn: xoffset + width - 1:-->
<!-- eqn: xoffset + width - 1: -->
<mml:mrow>
<mml:mi mathvariant="italic">xoffset</mml:mi>
<mml:mo>+</mml:mo>
@ -107,11 +107,11 @@
</para>
<para>
The pixels in the row are processed exactly as if
<citerefentry><refentrytitle>glCopyPixels</refentrytitle></citerefentry> had been called, but the process stops just before
<citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry> had been called, but the process stops just before
final conversion.
At this point, all pixel component values are clamped to the range
<inlineequation><mml:math>
<!-- eqn: [0,1]:-->
<!-- eqn: [0,1]: -->
<mml:mfenced open="[" close="]">
<mml:mn>0</mml:mn>
<mml:mn>1</mml:mn>
@ -135,19 +135,7 @@
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glCopyTexSubImage1D</function> is available only if the GL version is 1.1 or greater.
</para>
<para>
Texturing has no effect in color index mode.
</para>
<para>
<citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry> modes affect texture images
in exactly the way they affect <citerefentry><refentrytitle>glDrawPixels</refentrytitle></citerefentry>.
</para>
<para>
When the <code>ARB_imaging</code> extension is supported, the RGBA components
copied from the framebuffer may be processed by the imaging pipeline. See
<citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry> for specific details.
The <citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry> mode affects texture images.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
@ -164,7 +152,7 @@
<para>
<constant>GL_INVALID_VALUE</constant> may be generated if
<inlineequation><mml:math>
<!-- eqn: level > log sub 2(max):-->
<!-- eqn: level > log sub 2(max): -->
<mml:mrow>
<mml:mi mathvariant="italic">level</mml:mi>
<mml:mo>&gt;</mml:mo>
@ -184,7 +172,7 @@
<para>
<constant>GL_INVALID_VALUE</constant> is generated if
<inlineequation><mml:math>
<!-- eqn: xoffset < -b:-->
<!-- eqn: xoffset < -b: -->
<mml:mrow>
<mml:mi mathvariant="italic">xoffset</mml:mi>
<mml:mo>&lt;</mml:mo>
@ -196,7 +184,7 @@
</mml:math></inlineequation>,
or
<inlineequation><mml:math>
<!-- eqn: (xoffset + width) > (w-b):-->
<!-- eqn: (xoffset + width) > (w-b): -->
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
@ -232,22 +220,15 @@
<para>
<citerefentry><refentrytitle>glGetTexImage</refentrytitle></citerefentry>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_1D</constant>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glCopyPixels</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glReadBuffer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexEnv</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexGen</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>,

View file

@ -114,7 +114,7 @@
<para>
The screen-aligned pixel rectangle with lower left corner at
<inlineequation><mml:math>
<!-- eqn: (x, y):-->
<!-- eqn: (x, y): -->
<mml:mfenced open="(" close=")">
<mml:mi mathvariant="italic">x</mml:mi>
<mml:mi mathvariant="italic">y</mml:mi>
@ -124,7 +124,7 @@
width <parameter>width</parameter> and height <parameter>height</parameter> replaces the portion of the
texture array with x indices <parameter>xoffset</parameter> through
<inlineequation><mml:math>
<!-- eqn: xoffset + width - 1:-->
<!-- eqn: xoffset + width - 1: -->
<mml:mrow>
<mml:mi mathvariant="italic">xoffset</mml:mi>
<mml:mo>+</mml:mo>
@ -135,7 +135,7 @@
</mml:math></inlineequation>,
inclusive, and y indices <parameter>yoffset</parameter> through
<inlineequation><mml:math>
<!-- eqn: yoffset + height - 1:-->
<!-- eqn: yoffset + height - 1: -->
<mml:mrow>
<mml:mi mathvariant="italic">yoffset</mml:mi>
<mml:mo>+</mml:mo>
@ -148,11 +148,11 @@
</para>
<para>
The pixels in the rectangle are processed exactly as if
<citerefentry><refentrytitle>glCopyPixels</refentrytitle></citerefentry> had been called, but the process stops just before
<citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry> had been called, but the process stops just before
final conversion.
At this point, all pixel component values are clamped to the range
<inlineequation><mml:math>
<!-- eqn: [0,1]:-->
<!-- eqn: [0,1]: -->
<mml:mfenced open="[" close="]">
<mml:mn>0</mml:mn>
<mml:mn>1</mml:mn>
@ -180,29 +180,7 @@
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glCopyTexSubImage2D</function> is available only if the GL version is 1.1 or greater.
</para>
<para>
<constant>GL_TEXTURE_CUBE_MAP_POSITIVE_X</constant>,
<constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_X</constant>,
<constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Y</constant>,
<constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Y</constant>,
<constant>GL_TEXTURE_CUBE_MAP_POSITIVE_Z</constant>,
<constant>GL_TEXTURE_CUBE_MAP_NEGATIVE_Z</constant>, or
<constant>GL_PROXY_TEXTURE_CUBE_MAP</constant> are available only if the GL version is 1.3
or greater.
</para>
<para>
Texturing has no effect in color index mode.
</para>
<para>
<citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry> modes affect texture images
in exactly the way they affect <citerefentry><refentrytitle>glDrawPixels</refentrytitle></citerefentry>.
</para>
<para>
When the <code>ARB_imaging</code> extension is supported, the RGBA components
read from the framebuffer may be processed by the imaging pipeline. See
<citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry> for specific details.
<citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry> modes affect texture images.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
@ -225,7 +203,7 @@
<para>
<constant>GL_INVALID_VALUE</constant> may be generated if
<inlineequation><mml:math>
<!-- eqn: level > log sub 2(max):-->
<!-- eqn: level > log sub 2(max): -->
<mml:mrow>
<mml:mi mathvariant="italic">level</mml:mi>
<mml:mo>&gt;</mml:mo>
@ -247,7 +225,7 @@
<para>
<constant>GL_INVALID_VALUE</constant> is generated if
<inlineequation><mml:math>
<!-- eqn: xoffset < -b:-->
<!-- eqn: xoffset < -b: -->
<mml:mrow>
<mml:mi mathvariant="italic">xoffset</mml:mi>
<mml:mo>&lt;</mml:mo>
@ -258,7 +236,7 @@
</mml:mrow>
</mml:math></inlineequation>,
<inlineequation><mml:math>
<!-- eqn: (xoffset + width) > (w - b):-->
<!-- eqn: (xoffset + width) > (w - b): -->
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
@ -278,7 +256,7 @@
</mml:mrow>
</mml:math></inlineequation>,
<inlineequation><mml:math>
<!-- eqn: yoffset < -b:-->
<!-- eqn: yoffset < -b: -->
<mml:mrow>
<mml:mi mathvariant="italic">yoffset</mml:mi>
<mml:mo>&lt;</mml:mo>
@ -290,7 +268,7 @@
</mml:math></inlineequation>,
or
<inlineequation><mml:math>
<!-- eqn: (yoffset + height) > (h - b):-->
<!-- eqn: (yoffset + height) > (h - b): -->
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
@ -324,32 +302,20 @@
<inlineequation><mml:math><mml:mi mathvariant="italic">h</mml:mi></mml:math></inlineequation>
include twice the border width.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glCopyTexSubImage2D</function> is executed
between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding
execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGetTexImage</refentrytitle></citerefentry>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_2D</constant>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glCopyPixels</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage3D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glReadBuffer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexEnv</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexGen</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>,

View file

@ -116,11 +116,11 @@
</para>
<para>
The screen-aligned pixel rectangle with lower left corner at
(<parameter>x</parameter>,\ <parameter>y</parameter>) and with
(<parameter>x</parameter>, <parameter>y</parameter>) and with
width <parameter>width</parameter> and height <parameter>height</parameter> replaces the portion of the
texture array with x indices <parameter>xoffset</parameter> through
<inlineequation><mml:math>
<!-- eqn: xoffset + width - 1:-->
<!-- eqn: xoffset + width - 1: -->
<mml:mrow>
<mml:mi mathvariant="italic">xoffset</mml:mi>
<mml:mo>+</mml:mo>
@ -131,7 +131,7 @@
</mml:math></inlineequation>,
inclusive, and y indices <parameter>yoffset</parameter> through
<inlineequation><mml:math>
<!-- eqn: yoffset + height - 1:-->
<!-- eqn: yoffset + height - 1: -->
<mml:mrow>
<mml:mi mathvariant="italic">yoffset</mml:mi>
<mml:mo>+</mml:mo>
@ -144,11 +144,11 @@
</para>
<para>
The pixels in the rectangle are processed exactly as if
<citerefentry><refentrytitle>glCopyPixels</refentrytitle></citerefentry> had been called, but the process stops just before
<citerefentry><refentrytitle>glReadPixels</refentrytitle></citerefentry> had been called, but the process stops just before
final conversion.
At this point, all pixel component values are clamped to the range
<inlineequation><mml:math>
<!-- eqn: [0,1]:-->
<!-- eqn: [0,1]: -->
<mml:mfenced open="[" close="]">
<mml:mn>0</mml:mn>
<mml:mn>1</mml:mn>
@ -176,20 +176,7 @@
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glCopyTexSubImage3D</function> is available only if the GL version is 1.2 or greater.
</para>
<para>
Texturing has no effect in color index mode.
</para>
<para>
<citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry> modes affect texture images
in exactly the way they affect <citerefentry><refentrytitle>glDrawPixels</refentrytitle></citerefentry>.
</para>
<para>
When the <code>ARB_imaging</code> extension is supported, the RGBA components
copied from the framebuffer may be processed by the imaging pipeline, as
if they were a two-dimensional texture. See <citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry> for
specific details.
<citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry> modes affect texture images.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
@ -206,7 +193,7 @@
<para>
<constant>GL_INVALID_VALUE</constant> may be generated if
<inlineequation><mml:math>
<!-- eqn: level > log sub 2(max):-->
<!-- eqn: level > log sub 2(max): -->
<mml:mrow>
<mml:mi mathvariant="italic">level</mml:mi>
<mml:mo>&gt;</mml:mo>
@ -228,7 +215,7 @@
<para>
<constant>GL_INVALID_VALUE</constant> is generated if
<inlineequation><mml:math>
<!-- eqn: xoffset < -b:-->
<!-- eqn: xoffset < -b: -->
<mml:mrow>
<mml:mi mathvariant="italic">xoffset</mml:mi>
<mml:mo>&lt;</mml:mo>
@ -239,7 +226,7 @@
</mml:mrow>
</mml:math></inlineequation>,
<inlineequation><mml:math>
<!-- eqn: (xoffset + width) > (w - b):-->
<!-- eqn: (xoffset + width) > (w - b): -->
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
@ -259,7 +246,7 @@
</mml:mrow>
</mml:math></inlineequation>,
<inlineequation><mml:math>
<!-- eqn: yoffset < -b:-->
<!-- eqn: yoffset < -b: -->
<mml:mrow>
<mml:mi mathvariant="italic">yoffset</mml:mi>
<mml:mo>&lt;</mml:mo>
@ -270,7 +257,7 @@
</mml:mrow>
</mml:math></inlineequation>,
<inlineequation><mml:math>
<!-- eqn: (yoffset + height) > (h - b):-->
<!-- eqn: (yoffset + height) > (h - b): -->
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
@ -290,7 +277,7 @@
</mml:mrow>
</mml:math></inlineequation>,
<inlineequation><mml:math>
<!-- eqn: zoffset < -b:-->
<!-- eqn: zoffset < -b: -->
<mml:mrow>
<mml:mi mathvariant="italic">zoffset</mml:mi>
<mml:mo>&lt;</mml:mo>
@ -302,7 +289,7 @@
</mml:math></inlineequation>,
or
<inlineequation><mml:math>
<!-- eqn: (zoffset + 1) > (d - b):-->
<!-- eqn: (zoffset + 1) > (d - b): -->
<mml:mrow>
<mml:mfenced open="(" close=")">
<mml:mrow>
@ -339,32 +326,20 @@
<inlineequation><mml:math><mml:mi mathvariant="italic">d</mml:mi></mml:math></inlineequation>
include twice the border width.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glCopyTexSubImage3D</function> is executed
between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding
execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGetTexImage</refentrytitle></citerefentry>
</para>
<para>
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_TEXTURE_3D</constant>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glCopyPixels</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexSubImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelStore</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPixelTransfer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glReadBuffer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexEnv</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexGen</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage3D</refentrytitle></citerefentry>,

View file

@ -46,10 +46,7 @@
context.</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para><function>glCreateProgram</function> is available only if
the GL version is 2.0 or greater.</para>
<para>Like display lists and texture objects, the name space for
<para>Like buffer and texture objects, the name space for
program objects may be shared across a set of contexts, as long
as the server sides of the contexts share the same address
space. If the name space is shared across contexts, any attached
@ -63,12 +60,6 @@
<refsect1 id="errors"><title>Errors</title>
<para>This function returns 0 if an error occurs creating the program object.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if
<function>glCreateProgram</function> is executed between the
execution of
<citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of
<citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para><citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>

View file

@ -24,7 +24,10 @@
<term><parameter>shaderType</parameter></term>
<listitem>
<para>Specifies the type of shader to be created.
Must be either <constant>GL_VERTEX_SHADER</constant>
Must be one of <constant>GL_VERTEX_SHADER</constant>,
<constant>GL_TESS_CONTROL_SHADER</constant>,
<constant>GL_TESS_EVALUATION_SHADER</constant>,
<constant>GL_GEOMETRY_SHADER</constant>,
or <constant>GL_FRAGMENT_SHADER</constant>.</para>
</listitem>
</varlistentry>
@ -35,27 +38,29 @@
shader object and returns a non-zero value by which it can be
referenced. A shader object is used to maintain the source code
strings that define a shader. <parameter>shaderType</parameter>
indicates the type of shader to be created. Two types of shaders
indicates the type of shader to be created. Five types of shader
are supported. A shader of type
<constant>GL_VERTEX_SHADER</constant> is a shader that is
intended to run on the programmable vertex processor and replace
the fixed functionality vertex processing in OpenGL. A shader of
intended to run on the programmable vertex processor.
A shader of type <constant>GL_TESS_CONTROL_SHADER</constant> is a shader that
is intended to run on the programmable tessellation processor in the control stage.
A shader of type <constant>GL_TESS_EVALUATION_SHADER</constant> is a shader that
is intended to run on the programmable tessellation processor in the evaluation stage.
A shader of type
<constant>GL_GEOMETRY_SHADER</constant> is a shader that is intended to
run on the programmable geometry processor. A shader of
type <constant>GL_FRAGMENT_SHADER</constant> is a shader that is
intended to run on the programmable fragment processor and
replace the fixed functionality fragment processing in
OpenGL.</para>
intended to run on the programmable fragment processor.</para>
<para>When created, a shader object's
<constant>GL_SHADER_TYPE</constant> parameter is set to either
<constant>GL_VERTEX_SHADER</constant> or
<constant>GL_FRAGMENT_SHADER</constant>, depending on the value
<constant>GL_VERTEX_SHADER</constant>, <constant>GL_TESS_CONTROL_SHADER</constant>,
<constant>GL_TESS_EVALUATION_SHADER</constant>, <constant>GL_GEOMETRY_SHADER</constant>
or <constant>GL_FRAGMENT_SHADER</constant>, depending on the value
of <parameter>shaderType</parameter>.</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para><function>glCreateShader</function> is available only if
the GL version is 2.0 or greater.</para>
<para>Like display lists and texture objects, the name space for
<para>Like buffer and texture objects, the name space for
shader objects may be shared across a set of contexts, as long
as the server sides of the contexts share the same address
space. If the name space is shared across contexts, any attached
@ -73,12 +78,6 @@
<para><constant>GL_INVALID_ENUM</constant> is generated if
<parameter>shaderType</parameter> is not an accepted value.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if
<function>glCreateShader</function> is executed between the
execution of
<citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of
<citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para><citerefentry><refentrytitle>glGetShader</refentrytitle></citerefentry>

View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glCreateShaderProgram">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glCreateShaderProgram</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glCreateShaderProgramv</refname>
<refpurpose>create a stand-alone program from an array of null-terminated source code strings</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>GLuint <function>glCreateShaderProgramv</function></funcdef>
<paramdef>GLenum <parameter>type</parameter></paramdef>
<paramdef>GLsizei <parameter>count</parameter></paramdef>
<paramdef>const char **<parameter>strings</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>type</parameter></term>
<listitem>
<para>
Specifies the type of shader to create.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>count</parameter></term>
<listitem>
<para>
Specifies the number of source code strings in the array <parameter>strings</parameter>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>strings</parameter></term>
<listitem>
<para>
Specifies the address of an array of pointers to source code strings from which to create the program object.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glCreateShaderProgram</function> creates a program object containing compiled and linked
shaders for a single stage specified by <parameter>type</parameter>. <parameter>strings</parameter>
refers to an array of <parameter>count</parameter> strings from which to create the shader executables.
</para>
<para>
<function>glCreateShaderProgram</function> is equivalent (assuming no errors are generated) to:
</para>
<programlisting><![CDATA[ const GLuint shader = glCreateShader(type);
if (shader) {
glShaderSource(shader, count, strings, NULL);
glCompileShader(shader);
const GLuint program = glCreateProgram();
if (program) {
GLint compiled = GL_FALSE;
glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
glProgramParameteri(program, GL_PROGRAM_SEPARABLE, GL_TRUE);
if (compiled) {
glAttachShader(program, shader);
glLinkProgram(program);
glDetachShader(program, shader);
}
/* append-shader-info-log-to-program-info-log */
}
glDeleteShader(shader);
return program;
} else {
return 0;
}]]></programlisting>
<para>
The program object created by <function>glCreateShaderProgram</function> has its <constant>GL_PROGRAM_SEPARABLE</constant>
status set to <constant>GL_TRUE</constant>.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>pipeline</parameter> is not
a name previously returned from a call to <citerefentry><refentrytitle>glGenProgramPipelines</refentrytitle></citerefentry>
or if such a name has been deleted by a call to
<citerefentry><refentrytitle>glDeleteProgramPipelines</refentrytitle></citerefentry>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>program</parameter> refers
to a program object that has not been successfully linked.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glCreateShader</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCreateProgram</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCompileShader</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glLinkProgram</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -68,11 +68,6 @@
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>mode</parameter> is not an accepted value.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glCullFace</function>
is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>

View file

@ -51,27 +51,17 @@
After a buffer object is deleted, it has no contents,
and its name is free for reuse (for example by <citerefentry><refentrytitle>glGenBuffers</refentrytitle></citerefentry>).
If a buffer object that is currently bound is deleted, the binding reverts
to 0 (the absence of any buffer object, which reverts to client memory usage).
to 0 (the absence of any buffer object).
</para>
<para>
<function>glDeleteBuffers</function> silently ignores 0's and names that do not correspond to
existing buffer objects.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glDeleteBuffers</function> is available only if the GL version is 1.5 or greater.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>n</parameter> is negative.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glDeleteBuffers</function> is executed
between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding
execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>

View file

@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glDeleteFramebuffers">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glDeleteFramebuffers</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glDeleteFramebuffers</refname>
<refpurpose>delete framebuffer objects</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDeleteFramebuffers</function></funcdef>
<paramdef>GLsizei <parameter>n</parameter></paramdef>
<paramdef>GLuint *<parameter>framebuffers</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<!-- eqn: ignoring delim $$ -->
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>n</parameter></term>
<listitem>
<para>
Specifies the number of framebuffer objects to be deleted.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>framebuffers</parameter></term>
<listitem>
<para>
A pointer to an array containing <parameter>n</parameter> framebuffer objects to be deleted.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glDeleteFramebuffers</function> deletes the <parameter>n</parameter> framebuffer objects whose names are stored in
the array addressed by <parameter>framebuffers</parameter>. The name zero is reserved by the GL and is silently ignored, should it
occur in <parameter>framebuffers</parameter>, as are other unused names. Once a framebuffer object is deleted, its name is again
unused and it has no attachments. If a framebuffer that is currently bound to one or more of the targets <constant>GL_DRAW_FRAMEBUFFER</constant>
or <constant>GL_READ_FRAMEBUFFER</constant> is deleted, it is as though <citerefentry><refentrytitle>glBindFramebuffer</refentrytitle></citerefentry>
had been executed with the corresponding <parameter>target</parameter> and <parameter>framebuffer</parameter> zero.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>n</parameter> is negative.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glGenFramebuffers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBindFramebuffer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCheckFramebufferStatus</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -1,89 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glDeleteProgram">
<refmeta>
<refentrytitle>glDeleteProgram</refentrytitle>
<manvolnum>3G</manvolnum>
<refentrytitle>glDeleteProgram</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glDeleteProgram</refname>
<refpurpose>Deletes a program object</refpurpose>
<refname>glDeleteProgram</refname>
<refpurpose>Deletes a program object</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDeleteProgram</function></funcdef>
<paramdef>GLuint <parameter>program</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDeleteProgram</function></funcdef>
<paramdef>GLuint <parameter>program</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>program</parameter></term>
<listitem>
<para>Specifies the program object to be
deleted.</para>
</listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term><parameter>program</parameter></term>
<listitem>
<para>Specifies the program object to be
deleted.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para><function>glDeleteProgram</function> frees the memory and
invalidates the name associated with the program object
specified by <parameter>program.</parameter> This command
effectively undoes the effects of a call to
<citerefentry><refentrytitle>glCreateProgram</refentrytitle></citerefentry>.</para>
<para><function>glDeleteProgram</function> frees the memory and
invalidates the name associated with the program object
specified by <parameter>program.</parameter> This command
effectively undoes the effects of a call to
<citerefentry><refentrytitle>glCreateProgram</refentrytitle></citerefentry>.</para>
<para>If a program object is in use as part of current rendering
state, it will be flagged for deletion, but it will not be
deleted until it is no longer part of current state for any
rendering context. If a program object to be deleted has shader
objects attached to it, those shader objects will be
automatically detached but not deleted unless they have already
been flagged for deletion by a previous call to
<citerefentry><refentrytitle>glDeleteShader</refentrytitle></citerefentry>.
A value of 0 for <parameter>program</parameter> will be silently
ignored.</para>
<para>If a program object is in use as part of current rendering
state, it will be flagged for deletion, but it will not be
deleted until it is no longer part of current state for any
rendering context. If a program object to be deleted has shader
objects attached to it, those shader objects will be
automatically detached but not deleted unless they have already
been flagged for deletion by a previous call to
<citerefentry><refentrytitle>glDeleteShader</refentrytitle></citerefentry>.
A value of 0 for <parameter>program</parameter> will be silently
ignored.</para>
<para>To determine whether a program object has been flagged for
deletion, call
<citerefentry><refentrytitle>glGetProgram</refentrytitle></citerefentry>
with arguments <parameter>program</parameter> and
<constant>GL_DELETE_STATUS</constant>.</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para><function>glDeleteProgram</function> is available only if
the GL version is 2.0 or greater.</para>
<para>To determine whether a program object has been flagged for
deletion, call
<citerefentry><refentrytitle>glGetProgram</refentrytitle></citerefentry>
with arguments <parameter>program</parameter> and
<constant>GL_DELETE_STATUS</constant>.</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para><constant>GL_INVALID_VALUE</constant> is generated if
<parameter>program</parameter> is not a value generated by
OpenGL.</para>
<para><constant>GL_INVALID_VALUE</constant> is generated if
<parameter>program</parameter> is not a value generated by
OpenGL.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if
<function>glDeleteProgram</function> is executed between the
execution of
<citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of
<citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para><citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>
with argument <constant>GL_CURRENT_PROGRAM</constant></para>
<para><citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>
with argument <constant>GL_CURRENT_PROGRAM</constant></para>
<para><citerefentry><refentrytitle>glGetProgram</refentrytitle></citerefentry>
with arguments <parameter>program</parameter> and
<constant>GL_DELETE_STATUS</constant></para>
<para><citerefentry><refentrytitle>glGetProgram</refentrytitle></citerefentry>
with arguments <parameter>program</parameter> and
<constant>GL_DELETE_STATUS</constant></para>
<para><citerefentry><refentrytitle>glIsProgram</refentrytitle></citerefentry></para>
<para><citerefentry><refentrytitle>glIsProgram</refentrytitle></citerefentry></para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para><citerefentry><refentrytitle>glCreateShader</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDetachShader</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glUseProgram</refentrytitle></citerefentry>
</para>
<para><citerefentry><refentrytitle>glCreateShader</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDetachShader</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glUseProgram</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>

View file

@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glDeleteProgramPipelines">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group.</holder>
</copyright>
</refmetainfo>
<refentrytitle>c</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glDeleteProgramPipelines</refname>
<refpurpose>delete program pipeline objects</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDeleteProgramPipelines</function></funcdef>
<paramdef>GLsizei <parameter>n</parameter></paramdef>
<paramdef>const GLuint *<parameter>pipelines</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<!-- eqn: ignoring delim $$ -->
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>n</parameter></term>
<listitem>
<para>
Specifies the number of program pipeline objects to delete.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>pipelines</parameter></term>
<listitem>
<para>
Specifies an array of names of program pipeline objects to delete.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glDeleteProgramPipelines</function> deletes the <parameter>n</parameter> program pipeline objects
whose names are stored in the array <parameter>pipelines</parameter>. Unused names in <parameter>pipelines</parameter> are
ignored, as is the name zero. After a program pipeline object is deleted, its name is again unused and it
has no contents. If program pipeline object that is currently bound is deleted, the binding for that object reverts to
zero and no program pipeline object becomes current.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_PROGRAM_PIPELINE_BINDING</constant>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glGenProgramPipelines</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBindProgramPipeline</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIsProgramPipeline</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glUseShaderPrograms</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glUseProgram</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -56,11 +56,6 @@
existing query objects.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glDeleteQueries</function> is available only if the GL version is 1.5 or greater.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>n</parameter> is negative.
@ -70,11 +65,6 @@
between the execution of <citerefentry><refentrytitle>glBeginQuery</refentrytitle></citerefentry> and the corresponding
execution of <citerefentry><refentrytitle>glEndQuery</refentrytitle></citerefentry>.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glDeleteQueries</function> is executed
between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding
execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>

View file

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glDeleteFramebuffers">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glDeleteRenderbuffers</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glDeleteRenderbuffers</refname>
<refpurpose>delete renderbuffer objects</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDeleteRenderbuffers</function></funcdef>
<paramdef>GLsizei <parameter>n</parameter></paramdef>
<paramdef>GLuint *<parameter>renderbuffers</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<!-- eqn: ignoring delim $$ -->
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>n</parameter></term>
<listitem>
<para>
Specifies the number of renderbuffer objects to be deleted.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>renderbuffers</parameter></term>
<listitem>
<para>
A pointer to an array containing <parameter>n</parameter> renderbuffer objects to be deleted.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glDeleteRenderbuffers</function> deletes the <parameter>n</parameter> renderbuffer objects whose names are stored in
the array addressed by <parameter>renderbuffers</parameter>. The name zero is reserved by the GL and is silently ignored, should it
occur in <parameter>renderbuffers</parameter>, as are other unused names. Once a renderbuffer object is deleted, its name is again
unused and it has no contents. If a renderbuffer that is currently bound to the target <constant>GL_RENDERBUFFER</constant>
is deleted, it is as though <citerefentry><refentrytitle>glBindRenderbuffer</refentrytitle></citerefentry>
had been executed with a <parameter>target</parameter> of <constant>GL_RENDERBUFFER</constant> and a <parameter>name</parameter> of zero.
</para>
<para>
If a renderbuffer object is attached to one or more attachment points in the currently bound framebuffer, then it as if
<citerefentry><refentrytitle>glFramebufferRenderbuffer</refentrytitle></citerefentry> had been called, with a <parameter>renderbuffer</parameter>
of zero for each attachment point to which this image was attached in the currently bound framebuffer. In other words,
this renderbuffer object is first detached from all attachment ponits in the currently bound framebuffer. Note that the renderbuffer
image is specifically <emphasis>not</emphasis> detached from any non-bound framebuffers.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>n</parameter> is negative.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glGenRenderbuffers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glFramebufferRenderbuffer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glRenderbufferStorage</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glRenderbufferStorageMultisample</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glDeleteSamplers">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glDeleteSamplers</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glDeleteSamplers</refname>
<refpurpose>delete named sampler objects</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDeleteSamplers</function></funcdef>
<paramdef>GLsizei <parameter>n</parameter></paramdef>
<paramdef>const GLuint * <parameter>ids</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>n</parameter></term>
<listitem>
<para>
Specifies the number of sampler objects to be deleted.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>ids</parameter></term>
<listitem>
<para>
Specifies an array of sampler objects to be deleted.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glDeleteSamplers</function> deletes <parameter>n</parameter> sampler objects named by the elements of the array <parameter>ids</parameter>.
After a sampler object is deleted, its name is again unused. If a sampler object that is currently bound to a sampler unit is deleted, it is as
though <citerefentry><refentrytitle>glBindSampler</refentrytitle></citerefentry> is called with unit set to the unit the sampler is bound to and
sampler zero. Unused names in samplers are silently ignored, as is the reserved name zero.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glDeleteSamplers</function> is available only if the GL version is 3.3 or higher.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>n</parameter> is negative.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glIsSampler</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glGenSamplers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBindSampler</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDeleteSamplers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIsSampler</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -1,85 +1,75 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glDeleteShader">
<refmeta>
<refentrytitle>glDeleteShader</refentrytitle>
<manvolnum>3G</manvolnum>
<refentrytitle>glDeleteShader</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glDeleteShader</refname>
<refpurpose>Deletes a shader object</refpurpose>
<refname>glDeleteShader</refname>
<refpurpose>Deletes a shader object</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDeleteShader</function></funcdef>
<paramdef>GLuint <parameter>shader</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDeleteShader</function></funcdef>
<paramdef>GLuint <parameter>shader</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>shader</parameter></term>
<listitem>
<para>Specifies the shader object to be deleted.</para>
</listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term><parameter>shader</parameter></term>
<listitem>
<para>Specifies the shader object to be deleted.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para><function>glDeleteShader</function> frees the memory and
invalidates the name associated with the shader object specified
by <parameter>shader</parameter>. This command effectively
undoes the effects of a call to
<citerefentry><refentrytitle>glCreateShader</refentrytitle></citerefentry>.</para>
<para><function>glDeleteShader</function> frees the memory and
invalidates the name associated with the shader object specified
by <parameter>shader</parameter>. This command effectively
undoes the effects of a call to
<citerefentry><refentrytitle>glCreateShader</refentrytitle></citerefentry>.</para>
<para>If a shader object to be deleted is attached to a program
object, it will be flagged for deletion, but it will not be
deleted until it is no longer attached to any program object,
for any rendering context (i.e., it must be detached from
wherever it was attached before it will be deleted). A value of
0 for <parameter>shader</parameter> will be silently
ignored.</para>
<para>If a shader object to be deleted is attached to a program
object, it will be flagged for deletion, but it will not be
deleted until it is no longer attached to any program object,
for any rendering context (i.e., it must be detached from
wherever it was attached before it will be deleted). A value of
0 for <parameter>shader</parameter> will be silently
ignored.</para>
<para>To determine whether an object has been flagged for
deletion, call
<citerefentry><refentrytitle>glGetShader</refentrytitle></citerefentry>
with arguments <parameter>shader</parameter> and
<constant>GL_DELETE_STATUS</constant>.</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para><function>glDeleteShader</function> is available only if
the GL version is 2.0 or greater.</para>
<para>To determine whether an object has been flagged for
deletion, call
<citerefentry><refentrytitle>glGetShader</refentrytitle></citerefentry>
with arguments <parameter>shader</parameter> and
<constant>GL_DELETE_STATUS</constant>.</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para><constant>GL_INVALID_VALUE</constant> is generated if
<parameter>shader</parameter> is not a value generated by
OpenGL.</para>
<para><constant>GL_INVALID_VALUE</constant> is generated if
<parameter>shader</parameter> is not a value generated by
OpenGL.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if
<function>glDeleteShader</function> is executed between the
execution of
<citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of
<citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para><citerefentry><refentrytitle>glGetAttachedShaders</refentrytitle></citerefentry>
with the program object to be queried</para>
<para><citerefentry><refentrytitle>glGetAttachedShaders</refentrytitle></citerefentry>
with the program object to be queried</para>
<para><citerefentry><refentrytitle>glGetShader</refentrytitle></citerefentry>
with arguments <parameter>shader</parameter> and
<constant>GL_DELETE_STATUS</constant></para>
<para><citerefentry><refentrytitle>glGetShader</refentrytitle></citerefentry>
with arguments <parameter>shader</parameter> and
<constant>GL_DELETE_STATUS</constant></para>
<para><citerefentry><refentrytitle>glIsShader</refentrytitle></citerefentry></para>
<para><citerefentry><refentrytitle>glIsShader</refentrytitle></citerefentry></para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para><citerefentry><refentrytitle>glCreateProgram</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCreateShader</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDetachShader</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glUseProgram</refentrytitle></citerefentry></para>
<para><citerefentry><refentrytitle>glCreateProgram</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCreateShader</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDetachShader</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glUseProgram</refentrytitle></citerefentry></para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>

View file

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glDeleteSync">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glDeleteSync</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glDeleteSync</refname>
<refpurpose>delete a sync object</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDeleteSync</function></funcdef>
<paramdef>GLsync <parameter>sync</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<!-- eqn: ignoring delim $$ -->
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>sync</parameter></term>
<listitem>
<para>
The sync object to be deleted.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glDeleteSync</function> deletes the sync object specified by <parameter>sync</parameter>. If the fence command
corresponding to the specified sync object has completed, or if no <citerefentry><refentrytitle>glWaitSync</refentrytitle></citerefentry>
or <citerefentry><refentrytitle>glClientWaitSync</refentrytitle></citerefentry> commands are blocking on <parameter>sync</parameter>,
the object is deleted immediately. Otherwise, <parameter>sync</parameter> is flagged for deletion and will be deleted when
it is no longer associated with any fence command and is no longer blocking any <citerefentry><refentrytitle>glWaitSync</refentrytitle></citerefentry>
or <citerefentry><refentrytitle>glClientWaitSync</refentrytitle></citerefentry> command. In either case, after
<function>glDeleteSync</function> returns, the name <parameter>sync</parameter> is invalid and can no longer be used to
refer to the sync object.
</para>
<para>
<function>glDeleteSync</function> will silently ignore a <parameter>sync</parameter> value of zero.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glSync</function> is only supported if the GL version is 3.2 or greater, or if
the <code>ARB_sync</code> extension is supported.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>sync</parameter> is neither zero or the name of a sync object.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glFenceSync</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glWaitSync</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glClientWaitSync</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -58,20 +58,10 @@
existing textures.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glDeleteTextures</function> is available only if the GL version is 1.1 or greater.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>n</parameter> is negative.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glDeleteTextures</function> is executed
between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding
execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
@ -80,14 +70,12 @@
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glAreTexturesResident</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBindTexture</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glCopyTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGenTextures</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGetTexParameter</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPrioritizeTextures</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage1D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexImage2D</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexParameter</refentrytitle></citerefentry>

View file

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glDeleteTransformFeedbacks">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group.</holder>
</copyright>
</refmetainfo>
<refentrytitle>glDeleteTransformFeedbacks</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glDeleteTransformFeedbacks</refname>
<refpurpose>delete transform feedback objects</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDeleteTransformFeedbacks</function></funcdef>
<paramdef>GLsizei <parameter>n</parameter></paramdef>
<paramdef>const GLuint *<parameter>ids</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<!-- eqn: ignoring delim $$ -->
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>n</parameter></term>
<listitem>
<para>
Specifies the number of transform feedback objects to delete.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>ids</parameter></term>
<listitem>
<para>
Specifies an array of names of transform feedback objects to delete.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glDeleteTransformFeedbacks</function> deletes the <parameter>n</parameter> transform feedback objects
whose names are stored in the array <parameter>ids</parameter>. Unused names in <parameter>ids</parameter> are
ignored, as is the name zero. After a transform feedback object is deleted, its name is again unused and it
has no contents. If an active transform feedback object is deleted, its name immediately becomes unused, but
the underlying object is not deleted until it is no longer active.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_TRANSFORM_FEEDBACK_BINDING</constant>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glGenTransformFeedbacks</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBindTransformFeedback</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIsTransformFeedback</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBeginTransformFeedback</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPauseTransformFeedback</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glResumeTransformFeedback</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glEndTransformFeedback</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -0,0 +1,77 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glDeleteVertexArrays">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glDeleteVertexArrays</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glDeleteVertexArrays</refname>
<refpurpose>delete vertex array objects</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDeleteVertexArrays</function></funcdef>
<paramdef>GLsizei <parameter>n</parameter></paramdef>
<paramdef>const GLuint *<parameter>arrays</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<!-- eqn: ignoring delim $$ -->
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>n</parameter></term>
<listitem>
<para>
Specifies the number of vertex array objects to be deleted.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>arrays</parameter></term>
<listitem>
<para>
Specifies the address of an array containing the <parameter>n</parameter> names of the objects to be deleted.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glDeleteVertexArrays</function> deletes <parameter>n</parameter> vertex array objects whose names are stored in the
array addressed by <parameter>arrays</parameter>. Once a vertex array object is deleted it has no contents and its name is
again unused. If a vertex array object that is currently bound is deleted, the binding for that object reverts to zero
and the default vertex array becomes current. Unused names in <parameter>arrays</parameter> are silently ignored, as is the value zero.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>n</parameter> is negative.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glGenVertexArrays</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIsVertexArray</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glBindVertexArray</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -134,18 +134,15 @@
<refsect1 id="notes"><title>Notes</title>
<para>
Even if the depth buffer exists and the depth mask is non-zero, the
depth buffer is not updated if the depth test is disabled.
depth buffer is not updated if the depth test is disabled. In order to
unconditionally write to the depth buffer, the depth test should be enabled
and set to <constant>GL_ALWAYS</constant>.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>func</parameter> is not an accepted value.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glDepthFunc</function>
is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>

View file

@ -49,13 +49,6 @@
Initially, depth buffer writing is enabled.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glDepthMask</function>
is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_DEPTH_WRITEMASK</constant>
@ -66,7 +59,6 @@
<citerefentry><refentrytitle>glColorMask</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDepthFunc</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDepthRange</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIndexMask</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glStencilMask</refentrytitle></citerefentry>
</para>
</refsect1>

View file

@ -23,6 +23,11 @@
<paramdef>GLclampd <parameter>nearVal</parameter></paramdef>
<paramdef>GLclampd <parameter>farVal</parameter></paramdef>
</funcprototype>
<funcprototype>
<funcdef>void <function>glDepthRangef</function></funcdef>
<paramdef>GLclampf <parameter>nearVal</parameter></paramdef>
<paramdef>GLclampf <parameter>farVal</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<!-- eqn: ignoring delim $$ -->
@ -53,7 +58,7 @@
After clipping and division by <emphasis>w</emphasis>,
depth coordinates range from
<inlineequation><mml:math>
<!-- eqn: -1:-->
<!-- eqn: -1: -->
<mml:mn>-1</mml:mn>
</mml:math></inlineequation>
to 1,
@ -79,7 +84,7 @@
It is not necessary that <parameter>nearVal</parameter> be less than <parameter>farVal</parameter>.
Reverse mappings such as
<inlineequation><mml:math>
<!-- eqn: nearVal = 1:-->
<!-- eqn: nearVal = 1: -->
<mml:mrow>
<mml:mi mathvariant="italic">nearVal</mml:mi>
<mml:mo>=</mml:mo>
@ -88,7 +93,7 @@
</mml:math></inlineequation>,
and
<inlineequation><mml:math>
<!-- eqn: farVal = 0:-->
<!-- eqn: farVal = 0: -->
<mml:mrow>
<mml:mi mathvariant="italic">farVal</mml:mi>
<mml:mo>=</mml:mo>
@ -98,13 +103,6 @@
are acceptable.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glDepthRange</function>
is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_DEPTH_RANGE</constant>

View file

@ -0,0 +1,153 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glDepthRangeArray">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glDepthRangeArray</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glDepthRangeArray</refname>
<refpurpose>specify mapping of depth values from normalized device coordinates to window coordinates for a specified set of viewports</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDepthRangeArrayv</function></funcdef>
<paramdef>GLuint <parameter>first</parameter></paramdef>
<paramdef>GLsizei <parameter>count</parameter></paramdef>
<paramdef>const GLclampd *<parameter>v</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<!-- eqn: ignoring delim $$ -->
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>first</parameter></term>
<listitem>
<para>
Specifies the index of the first viewport whose depth range to update.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>count</parameter></term>
<listitem>
<para>
Specifies the number of viewports whose depth range to update.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>v</parameter></term>
<listitem>
<para>
Specifies the address of an array containing the near and far values for the
depth range of each modified viewport.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
After clipping and division by <emphasis>w</emphasis>,
depth coordinates range from
<inlineequation><mml:math>
<!-- eqn: -1: -->
<mml:mn>-1</mml:mn>
</mml:math></inlineequation>
to 1,
corresponding to the near and far clipping planes.
Each viewport has an independent depth range specified as a linear mapping of the normalized
depth coordinates in this range to window depth coordinates.
Regardless of the actual depth buffer implementation,
window coordinate depth values are treated as though they range
from 0 through 1 (like color components).
<function>glDepthRangeArray</function> specifies a linear mapping of the normalized depth coordinates
in this range to window depth coordinates for each viewport in the range [<parameter>first</parameter>,
<parameter>first</parameter> + <parameter>count</parameter>).
Thus,
the values accepted by <function>glDepthRangeArray</function> are both clamped to this range
before they are accepted.
</para>
<para>
The <parameter>first</parameter> parameter specifies the index of the first viewport whose depth
range to modify and must be less than the value of <constant>GL_MAX_VIEWPORTS</constant>.
<parameter>count</parameter> specifies the number of viewports whose depth range to modify.
<parameter>first</parameter> + <parameter>count</parameter> must be less than or equal to
the value of <constant>GL_MAX_VIEWPORTS</constant>. <parameter>v</parameter> specifies the address of an
array of pairs of double precision floating point values representing the near and far values of the
depth range for each viewport, in that order.
</para>
<para>
The setting of (0,1) maps the near plane to 0 and
the far plane to 1.
With this mapping,
the depth buffer range is fully utilized.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
It is not necessary that the near plane distance be less than the far plane distance.
Reverse mappings such as
<inlineequation><mml:math>
<!-- eqn: nearVal = 1: -->
<mml:mrow>
<mml:mi mathvariant="italic">near</mml:mi>
<mml:mo>=</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:math></inlineequation>,
and
<inlineequation><mml:math>
<!-- eqn: farVal = 0: -->
<mml:mrow>
<mml:mi mathvariant="italic">far</mml:mi>
<mml:mo>=</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:math></inlineequation>
are acceptable.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>first</parameter> is greater than or equal to
the value of <constant>GL_MAX_VIEWPORTS</constant>.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>first</parameter> + <parameter>count</parameter>
is greater than or equal to the value of <constant>GL_MAX_VIEWPORTS</constant>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_DEPTH_RANGE</constant>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glDepthFunc</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDepthRange</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPolygonOffset</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glViewportArray</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glViewport</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -0,0 +1,147 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glDepthRangeArray">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glDepthRangeIndexed</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glDepthRangeIndexed</refname>
<refpurpose>specify mapping of depth values from normalized device coordinates to window coordinates for a specified viewport</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDepthRangeArrayv</function></funcdef>
<paramdef>GLuint <parameter>index</parameter></paramdef>
<paramdef>GLclampd <parameter>nearVal</parameter></paramdef>
<paramdef>GLclampd <parameter>farVal</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<!-- eqn: ignoring delim $$ -->
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>index</parameter></term>
<listitem>
<para>
Specifies the index of the viewport whose depth range to update.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>nearVal</parameter></term>
<listitem>
<para>
Specifies the mapping of the near clipping plane to window coordinates.
The initial value is 0.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>farVal</parameter></term>
<listitem>
<para>
Specifies the mapping of the far clipping plane to window coordinates.
The initial value is 1.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
After clipping and division by <emphasis>w</emphasis>,
depth coordinates range from
<inlineequation><mml:math>
<!-- eqn: -1: -->
<mml:mn>-1</mml:mn>
</mml:math></inlineequation>
to 1,
corresponding to the near and far clipping planes.
Each viewport has an independent depth range specified as a linear mapping of the normalized
depth coordinates in this range to window depth coordinates.
Regardless of the actual depth buffer implementation,
window coordinate depth values are treated as though they range
from 0 through 1 (like color components).
<function>glDepthRangeIndexed</function> specifies a linear mapping of the normalized depth coordinates
in this range to window depth coordinates for a specified viewport.
Thus,
the values accepted by <function>glDepthRangeArray</function> are both clamped to this range
before they are accepted.
</para>
<para>
The <parameter>index</parameter> parameter specifies the index of first viewport whose depth
range to modify and must be less than the value of <constant>GL_MAX_VIEWPORTS</constant>.
<parameter>nearVal</parameter> and <parameter>farVal</parameter> specify near and far values of the
depth range for the specified viewport, respectively.
</para>
<para>
The setting of (0,1) maps the near plane to 0 and
the far plane to 1.
With this mapping,
the depth buffer range is fully utilized.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
It is not necessary that the near plane distance be less than the far plane distance.
Reverse mappings such as
<inlineequation><mml:math>
<!-- eqn: nearVal = 1: -->
<mml:mrow>
<mml:mi mathvariant="italic">nearVal</mml:mi>
<mml:mo>=</mml:mo>
<mml:mn>1</mml:mn>
</mml:mrow>
</mml:math></inlineequation>,
and
<inlineequation><mml:math>
<!-- eqn: farVal = 0: -->
<mml:mrow>
<mml:mi mathvariant="italic">farVal</mml:mi>
<mml:mo>=</mml:mo>
<mml:mn>0</mml:mn>
</mml:mrow>
</mml:math></inlineequation>
are acceptable.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>index</parameter> is greater than or equal to
the value of <constant>GL_MAX_VIEWPORTS</constant>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_DEPTH_RANGE</constant>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glDepthFunc</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDepthRange</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDepthRangeArray</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glPolygonOffset</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glViewportArray</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glViewport</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -1,95 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glDetachShader">
<refmeta>
<refentrytitle>glDetachShader</refentrytitle>
<manvolnum>3G</manvolnum>
<refentrytitle>glDetachShader</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glDetachShader</refname>
<refpurpose>Detaches a shader object from a program object to which it is attached</refpurpose>
<refname>glDetachShader</refname>
<refpurpose>Detaches a shader object from a program object to which it is attached</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDetachShader</function></funcdef>
<paramdef>GLuint <parameter>program</parameter></paramdef>
<paramdef>GLuint <parameter>shader</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDetachShader</function></funcdef>
<paramdef>GLuint <parameter>program</parameter></paramdef>
<paramdef>GLuint <parameter>shader</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>program</parameter></term>
<listitem>
<para>Specifies the program object from which to
detach the shader object.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>shader</parameter></term>
<listitem>
<para>Specifies the shader object to be
detached.</para>
</listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term><parameter>program</parameter></term>
<listitem>
<para>Specifies the program object from which to
detach the shader object.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>shader</parameter></term>
<listitem>
<para>Specifies the shader object to be
detached.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para><function>glDetachShader</function> detaches the shader
object specified by <parameter>shader</parameter> from the
program object specified by <parameter>program</parameter>. This
command can be used to undo the effect of the command
<citerefentry><refentrytitle>glAttachShader</refentrytitle></citerefentry>.</para>
<para><function>glDetachShader</function> detaches the shader
object specified by <parameter>shader</parameter> from the
program object specified by <parameter>program</parameter>. This
command can be used to undo the effect of the command
<citerefentry><refentrytitle>glAttachShader</refentrytitle></citerefentry>.</para>
<para>If <parameter>shader</parameter> has already been flagged
for deletion by a call to
<citerefentry><refentrytitle>glDeleteShader</refentrytitle></citerefentry>
and it is not attached to any other program object, it will be
deleted after it has been detached.</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para><function>glDetachShader</function> is available only if
the GL version is 2.0 or greater.</para>
<para>If <parameter>shader</parameter> has already been flagged
for deletion by a call to
<citerefentry><refentrytitle>glDeleteShader</refentrytitle></citerefentry>
and it is not attached to any other program object, it will be
deleted after it has been detached.</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para><constant>GL_INVALID_VALUE</constant> is generated if either
<parameter>program</parameter> or <parameter>shader</parameter>
is a value that was not generated by OpenGL.</para>
<para><constant>GL_INVALID_VALUE</constant> is generated if either
<parameter>program</parameter> or <parameter>shader</parameter>
is a value that was not generated by OpenGL.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if
<parameter>program</parameter> is not a program object.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if
<parameter>program</parameter> is not a program object.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if
<parameter>shader</parameter> is not a shader object.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if
<parameter>shader</parameter> is not a shader object.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if
<parameter>shader</parameter> is not attached to
<parameter>program</parameter>.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if
<parameter>shader</parameter> is not attached to
<parameter>program</parameter>.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if
<function>glDetachShader</function> is executed between the
execution of
<citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of
<citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para><citerefentry><refentrytitle>glGetAttachedShaders</refentrytitle></citerefentry>
with the handle of a valid program object</para>
<para><citerefentry><refentrytitle>glGetAttachedShaders</refentrytitle></citerefentry>
with the handle of a valid program object</para>
<para><citerefentry><refentrytitle>glGetShader</refentrytitle></citerefentry>
with arguments <parameter>shader</parameter> and
<constant>GL_DELETE_STATUS</constant></para>
<para><citerefentry><refentrytitle>glGetShader</refentrytitle></citerefentry>
with arguments <parameter>shader</parameter> and
<constant>GL_DELETE_STATUS</constant></para>
<para><citerefentry><refentrytitle>glIsProgram</refentrytitle></citerefentry></para>
<para><citerefentry><refentrytitle>glIsProgram</refentrytitle></citerefentry></para>
<para><citerefentry><refentrytitle>glIsShader</refentrytitle></citerefentry></para>
<para><citerefentry><refentrytitle>glIsShader</refentrytitle></citerefentry></para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para><citerefentry><refentrytitle>glAttachShader</refentrytitle></citerefentry></para>
<para><citerefentry><refentrytitle>glAttachShader</refentrytitle></citerefentry></para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>

View file

@ -39,12 +39,14 @@
<constant>GL_LINE_STRIP</constant>,
<constant>GL_LINE_LOOP</constant>,
<constant>GL_LINES</constant>,
<constant>GL_LINE_STRIP_ADJACENCY</constant>,
<constant>GL_LINES_ADJACENCY</constant>,
<constant>GL_TRIANGLE_STRIP</constant>,
<constant>GL_TRIANGLE_FAN</constant>,
<constant>GL_TRIANGLES</constant>,
<constant>GL_QUAD_STRIP</constant>,
<constant>GL_QUADS</constant>,
and <constant>GL_POLYGON</constant> are accepted.
<constant>GL_TRIANGLE_STRIP_ADJACENCY</constant>,
<constant>GL_TRIANGLES_ADJACENCY</constant> and <constant>GL_PATCHES</constant>
are accepted.
</para>
</listitem>
</varlistentry>
@ -81,29 +83,21 @@
enabled array to construct a sequence of geometric primitives,
beginning with element <parameter>first</parameter>. <parameter>mode</parameter> specifies what kind of
primitives are constructed and how the array elements
construct those primitives. If <constant>GL_VERTEX_ARRAY</constant> is not enabled, no
geometric primitives are generated.
construct those primitives.
</para>
<para>
Vertex attributes that are modified by <function>glDrawArrays</function> have an
unspecified value after <function>glDrawArrays</function> returns. For example, if
<constant>GL_COLOR_ARRAY</constant> is enabled, the value of the current color is
undefined after <function>glDrawArrays</function> executes. Attributes that aren't
unspecified value after <function>glDrawArrays</function> returns. Attributes that aren't
modified remain well defined.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glDrawArrays</function> is available only if the GL version is 1.1 or greater.
</para>
<para>
<function>glDrawArrays</function> is included in display lists. If <function>glDrawArrays</function> is entered into a
display list,
the necessary array data (determined by the array pointers and
enables) is also
entered into the display list. Because the array pointers and
enables are client-side state, their values affect display lists
when the lists are created, not when the lists are executed.
<constant>GL_LINE_STRIP_ADJACENCY</constant>,
<constant>GL_LINES_ADJACENCY</constant>,
<constant>GL_TRIANGLE_STRIP_ADJACENCY</constant> and
<constant>GL_TRIANGLES_ADJACENCY</constant>
are available only if the GL version is 3.2 or greater.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
@ -118,25 +112,15 @@
enabled array and the buffer object's data store is currently mapped.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glDrawArrays</function> is executed between
the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
<constant>GL_INVALID_OPERATION</constant> is generated if a geometry shader is active and <parameter>mode</parameter>
is incompatible with the input primitive type of the geometry shader in the currently installed program object.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glArrayElement</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glColorPointer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawArraysInstanced</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawElements</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawRangeElements</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glEdgeFlagPointer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glFogCoordPointer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGetPointerv</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIndexPointer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glInterleavedArrays</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glNormalPointer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glSecondaryColorPointer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexCoordPointer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glVertexPointer</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>

View file

@ -0,0 +1,135 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glDrawArraysIndirect">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group.</holder>
</copyright>
</refmetainfo>
<refentrytitle>glDrawTransformFeedback</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glDrawArraysIndirect</refname>
<refpurpose>render primitives from array data, taking parameters from memory</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDrawArraysIndirect</function></funcdef>
<paramdef>GLenum <parameter>mode</parameter></paramdef>
<paramdef>const void *<parameter>indirect</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<!-- eqn: ignoring delim $$ -->
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
Specifies what kind of primitives to render.
Symbolic constants
<constant>GL_POINTS</constant>,
<constant>GL_LINE_STRIP</constant>,
<constant>GL_LINE_LOOP</constant>,
<constant>GL_LINES</constant>,
<constant>GL_LINE_STRIP_ADJACENCY</constant>,
<constant>GL_LINES_ADJACENCY</constant>,
<constant>GL_TRIANGLE_STRIP</constant>,
<constant>GL_TRIANGLE_FAN</constant>,
<constant>GL_TRIANGLES</constant>,
<constant>GL_TRIANGLE_STRIP_ADJACENCY</constant>,
<constant>GL_TRIANGLES_ADJACENCY</constant>, and
<constant>GL_PATCHES</constant>
are accepted.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>indirect</parameter></term>
<listitem>
<para>
Specifies the address of a structure containing the draw parameters.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glDrawArraysIndirect</function> specifies multiple geometric primitives
with very few subroutine calls. <function>glDrawArraysIndirect</function> behaves
similarly to <citerefentry><refentrytitle>glDrawArraysInstanced</refentrytitle></citerefentry>,
execpt that the parameters to <citerefentry><refentrytitle>glDrawArraysInstanced</refentrytitle></citerefentry>
are stored in memory at the address given by <parameter>indirect</parameter>.
</para>
<para>
The parameters addressed by <parameter>indirect</parameter> are packed into a structure
that takes the form (in C):
<programlisting><![CDATA[ typedef struct {
uint count;
uint primCount;
uint first;
uint reservedMustBeZero;
} DrawArraysIndirectCommand;
const DrawArraysIndirectCommand *cmd = (const DrawArraysIndirectCommand *)indirect;
glDrawArraysInstanced(mode, cmd->first, cmd->count, cmd->primCount);]]></programlisting>
</para>
<para>
If a buffer is bound to the <constant>GL_INDIRECT_BUFFER</constant> binding at the time
of a call to <function>glDrawArraysIndirect</function>, <parameter>indirect</parameter>
is interpreted as an offset, in basic machine units, into that buffer and the parameter
data is read from the buffer rather than from client memory.
</para>
<para>
In contrast to <citerefentry><refentrytitle>glDrawArraysInstanced</refentrytitle></citerefentry>,
the <code>first</code> member of the parameter structure is unsigned, and out-of-range indices
do not generate an error. The results of the operation are undefined if the <code>reservedMustBeZero</code> member
of the parameter structure is non-zero. However, no error is generated in this case.
</para>
<para>
Vertex attributes that are modified by <function>glDrawArraysIndirect</function> have an
unspecified value after <function>glDrawArraysIndirect</function> returns. Attributes that aren't
modified remain well defined.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>mode</parameter> is not an accepted value.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to an
enabled array or to the <constant>GL_INDIRECT_BUFFER</constant> binding and the buffer object's data store is currently mapped.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if a geometry shader is active and <parameter>mode</parameter>
is incompatible with the input primitive type of the geometry shader in the currently installed program object.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>mode</parameter> is <constant>GL_PATCHES</constant>
and no tessellation control shader is active.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawArraysInstanced</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawElements</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawRangeElements</refentrytitle></citerefentry>,
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -0,0 +1,122 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glDrawArraysInstanced">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glDrawArraysInstanced</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glDrawArraysInstanced</refname>
<refpurpose>draw multiple instances of a range of elements</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDrawArraysInstanced</function></funcdef>
<paramdef>GLenum <parameter>mode</parameter></paramdef>
<paramdef>GLint <parameter>first</parameter></paramdef>
<paramdef>GLsizei <parameter>count</parameter></paramdef>
<paramdef>GLsizei <parameter>primcount</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
Specifies what kind of primitives to render. Symbolic constants <constant>GL_POINTS</constant>,
<constant>GL_LINE_STRIP</constant>, <constant>GL_LINE_LOOP</constant>, <constant>GL_LINES</constant>,
<constant>GL_TRIANGLE_STRIP</constant>, <constant>GL_TRIANGLE_FAN</constant>, <constant>GL_TRIANGLES</constant>
<constant>GL_LINES_ADJACENCY</constant>, <constant>GL_LINE_STRIP_ADJACENCY</constant>,
<constant>GL_TRIANGLES_ADJACENCY</constant>, <constant>GL_TRIANGLE_STRIP_ADJACENCY</constant> and <constant>GL_PATCHES</constant>
are accepted.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>first</parameter></term>
<listitem>
<para>
Specifies the starting index in the enabled arrays.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>count</parameter></term>
<listitem>
<para>
Specifies the number of indices to be rendered.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>primcount</parameter></term>
<listitem>
<para>
Specifies the number of instances of the specified range of indices to be rendered.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glDrawArraysInstanced</function> behaves identically to <citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry>
except that <parameter>primcount</parameter> instances of the range of elements are executed and the value of the internal counter
<parameter>instanceID</parameter> advances for each iteration. <parameter>instanceID</parameter> is an internal 32-bit integer counter
that may be read by a vertex shader as <constant>gl_InstanceID</constant>.
</para>
<para>
<function>glDrawArraysInstanced</function> has the same effect as:
<programlisting><![CDATA[ if ( mode or count is invalid )
generate appropriate error
else {
for (int i = 0; i < primcount ; i++) {
instanceID = i;
glDrawArrays(mode, first, count);
}
instanceID = 0;
}]]></programlisting>
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>mode</parameter> is not one of
the accepted values.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if a geometry shader is active and <parameter>mode</parameter>
is incompatible with the input primitive type of the geometry shader in the currently installed program object.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>count</parameter> or <parameter>primcount</parameter> are negative.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to an
enabled array and the buffer object's data store is currently mapped.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawElementsInstanced</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -41,12 +41,9 @@
<constant>GL_FRONT</constant>,
<constant>GL_BACK</constant>,
<constant>GL_LEFT</constant>,
<constant>GL_RIGHT</constant>,
<constant>GL_FRONT_AND_BACK</constant>, and
<constant>GL_AUX</constant><emphasis>i</emphasis>,
where <emphasis>i</emphasis> is between 0 and the value of <constant>GL_AUX_BUFFERS</constant> minus 1,
are accepted. (<constant>GL_AUX_BUFFERS</constant> is not the upper limit; use <citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>
to query the number of available aux buffers.)
<constant>GL_RIGHT</constant>, and
<constant>GL_FRONT_AND_BACK</constant>
are accepted.
The initial value is <constant>GL_FRONT</constant> for single-buffered contexts,
and <constant>GL_BACK</constant> for double-buffered contexts.
</para>
@ -157,14 +154,6 @@
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_AUX</constant><emphasis>i</emphasis></term>
<listitem>
<para>
Only auxiliary color buffer <emphasis>i</emphasis> is written.
</para>
</listitem>
</varlistentry>
</variablelist>
<para>
If more than one color buffer is selected for drawing,
@ -189,14 +178,6 @@
The context is selected at GL initialization.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
It is always the case that <constant>GL_AUX</constant>
<inlineequation><mml:math><mml:mi mathvariant="italic">i</mml:mi></mml:math></inlineequation>
= <constant>GL_AUX0</constant> +
<inlineequation><mml:math><mml:mi mathvariant="italic">i</mml:mi></mml:math></inlineequation>.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>mode</parameter> is not an accepted value.
@ -205,25 +186,17 @@
<constant>GL_INVALID_OPERATION</constant> is generated if none of the buffers indicated
by <parameter>mode</parameter> exists.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glDrawBuffer</function>
is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_DRAW_BUFFER</constant>
</para>
<para>
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_AUX_BUFFERS</constant>
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glBlendFunc</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glColorMask</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIndexMask</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawBuffers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glLogicOp</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glReadBuffer</refentrytitle></citerefentry>
</para>

View file

@ -1,189 +1,177 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glDrawBuffers">
<refmeta>
<refentrytitle>glDrawBuffers</refentrytitle>
<manvolnum>3G</manvolnum>
<refentrytitle>glDrawBuffers</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glDrawBuffers</refname>
<refpurpose>Specifies a list of color buffers to be drawn into</refpurpose>
<refname>glDrawBuffers</refname>
<refpurpose>Specifies a list of color buffers to be drawn into</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDrawBuffers</function></funcdef>
<paramdef>GLsizei <parameter>n</parameter></paramdef>
<paramdef>const GLenum *<parameter>bufs</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDrawBuffers</function></funcdef>
<paramdef>GLsizei <parameter>n</parameter></paramdef>
<paramdef>const GLenum *<parameter>bufs</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>n</parameter></term>
<listitem>
<para>Specifies the number of buffers in
<parameter>bufs</parameter>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>bufs</parameter></term>
<listitem>
<para>Points to an array of symbolic constants
specifying the buffers into which fragment colors or
data values will be written.</para>
</listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term><parameter>n</parameter></term>
<listitem>
<para>Specifies the number of buffers in
<parameter>bufs</parameter>.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>bufs</parameter></term>
<listitem>
<para>Points to an array of symbolic constants
specifying the buffers into which fragment colors or
data values will be written.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para><function>glDrawBuffers</function> defines an array of
buffers into which fragment color values or fragment data will
be written. If no fragment shader is active, rendering
operations will generate only one fragment color per fragment
and it will be written into each of the buffers specified by
<parameter>bufs</parameter>. If a fragment shader is active and
it writes a value to the output variable
<code>gl_FragColor</code>, then that value will be
written into each of the buffers specified by
<parameter>bufs</parameter>. If a fragment shader is active and
it writes a value to one or more elements of the output array
variable <code>gl_FragData[]</code>, then the value of
<code>gl_FragData[0] </code> will be written into the
first buffer specified by <parameter>bufs</parameter>, the value
of <code>gl_FragData[1] </code> will be written into the
second buffer specified by <parameter>bufs</parameter>, and so
on up to <code>gl_FragData[n-1]</code>. The draw buffer
used for <code>gl_FragData[n]</code> and beyond is
implicitly set to be <constant>GL_NONE</constant>.</para>
<para><function>glDrawBuffers</function> defines an array of
buffers into which outputs from the fragment shader data will
be written. If a fragment shader writes a value
to one or more user defined output
variables, then the value of each variable will be written into the
buffer specified at a location within <parameter>bufs</parameter>
corresponding to the location assigned to that user defined output.
The draw buffer used for user defined outputs assigned to locations
greater than or equal to <parameter>n</parameter> is implicitly set
to <constant>GL_NONE</constant> and any data written to such an output
is discarded.</para>
<para>The symbolic constants contained in
<parameter>bufs</parameter> may be any of the following:</para>
<para>The symbolic constants contained in
<parameter>bufs</parameter> may be any of the following:</para>
<variablelist>
<varlistentry>
<term><constant>GL_NONE</constant></term>
<listitem>
<para>The fragment color/data value is not written into
any color buffer.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_FRONT_LEFT</constant></term>
<listitem>
<para>The fragment color/data value is written into the
front left color buffer.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_FRONT_RIGHT</constant></term>
<listitem>
<para>The fragment color/data value is written into the
front right color buffer.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_BACK_LEFT</constant></term>
<listitem>
<para>The fragment color/data value is written into the
back left color buffer.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_BACK_RIGHT</constant></term>
<listitem>
<para>The fragment color/data value is written into the
back right color buffer.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_AUXi</constant></term>
<listitem>
<para>The fragment color/data value is written into
auxiliary buffer <code>i</code>.</para>
</listitem>
</varlistentry>
</variablelist>
<variablelist>
<varlistentry>
<term><constant>GL_NONE</constant></term>
<listitem>
<para>The fragment shader output value is not written into
any color buffer.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_FRONT_LEFT</constant></term>
<listitem>
<para>The fragment shader output value is written into the
front left color buffer.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_FRONT_RIGHT</constant></term>
<listitem>
<para>The fragment shader output value is written into the
front right color buffer.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_BACK_LEFT</constant></term>
<listitem>
<para>The fragment shader output value is written into the
back left color buffer.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_BACK_RIGHT</constant></term>
<listitem>
<para>The fragment shader output value is written into the
back right color buffer.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><constant>GL_COLOR_ATTACHMENT<emphasis>n</emphasis></constant></term>
<listitem>
<para>The fragment shader output value is written into the
<emphasis>n</emphasis>th color attachment of the current framebuffer.
<emphasis>n</emphasis> may range from 0 to the value of
<constant>GL_MAX_COLOR_ATTACHMENTS</constant>.</para>
</listitem>
</varlistentry>
</variablelist>
<para>Except for <constant>GL_NONE</constant>, the preceding
symbolic constants may not appear more than once in
<parameter>bufs</parameter>. The maximum number of draw buffers
supported is implementation dependent and can be queried by
calling
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>
with the argument <constant>GL_MAX_DRAW_BUFFERS</constant>. The
number of auxiliary buffers can be queried by calling
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>
with the argument <constant>GL_AUX_BUFFERS</constant>.</para>
<para>Except for <constant>GL_NONE</constant>, the preceding
symbolic constants may not appear more than once in
<parameter>bufs</parameter>. The maximum number of draw buffers
supported is implementation dependent and can be queried by
calling
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>
with the argument <constant>GL_MAX_DRAW_BUFFERS</constant>.</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para><function>glDrawBuffers</function> is available only if
the GL version is 2.0 or greater.</para>
<para>It is always the case that <constant>GL_AUXi</constant> =
<constant>GL_AUX0</constant> + <code>i</code>.</para>
<para>The symbolic constants <constant>GL_FRONT</constant>,
<constant>GL_BACK</constant>, <constant>GL_LEFT</constant>,
<constant>GL_RIGHT</constant>, and
<constant>GL_FRONT_AND_BACK</constant> are not allowed in the
<parameter>bufs</parameter> array since they may refer to
multiple buffers.</para>
<para>The symbolic constants <constant>GL_FRONT</constant>,
<constant>GL_BACK</constant>, <constant>GL_LEFT</constant>,
<constant>GL_RIGHT</constant>, and
<constant>GL_FRONT_AND_BACK</constant> are not allowed in the
<parameter>bufs</parameter> array since they may refer to
multiple buffers.</para>
<para>If a fragment shader writes to neither
<code>gl_FragColor</code> nor
<code>gl_FragData</code>, the values of the fragment
colors following shader execution are undefined. For each
fragment generated in this situation, a different value may be
written into each of the buffers specified by
<parameter>bufs</parameter>.</para>
<para>If a fragment shader does not write to a user defined output variable,
the values of the fragment
colors following shader execution are undefined. For each
fragment generated in this situation, a different value may be
written into each of the buffers specified by
<parameter>bufs</parameter>.</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para><constant>GL_INVALID_ENUM</constant> is generated if one of the
values in <parameter>bufs</parameter> is not an accepted
value.</para>
<para><constant>GL_INVALID_ENUM</constant> is generated if one of the
values in <parameter>bufs</parameter> is not an accepted
value.</para>
<para><constant>GL_INVALID_ENUM</constant> is generated if the GL is bound
to the default framebuffer and one or more of the values in
<parameter>bufs</parameter> is one of the <constant>GL_COLOR_ATTACHMENT<emphasis>n</emphasis></constant>
tokens.</para>
<para><constant>GL_INVALID_ENUM</constant> is generated if
<parameter>n</parameter> is less than 0.</para>
<para><constant>GL_INVALID_ENUM</constant> is generated if the GL is bound
to a framebuffer object and one or more of the values in <parameter>bufs</parameter>
is anything other than <constant>GL_NONE</constant> or one of the
<constant>GL_COLOR_ATTACHMENTS<emphasis>n</emphasis></constant> tokens.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if a
symbolic constant other than <constant>GL_NONE</constant>
appears more than once in <parameter>bufs</parameter>.</para>
<para><constant>GL_INVALID_ENUM</constant> is generated if
<parameter>n</parameter> is less than 0.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if any of
the entries in <parameter>bufs</parameter> (other than
<constant>GL_NONE</constant> ) indicates a color buffer that
does not exist in the current GL context.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if a
symbolic constant other than <constant>GL_NONE</constant>
appears more than once in <parameter>bufs</parameter>.</para>
<para><constant>GL_INVALID_VALUE</constant> is generated if
<parameter>n</parameter> is greater than
<constant>GL_MAX_DRAW_BUFFERS</constant>.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if any of
the entries in <parameter>bufs</parameter> (other than
<constant>GL_NONE</constant> ) indicates a color buffer that
does not exist in the current GL context.</para>
<para><constant>GL_INVALID_VALUE</constant> is generated if
<parameter>n</parameter> is greater than
<constant>GL_MAX_DRAW_BUFFERS</constant>.</para>
<para><constant>GL_INVALID_OPERATION</constant> is generated if
<function>glDrawBuffers</function> is executed between the
execution of
<citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
and the corresponding execution of
<citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.</para>
</refsect1>
<refsect1 id="associatedgets"><title>Associated Gets</title>
<para><citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>
with argument <constant>GL_MAX_DRAW_BUFFERS</constant></para>
<para><citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>
with argument <constant>GL_MAX_DRAW_BUFFERS</constant></para>
<para><citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>
with argument <constant>GL_DRAW_BUFFERSi</constant> where
<code>i</code> indicates the number of the draw buffer
whose value is to be queried</para>
<para><citerefentry><refentrytitle>glGet</refentrytitle></citerefentry>
with argument <constant>GL_DRAW_BUFFER<emphasis>i</emphasis></constant> where
<code><emphasis>i</emphasis></code> indicates the number of the draw buffer
whose value is to be queried</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para> <citerefentry><refentrytitle>glBlendFunc</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glColorMask</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawBuffers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIndexMask</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glLogicOp</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glReadBuffer</refentrytitle></citerefentry></para>
<para> <citerefentry><refentrytitle>glBlendFunc</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glColorMask</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawBuffers</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glLogicOp</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glReadBuffer</refentrytitle></citerefentry></para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>

View file

@ -40,12 +40,14 @@
<constant>GL_LINE_STRIP</constant>,
<constant>GL_LINE_LOOP</constant>,
<constant>GL_LINES</constant>,
<constant>GL_LINE_STRIP_ADJACENCY</constant>,
<constant>GL_LINES_ADJACENCY</constant>,
<constant>GL_TRIANGLE_STRIP</constant>,
<constant>GL_TRIANGLE_FAN</constant>,
<constant>GL_TRIANGLES</constant>,
<constant>GL_QUAD_STRIP</constant>,
<constant>GL_QUADS</constant>,
and <constant>GL_POLYGON</constant> are accepted.
<constant>GL_TRIANGLE_STRIP_ADJACENCY</constant>,
<constant>GL_TRIANGLES_ADJACENCY</constant> and <constant>GL_PATCHES</constant>
are accepted.
</para>
</listitem>
</varlistentry>
@ -92,30 +94,21 @@
enabled array, starting at <parameter>indices</parameter> to construct a sequence of
geometric primitives. <parameter>mode</parameter> specifies what kind of primitives are
constructed and how the array elements construct these primitives. If
more than one array is enabled, each is used. If
<constant>GL_VERTEX_ARRAY</constant> is not enabled, no geometric primitives are
constructed.
more than one array is enabled, each is used.
</para>
<para>
Vertex attributes that are modified by <function>glDrawElements</function> have an
unspecified value after <function>glDrawElements</function> returns. For example, if
<constant>GL_COLOR_ARRAY</constant> is enabled, the value of the current color is
undefined after <function>glDrawElements</function> executes. Attributes that aren't
unspecified value after <function>glDrawElements</function> returns. Attributes that aren't
modified maintain their previous values.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glDrawElements</function> is available only if the GL version is 1.1 or greater.
</para>
<para>
<function>glDrawElements</function> is included in display lists. If <function>glDrawElements</function> is entered into a
display list,
the necessary array data (determined by the array pointers and
enables) is also
entered into the display list. Because the array pointers and
enables are client-side state, their values affect display lists
when the lists are created, not when the lists are executed.
<constant>GL_LINE_STRIP_ADJACENCY</constant>,
<constant>GL_LINES_ADJACENCY</constant>,
<constant>GL_TRIANGLE_STRIP_ADJACENCY</constant> and
<constant>GL_TRIANGLES_ADJACENCY</constant>
are available only if the GL version is 3.2 or greater.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
@ -126,29 +119,20 @@
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>count</parameter> is negative.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to an
enabled array or the element array and the buffer object's data store is currently mapped.
<constant>GL_INVALID_OPERATION</constant> is generated if a geometry shader is active and <parameter>mode</parameter>
is incompatible with the input primitive type of the geometry shader in the currently installed program object.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glDrawElements</function> is executed between
the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry> and the corresponding <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
<constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to an
enabled array or the element array and the buffer object's data store is currently mapped.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glArrayElement</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glColorPointer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawRangeElements</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glEdgeFlagPointer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glFogCoordPointer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glGetPointerv</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glIndexPointer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glInterleavedArrays</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glNormalPointer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glSecondaryColorPointer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glTexCoordPointer</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glVertexPointer</refentrytitle></citerefentry>
<citerefentry><refentrytitle>glDrawElementsInstanced</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawElementsBaseVertex</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawRangeElements</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>

View file

@ -0,0 +1,130 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glDrawElementsBaseVertex">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glDrawElementsBaseVertex</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glDrawElementsBaseVertex</refname>
<refpurpose>render primitives from array data with a per-element offset</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDrawElementsBaseVertex</function></funcdef>
<paramdef>GLenum <parameter>mode</parameter></paramdef>
<paramdef>GLsizei <parameter>count</parameter></paramdef>
<paramdef>GLenum <parameter>type</parameter></paramdef>
<paramdef>GLvoid *<parameter>indices</parameter></paramdef>
<paramdef>GLint <parameter>basevertex</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<!-- eqn: ignoring delim $$ -->
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
Specifies what kind of primitives to render.
Symbolic constants
<constant>GL_POINTS</constant>, <constant>GL_LINE_STRIP</constant>, <constant>GL_LINE_LOOP</constant>,
<constant>GL_LINES</constant>, <constant>GL_TRIANGLE_STRIP</constant>, <constant>GL_TRIANGLE_FAN</constant>,
<constant>GL_TRIANGLES</constant>, <constant>GL_LINES_ADJACENCY</constant>, <constant>GL_LINE_STRIP_ADJACENCY</constant>,
<constant>GL_TRIANGLES_ADJACENCY</constant>, <constant>GL_TRIANGLE_STRIP_ADJACENCY</constant> and <constant>GL_PATCHES</constant> are accepted.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>count</parameter></term>
<listitem>
<para>
Specifies the number of elements to be rendered.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>type</parameter></term>
<listitem>
<para>
Specifies the type of the values in indices. Must be one of <constant>GL_UNSIGNED_BYTE</constant>,
<constant>GL_UNSIGNED_SHORT</constant>, or <constant>GL_UNSIGNED_INT</constant>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>indices</parameter></term>
<listitem>
<para>
Specifies a pointer to the location where the indices are stored.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>basevertex</parameter></term>
<listitem>
<para>
Specifies a constant that should be added to each element of <parameter>indices</parameter>
when chosing elements from the enabled vertex arrays.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glDrawElementsBaseVertex</function> behaves identically to
<citerefentry><refentrytitle>glDrawElements</refentrytitle></citerefentry> except that the <emphasis>i</emphasis>th element
transferred by the corresponding draw call will be taken from element <parameter>indices</parameter>[i] + <parameter>basevertex</parameter>
of each enabled array. If the resulting value is larger than the maximum value representable by <parameter>type</parameter>,
it is as if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow conditions).
The operation is undefined if the sum would be negative.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<function>glDrawElementsBaseVertex</function> is only supported if the GL version is 3.2 or greater, or if
the <code>ARB_draw_elements_base_vertex</code> extension is supported.
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>mode</parameter> is not an accepted value.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>count</parameter> is negative.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if a geometry shader is active and <parameter>mode</parameter>
is incompatible with the input primitive type of the geometry shader in the currently installed program object.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to an
enabled array or the element array and the buffer object's data store is currently mapped.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glDrawElements</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawRangeElements</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawRangeElementsBaseVertex</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawElementsInstanced</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawElementsInstancedBaseVertex</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -0,0 +1,162 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glDrawArraysIndirect">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group.</holder>
</copyright>
</refmetainfo>
<refentrytitle>glDrawElementsIndirect</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glDrawElementsIndirect</refname>
<refpurpose>render indexed primitives from array data, taking parameters from memory</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDrawElementsIndirect</function></funcdef>
<paramdef>GLenum <parameter>mode</parameter></paramdef>
<paramdef>GLenum <parameter>type</parameter></paramdef>
<paramdef>const void *<parameter>indirect</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<!-- eqn: ignoring delim $$ -->
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
Specifies what kind of primitives to render.
Symbolic constants
<constant>GL_POINTS</constant>,
<constant>GL_LINE_STRIP</constant>,
<constant>GL_LINE_LOOP</constant>,
<constant>GL_LINES</constant>,
<constant>GL_LINE_STRIP_ADJACENCY</constant>,
<constant>GL_LINES_ADJACENCY</constant>,
<constant>GL_TRIANGLE_STRIP</constant>,
<constant>GL_TRIANGLE_FAN</constant>,
<constant>GL_TRIANGLES</constant>,
<constant>GL_TRIANGLE_STRIP_ADJACENCY</constant>,
<constant>GL_TRIANGLES_ADJACENCY</constant>, and
<constant>GL_PATCHES</constant>
are accepted.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>type</parameter></term>
<listitem>
<para>
Specifies the type of data in the buffer bound to the <constant>GL_ELEMENT_ARRAY_BUFFER</constant> binding.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>indirect</parameter></term>
<listitem>
<para>
Specifies the address of a structure containing the draw parameters.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glDrawElementsIndirect</function> specifies multiple indexed geometric primitives
with very few subroutine calls. <function>glDrawElementsIndirect</function> behaves
similarly to <citerefentry><refentrytitle>glDrawElementsInstancedBaseVertex</refentrytitle></citerefentry>,
execpt that the parameters to <citerefentry><refentrytitle>glDrawElementsInstancedBaseVertex</refentrytitle></citerefentry>
are stored in memory at the address given by <parameter>indirect</parameter>.
</para>
<para>
The parameters addressed by <parameter>indirect</parameter> are packed into a structure
that takes the form (in C):
<programlisting><![CDATA[ typedef struct {
uint count;
uint primCount;
uint firstIndex;
uint baseVertex;
uint reservedMustBeZero;
} DrawElementsIndirectCommand;]]></programlisting>
<para>
<function>glDrawElementsIndirect</function> is equivalent to:
</para>
<programlisting><![CDATA[ void glDrawElementsIndirect(GLenum mode, GLenum type, const void * indirect)
{
const DrawElementsIndirectCommand *cmd = (const DrawElementsIndirectCommand *)indirect;
glDrawElementsInstancedBaseVertex(mode,
cmd->count,
type,
cmd->firstIndex + size-of-type,
cmd->primCount,
cmd->baseVertex);
}]]></programlisting>
</para>
<para>
If a buffer is bound to the <constant>GL_INDIRECT_BUFFER</constant> binding at the time
of a call to <function>glDrawElementsIndirect</function>, <parameter>indirect</parameter>
is interpreted as an offset, in basic machine units, into that buffer and the parameter
data is read from the buffer rather than from client memory.
</para>
<para>
Note that indices stored in client memory are not supported. If no buffer is bound to the
<constant>GL_ELEMENT_ARRAY_BUFFER</constant> binding, an error will be generated.
</para>
<para>
The results of the operation are undefined if the <code>reservedMustBeZero</code> member
of the parameter structure is non-zero. However, no error is generated in this case.
</para>
<para>
Vertex attributes that are modified by <function>glDrawElementsIndirect</function> have an
unspecified value after <function>glDrawElementsIndirect</function> returns. Attributes that aren't
modified remain well defined.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>mode</parameter> is not an accepted value.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if no buffer is bound to the <constant>GL_ELEMENT_ARRAY_BUFFER</constant>
binding, or if such a buffer's data store is currently mapped.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to an
enabled array or to the <constant>GL_INDIRECT_BUFFER</constant> binding and the buffer object's data store is currently mapped.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if a geometry shader is active and <parameter>mode</parameter>
is incompatible with the input primitive type of the geometry shader in the currently installed program object.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if <parameter>mode</parameter> is <constant>GL_PATCHES</constant>
and no tessellation control shader is active.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glDrawArrays</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawArraysInstanced</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawArraysIndirect</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawElements</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawRangeElements</refentrytitle></citerefentry>,
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -0,0 +1,153 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glDrawElementsInstanced">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glDrawElementsInstanced</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glDrawElementsInstanced</refname>
<refpurpose>draw multiple instances of a set of elements</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDrawElementsInstanced</function></funcdef>
<paramdef>GLenum <parameter>mode</parameter></paramdef>
<paramdef>GLsizei <parameter>count</parameter></paramdef>
<paramdef>GLenum <parameter>type</parameter></paramdef>
<paramdef>const void * <parameter>indices</parameter></paramdef>
<paramdef>GLsizei <parameter>primcount</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
Specifies what kind of primitives to render.
Symbolic constants
<constant>GL_POINTS</constant>,
<constant>GL_LINE_STRIP</constant>,
<constant>GL_LINE_LOOP</constant>,
<constant>GL_LINES</constant>,
<constant>GL_LINE_STRIP_ADJACENCY</constant>,
<constant>GL_LINES_ADJACENCY</constant>,
<constant>GL_TRIANGLE_STRIP</constant>,
<constant>GL_TRIANGLE_FAN</constant>,
<constant>GL_TRIANGLES</constant>,
<constant>GL_TRIANGLE_STRIP_ADJACENCY</constant>,
<constant>GL_TRIANGLES_ADJACENCY</constant> and <constant>GL_PATCHES</constant>
are accepted.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>count</parameter></term>
<listitem>
<para>
Specifies the number of elements to be rendered.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>type</parameter></term>
<listitem>
<para>
Specifies the type of the values in <parameter>indices</parameter>. Must be one of <constant>GL_UNSIGNED_BYTE</constant>,
<constant>GL_UNSIGNED_SHORT</constant>, or <constant>GL_UNSIGNED_INT</constant>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>indices</parameter></term>
<listitem>
<para>
Specifies a pointer to the location where the indices are stored.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>primcount</parameter></term>
<listitem>
<para>
Specifies the number of instances of the specified range of indices to be rendered.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glDrawElementsInstanced</function> behaves identically to <citerefentry><refentrytitle>glDrawElements</refentrytitle></citerefentry>
except that <parameter>primcount</parameter> instances of the set of elements are executed and the value of the internal counter
<parameter>instanceID</parameter> advances for each iteration. <parameter>instanceID</parameter> is an internal 32-bit integer counter
that may be read by a vertex shader as <constant>gl_InstanceID</constant>.
</para>
<para>
<function>glDrawElementsInstanced</function> has the same effect as:
<programlisting><![CDATA[ if (mode, count, or type is invalid )
generate appropriate error
else {
for (int i = 0; i < primcount ; i++) {
instanceID = i;
glDrawElements(mode, count, type, indices);
}
instanceID = 0;
}]]></programlisting>
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<para>
<function>glDrawElementsInstanced</function> is available only if the GL version is 3.1 or greater.
</para>
<para>
<constant>GL_LINE_STRIP_ADJACENCY</constant>,
<constant>GL_LINES_ADJACENCY</constant>,
<constant>GL_TRIANGLE_STRIP_ADJACENCY</constant> and
<constant>GL_TRIANGLES_ADJACENCY</constant>
are available only if the GL version is 3.2 or greater.
</para>
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>mode</parameter> is not one of <constant>GL_POINTS</constant>,
<constant>GL_LINE_STRIP</constant>, <constant>GL_LINE_LOOP</constant>, <constant>GL_LINES</constant>,
<constant>GL_TRIANGLE_STRIP</constant>, <constant>GL_TRIANGLE_FAN</constant>, or <constant>GL_TRIANGLES</constant>.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>count</parameter> or <parameter>primcount</parameter> are negative.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if a geometry shader is active and <parameter>mode</parameter>
is incompatible with the input primitive type of the geometry shader in the currently installed program object.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to an
enabled array and the buffer object's data store is currently mapped.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glDrawElements</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawArraysInstanced</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

View file

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
<refentry id="glDrawElementsBaseVertex">
<refmeta>
<refmetainfo>
<copyright>
<year>2010</year>
<holder>Khronos Group</holder>
</copyright>
</refmetainfo>
<refentrytitle>glDrawElementsInstancedBaseVertex</refentrytitle>
<manvolnum>3G</manvolnum>
</refmeta>
<refnamediv>
<refname>glDrawElementsInstancedBaseVertex</refname>
<refpurpose>render multiple instances of a set of primitives from array data with a per-element offset</refpurpose>
</refnamediv>
<refsynopsisdiv><title>C Specification</title>
<funcsynopsis>
<funcprototype>
<funcdef>void <function>glDrawElementsInstancedBaseVertex</function></funcdef>
<paramdef>GLenum <parameter>mode</parameter></paramdef>
<paramdef>GLsizei <parameter>count</parameter></paramdef>
<paramdef>GLenum <parameter>type</parameter></paramdef>
<paramdef>GLvoid *<parameter>indices</parameter></paramdef>
<paramdef>GLsizei <parameter>primcount</parameter></paramdef>
<paramdef>GLint <parameter>basevertex</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<!-- eqn: ignoring delim $$ -->
<refsect1 id="parameters"><title>Parameters</title>
<variablelist>
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
Specifies what kind of primitives to render.
Symbolic constants
<constant>GL_POINTS</constant>, <constant>GL_LINE_STRIP</constant>, <constant>GL_LINE_LOOP</constant>,
<constant>GL_LINES</constant>, <constant>GL_TRIANGLE_STRIP</constant>, <constant>GL_TRIANGLE_FAN</constant>,
<constant>GL_TRIANGLES</constant>, <constant>GL_LINES_ADJACENCY</constant>, <constant>GL_LINE_STRIP_ADJACENCY</constant>,
<constant>GL_TRIANGLES_ADJACENCY</constant>, <constant>GL_TRIANGLE_STRIP_ADJACENCY</constant> and <constant>GL_PATCHES</constant> are accepted.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>count</parameter></term>
<listitem>
<para>
Specifies the number of elements to be rendered.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>type</parameter></term>
<listitem>
<para>
Specifies the type of the values in indices. Must be one of <constant>GL_UNSIGNED_BYTE</constant>,
<constant>GL_UNSIGNED_SHORT</constant>, or <constant>GL_UNSIGNED_INT</constant>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>indices</parameter></term>
<listitem>
<para>
Specifies a pointer to the location where the indices are stored.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>primcount</parameter></term>
<listitem>
<para>
Specifies the number of instances of the indexed geometry that should be drawn.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>basevertex</parameter></term>
<listitem>
<para>
Specifies a constant that should be added to each element of <parameter>indices</parameter>
when chosing elements from the enabled vertex arrays.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 id="description"><title>Description</title>
<para>
<function>glDrawElementsInstancedBaseVertex</function> behaves identically to
<citerefentry><refentrytitle>glDrawElementsInstanced</refentrytitle></citerefentry> except that the <emphasis>i</emphasis>th element
transferred by the corresponding draw call will be taken from element <parameter>indices</parameter>[i] + <parameter>basevertex</parameter>
of each enabled array. If the resulting value is larger than the maximum value representable by <parameter>type</parameter>,
it is as if the calculation were upconverted to 32-bit unsigned integers (with wrapping on overflow conditions).
The operation is undefined if the sum would be negative.
</para>
</refsect1>
<refsect1 id="notes"><title>Notes</title>
<function>glDrawElementsInstancedBaseVertex</function> is only supported if the GL version is 3.2 or greater.
</refsect1>
<refsect1 id="errors"><title>Errors</title>
<para>
<constant>GL_INVALID_ENUM</constant> is generated if <parameter>mode</parameter> is not an accepted value.
</para>
<para>
<constant>GL_INVALID_VALUE</constant> is generated if <parameter>count</parameter> or <parameter>primcount</parameter> is negative.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if a geometry shader is active and <parameter>mode</parameter>
is incompatible with the input primitive type of the geometry shader in the currently installed program object.
</para>
<para>
<constant>GL_INVALID_OPERATION</constant> is generated if a non-zero buffer object name is bound to an
enabled array or the element array and the buffer object's data store is currently mapped.
</para>
</refsect1>
<refsect1 id="seealso"><title>See Also</title>
<para>
<citerefentry><refentrytitle>glDrawElements</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawRangeElements</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawRangeElementsBaseVertex</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawElementsInstanced</refentrytitle></citerefentry>,
<citerefentry><refentrytitle>glDrawElementsInstancedBaseVertex</refentrytitle></citerefentry>
</para>
</refsect1>
<refsect1 id="Copyright"><title>Copyright</title>
<para>
Copyright <trademark class="copyright"></trademark> 2010 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.
<ulink url="http://opencontent.org/openpub/">http://opencontent.org/openpub/</ulink>.
</para>
</refsect1>
</refentry>

Some files were not shown because too many files have changed in this diff Show more