diff --git a/_static/basic.css b/_static/basic.css index 24a49f09b..aa9df316d 100644 --- a/_static/basic.css +++ b/_static/basic.css @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- basic theme. * - * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -130,7 +130,7 @@ ul.search li a { font-weight: bold; } -ul.search li div.context { +ul.search li p.context { color: #888; margin: 2px 0 0 30px; text-align: left; @@ -277,25 +277,25 @@ p.rubric { font-weight: bold; } -img.align-left, .figure.align-left, object.align-left { +img.align-left, figure.align-left, .figure.align-left, object.align-left { clear: left; float: left; margin-right: 1em; } -img.align-right, .figure.align-right, object.align-right { +img.align-right, figure.align-right, .figure.align-right, object.align-right { clear: right; float: right; margin-left: 1em; } -img.align-center, .figure.align-center, object.align-center { +img.align-center, figure.align-center, .figure.align-center, object.align-center { display: block; margin-left: auto; margin-right: auto; } -img.align-default, .figure.align-default { +img.align-default, figure.align-default, .figure.align-default { display: block; margin-left: auto; margin-right: auto; @@ -319,7 +319,8 @@ img.align-default, .figure.align-default { /* -- sidebars -------------------------------------------------------------- */ -div.sidebar { +div.sidebar, +aside.sidebar { margin: 0 0 0.5em 1em; border: 1px solid #ddb; padding: 7px; @@ -377,12 +378,14 @@ div.body p.centered { /* -- content of sidebars/topics/admonitions -------------------------------- */ div.sidebar > :last-child, +aside.sidebar > :last-child, div.topic > :last-child, div.admonition > :last-child { margin-bottom: 0; } div.sidebar::after, +aside.sidebar::after, div.topic::after, div.admonition::after, blockquote::after { @@ -455,20 +458,22 @@ td > :last-child { /* -- figures --------------------------------------------------------------- */ -div.figure { +div.figure, figure { margin: 0.5em; padding: 0.5em; } -div.figure p.caption { +div.figure p.caption, figcaption { padding: 0.3em; } -div.figure p.caption span.caption-number { +div.figure p.caption span.caption-number, +figcaption span.caption-number { font-style: italic; } -div.figure p.caption span.caption-text { +div.figure p.caption span.caption-text, +figcaption span.caption-text { } /* -- field list styles ----------------------------------------------------- */ @@ -503,6 +508,63 @@ table.hlist td { vertical-align: top; } +/* -- object description styles --------------------------------------------- */ + +.sig { + font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; +} + +.sig-name, code.descname { + background-color: transparent; + font-weight: bold; +} + +.sig-name { + font-size: 1.1em; +} + +code.descname { + font-size: 1.2em; +} + +.sig-prename, code.descclassname { + background-color: transparent; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.sig-param.n { + font-style: italic; +} + +/* C++ specific styling */ + +.sig-inline.c-texpr, +.sig-inline.cpp-texpr { + font-family: unset; +} + +.sig.c .k, .sig.c .kt, +.sig.cpp .k, .sig.cpp .kt { + color: #0033B3; +} + +.sig.c .m, +.sig.cpp .m { + color: #1750EB; +} + +.sig.c .s, .sig.c .sc, +.sig.cpp .s, .sig.cpp .sc { + color: #067D17; +} + /* -- other body styles ----------------------------------------------------- */ @@ -629,14 +691,6 @@ dl.glossary dt { font-size: 1.1em; } -.optional { - font-size: 1.3em; -} - -.sig-paren { - font-size: larger; -} - .versionmodified { font-style: italic; } @@ -766,7 +820,11 @@ div.code-block-caption code { table.highlighttable td.linenos, span.linenos, div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */ - user-select: none; + user-select: none; + -webkit-user-select: text; /* Safari fallback only */ + -webkit-user-select: none; /* Chrome/Safari */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE10+ */ } div.code-block-caption span.caption-number { @@ -781,16 +839,6 @@ div.literal-block-wrapper { margin: 1em 0; } -code.descname { - background-color: transparent; - font-weight: bold; - font-size: 1.2em; -} - -code.descclassname { - background-color: transparent; -} - code.xref, a code { background-color: transparent; font-weight: bold; diff --git a/_static/doctools.js b/_static/doctools.js index 7d88f807d..61ac9d266 100644 --- a/_static/doctools.js +++ b/_static/doctools.js @@ -4,7 +4,7 @@ * * Sphinx JavaScript utilities for all documentation. * - * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -29,9 +29,14 @@ if (!window.console || !console.firebug) { /** * small helper function to urldecode strings + * + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL */ jQuery.urldecode = function(x) { - return decodeURIComponent(x).replace(/\+/g, ' '); + if (!x) { + return x + } + return decodeURIComponent(x.replace(/\+/g, ' ')); }; /** diff --git a/_static/fonts/Inconsolata-Bold.ttf b/_static/fonts/Inconsolata-Bold.ttf new file mode 100644 index 000000000..809c1f582 Binary files /dev/null and b/_static/fonts/Inconsolata-Bold.ttf differ diff --git a/_static/fonts/Inconsolata-Regular.ttf b/_static/fonts/Inconsolata-Regular.ttf new file mode 100644 index 000000000..fc981ce7a Binary files /dev/null and b/_static/fonts/Inconsolata-Regular.ttf differ diff --git a/_static/fonts/Inconsolata.ttf b/_static/fonts/Inconsolata.ttf new file mode 100644 index 000000000..4b8a36d24 Binary files /dev/null and b/_static/fonts/Inconsolata.ttf differ diff --git a/_static/fonts/Lato-Bold.ttf b/_static/fonts/Lato-Bold.ttf new file mode 100644 index 000000000..1d23c7066 Binary files /dev/null and b/_static/fonts/Lato-Bold.ttf differ diff --git a/_static/fonts/Lato-Regular.ttf b/_static/fonts/Lato-Regular.ttf new file mode 100644 index 000000000..0f3d0f837 Binary files /dev/null and b/_static/fonts/Lato-Regular.ttf differ diff --git a/_static/fonts/RobotoSlab-Bold.ttf b/_static/fonts/RobotoSlab-Bold.ttf new file mode 100644 index 000000000..df5d1df27 Binary files /dev/null and b/_static/fonts/RobotoSlab-Bold.ttf differ diff --git a/_static/fonts/RobotoSlab-Regular.ttf b/_static/fonts/RobotoSlab-Regular.ttf new file mode 100644 index 000000000..eb52a7907 Binary files /dev/null and b/_static/fonts/RobotoSlab-Regular.ttf differ diff --git a/_static/language_data.js b/_static/language_data.js index d2b4ee91b..863704b31 100644 --- a/_static/language_data.js +++ b/_static/language_data.js @@ -5,7 +5,7 @@ * This script contains the language-specific data used by searchtools.js, * namely the list of stopwords, stemmer, scorer and splitter. * - * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -13,7 +13,8 @@ var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"]; -/* Non-minified version JS is _stemmer.js if file is provided */ +/* Non-minified version is copied as a separate JS file, is available */ + /** * Porter Stemmer */ @@ -199,7 +200,6 @@ var Stemmer = function() { - var splitChars = (function() { var result = {}; var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648, diff --git a/_static/pygments.css b/_static/pygments.css index 20c4814dc..691aeb82d 100644 --- a/_static/pygments.css +++ b/_static/pygments.css @@ -1,5 +1,10 @@ +pre { line-height: 125%; } +td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #ffffcc } -.highlight { background: #eeffcc; } +.highlight { background: #eeffcc; } .highlight .c { color: #408090; font-style: italic } /* Comment */ .highlight .err { border: 1px solid #FF0000 } /* Error */ .highlight .k { color: #007020; font-weight: bold } /* Keyword */ diff --git a/_static/searchtools.js b/_static/searchtools.js index 261ecaa92..e09f9263f 100644 --- a/_static/searchtools.js +++ b/_static/searchtools.js @@ -4,7 +4,7 @@ * * Sphinx JavaScript utilities for the full-text search. * - * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -248,7 +248,7 @@ var Search = { // results left, load the summary and display it if (results.length) { var item = results.pop(); - var listItem = $('
  • '); + var listItem = $('
  • '); var requestUrl = ""; var linkUrl = ""; if (DOCUMENTATION_OPTIONS.BUILDER === 'dirhtml') { @@ -273,9 +273,9 @@ var Search = { if (item[3]) { listItem.append($(' (' + item[3] + ')')); Search.output.append(listItem); - listItem.slideDown(5, function() { + setTimeout(function() { displayNextItem(); - }); + }, 5); } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) { $.ajax({url: requestUrl, dataType: "text", @@ -285,16 +285,16 @@ var Search = { listItem.append(Search.makeSearchSummary(data, searchterms, hlterms)); } Search.output.append(listItem); - listItem.slideDown(5, function() { + setTimeout(function() { displayNextItem(); - }); + }, 5); }}); } else { // no source available, just display title Search.output.append(listItem); - listItem.slideDown(5, function() { + setTimeout(function() { displayNextItem(); - }); + }, 5); } } // search finished, update title and status message @@ -379,6 +379,13 @@ var Search = { return results; }, + /** + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions + */ + escapeRegExp : function(string) { + return string.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string + }, + /** * search for full-text terms in the index */ @@ -402,13 +409,14 @@ var Search = { ]; // add support for partial matches if (word.length > 2) { + var word_regex = this.escapeRegExp(word); for (var w in terms) { - if (w.match(word) && !terms[word]) { + if (w.match(word_regex) && !terms[word]) { _o.push({files: terms[w], score: Scorer.partialTerm}) } } for (var w in titleterms) { - if (w.match(word) && !titleterms[word]) { + if (w.match(word_regex) && !titleterms[word]) { _o.push({files: titleterms[w], score: Scorer.partialTitle}) } } @@ -501,7 +509,7 @@ var Search = { var excerpt = ((start > 0) ? '...' : '') + $.trim(text.substr(start, 240)) + ((start + 240 - text.length) ? '...' : ''); - var rv = $('
    ').text(excerpt); + var rv = $('

    ').text(excerpt); $.each(hlwords, function() { rv = rv.highlightText(this, 'highlighted'); }); diff --git a/_static/underscore-1.13.1.js b/_static/underscore-1.13.1.js new file mode 100644 index 000000000..ffd77af96 --- /dev/null +++ b/_static/underscore-1.13.1.js @@ -0,0 +1,2042 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define('underscore', factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () { + var current = global._; + var exports = global._ = factory(); + exports.noConflict = function () { global._ = current; return exports; }; + }())); +}(this, (function () { + // Underscore.js 1.13.1 + // https://underscorejs.org + // (c) 2009-2021 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors + // Underscore may be freely distributed under the MIT license. + + // Current version. + var VERSION = '1.13.1'; + + // Establish the root object, `window` (`self`) in the browser, `global` + // on the server, or `this` in some virtual machines. We use `self` + // instead of `window` for `WebWorker` support. + var root = typeof self == 'object' && self.self === self && self || + typeof global == 'object' && global.global === global && global || + Function('return this')() || + {}; + + // Save bytes in the minified (but not gzipped) version: + var ArrayProto = Array.prototype, ObjProto = Object.prototype; + var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null; + + // Create quick reference variables for speed access to core prototypes. + var push = ArrayProto.push, + slice = ArrayProto.slice, + toString = ObjProto.toString, + hasOwnProperty = ObjProto.hasOwnProperty; + + // Modern feature detection. + var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined', + supportsDataView = typeof DataView !== 'undefined'; + + // All **ECMAScript 5+** native function implementations that we hope to use + // are declared here. + var nativeIsArray = Array.isArray, + nativeKeys = Object.keys, + nativeCreate = Object.create, + nativeIsView = supportsArrayBuffer && ArrayBuffer.isView; + + // Create references to these builtin functions because we override them. + var _isNaN = isNaN, + _isFinite = isFinite; + + // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed. + var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString'); + var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString', + 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString']; + + // The largest integer that can be represented exactly. + var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1; + + // Some functions take a variable number of arguments, or a few expected + // arguments at the beginning and then a variable number of values to operate + // on. This helper accumulates all remaining arguments past the function’s + // argument length (or an explicit `startIndex`), into an array that becomes + // the last argument. Similar to ES6’s "rest parameter". + function restArguments(func, startIndex) { + startIndex = startIndex == null ? func.length - 1 : +startIndex; + return function() { + var length = Math.max(arguments.length - startIndex, 0), + rest = Array(length), + index = 0; + for (; index < length; index++) { + rest[index] = arguments[index + startIndex]; + } + switch (startIndex) { + case 0: return func.call(this, rest); + case 1: return func.call(this, arguments[0], rest); + case 2: return func.call(this, arguments[0], arguments[1], rest); + } + var args = Array(startIndex + 1); + for (index = 0; index < startIndex; index++) { + args[index] = arguments[index]; + } + args[startIndex] = rest; + return func.apply(this, args); + }; + } + + // Is a given variable an object? + function isObject(obj) { + var type = typeof obj; + return type === 'function' || type === 'object' && !!obj; + } + + // Is a given value equal to null? + function isNull(obj) { + return obj === null; + } + + // Is a given variable undefined? + function isUndefined(obj) { + return obj === void 0; + } + + // Is a given value a boolean? + function isBoolean(obj) { + return obj === true || obj === false || toString.call(obj) === '[object Boolean]'; + } + + // Is a given value a DOM element? + function isElement(obj) { + return !!(obj && obj.nodeType === 1); + } + + // Internal function for creating a `toString`-based type tester. + function tagTester(name) { + var tag = '[object ' + name + ']'; + return function(obj) { + return toString.call(obj) === tag; + }; + } + + var isString = tagTester('String'); + + var isNumber = tagTester('Number'); + + var isDate = tagTester('Date'); + + var isRegExp = tagTester('RegExp'); + + var isError = tagTester('Error'); + + var isSymbol = tagTester('Symbol'); + + var isArrayBuffer = tagTester('ArrayBuffer'); + + var isFunction = tagTester('Function'); + + // Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old + // v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236). + var nodelist = root.document && root.document.childNodes; + if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') { + isFunction = function(obj) { + return typeof obj == 'function' || false; + }; + } + + var isFunction$1 = isFunction; + + var hasObjectTag = tagTester('Object'); + + // In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`. + // In IE 11, the most common among them, this problem also applies to + // `Map`, `WeakMap` and `Set`. + var hasStringTagBug = ( + supportsDataView && hasObjectTag(new DataView(new ArrayBuffer(8))) + ), + isIE11 = (typeof Map !== 'undefined' && hasObjectTag(new Map)); + + var isDataView = tagTester('DataView'); + + // In IE 10 - Edge 13, we need a different heuristic + // to determine whether an object is a `DataView`. + function ie10IsDataView(obj) { + return obj != null && isFunction$1(obj.getInt8) && isArrayBuffer(obj.buffer); + } + + var isDataView$1 = (hasStringTagBug ? ie10IsDataView : isDataView); + + // Is a given value an array? + // Delegates to ECMA5's native `Array.isArray`. + var isArray = nativeIsArray || tagTester('Array'); + + // Internal function to check whether `key` is an own property name of `obj`. + function has$1(obj, key) { + return obj != null && hasOwnProperty.call(obj, key); + } + + var isArguments = tagTester('Arguments'); + + // Define a fallback version of the method in browsers (ahem, IE < 9), where + // there isn't any inspectable "Arguments" type. + (function() { + if (!isArguments(arguments)) { + isArguments = function(obj) { + return has$1(obj, 'callee'); + }; + } + }()); + + var isArguments$1 = isArguments; + + // Is a given object a finite number? + function isFinite$1(obj) { + return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj)); + } + + // Is the given value `NaN`? + function isNaN$1(obj) { + return isNumber(obj) && _isNaN(obj); + } + + // Predicate-generating function. Often useful outside of Underscore. + function constant(value) { + return function() { + return value; + }; + } + + // Common internal logic for `isArrayLike` and `isBufferLike`. + function createSizePropertyCheck(getSizeProperty) { + return function(collection) { + var sizeProperty = getSizeProperty(collection); + return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX; + } + } + + // Internal helper to generate a function to obtain property `key` from `obj`. + function shallowProperty(key) { + return function(obj) { + return obj == null ? void 0 : obj[key]; + }; + } + + // Internal helper to obtain the `byteLength` property of an object. + var getByteLength = shallowProperty('byteLength'); + + // Internal helper to determine whether we should spend extensive checks against + // `ArrayBuffer` et al. + var isBufferLike = createSizePropertyCheck(getByteLength); + + // Is a given value a typed array? + var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/; + function isTypedArray(obj) { + // `ArrayBuffer.isView` is the most future-proof, so use it when available. + // Otherwise, fall back on the above regular expression. + return nativeIsView ? (nativeIsView(obj) && !isDataView$1(obj)) : + isBufferLike(obj) && typedArrayPattern.test(toString.call(obj)); + } + + var isTypedArray$1 = supportsArrayBuffer ? isTypedArray : constant(false); + + // Internal helper to obtain the `length` property of an object. + var getLength = shallowProperty('length'); + + // Internal helper to create a simple lookup structure. + // `collectNonEnumProps` used to depend on `_.contains`, but this led to + // circular imports. `emulatedSet` is a one-off solution that only works for + // arrays of strings. + function emulatedSet(keys) { + var hash = {}; + for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true; + return { + contains: function(key) { return hash[key]; }, + push: function(key) { + hash[key] = true; + return keys.push(key); + } + }; + } + + // Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't + // be iterated by `for key in ...` and thus missed. Extends `keys` in place if + // needed. + function collectNonEnumProps(obj, keys) { + keys = emulatedSet(keys); + var nonEnumIdx = nonEnumerableProps.length; + var constructor = obj.constructor; + var proto = isFunction$1(constructor) && constructor.prototype || ObjProto; + + // Constructor is a special case. + var prop = 'constructor'; + if (has$1(obj, prop) && !keys.contains(prop)) keys.push(prop); + + while (nonEnumIdx--) { + prop = nonEnumerableProps[nonEnumIdx]; + if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) { + keys.push(prop); + } + } + } + + // Retrieve the names of an object's own properties. + // Delegates to **ECMAScript 5**'s native `Object.keys`. + function keys(obj) { + if (!isObject(obj)) return []; + if (nativeKeys) return nativeKeys(obj); + var keys = []; + for (var key in obj) if (has$1(obj, key)) keys.push(key); + // Ahem, IE < 9. + if (hasEnumBug) collectNonEnumProps(obj, keys); + return keys; + } + + // Is a given array, string, or object empty? + // An "empty" object has no enumerable own-properties. + function isEmpty(obj) { + if (obj == null) return true; + // Skip the more expensive `toString`-based type checks if `obj` has no + // `.length`. + var length = getLength(obj); + if (typeof length == 'number' && ( + isArray(obj) || isString(obj) || isArguments$1(obj) + )) return length === 0; + return getLength(keys(obj)) === 0; + } + + // Returns whether an object has a given set of `key:value` pairs. + function isMatch(object, attrs) { + var _keys = keys(attrs), length = _keys.length; + if (object == null) return !length; + var obj = Object(object); + for (var i = 0; i < length; i++) { + var key = _keys[i]; + if (attrs[key] !== obj[key] || !(key in obj)) return false; + } + return true; + } + + // If Underscore is called as a function, it returns a wrapped object that can + // be used OO-style. This wrapper holds altered versions of all functions added + // through `_.mixin`. Wrapped objects may be chained. + function _$1(obj) { + if (obj instanceof _$1) return obj; + if (!(this instanceof _$1)) return new _$1(obj); + this._wrapped = obj; + } + + _$1.VERSION = VERSION; + + // Extracts the result from a wrapped and chained object. + _$1.prototype.value = function() { + return this._wrapped; + }; + + // Provide unwrapping proxies for some methods used in engine operations + // such as arithmetic and JSON stringification. + _$1.prototype.valueOf = _$1.prototype.toJSON = _$1.prototype.value; + + _$1.prototype.toString = function() { + return String(this._wrapped); + }; + + // Internal function to wrap or shallow-copy an ArrayBuffer, + // typed array or DataView to a new view, reusing the buffer. + function toBufferView(bufferSource) { + return new Uint8Array( + bufferSource.buffer || bufferSource, + bufferSource.byteOffset || 0, + getByteLength(bufferSource) + ); + } + + // We use this string twice, so give it a name for minification. + var tagDataView = '[object DataView]'; + + // Internal recursive comparison function for `_.isEqual`. + function eq(a, b, aStack, bStack) { + // Identical objects are equal. `0 === -0`, but they aren't identical. + // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal). + if (a === b) return a !== 0 || 1 / a === 1 / b; + // `null` or `undefined` only equal to itself (strict comparison). + if (a == null || b == null) return false; + // `NaN`s are equivalent, but non-reflexive. + if (a !== a) return b !== b; + // Exhaust primitive checks + var type = typeof a; + if (type !== 'function' && type !== 'object' && typeof b != 'object') return false; + return deepEq(a, b, aStack, bStack); + } + + // Internal recursive comparison function for `_.isEqual`. + function deepEq(a, b, aStack, bStack) { + // Unwrap any wrapped objects. + if (a instanceof _$1) a = a._wrapped; + if (b instanceof _$1) b = b._wrapped; + // Compare `[[Class]]` names. + var className = toString.call(a); + if (className !== toString.call(b)) return false; + // Work around a bug in IE 10 - Edge 13. + if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) { + if (!isDataView$1(b)) return false; + className = tagDataView; + } + switch (className) { + // These types are compared by value. + case '[object RegExp]': + // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i') + case '[object String]': + // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is + // equivalent to `new String("5")`. + return '' + a === '' + b; + case '[object Number]': + // `NaN`s are equivalent, but non-reflexive. + // Object(NaN) is equivalent to NaN. + if (+a !== +a) return +b !== +b; + // An `egal` comparison is performed for other numeric values. + return +a === 0 ? 1 / +a === 1 / b : +a === +b; + case '[object Date]': + case '[object Boolean]': + // Coerce dates and booleans to numeric primitive values. Dates are compared by their + // millisecond representations. Note that invalid dates with millisecond representations + // of `NaN` are not equivalent. + return +a === +b; + case '[object Symbol]': + return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b); + case '[object ArrayBuffer]': + case tagDataView: + // Coerce to typed array so we can fall through. + return deepEq(toBufferView(a), toBufferView(b), aStack, bStack); + } + + var areArrays = className === '[object Array]'; + if (!areArrays && isTypedArray$1(a)) { + var byteLength = getByteLength(a); + if (byteLength !== getByteLength(b)) return false; + if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true; + areArrays = true; + } + if (!areArrays) { + if (typeof a != 'object' || typeof b != 'object') return false; + + // Objects with different constructors are not equivalent, but `Object`s or `Array`s + // from different frames are. + var aCtor = a.constructor, bCtor = b.constructor; + if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor && + isFunction$1(bCtor) && bCtor instanceof bCtor) + && ('constructor' in a && 'constructor' in b)) { + return false; + } + } + // Assume equality for cyclic structures. The algorithm for detecting cyclic + // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. + + // Initializing stack of traversed objects. + // It's done here since we only need them for objects and arrays comparison. + aStack = aStack || []; + bStack = bStack || []; + var length = aStack.length; + while (length--) { + // Linear search. Performance is inversely proportional to the number of + // unique nested structures. + if (aStack[length] === a) return bStack[length] === b; + } + + // Add the first object to the stack of traversed objects. + aStack.push(a); + bStack.push(b); + + // Recursively compare objects and arrays. + if (areArrays) { + // Compare array lengths to determine if a deep comparison is necessary. + length = a.length; + if (length !== b.length) return false; + // Deep compare the contents, ignoring non-numeric properties. + while (length--) { + if (!eq(a[length], b[length], aStack, bStack)) return false; + } + } else { + // Deep compare objects. + var _keys = keys(a), key; + length = _keys.length; + // Ensure that both objects contain the same number of properties before comparing deep equality. + if (keys(b).length !== length) return false; + while (length--) { + // Deep compare each member + key = _keys[length]; + if (!(has$1(b, key) && eq(a[key], b[key], aStack, bStack))) return false; + } + } + // Remove the first object from the stack of traversed objects. + aStack.pop(); + bStack.pop(); + return true; + } + + // Perform a deep comparison to check if two objects are equal. + function isEqual(a, b) { + return eq(a, b); + } + + // Retrieve all the enumerable property names of an object. + function allKeys(obj) { + if (!isObject(obj)) return []; + var keys = []; + for (var key in obj) keys.push(key); + // Ahem, IE < 9. + if (hasEnumBug) collectNonEnumProps(obj, keys); + return keys; + } + + // Since the regular `Object.prototype.toString` type tests don't work for + // some types in IE 11, we use a fingerprinting heuristic instead, based + // on the methods. It's not great, but it's the best we got. + // The fingerprint method lists are defined below. + function ie11fingerprint(methods) { + var length = getLength(methods); + return function(obj) { + if (obj == null) return false; + // `Map`, `WeakMap` and `Set` have no enumerable keys. + var keys = allKeys(obj); + if (getLength(keys)) return false; + for (var i = 0; i < length; i++) { + if (!isFunction$1(obj[methods[i]])) return false; + } + // If we are testing against `WeakMap`, we need to ensure that + // `obj` doesn't have a `forEach` method in order to distinguish + // it from a regular `Map`. + return methods !== weakMapMethods || !isFunction$1(obj[forEachName]); + }; + } + + // In the interest of compact minification, we write + // each string in the fingerprints only once. + var forEachName = 'forEach', + hasName = 'has', + commonInit = ['clear', 'delete'], + mapTail = ['get', hasName, 'set']; + + // `Map`, `WeakMap` and `Set` each have slightly different + // combinations of the above sublists. + var mapMethods = commonInit.concat(forEachName, mapTail), + weakMapMethods = commonInit.concat(mapTail), + setMethods = ['add'].concat(commonInit, forEachName, hasName); + + var isMap = isIE11 ? ie11fingerprint(mapMethods) : tagTester('Map'); + + var isWeakMap = isIE11 ? ie11fingerprint(weakMapMethods) : tagTester('WeakMap'); + + var isSet = isIE11 ? ie11fingerprint(setMethods) : tagTester('Set'); + + var isWeakSet = tagTester('WeakSet'); + + // Retrieve the values of an object's properties. + function values(obj) { + var _keys = keys(obj); + var length = _keys.length; + var values = Array(length); + for (var i = 0; i < length; i++) { + values[i] = obj[_keys[i]]; + } + return values; + } + + // Convert an object into a list of `[key, value]` pairs. + // The opposite of `_.object` with one argument. + function pairs(obj) { + var _keys = keys(obj); + var length = _keys.length; + var pairs = Array(length); + for (var i = 0; i < length; i++) { + pairs[i] = [_keys[i], obj[_keys[i]]]; + } + return pairs; + } + + // Invert the keys and values of an object. The values must be serializable. + function invert(obj) { + var result = {}; + var _keys = keys(obj); + for (var i = 0, length = _keys.length; i < length; i++) { + result[obj[_keys[i]]] = _keys[i]; + } + return result; + } + + // Return a sorted list of the function names available on the object. + function functions(obj) { + var names = []; + for (var key in obj) { + if (isFunction$1(obj[key])) names.push(key); + } + return names.sort(); + } + + // An internal function for creating assigner functions. + function createAssigner(keysFunc, defaults) { + return function(obj) { + var length = arguments.length; + if (defaults) obj = Object(obj); + if (length < 2 || obj == null) return obj; + for (var index = 1; index < length; index++) { + var source = arguments[index], + keys = keysFunc(source), + l = keys.length; + for (var i = 0; i < l; i++) { + var key = keys[i]; + if (!defaults || obj[key] === void 0) obj[key] = source[key]; + } + } + return obj; + }; + } + + // Extend a given object with all the properties in passed-in object(s). + var extend = createAssigner(allKeys); + + // Assigns a given object with all the own properties in the passed-in + // object(s). + // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign) + var extendOwn = createAssigner(keys); + + // Fill in a given object with default properties. + var defaults = createAssigner(allKeys, true); + + // Create a naked function reference for surrogate-prototype-swapping. + function ctor() { + return function(){}; + } + + // An internal function for creating a new object that inherits from another. + function baseCreate(prototype) { + if (!isObject(prototype)) return {}; + if (nativeCreate) return nativeCreate(prototype); + var Ctor = ctor(); + Ctor.prototype = prototype; + var result = new Ctor; + Ctor.prototype = null; + return result; + } + + // Creates an object that inherits from the given prototype object. + // If additional properties are provided then they will be added to the + // created object. + function create(prototype, props) { + var result = baseCreate(prototype); + if (props) extendOwn(result, props); + return result; + } + + // Create a (shallow-cloned) duplicate of an object. + function clone(obj) { + if (!isObject(obj)) return obj; + return isArray(obj) ? obj.slice() : extend({}, obj); + } + + // Invokes `interceptor` with the `obj` and then returns `obj`. + // The primary purpose of this method is to "tap into" a method chain, in + // order to perform operations on intermediate results within the chain. + function tap(obj, interceptor) { + interceptor(obj); + return obj; + } + + // Normalize a (deep) property `path` to array. + // Like `_.iteratee`, this function can be customized. + function toPath$1(path) { + return isArray(path) ? path : [path]; + } + _$1.toPath = toPath$1; + + // Internal wrapper for `_.toPath` to enable minification. + // Similar to `cb` for `_.iteratee`. + function toPath(path) { + return _$1.toPath(path); + } + + // Internal function to obtain a nested property in `obj` along `path`. + function deepGet(obj, path) { + var length = path.length; + for (var i = 0; i < length; i++) { + if (obj == null) return void 0; + obj = obj[path[i]]; + } + return length ? obj : void 0; + } + + // Get the value of the (deep) property on `path` from `object`. + // If any property in `path` does not exist or if the value is + // `undefined`, return `defaultValue` instead. + // The `path` is normalized through `_.toPath`. + function get(object, path, defaultValue) { + var value = deepGet(object, toPath(path)); + return isUndefined(value) ? defaultValue : value; + } + + // Shortcut function for checking if an object has a given property directly on + // itself (in other words, not on a prototype). Unlike the internal `has` + // function, this public version can also traverse nested properties. + function has(obj, path) { + path = toPath(path); + var length = path.length; + for (var i = 0; i < length; i++) { + var key = path[i]; + if (!has$1(obj, key)) return false; + obj = obj[key]; + } + return !!length; + } + + // Keep the identity function around for default iteratees. + function identity(value) { + return value; + } + + // Returns a predicate for checking whether an object has a given set of + // `key:value` pairs. + function matcher(attrs) { + attrs = extendOwn({}, attrs); + return function(obj) { + return isMatch(obj, attrs); + }; + } + + // Creates a function that, when passed an object, will traverse that object’s + // properties down the given `path`, specified as an array of keys or indices. + function property(path) { + path = toPath(path); + return function(obj) { + return deepGet(obj, path); + }; + } + + // Internal function that returns an efficient (for current engines) version + // of the passed-in callback, to be repeatedly applied in other Underscore + // functions. + function optimizeCb(func, context, argCount) { + if (context === void 0) return func; + switch (argCount == null ? 3 : argCount) { + case 1: return function(value) { + return func.call(context, value); + }; + // The 2-argument case is omitted because we’re not using it. + case 3: return function(value, index, collection) { + return func.call(context, value, index, collection); + }; + case 4: return function(accumulator, value, index, collection) { + return func.call(context, accumulator, value, index, collection); + }; + } + return function() { + return func.apply(context, arguments); + }; + } + + // An internal function to generate callbacks that can be applied to each + // element in a collection, returning the desired result — either `_.identity`, + // an arbitrary callback, a property matcher, or a property accessor. + function baseIteratee(value, context, argCount) { + if (value == null) return identity; + if (isFunction$1(value)) return optimizeCb(value, context, argCount); + if (isObject(value) && !isArray(value)) return matcher(value); + return property(value); + } + + // External wrapper for our callback generator. Users may customize + // `_.iteratee` if they want additional predicate/iteratee shorthand styles. + // This abstraction hides the internal-only `argCount` argument. + function iteratee(value, context) { + return baseIteratee(value, context, Infinity); + } + _$1.iteratee = iteratee; + + // The function we call internally to generate a callback. It invokes + // `_.iteratee` if overridden, otherwise `baseIteratee`. + function cb(value, context, argCount) { + if (_$1.iteratee !== iteratee) return _$1.iteratee(value, context); + return baseIteratee(value, context, argCount); + } + + // Returns the results of applying the `iteratee` to each element of `obj`. + // In contrast to `_.map` it returns an object. + function mapObject(obj, iteratee, context) { + iteratee = cb(iteratee, context); + var _keys = keys(obj), + length = _keys.length, + results = {}; + for (var index = 0; index < length; index++) { + var currentKey = _keys[index]; + results[currentKey] = iteratee(obj[currentKey], currentKey, obj); + } + return results; + } + + // Predicate-generating function. Often useful outside of Underscore. + function noop(){} + + // Generates a function for a given object that returns a given property. + function propertyOf(obj) { + if (obj == null) return noop; + return function(path) { + return get(obj, path); + }; + } + + // Run a function **n** times. + function times(n, iteratee, context) { + var accum = Array(Math.max(0, n)); + iteratee = optimizeCb(iteratee, context, 1); + for (var i = 0; i < n; i++) accum[i] = iteratee(i); + return accum; + } + + // Return a random integer between `min` and `max` (inclusive). + function random(min, max) { + if (max == null) { + max = min; + min = 0; + } + return min + Math.floor(Math.random() * (max - min + 1)); + } + + // A (possibly faster) way to get the current timestamp as an integer. + var now = Date.now || function() { + return new Date().getTime(); + }; + + // Internal helper to generate functions for escaping and unescaping strings + // to/from HTML interpolation. + function createEscaper(map) { + var escaper = function(match) { + return map[match]; + }; + // Regexes for identifying a key that needs to be escaped. + var source = '(?:' + keys(map).join('|') + ')'; + var testRegexp = RegExp(source); + var replaceRegexp = RegExp(source, 'g'); + return function(string) { + string = string == null ? '' : '' + string; + return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string; + }; + } + + // Internal list of HTML entities for escaping. + var escapeMap = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`' + }; + + // Function for escaping strings to HTML interpolation. + var _escape = createEscaper(escapeMap); + + // Internal list of HTML entities for unescaping. + var unescapeMap = invert(escapeMap); + + // Function for unescaping strings from HTML interpolation. + var _unescape = createEscaper(unescapeMap); + + // By default, Underscore uses ERB-style template delimiters. Change the + // following template settings to use alternative delimiters. + var templateSettings = _$1.templateSettings = { + evaluate: /<%([\s\S]+?)%>/g, + interpolate: /<%=([\s\S]+?)%>/g, + escape: /<%-([\s\S]+?)%>/g + }; + + // When customizing `_.templateSettings`, if you don't want to define an + // interpolation, evaluation or escaping regex, we need one that is + // guaranteed not to match. + var noMatch = /(.)^/; + + // Certain characters need to be escaped so that they can be put into a + // string literal. + var escapes = { + "'": "'", + '\\': '\\', + '\r': 'r', + '\n': 'n', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g; + + function escapeChar(match) { + return '\\' + escapes[match]; + } + + // In order to prevent third-party code injection through + // `_.templateSettings.variable`, we test it against the following regular + // expression. It is intentionally a bit more liberal than just matching valid + // identifiers, but still prevents possible loopholes through defaults or + // destructuring assignment. + var bareIdentifier = /^\s*(\w|\$)+\s*$/; + + // JavaScript micro-templating, similar to John Resig's implementation. + // Underscore templating handles arbitrary delimiters, preserves whitespace, + // and correctly escapes quotes within interpolated code. + // NB: `oldSettings` only exists for backwards compatibility. + function template(text, settings, oldSettings) { + if (!settings && oldSettings) settings = oldSettings; + settings = defaults({}, settings, _$1.templateSettings); + + // Combine delimiters into one regular expression via alternation. + var matcher = RegExp([ + (settings.escape || noMatch).source, + (settings.interpolate || noMatch).source, + (settings.evaluate || noMatch).source + ].join('|') + '|$', 'g'); + + // Compile the template source, escaping string literals appropriately. + var index = 0; + var source = "__p+='"; + text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { + source += text.slice(index, offset).replace(escapeRegExp, escapeChar); + index = offset + match.length; + + if (escape) { + source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; + } else if (interpolate) { + source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; + } else if (evaluate) { + source += "';\n" + evaluate + "\n__p+='"; + } + + // Adobe VMs need the match returned to produce the correct offset. + return match; + }); + source += "';\n"; + + var argument = settings.variable; + if (argument) { + // Insure against third-party code injection. (CVE-2021-23358) + if (!bareIdentifier.test(argument)) throw new Error( + 'variable is not a bare identifier: ' + argument + ); + } else { + // If a variable is not specified, place data values in local scope. + source = 'with(obj||{}){\n' + source + '}\n'; + argument = 'obj'; + } + + source = "var __t,__p='',__j=Array.prototype.join," + + "print=function(){__p+=__j.call(arguments,'');};\n" + + source + 'return __p;\n'; + + var render; + try { + render = new Function(argument, '_', source); + } catch (e) { + e.source = source; + throw e; + } + + var template = function(data) { + return render.call(this, data, _$1); + }; + + // Provide the compiled source as a convenience for precompilation. + template.source = 'function(' + argument + '){\n' + source + '}'; + + return template; + } + + // Traverses the children of `obj` along `path`. If a child is a function, it + // is invoked with its parent as context. Returns the value of the final + // child, or `fallback` if any child is undefined. + function result(obj, path, fallback) { + path = toPath(path); + var length = path.length; + if (!length) { + return isFunction$1(fallback) ? fallback.call(obj) : fallback; + } + for (var i = 0; i < length; i++) { + var prop = obj == null ? void 0 : obj[path[i]]; + if (prop === void 0) { + prop = fallback; + i = length; // Ensure we don't continue iterating. + } + obj = isFunction$1(prop) ? prop.call(obj) : prop; + } + return obj; + } + + // Generate a unique integer id (unique within the entire client session). + // Useful for temporary DOM ids. + var idCounter = 0; + function uniqueId(prefix) { + var id = ++idCounter + ''; + return prefix ? prefix + id : id; + } + + // Start chaining a wrapped Underscore object. + function chain(obj) { + var instance = _$1(obj); + instance._chain = true; + return instance; + } + + // Internal function to execute `sourceFunc` bound to `context` with optional + // `args`. Determines whether to execute a function as a constructor or as a + // normal function. + function executeBound(sourceFunc, boundFunc, context, callingContext, args) { + if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args); + var self = baseCreate(sourceFunc.prototype); + var result = sourceFunc.apply(self, args); + if (isObject(result)) return result; + return self; + } + + // Partially apply a function by creating a version that has had some of its + // arguments pre-filled, without changing its dynamic `this` context. `_` acts + // as a placeholder by default, allowing any combination of arguments to be + // pre-filled. Set `_.partial.placeholder` for a custom placeholder argument. + var partial = restArguments(function(func, boundArgs) { + var placeholder = partial.placeholder; + var bound = function() { + var position = 0, length = boundArgs.length; + var args = Array(length); + for (var i = 0; i < length; i++) { + args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i]; + } + while (position < arguments.length) args.push(arguments[position++]); + return executeBound(func, bound, this, this, args); + }; + return bound; + }); + + partial.placeholder = _$1; + + // Create a function bound to a given object (assigning `this`, and arguments, + // optionally). + var bind = restArguments(function(func, context, args) { + if (!isFunction$1(func)) throw new TypeError('Bind must be called on a function'); + var bound = restArguments(function(callArgs) { + return executeBound(func, bound, context, this, args.concat(callArgs)); + }); + return bound; + }); + + // Internal helper for collection methods to determine whether a collection + // should be iterated as an array or as an object. + // Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength + // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094 + var isArrayLike = createSizePropertyCheck(getLength); + + // Internal implementation of a recursive `flatten` function. + function flatten$1(input, depth, strict, output) { + output = output || []; + if (!depth && depth !== 0) { + depth = Infinity; + } else if (depth <= 0) { + return output.concat(input); + } + var idx = output.length; + for (var i = 0, length = getLength(input); i < length; i++) { + var value = input[i]; + if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) { + // Flatten current level of array or arguments object. + if (depth > 1) { + flatten$1(value, depth - 1, strict, output); + idx = output.length; + } else { + var j = 0, len = value.length; + while (j < len) output[idx++] = value[j++]; + } + } else if (!strict) { + output[idx++] = value; + } + } + return output; + } + + // Bind a number of an object's methods to that object. Remaining arguments + // are the method names to be bound. Useful for ensuring that all callbacks + // defined on an object belong to it. + var bindAll = restArguments(function(obj, keys) { + keys = flatten$1(keys, false, false); + var index = keys.length; + if (index < 1) throw new Error('bindAll must be passed function names'); + while (index--) { + var key = keys[index]; + obj[key] = bind(obj[key], obj); + } + return obj; + }); + + // Memoize an expensive function by storing its results. + function memoize(func, hasher) { + var memoize = function(key) { + var cache = memoize.cache; + var address = '' + (hasher ? hasher.apply(this, arguments) : key); + if (!has$1(cache, address)) cache[address] = func.apply(this, arguments); + return cache[address]; + }; + memoize.cache = {}; + return memoize; + } + + // Delays a function for the given number of milliseconds, and then calls + // it with the arguments supplied. + var delay = restArguments(function(func, wait, args) { + return setTimeout(function() { + return func.apply(null, args); + }, wait); + }); + + // Defers a function, scheduling it to run after the current call stack has + // cleared. + var defer = partial(delay, _$1, 1); + + // Returns a function, that, when invoked, will only be triggered at most once + // during a given window of time. Normally, the throttled function will run + // as much as it can, without ever going more than once per `wait` duration; + // but if you'd like to disable the execution on the leading edge, pass + // `{leading: false}`. To disable execution on the trailing edge, ditto. + function throttle(func, wait, options) { + var timeout, context, args, result; + var previous = 0; + if (!options) options = {}; + + var later = function() { + previous = options.leading === false ? 0 : now(); + timeout = null; + result = func.apply(context, args); + if (!timeout) context = args = null; + }; + + var throttled = function() { + var _now = now(); + if (!previous && options.leading === false) previous = _now; + var remaining = wait - (_now - previous); + context = this; + args = arguments; + if (remaining <= 0 || remaining > wait) { + if (timeout) { + clearTimeout(timeout); + timeout = null; + } + previous = _now; + result = func.apply(context, args); + if (!timeout) context = args = null; + } else if (!timeout && options.trailing !== false) { + timeout = setTimeout(later, remaining); + } + return result; + }; + + throttled.cancel = function() { + clearTimeout(timeout); + previous = 0; + timeout = context = args = null; + }; + + return throttled; + } + + // When a sequence of calls of the returned function ends, the argument + // function is triggered. The end of a sequence is defined by the `wait` + // parameter. If `immediate` is passed, the argument function will be + // triggered at the beginning of the sequence instead of at the end. + function debounce(func, wait, immediate) { + var timeout, previous, args, result, context; + + var later = function() { + var passed = now() - previous; + if (wait > passed) { + timeout = setTimeout(later, wait - passed); + } else { + timeout = null; + if (!immediate) result = func.apply(context, args); + // This check is needed because `func` can recursively invoke `debounced`. + if (!timeout) args = context = null; + } + }; + + var debounced = restArguments(function(_args) { + context = this; + args = _args; + previous = now(); + if (!timeout) { + timeout = setTimeout(later, wait); + if (immediate) result = func.apply(context, args); + } + return result; + }); + + debounced.cancel = function() { + clearTimeout(timeout); + timeout = args = context = null; + }; + + return debounced; + } + + // Returns the first function passed as an argument to the second, + // allowing you to adjust arguments, run code before and after, and + // conditionally execute the original function. + function wrap(func, wrapper) { + return partial(wrapper, func); + } + + // Returns a negated version of the passed-in predicate. + function negate(predicate) { + return function() { + return !predicate.apply(this, arguments); + }; + } + + // Returns a function that is the composition of a list of functions, each + // consuming the return value of the function that follows. + function compose() { + var args = arguments; + var start = args.length - 1; + return function() { + var i = start; + var result = args[start].apply(this, arguments); + while (i--) result = args[i].call(this, result); + return result; + }; + } + + // Returns a function that will only be executed on and after the Nth call. + function after(times, func) { + return function() { + if (--times < 1) { + return func.apply(this, arguments); + } + }; + } + + // Returns a function that will only be executed up to (but not including) the + // Nth call. + function before(times, func) { + var memo; + return function() { + if (--times > 0) { + memo = func.apply(this, arguments); + } + if (times <= 1) func = null; + return memo; + }; + } + + // Returns a function that will be executed at most one time, no matter how + // often you call it. Useful for lazy initialization. + var once = partial(before, 2); + + // Returns the first key on an object that passes a truth test. + function findKey(obj, predicate, context) { + predicate = cb(predicate, context); + var _keys = keys(obj), key; + for (var i = 0, length = _keys.length; i < length; i++) { + key = _keys[i]; + if (predicate(obj[key], key, obj)) return key; + } + } + + // Internal function to generate `_.findIndex` and `_.findLastIndex`. + function createPredicateIndexFinder(dir) { + return function(array, predicate, context) { + predicate = cb(predicate, context); + var length = getLength(array); + var index = dir > 0 ? 0 : length - 1; + for (; index >= 0 && index < length; index += dir) { + if (predicate(array[index], index, array)) return index; + } + return -1; + }; + } + + // Returns the first index on an array-like that passes a truth test. + var findIndex = createPredicateIndexFinder(1); + + // Returns the last index on an array-like that passes a truth test. + var findLastIndex = createPredicateIndexFinder(-1); + + // Use a comparator function to figure out the smallest index at which + // an object should be inserted so as to maintain order. Uses binary search. + function sortedIndex(array, obj, iteratee, context) { + iteratee = cb(iteratee, context, 1); + var value = iteratee(obj); + var low = 0, high = getLength(array); + while (low < high) { + var mid = Math.floor((low + high) / 2); + if (iteratee(array[mid]) < value) low = mid + 1; else high = mid; + } + return low; + } + + // Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions. + function createIndexFinder(dir, predicateFind, sortedIndex) { + return function(array, item, idx) { + var i = 0, length = getLength(array); + if (typeof idx == 'number') { + if (dir > 0) { + i = idx >= 0 ? idx : Math.max(idx + length, i); + } else { + length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1; + } + } else if (sortedIndex && idx && length) { + idx = sortedIndex(array, item); + return array[idx] === item ? idx : -1; + } + if (item !== item) { + idx = predicateFind(slice.call(array, i, length), isNaN$1); + return idx >= 0 ? idx + i : -1; + } + for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) { + if (array[idx] === item) return idx; + } + return -1; + }; + } + + // Return the position of the first occurrence of an item in an array, + // or -1 if the item is not included in the array. + // If the array is large and already in sort order, pass `true` + // for **isSorted** to use binary search. + var indexOf = createIndexFinder(1, findIndex, sortedIndex); + + // Return the position of the last occurrence of an item in an array, + // or -1 if the item is not included in the array. + var lastIndexOf = createIndexFinder(-1, findLastIndex); + + // Return the first value which passes a truth test. + function find(obj, predicate, context) { + var keyFinder = isArrayLike(obj) ? findIndex : findKey; + var key = keyFinder(obj, predicate, context); + if (key !== void 0 && key !== -1) return obj[key]; + } + + // Convenience version of a common use case of `_.find`: getting the first + // object containing specific `key:value` pairs. + function findWhere(obj, attrs) { + return find(obj, matcher(attrs)); + } + + // The cornerstone for collection functions, an `each` + // implementation, aka `forEach`. + // Handles raw objects in addition to array-likes. Treats all + // sparse array-likes as if they were dense. + function each(obj, iteratee, context) { + iteratee = optimizeCb(iteratee, context); + var i, length; + if (isArrayLike(obj)) { + for (i = 0, length = obj.length; i < length; i++) { + iteratee(obj[i], i, obj); + } + } else { + var _keys = keys(obj); + for (i = 0, length = _keys.length; i < length; i++) { + iteratee(obj[_keys[i]], _keys[i], obj); + } + } + return obj; + } + + // Return the results of applying the iteratee to each element. + function map(obj, iteratee, context) { + iteratee = cb(iteratee, context); + var _keys = !isArrayLike(obj) && keys(obj), + length = (_keys || obj).length, + results = Array(length); + for (var index = 0; index < length; index++) { + var currentKey = _keys ? _keys[index] : index; + results[index] = iteratee(obj[currentKey], currentKey, obj); + } + return results; + } + + // Internal helper to create a reducing function, iterating left or right. + function createReduce(dir) { + // Wrap code that reassigns argument variables in a separate function than + // the one that accesses `arguments.length` to avoid a perf hit. (#1991) + var reducer = function(obj, iteratee, memo, initial) { + var _keys = !isArrayLike(obj) && keys(obj), + length = (_keys || obj).length, + index = dir > 0 ? 0 : length - 1; + if (!initial) { + memo = obj[_keys ? _keys[index] : index]; + index += dir; + } + for (; index >= 0 && index < length; index += dir) { + var currentKey = _keys ? _keys[index] : index; + memo = iteratee(memo, obj[currentKey], currentKey, obj); + } + return memo; + }; + + return function(obj, iteratee, memo, context) { + var initial = arguments.length >= 3; + return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial); + }; + } + + // **Reduce** builds up a single result from a list of values, aka `inject`, + // or `foldl`. + var reduce = createReduce(1); + + // The right-associative version of reduce, also known as `foldr`. + var reduceRight = createReduce(-1); + + // Return all the elements that pass a truth test. + function filter(obj, predicate, context) { + var results = []; + predicate = cb(predicate, context); + each(obj, function(value, index, list) { + if (predicate(value, index, list)) results.push(value); + }); + return results; + } + + // Return all the elements for which a truth test fails. + function reject(obj, predicate, context) { + return filter(obj, negate(cb(predicate)), context); + } + + // Determine whether all of the elements pass a truth test. + function every(obj, predicate, context) { + predicate = cb(predicate, context); + var _keys = !isArrayLike(obj) && keys(obj), + length = (_keys || obj).length; + for (var index = 0; index < length; index++) { + var currentKey = _keys ? _keys[index] : index; + if (!predicate(obj[currentKey], currentKey, obj)) return false; + } + return true; + } + + // Determine if at least one element in the object passes a truth test. + function some(obj, predicate, context) { + predicate = cb(predicate, context); + var _keys = !isArrayLike(obj) && keys(obj), + length = (_keys || obj).length; + for (var index = 0; index < length; index++) { + var currentKey = _keys ? _keys[index] : index; + if (predicate(obj[currentKey], currentKey, obj)) return true; + } + return false; + } + + // Determine if the array or object contains a given item (using `===`). + function contains(obj, item, fromIndex, guard) { + if (!isArrayLike(obj)) obj = values(obj); + if (typeof fromIndex != 'number' || guard) fromIndex = 0; + return indexOf(obj, item, fromIndex) >= 0; + } + + // Invoke a method (with arguments) on every item in a collection. + var invoke = restArguments(function(obj, path, args) { + var contextPath, func; + if (isFunction$1(path)) { + func = path; + } else { + path = toPath(path); + contextPath = path.slice(0, -1); + path = path[path.length - 1]; + } + return map(obj, function(context) { + var method = func; + if (!method) { + if (contextPath && contextPath.length) { + context = deepGet(context, contextPath); + } + if (context == null) return void 0; + method = context[path]; + } + return method == null ? method : method.apply(context, args); + }); + }); + + // Convenience version of a common use case of `_.map`: fetching a property. + function pluck(obj, key) { + return map(obj, property(key)); + } + + // Convenience version of a common use case of `_.filter`: selecting only + // objects containing specific `key:value` pairs. + function where(obj, attrs) { + return filter(obj, matcher(attrs)); + } + + // Return the maximum element (or element-based computation). + function max(obj, iteratee, context) { + var result = -Infinity, lastComputed = -Infinity, + value, computed; + if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) { + obj = isArrayLike(obj) ? obj : values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value != null && value > result) { + result = value; + } + } + } else { + iteratee = cb(iteratee, context); + each(obj, function(v, index, list) { + computed = iteratee(v, index, list); + if (computed > lastComputed || computed === -Infinity && result === -Infinity) { + result = v; + lastComputed = computed; + } + }); + } + return result; + } + + // Return the minimum element (or element-based computation). + function min(obj, iteratee, context) { + var result = Infinity, lastComputed = Infinity, + value, computed; + if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) { + obj = isArrayLike(obj) ? obj : values(obj); + for (var i = 0, length = obj.length; i < length; i++) { + value = obj[i]; + if (value != null && value < result) { + result = value; + } + } + } else { + iteratee = cb(iteratee, context); + each(obj, function(v, index, list) { + computed = iteratee(v, index, list); + if (computed < lastComputed || computed === Infinity && result === Infinity) { + result = v; + lastComputed = computed; + } + }); + } + return result; + } + + // Sample **n** random values from a collection using the modern version of the + // [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle). + // If **n** is not specified, returns a single random element. + // The internal `guard` argument allows it to work with `_.map`. + function sample(obj, n, guard) { + if (n == null || guard) { + if (!isArrayLike(obj)) obj = values(obj); + return obj[random(obj.length - 1)]; + } + var sample = isArrayLike(obj) ? clone(obj) : values(obj); + var length = getLength(sample); + n = Math.max(Math.min(n, length), 0); + var last = length - 1; + for (var index = 0; index < n; index++) { + var rand = random(index, last); + var temp = sample[index]; + sample[index] = sample[rand]; + sample[rand] = temp; + } + return sample.slice(0, n); + } + + // Shuffle a collection. + function shuffle(obj) { + return sample(obj, Infinity); + } + + // Sort the object's values by a criterion produced by an iteratee. + function sortBy(obj, iteratee, context) { + var index = 0; + iteratee = cb(iteratee, context); + return pluck(map(obj, function(value, key, list) { + return { + value: value, + index: index++, + criteria: iteratee(value, key, list) + }; + }).sort(function(left, right) { + var a = left.criteria; + var b = right.criteria; + if (a !== b) { + if (a > b || a === void 0) return 1; + if (a < b || b === void 0) return -1; + } + return left.index - right.index; + }), 'value'); + } + + // An internal function used for aggregate "group by" operations. + function group(behavior, partition) { + return function(obj, iteratee, context) { + var result = partition ? [[], []] : {}; + iteratee = cb(iteratee, context); + each(obj, function(value, index) { + var key = iteratee(value, index, obj); + behavior(result, value, key); + }); + return result; + }; + } + + // Groups the object's values by a criterion. Pass either a string attribute + // to group by, or a function that returns the criterion. + var groupBy = group(function(result, value, key) { + if (has$1(result, key)) result[key].push(value); else result[key] = [value]; + }); + + // Indexes the object's values by a criterion, similar to `_.groupBy`, but for + // when you know that your index values will be unique. + var indexBy = group(function(result, value, key) { + result[key] = value; + }); + + // Counts instances of an object that group by a certain criterion. Pass + // either a string attribute to count by, or a function that returns the + // criterion. + var countBy = group(function(result, value, key) { + if (has$1(result, key)) result[key]++; else result[key] = 1; + }); + + // Split a collection into two arrays: one whose elements all pass the given + // truth test, and one whose elements all do not pass the truth test. + var partition = group(function(result, value, pass) { + result[pass ? 0 : 1].push(value); + }, true); + + // Safely create a real, live array from anything iterable. + var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g; + function toArray(obj) { + if (!obj) return []; + if (isArray(obj)) return slice.call(obj); + if (isString(obj)) { + // Keep surrogate pair characters together. + return obj.match(reStrSymbol); + } + if (isArrayLike(obj)) return map(obj, identity); + return values(obj); + } + + // Return the number of elements in a collection. + function size(obj) { + if (obj == null) return 0; + return isArrayLike(obj) ? obj.length : keys(obj).length; + } + + // Internal `_.pick` helper function to determine whether `key` is an enumerable + // property name of `obj`. + function keyInObj(value, key, obj) { + return key in obj; + } + + // Return a copy of the object only containing the allowed properties. + var pick = restArguments(function(obj, keys) { + var result = {}, iteratee = keys[0]; + if (obj == null) return result; + if (isFunction$1(iteratee)) { + if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]); + keys = allKeys(obj); + } else { + iteratee = keyInObj; + keys = flatten$1(keys, false, false); + obj = Object(obj); + } + for (var i = 0, length = keys.length; i < length; i++) { + var key = keys[i]; + var value = obj[key]; + if (iteratee(value, key, obj)) result[key] = value; + } + return result; + }); + + // Return a copy of the object without the disallowed properties. + var omit = restArguments(function(obj, keys) { + var iteratee = keys[0], context; + if (isFunction$1(iteratee)) { + iteratee = negate(iteratee); + if (keys.length > 1) context = keys[1]; + } else { + keys = map(flatten$1(keys, false, false), String); + iteratee = function(value, key) { + return !contains(keys, key); + }; + } + return pick(obj, iteratee, context); + }); + + // Returns everything but the last entry of the array. Especially useful on + // the arguments object. Passing **n** will return all the values in + // the array, excluding the last N. + function initial(array, n, guard) { + return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n))); + } + + // Get the first element of an array. Passing **n** will return the first N + // values in the array. The **guard** check allows it to work with `_.map`. + function first(array, n, guard) { + if (array == null || array.length < 1) return n == null || guard ? void 0 : []; + if (n == null || guard) return array[0]; + return initial(array, array.length - n); + } + + // Returns everything but the first entry of the `array`. Especially useful on + // the `arguments` object. Passing an **n** will return the rest N values in the + // `array`. + function rest(array, n, guard) { + return slice.call(array, n == null || guard ? 1 : n); + } + + // Get the last element of an array. Passing **n** will return the last N + // values in the array. + function last(array, n, guard) { + if (array == null || array.length < 1) return n == null || guard ? void 0 : []; + if (n == null || guard) return array[array.length - 1]; + return rest(array, Math.max(0, array.length - n)); + } + + // Trim out all falsy values from an array. + function compact(array) { + return filter(array, Boolean); + } + + // Flatten out an array, either recursively (by default), or up to `depth`. + // Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively. + function flatten(array, depth) { + return flatten$1(array, depth, false); + } + + // Take the difference between one array and a number of other arrays. + // Only the elements present in just the first array will remain. + var difference = restArguments(function(array, rest) { + rest = flatten$1(rest, true, true); + return filter(array, function(value){ + return !contains(rest, value); + }); + }); + + // Return a version of the array that does not contain the specified value(s). + var without = restArguments(function(array, otherArrays) { + return difference(array, otherArrays); + }); + + // Produce a duplicate-free version of the array. If the array has already + // been sorted, you have the option of using a faster algorithm. + // The faster algorithm will not work with an iteratee if the iteratee + // is not a one-to-one function, so providing an iteratee will disable + // the faster algorithm. + function uniq(array, isSorted, iteratee, context) { + if (!isBoolean(isSorted)) { + context = iteratee; + iteratee = isSorted; + isSorted = false; + } + if (iteratee != null) iteratee = cb(iteratee, context); + var result = []; + var seen = []; + for (var i = 0, length = getLength(array); i < length; i++) { + var value = array[i], + computed = iteratee ? iteratee(value, i, array) : value; + if (isSorted && !iteratee) { + if (!i || seen !== computed) result.push(value); + seen = computed; + } else if (iteratee) { + if (!contains(seen, computed)) { + seen.push(computed); + result.push(value); + } + } else if (!contains(result, value)) { + result.push(value); + } + } + return result; + } + + // Produce an array that contains the union: each distinct element from all of + // the passed-in arrays. + var union = restArguments(function(arrays) { + return uniq(flatten$1(arrays, true, true)); + }); + + // Produce an array that contains every item shared between all the + // passed-in arrays. + function intersection(array) { + var result = []; + var argsLength = arguments.length; + for (var i = 0, length = getLength(array); i < length; i++) { + var item = array[i]; + if (contains(result, item)) continue; + var j; + for (j = 1; j < argsLength; j++) { + if (!contains(arguments[j], item)) break; + } + if (j === argsLength) result.push(item); + } + return result; + } + + // Complement of zip. Unzip accepts an array of arrays and groups + // each array's elements on shared indices. + function unzip(array) { + var length = array && max(array, getLength).length || 0; + var result = Array(length); + + for (var index = 0; index < length; index++) { + result[index] = pluck(array, index); + } + return result; + } + + // Zip together multiple lists into a single array -- elements that share + // an index go together. + var zip = restArguments(unzip); + + // Converts lists into objects. Pass either a single array of `[key, value]` + // pairs, or two parallel arrays of the same length -- one of keys, and one of + // the corresponding values. Passing by pairs is the reverse of `_.pairs`. + function object(list, values) { + var result = {}; + for (var i = 0, length = getLength(list); i < length; i++) { + if (values) { + result[list[i]] = values[i]; + } else { + result[list[i][0]] = list[i][1]; + } + } + return result; + } + + // Generate an integer Array containing an arithmetic progression. A port of + // the native Python `range()` function. See + // [the Python documentation](https://docs.python.org/library/functions.html#range). + function range(start, stop, step) { + if (stop == null) { + stop = start || 0; + start = 0; + } + if (!step) { + step = stop < start ? -1 : 1; + } + + var length = Math.max(Math.ceil((stop - start) / step), 0); + var range = Array(length); + + for (var idx = 0; idx < length; idx++, start += step) { + range[idx] = start; + } + + return range; + } + + // Chunk a single array into multiple arrays, each containing `count` or fewer + // items. + function chunk(array, count) { + if (count == null || count < 1) return []; + var result = []; + var i = 0, length = array.length; + while (i < length) { + result.push(slice.call(array, i, i += count)); + } + return result; + } + + // Helper function to continue chaining intermediate results. + function chainResult(instance, obj) { + return instance._chain ? _$1(obj).chain() : obj; + } + + // Add your own custom functions to the Underscore object. + function mixin(obj) { + each(functions(obj), function(name) { + var func = _$1[name] = obj[name]; + _$1.prototype[name] = function() { + var args = [this._wrapped]; + push.apply(args, arguments); + return chainResult(this, func.apply(_$1, args)); + }; + }); + return _$1; + } + + // Add all mutator `Array` functions to the wrapper. + each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { + var method = ArrayProto[name]; + _$1.prototype[name] = function() { + var obj = this._wrapped; + if (obj != null) { + method.apply(obj, arguments); + if ((name === 'shift' || name === 'splice') && obj.length === 0) { + delete obj[0]; + } + } + return chainResult(this, obj); + }; + }); + + // Add all accessor `Array` functions to the wrapper. + each(['concat', 'join', 'slice'], function(name) { + var method = ArrayProto[name]; + _$1.prototype[name] = function() { + var obj = this._wrapped; + if (obj != null) obj = method.apply(obj, arguments); + return chainResult(this, obj); + }; + }); + + // Named Exports + + var allExports = { + __proto__: null, + VERSION: VERSION, + restArguments: restArguments, + isObject: isObject, + isNull: isNull, + isUndefined: isUndefined, + isBoolean: isBoolean, + isElement: isElement, + isString: isString, + isNumber: isNumber, + isDate: isDate, + isRegExp: isRegExp, + isError: isError, + isSymbol: isSymbol, + isArrayBuffer: isArrayBuffer, + isDataView: isDataView$1, + isArray: isArray, + isFunction: isFunction$1, + isArguments: isArguments$1, + isFinite: isFinite$1, + isNaN: isNaN$1, + isTypedArray: isTypedArray$1, + isEmpty: isEmpty, + isMatch: isMatch, + isEqual: isEqual, + isMap: isMap, + isWeakMap: isWeakMap, + isSet: isSet, + isWeakSet: isWeakSet, + keys: keys, + allKeys: allKeys, + values: values, + pairs: pairs, + invert: invert, + functions: functions, + methods: functions, + extend: extend, + extendOwn: extendOwn, + assign: extendOwn, + defaults: defaults, + create: create, + clone: clone, + tap: tap, + get: get, + has: has, + mapObject: mapObject, + identity: identity, + constant: constant, + noop: noop, + toPath: toPath$1, + property: property, + propertyOf: propertyOf, + matcher: matcher, + matches: matcher, + times: times, + random: random, + now: now, + escape: _escape, + unescape: _unescape, + templateSettings: templateSettings, + template: template, + result: result, + uniqueId: uniqueId, + chain: chain, + iteratee: iteratee, + partial: partial, + bind: bind, + bindAll: bindAll, + memoize: memoize, + delay: delay, + defer: defer, + throttle: throttle, + debounce: debounce, + wrap: wrap, + negate: negate, + compose: compose, + after: after, + before: before, + once: once, + findKey: findKey, + findIndex: findIndex, + findLastIndex: findLastIndex, + sortedIndex: sortedIndex, + indexOf: indexOf, + lastIndexOf: lastIndexOf, + find: find, + detect: find, + findWhere: findWhere, + each: each, + forEach: each, + map: map, + collect: map, + reduce: reduce, + foldl: reduce, + inject: reduce, + reduceRight: reduceRight, + foldr: reduceRight, + filter: filter, + select: filter, + reject: reject, + every: every, + all: every, + some: some, + any: some, + contains: contains, + includes: contains, + include: contains, + invoke: invoke, + pluck: pluck, + where: where, + max: max, + min: min, + shuffle: shuffle, + sample: sample, + sortBy: sortBy, + groupBy: groupBy, + indexBy: indexBy, + countBy: countBy, + partition: partition, + toArray: toArray, + size: size, + pick: pick, + omit: omit, + first: first, + head: first, + take: first, + initial: initial, + last: last, + rest: rest, + tail: rest, + drop: rest, + compact: compact, + flatten: flatten, + without: without, + uniq: uniq, + unique: uniq, + union: union, + intersection: intersection, + difference: difference, + unzip: unzip, + transpose: unzip, + zip: zip, + object: object, + range: range, + chunk: chunk, + mixin: mixin, + 'default': _$1 + }; + + // Default Export + + // Add all of the Underscore functions to the wrapper object. + var _ = mixin(allExports); + // Legacy Node.js API. + _._ = _; + + return _; + +}))); +//# sourceMappingURL=underscore-umd.js.map diff --git a/_static/underscore.js b/_static/underscore.js index 5b55f32be..cf177d428 100644 --- a/_static/underscore.js +++ b/_static/underscore.js @@ -1,31 +1,6 @@ -// Underscore.js 1.3.1 -// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore is freely distributable under the MIT license. -// Portions of Underscore are inspired or borrowed from Prototype, -// Oliver Steele's Functional, and John Resig's Micro-Templating. -// For all details and documentation: -// http://documentcloud.github.com/underscore -(function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source== -c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c, -h)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION="1.3.1";var j=b.each= -b.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e2;a== -null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect= -function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e= -e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck= -function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a, -c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}}; -b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments, -1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)}; -b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"}; -b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a), -function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+ -u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]= -function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain= -true;return this};m.prototype.value=function(){return this._wrapped}}).call(this); +!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define("underscore",r):(n="undefined"!=typeof globalThis?globalThis:n||self,function(){var t=n._,e=n._=r();e.noConflict=function(){return n._=t,e}}())}(this,(function(){ +// Underscore.js 1.13.1 +// https://underscorejs.org +// (c) 2009-2021 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors +// Underscore may be freely distributed under the MIT license. +var n="1.13.1",r="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},t=Array.prototype,e=Object.prototype,u="undefined"!=typeof Symbol?Symbol.prototype:null,o=t.push,i=t.slice,a=e.toString,f=e.hasOwnProperty,c="undefined"!=typeof ArrayBuffer,l="undefined"!=typeof DataView,s=Array.isArray,p=Object.keys,v=Object.create,h=c&&ArrayBuffer.isView,y=isNaN,d=isFinite,g=!{toString:null}.propertyIsEnumerable("toString"),b=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],m=Math.pow(2,53)-1;function j(n,r){return r=null==r?n.length-1:+r,function(){for(var t=Math.max(arguments.length-r,0),e=Array(t),u=0;u=0&&t<=m}}function J(n){return function(r){return null==r?void 0:r[n]}}var G=J("byteLength"),H=K(G),Q=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var X=c?function(n){return h?h(n)&&!q(n):H(n)&&Q.test(a.call(n))}:C(!1),Y=J("length");function Z(n,r){r=function(n){for(var r={},t=n.length,e=0;e":">",'"':""","'":"'","`":"`"},Cn=Ln($n),Kn=Ln(_n($n)),Jn=tn.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Gn=/(.)^/,Hn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Qn=/\\|'|\r|\n|\u2028|\u2029/g;function Xn(n){return"\\"+Hn[n]}var Yn=/^\s*(\w|\$)+\s*$/;var Zn=0;function nr(n,r,t,e,u){if(!(e instanceof r))return n.apply(t,u);var o=Mn(n.prototype),i=n.apply(o,u);return _(i)?i:o}var rr=j((function(n,r){var t=rr.placeholder,e=function(){for(var u=0,o=r.length,i=Array(o),a=0;a1)ur(a,r-1,t,e),u=e.length;else for(var f=0,c=a.length;f0&&(t=r.apply(this,arguments)),n<=1&&(r=null),t}}var lr=rr(cr,2);function sr(n,r,t){r=qn(r,t);for(var e,u=nn(n),o=0,i=u.length;o0?0:u-1;o>=0&&o0?a=o>=0?o:Math.max(o+f,a):f=o>=0?Math.min(o+1,f):o+f+1;else if(t&&o&&f)return e[o=t(e,u)]===u?o:-1;if(u!=u)return(o=r(i.call(e,a,f),$))>=0?o+a:-1;for(o=n>0?a:f-1;o>=0&&o0?0:i-1;for(u||(e=r[o?o[a]:a],a+=n);a>=0&&a=3;return r(n,Fn(t,u,4),e,o)}}var Ar=wr(1),xr=wr(-1);function Sr(n,r,t){var e=[];return r=qn(r,t),jr(n,(function(n,t,u){r(n,t,u)&&e.push(n)})),e}function Or(n,r,t){r=qn(r,t);for(var e=!er(n)&&nn(n),u=(e||n).length,o=0;o=0}var Br=j((function(n,r,t){var e,u;return D(r)?u=r:(r=Nn(r),e=r.slice(0,-1),r=r[r.length-1]),_r(n,(function(n){var o=u;if(!o){if(e&&e.length&&(n=In(n,e)),null==n)return;o=n[r]}return null==o?o:o.apply(n,t)}))}));function Nr(n,r){return _r(n,Rn(r))}function Ir(n,r,t){var e,u,o=-1/0,i=-1/0;if(null==r||"number"==typeof r&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=er(n)?n:jn(n)).length;ao&&(o=e);else r=qn(r,t),jr(n,(function(n,t,e){((u=r(n,t,e))>i||u===-1/0&&o===-1/0)&&(o=n,i=u)}));return o}function Tr(n,r,t){if(null==r||t)return er(n)||(n=jn(n)),n[Wn(n.length-1)];var e=er(n)?En(n):jn(n),u=Y(e);r=Math.max(Math.min(r,u),0);for(var o=u-1,i=0;i1&&(e=Fn(e,r[1])),r=an(n)):(e=qr,r=ur(r,!1,!1),n=Object(n));for(var u=0,o=r.length;u1&&(t=r[1])):(r=_r(ur(r,!1,!1),String),e=function(n,t){return!Er(r,t)}),Ur(n,e,t)}));function zr(n,r,t){return i.call(n,0,Math.max(0,n.length-(null==r||t?1:r)))}function Lr(n,r,t){return null==n||n.length<1?null==r||t?void 0:[]:null==r||t?n[0]:zr(n,n.length-r)}function $r(n,r,t){return i.call(n,null==r||t?1:r)}var Cr=j((function(n,r){return r=ur(r,!0,!0),Sr(n,(function(n){return!Er(r,n)}))})),Kr=j((function(n,r){return Cr(n,r)}));function Jr(n,r,t,e){A(r)||(e=t,t=r,r=!1),null!=t&&(t=qn(t,e));for(var u=[],o=[],i=0,a=Y(n);ir?(e&&(clearTimeout(e),e=null),a=c,i=n.apply(u,o),e||(u=o=null)):e||!1===t.trailing||(e=setTimeout(f,l)),i};return c.cancel=function(){clearTimeout(e),a=0,e=u=o=null},c},debounce:function(n,r,t){var e,u,o,i,a,f=function(){var c=zn()-u;r>c?e=setTimeout(f,r-c):(e=null,t||(i=n.apply(a,o)),e||(o=a=null))},c=j((function(c){return a=this,o=c,u=zn(),e||(e=setTimeout(f,r),t&&(i=n.apply(a,o))),i}));return c.cancel=function(){clearTimeout(e),e=o=a=null},c},wrap:function(n,r){return rr(r,n)},negate:fr,compose:function(){var n=arguments,r=n.length-1;return function(){for(var t=r,e=n[r].apply(this,arguments);t--;)e=n[t].call(this,e);return e}},after:function(n,r){return function(){if(--n<1)return r.apply(this,arguments)}},before:cr,once:lr,findKey:sr,findIndex:vr,findLastIndex:hr,sortedIndex:yr,indexOf:gr,lastIndexOf:br,find:mr,detect:mr,findWhere:function(n,r){return mr(n,Dn(r))},each:jr,forEach:jr,map:_r,collect:_r,reduce:Ar,foldl:Ar,inject:Ar,reduceRight:xr,foldr:xr,filter:Sr,select:Sr,reject:function(n,r,t){return Sr(n,fr(qn(r)),t)},every:Or,all:Or,some:Mr,any:Mr,contains:Er,includes:Er,include:Er,invoke:Br,pluck:Nr,where:function(n,r){return Sr(n,Dn(r))},max:Ir,min:function(n,r,t){var e,u,o=1/0,i=1/0;if(null==r||"number"==typeof r&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=er(n)?n:jn(n)).length;ae||void 0===t)return 1;if(t - - - + + + + API Reference — bgfx 1.0 documentation @@ -13,23 +14,28 @@ + + + + + + - @@ -51,7 +57,7 @@ - bgfx + bgfx @@ -198,6 +204,8 @@ + +
      @@ -209,7 +217,7 @@
    • - +
    • @@ -221,7 +229,7 @@
      -
      +

      API Reference

      Note

      @@ -230,13 +238,13 @@ or Using the bgfx library with C++ on Ubuntu tutorial.

      -
      +

      General

      -
      +

      Initialization and Shutdown

      -
      -struct bgfx::Init
      +
      +struct bgfx::Init

      Initialization parameters used by bgfx::init.

      Attention

      C99 equivalent is bgfx_init_t.

      @@ -244,16 +252,16 @@ tutorial.

      -

      Public Members

      +

      Public Members

      -
      -RendererType::Enum type
      +
      +RendererType::Enum type

      Select rendering backend. When set to RendererType::Count a default rendering backend will be selected appropriate to the platform. See: bgfx::RendererType

      -
      -uint16_t vendorId
      +
      +uint16_t vendorId

      Vendor PCI id. If set to BGFX_PCI_ID_NONE it will select the first device.

      • BGFX_PCI_ID_NONE - Autoselect adapter.

      • @@ -266,63 +274,63 @@ tutorial.

      -
      -uint16_t deviceId
      +
      +uint16_t deviceId

      Device id. If set to 0 it will select first device, or device with matching id.

      -
      -uint64_t capabilities
      +
      +uint64_t capabilities

      Capabilities initialization mask (default: UINT64_MAX).

      -
      -bool debug
      +
      +bool debug

      Enable device for debuging.

      -
      -bool profile
      +
      +bool profile

      Enable device for profiling.

      -
      -PlatformData platformData
      +
      +PlatformData platformData

      Platform data.

      -
      -Resolution resolution
      +
      +Resolution resolution

      Backbuffer resolution and reset parameters. See: bgfx::Resolution.

      -
      -Limits limits
      +
      +Limits limits

      Configurable runtime limits.

      -
      -CallbackI *callback
      +
      +CallbackI *callback

      Provide application specific callback interface. See: bgfx::CallbackI

      -
      -bx::AllocatorI *allocator
      +
      +bx::AllocatorI *allocator

      Custom allocator. When a custom allocator is not specified, bgfx uses the CRT allocator. Bgfx assumes custom allocator is thread safe.

      -
      -struct Limits
      +
      +struct Limits

      Configurable runtime limits parameters.

      Attention

      C99 equivalent is bgfx_init_limits_t.

      @@ -330,28 +338,28 @@ tutorial.

      -

      Public Members

      +

      Public Members

      -
      -uint16_t maxEncoders
      +
      +uint16_t maxEncoders

      Maximum number of encoder threads.

      -
      -uint32_t minResourceCbSize
      +
      +uint32_t minResourceCbSize

      Minimum resource command buffer size.

      -
      -uint32_t transientVbSize
      +
      +uint32_t transientVbSize

      Maximum transient vertex buffer size.

      -
      -uint32_t transientIbSize
      +
      +uint32_t transientIbSize

      Maximum transient index buffer size.

      @@ -361,8 +369,8 @@ tutorial.

      -
      -struct bgfx::Resolution
      +
      +struct bgfx::Resolution

      Backbuffer resolution and reset parameters.

      Attention

      C99 equivalent is bgfx_resolution_t.

      @@ -370,40 +378,40 @@ tutorial.

      -

      Public Members

      +

      Public Members

      -
      -TextureFormat::Enum format
      +
      +TextureFormat::Enum format

      Backbuffer format.

      -
      -uint32_t width
      +
      +uint32_t width

      Backbuffer width.

      -
      -uint32_t height
      +
      +uint32_t height

      Backbuffer height.

      -
      -uint32_t reset
      +
      +uint32_t reset

      Reset parameters.

      -
      -uint8_t numBackBuffers
      +
      +uint8_t numBackBuffers

      Number of back buffers.

      -
      -uint8_t maxFrameLatency
      +
      +uint8_t maxFrameLatency

      Maximum frame latency.

      @@ -411,55 +419,57 @@ tutorial.

      -
      -bool bgfx::init(const Init &_init = {})
      +
      +bool bgfx::init(const Init &_init = {})

      Initialize bgfx library.

      -
      Return

      true if initialization was successful.

      -
      Attention

      C99 equivalent is bgfx_init.

      -
      Parameters
        -
      • [in] _init: Initialization parameters. See: bgfx::Init for more info.

      • -
      -

      +
      +
      Parameters
      +

      _init[in] Initialization parameters. See: bgfx::Init for more info.

      +
      +
      Returns
      +

      true if initialization was successful.

      +
      +
      -
      -BGFX_PCI_ID_NONE
      +
      +BGFX_PCI_ID_NONE

      Autoselect adapter.

      -
      -BGFX_PCI_ID_SOFTWARE_RASTERIZER
      +
      +BGFX_PCI_ID_SOFTWARE_RASTERIZER

      Software rasterizer.

      -
      -BGFX_PCI_ID_AMD
      +
      +BGFX_PCI_ID_AMD

      AMD adapter.

      -
      -BGFX_PCI_ID_INTEL
      +
      +BGFX_PCI_ID_INTEL

      Intel adapter.

      -
      -BGFX_PCI_ID_NVIDIA
      +
      +BGFX_PCI_ID_NVIDIA

      nVidia adapter.

      -
      -struct bgfx::CallbackI
      +
      +struct bgfx::CallbackI

      Callback interface to implement application specific behavior. Cached items are currently used for OpenGL and Direct3D 12 binary shaders.

      Remark

      ’fatal’ and ‘trace’ callbacks can be called from any thread. Other callbacks are called from the render thread.

      @@ -469,90 +479,102 @@ tutorial.

      -

      Public Functions

      +

      Public Functions

      -
      -void fatal(const char *_filePath, uint16_t _line, Fatal::Enum _code, const char *_str) = 0
      +
      +virtual void fatal(const char *_filePath, uint16_t _line, Fatal::Enum _code, const char *_str) = 0

      This callback is called on unrecoverable errors. It’s not safe to continue (Exluding _code Fatal::DebugCheck), inform the user and terminate the application.

      Remark

      Not thread safe and it can be called from any thread.

      Attention

      C99 equivalent is bgfx_callback_vtbl.fatal.

      -
      Parameters
        -
      • [in] _filePath: File path where fatal message was generated.

      • -
      • [in] _line: Line where fatal message was generated.

      • -
      • [in] _code: Fatal error code.

      • -
      • [in] _str: More information about error.

      • +
      +

      +
      +
      Parameters
      +
        +
      • _filePath[in] File path where fatal message was generated.

      • +
      • _line[in] Line where fatal message was generated.

      • +
      • _code[in] Fatal error code.

      • +
      • _str[in] More information about error.

      -

      -
      -void traceVargs(const char *_filePath, uint16_t _line, const char *_format, va_list _argList) = 0
      +
      +virtual void traceVargs(const char *_filePath, uint16_t _line, const char *_format, va_list _argList) = 0

      Print debug message.

      Remark

      Not thread safe and it can be called from any thread.

      Attention

      C99 equivalent is bgfx_callback_vtbl.trace_vargs.

      -
      Parameters
        -
      • [in] _filePath: File path where debug message was generated.

      • -
      • [in] _line: Line where debug message was generated.

      • -
      • [in] _format: printf style format.

      • -
      • [in] _argList: Variable arguments list initialized with va_start.

      • +
      +

      +
      +
      Parameters
      +
        +
      • _filePath[in] File path where debug message was generated.

      • +
      • _line[in] Line where debug message was generated.

      • +
      • _format[in] printf style format.

      • +
      • _argList[in] Variable arguments list initialized with va_start.

      -

      -
      -void profilerBegin(const char *_name, uint32_t _abgr, const char *_filePath, uint16_t _line) = 0
      +
      +virtual void profilerBegin(const char *_name, uint32_t _abgr, const char *_filePath, uint16_t _line) = 0

      Profiler region begin.

      Remark

      Not thread safe and it can be called from any thread.

      Attention

      C99 equivalent is bgfx_callback_vtbl.profiler_begin.

      -
      Parameters
        -
      • [in] _name: Region name, contains dynamic string.

      • -
      • [in] _abgr: Color of profiler region.

      • -
      • [in] _filePath: File path where profilerBegin was called.

      • -
      • [in] _line: Line where profilerBegin was called.

      • +
      +

      +
      +
      Parameters
      +
        +
      • _name[in] Region name, contains dynamic string.

      • +
      • _abgr[in] Color of profiler region.

      • +
      • _filePath[in] File path where profilerBegin was called.

      • +
      • _line[in] Line where profilerBegin was called.

      -

      -
      -void profilerBeginLiteral(const char *_name, uint32_t _abgr, const char *_filePath, uint16_t _line) = 0
      +
      +virtual void profilerBeginLiteral(const char *_name, uint32_t _abgr, const char *_filePath, uint16_t _line) = 0

      Profiler region begin with string literal name.

      Remark

      Not thread safe and it can be called from any thread.

      Attention

      C99 equivalent is bgfx_callback_vtbl.profiler_begin_literal.

      -
      Parameters
        -
      • [in] _name: Region name, contains string literal.

      • -
      • [in] _abgr: Color of profiler region.

      • -
      • [in] _filePath: File path where profilerBeginLiteral was called.

      • -
      • [in] _line: Line where profilerBeginLiteral was called.

      • +
      +

      +
      +
      Parameters
      +
        +
      • _name[in] Region name, contains string literal.

      • +
      • _abgr[in] Color of profiler region.

      • +
      • _filePath[in] File path where profilerBeginLiteral was called.

      • +
      • _line[in] Line where profilerBeginLiteral was called.

      -

      -
      -void profilerEnd() = 0
      +
      +virtual void profilerEnd() = 0

      Profiler region end.

      Remark

      Not thread safe and it can be called from any thread.

      @@ -564,101 +586,116 @@ tutorial.

      -
      -uint32_t cacheReadSize(uint64_t _id) = 0
      +
      +virtual uint32_t cacheReadSize(uint64_t _id) = 0

      Returns the size of a cached item. Returns 0 if no cached item was found.

      -
      Return

      Number of bytes to read.

      -
      Attention

      C99 equivalent is bgfx_callback_vtbl.cache_read_size.

      -
      Parameters
        -
      • [in] _id: Cache id.

      • -
      -

      +
      +
      Parameters
      +

      _id[in] Cache id.

      +
      +
      Returns
      +

      Number of bytes to read.

      +
      +
      -
      -bool cacheRead(uint64_t _id, void *_data, uint32_t _size) = 0
      +
      +virtual bool cacheRead(uint64_t _id, void *_data, uint32_t _size) = 0

      Read cached item.

      -
      Return

      True if data is read.

      -
      Attention

      C99 equivalent is bgfx_callback_vtbl.cache_read.

      -
      Parameters
        -
      • [in] _id: Cache id.

      • -
      • [in] _data: Buffer where to read data.

      • -
      • [in] _size: Size of data to read.

      • -
      -

      +
      +
      Parameters
      +
        +
      • _id[in] Cache id.

      • +
      • _data[in] Buffer where to read data.

      • +
      • _size[in] Size of data to read.

      • +
      +
      +
      Returns
      +

      True if data is read.

      +
      +
      -
      -void cacheWrite(uint64_t _id, const void *_data, uint32_t _size) = 0
      +
      +virtual void cacheWrite(uint64_t _id, const void *_data, uint32_t _size) = 0

      Write cached item.

      Attention

      C99 equivalent is bgfx_callback_vtbl.cache_write.

      -
      Parameters
        -
      • [in] _id: Cache id.

      • -
      • [in] _data: Data to write.

      • -
      • [in] _size: Size of data to write.

      • +
      +

      +
      +
      Parameters
      +
        +
      • _id[in] Cache id.

      • +
      • _data[in] Data to write.

      • +
      • _size[in] Size of data to write.

      -

      -
      -void screenShot(const char *_filePath, uint32_t _width, uint32_t _height, uint32_t _pitch, const void *_data, uint32_t _size, bool _yflip) = 0
      +
      +virtual void screenShot(const char *_filePath, uint32_t _width, uint32_t _height, uint32_t _pitch, const void *_data, uint32_t _size, bool _yflip) = 0

      Screenshot captured. Screenshot format is always 4-byte BGRA.

      Attention

      C99 equivalent is bgfx_callback_vtbl.screen_shot.

      -
      Parameters
        -
      • [in] _filePath: File path.

      • -
      • [in] _width: Image width.

      • -
      • [in] _height: Image height.

      • -
      • [in] _pitch: Number of bytes to skip between the start of each horizontal line of the image.

      • -
      • [in] _data: Image data.

      • -
      • [in] _size: Image size.

      • -
      • [in] _yflip: If true, image origin is bottom left.

      • +
      +

      +
      +
      Parameters
      +
        +
      • _filePath[in] File path.

      • +
      • _width[in] Image width.

      • +
      • _height[in] Image height.

      • +
      • _pitch[in] Number of bytes to skip between the start of each horizontal line of the image.

      • +
      • _data[in] Image data.

      • +
      • _size[in] Image size.

      • +
      • _yflip[in] If true, image origin is bottom left.

      -

      -
      -void captureBegin(uint32_t _width, uint32_t _height, uint32_t _pitch, TextureFormat::Enum _format, bool _yflip) = 0
      +
      +virtual void captureBegin(uint32_t _width, uint32_t _height, uint32_t _pitch, TextureFormat::Enum _format, bool _yflip) = 0

      Called when a video capture begins.

      Attention

      C99 equivalent is bgfx_callback_vtbl.capture_begin.

      -
      Parameters
        -
      • [in] _width: Image width.

      • -
      • [in] _height: Image height.

      • -
      • [in] _pitch: Number of bytes to skip between the start of each horizontal line of the image.

      • -
      • [in] _format: Texture format. See: TextureFormat::Enum.

      • -
      • [in] _yflip: If true, image origin is bottom left.

      • +
      +

      +
      +
      Parameters
      +
        +
      • _width[in] Image width.

      • +
      • _height[in] Image height.

      • +
      • _pitch[in] Number of bytes to skip between the start of each horizontal line of the image.

      • +
      • _format[in] Texture format. See: TextureFormat::Enum.

      • +
      • _yflip[in] If true, image origin is bottom left.

      -

      -
      -void captureEnd() = 0
      +
      +virtual void captureEnd() = 0

      Called when a video capture ends.

      Attention

      C99 equivalent is bgfx_callback_vtbl.capture_end.

      @@ -668,27 +705,30 @@ tutorial.

      -
      -void captureFrame(const void *_data, uint32_t _size) = 0
      +
      +virtual void captureFrame(const void *_data, uint32_t _size) = 0

      Captured frame.

      Attention

      C99 equivalent is bgfx_callback_vtbl.capture_frame.

      -
      Parameters
        -
      • [in] _data: Image data.

      • -
      • [in] _size: Image size.

      • +
      +

      +
      +
      Parameters
      +
        +
      • _data[in] Image data.

      • +
      • _size[in] Image size.

      -

      -
      -void bgfx::shutdown()
      +
      +void bgfx::shutdown()

      Shutdown bgfx library.

      Attention

      C99 equivalent is bgfx_shutdown.

      @@ -697,24 +737,28 @@ tutorial.

      -
      -
      +
      +

      Updating

      -
      +

      Reset

      -
      -void bgfx::reset(uint32_t _width, uint32_t _height, uint32_t _flags = BGFX_RESET_NONE, TextureFormat::Enum _format = TextureFormat::Count)
      +
      +void bgfx::reset(uint32_t _width, uint32_t _height, uint32_t _flags = BGFX_RESET_NONE, TextureFormat::Enum _format = TextureFormat::Count)

      Reset graphic settings and back-buffer size.

      Attention

      This call doesn’t actually change window size, it just resizes back-buffer. Windowing code has to change window size.

      Attention

      C99 equivalent is bgfx_reset.

      -
      Parameters
        -
      • [in] _width: Back-buffer width.

      • -
      • [in] _height: Back-buffer height.

      • -
      • [in] _flags: See: BGFX_RESET_* for more info.

          +
      +

      +
      +
      Parameters
      +
        +
      • _width[in] Back-buffer width.

      • +
      • _height[in] Back-buffer height.

      • +
      • _flags[in] See: BGFX_RESET_* for more info.

        • BGFX_RESET_NONE - No reset flags.

        • BGFX_RESET_FULLSCREEN - Not supported yet.

        • BGFX_RESET_MSAA_X[2/4/8/16] - Enable 2, 4, 8 or 16 x MSAA.

        • @@ -726,271 +770,307 @@ tutorial.

        • BGFX_RESET_SRGB_BACKBUFFER - Enable sRGB backbuffer.

      • -
      • [in] _format: Texture format. See: TextureFormat::Enum.

      • +
      • _format[in] Texture format. See: TextureFormat::Enum.

      -

      -
      -BGFX_RESET_NONE
      +
      +BGFX_RESET_NONE

      No reset flags.

      -
      -BGFX_RESET_FULLSCREEN
      +
      +BGFX_RESET_FULLSCREEN

      Not supported yet.

      -
      -BGFX_RESET_MSAA_X2
      +
      +BGFX_RESET_MSAA_X2

      Enable 2x MSAA.

      -
      -BGFX_RESET_MSAA_X4
      +
      +BGFX_RESET_MSAA_X4

      Enable 4x MSAA.

      -
      -BGFX_RESET_MSAA_X8
      +
      +BGFX_RESET_MSAA_X8

      Enable 8x MSAA.

      -
      -BGFX_RESET_MSAA_X16
      +
      +BGFX_RESET_MSAA_X16

      Enable 16x MSAA.

      -
      -BGFX_RESET_VSYNC
      +
      +BGFX_RESET_VSYNC

      Enable V-Sync.

      -
      -BGFX_RESET_MAXANISOTROPY
      +
      +BGFX_RESET_MAXANISOTROPY

      Turn on/off max anisotropy.

      -
      -BGFX_RESET_CAPTURE
      +
      +BGFX_RESET_CAPTURE

      Begin screen capture.

      -
      -BGFX_RESET_FLUSH_AFTER_RENDER
      +
      +BGFX_RESET_FLUSH_AFTER_RENDER

      Flush rendering after submitting to GPU.

      -
      -BGFX_RESET_FLIP_AFTER_RENDER
      +
      +BGFX_RESET_FLIP_AFTER_RENDER

      This flag specifies where flip occurs. Default behaviour is that flip occurs before rendering new frame. This flag only has effect when BGFX_CONFIG_MULTITHREADED=0.

      -
      -BGFX_RESET_SRGB_BACKBUFFER
      +
      +BGFX_RESET_SRGB_BACKBUFFER

      Enable sRGB backbuffer.

      -
      -BGFX_RESET_HDR10
      +
      +BGFX_RESET_HDR10

      Enable HDR10 rendering.

      -
      -BGFX_RESET_HIDPI
      +
      +BGFX_RESET_HIDPI

      Enable HiDPI rendering.

      -
      -BGFX_RESET_DEPTH_CLAMP
      +
      +BGFX_RESET_DEPTH_CLAMP

      Enable depth clamp.

      -
      -
      +
      +

      Frame

      -
      -uint32_t bgfx::frame(bool _capture = false)
      +
      +uint32_t bgfx::frame(bool _capture = false)

      Advance to next frame. When using multithreaded renderer, this call just swaps internal buffers, kicks render thread, and returns. In singlethreaded renderer this call does frame rendering.

      -
      Return

      Current frame number. This might be used in conjunction with double/multi buffering data outside the library and passing it to library via bgfx::makeRef calls.

      -
      Attention

      C99 equivalent is bgfx_frame.

      -
      Parameters
        -
      • [in] _capture: Capture frame with graphics debugger.

      • -
      -

      +
      +
      Parameters
      +

      _capture[in] Capture frame with graphics debugger.

      +
      +
      Returns
      +

      Current frame number. This might be used in conjunction with double/multi buffering data outside the library and passing it to library via bgfx::makeRef calls.

      +
      +
      -
      -
      -
      + + +

      Debug

      -
      +

      Debug Features

      -
      -void bgfx::setDebug(uint32_t _debug)
      +
      +void bgfx::setDebug(uint32_t _debug)

      Set debug flags.

      Attention

      C99 equivalent is bgfx_set_debug.

      -
      Parameters
        -
      • [in] _debug: Available flags:

          +
      +

      +
      +
      Parameters
      +

      _debug[in] Available flags:

      • BGFX_DEBUG_IFH - Infinitely fast hardware. When this flag is set all rendering calls will be skipped. This is useful when profiling to quickly assess potential bottlenecks between CPU and GPU.

      • BGFX_DEBUG_PROFILER - Enable profiler.

      • BGFX_DEBUG_STATS - Display internal statistics.

      • BGFX_DEBUG_TEXT - Display debug text.

      • BGFX_DEBUG_WIREFRAME - Wireframe rendering. All rendering primitives will be rendered as lines.

      -

      -
    +

    -

    -
    -
    + +

    Debug Flags

    -
    -BGFX_DEBUG_NONE
    +
    +BGFX_DEBUG_NONE

    No debug.

    -
    -BGFX_DEBUG_WIREFRAME
    +
    +BGFX_DEBUG_WIREFRAME

    Enable wireframe for all primitives.

    -
    -BGFX_DEBUG_IFH
    +
    +BGFX_DEBUG_IFH

    Enable infinitely fast hardware test. No draw calls will be submitted to driver. It’s useful when profiling to quickly assess bottleneck between CPU and GPU.

    -
    -BGFX_DEBUG_STATS
    +
    +BGFX_DEBUG_STATS

    Enable statistics display.

    -
    -BGFX_DEBUG_TEXT
    +
    +BGFX_DEBUG_TEXT

    Enable debug text display.

    -
    -BGFX_DEBUG_PROFILER
    +
    +BGFX_DEBUG_PROFILER

    Enable profiler.

    -
    -
    + +

    Debug Text Display

    -
    -void bgfx::dbgTextClear(uint8_t _attr = 0, bool _small = false)
    +
    +void bgfx::dbgTextClear(uint8_t _attr = 0, bool _small = false)

    Clear internal debug text buffer.

    Attention

    C99 equivalent is bgfx_dbg_text_clear.

    -
    Parameters
      -
    • [in] _attr: Background color.

    • -
    • [in] _small: Default 8x16 or 8x8 font.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _attr[in] Background color.

    • +
    • _small[in] Default 8x16 or 8x8 font.

    -

    -
    -void bgfx::dbgTextPrintf(uint16_t _x, uint16_t _y, uint8_t _attr, const char *_format, ...)
    +
    +void bgfx::dbgTextPrintf(uint16_t _x, uint16_t _y, uint8_t _attr, const char *_format, ...)

    Print into internal debug text character-buffer (VGA-compatible text mode).

    Attention

    C99 equivalent is bgfx_dbg_text_printf.

    -
    Parameters
      -
    • [in] _x[in] _y: 2D position from top-left.

    • -
    • [in] _attr: Color palette. Where top 4-bits represent index of background, and bottom 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).

    • -
    • [in] _format: printf style format.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _x, _y[in] 2D position from top-left.

    • +
    • _attr[in] Color palette. Where top 4-bits represent index of background, and bottom 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).

    • +
    • _format[in] printf style format.

    -

    -
    -void bgfx::dbgTextPrintfVargs(uint16_t _x, uint16_t _y, uint8_t _attr, const char *_format, va_list _argList)
    +
    +void bgfx::dbgTextPrintfVargs(uint16_t _x, uint16_t _y, uint8_t _attr, const char *_format, va_list _argList)

    Print into internal debug text character-buffer (VGA-compatible text mode).

    Attention

    C99 equivalent is bgfx_dbg_text_vprintf.

    -
    Parameters
      -
    • [in] _x[in] _y: 2D position from top-left.

    • -
    • [in] _attr: Color palette. Where top 4-bits represent index of background, and bottom 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).

    • -
    • [in] _format: printf style format.

    • -
    • [in] _argList: additional arguments for format string

    • +
    +

    +
    +
    Parameters
    +
      +
    • _x, _y[in] 2D position from top-left.

    • +
    • _attr[in] Color palette. Where top 4-bits represent index of background, and bottom 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).

    • +
    • _format[in] printf style format.

    • +
    • _argList[in] additional arguments for format string

    -

    -
    -void bgfx::dbgTextImage(uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height, const void *_data, uint16_t _pitch)
    +
    +void bgfx::dbgTextImage(uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height, const void *_data, uint16_t _pitch)

    Draw image into internal debug text buffer.

    Attention

    C99 equivalent is bgfx_dbg_text_image.

    -
    Parameters
      -
    • [in] _x[in] _y: 2D position from top-left.

    • -
    • [in] _width[in] _height: Image width and height.

    • -
    • [in] _data: Raw image data (character/attribute raw encoding).

    • -
    • [in] _pitch: Image pitch in bytes.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _x, _y[in] 2D position from top-left.

    • +
    • _width, _height[in] Image width and height.

    • +
    • _data[in] Raw image data (character/attribute raw encoding).

    • +
    • _pitch[in] Image pitch in bytes.

    -

    -
    - -
    + + +

    Querying information

    -
    +

    Renderer

    -
    -RendererType::Enum bgfx::getRendererType()
    +
    +uint8_t bgfx::getSupportedRenderers(uint8_t _max = 0, RendererType::Enum *_enum = NULL)
    +

    Returns supported backend API renderers.

    +

    +
    Attention

    C99 equivalent is bgfx_get_supported_renderers.

    +
    +
    +

    +
    +
    Parameters
    +
      +
    • _max[in] Maximum number of elements in _enum array.

    • +
    • _enum[inout] Array where supported renderers will be written.

    • +
    +
    +
    Returns
    +

    Number of supported renderers.

    +
    +
    +
    + +
    +
    +RendererType::Enum bgfx::getRendererType()

    Returns current renderer backend API type.

    Remark

    Library must be initialized.

    @@ -1002,8 +1082,8 @@ tutorial.

    -
    -struct bgfx::RendererType
    +
    +struct bgfx::RendererType

    Renderer backend type enum.

    Attention

    C99 equivalent is bgfx_renderer_type_t.

    @@ -1011,81 +1091,81 @@ tutorial.

    -

    Public Types

    +

    Public Types

    -
    -enum Enum
    +
    +enum Enum

    Renderer types:

    Values:

    -
    -enumerator Noop
    +
    +enumerator Noop

    No rendering.

    -
    -enumerator Direct3D9
    +
    +enumerator Direct3D9

    Direct3D 9.0.

    -
    -enumerator Direct3D11
    +
    +enumerator Direct3D11

    Direct3D 11.0.

    -
    -enumerator Direct3D12
    +
    +enumerator Direct3D12

    Direct3D 12.0.

    -
    -enumerator Gnm
    +
    +enumerator Gnm

    GNM.

    -
    -enumerator Metal
    +
    +enumerator Metal

    Metal.

    -
    -enumerator Nvn
    +
    +enumerator Nvn

    NVN.

    -
    -enumerator OpenGLES
    +
    +enumerator OpenGLES

    OpenGL ES 2.0+.

    -
    -enumerator OpenGL
    +
    +enumerator OpenGL

    OpenGL 2.1+.

    -
    -enumerator Vulkan
    +
    +enumerator Vulkan

    Vulkan.

    -
    -enumerator WebGPU
    +
    +enumerator WebGPU

    WebGPU.

    -
    -enumerator Count
    +
    +enumerator Count
    @@ -1093,27 +1173,30 @@ tutorial.

    -
    -
    +
    +

    Capabilities

    -
    -const Caps *bgfx::getCaps()
    +
    +const Caps *bgfx::getCaps()

    Returns renderer capabilities.

    -
    Return

    Pointer to static bgfx::Caps structure.

    -
    Remark

    Library must be initialized.

    Attention

    C99 equivalent is bgfx_get_caps.

    +
    +
    Returns
    +

    Pointer to static bgfx::Caps structure.

    +
    +
    -
    -struct bgfx::Caps
    +
    +struct bgfx::Caps

    Renderer capabilities.

    Attention

    C99 equivalent is bgfx_caps_t.

    @@ -1121,16 +1204,16 @@ tutorial.

    -

    Public Members

    +

    Public Members

    -
    -RendererType::Enum rendererType
    +
    +RendererType::Enum rendererType

    Renderer backend type. See: bgfx::RendererType

    -
    -uint64_t supported
    +
    +uint64_t supported

    Supported functionality.

    Attention

    See BGFX_CAPS_* flags at https://bkaradzic.github.io/bgfx/bgfx.html#available-caps

    @@ -1140,50 +1223,50 @@ tutorial.

    -
    -uint16_t vendorId
    +
    +uint16_t vendorId

    Selected GPU vendor PCI id.

    -
    -uint16_t deviceId
    +
    +uint16_t deviceId

    Selected GPU device id.

    -
    -bool homogeneousDepth
    +
    +bool homogeneousDepth

    True when NDC depth is in [-1, 1] range, otherwise its [0, 1].

    -
    -bool originBottomLeft
    +
    +bool originBottomLeft

    True when NDC origin is at bottom left.

    -
    -uint8_t numGPUs
    +
    +uint8_t numGPUs

    Number of enumerated GPUs.

    -
    -GPU gpu[4]
    +
    +GPU gpu[4]

    Enumerated GPUs.

    -
    -Limits limits
    +
    +Limits limits

    Renderer runtime limits.

    -
    -uint16_t formats[Count]
    +
    +uint16_t formats[TextureFormat::Count]

    Supported texture format capabilities flags:

    • BGFX_CAPS_FORMAT_TEXTURE_NONE - Texture format is not supported.

    • @@ -1209,8 +1292,8 @@ tutorial.

    -
    -struct GPU
    +
    +struct GPU

    GPU info.

    Attention

    C99 equivalent is bgfx_caps_gpu_t.

    @@ -1218,16 +1301,16 @@ tutorial.

    -

    Public Members

    +

    Public Members

    -
    -uint16_t vendorId
    +
    +uint16_t vendorId

    Vendor PCI id. See BGFX_PCI_ID_*.

    -
    -uint16_t deviceId
    +
    +uint16_t deviceId

    Device id.

    @@ -1235,8 +1318,8 @@ tutorial.

    -
    -struct Limits
    +
    +struct Limits

    Renderer runtime limits.

    Attention

    C99 equivalent is bgfx_caps_limits_t.

    @@ -1244,148 +1327,148 @@ tutorial.

    -

    Public Members

    +

    Public Members

    -
    -uint32_t maxDrawCalls
    +
    +uint32_t maxDrawCalls

    Maximum number of draw calls.

    -
    -uint32_t maxBlits
    +
    +uint32_t maxBlits

    Maximum number of blit calls.

    -
    -uint32_t maxTextureSize
    +
    +uint32_t maxTextureSize

    Maximum texture size.

    -
    -uint32_t maxTextureLayers
    +
    +uint32_t maxTextureLayers

    Maximum texture layers.

    -
    -uint32_t maxViews
    +
    +uint32_t maxViews

    Maximum number of views.

    -
    -uint32_t maxFrameBuffers
    +
    +uint32_t maxFrameBuffers

    Maximum number of frame buffer handles.

    -
    -uint32_t maxFBAttachments
    +
    +uint32_t maxFBAttachments

    Maximum number of frame buffer attachments.

    -
    -uint32_t maxPrograms
    +
    +uint32_t maxPrograms

    Maximum number of program handles.

    -
    -uint32_t maxShaders
    +
    +uint32_t maxShaders

    Maximum number of shader handles.

    -
    -uint32_t maxTextures
    +
    +uint32_t maxTextures

    Maximum number of texture handles.

    -
    -uint32_t maxTextureSamplers
    +
    +uint32_t maxTextureSamplers

    Maximum number of texture samplers.

    -
    -uint32_t maxComputeBindings
    +
    +uint32_t maxComputeBindings

    Maximum number of compute bindings.

    -
    -uint32_t maxVertexLayouts
    +
    +uint32_t maxVertexLayouts

    Maximum number of vertex format layouts.

    -
    -uint32_t maxVertexStreams
    +
    +uint32_t maxVertexStreams

    Maximum number of vertex streams.

    -
    -uint32_t maxIndexBuffers
    +
    +uint32_t maxIndexBuffers

    Maximum number of index buffer handles.

    -
    -uint32_t maxVertexBuffers
    +
    +uint32_t maxVertexBuffers

    Maximum number of vertex buffer handles.

    -
    -uint32_t maxDynamicIndexBuffers
    +
    +uint32_t maxDynamicIndexBuffers

    Maximum number of dynamic index buffer handles.

    -
    -uint32_t maxDynamicVertexBuffers
    +
    +uint32_t maxDynamicVertexBuffers

    Maximum number of dynamic vertex buffer handles.

    -
    -uint32_t maxUniforms
    +
    +uint32_t maxUniforms

    Maximum number of uniform handles.

    -
    -uint32_t maxOcclusionQueries
    +
    +uint32_t maxOcclusionQueries

    Maximum number of occlusion query handles.

    -
    -uint32_t maxEncoders
    +
    +uint32_t maxEncoders

    Maximum number of encoder threads.

    -
    -uint32_t minResourceCbSize
    +
    +uint32_t minResourceCbSize

    Minimum resource command buffer size.

    -
    -uint32_t transientVbSize
    +
    +uint32_t transientVbSize

    Maximum transient vertex buffer size.

    -
    -uint32_t transientIbSize
    +
    +uint32_t transientIbSize

    Maximum transient index buffer size.

    @@ -1394,176 +1477,176 @@ tutorial.

    -
    +
    Available Caps
    -
    -BGFX_CAPS_ALPHA_TO_COVERAGE
    +
    +BGFX_CAPS_ALPHA_TO_COVERAGE

    Alpha to coverage is supported.

    -
    -BGFX_CAPS_BLEND_INDEPENDENT
    +
    +BGFX_CAPS_BLEND_INDEPENDENT

    Blend independent is supported.

    -
    -BGFX_CAPS_COMPUTE
    +
    +BGFX_CAPS_COMPUTE

    Compute shaders are supported.

    -
    -BGFX_CAPS_CONSERVATIVE_RASTER
    +
    +BGFX_CAPS_CONSERVATIVE_RASTER

    Conservative rasterization is supported.

    -
    -BGFX_CAPS_DRAW_INDIRECT
    +
    +BGFX_CAPS_DRAW_INDIRECT

    Draw indirect is supported.

    -
    -BGFX_CAPS_FRAGMENT_DEPTH
    +
    +BGFX_CAPS_FRAGMENT_DEPTH

    Fragment depth is available in fragment shader.

    -
    -BGFX_CAPS_FRAGMENT_ORDERING
    +
    +BGFX_CAPS_FRAGMENT_ORDERING

    Fragment ordering is available in fragment shader.

    -
    -BGFX_CAPS_GRAPHICS_DEBUGGER
    +
    +BGFX_CAPS_GRAPHICS_DEBUGGER

    Graphics debugger is present.

    -
    -BGFX_CAPS_HDR10
    +
    +BGFX_CAPS_HDR10

    HDR10 rendering is supported.

    -
    -BGFX_CAPS_HIDPI
    +
    +BGFX_CAPS_HIDPI

    HiDPI rendering is supported.

    -
    -BGFX_CAPS_IMAGE_RW
    +
    +BGFX_CAPS_IMAGE_RW

    Image Read/Write is supported.

    -
    -BGFX_CAPS_INDEX32
    +
    +BGFX_CAPS_INDEX32

    32-bit indices are supported.

    -
    -BGFX_CAPS_INSTANCING
    +
    +BGFX_CAPS_INSTANCING

    Instancing is supported.

    -
    -BGFX_CAPS_OCCLUSION_QUERY
    +
    +BGFX_CAPS_OCCLUSION_QUERY

    Occlusion query is supported.

    -
    -BGFX_CAPS_RENDERER_MULTITHREADED
    +
    +BGFX_CAPS_RENDERER_MULTITHREADED

    Renderer is on separate thread.

    -
    -BGFX_CAPS_SWAP_CHAIN
    +
    +BGFX_CAPS_SWAP_CHAIN

    Multiple windows are supported.

    -
    -BGFX_CAPS_TEXTURE_2D_ARRAY
    +
    +BGFX_CAPS_TEXTURE_2D_ARRAY

    2D texture array is supported.

    -
    -BGFX_CAPS_TEXTURE_3D
    +
    +BGFX_CAPS_TEXTURE_3D

    3D textures are supported.

    -
    -BGFX_CAPS_TEXTURE_BLIT
    +
    +BGFX_CAPS_TEXTURE_BLIT

    Texture blit is supported.

    -
    -BGFX_CAPS_TEXTURE_COMPARE_ALL
    +
    +BGFX_CAPS_TEXTURE_COMPARE_ALL
    -
    -BGFX_CAPS_TEXTURE_COMPARE_LEQUAL
    +
    +BGFX_CAPS_TEXTURE_COMPARE_LEQUAL

    Texture compare less equal mode is supported.

    -
    -BGFX_CAPS_TEXTURE_CUBE_ARRAY
    +
    +BGFX_CAPS_TEXTURE_CUBE_ARRAY

    Cubemap texture array is supported.

    -
    -BGFX_CAPS_TEXTURE_DIRECT_ACCESS
    +
    +BGFX_CAPS_TEXTURE_DIRECT_ACCESS

    CPU direct access to GPU texture memory.

    -
    -BGFX_CAPS_TEXTURE_READ_BACK
    +
    +BGFX_CAPS_TEXTURE_READ_BACK

    Read-back texture is supported.

    -
    -BGFX_CAPS_VERTEX_ATTRIB_HALF
    +
    +BGFX_CAPS_VERTEX_ATTRIB_HALF

    Vertex attribute half-float is supported.

    -
    -BGFX_CAPS_VERTEX_ATTRIB_UINT10
    +
    +BGFX_CAPS_VERTEX_ATTRIB_UINT10

    Vertex attribute 10_10_10_2 is supported.

    -
    -BGFX_CAPS_VERTEX_ID
    +
    +BGFX_CAPS_VERTEX_ID

    Rendering with VertexID only is supported.

    -
    -
    -
    + + +

    Statistics

    -
    -const Stats *bgfx::getStats()
    +
    +const Stats *bgfx::getStats()

    Returns performance counters.

    Attention

    Pointer returned is valid until bgfx::frame is called.

    @@ -1575,8 +1658,8 @@ tutorial.

    -
    -struct bgfx::Stats
    +
    +struct bgfx::Stats

    Renderer statistics data.

    Attention

    C99 equivalent is bgfx_stats_t.

    @@ -1586,238 +1669,238 @@ tutorial.

    -

    Public Members

    +

    Public Members

    -
    -int64_t cpuTimeFrame
    +
    +int64_t cpuTimeFrame

    CPU time between two bgfx::frame calls.

    -
    -int64_t cpuTimeBegin
    +
    +int64_t cpuTimeBegin

    Render thread CPU submit begin time.

    -
    -int64_t cpuTimeEnd
    +
    +int64_t cpuTimeEnd

    Render thread CPU submit end time.

    -
    -int64_t cpuTimerFreq
    +
    +int64_t cpuTimerFreq

    CPU timer frequency. Timestamps-per-second.

    -
    -int64_t gpuTimeBegin
    +
    +int64_t gpuTimeBegin

    GPU frame begin time.

    -
    -int64_t gpuTimeEnd
    +
    +int64_t gpuTimeEnd

    GPU frame end time.

    -
    -int64_t gpuTimerFreq
    +
    +int64_t gpuTimerFreq

    GPU timer frequency.

    -
    -int64_t waitRender
    +
    +int64_t waitRender

    Time spent waiting for render backend thread to finish issuing draw commands to underlying graphics API.

    -
    -int64_t waitSubmit
    +
    +int64_t waitSubmit

    Time spent waiting for submit thread to advance to next frame.

    -
    -uint32_t numDraw
    +
    +uint32_t numDraw

    Number of draw calls submitted.

    -
    -uint32_t numCompute
    +
    +uint32_t numCompute

    Number of compute calls submitted.

    -
    -uint32_t numBlit
    +
    +uint32_t numBlit

    Number of blit calls submitted.

    -
    -uint32_t maxGpuLatency
    +
    +uint32_t maxGpuLatency

    GPU driver latency.

    -
    -uint16_t numDynamicIndexBuffers
    +
    +uint16_t numDynamicIndexBuffers

    Number of used dynamic index buffers.

    -
    -uint16_t numDynamicVertexBuffers
    +
    +uint16_t numDynamicVertexBuffers

    Number of used dynamic vertex buffers.

    -
    -uint16_t numFrameBuffers
    +
    +uint16_t numFrameBuffers

    Number of used frame buffers.

    -
    -uint16_t numIndexBuffers
    +
    +uint16_t numIndexBuffers

    Number of used index buffers.

    -
    -uint16_t numOcclusionQueries
    +
    +uint16_t numOcclusionQueries

    Number of used occlusion queries.

    -
    -uint16_t numPrograms
    +
    +uint16_t numPrograms

    Number of used programs.

    -
    -uint16_t numShaders
    +
    +uint16_t numShaders

    Number of used shaders.

    -
    -uint16_t numTextures
    +
    +uint16_t numTextures

    Number of used textures.

    -
    -uint16_t numUniforms
    +
    +uint16_t numUniforms

    Number of used uniforms.

    -
    -uint16_t numVertexBuffers
    +
    +uint16_t numVertexBuffers

    Number of used vertex buffers.

    -
    -uint16_t numVertexLayouts
    +
    +uint16_t numVertexLayouts

    Number of used vertex layouts.

    -
    -int64_t textureMemoryUsed
    +
    +int64_t textureMemoryUsed

    Estimate of texture memory used.

    -
    -int64_t rtMemoryUsed
    +
    +int64_t rtMemoryUsed

    Estimate of render target memory used.

    -
    -int32_t transientVbUsed
    +
    +int32_t transientVbUsed

    Amount of transient vertex buffer used.

    -
    -int32_t transientIbUsed
    +
    +int32_t transientIbUsed

    Amount of transient index buffer used.

    -
    -uint32_t numPrims[Count]
    +
    +uint32_t numPrims[Topology::Count]

    Number of primitives rendered.

    -
    -int64_t gpuMemoryMax
    +
    +int64_t gpuMemoryMax

    Maximum available GPU memory for application.

    -
    -int64_t gpuMemoryUsed
    +
    +int64_t gpuMemoryUsed

    Amount of GPU memory used by the application.

    -
    -uint16_t width
    +
    +uint16_t width

    Backbuffer width in pixels.

    -
    -uint16_t height
    +
    +uint16_t height

    Backbuffer height in pixels.

    -
    -uint16_t textWidth
    +
    +uint16_t textWidth

    Debug text width in characters.

    -
    -uint16_t textHeight
    +
    +uint16_t textHeight

    Debug text height in characters.

    -
    -uint16_t numViews
    +
    +uint16_t numViews

    Number of view stats.

    -
    -ViewStats *viewStats
    +
    +ViewStats *viewStats

    Array of View stats.

    -
    -uint8_t numEncoders
    +
    +uint8_t numEncoders

    Number of encoders used during frame.

    -
    -EncoderStats *encoderStats
    +
    +EncoderStats *encoderStats

    Array of encoder stats.

    @@ -1825,8 +1908,8 @@ tutorial.

    -
    -struct bgfx::ViewStats
    +
    +struct bgfx::ViewStats

    View stats.

    Attention

    C99 equivalent is bgfx_view_stats_t.

    @@ -1834,40 +1917,40 @@ tutorial.

    -

    Public Members

    +

    Public Members

    -
    -char name[256]
    +
    +char name[256]

    View name.

    -
    -ViewId view
    +
    +ViewId view

    View id.

    -
    -int64_t cpuTimeBegin
    +
    +int64_t cpuTimeBegin

    CPU (submit) begin time.

    -
    -int64_t cpuTimeEnd
    +
    +int64_t cpuTimeEnd

    CPU (submit) end time.

    -
    -int64_t gpuTimeBegin
    +
    +int64_t gpuTimeBegin

    GPU begin time.

    -
    -int64_t gpuTimeEnd
    +
    +int64_t gpuTimeEnd

    GPU end time.

    @@ -1875,8 +1958,8 @@ tutorial.

    -
    -struct bgfx::EncoderStats
    +
    +struct bgfx::EncoderStats

    Encoder stats.

    Attention

    C99 equivalent is bgfx_encoder_stats_t.

    @@ -1884,52 +1967,56 @@ tutorial.

    -

    Public Members

    +

    Public Members

    -
    -int64_t cpuTimeBegin
    +
    +int64_t cpuTimeBegin

    Encoder thread CPU submit begin time.

    -
    -int64_t cpuTimeEnd
    +
    +int64_t cpuTimeEnd

    Encoder thread CPU submit end time.

    -
    - -
    + + +

    Platform specific

    These are platform specific APIs. It is only necessary to use these APIs in conjunction with creating windows.

    -
    -RenderFrame::Enum bgfx::renderFrame(int32_t _msecs = -1)
    +
    +RenderFrame::Enum bgfx::renderFrame(int32_t _msecs = -1)

    Render frame.

    -
    Return

    Current renderer state. See: bgfx::RenderFrame.

    -
    Attention

    bgfx::renderFrame is blocking call. It waits for bgfx::frame to be called from API thread to process frame. If timeout value is passed call will timeout and return even if bgfx::frame is not called.

    -
    Warning

    This call should be only used on platforms that don’t allow creating separate rendering thread. If it is called before to bgfx::init, render thread won’t be created by bgfx::init call.

    -
    Attention

    C99 equivalent is bgfx_render_frame.

    -
    Parameters
      -
    • _msecs: Timeout in milliseconds.

    • -
    -

    +
    +

    Warning

    +

    This call should be only used on platforms that don’t allow creating separate rendering thread. If it is called before to bgfx::init, render thread won’t be created by bgfx::init call.

    +
    +
    +
    Parameters
    +

    _msecs – Timeout in milliseconds.

    +
    +
    Returns
    +

    Current renderer state. See: bgfx::RenderFrame.

    +
    +
    -
    -struct RenderFrame
    +
    +struct RenderFrame

    Render frame enum.

    Attention

    C99 equivalent is bgfx_render_frame_t.

    @@ -1939,21 +2026,23 @@ creating windows.

    -
    -void bgfx::setPlatformData(const PlatformData &_data)
    +
    +void bgfx::setPlatformData(const PlatformData &_data)

    Set platform data.

    -
    Warning

    Must be called before bgfx::init.

    -
    Attention

    C99 equivalent is bgfx_set_platform_data.

    +
    +

    Warning

    +

    Must be called before bgfx::init.

    +
    -
    -struct bgfx::PlatformData
    +
    +struct bgfx::PlatformData

    Platform data.

    Attention

    C99 equivalent is bgfx_platform_data_t.

    @@ -1961,34 +2050,34 @@ creating windows.

    -

    Public Members

    +

    Public Members

    -
    -void *ndt
    +
    +void *ndt

    Native display type (*nix specific).

    -
    -void *nwh
    +
    +void *nwh

    Native window handle. If NULL bgfx will create headless context/device if renderer API supports it.

    -
    -void *context
    +
    +void *context

    GL context, or D3D device. If NULL, bgfx will create context/device.

    -
    -void *backBuffer
    +
    +void *backBuffer

    GL back-buffer, or D3D render target view. If NULL bgfx will create back-buffer color surface.

    -
    -void *backBufferDS
    +
    +void *backBufferDS

    Backbuffer depth/stencil. If NULL bgfx will create back-buffer depth/stencil surface.

    @@ -1996,23 +2085,25 @@ creating windows.

    -
    -const InternalData *bgfx::getInternalData()
    +
    +const InternalData *bgfx::getInternalData()

    Get internal data for interop.

    Attention

    It’s expected you understand some bgfx internals before you use this call.

    -
    Warning

    Must be called only on render thread.

    -
    Attention

    C99 equivalent is bgfx_get_internal_data.

    +
    +

    Warning

    +

    Must be called only on render thread.

    +
    -
    -struct bgfx::InternalData
    +
    +struct bgfx::InternalData

    Internal data.

    Attention

    C99 equivalent is bgfx_internal_data_t.

    @@ -2020,16 +2111,16 @@ creating windows.

    -

    Public Members

    +

    Public Members

    -
    -const struct Caps *caps
    +
    +const struct Caps *caps

    Renderer capabilities.

    -
    -void *context
    +
    +void *context

    GL context, or D3D device.

    @@ -2037,143 +2128,168 @@ creating windows.

    -
    -uintptr_t bgfx::overrideInternal(TextureHandle _handle, uintptr_t _ptr)
    +
    +uintptr_t bgfx::overrideInternal(TextureHandle _handle, uintptr_t _ptr)

    Override internal texture with externally created texture. Previously created internal texture will released.

    Attention

    It’s expected you understand some bgfx internals before you use this call.

    -
    Return

    Native API pointer to texture. If result is 0, texture is not created yet from the main thread.

    -
    -
    Warning

    Must be called only on render thread.

    -
    Attention

    C99 equivalent is bgfx_override_internal_texture_ptr.

    -
    Parameters
      -
    • [in] _handle: Texture handle.

    • -
    • [in] _ptr: Native API pointer to texture.

    • -
    -

    +
    +

    Warning

    +

    Must be called only on render thread.

    +
    +
    +
    Parameters
    +
      +
    • _handle[in] Texture handle.

    • +
    • _ptr[in] Native API pointer to texture.

    • +
    +
    +
    Returns
    +

    Native API pointer to texture. If result is 0, texture is not created yet from the main thread.

    +
    +
    -
    -uintptr_t bgfx::overrideInternal(TextureHandle _handle, uint16_t _width, uint16_t _height, uint8_t _numMips, TextureFormat::Enum _format, uint64_t _flags = BGFX_TEXTURE_NONE | BGFX_SAMPLER_NONE)
    +
    +uintptr_t bgfx::overrideInternal(TextureHandle _handle, uint16_t _width, uint16_t _height, uint8_t _numMips, TextureFormat::Enum _format, uint64_t _flags = BGFX_TEXTURE_NONE | BGFX_SAMPLER_NONE)

    Override internal texture by creating new texture. Previously created internal texture will released.

    Attention

    It’s expected you understand some bgfx internals before you use this call.

    -
    Return

    Native API pointer to texture. If result is 0, texture is not created yet from the main thread.

    -
    -
    Warning

    Must be called only on render thread.

    -
    Attention

    C99 equivalent is bgfx_override_internal_texture.

    -
    Parameters
      -
    • [in] _handle: Texture handle.

    • -
    • [in] _width: Width.

    • -
    • [in] _height: Height.

    • -
    • [in] _numMips: Number of mip-maps.

    • -
    • [in] _format: Texture format. See: TextureFormat::Enum.

    • -
    • [in] _flags: Default texture sampling mode is linear, and wrap mode is repeat.

        +
    +

    +
    +

    Warning

    +

    Must be called only on render thread.

    +
    +
    +
    Parameters
    +
      +
    • _handle[in] Texture handle.

    • +
    • _width[in] Width.

    • +
    • _height[in] Height.

    • +
    • _numMips[in] Number of mip-maps.

    • +
    • _format[in] Texture format. See: TextureFormat::Enum.

    • +
    • _flags[in] Default texture sampling mode is linear, and wrap mode is repeat.

      • BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP] - Mirror or clamp to edge wrap mode.

      • BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC] - Point or anisotropic sampling.

    +
    Returns
    +

    Native API pointer to texture. If result is 0, texture is not created yet from the main thread.

    +
    -

    -
    -
    + +

    Miscellaneous

    -
    -void bgfx::vertexPack(const float _input[4], bool _inputNormalized, Attrib::Enum _attr, const VertexLayout &_layout, void *_data, uint32_t _index = 0)
    +
    +void bgfx::vertexPack(const float _input[4], bool _inputNormalized, Attrib::Enum _attr, const VertexLayout &_layout, void *_data, uint32_t _index = 0)

    Pack vertex attribute into vertex stream format.

    Attention

    C99 equivalent is bgfx_vertex_pack.

    -
    Parameters
      -
    • [in] _input: Value to be packed into vertex stream.

    • -
    • [in] _inputNormalized: True if input value is already normalized.

    • -
    • [in] _attr: Attribute to pack.

    • -
    • [in] _layout: Vertex stream layout.

    • -
    • [in] _data: Destination vertex stream where data will be packed.

    • -
    • [in] _index: Vertex index that will be modified.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _input[in] Value to be packed into vertex stream.

    • +
    • _inputNormalized[in] True if input value is already normalized.

    • +
    • _attr[in] Attribute to pack.

    • +
    • _layout[in] Vertex stream layout.

    • +
    • _data[in] Destination vertex stream where data will be packed.

    • +
    • _index[in] Vertex index that will be modified.

    -

    -
    -void bgfx::vertexUnpack(float _output[4], Attrib::Enum _attr, const VertexLayout &_layout, const void *_data, uint32_t _index = 0)
    +
    +void bgfx::vertexUnpack(float _output[4], Attrib::Enum _attr, const VertexLayout &_layout, const void *_data, uint32_t _index = 0)

    Unpack vertex attribute from vertex stream format.

    Attention

    C99 equivalent is bgfx_vertex_unpack.

    -
    Parameters
      -
    • [out] _output: Result of unpacking.

    • -
    • [in] _attr: Attribute to unpack.

    • -
    • [in] _layout: Vertex stream layout.

    • -
    • [in] _data: Source vertex stream from where data will be unpacked.

    • -
    • [in] _index: Vertex index that will be unpacked.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _output[out] Result of unpacking.

    • +
    • _attr[in] Attribute to unpack.

    • +
    • _layout[in] Vertex stream layout.

    • +
    • _data[in] Source vertex stream from where data will be unpacked.

    • +
    • _index[in] Vertex index that will be unpacked.

    -

    -
    -void bgfx::vertexConvert(const VertexLayout &_destLayout, void *_destData, const VertexLayout &_srcLayout, const void *_srcData, uint32_t _num = 1)
    +
    +void bgfx::vertexConvert(const VertexLayout &_destLayout, void *_destData, const VertexLayout &_srcLayout, const void *_srcData, uint32_t _num = 1)

    Converts vertex stream data from one vertex stream format to another.

    Attention

    C99 equivalent is bgfx_vertex_convert.

    -
    Parameters
      -
    • [in] _destLayout: Destination vertex stream layout.

    • -
    • [in] _destData: Destination vertex stream.

    • -
    • [in] _srcLayout: Source vertex stream layout.

    • -
    • [in] _srcData: Source vertex stream data.

    • -
    • [in] _num: Number of vertices to convert from source to destination.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _destLayout[in] Destination vertex stream layout.

    • +
    • _destData[in] Destination vertex stream.

    • +
    • _srcLayout[in] Source vertex stream layout.

    • +
    • _srcData[in] Source vertex stream data.

    • +
    • _num[in] Number of vertices to convert from source to destination.

    -

    -
    -uint32_t bgfx::weldVertices(void *_output, const VertexLayout &_layout, const void *_data, uint32_t _num, bool _index32, float _epsilon = 0.001f)
    +
    +uint32_t bgfx::weldVertices(void *_output, const VertexLayout &_layout, const void *_data, uint32_t _num, bool _index32, float _epsilon = 0.001f)

    Weld vertices.

    -
    Return

    Number of unique vertices after vertex welding.

    -
    Attention

    C99 equivalent is bgfx_weld_vertices.

    -
    Parameters
      -
    • [in] _output: Welded vertices remapping table. The size of buffer must be the same as number of vertices.

    • -
    • [in] _layout: Vertex stream layout.

    • -
    • [in] _data: Vertex stream.

    • -
    • [in] _num: Number of vertices in vertex stream.

    • -
    • [in] _index32: Set to true if input indices are 32-bit.

    • -
    • [in] _epsilon: Error tolerance for vertex position comparison.

    • -
    -

    +
    +
    Parameters
    +
      +
    • _output[in] Welded vertices remapping table. The size of buffer must be the same as number of vertices.

    • +
    • _layout[in] Vertex stream layout.

    • +
    • _data[in] Vertex stream.

    • +
    • _num[in] Number of vertices in vertex stream.

    • +
    • _index32[in] Set to true if input indices are 32-bit.

    • +
    • _epsilon[in] Error tolerance for vertex position comparison.

    • +
    +
    +
    Returns
    +

    Number of unique vertices after vertex welding.

    +
    +
    -
    -struct bgfx::TopologyConvert
    +
    +struct bgfx::TopologyConvert

    Topology conversion function.

    Attention

    C99 equivalent is bgfx_topology_convert_t.

    @@ -2181,45 +2297,45 @@ creating windows.

    -

    Public Types

    +

    Public Types

    -
    -enum Enum
    +
    +enum Enum

    Topology conversion functions:

    Values:

    -
    -enumerator TriListFlipWinding
    +
    +enumerator TriListFlipWinding

    Flip winding order of triangle list.

    -
    -enumerator TriStripFlipWinding
    +
    +enumerator TriStripFlipWinding

    Flip winding order of trinagle strip.

    -
    -enumerator TriListToLineList
    +
    +enumerator TriListToLineList

    Convert triangle list to line list.

    -
    -enumerator TriStripToTriList
    +
    +enumerator TriStripToTriList

    Convert triangle strip to triangle list.

    -
    -enumerator LineStripToLineList
    +
    +enumerator LineStripToLineList

    Convert line strip to line list.

    -
    -enumerator Count
    +
    +enumerator Count
    @@ -2228,30 +2344,34 @@ creating windows.

    -
    -uint32_t bgfx::topologyConvert(TopologyConvert::Enum _conversion, void *_dst, uint32_t _dstSize, const void *_indices, uint32_t _numIndices, bool _index32)
    +
    +uint32_t bgfx::topologyConvert(TopologyConvert::Enum _conversion, void *_dst, uint32_t _dstSize, const void *_indices, uint32_t _numIndices, bool _index32)

    Convert index buffer for use with different primitive topologies.

    -
    Return

    Number of output indices after conversion.

    -
    Attention

    C99 equivalent is bgfx_topology_convert.

    -
    Parameters
      -
    • [in] _conversion: Conversion type, see TopologyConvert::Enum.

    • -
    • [in] _dst: Destination index buffer. If this argument is NULL function will return number of indices after conversion.

    • -
    • [in] _dstSize: Destination index buffer in bytes. It must be large enough to contain output indices. If destination size is insufficient index buffer will be truncated.

    • -
    • [in] _indices: Source indices.

    • -
    • [in] _numIndices: Number of input indices.

    • -
    • [in] _index32: Set to true if input indices are 32-bit.

    • -
    -

    +
    +
    Parameters
    +
      +
    • _conversion[in] Conversion type, see TopologyConvert::Enum.

    • +
    • _dst[in] Destination index buffer. If this argument is NULL function will return number of indices after conversion.

    • +
    • _dstSize[in] Destination index buffer in bytes. It must be large enough to contain output indices. If destination size is insufficient index buffer will be truncated.

    • +
    • _indices[in] Source indices.

    • +
    • _numIndices[in] Number of input indices.

    • +
    • _index32[in] Set to true if input indices are 32-bit.

    • +
    +
    +
    Returns
    +

    Number of output indices after conversion.

    +
    +
    -
    -struct bgfx::TopologySort
    +
    +struct bgfx::TopologySort

    Topology sort order.

    Attention

    C99 equivalent is bgfx_topology_sort_t.

    @@ -2259,75 +2379,75 @@ creating windows.

    -

    Public Types

    +

    Public Types

    -
    -enum Enum
    +
    +enum Enum

    Topology sort order:

    Values:

    -
    -enumerator DirectionFrontToBackMin
    +
    +enumerator DirectionFrontToBackMin
    -
    -enumerator DirectionFrontToBackAvg
    +
    +enumerator DirectionFrontToBackAvg
    -
    -enumerator DirectionFrontToBackMax
    +
    +enumerator DirectionFrontToBackMax
    -
    -enumerator DirectionBackToFrontMin
    +
    +enumerator DirectionBackToFrontMin
    -
    -enumerator DirectionBackToFrontAvg
    +
    +enumerator DirectionBackToFrontAvg
    -
    -enumerator DirectionBackToFrontMax
    +
    +enumerator DirectionBackToFrontMax
    -
    -enumerator DistanceFrontToBackMin
    +
    +enumerator DistanceFrontToBackMin
    -
    -enumerator DistanceFrontToBackAvg
    +
    +enumerator DistanceFrontToBackAvg
    -
    -enumerator DistanceFrontToBackMax
    +
    +enumerator DistanceFrontToBackMax
    -
    -enumerator DistanceBackToFrontMin
    +
    +enumerator DistanceBackToFrontMin
    -
    -enumerator DistanceBackToFrontAvg
    +
    +enumerator DistanceBackToFrontAvg
    -
    -enumerator DistanceBackToFrontMax
    +
    +enumerator DistanceBackToFrontMax
    -
    -enumerator Count
    +
    +enumerator Count
    @@ -2336,111 +2456,125 @@ creating windows.

    -
    -void bgfx::topologySortTriList(TopologySort::Enum _sort, void *_dst, uint32_t _dstSize, const float _dir[3], const float _pos[3], const void *_vertices, uint32_t _stride, const void *_indices, uint32_t _numIndices, bool _index32)
    +
    +void bgfx::topologySortTriList(TopologySort::Enum _sort, void *_dst, uint32_t _dstSize, const float _dir[3], const float _pos[3], const void *_vertices, uint32_t _stride, const void *_indices, uint32_t _numIndices, bool _index32)

    Sort indices.

    Attention

    C99 equivalent is bgfx_topology_sort_tri_list.

    -
    Parameters
      -
    • [in] _sort: Sort order, see TopologySort::Enum.

    • -
    • [in] _dst: Destination index buffer.

    • -
    • [in] _dstSize: Destination index buffer in bytes. It must be large enough to contain output indices. If destination size is insufficient index buffer will be truncated.

    • -
    • [in] _dir: Direction (vector must be normalized).

    • -
    • [in] _pos: Position.

    • -
    • [in] _vertices: Pointer to first vertex represented as float x, y, z. Must contain at least number of vertices referencende by index buffer.

    • -
    • [in] _stride: Vertex stride.

    • -
    • [in] _indices: Source indices.

    • -
    • [in] _numIndices: Number of input indices.

    • -
    • [in] _index32: Set to true if input indices are 32-bit.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _sort[in] Sort order, see TopologySort::Enum.

    • +
    • _dst[in] Destination index buffer.

    • +
    • _dstSize[in] Destination index buffer in bytes. It must be large enough to contain output indices. If destination size is insufficient index buffer will be truncated.

    • +
    • _dir[in] Direction (vector must be normalized).

    • +
    • _pos[in] Position.

    • +
    • _vertices[in] Pointer to first vertex represented as float x, y, z. Must contain at least number of vertices referencende by index buffer.

    • +
    • _stride[in] Vertex stride.

    • +
    • _indices[in] Source indices.

    • +
    • _numIndices[in] Number of input indices.

    • +
    • _index32[in] Set to true if input indices are 32-bit.

    -

    -
    -void bgfx::discard(uint8_t _flags = BGFX_DISCARD_ALL)
    +
    +void bgfx::discard(uint8_t _flags = BGFX_DISCARD_ALL)

    Discard all previously set state for draw or compute call.

    Attention

    C99 equivalent is bgfx_discard.

    -
    Parameters
      -
    • [in] _flags: Draw/compute states to discard.

    • -
    -

    +
    +
    Parameters
    +

    _flags[in] Draw/compute states to discard.

    +
    +
    -
    -void bgfx::touch(ViewId _id)
    +
    +void bgfx::touch(ViewId _id)

    Submit an empty primitive for rendering. Uniforms and draw state will be applied but no geometry will be submitted.

    These empty draw calls will sort before ordinary draw calls.

    Attention

    C99 equivalent is bgfx_touch.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    -

    +
    +
    Parameters
    +

    _id[in] View id.

    +
    +
    -
    -void bgfx::setPaletteColor(uint8_t _index, uint32_t _rgba)
    +
    +void bgfx::setPaletteColor(uint8_t _index, uint32_t _rgba)

    Set palette color value.

    Attention

    C99 equivalent is bgfx_set_palette_color.

    -
    Parameters
      -
    • [in] _index: Index into palette.

    • -
    • [in] _rgba: Packed 32-bit RGBA value.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _index[in] Index into palette.

    • +
    • _rgba[in] Packed 32-bit RGBA value.

    -

    -
    -void bgfx::setPaletteColor(uint8_t _index, const float _rgba[4])
    +
    +void bgfx::setPaletteColor(uint8_t _index, const float _rgba[4])

    Set palette color value.

    Attention

    C99 equivalent is bgfx_set_palette_color.

    -
    Parameters
      -
    • [in] _index: Index into palette.

    • -
    • [in] _rgba: RGBA floating point value.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _index[in] Index into palette.

    • +
    • _rgba[in] RGBA floating point value.

    -

    -
    -void bgfx::setPaletteColor(uint8_t _index, float _r, float _g, float _b, float _a)
    +
    +void bgfx::setPaletteColor(uint8_t _index, float _r, float _g, float _b, float _a)

    Set palette color value.

    Attention

    C99 equivalent is bgfx_set_palette_color.

    -
    Parameters
      -
    • [in] _index: Index into palette.

    • -
    • [in] _r[in] _g[in] _b[in] _a: RGBA floating point values.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _index[in] Index into palette.

    • +
    • _r, _g, _b, _a[in] RGBA floating point values.

    -

    -
    -void bgfx::requestScreenShot(FrameBufferHandle _handle, const char *_filePath)
    +
    +void bgfx::requestScreenShot(FrameBufferHandle _handle, const char *_filePath)

    Request screen shot of window back buffer.

    Remark

    bgfx::CallbackI::screenShot must be implemented.

    @@ -2449,18 +2583,21 @@ creating windows.

    Attention

    C99 equivalent is bgfx_request_screen_shot.

    -
    Parameters
      -
    • [in] _handle: Frame buffer handle. If handle is BGFX_INVALID_HANDLE request will be made for main window back buffer.

    • -
    • [in] _filePath: Will be passed to bgfx::CallbackI::screenShot callback.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] Frame buffer handle. If handle is BGFX_INVALID_HANDLE request will be made for main window back buffer.

    • +
    • _filePath[in] Will be passed to bgfx::CallbackI::screenShot callback.

    -

    -
    - -
    + + +

    Views

    View is primary sorting mechanism in bgfx. View represent bucket of draw and compute calls. Compute and draw calls inside bucket are sorted in the way that all compute calls are executed before draw @@ -2474,11 +2611,11 @@ known until the last moment, view ids can be remaped to arbitrary order by calli bgfx::setViewOrder.

    View state is preserved between multiple frames.

    -
    -void bgfx::setViewName(ViewId _id, const char *_name)
    +
    +void bgfx::setViewName(ViewId _id, const char *_name)

    Set view name.

    -

    In graphics debugger view name will appear as:

    -
    "nnnce <view name>"
    +

    +In graphics debugger view name will appear as:

    "nnnce <view name>"
      ^  ^^ ^
      |  |+-- eye (L/R)
      |  +--- compute (C)
    @@ -2488,11 +2625,6 @@ known until the last moment, view ids can be remaped to arbitrary order by calli
     
    Remark

    This is debug only feature.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _name: View name.

    • -
    -

    @@ -2500,112 +2632,135 @@ known until the last moment, view ids can be remaped to arbitrary order by calli

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _name[in] View name.

    • +
    +
    +
    -
    -void bgfx::setViewRect(ViewId _id, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height)
    +
    +void bgfx::setViewRect(ViewId _id, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height)

    Set view rectangle. Draw primitive outside view will be clipped.

    Attention

    C99 equivalent is bgfx_set_view_rect.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _x: Position x from the left corner of the window.

    • -
    • [in] _y: Position y from the top corner of the window.

    • -
    • [in] _width: Width of view port region.

    • -
    • [in] _height: Height of view port region.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _x[in] Position x from the left corner of the window.

    • +
    • _y[in] Position y from the top corner of the window.

    • +
    • _width[in] Width of view port region.

    • +
    • _height[in] Height of view port region.

    -

    -
    -void bgfx::setViewRect(ViewId _id, uint16_t _x, uint16_t _y, BackbufferRatio::Enum _ratio)
    +
    +void bgfx::setViewRect(ViewId _id, uint16_t _x, uint16_t _y, BackbufferRatio::Enum _ratio)

    Set view rectangle. Draw primitive outside view will be clipped.

    Attention

    C99 equivalent is bgfx_set_view_rect_ratio.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _x: Position x from the left corner of the window.

    • -
    • [in] _y: Position y from the top corner of the window.

    • -
    • [in] _ratio: Width and height will be set in respect to back-buffer size. See: BackbufferRatio::Enum.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _x[in] Position x from the left corner of the window.

    • +
    • _y[in] Position y from the top corner of the window.

    • +
    • _ratio[in] Width and height will be set in respect to back-buffer size. See: BackbufferRatio::Enum.

    -

    -
    -void bgfx::setViewScissor(ViewId _id, uint16_t _x = 0, uint16_t _y = 0, uint16_t _width = 0, uint16_t _height = 0)
    +
    +void bgfx::setViewScissor(ViewId _id, uint16_t _x = 0, uint16_t _y = 0, uint16_t _width = 0, uint16_t _height = 0)

    Set view scissor. Draw primitive outside view will be clipped. When _x, _y, _width and _height are set to 0, scissor will be disabled.

    Attention

    C99 equivalent is bgfx_set_view_scissor.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _x: Position x from the left corner of the window.

    • -
    • [in] _y: Position y from the top corner of the window.

    • -
    • [in] _width: Width of scissor region.

    • -
    • [in] _height: Height of scissor region.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _x[in] Position x from the left corner of the window.

    • +
    • _y[in] Position y from the top corner of the window.

    • +
    • _width[in] Width of scissor region.

    • +
    • _height[in] Height of scissor region.

    -

    -
    -void bgfx::setViewClear(ViewId _id, uint16_t _flags, uint32_t _rgba = 0x000000ff, float _depth = 1.0f, uint8_t _stencil = 0)
    +
    +void bgfx::setViewClear(ViewId _id, uint16_t _flags, uint32_t _rgba = 0x000000ff, float _depth = 1.0f, uint8_t _stencil = 0)

    Set view clear flags.

    Attention

    C99 equivalent is bgfx_set_view_clear.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _flags: Clear flags. Use BGFX_CLEAR_NONE to remove any clear operation. See: BGFX_CLEAR_*.

    • -
    • [in] _rgba: Color clear value.

    • -
    • [in] _depth: Depth clear value.

    • -
    • [in] _stencil: Stencil clear value.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _flags[in] Clear flags. Use BGFX_CLEAR_NONE to remove any clear operation. See: BGFX_CLEAR_*.

    • +
    • _rgba[in] Color clear value.

    • +
    • _depth[in] Depth clear value.

    • +
    • _stencil[in] Stencil clear value.

    -

    -
    -void bgfx::setViewClear(ViewId _id, uint16_t _flags, float _depth, uint8_t _stencil, uint8_t _0 = UINT8_MAX, uint8_t _1 = UINT8_MAX, uint8_t _2 = UINT8_MAX, uint8_t _3 = UINT8_MAX, uint8_t _4 = UINT8_MAX, uint8_t _5 = UINT8_MAX, uint8_t _6 = UINT8_MAX, uint8_t _7 = UINT8_MAX)
    +
    +void bgfx::setViewClear(ViewId _id, uint16_t _flags, float _depth, uint8_t _stencil, uint8_t _0 = UINT8_MAX, uint8_t _1 = UINT8_MAX, uint8_t _2 = UINT8_MAX, uint8_t _3 = UINT8_MAX, uint8_t _4 = UINT8_MAX, uint8_t _5 = UINT8_MAX, uint8_t _6 = UINT8_MAX, uint8_t _7 = UINT8_MAX)

    Set view clear flags with different clear color for each frame buffer texture. Must use bgfx::setPaletteColor to setup clear color palette.

    Attention

    C99 equivalent is bgfx_set_view_clear_mrt.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _flags: Clear flags. Use BGFX_CLEAR_NONE to remove any clear operation. See: BGFX_CLEAR_*.

    • -
    • [in] _depth: Depth clear value.

    • -
    • [in] _stencil: Stencil clear value.

    • -
    • [in] _0: Palette index for frame buffer attachment 0.

    • -
    • [in] _1: Palette index for frame buffer attachment 1.

    • -
    • [in] _2: Palette index for frame buffer attachment 2.

    • -
    • [in] _3: Palette index for frame buffer attachment 3.

    • -
    • [in] _4: Palette index for frame buffer attachment 4.

    • -
    • [in] _5: Palette index for frame buffer attachment 5.

    • -
    • [in] _6: Palette index for frame buffer attachment 6.

    • -
    • [in] _7: Palette index for frame buffer attachment 7.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _flags[in] Clear flags. Use BGFX_CLEAR_NONE to remove any clear operation. See: BGFX_CLEAR_*.

    • +
    • _depth[in] Depth clear value.

    • +
    • _stencil[in] Stencil clear value.

    • +
    • _0[in] Palette index for frame buffer attachment 0.

    • +
    • _1[in] Palette index for frame buffer attachment 1.

    • +
    • _2[in] Palette index for frame buffer attachment 2.

    • +
    • _3[in] Palette index for frame buffer attachment 3.

    • +
    • _4[in] Palette index for frame buffer attachment 4.

    • +
    • _5[in] Palette index for frame buffer attachment 5.

    • +
    • _6[in] Palette index for frame buffer attachment 6.

    • +
    • _7[in] Palette index for frame buffer attachment 7.

    -

    -
    -struct bgfx::ViewMode
    +
    +struct bgfx::ViewMode

    View mode sets draw call sort order.

    Attention

    C99 equivalent is bgfx_view_mode_t.

    @@ -2613,39 +2768,39 @@ known until the last moment, view ids can be remaped to arbitrary order by calli

    -

    Public Types

    +

    Public Types

    -
    -enum Enum
    +
    +enum Enum

    View modes:

    Values:

    -
    -enumerator Default
    +
    +enumerator Default

    Default sort order.

    -
    -enumerator Sequential
    +
    +enumerator Sequential

    Sort in the same order in which submit calls were called.

    -
    -enumerator DepthAscending
    +
    +enumerator DepthAscending

    Sort draw call depth in ascending order.

    -
    -enumerator DepthDescending
    +
    +enumerator DepthDescending

    Sort draw call depth in descending order.

    -
    -enumerator Count
    +
    +enumerator Count
    @@ -2654,118 +2809,129 @@ known until the last moment, view ids can be remaped to arbitrary order by calli
    -
    -void bgfx::setViewMode(ViewId _id, ViewMode::Enum _mode = ViewMode::Default)
    +
    +void bgfx::setViewMode(ViewId _id, ViewMode::Enum _mode = ViewMode::Default)

    Set view sorting mode.

    Remark

    View mode must be set prior calling bgfx::submit for the view.

    Attention

    C99 equivalent is bgfx_set_view_mode.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _mode: View sort mode. See ViewMode::Enum.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _mode[in] View sort mode. See ViewMode::Enum.

    -

    -
    -void bgfx::setViewFrameBuffer(ViewId _id, FrameBufferHandle _handle)
    +
    +void bgfx::setViewFrameBuffer(ViewId _id, FrameBufferHandle _handle)

    Set view frame buffer.

    Remark

    Not persistent after bgfx::reset call.

    Attention

    C99 equivalent is bgfx_set_view_frame_buffer.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _handle: Frame buffer handle. Passing BGFX_INVALID_HANDLE as frame buffer handle will draw primitives from this view into default back buffer.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _handle[in] Frame buffer handle. Passing BGFX_INVALID_HANDLE as frame buffer handle will draw primitives from this view into default back buffer.

    -

    -
    -void bgfx::setViewTransform(ViewId _id, const void *_view, const void *_proj)
    +
    +void bgfx::setViewTransform(ViewId _id, const void *_view, const void *_proj)

    Set view view and projection matrices, all draw primitives in this view will use these matrices.

    Attention

    C99 equivalent is bgfx_set_view_transform.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _view: View matrix.

    • -
    • [in] _proj: Projection matrix.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _view[in] View matrix.

    • +
    • _proj[in] Projection matrix.

    -

    -
    -void bgfx::setViewOrder(ViewId _id = 0, uint16_t _num = UINT16_MAX, const ViewId *_remap = NULL)
    +
    +void bgfx::setViewOrder(ViewId _id = 0, uint16_t _num = UINT16_MAX, const ViewId *_remap = NULL)

    Post submit view reordering.

    Attention

    C99 equivalent is bgfx_set_view_order.

    -
    Parameters
      -
    • [in] _id: First view id.

    • -
    • [in] _num: Number of views to remap.

    • -
    • [in] _remap: View remap id table. Passing NULL will reset view ids to default state.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] First view id.

    • +
    • _num[in] Number of views to remap.

    • +
    • _remap[in] View remap id table. Passing NULL will reset view ids to default state.

    -

    -
    -void bgfx::resetView(ViewId _id)
    +
    +void bgfx::resetView(ViewId _id)

    Reset all view settings to default.

    Attention

    C99 equivalent is bgfx_reset_view.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    -

    +
    +
    Parameters
    +

    _id[in] View id.

    +
    +
    -
    -
    + +

    Encoder

    -
    +

    Encoder

    API for multi-threaded submission.

    -
    -Encoder *bgfx::begin(bool _forThread = false)
    +
    +Encoder *bgfx::begin(bool _forThread = false)

    Begin submitting draw calls from thread.

    -

    -
    Parameters
      -
    • [in] _forThread: Explicitly request an encoder for a worker thread.

    • -
    +
    +
    Parameters
    +

    _forThread[in] Explicitly request an encoder for a worker thread.

    -

    -
    -void bgfx::end(Encoder *_encoder)
    +
    +void bgfx::end(Encoder *_encoder)

    End submitting draw calls from thread.

    -
    -struct bgfx::Encoder
    +
    +struct bgfx::Encoder

    Encoders are used for submitting draw calls from multiple threads. Only one encoder per thread should be used. Use bgfx::begin() to obtain an encoder for a thread.

    Attention

    C99 equivalent is bgfx_encoder.

    @@ -2773,10 +2939,10 @@ known until the last moment, view ids can be remaped to arbitrary order by calli

    -

    Public Functions

    +

    Public Functions

    -
    -void setMarker(const char *_marker)
    +
    +void setMarker(const char *_marker)

    Sets a debug marker. This allows you to group graphics calls together for easy browsing in graphics debugging tools.

    Attention

    C99 equivalent is bgfx_encoder_set_marker.

    @@ -2786,8 +2952,8 @@ known until the last moment, view ids can be remaped to arbitrary order by calli
    -
    -void setState(uint64_t _state, uint32_t _rgba = 0)
    +
    +void setState(uint64_t _state, uint32_t _rgba = 0)

    Set render states for draw primitive.

    Remark

      @@ -2798,8 +2964,12 @@ known until the last moment, view ids can be remaped to arbitrary order by calli
    Attention

    C99 equivalent is bgfx_encoder_set_state.

    -
    Parameters
      -
    • [in] _state: State flags. Default state for primitive type is triangles. See: BGFX_STATE_DEFAULT.

        +
    +

    +
    +
    Parameters
    +
      +
    • _state[in] State flags. Default state for primitive type is triangles. See: BGFX_STATE_DEFAULT.

      • BGFX_STATE_DEPTH_TEST_* - Depth test function.

      • BGFX_STATE_BLEND_* - See remark 1 about BGFX_STATE_BLEND_FUNC.

      • BGFX_STATE_BLEND_EQUATION_* - See remark 2.

      • @@ -2809,464 +2979,534 @@ known until the last moment, view ids can be remaped to arbitrary order by calli
      • BGFX_STATE_PT_[TRISTRIP/LINES/POINTS] - Primitive type.

    • -
    • [in] _rgba: Sets blend factor used by BGFX_STATE_BLEND_FACTOR and BGFX_STATE_BLEND_INV_FACTOR blend modes.

    • +
    • _rgba[in] Sets blend factor used by BGFX_STATE_BLEND_FACTOR and BGFX_STATE_BLEND_INV_FACTOR blend modes.

    -

    -
    -void setCondition(OcclusionQueryHandle _handle, bool _visible)
    +
    +void setCondition(OcclusionQueryHandle _handle, bool _visible)

    Set condition for rendering.

    Attention

    C99 equivalent is bgfx_encoder_set_condition.

    -
    Parameters
      -
    • [in] _handle: Occlusion query handle.

    • -
    • [in] _visible: Render if occlusion query is visible.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] Occlusion query handle.

    • +
    • _visible[in] Render if occlusion query is visible.

    -

    -
    -void setStencil(uint32_t _fstencil, uint32_t _bstencil = BGFX_STENCIL_NONE)
    +
    +void setStencil(uint32_t _fstencil, uint32_t _bstencil = BGFX_STENCIL_NONE)

    Set stencil test state.

    Attention

    C99 equivalent is bgfx_encoder_set_stencil.

    -
    Parameters
      -
    • [in] _fstencil: Front stencil state.

    • -
    • [in] _bstencil: Back stencil state. If back is set to BGFX_STENCIL_NONE _fstencil is applied to both front and back facing primitives.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _fstencil[in] Front stencil state.

    • +
    • _bstencil[in] Back stencil state. If back is set to BGFX_STENCIL_NONE _fstencil is applied to both front and back facing primitives.

    -

    -
    -uint16_t setScissor(uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height)
    +
    +uint16_t setScissor(uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height)

    Set scissor for draw primitive. To scissor for all primitives in view see bgfx::setViewScissor.

    -
    Return

    Scissor cache index.

    -
    Attention

    C99 equivalent is bgfx_encoder_set_scissor.

    -
    Parameters
      -
    • [in] _x: Position x from the left side of the window.

    • -
    • [in] _y: Position y from the top of the window.

    • -
    • [in] _width: Width of scissor region.

    • -
    • [in] _height: Height of scissor region.

    • -
    -

    +
    +
    Parameters
    +
      +
    • _x[in] Position x from the left side of the window.

    • +
    • _y[in] Position y from the top of the window.

    • +
    • _width[in] Width of scissor region.

    • +
    • _height[in] Height of scissor region.

    • +
    +
    +
    Returns
    +

    Scissor cache index.

    +
    +
    -
    -void setScissor(uint16_t _cache = UINT16_MAX)
    +
    +void setScissor(uint16_t _cache = UINT16_MAX)

    Set scissor from cache for draw primitive.

    Attention

    C99 equivalent is bgfx_encoder_set_scissor_cached.

    -
    Parameters
      -
    • [in] _cache: Index in scissor cache. Pass UINT16_MAX to have primitive use view scissor instead.

    • -
    -

    +
    +
    Parameters
    +

    _cache[in] Index in scissor cache. Pass UINT16_MAX to have primitive use view scissor instead.

    +
    +
    -
    -uint32_t setTransform(const void *_mtx, uint16_t _num = 1)
    +
    +uint32_t setTransform(const void *_mtx, uint16_t _num = 1)

    Set model matrix for draw primitive. If it is not called, model will be rendered with identity model matrix.

    -
    Return

    Index into matrix cache in case the same model matrix has to be used for other draw primitive call.

    -
    Attention

    C99 equivalent is bgfx_encoder_set_transform.

    -
    Parameters
      -
    • [in] _mtx: Pointer to first matrix in array.

    • -
    • [in] _num: Number of matrices in array.

    • -
    -

    +
    +
    Parameters
    +
      +
    • _mtx[in] Pointer to first matrix in array.

    • +
    • _num[in] Number of matrices in array.

    • +
    +
    +
    Returns
    +

    Index into matrix cache in case the same model matrix has to be used for other draw primitive call.

    +
    +
    -
    -uint32_t allocTransform(Transform *_transform, uint16_t _num)
    +
    +uint32_t allocTransform(Transform *_transform, uint16_t _num)

    Reserve _num matrices in internal matrix cache.

    -
    Return

    Index into matrix cache.

    -
    Attention

    Pointer returned can be modifed until bgfx::frame is called.

    Attention

    C99 equivalent is bgfx_encoder_alloc_transform.

    -
    Parameters
      -
    • [in] _transform: Pointer to Transform structure.

    • -
    • [in] _num: Number of matrices.

    • -
    -

    +
    +
    Parameters
    +
      +
    • _transform[in] Pointer to Transform structure.

    • +
    • _num[in] Number of matrices.

    • +
    +
    +
    Returns
    +

    Index into matrix cache.

    +
    +
    -
    -void setTransform(uint32_t _cache, uint16_t _num = 1)
    +
    +void setTransform(uint32_t _cache, uint16_t _num = 1)

    Set model matrix from matrix cache for draw primitive.

    Attention

    C99 equivalent is bgfx_encoder_set_transform_cached.

    -
    Parameters
      -
    • [in] _cache: Index in matrix cache.

    • -
    • [in] _num: Number of matrices from cache.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _cache[in] Index in matrix cache.

    • +
    • _num[in] Number of matrices from cache.

    -

    -
    -void setUniform(UniformHandle _handle, const void *_value, uint16_t _num = 1)
    +
    +void setUniform(UniformHandle _handle, const void *_value, uint16_t _num = 1)

    Set shader uniform parameter for draw primitive.

    Attention

    C99 equivalent is bgfx_encoder_set_uniform.

    -
    Parameters
      -
    • [in] _handle: Uniform.

    • -
    • [in] _value: Pointer to uniform data.

    • -
    • [in] _num: Number of elements. Passing UINT16_MAX will use the _num passed on uniform creation.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] Uniform.

    • +
    • _value[in] Pointer to uniform data.

    • +
    • _num[in] Number of elements. Passing UINT16_MAX will use the _num passed on uniform creation.

    -

    -
    -void setIndexBuffer(IndexBufferHandle _handle)
    +
    +void setIndexBuffer(IndexBufferHandle _handle)

    Set index buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_encoder_set_index_buffer.

    -
    Parameters
      -
    • [in] _handle: Index buffer.

    • -
    -

    +
    +
    Parameters
    +

    _handle[in] Index buffer.

    +
    +
    -
    -void setIndexBuffer(IndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices)
    +
    +void setIndexBuffer(IndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices)

    Set index buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_encoder_set_index_buffer.

    -
    Parameters
      -
    • [in] _handle: Index buffer.

    • -
    • [in] _firstIndex: First index to render.

    • -
    • [in] _numIndices: Number of indices to render.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] Index buffer.

    • +
    • _firstIndex[in] First index to render.

    • +
    • _numIndices[in] Number of indices to render.

    -

    -
    -void setIndexBuffer(DynamicIndexBufferHandle _handle)
    +
    +void setIndexBuffer(DynamicIndexBufferHandle _handle)

    Set index buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_encoder_set_dynamic_index_buffer.

    -
    Parameters
      -
    • [in] _handle: Dynamic index buffer.

    • -
    -

    +
    +
    Parameters
    +

    _handle[in] Dynamic index buffer.

    +
    +
    -
    -void setIndexBuffer(DynamicIndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices)
    +
    +void setIndexBuffer(DynamicIndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices)

    Set index buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_encoder_set_dynamic_index_buffer.

    -
    Parameters
      -
    • [in] _handle: Dynamic index buffer.

    • -
    • [in] _firstIndex: First index to render.

    • -
    • [in] _numIndices: Number of indices to render.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] Dynamic index buffer.

    • +
    • _firstIndex[in] First index to render.

    • +
    • _numIndices[in] Number of indices to render.

    -

    -
    -void setIndexBuffer(const TransientIndexBuffer *_tib)
    +
    +void setIndexBuffer(const TransientIndexBuffer *_tib)

    Set index buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_encoder_set_transient_index_buffer.

    -
    Parameters
      -
    • [in] _tib: Transient index buffer.

    • -
    -

    +
    +
    Parameters
    +

    _tib[in] Transient index buffer.

    +
    +
    -
    -void setIndexBuffer(const TransientIndexBuffer *_tib, uint32_t _firstIndex, uint32_t _numIndices)
    +
    +void setIndexBuffer(const TransientIndexBuffer *_tib, uint32_t _firstIndex, uint32_t _numIndices)

    Set index buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_encoder_set_transient_index_buffer.

    -
    Parameters
      -
    • [in] _tib: Transient index buffer.

    • -
    • [in] _firstIndex: First index to render.

    • -
    • [in] _numIndices: Number of indices to render.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _tib[in] Transient index buffer.

    • +
    • _firstIndex[in] First index to render.

    • +
    • _numIndices[in] Number of indices to render.

    -

    -
    -void setVertexBuffer(uint8_t _stream, VertexBufferHandle _handle)
    +
    +void setVertexBuffer(uint8_t _stream, VertexBufferHandle _handle)

    Set vertex buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_encoder_set_vertex_buffer.

    -
    Parameters
      -
    • [in] _stream: Vertex stream.

    • -
    • [in] _handle: Vertex buffer.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stream[in] Vertex stream.

    • +
    • _handle[in] Vertex buffer.

    -

    -
    -void setVertexBuffer(uint8_t _stream, VertexBufferHandle _handle, uint32_t _startVertex, uint32_t _numVertices, VertexLayoutHandle _layoutHandle = BGFX_INVALID_HANDLE)
    +
    +void setVertexBuffer(uint8_t _stream, VertexBufferHandle _handle, uint32_t _startVertex, uint32_t _numVertices, VertexLayoutHandle _layoutHandle = BGFX_INVALID_HANDLE)

    Set vertex buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_encoder_set_vertex_buffer.

    -
    Parameters
      -
    • [in] _stream: Vertex stream.

    • -
    • [in] _handle: Vertex buffer.

    • -
    • [in] _startVertex: First vertex to render.

    • -
    • [in] _numVertices: Number of vertices to render.

    • -
    • [in] _layoutHandle: Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stream[in] Vertex stream.

    • +
    • _handle[in] Vertex buffer.

    • +
    • _startVertex[in] First vertex to render.

    • +
    • _numVertices[in] Number of vertices to render.

    • +
    • _layoutHandle[in] Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.

    -

    -
    -void setVertexBuffer(uint8_t _stream, DynamicVertexBufferHandle _handle)
    +
    +void setVertexBuffer(uint8_t _stream, DynamicVertexBufferHandle _handle)

    Set vertex buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_encoder_set_dynamic_vertex_buffer.

    -
    Parameters
      -
    • [in] _stream: Vertex stream.

    • -
    • [in] _handle: Dynamic vertex buffer.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stream[in] Vertex stream.

    • +
    • _handle[in] Dynamic vertex buffer.

    -

    -
    -void setVertexBuffer(uint8_t _stream, DynamicVertexBufferHandle _handle, uint32_t _startVertex, uint32_t _numVertices, VertexLayoutHandle _layoutHandle = BGFX_INVALID_HANDLE)
    +
    +void setVertexBuffer(uint8_t _stream, DynamicVertexBufferHandle _handle, uint32_t _startVertex, uint32_t _numVertices, VertexLayoutHandle _layoutHandle = BGFX_INVALID_HANDLE)

    Set vertex buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_encoder_set_dynamic_vertex_buffer.

    -
    Parameters
      -
    • [in] _stream: Vertex stream.

    • -
    • [in] _handle: Dynamic vertex buffer.

    • -
    • [in] _startVertex: First vertex to render.

    • -
    • [in] _numVertices: Number of vertices to render.

    • -
    • [in] _layoutHandle: Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stream[in] Vertex stream.

    • +
    • _handle[in] Dynamic vertex buffer.

    • +
    • _startVertex[in] First vertex to render.

    • +
    • _numVertices[in] Number of vertices to render.

    • +
    • _layoutHandle[in] Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.

    -

    -
    -void setVertexBuffer(uint8_t _stream, const TransientVertexBuffer *_tvb)
    +
    +void setVertexBuffer(uint8_t _stream, const TransientVertexBuffer *_tvb)

    Set vertex buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_encoder_set_transient_vertex_buffer.

    -
    Parameters
      -
    • [in] _stream: Vertex stream.

    • -
    • [in] _tvb: Transient vertex buffer.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stream[in] Vertex stream.

    • +
    • _tvb[in] Transient vertex buffer.

    -

    -
    -void setVertexBuffer(uint8_t _stream, const TransientVertexBuffer *_tvb, uint32_t _startVertex, uint32_t _numVertices, VertexLayoutHandle _layoutHandle = BGFX_INVALID_HANDLE)
    +
    +void setVertexBuffer(uint8_t _stream, const TransientVertexBuffer *_tvb, uint32_t _startVertex, uint32_t _numVertices, VertexLayoutHandle _layoutHandle = BGFX_INVALID_HANDLE)

    Set vertex buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_encoder_set_transient_vertex_buffer.

    -
    Parameters
      -
    • [in] _stream: Vertex stream.

    • -
    • [in] _tvb: Transient vertex buffer.

    • -
    • [in] _startVertex: First vertex to render.

    • -
    • [in] _numVertices: Number of vertices to render.

    • -
    • [in] _layoutHandle: Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stream[in] Vertex stream.

    • +
    • _tvb[in] Transient vertex buffer.

    • +
    • _startVertex[in] First vertex to render.

    • +
    • _numVertices[in] Number of vertices to render.

    • +
    • _layoutHandle[in] Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.

    -

    -
    -void setVertexCount(uint32_t _numVertices)
    +
    +void setVertexCount(uint32_t _numVertices)

    Set number of vertices for auto generated vertices use in conjuction with gl_VertexID.

    Attention

    Availability depends on: BGFX_CAPS_VERTEX_ID.

    Attention

    C99 equivalent is bgfx_encoder_set_vertex_count.

    -
    Parameters
      -
    • [in] _numVertices: Number of vertices.

    • -
    -

    +
    +
    Parameters
    +

    _numVertices[in] Number of vertices.

    +
    +
    -
    -void setInstanceDataBuffer(const InstanceDataBuffer *_idb)
    +
    +void setInstanceDataBuffer(const InstanceDataBuffer *_idb)

    Set instance data buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_encoder_set_instance_data_buffer.

    -
    Parameters
      -
    • [in] _idb: Transient instance data buffer.

    • -
    -

    +
    +
    Parameters
    +

    _idb[in] Transient instance data buffer.

    +
    +
    -
    -void setInstanceDataBuffer(const InstanceDataBuffer *_idb, uint32_t _start, uint32_t _num)
    +
    +void setInstanceDataBuffer(const InstanceDataBuffer *_idb, uint32_t _start, uint32_t _num)

    Set instance data buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_encoder_set_instance_data_buffer.

    -
    Parameters
      -
    • [in] _idb: Transient instance data buffer.

    • -
    • [in] _start: First instance data.

    • -
    • [in] _num: Number of data instances.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _idb[in] Transient instance data buffer.

    • +
    • _start[in] First instance data.

    • +
    • _num[in] Number of data instances.

    -

    -
    -void setInstanceDataBuffer(VertexBufferHandle _handle, uint32_t _start, uint32_t _num)
    +
    +void setInstanceDataBuffer(VertexBufferHandle _handle, uint32_t _start, uint32_t _num)

    Set instance data buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_encoder_set_instance_data_from_vertex_buffer.

    -
    Parameters
      -
    • [in] _handle: Vertex buffer.

    • -
    • [in] _start: First instance data.

    • -
    • [in] _num: Number of data instances.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] Vertex buffer.

    • +
    • _start[in] First instance data.

    • +
    • _num[in] Number of data instances.

    -

    -
    -void setInstanceDataBuffer(DynamicVertexBufferHandle _handle, uint32_t _start, uint32_t _num)
    +
    +void setInstanceDataBuffer(DynamicVertexBufferHandle _handle, uint32_t _start, uint32_t _num)

    Set instance data buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer.

    -
    Parameters
      -
    • [in] _handle: Vertex buffer.

    • -
    • [in] _start: First instance data.

    • -
    • [in] _num: Number of data instances.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] Vertex buffer.

    • +
    • _start[in] First instance data.

    • +
    • _num[in] Number of data instances.

    -

    -
    -void setInstanceCount(uint32_t _numInstances)
    +
    +void setInstanceCount(uint32_t _numInstances)

    Set number of instances for auto generated instances use in conjuction with gl_InstanceID.

    Attention

    Availability depends on: BGFX_CAPS_VERTEX_ID.

    Attention

    C99 equivalent is bgfx_encoder_set_instance_count.

    -
    Parameters
      -
    • [in] _numInstances: Number of instances.

    • -
    -

    +
    +
    Parameters
    +

    _numInstances[in] Number of instances.

    +
    +
    -
    -void setTexture(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint32_t _flags = UINT32_MAX)
    +
    +void setTexture(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint32_t _flags = UINT32_MAX)

    Set texture stage for draw primitive.

    Attention

    C99 equivalent is bgfx_encoder_set_texture.

    -
    Parameters
      -
    • [in] _stage: Texture unit.

    • -
    • [in] _sampler: Program sampler.

    • -
    • [in] _handle: Texture handle.

    • -
    • [in] _flags: Texture sampling mode. Default value UINT32_MAX uses texture sampling settings from the texture.

        +
    +

    +
    +
    Parameters
    +
      +
    • _stage[in] Texture unit.

    • +
    • _sampler[in] Program sampler.

    • +
    • _handle[in] Texture handle.

    • +
    • _flags[in] Texture sampling mode. Default value UINT32_MAX uses texture sampling settings from the texture.

      • BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP] - Mirror or clamp to edge wrap mode.

      • BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC] - Point or anisotropic sampling.

      @@ -3274,245 +3514,279 @@ known until the last moment, view ids can be remaped to arbitrary order by calli
    -

    -
    -void touch(ViewId _id)
    +
    +void touch(ViewId _id)

    Submit an empty primitive for rendering. Uniforms and draw state will be applied but no geometry will be submitted. Useful in cases when no other draw/compute primitive is submitted to view, but it’s desired to execute clear view.

    These empty draw calls will sort before ordinary draw calls.

    Attention

    C99 equivalent is bgfx_encoder_touch.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    -

    +
    +
    Parameters
    +

    _id[in] View id.

    +
    +
    -
    -void submit(ViewId _id, ProgramHandle _program, uint32_t _depth = 0, uint8_t _flags = BGFX_DISCARD_ALL)
    +
    +void submit(ViewId _id, ProgramHandle _program, uint32_t _depth = 0, uint8_t _flags = BGFX_DISCARD_ALL)

    Submit primitive for rendering.

    Attention

    C99 equivalent is bgfx_encoder_submit.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _program: Program.

    • -
    • [in] _depth: Depth for sorting.

    • -
    • [in] _flags: Discard or preserve states. See BGFX_DISCARD_*.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _program[in] Program.

    • +
    • _depth[in] Depth for sorting.

    • +
    • _flags[in] Discard or preserve states. See BGFX_DISCARD_*.

    -

    -
    -void submit(ViewId _id, ProgramHandle _program, OcclusionQueryHandle _occlusionQuery, uint32_t _depth = 0, uint8_t _flags = BGFX_DISCARD_ALL)
    +
    +void submit(ViewId _id, ProgramHandle _program, OcclusionQueryHandle _occlusionQuery, uint32_t _depth = 0, uint8_t _flags = BGFX_DISCARD_ALL)

    Submit primitive with occlusion query for rendering.

    Attention

    C99 equivalent is bgfx_encoder_submit_occlusion_query.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _program: Program.

    • -
    • [in] _occlusionQuery: Occlusion query.

    • -
    • [in] _depth: Depth for sorting.

    • -
    • [in] _flags: Discard or preserve states. See BGFX_DISCARD_*.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _program[in] Program.

    • +
    • _occlusionQuery[in] Occlusion query.

    • +
    • _depth[in] Depth for sorting.

    • +
    • _flags[in] Discard or preserve states. See BGFX_DISCARD_*.

    -

    -
    -void submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16_t _start = 0, uint16_t _num = 1, uint32_t _depth = 0, uint8_t _flags = BGFX_DISCARD_ALL)
    +
    +void submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16_t _start = 0, uint16_t _num = 1, uint32_t _depth = 0, uint8_t _flags = BGFX_DISCARD_ALL)

    Submit primitive for rendering with index and instance data info from indirect buffer.

    Attention

    C99 equivalent is bgfx_encoder_submit_indirect.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _program: Program.

    • -
    • [in] _indirectHandle: Indirect buffer.

    • -
    • [in] _start: First element in indirect buffer.

    • -
    • [in] _num: Number of dispatches.

    • -
    • [in] _depth: Depth for sorting.

    • -
    • [in] _flags: Discard or preserve states. See BGFX_DISCARD_*.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _program[in] Program.

    • +
    • _indirectHandle[in] Indirect buffer.

    • +
    • _start[in] First element in indirect buffer.

    • +
    • _num[in] Number of dispatches.

    • +
    • _depth[in] Depth for sorting.

    • +
    • _flags[in] Discard or preserve states. See BGFX_DISCARD_*.

    -

    -
    -void setBuffer(uint8_t _stage, IndexBufferHandle _handle, Access::Enum _access)
    +
    +void setBuffer(uint8_t _stage, IndexBufferHandle _handle, Access::Enum _access)

    Set compute index buffer.

    Attention

    C99 equivalent is bgfx_encoder_set_compute_index_buffer.

    -
    Parameters
      -
    • [in] _stage: Compute stage.

    • -
    • [in] _handle: Index buffer handle.

    • -
    • [in] _access: Buffer access. See Access::Enum.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stage[in] Compute stage.

    • +
    • _handle[in] Index buffer handle.

    • +
    • _access[in] Buffer access. See Access::Enum.

    -

    -
    -void setBuffer(uint8_t _stage, VertexBufferHandle _handle, Access::Enum _access)
    +
    +void setBuffer(uint8_t _stage, VertexBufferHandle _handle, Access::Enum _access)

    Set compute vertex buffer.

    Attention

    C99 equivalent is bgfx_encoder_set_compute_vertex_buffer.

    -
    Parameters
      -
    • [in] _stage: Compute stage.

    • -
    • [in] _handle: Vertex buffer handle.

    • -
    • [in] _access: Buffer access. See Access::Enum.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stage[in] Compute stage.

    • +
    • _handle[in] Vertex buffer handle.

    • +
    • _access[in] Buffer access. See Access::Enum.

    -

    -
    -void setBuffer(uint8_t _stage, DynamicIndexBufferHandle _handle, Access::Enum _access)
    +
    +void setBuffer(uint8_t _stage, DynamicIndexBufferHandle _handle, Access::Enum _access)

    Set compute dynamic index buffer.

    Attention

    C99 equivalent is bgfx_encoder_set_compute_dynamic_index_buffer.

    -
    Parameters
      -
    • [in] _stage: Compute stage.

    • -
    • [in] _handle: Dynamic index buffer handle.

    • -
    • [in] _access: Buffer access. See Access::Enum.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stage[in] Compute stage.

    • +
    • _handle[in] Dynamic index buffer handle.

    • +
    • _access[in] Buffer access. See Access::Enum.

    -

    -
    -void setBuffer(uint8_t _stage, DynamicVertexBufferHandle _handle, Access::Enum _access)
    +
    +void setBuffer(uint8_t _stage, DynamicVertexBufferHandle _handle, Access::Enum _access)

    Set compute dynamic vertex buffer.

    Attention

    C99 equivalent is bgfx_encoder_set_compute_dynamic_vertex_buffer.

    -
    Parameters
      -
    • [in] _stage: Compute stage.

    • -
    • [in] _handle: Dynamic vertex buffer handle.

    • -
    • [in] _access: Buffer access. See Access::Enum.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stage[in] Compute stage.

    • +
    • _handle[in] Dynamic vertex buffer handle.

    • +
    • _access[in] Buffer access. See Access::Enum.

    -

    -
    -void setBuffer(uint8_t _stage, IndirectBufferHandle _handle, Access::Enum _access)
    +
    +void setBuffer(uint8_t _stage, IndirectBufferHandle _handle, Access::Enum _access)

    Set compute indirect buffer.

    Attention

    C99 equivalent is bgfx_encoder_set_compute_indirect_buffer.

    -
    Parameters
      -
    • [in] _stage: Compute stage.

    • -
    • [in] _handle: Indirect buffer handle.

    • -
    • [in] _access: Buffer access. See Access::Enum.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stage[in] Compute stage.

    • +
    • _handle[in] Indirect buffer handle.

    • +
    • _access[in] Buffer access. See Access::Enum.

    -

    -
    -void setImage(uint8_t _stage, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format = TextureFormat::Count)
    +
    +void setImage(uint8_t _stage, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format = TextureFormat::Count)

    Set compute image from texture.

    Attention

    C99 equivalent is bgfx_encoder_set_image.

    -
    Parameters
      -
    • [in] _stage: Texture unit.

    • -
    • [in] _handle: Texture handle.

    • -
    • [in] _mip: Mip level.

    • -
    • [in] _access: Texture access. See Access::Enum.

    • -
    • [in] _format: Texture format. See: TextureFormat::Enum.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stage[in] Texture unit.

    • +
    • _handle[in] Texture handle.

    • +
    • _mip[in] Mip level.

    • +
    • _access[in] Texture access. See Access::Enum.

    • +
    • _format[in] Texture format. See: TextureFormat::Enum.

    -

    -
    -void dispatch(ViewId _id, ProgramHandle _handle, uint32_t _numX = 1, uint32_t _numY = 1, uint32_t _numZ = 1, uint8_t _flags = BGFX_DISCARD_ALL)
    +
    +void dispatch(ViewId _id, ProgramHandle _handle, uint32_t _numX = 1, uint32_t _numY = 1, uint32_t _numZ = 1, uint8_t _flags = BGFX_DISCARD_ALL)

    Dispatch compute.

    Attention

    C99 equivalent is bgfx_encoder_dispatch.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _handle: Compute program.

    • -
    • [in] _numX: Number of groups X.

    • -
    • [in] _numY: Number of groups Y.

    • -
    • [in] _numZ: Number of groups Z.

    • -
    • [in] _flags: Discard or preserve states. See BGFX_DISCARD_*.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _handle[in] Compute program.

    • +
    • _numX[in] Number of groups X.

    • +
    • _numY[in] Number of groups Y.

    • +
    • _numZ[in] Number of groups Z.

    • +
    • _flags[in] Discard or preserve states. See BGFX_DISCARD_*.

    -

    -
    -void dispatch(ViewId _id, ProgramHandle _handle, IndirectBufferHandle _indirectHandle, uint16_t _start = 0, uint16_t _num = 1, uint8_t _flags = BGFX_DISCARD_ALL)
    +
    +void dispatch(ViewId _id, ProgramHandle _handle, IndirectBufferHandle _indirectHandle, uint16_t _start = 0, uint16_t _num = 1, uint8_t _flags = BGFX_DISCARD_ALL)

    Dispatch compute indirect.

    Attention

    C99 equivalent is bgfx_encoder_dispatch_indirect.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _handle: Compute program.

    • -
    • [in] _indirectHandle: Indirect buffer.

    • -
    • [in] _start: First element in indirect buffer.

    • -
    • [in] _num: Number of dispatches.

    • -
    • [in] _flags: Discard or preserve states. See BGFX_DISCARD_*.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _handle[in] Compute program.

    • +
    • _indirectHandle[in] Indirect buffer.

    • +
    • _start[in] First element in indirect buffer.

    • +
    • _num[in] Number of dispatches.

    • +
    • _flags[in] Discard or preserve states. See BGFX_DISCARD_*.

    -

    -
    -void discard(uint8_t _flags = BGFX_DISCARD_ALL)
    +
    +void discard(uint8_t _flags = BGFX_DISCARD_ALL)

    Discard all previously set state for draw or compute call.

    Attention

    C99 equivalent is bgfx_encoder_discard.

    -
    Parameters
      -
    • [in] _flags: Draw/compute states to discard.

    • -
    -

    +
    +
    Parameters
    +

    _flags[in] Draw/compute states to discard.

    +
    +
    -
    -void blit(ViewId _id, TextureHandle _dst, uint16_t _dstX, uint16_t _dstY, TextureHandle _src, uint16_t _srcX = 0, uint16_t _srcY = 0, uint16_t _width = UINT16_MAX, uint16_t _height = UINT16_MAX)
    +
    +void blit(ViewId _id, TextureHandle _dst, uint16_t _dstX, uint16_t _dstY, TextureHandle _src, uint16_t _srcX = 0, uint16_t _srcY = 0, uint16_t _width = UINT16_MAX, uint16_t _height = UINT16_MAX)

    Blit texture 2D region between two 2D textures.

    Attention

    Destination texture must be created with BGFX_TEXTURE_BLIT_DST flag.

    @@ -3521,25 +3795,28 @@ known until the last moment, view ids can be remaped to arbitrary order by calli
    Attention

    C99 equivalent is bgfx_encoder_blit.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _dst: Destination texture handle.

    • -
    • [in] _dstX: Destination texture X position.

    • -
    • [in] _dstY: Destination texture Y position.

    • -
    • [in] _src: Source texture handle.

    • -
    • [in] _srcX: Source texture X position.

    • -
    • [in] _srcY: Source texture Y position.

    • -
    • [in] _width: Width of region.

    • -
    • [in] _height: Height of region.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _dst[in] Destination texture handle.

    • +
    • _dstX[in] Destination texture X position.

    • +
    • _dstY[in] Destination texture Y position.

    • +
    • _src[in] Source texture handle.

    • +
    • _srcX[in] Source texture X position.

    • +
    • _srcY[in] Source texture Y position.

    • +
    • _width[in] Width of region.

    • +
    • _height[in] Height of region.

    -

    -
    -void blit(ViewId _id, TextureHandle _dst, uint8_t _dstMip, uint16_t _dstX, uint16_t _dstY, uint16_t _dstZ, TextureHandle _src, uint8_t _srcMip = 0, uint16_t _srcX = 0, uint16_t _srcY = 0, uint16_t _srcZ = 0, uint16_t _width = UINT16_MAX, uint16_t _height = UINT16_MAX, uint16_t _depth = UINT16_MAX)
    +
    +void blit(ViewId _id, TextureHandle _dst, uint8_t _dstMip, uint16_t _dstX, uint16_t _dstY, uint16_t _dstZ, TextureHandle _src, uint8_t _srcMip = 0, uint16_t _srcX = 0, uint16_t _srcY = 0, uint16_t _srcZ = 0, uint16_t _width = UINT16_MAX, uint16_t _height = UINT16_MAX, uint16_t _depth = UINT16_MAX)

    Blit texture region between two textures.

    Attention

    Destination texture must be created with BGFX_TEXTURE_BLIT_DST flag.

    @@ -3548,43 +3825,46 @@ known until the last moment, view ids can be remaped to arbitrary order by calli
    Attention

    C99 equivalent is bgfx_encoder_blit.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _dst: Destination texture handle.

    • -
    • [in] _dstMip: Destination texture mip level.

    • -
    • [in] _dstX: Destination texture X position.

    • -
    • [in] _dstY: Destination texture Y position.

    • -
    • [in] _dstZ: If texture is 2D this argument should be 0. If destination texture is cube this argument represents destination texture cube face. For 3D texture this argument represents destination texture Z position.

    • -
    • [in] _src: Source texture handle.

    • -
    • [in] _srcMip: Source texture mip level.

    • -
    • [in] _srcX: Source texture X position.

    • -
    • [in] _srcY: Source texture Y position.

    • -
    • [in] _srcZ: If texture is 2D this argument should be 0. If source texture is cube this argument represents source texture cube face. For 3D texture this argument represents source texture Z position.

    • -
    • [in] _width: Width of region.

    • -
    • [in] _height: Height of region.

    • -
    • [in] _depth: If texture is 3D this argument represents depth of region, otherwise it’s unused.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _dst[in] Destination texture handle.

    • +
    • _dstMip[in] Destination texture mip level.

    • +
    • _dstX[in] Destination texture X position.

    • +
    • _dstY[in] Destination texture Y position.

    • +
    • _dstZ[in] If texture is 2D this argument should be 0. If destination texture is cube this argument represents destination texture cube face. For 3D texture this argument represents destination texture Z position.

    • +
    • _src[in] Source texture handle.

    • +
    • _srcMip[in] Source texture mip level.

    • +
    • _srcX[in] Source texture X position.

    • +
    • _srcY[in] Source texture Y position.

    • +
    • _srcZ[in] If texture is 2D this argument should be 0. If source texture is cube this argument represents source texture cube face. For 3D texture this argument represents source texture Z position.

    • +
    • _width[in] Width of region.

    • +
    • _height[in] Height of region.

    • +
    • _depth[in] If texture is 3D this argument represents depth of region, otherwise it’s unused.

    -

    -
    -
    +
    +

    Draw

    Draw state is not preserved between two draw calls. All state is cleared after calling bgfx::submit.

    -
    +

    State

    -
    -
    +
    +

    Debug

    -
    -void bgfx::setMarker(const char *_marker)
    +
    +void bgfx::setMarker(const char *_marker)

    Sets debug marker.

    Attention

    C99 equivalent is bgfx_set_marker.

    @@ -3594,45 +3874,51 @@ known until the last moment, view ids can be remaped to arbitrary order by calli
    -
    -void bgfx::setName(ShaderHandle _handle, const char *_name, int32_t _len = INT32_MAX)
    +
    +void bgfx::setName(ShaderHandle _handle, const char *_name, int32_t _len = INT32_MAX)

    Set shader debug name.

    Attention

    C99 equivalent is bgfx_set_shader_name.

    -
    Parameters
      -
    • [in] _handle: Shader handle.

    • -
    • [in] _name: Shader name.

    • -
    • [in] _len: Shader name length (if length is INT32_MAX, it’s expected that _name is zero terminated string.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] Shader handle.

    • +
    • _name[in] Shader name.

    • +
    • _len[in] Shader name length (if length is INT32_MAX, it’s expected that _name is zero terminated string.

    -

    -
    -void bgfx::setName(TextureHandle _handle, const char *_name, int32_t _len = INT32_MAX)
    +
    +void bgfx::setName(TextureHandle _handle, const char *_name, int32_t _len = INT32_MAX)

    Set texture debug name.

    Attention

    C99 equivalent is bgfx_set_texture_name.

    -
    Parameters
      -
    • [in] _handle: Texture handle.

    • -
    • [in] _name: Texture name.

    • -
    • [in] _len: Texture name length (if length is INT32_MAX, it’s expected that _name is zero terminated string.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] Texture handle.

    • +
    • _name[in] Texture name.

    • +
    • _len[in] Texture name length (if length is INT32_MAX, it’s expected that _name is zero terminated string.

    -

    -
    -
    + +

    State

    -
    -void bgfx::setState(uint64_t _state, uint32_t _rgba = 0)
    +
    +void bgfx::setState(uint64_t _state, uint32_t _rgba = 0)

    Set render states for draw primitive.

    Remark

      @@ -3643,8 +3929,12 @@ known until the last moment, view ids can be remaped to arbitrary order by calli
    Attention

    C99 equivalent is bgfx_set_state.

    -
    Parameters
      -
    • [in] _state: State flags. Default state for primitive type is triangles. See: BGFX_STATE_DEFAULT.

        +
    +

    +
    +
    Parameters
    +
      +
    • _state[in] State flags. Default state for primitive type is triangles. See: BGFX_STATE_DEFAULT.

      • BGFX_STATE_DEPTH_TEST_* - Depth test function.

      • BGFX_STATE_BLEND_* - See remark 1 about BGFX_STATE_BLEND_FUNC.

      • BGFX_STATE_BLEND_EQUATION_* - See remark 2.

      • @@ -3654,494 +3944,523 @@ known until the last moment, view ids can be remaped to arbitrary order by calli
      • BGFX_STATE_PT_[TRISTRIP/LINES/POINTS] - Primitive type.

    • -
    • [in] _rgba: Sets blend factor used by BGFX_STATE_BLEND_FACTOR and BGFX_STATE_BLEND_INV_FACTOR blend modes.

    • +
    • _rgba[in] Sets blend factor used by BGFX_STATE_BLEND_FACTOR and BGFX_STATE_BLEND_INV_FACTOR blend modes.

    -

    -
    -
    + +

    State Flags

    Write

    -
    -BGFX_STATE_WRITE_R
    +
    +BGFX_STATE_WRITE_R

    Enable R write.

    Color RGB/alpha/depth write. When it’s not specified write will be disabled.

    -
    -BGFX_STATE_WRITE_G
    +
    +BGFX_STATE_WRITE_G

    Enable G write.

    -
    -BGFX_STATE_WRITE_B
    +
    +BGFX_STATE_WRITE_B

    Enable B write.

    -
    -BGFX_STATE_WRITE_RGB
    +
    +BGFX_STATE_WRITE_RGB
    -
    -BGFX_STATE_WRITE_A
    +
    +BGFX_STATE_WRITE_A

    Enable alpha write.

    -
    -BGFX_STATE_WRITE_Z
    +
    +BGFX_STATE_WRITE_Z

    Enable depth write. Enable RGB write.

    Depth Test

    -
    -BGFX_STATE_DEPTH_TEST_LESS
    +
    +BGFX_STATE_DEPTH_TEST_LESS

    Enable depth test, less.

    Depth test state. When BGFX_STATE_DEPTH_ is not specified depth test will be disabled.

    -
    -BGFX_STATE_DEPTH_TEST_LEQUAL
    +
    +BGFX_STATE_DEPTH_TEST_LEQUAL

    Enable depth test, less or equal.

    -
    -BGFX_STATE_DEPTH_TEST_EQUAL
    +
    +BGFX_STATE_DEPTH_TEST_EQUAL

    Enable depth test, equal.

    -
    -BGFX_STATE_DEPTH_TEST_GEQUAL
    +
    +BGFX_STATE_DEPTH_TEST_GEQUAL

    Enable depth test, greater or equal.

    -
    -BGFX_STATE_DEPTH_TEST_GREATER
    +
    +BGFX_STATE_DEPTH_TEST_GREATER

    Enable depth test, greater.

    -
    -BGFX_STATE_DEPTH_TEST_NOTEQUAL
    +
    +BGFX_STATE_DEPTH_TEST_NOTEQUAL

    Enable depth test, not equal.

    -
    -BGFX_STATE_DEPTH_TEST_NEVER
    +
    +BGFX_STATE_DEPTH_TEST_NEVER

    Enable depth test, never.

    -
    -BGFX_STATE_DEPTH_TEST_ALWAYS
    +
    +BGFX_STATE_DEPTH_TEST_ALWAYS

    Enable depth test, always.

    Blend Mode

    -
    -BGFX_STATE_BLEND_ZERO
    +
    +BGFX_STATE_BLEND_ZERO

    0, 0, 0, 0

    Use BGFX_STATE_BLEND_FUNC(_src, _dst) or BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA) helper macros.

    -
    -BGFX_STATE_BLEND_ONE
    +
    +BGFX_STATE_BLEND_ONE

    1, 1, 1, 1

    -
    -BGFX_STATE_BLEND_SRC_COLOR
    +
    +BGFX_STATE_BLEND_SRC_COLOR

    Rs, Gs, Bs, As.

    -
    -BGFX_STATE_BLEND_INV_SRC_COLOR
    +
    +BGFX_STATE_BLEND_INV_SRC_COLOR

    1-Rs, 1-Gs, 1-Bs, 1-As

    -
    -BGFX_STATE_BLEND_SRC_ALPHA
    +
    +BGFX_STATE_BLEND_SRC_ALPHA

    As, As, As, As.

    -
    -BGFX_STATE_BLEND_INV_SRC_ALPHA
    +
    +BGFX_STATE_BLEND_INV_SRC_ALPHA

    1-As, 1-As, 1-As, 1-As

    -
    -BGFX_STATE_BLEND_DST_ALPHA
    +
    +BGFX_STATE_BLEND_DST_ALPHA

    Ad, Ad, Ad, Ad.

    -
    -BGFX_STATE_BLEND_INV_DST_ALPHA
    +
    +BGFX_STATE_BLEND_INV_DST_ALPHA

    1-Ad, 1-Ad, 1-Ad ,1-Ad

    -
    -BGFX_STATE_BLEND_DST_COLOR
    +
    +BGFX_STATE_BLEND_DST_COLOR

    Rd, Gd, Bd, Ad.

    -
    -BGFX_STATE_BLEND_INV_DST_COLOR
    +
    +BGFX_STATE_BLEND_INV_DST_COLOR

    1-Rd, 1-Gd, 1-Bd, 1-Ad

    -
    -BGFX_STATE_BLEND_SRC_ALPHA_SAT
    +
    +BGFX_STATE_BLEND_SRC_ALPHA_SAT

    f, f, f, 1; f = min(As, 1-Ad)

    -
    -BGFX_STATE_BLEND_FACTOR
    +
    +BGFX_STATE_BLEND_FACTOR

    Blend factor.

    -
    -BGFX_STATE_BLEND_INV_FACTOR
    +
    +BGFX_STATE_BLEND_INV_FACTOR

    1-Blend factor

    Blend Equaation

    -
    -BGFX_STATE_BLEND_EQUATION_ADD
    +
    +BGFX_STATE_BLEND_EQUATION_ADD

    Blend add: src + dst.

    Use BGFX_STATE_BLEND_EQUATION(_equation) or BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA) helper macros.

    -
    -BGFX_STATE_BLEND_EQUATION_SUB
    +
    +BGFX_STATE_BLEND_EQUATION_SUB

    Blend subtract: src - dst.

    -
    -BGFX_STATE_BLEND_EQUATION_REVSUB
    +
    +BGFX_STATE_BLEND_EQUATION_REVSUB

    Blend reverse subtract: dst - src.

    -
    -BGFX_STATE_BLEND_EQUATION_MIN
    +
    +BGFX_STATE_BLEND_EQUATION_MIN

    Blend min: min(src, dst).

    -
    -BGFX_STATE_BLEND_EQUATION_MAX
    +
    +BGFX_STATE_BLEND_EQUATION_MAX

    Blend max: max(src, dst).

    Primitive Culling

    -
    -BGFX_STATE_CULL_CW
    +
    +BGFX_STATE_CULL_CW

    Cull clockwise triangles.

    Cull state. When BGFX_STATE_CULL_* is not specified culling will be disabled.

    -
    -BGFX_STATE_CULL_CCW
    +
    +BGFX_STATE_CULL_CCW

    Cull counter-clockwise triangles.

    Primitive Type

    -
    -BGFX_STATE_PT_TRISTRIP
    +
    +BGFX_STATE_PT_TRISTRIP

    Tristrip.

    -
    -BGFX_STATE_PT_LINES
    +
    +BGFX_STATE_PT_LINES

    Lines.

    -
    -BGFX_STATE_PT_LINESTRIP
    +
    +BGFX_STATE_PT_LINESTRIP

    Line strip.

    -
    -BGFX_STATE_PT_POINTS
    +
    +BGFX_STATE_PT_POINTS

    Points.

    Misc

    -
    -BGFX_STATE_BLEND_INDEPENDENT
    +
    +BGFX_STATE_BLEND_INDEPENDENT

    Enable blend independent.

    -
    -BGFX_STATE_BLEND_ALPHA_TO_COVERAGE
    +
    +BGFX_STATE_BLEND_ALPHA_TO_COVERAGE

    Enable alpha to coverage. Default state is write to RGB, alpha, and depth with depth test less enabled, with clockwise culling and MSAA (when writing into MSAA frame buffer, otherwise this flag is ignored).

    -
    -BGFX_STATE_MSAA
    +
    +BGFX_STATE_MSAA

    Enable MSAA rasterization.

    Enable MSAA write when writing into MSAA frame buffer. This flag is ignored when not writing into MSAA frame buffer.

    -
    -BGFX_STATE_LINEAA
    +
    +BGFX_STATE_LINEAA

    Enable line AA rasterization.

    -
    -
    + +

    Stencil

    -
    -void bgfx::setStencil(uint32_t _fstencil, uint32_t _bstencil = BGFX_STENCIL_NONE)
    +
    +void bgfx::setStencil(uint32_t _fstencil, uint32_t _bstencil = BGFX_STENCIL_NONE)

    Set stencil test state.

    Attention

    C99 equivalent is bgfx_set_stencil.

    -
    Parameters
      -
    • [in] _fstencil: Front stencil state.

    • -
    • [in] _bstencil: Back stencil state. If back is set to BGFX_STENCIL_NONE _fstencil is applied to both front and back facing primitives.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _fstencil[in] Front stencil state.

    • +
    • _bstencil[in] Back stencil state. If back is set to BGFX_STENCIL_NONE _fstencil is applied to both front and back facing primitives.

    -

    -
    -
    + +

    Stencil Flags

    -
    -BGFX_STENCIL_TEST_LESS
    +
    +BGFX_STENCIL_TEST_LESS

    Enable stencil test, less.

    -
    -
    + +

    Scissor

    When scissor rectangle is changing per draw call inside the same view use bgfx::setScissor, otherwise prefer bgfx::setViewScissor.

    -
    -uint16_t bgfx::setScissor(uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height)
    +
    +uint16_t bgfx::setScissor(uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height)

    Set scissor for draw primitive. For scissor for all primitives in view see bgfx::setViewScissor.

    -
    Return

    Scissor cache index.

    -
    Attention

    C99 equivalent is bgfx_set_scissor.

    -
    Parameters
      -
    • [in] _x: Position x from the left corner of the window.

    • -
    • [in] _y: Position y from the top corner of the window.

    • -
    • [in] _width: Width of scissor region.

    • -
    • [in] _height: Height of scissor region.

    • -
    -

    +
    +
    Parameters
    +
      +
    • _x[in] Position x from the left corner of the window.

    • +
    • _y[in] Position y from the top corner of the window.

    • +
    • _width[in] Width of scissor region.

    • +
    • _height[in] Height of scissor region.

    • +
    +
    +
    Returns
    +

    Scissor cache index.

    +
    +
    -
    -void bgfx::setScissor(uint16_t _cache = UINT16_MAX)
    +
    +void bgfx::setScissor(uint16_t _cache = UINT16_MAX)

    Set scissor from cache for draw primitive.

    Attention

    C99 equivalent is bgfx_set_scissor_cached.

    -
    Parameters
      -
    • [in] _cache: Index in scissor cache. Passing UINT16_MAX unset primitive scissor and primitive will use view scissor instead.

    • -
    -

    +
    +
    Parameters
    +

    _cache[in] Index in scissor cache. Passing UINT16_MAX unset primitive scissor and primitive will use view scissor instead.

    +
    +
    -
    -
    + +

    Transform

    -
    -uint32_t bgfx::allocTransform(Transform *_transform, uint16_t _num)
    +
    +uint32_t bgfx::allocTransform(Transform *_transform, uint16_t _num)

    Reserve _num matrices in internal matrix cache.

    -
    Return

    index into matrix cache.

    -
    Attention

    Pointer returned can be modifed until bgfx::frame is called.

    Attention

    C99 equivalent is bgfx_alloc_transform.

    -
    Parameters
      -
    • [in] _transform: Pointer to Transform structure.

    • -
    • [in] _num: Number of matrices.

    • -
    -

    +
    +
    Parameters
    +
      +
    • _transform[in] Pointer to Transform structure.

    • +
    • _num[in] Number of matrices.

    • +
    +
    +
    Returns
    +

    index into matrix cache.

    +
    +
    -
    -uint32_t bgfx::setTransform(const void *_mtx, uint16_t _num = 1)
    +
    +uint32_t bgfx::setTransform(const void *_mtx, uint16_t _num = 1)

    Set model matrix for draw primitive. If it is not called, the model will be rendered with an identity model matrix.

    -
    Return

    index into matrix cache in case the same model matrix has to be used for other draw primitive call.

    -
    Attention

    C99 equivalent is bgfx_set_transform.

    -
    Parameters
      -
    • [in] _mtx: Pointer to first matrix in array.

    • -
    • [in] _num: Number of matrices in array.

    • -
    -

    +
    +
    Parameters
    +
      +
    • _mtx[in] Pointer to first matrix in array.

    • +
    • _num[in] Number of matrices in array.

    • +
    +
    +
    Returns
    +

    index into matrix cache in case the same model matrix has to be used for other draw primitive call.

    +
    +
    -
    -void bgfx::setTransform(uint32_t _cache, uint16_t _num = 1)
    +
    +void bgfx::setTransform(uint32_t _cache, uint16_t _num = 1)

    Set model matrix from matrix cache for draw primitive.

    Attention

    C99 equivalent is bgfx_set_transform_cached.

    -
    Parameters
      -
    • [in] _cache: Index in matrix cache.

    • -
    • [in] _num: Number of matrices from cache.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _cache[in] Index in matrix cache.

    • +
    • _num[in] Number of matrices from cache.

    -

    -
    -
    + +

    Conditional Rendering

    -
    -void bgfx::setCondition(OcclusionQueryHandle _handle, bool _visible)
    +
    +void bgfx::setCondition(OcclusionQueryHandle _handle, bool _visible)

    Set condition for rendering.

    Attention

    C99 equivalent is bgfx_set_condition.

    -
    Parameters
      -
    • [in] _handle: Occlusion query handle.

    • -
    • [in] _visible: Render if occlusion query is visible.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] Occlusion query handle.

    • +
    • _visible[in] Render if occlusion query is visible.

    -

    -
    -
    + +

    Buffers

    -
    -void bgfx::setIndexBuffer(IndexBufferHandle _handle)
    +
    +void bgfx::setIndexBuffer(IndexBufferHandle _handle)

    Set index buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_set_index_buffer.

    -
    Parameters
      -
    • [in] _handle: Index buffer.

    • -
    -

    +
    +
    Parameters
    +

    _handle[in] Index buffer.

    +
    +
    -
    -void bgfx::setIndexBuffer(IndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices)
    +
    +void bgfx::setIndexBuffer(IndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices)

    Set index buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_set_index_buffer.

    -
    Parameters
      -
    • [in] _handle: Index buffer.

    • -
    • [in] _firstIndex: First index to render.

    • -
    • [in] _numIndices: Number of indices to render.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] Index buffer.

    • +
    • _firstIndex[in] First index to render.

    • +
    • _numIndices[in] Number of indices to render.

    -

    -
    -void bgfx::setIndexBuffer(DynamicIndexBufferHandle _handle)
    +
    +void bgfx::setIndexBuffer(DynamicIndexBufferHandle _handle)

    Set index buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_set_dynamic_index_buffer.

    -
    Parameters
      -
    • [in] _handle: Dynamic index buffer.

    • -
    -

    +
    +
    Parameters
    +

    _handle[in] Dynamic index buffer.

    +
    +
    -
    -void bgfx::setIndexBuffer(DynamicIndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices)
    +
    +void bgfx::setIndexBuffer(DynamicIndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices)

    Set index buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_set_dynamic_index_buffer.

    -
    Parameters
      -
    • [in] _handle: Dynamic index buffer.

    • -
    • [in] _firstIndex: First index to render.

    • -
    • [in] _numIndices: Number of indices to render.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] Dynamic index buffer.

    • +
    • _firstIndex[in] First index to render.

    • +
    • _numIndices[in] Number of indices to render.

    -

    -
    -struct bgfx::TransientIndexBuffer
    +
    +struct bgfx::TransientIndexBuffer

    Transient index buffer.

    Attention

    C99 equivalent is bgfx_transient_index_buffer_t.

    @@ -4149,34 +4468,34 @@ otherwise prefer bgfx::setViewScissor.

    -

    Public Members

    +

    Public Members

    -
    -uint8_t *data
    +
    +uint8_t *data

    Pointer to data.

    -
    -uint32_t size
    +
    +uint32_t size

    Data size.

    -
    -uint32_t startIndex
    +
    +uint32_t startIndex

    First index.

    -
    -IndexBufferHandle handle
    +
    +IndexBufferHandle handle

    Index buffer handle.

    -
    -bool isIndex16
    +
    +bool isIndex16

    Index buffer format is 16-bits if true, otherwise it is 32-bit.

    @@ -4184,110 +4503,126 @@ otherwise prefer bgfx::setViewScissor.

    -
    -void bgfx::setIndexBuffer(const TransientIndexBuffer *_tib)
    +
    +void bgfx::setIndexBuffer(const TransientIndexBuffer *_tib)

    Set index buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_set_transient_index_buffer.

    -
    Parameters
      -
    • [in] _tib: Transient index buffer.

    • -
    -

    +
    +
    Parameters
    +

    _tib[in] Transient index buffer.

    +
    +
    -
    -void bgfx::setIndexBuffer(const TransientIndexBuffer *_tib, uint32_t _firstIndex, uint32_t _numIndices)
    +
    +void bgfx::setIndexBuffer(const TransientIndexBuffer *_tib, uint32_t _firstIndex, uint32_t _numIndices)

    Set index buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_set_transient_index_buffer.

    -
    Parameters
      -
    • [in] _tib: Transient index buffer.

    • -
    • [in] _firstIndex: First index to render.

    • -
    • [in] _numIndices: Number of indices to render.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _tib[in] Transient index buffer.

    • +
    • _firstIndex[in] First index to render.

    • +
    • _numIndices[in] Number of indices to render.

    -

    -
    -void bgfx::setVertexBuffer(uint8_t _stream, VertexBufferHandle _handle)
    +
    +void bgfx::setVertexBuffer(uint8_t _stream, VertexBufferHandle _handle)

    Set vertex buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_set_vertex_buffer.

    -
    Parameters
      -
    • [in] _stream: Vertex stream.

    • -
    • [in] _handle: Vertex buffer.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stream[in] Vertex stream.

    • +
    • _handle[in] Vertex buffer.

    -

    -
    -void bgfx::setVertexBuffer(uint8_t _stream, VertexBufferHandle _handle, uint32_t _startVertex, uint32_t _numVertices, VertexLayoutHandle _layoutHandle = BGFX_INVALID_HANDLE)
    +
    +void bgfx::setVertexBuffer(uint8_t _stream, VertexBufferHandle _handle, uint32_t _startVertex, uint32_t _numVertices, VertexLayoutHandle _layoutHandle = BGFX_INVALID_HANDLE)

    Set vertex buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_set_vertex_buffer.

    -
    Parameters
      -
    • [in] _stream: Vertex stream.

    • -
    • [in] _handle: Vertex buffer.

    • -
    • [in] _startVertex: First vertex to render.

    • -
    • [in] _numVertices: Number of vertices to render.

    • -
    • [in] _layoutHandle: Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stream[in] Vertex stream.

    • +
    • _handle[in] Vertex buffer.

    • +
    • _startVertex[in] First vertex to render.

    • +
    • _numVertices[in] Number of vertices to render.

    • +
    • _layoutHandle[in] Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.

    -

    -
    -void bgfx::setVertexBuffer(uint8_t _stream, DynamicVertexBufferHandle _handle)
    +
    +void bgfx::setVertexBuffer(uint8_t _stream, DynamicVertexBufferHandle _handle)

    Set vertex buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_set_dynamic_vertex_buffer.

    -
    Parameters
      -
    • [in] _stream: Vertex stream.

    • -
    • [in] _handle: Dynamic vertex buffer.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stream[in] Vertex stream.

    • +
    • _handle[in] Dynamic vertex buffer.

    -

    -
    -void bgfx::setVertexBuffer(uint8_t _stream, DynamicVertexBufferHandle _handle, uint32_t _startVertex, uint32_t _numVertices, VertexLayoutHandle _layoutHandle = BGFX_INVALID_HANDLE)
    +
    +void bgfx::setVertexBuffer(uint8_t _stream, DynamicVertexBufferHandle _handle, uint32_t _startVertex, uint32_t _numVertices, VertexLayoutHandle _layoutHandle = BGFX_INVALID_HANDLE)

    Set vertex buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_set_dynamic_vertex_buffer.

    -
    Parameters
      -
    • [in] _stream: Vertex stream.

    • -
    • [in] _handle: Dynamic vertex buffer.

    • -
    • [in] _startVertex: First vertex to render.

    • -
    • [in] _numVertices: Number of vertices to render.

    • -
    • [in] _layoutHandle: Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stream[in] Vertex stream.

    • +
    • _handle[in] Dynamic vertex buffer.

    • +
    • _startVertex[in] First vertex to render.

    • +
    • _numVertices[in] Number of vertices to render.

    • +
    • _layoutHandle[in] Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.

    -

    -
    -struct bgfx::TransientVertexBuffer
    +
    +struct bgfx::TransientVertexBuffer

    Transient vertex buffer.

    Attention

    C99 equivalent is bgfx_transient_vertex_buffer_t.

    @@ -4295,40 +4630,40 @@ otherwise prefer bgfx::setViewScissor.

    -

    Public Members

    +

    Public Members

    -
    -uint8_t *data
    +
    +uint8_t *data

    Pointer to data.

    -
    -uint32_t size
    +
    +uint32_t size

    Data size.

    -
    -uint32_t startVertex
    +
    +uint32_t startVertex

    First vertex.

    -
    -uint16_t stride
    +
    +uint16_t stride

    Vertex stride.

    -
    -VertexBufferHandle handle
    +
    +VertexBufferHandle handle

    Vertex buffer handle.

    -
    -VertexLayoutHandle layoutHandle
    +
    +VertexLayoutHandle layoutHandle

    Vertex layout handle.

    @@ -4336,60 +4671,67 @@ otherwise prefer bgfx::setViewScissor.

    -
    -void bgfx::setVertexBuffer(uint8_t _stream, const TransientVertexBuffer *_tvb)
    +
    +void bgfx::setVertexBuffer(uint8_t _stream, const TransientVertexBuffer *_tvb)

    Set vertex buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_set_transient_vertex_buffer.

    -
    Parameters
      -
    • [in] _stream: Vertex stream.

    • -
    • [in] _tvb: Transient vertex buffer.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stream[in] Vertex stream.

    • +
    • _tvb[in] Transient vertex buffer.

    -

    -
    -void bgfx::setVertexBuffer(uint8_t _stream, const TransientVertexBuffer *_tvb, uint32_t _startVertex, uint32_t _numVertices, VertexLayoutHandle _layoutHandle = BGFX_INVALID_HANDLE)
    +
    +void bgfx::setVertexBuffer(uint8_t _stream, const TransientVertexBuffer *_tvb, uint32_t _startVertex, uint32_t _numVertices, VertexLayoutHandle _layoutHandle = BGFX_INVALID_HANDLE)

    Set vertex buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_set_transient_vertex_buffer.

    -
    Parameters
      -
    • [in] _stream: Vertex stream.

    • -
    • [in] _tvb: Transient vertex buffer.

    • -
    • [in] _startVertex: First vertex to render.

    • -
    • [in] _numVertices: Number of vertices to render.

    • -
    • [in] _layoutHandle: Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stream[in] Vertex stream.

    • +
    • _tvb[in] Transient vertex buffer.

    • +
    • _startVertex[in] First vertex to render.

    • +
    • _numVertices[in] Number of vertices to render.

    • +
    • _layoutHandle[in] Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.

    -

    -
    -void bgfx::setVertexCount(uint32_t _numVertices)
    +
    +void bgfx::setVertexCount(uint32_t _numVertices)

    Set number of vertices for auto generated vertices use in conjuction with gl_VertexID.

    Attention

    Availability depends on: BGFX_CAPS_VERTEX_ID.

    Attention

    C99 equivalent is bgfx_set_vertex_count.

    -
    Parameters
      -
    • [in] _numVertices: Number of vertices.

    • -
    -

    +
    +
    Parameters
    +

    _numVertices[in] Number of vertices.

    +
    +
    -
    -struct bgfx::InstanceDataBuffer
    +
    +struct bgfx::InstanceDataBuffer

    Instance data buffer info.

    Attention

    C99 equivalent is bgfx_instance_data_buffer_t.

    @@ -4397,40 +4739,40 @@ otherwise prefer bgfx::setViewScissor.

    -

    Public Members

    +

    Public Members

    -
    -uint8_t *data
    +
    +uint8_t *data

    Pointer to data.

    -
    -uint32_t size
    +
    +uint32_t size

    Data size.

    -
    -uint32_t offset
    +
    +uint32_t offset

    Offset in vertex buffer.

    -
    -uint32_t num
    +
    +uint32_t num

    Number of instances.

    -
    -uint16_t stride
    +
    +uint16_t stride

    Vertex buffer stride.

    -
    -VertexBufferHandle handle
    +
    +VertexBufferHandle handle

    Vertex buffer object handle.

    @@ -4438,103 +4780,118 @@ otherwise prefer bgfx::setViewScissor.

    -
    -void bgfx::setInstanceDataBuffer(const InstanceDataBuffer *_idb)
    +
    +void bgfx::setInstanceDataBuffer(const InstanceDataBuffer *_idb)

    Set instance data buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_set_instance_data_buffer.

    -
    Parameters
      -
    • [in] _idb: Transient instance data buffer.

    • -
    -

    +
    +
    Parameters
    +

    _idb[in] Transient instance data buffer.

    +
    +
    -
    -void bgfx::setInstanceDataBuffer(const InstanceDataBuffer *_idb, uint32_t _start, uint32_t _num)
    +
    +void bgfx::setInstanceDataBuffer(const InstanceDataBuffer *_idb, uint32_t _start, uint32_t _num)

    Set instance data buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_set_instance_data_buffer.

    -
    Parameters
      -
    • [in] _idb: Transient instance data buffer.

    • -
    • [in] _start: First instance data.

    • -
    • [in] _num: Number of data instances.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _idb[in] Transient instance data buffer.

    • +
    • _start[in] First instance data.

    • +
    • _num[in] Number of data instances.

    -

    -
    -void bgfx::setInstanceDataBuffer(VertexBufferHandle _handle, uint32_t _start, uint32_t _num)
    +
    +void bgfx::setInstanceDataBuffer(VertexBufferHandle _handle, uint32_t _start, uint32_t _num)

    Set instance data buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_set_instance_data_from_vertex_buffer.

    -
    Parameters
      -
    • [in] _handle: Vertex buffer.

    • -
    • [in] _start: First instance data.

    • -
    • [in] _num: Number of data instances.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] Vertex buffer.

    • +
    • _start[in] First instance data.

    • +
    • _num[in] Number of data instances.

    -

    -
    -void bgfx::setInstanceDataBuffer(DynamicVertexBufferHandle _handle, uint32_t _start, uint32_t _num)
    +
    +void bgfx::setInstanceDataBuffer(DynamicVertexBufferHandle _handle, uint32_t _start, uint32_t _num)

    Set instance data buffer for draw primitive.

    Attention

    C99 equivalent is bgfx_set_instance_data_from_dynamic_vertex_buffer.

    -
    Parameters
      -
    • [in] _handle: Vertex buffer.

    • -
    • [in] _start: First instance data.

    • -
    • [in] _num: Number of data instances.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] Vertex buffer.

    • +
    • _start[in] First instance data.

    • +
    • _num[in] Number of data instances.

    -

    -
    -void bgfx::setInstanceCount(uint32_t _numInstances)
    +
    +void bgfx::setInstanceCount(uint32_t _numInstances)

    Set number of instances for auto generated instances use in conjuction with gl_InstanceID.

    Attention

    Availability depends on: BGFX_CAPS_VERTEX_ID.

    Attention

    C99 equivalent is bgfx_set_instance_count.

    -
    Parameters
      -
    • [in] _numInstances: Number of instances.

    • -
    -

    +
    +
    Parameters
    +

    _numInstances[in] Number of instances.

    +
    +
    -
    -
    + +

    Textures

    -
    -void bgfx::setTexture(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint32_t _flags = UINT32_MAX)
    +
    +void bgfx::setTexture(uint8_t _stage, UniformHandle _sampler, TextureHandle _handle, uint32_t _flags = UINT32_MAX)

    Set texture stage for draw primitive.

    Attention

    C99 equivalent is bgfx_set_texture.

    -
    Parameters
      -
    • [in] _stage: Texture unit.

    • -
    • [in] _sampler: Program sampler.

    • -
    • [in] _handle: Texture handle.

    • -
    • [in] _flags: Texture sampling mode. Default value UINT32_MAX uses texture sampling settings from the texture.

        +
    +

    +
    +
    Parameters
    +
      +
    • _stage[in] Texture unit.

    • +
    • _sampler[in] Program sampler.

    • +
    • _handle[in] Texture handle.

    • +
    • _flags[in] Texture sampling mode. Default value UINT32_MAX uses texture sampling settings from the texture.

      • BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP] - Mirror or clamp to edge wrap mode.

      • BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC] - Point or anisotropic sampling.

      @@ -4542,82 +4899,90 @@ otherwise prefer bgfx::setViewScissor.

    -

    -
    -
    + +

    Submit

    Within view all draw commands are executed after blit and compute commands.

    -
    -void bgfx::submit(ViewId _id, ProgramHandle _program, uint32_t _depth = 0, uint8_t _flags = BGFX_DISCARD_ALL)
    +
    +void bgfx::submit(ViewId _id, ProgramHandle _program, uint32_t _depth = 0, uint8_t _flags = BGFX_DISCARD_ALL)

    Submit primitive for rendering.

    Attention

    C99 equivalent is bgfx_submit.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _program: Program.

    • -
    • [in] _depth: Depth for sorting.

    • -
    • [in] _flags: Discard or preserve states. See BGFX_DISCARD_*.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _program[in] Program.

    • +
    • _depth[in] Depth for sorting.

    • +
    • _flags[in] Discard or preserve states. See BGFX_DISCARD_*.

    -

    -
    -void bgfx::submit(ViewId _id, ProgramHandle _program, OcclusionQueryHandle _occlusionQuery, uint32_t _depth = 0, uint8_t _flags = BGFX_DISCARD_ALL)
    +
    +void bgfx::submit(ViewId _id, ProgramHandle _program, OcclusionQueryHandle _occlusionQuery, uint32_t _depth = 0, uint8_t _flags = BGFX_DISCARD_ALL)

    Submit primitive with occlusion query for rendering.

    Attention

    C99 equivalent is bgfx_submit_occlusion_query.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _program: Program.

    • -
    • [in] _occlusionQuery: Occlusion query.

    • -
    • [in] _depth: Depth for sorting.

    • -
    • [in] _flags: Discard or preserve states. See BGFX_DISCARD_*.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _program[in] Program.

    • +
    • _occlusionQuery[in] Occlusion query.

    • +
    • _depth[in] Depth for sorting.

    • +
    • _flags[in] Discard or preserve states. See BGFX_DISCARD_*.

    -

    -
    -void bgfx::submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16_t _start = 0, uint16_t _num = 1, uint32_t _depth = 0, uint8_t _flags = BGFX_DISCARD_ALL)
    +
    +void bgfx::submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16_t _start = 0, uint16_t _num = 1, uint32_t _depth = 0, uint8_t _flags = BGFX_DISCARD_ALL)

    Submit primitive for rendering with index and instance data info from indirect buffer.

    Attention

    C99 equivalent is bgfx_submit_indirect.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _program: Program.

    • -
    • [in] _indirectHandle: Indirect buffer.

    • -
    • [in] _start: First element in indirect buffer.

    • -
    • [in] _num: Number of dispatches.

    • -
    • [in] _depth: Depth for sorting.

    • -
    • [in] _flags: Discard or preserve states. See BGFX_DISCARD_*.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _program[in] Program.

    • +
    • _indirectHandle[in] Indirect buffer.

    • +
    • _start[in] First element in indirect buffer.

    • +
    • _num[in] Number of dispatches.

    • +
    • _depth[in] Depth for sorting.

    • +
    • _flags[in] Discard or preserve states. See BGFX_DISCARD_*.

    -

    -
    - -
    + + +

    Compute

    Compute state is not preserved between two compute dispatches. All state is cleared after calling bgfx::dispatch.

    -
    +

    Buffers

    -
    -struct bgfx::Access
    +
    +struct bgfx::Access

    Access mode enum.

    Attention

    C99 equivalent is bgfx_access_t.

    @@ -4625,33 +4990,33 @@ otherwise prefer bgfx::setViewScissor.

    -

    Public Types

    +

    Public Types

    -
    -enum Enum
    +
    +enum Enum

    Access:

    Values:

    -
    -enumerator Read
    +
    +enumerator Read

    Read.

    -
    -enumerator Write
    +
    +enumerator Write

    Write.

    -
    -enumerator ReadWrite
    +
    +enumerator ReadWrite

    Read and write.

    -
    -enumerator Count
    +
    +enumerator Count
    @@ -4660,164 +5025,188 @@ otherwise prefer bgfx::setViewScissor.

    -
    -void bgfx::setBuffer(uint8_t _stage, IndexBufferHandle _handle, Access::Enum _access)
    +
    +void bgfx::setBuffer(uint8_t _stage, IndexBufferHandle _handle, Access::Enum _access)

    Set compute index buffer.

    Attention

    C99 equivalent is bgfx_set_compute_index_buffer.

    -
    Parameters
      -
    • [in] _stage: Compute stage.

    • -
    • [in] _handle: Index buffer handle.

    • -
    • [in] _access: Buffer access. See Access::Enum.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stage[in] Compute stage.

    • +
    • _handle[in] Index buffer handle.

    • +
    • _access[in] Buffer access. See Access::Enum.

    -

    -
    -void bgfx::setBuffer(uint8_t _stage, VertexBufferHandle _handle, Access::Enum _access)
    +
    +void bgfx::setBuffer(uint8_t _stage, VertexBufferHandle _handle, Access::Enum _access)

    Set compute vertex buffer.

    Attention

    C99 equivalent is bgfx_set_compute_vertex_buffer.

    -
    Parameters
      -
    • [in] _stage: Compute stage.

    • -
    • [in] _handle: Vertex buffer handle.

    • -
    • [in] _access: Buffer access. See Access::Enum.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stage[in] Compute stage.

    • +
    • _handle[in] Vertex buffer handle.

    • +
    • _access[in] Buffer access. See Access::Enum.

    -

    -
    -void bgfx::setBuffer(uint8_t _stage, DynamicIndexBufferHandle _handle, Access::Enum _access)
    +
    +void bgfx::setBuffer(uint8_t _stage, DynamicIndexBufferHandle _handle, Access::Enum _access)

    Set compute dynamic index buffer.

    Attention

    C99 equivalent is bgfx_set_compute_dynamic_index_buffer.

    -
    Parameters
      -
    • [in] _stage: Compute stage.

    • -
    • [in] _handle: Dynamic index buffer handle.

    • -
    • [in] _access: Buffer access. See Access::Enum.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stage[in] Compute stage.

    • +
    • _handle[in] Dynamic index buffer handle.

    • +
    • _access[in] Buffer access. See Access::Enum.

    -

    -
    -void bgfx::setBuffer(uint8_t _stage, DynamicVertexBufferHandle _handle, Access::Enum _access)
    +
    +void bgfx::setBuffer(uint8_t _stage, DynamicVertexBufferHandle _handle, Access::Enum _access)

    Set compute dynamic vertex buffer.

    Attention

    C99 equivalent is bgfx_set_compute_dynamic_vertex_buffer.

    -
    Parameters
      -
    • [in] _stage: Compute stage.

    • -
    • [in] _handle: Dynamic vertex buffer handle.

    • -
    • [in] _access: Buffer access. See Access::Enum.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stage[in] Compute stage.

    • +
    • _handle[in] Dynamic vertex buffer handle.

    • +
    • _access[in] Buffer access. See Access::Enum.

    -

    -
    -void bgfx::setBuffer(uint8_t _stage, IndirectBufferHandle _handle, Access::Enum _access)
    +
    +void bgfx::setBuffer(uint8_t _stage, IndirectBufferHandle _handle, Access::Enum _access)

    Set compute indirect buffer.

    Attention

    C99 equivalent is bgfx_set_compute_indirect_buffer.

    -
    Parameters
      -
    • [in] _stage: Compute stage.

    • -
    • [in] _handle: Indirect buffer handle.

    • -
    • [in] _access: Buffer access. See Access::Enum.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stage[in] Compute stage.

    • +
    • _handle[in] Indirect buffer handle.

    • +
    • _access[in] Buffer access. See Access::Enum.

    -

    -
    -
    +
    +

    Images

    -
    -void bgfx::setImage(uint8_t _stage, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format = TextureFormat::Count)
    +
    +void bgfx::setImage(uint8_t _stage, TextureHandle _handle, uint8_t _mip, Access::Enum _access, TextureFormat::Enum _format = TextureFormat::Count)

    Set compute image from texture.

    Attention

    C99 equivalent is bgfx_set_image.

    -
    Parameters
      -
    • [in] _stage: Texture unit.

    • -
    • [in] _handle: Texture handle.

    • -
    • [in] _mip: Mip level.

    • -
    • [in] _access: Texture access. See Access::Enum.

    • -
    • [in] _format: Texture format. See: TextureFormat::Enum.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _stage[in] Texture unit.

    • +
    • _handle[in] Texture handle.

    • +
    • _mip[in] Mip level.

    • +
    • _access[in] Texture access. See Access::Enum.

    • +
    • _format[in] Texture format. See: TextureFormat::Enum.

    -

    -
    -
    + +

    Dispatch

    Within view all compute commands are dispatched after blit commands, and before draw commands.

    -
    -void bgfx::dispatch(ViewId _id, ProgramHandle _handle, uint32_t _numX = 1, uint32_t _numY = 1, uint32_t _numZ = 1, uint8_t _flags = BGFX_DISCARD_ALL)
    +
    +void bgfx::dispatch(ViewId _id, ProgramHandle _handle, uint32_t _numX = 1, uint32_t _numY = 1, uint32_t _numZ = 1, uint8_t _flags = BGFX_DISCARD_ALL)

    Dispatch compute.

    Attention

    C99 equivalent is bgfx_dispatch.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _handle: Compute program.

    • -
    • [in] _numX: Number of groups X.

    • -
    • [in] _numY: Number of groups Y.

    • -
    • [in] _numZ: Number of groups Z.

    • -
    • [in] _flags: Discard or preserve states. See BGFX_DISCARD_*.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _handle[in] Compute program.

    • +
    • _numX[in] Number of groups X.

    • +
    • _numY[in] Number of groups Y.

    • +
    • _numZ[in] Number of groups Z.

    • +
    • _flags[in] Discard or preserve states. See BGFX_DISCARD_*.

    -

    -
    -void bgfx::dispatch(ViewId _id, ProgramHandle _handle, IndirectBufferHandle _indirectHandle, uint16_t _start = 0, uint16_t _num = 1, uint8_t _flags = BGFX_DISCARD_ALL)
    +
    +void bgfx::dispatch(ViewId _id, ProgramHandle _handle, IndirectBufferHandle _indirectHandle, uint16_t _start = 0, uint16_t _num = 1, uint8_t _flags = BGFX_DISCARD_ALL)

    Dispatch compute indirect.

    Attention

    C99 equivalent is bgfx_dispatch_indirect.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _handle: Compute program.

    • -
    • [in] _indirectHandle: Indirect buffer.

    • -
    • [in] _start: First element in indirect buffer.

    • -
    • [in] _num: Number of dispatches.

    • -
    • [in] _flags: Discard or preserve states. See BGFX_DISCARD_*.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _handle[in] Compute program.

    • +
    • _indirectHandle[in] Indirect buffer.

    • +
    • _start[in] First element in indirect buffer.

    • +
    • _num[in] Number of dispatches.

    • +
    • _flags[in] Discard or preserve states. See BGFX_DISCARD_*.

    -

    -
    - -
    + + +

    Blit

    Within view all blit commands are executed before compute, and draw commands.

    -
    -void bgfx::blit(ViewId _id, TextureHandle _dst, uint16_t _dstX, uint16_t _dstY, TextureHandle _src, uint16_t _srcX = 0, uint16_t _srcY = 0, uint16_t _width = UINT16_MAX, uint16_t _height = UINT16_MAX)
    +
    +void bgfx::blit(ViewId _id, TextureHandle _dst, uint16_t _dstX, uint16_t _dstY, TextureHandle _src, uint16_t _srcX = 0, uint16_t _srcY = 0, uint16_t _width = UINT16_MAX, uint16_t _height = UINT16_MAX)

    Blit 2D texture region between two 2D textures.

    Attention

    Destination texture must be created with BGFX_TEXTURE_BLIT_DST flag.

    @@ -4826,25 +5215,28 @@ otherwise prefer bgfx::setViewScissor.

    Attention

    C99 equivalent is bgfx_blit.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _dst: Destination texture handle.

    • -
    • [in] _dstX: Destination texture X position.

    • -
    • [in] _dstY: Destination texture Y position.

    • -
    • [in] _src: Source texture handle.

    • -
    • [in] _srcX: Source texture X position.

    • -
    • [in] _srcY: Source texture Y position.

    • -
    • [in] _width: Width of region.

    • -
    • [in] _height: Height of region.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _dst[in] Destination texture handle.

    • +
    • _dstX[in] Destination texture X position.

    • +
    • _dstY[in] Destination texture Y position.

    • +
    • _src[in] Source texture handle.

    • +
    • _srcX[in] Source texture X position.

    • +
    • _srcY[in] Source texture Y position.

    • +
    • _width[in] Width of region.

    • +
    • _height[in] Height of region.

    -

    -
    -void bgfx::blit(ViewId _id, TextureHandle _dst, uint8_t _dstMip, uint16_t _dstX, uint16_t _dstY, uint16_t _dstZ, TextureHandle _src, uint8_t _srcMip = 0, uint16_t _srcX = 0, uint16_t _srcY = 0, uint16_t _srcZ = 0, uint16_t _width = UINT16_MAX, uint16_t _height = UINT16_MAX, uint16_t _depth = UINT16_MAX)
    +
    +void bgfx::blit(ViewId _id, TextureHandle _dst, uint8_t _dstMip, uint16_t _dstX, uint16_t _dstY, uint16_t _dstZ, TextureHandle _src, uint8_t _srcMip = 0, uint16_t _srcX = 0, uint16_t _srcY = 0, uint16_t _srcZ = 0, uint16_t _width = UINT16_MAX, uint16_t _height = UINT16_MAX, uint16_t _depth = UINT16_MAX)

    Blit texture region between two textures.

    Attention

    Destination texture must be created with BGFX_TEXTURE_BLIT_DST flag.

    @@ -4853,34 +5245,37 @@ otherwise prefer bgfx::setViewScissor.

    Attention

    C99 equivalent is bgfx_blit.

    -
    Parameters
      -
    • [in] _id: View id.

    • -
    • [in] _dst: Destination texture handle.

    • -
    • [in] _dstMip: Destination texture mip level.

    • -
    • [in] _dstX: Destination texture X position.

    • -
    • [in] _dstY: Destination texture Y position.

    • -
    • [in] _dstZ: If texture is 2D this argument should be 0. If destination texture is cube this argument represents destination texture cube face. For 3D texture this argument represents destination texture Z position.

    • -
    • [in] _src: Source texture handle.

    • -
    • [in] _srcMip: Source texture mip level.

    • -
    • [in] _srcX: Source texture X position.

    • -
    • [in] _srcY: Source texture Y position.

    • -
    • [in] _srcZ: If texture is 2D this argument should be 0. If source texture is cube this argument represents source texture cube face. For 3D texture this argument represents source texture Z position.

    • -
    • [in] _width: Width of region.

    • -
    • [in] _height: Height of region.

    • -
    • [in] _depth: If texture is 3D this argument represents depth of region, otherwise it’s unused.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _id[in] View id.

    • +
    • _dst[in] Destination texture handle.

    • +
    • _dstMip[in] Destination texture mip level.

    • +
    • _dstX[in] Destination texture X position.

    • +
    • _dstY[in] Destination texture Y position.

    • +
    • _dstZ[in] If texture is 2D this argument should be 0. If destination texture is cube this argument represents destination texture cube face. For 3D texture this argument represents destination texture Z position.

    • +
    • _src[in] Source texture handle.

    • +
    • _srcMip[in] Source texture mip level.

    • +
    • _srcX[in] Source texture X position.

    • +
    • _srcY[in] Source texture Y position.

    • +
    • _srcZ[in] If texture is 2D this argument should be 0. If source texture is cube this argument represents source texture cube face. For 3D texture this argument represents source texture Z position.

    • +
    • _width[in] Width of region.

    • +
    • _height[in] Height of region.

    • +
    • _depth[in] If texture is 3D this argument represents depth of region, otherwise it’s unused.

    -

    -
    - -
    + + +

    Resources

    -
    -struct bgfx::Memory
    +
    +struct bgfx::Memory

    Memory must be obtained by calling bgfx::alloc, bgfx::copy, or bgfx::makeRef.

    Attention

    It is illegal to create this structure on stack and pass it to any bgfx API.

    @@ -4890,16 +5285,16 @@ otherwise prefer bgfx::setViewScissor.

    -

    Public Members

    +

    Public Members

    -
    -uint8_t *data
    +
    +uint8_t *data

    Pointer to data.

    -
    -uint32_t size
    +
    +uint32_t size

    Data size.

    @@ -4907,169 +5302,191 @@ otherwise prefer bgfx::setViewScissor.

    -
    -const Memory *bgfx::alloc(uint32_t _size)
    +
    +const Memory *bgfx::alloc(uint32_t _size)

    Allocate buffer to pass to bgfx calls. Data will be freed inside bgfx.

    Attention

    C99 equivalent is bgfx_alloc.

    -
    Parameters
      -
    • [in] _size: Size to allocate.

    • -
    -

    +
    +
    Parameters
    +

    _size[in] Size to allocate.

    +
    +
    -
    -const Memory *bgfx::copy(const void *_data, uint32_t _size)
    +
    +const Memory *bgfx::copy(const void *_data, uint32_t _size)

    Allocate buffer and copy data into it. Data will be freed inside bgfx.

    Attention

    C99 equivalent is bgfx_copy.

    -
    Parameters
      -
    • [in] _data: Pointer to data to be copied.

    • -
    • [in] _size: Size of data to be copied.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _data[in] Pointer to data to be copied.

    • +
    • _size[in] Size of data to be copied.

    -

    -
    -const Memory *bgfx::makeRef(const void *_data, uint32_t _size, ReleaseFn _releaseFn = NULL, void *_userData = NULL)
    +
    +const Memory *bgfx::makeRef(const void *_data, uint32_t _size, ReleaseFn _releaseFn = NULL, void *_userData = NULL)

    Make reference to data to pass to bgfx. Unlike bgfx::alloc, this call doesn’t allocate memory for data. It just copies the _data pointer. You can pass ReleaseFn function pointer to release this memory after it’s consumed, otherwise you must make sure _data is available for at least 2 bgfx::frame calls. ReleaseFn function must be able to be called from any thread.

    Attention

    Data passed must be available for at least 2 bgfx::frame calls.

    Attention

    C99 equivalent are bgfx_make_ref, bgfx_make_ref_release.

    -
    Parameters
      -
    • [in] _data: Pointer to data.

    • -
    • [in] _size: Size of data.

    • -
    • [in] _releaseFn: Callback function to release memory after use.

    • -
    • [in] _userData: User data to be passed to callback function.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _data[in] Pointer to data.

    • +
    • _size[in] Size of data.

    • +
    • _releaseFn[in] Callback function to release memory after use.

    • +
    • _userData[in] User data to be passed to callback function.

    -

    -
    +

    Shaders and Programs

    -
    -ShaderHandle bgfx::createShader(const Memory *_mem)
    +
    +ShaderHandle bgfx::createShader(const Memory *_mem)

    Create shader from memory buffer.

    -
    Return

    Shader handle.

    -
    Attention

    C99 equivalent is bgfx_create_shader.

    +
    +
    Returns
    +

    Shader handle.

    +
    +
    -
    -uint16_t bgfx::getShaderUniforms(ShaderHandle _handle, UniformHandle *_uniforms = NULL, uint16_t _max = 0)
    +
    +uint16_t bgfx::getShaderUniforms(ShaderHandle _handle, UniformHandle *_uniforms = NULL, uint16_t _max = 0)

    Returns the number of uniforms and uniform handles used inside a shader.

    -
    Return

    Number of uniforms used by shader.

    -
    Remark

    Only non-predefined uniforms are returned.

    Attention

    C99 equivalent is bgfx_get_shader_uniforms.

    -
    Parameters
      -
    • [in] _handle: Shader handle.

    • -
    • [in] _uniforms: UniformHandle array where data will be stored.

    • -
    • [in] _max: Maximum capacity of array.

    • -
    -

    +
    +
    Parameters
    +
      +
    • _handle[in] Shader handle.

    • +
    • _uniforms[in] UniformHandle array where data will be stored.

    • +
    • _max[in] Maximum capacity of array.

    • +
    +
    +
    Returns
    +

    Number of uniforms used by shader.

    +
    +
    -
    -void bgfx::destroy(ShaderHandle _handle)
    +
    +void bgfx::destroy(ShaderHandle _handle)

    Destroy shader. Once a shader program is created with _handle, it is safe to destroy that shader.

    Attention

    C99 equivalent is bgfx_destroy_shader.

    -
    Parameters
      -
    • [in] _handle: Shader handle.

    • -
    -

    +
    +
    Parameters
    +

    _handle[in] Shader handle.

    +
    +
    -
    -ProgramHandle bgfx::createProgram(ShaderHandle _vsh, ShaderHandle _fsh, bool _destroyShaders = false)
    +
    +ProgramHandle bgfx::createProgram(ShaderHandle _vsh, ShaderHandle _fsh, bool _destroyShaders = false)

    Create program with vertex and fragment shaders.

    -
    Return

    Program handle if vertex shader output and fragment shader input are matching, otherwise returns invalid program handle.

    -
    Attention

    C99 equivalent is bgfx_create_program.

    -
    Parameters
      -
    • [in] _vsh: Vertex shader.

    • -
    • [in] _fsh: Fragment shader.

    • -
    • [in] _destroyShaders: If true, shaders will be destroyed when program is destroyed.

    • -
    -

    +
    +
    Parameters
    +
      +
    • _vsh[in] Vertex shader.

    • +
    • _fsh[in] Fragment shader.

    • +
    • _destroyShaders[in] If true, shaders will be destroyed when program is destroyed.

    • +
    +
    +
    Returns
    +

    Program handle if vertex shader output and fragment shader input are matching, otherwise returns invalid program handle.

    +
    +
    -
    -ProgramHandle bgfx::createProgram(ShaderHandle _csh, bool _destroyShader = false)
    +
    +ProgramHandle bgfx::createProgram(ShaderHandle _csh, bool _destroyShader = false)

    Create program with compute shader.

    -
    Return

    Program handle.

    -
    Attention

    C99 equivalent is bgfx_create_compute_program.

    -
    Parameters
      -
    • [in] _csh: Compute shader.

    • -
    • [in] _destroyShader: If true, shader will be destroyed when program is destroyed.

    • -
    -

    +
    +
    Parameters
    +
      +
    • _csh[in] Compute shader.

    • +
    • _destroyShader[in] If true, shader will be destroyed when program is destroyed.

    • +
    +
    +
    Returns
    +

    Program handle.

    +
    +
    -
    -void bgfx::destroy(ProgramHandle _handle)
    +
    +void bgfx::destroy(ProgramHandle _handle)

    Destroy program.

    Attention

    C99 equivalent is bgfx_destroy_program.

    -
    Parameters
      -
    • [in] _handle: Program handle.

    • -
    -

    +
    +
    Parameters
    +

    _handle[in] Program handle.

    +
    +
    -
    -
    +
    +

    Uniforms

    -
    -UniformHandle bgfx::createUniform(const char *_name, UniformType::Enum _type, uint16_t _num = 1)
    +
    +UniformHandle bgfx::createUniform(const char *_name, UniformType::Enum _type, uint16_t _num = 1)

    Create shader uniform parameter.

    -
    Return

    Handle to uniform object.

    -
    Remark

    1. Uniform names are unique. It’s valid to call bgfx::createUniform multiple times with the same uniform name. The library will always return the same handle, but the handle reference count will be incremented. This means that the same number of bgfx::destroyUniform must be called to properly destroy the uniform.

    2. Predefined uniforms (declared in bgfx_shader.sh):

        @@ -5092,50 +5509,60 @@ otherwise prefer bgfx::setViewScissor.

    Attention

    C99 equivalent is bgfx_create_uniform.

    -
    Parameters
      -
    • [in] _name: Uniform name in shader.

    • -
    • [in] _type: Type of uniform (See: bgfx::UniformType).

    • -
    • [in] _num: Number of elements in array.

    • -
    -

    +
    +
    Parameters
    +
      +
    • _name[in] Uniform name in shader.

    • +
    • _type[in] Type of uniform (See: bgfx::UniformType).

    • +
    • _num[in] Number of elements in array.

    • +
    +
    +
    Returns
    +

    Handle to uniform object.

    +
    +
    -
    -void bgfx::getUniformInfo(UniformHandle _handle, UniformInfo &_info)
    +
    +void bgfx::getUniformInfo(UniformHandle _handle, UniformInfo &_info)

    Retrieve uniform info.

    Attention

    C99 equivalent is bgfx_get_uniform_info.

    -
    Parameters
      -
    • [in] _handle: Handle to uniform object.

    • -
    • [out] _info: Uniform info.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] Handle to uniform object.

    • +
    • _info[out] Uniform info.

    -

    -
    -void bgfx::destroy(UniformHandle _handle)
    +
    +void bgfx::destroy(UniformHandle _handle)

    Destroy shader uniform parameter.

    Attention

    C99 equivalent is bgfx_destroy_uniform.

    -
    Parameters
      -
    • [in] _handle: Handle to uniform object.

    • -
    -

    +
    +
    Parameters
    +

    _handle[in] Handle to uniform object.

    +
    +
    -
    -struct bgfx::UniformType
    +
    +struct bgfx::UniformType

    Uniform type enum.

    Attention

    C99 equivalent is bgfx_uniform_type_t.

    @@ -5143,45 +5570,45 @@ otherwise prefer bgfx::setViewScissor.

    -

    Public Types

    +

    Public Types

    -
    -enum Enum
    +
    +enum Enum

    Uniform types:

    Values:

    -
    -enumerator Sampler
    +
    +enumerator Sampler

    Sampler.

    -
    -enumerator End
    +
    +enumerator End

    Reserved, do not use.

    -
    -enumerator Vec4
    +
    +enumerator Vec4

    4 floats vector.

    -
    -enumerator Mat3
    +
    +enumerator Mat3

    3x3 matrix.

    -
    -enumerator Mat4
    +
    +enumerator Mat4

    4x4 matrix.

    -
    -enumerator Count
    +
    +enumerator Count
    @@ -5190,8 +5617,8 @@ otherwise prefer bgfx::setViewScissor.

    -
    -struct bgfx::UniformInfo
    +
    +struct bgfx::UniformInfo

    Uniform info.

    Attention

    C99 equivalent is bgfx_uniform_info_t.

    @@ -5199,34 +5626,34 @@ otherwise prefer bgfx::setViewScissor.

    -

    Public Members

    +

    Public Members

    -
    -char name[256]
    +
    +char name[256]

    Uniform name.

    -
    -UniformType::Enum type
    +
    +UniformType::Enum type

    Uniform type.

    -
    -uint16_t num
    +
    +uint16_t num

    Number of elements in array.

    -
    -
    + +

    Vertex Buffers

    -
    -VertexLayoutHandle bgfx::createVertexLayout(const VertexLayout &_layout)
    +
    +VertexLayoutHandle bgfx::createVertexLayout(const VertexLayout &_layout)

    Create vertex layout.

    Attention

    C99 equivalent is bgfx_create_vertex_layout.

    @@ -5236,8 +5663,8 @@ otherwise prefer bgfx::setViewScissor.

    -
    -void bgfx::destroy(VertexLayoutHandle _handle)
    +
    +void bgfx::destroy(VertexLayoutHandle _handle)

    Destroy vertex layout.

    Attention

    C99 equivalent is bgfx_destroy_vertex_layout.

    @@ -5247,18 +5674,20 @@ otherwise prefer bgfx::setViewScissor.

    -
    -VertexBufferHandle bgfx::createVertexBuffer(const Memory *_mem, const VertexLayout &_layout, uint16_t _flags = BGFX_BUFFER_NONE)
    +
    +VertexBufferHandle bgfx::createVertexBuffer(const Memory *_mem, const VertexLayout &_layout, uint16_t _flags = BGFX_BUFFER_NONE)

    Create static vertex buffer.

    -
    Return

    Static vertex buffer handle.

    -
    Attention

    C99 equivalent is bgfx_create_vertex_buffer.

    -
    Parameters
      -
    • [in] _mem: Vertex buffer data.

    • -
    • [in] _layout: Vertex layout.

    • -
    • [in] _flags: Buffer creation flags.

        +
    +

    +
    +
    Parameters
    +
      +
    • _mem[in] Vertex buffer data.

    • +
    • _layout[in] Vertex layout.

    • +
    • _flags[in] Buffer creation flags.

      • BGFX_BUFFER_NONE - No flags.

      • BGFX_BUFFER_COMPUTE_READ - Buffer will be read from by compute shader.

      • BGFX_BUFFER_COMPUTE_WRITE - Buffer will be written into by compute shader. When buffer is created with BGFX_BUFFER_COMPUTE_WRITE flag it cannot be updated from CPU.

      • @@ -5269,45 +5698,51 @@ otherwise prefer bgfx::setViewScissor.

    +
    Returns
    +

    Static vertex buffer handle.

    +
    -

    -
    -void bgfx::setName(VertexBufferHandle _handle, const char *_name, int32_t _len = INT32_MAX)
    +
    +void bgfx::setName(VertexBufferHandle _handle, const char *_name, int32_t _len = INT32_MAX)

    Set static vertex buffer debug name.

    Attention

    C99 equivalent is bgfx_set_vertex_buffer_name.

    -
    Parameters
      -
    • [in] _handle: Static vertex buffer handle.

    • -
    • [in] _name: Static vertex buffer name.

    • -
    • [in] _len: Static vertex buffer name length (if length is INT32_MAX, it’s expected that _name is zero terminated string.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] Static vertex buffer handle.

    • +
    • _name[in] Static vertex buffer name.

    • +
    • _len[in] Static vertex buffer name length (if length is INT32_MAX, it’s expected that _name is zero terminated string.

    -

    -
    -void bgfx::destroy(VertexBufferHandle _handle)
    +
    +void bgfx::destroy(VertexBufferHandle _handle)

    Destroy static vertex buffer.

    Attention

    C99 equivalent is bgfx_destroy_vertex_buffer.

    -
    Parameters
      -
    • [in] _handle: Static vertex buffer handle.

    • -
    -

    +
    +
    Parameters
    +

    _handle[in] Static vertex buffer handle.

    +
    +
    -
    -struct bgfx::VertexLayout
    +
    +struct bgfx::VertexLayout

    Vertex layout.

    Attention

    C99 equivalent is bgfx_vertex_layout_t.

    @@ -5315,27 +5750,29 @@ otherwise prefer bgfx::setViewScissor.

    -

    Public Functions

    +

    Public Functions

    -
    -VertexLayout &begin(RendererType::Enum _renderer = RendererType::Noop)
    +
    +VertexLayout &begin(RendererType::Enum _renderer = RendererType::Noop)

    Start VertexLayout.

    -
    Return

    Returns itself.

    -
    Attention

    C99 equivalent is bgfx_vertex_layout_begin.

    -
    Parameters
    -

    +
    +
    Parameters
    +

    _renderer[in] Renderer backend type. See: bgfx::RendererType

    +
    +
    Returns
    +

    Returns itself.

    +
    +
    -
    -void end()
    +
    +void end()

    End VertexLayout.

    Attention

    C99 equivalent is bgfx_vertex_layout_end.

    @@ -5345,44 +5782,51 @@ otherwise prefer bgfx::setViewScissor.

    -
    -VertexLayout &add(Attrib::Enum _attrib, uint8_t _num, AttribType::Enum _type, bool _normalized = false, bool _asInt = false)
    +
    +VertexLayout &add(Attrib::Enum _attrib, uint8_t _num, AttribType::Enum _type, bool _normalized = false, bool _asInt = false)

    Add attribute to VertexLayout.

    -
    Return

    Returns itself.

    -
    Remark

    Must be called between begin/end.

    Attention

    C99 equivalent is bgfx_vertex_layout_add.

    -
    Parameters
      -
    • [in] _attrib: Attribute semantics. See: bgfx::Attrib

    • -
    • [in] _num: Number of elements 1, 2, 3 or 4.

    • -
    • [in] _type: Element type.

    • -
    • [in] _normalized: When using fixed point AttribType (f.e. Uint8) value will be normalized for vertex shader usage. When normalized is set to true, AttribType::Uint8 value in range 0-255 will be in range 0.0-1.0 in vertex shader.

    • -
    • [in] _asInt: Packaging rule for vertexPack, vertexUnpack, and vertexConvert for AttribType::Uint8 and AttribType::Int16. Unpacking code must be implemented inside vertex shader.

    • -
    -

    +
    +
    Parameters
    +
      +
    • _attrib[in] Attribute semantics. See: bgfx::Attrib

    • +
    • _num[in] Number of elements 1, 2, 3 or 4.

    • +
    • _type[in] Element type.

    • +
    • _normalized[in] When using fixed point AttribType (f.e. Uint8) value will be normalized for vertex shader usage. When normalized is set to true, AttribType::Uint8 value in range 0-255 will be in range 0.0-1.0 in vertex shader.

    • +
    • _asInt[in] Packaging rule for vertexPack, vertexUnpack, and vertexConvert for AttribType::Uint8 and AttribType::Int16. Unpacking code must be implemented inside vertex shader.

    • +
    +
    +
    Returns
    +

    Returns itself.

    +
    +
    -
    -VertexLayout &skip(uint8_t _num)
    +
    +VertexLayout &skip(uint8_t _num)

    Skip _num bytes in vertex stream.

    -
    Return

    Returns itself.

    -
    Attention

    C99 equivalent is bgfx_vertex_layout_skip.

    +
    +
    Returns
    +

    Returns itself.

    +
    +
    -
    -void decode(Attrib::Enum _attrib, uint8_t &_num, AttribType::Enum &_type, bool &_normalized, bool &_asInt) const
    +
    +void decode(Attrib::Enum _attrib, uint8_t &_num, AttribType::Enum &_type, bool &_normalized, bool &_asInt) const

    Decode attribute.

    Attention

    C99 equivalent is bgfx_vertex_layout_decode.

    @@ -5392,87 +5836,87 @@ otherwise prefer bgfx::setViewScissor.

    -
    -bool has(Attrib::Enum _attrib) const
    +
    +inline bool has(Attrib::Enum _attrib) const

    Returns true if VertexLayout contains attribute.

    -
    Return

    True if VertexLayout contains attribute.

    -
    Attention

    C99 equivalent is bgfx_vertex_layout_has.

    -
    Parameters
    -

    +
    +
    Parameters
    +

    _attrib[in] Attribute semantics. See: bgfx::Attrib

    +
    +
    Returns
    +

    True if VertexLayout contains attribute.

    +
    +
    -
    -uint16_t getOffset(Attrib::Enum _attrib) const
    +
    +inline uint16_t getOffset(Attrib::Enum _attrib) const

    Returns relative attribute offset from the vertex.

    -

    -
    Return

    Relative attribute offset from the vertex.

    +
    +
    Parameters
    +

    _attrib[in] Attribute semantics. See: bgfx::Attrib

    -
    Parameters
    +
    Returns
    +

    Relative attribute offset from the vertex.

    -

    -
    -uint16_t getStride() const
    +
    +inline uint16_t getStride() const

    Returns vertex stride.

    -

    -
    Return

    Vertex stride.

    +
    +
    Returns
    +

    Vertex stride.

    -

    -
    -uint32_t getSize(uint32_t _num) const
    +
    +inline uint32_t getSize(uint32_t _num) const

    Returns size of vertex buffer for number of vertices.

    -

    -
    Return

    Size of vertex buffer for number of vertices.

    +
    +
    Parameters
    +

    _num[in] Number of vertices.

    -
    Parameters
      -
    • [in] _num: Number of vertices.

    • -
    +
    Returns
    +

    Size of vertex buffer for number of vertices.

    -

    -

    Public Members

    +

    Public Members

    -
    -uint32_t m_hash
    +
    +uint32_t m_hash

    Hash.

    -
    -uint16_t m_stride
    +
    +uint16_t m_stride

    Stride.

    -
    -uint16_t m_offset[Count]
    +
    +uint16_t m_offset[Attrib::Count]

    Attribute offsets.

    -
    -uint16_t m_attributes[Count]
    +
    +uint16_t m_attributes[Attrib::Count]

    Used attributes.

    @@ -5480,8 +5924,8 @@ otherwise prefer bgfx::setViewScissor.

    -
    -struct bgfx::Attrib
    +
    +struct bgfx::Attrib

    Vertex attribute enum.

    Attention

    C99 equivalent is bgfx_attrib_t.

    @@ -5489,123 +5933,123 @@ otherwise prefer bgfx::setViewScissor.

    -

    Public Types

    +

    Public Types

    -
    -enum Enum
    +
    +enum Enum

    Corresponds to vertex shader attribute.

    Values:

    -
    -enumerator Position
    +
    +enumerator Position

    a_position

    -
    -enumerator Normal
    +
    +enumerator Normal

    a_normal

    -
    -enumerator Tangent
    +
    +enumerator Tangent

    a_tangent

    -
    -enumerator Bitangent
    +
    +enumerator Bitangent

    a_bitangent

    -
    -enumerator Color0
    +
    +enumerator Color0

    a_color0

    -
    -enumerator Color1
    +
    +enumerator Color1

    a_color1

    -
    -enumerator Color2
    +
    +enumerator Color2

    a_color2

    -
    -enumerator Color3
    +
    +enumerator Color3

    a_color3

    -
    -enumerator Indices
    +
    +enumerator Indices

    a_indices

    -
    -enumerator Weight
    +
    +enumerator Weight

    a_weight

    -
    -enumerator TexCoord0
    +
    +enumerator TexCoord0

    a_texcoord0

    -
    -enumerator TexCoord1
    +
    +enumerator TexCoord1

    a_texcoord1

    -
    -enumerator TexCoord2
    +
    +enumerator TexCoord2

    a_texcoord2

    -
    -enumerator TexCoord3
    +
    +enumerator TexCoord3

    a_texcoord3

    -
    -enumerator TexCoord4
    +
    +enumerator TexCoord4

    a_texcoord4

    -
    -enumerator TexCoord5
    +
    +enumerator TexCoord5

    a_texcoord5

    -
    -enumerator TexCoord6
    +
    +enumerator TexCoord6

    a_texcoord6

    -
    -enumerator TexCoord7
    +
    +enumerator TexCoord7

    a_texcoord7

    -
    -enumerator Count
    +
    +enumerator Count
    @@ -5614,8 +6058,8 @@ otherwise prefer bgfx::setViewScissor.

    -
    -struct bgfx::AttribType
    +
    +struct bgfx::AttribType

    Vertex attribute type enum.

    Attention

    C99 equivalent is bgfx_attrib_type_t.

    @@ -5623,45 +6067,45 @@ otherwise prefer bgfx::setViewScissor.

    -

    Public Types

    +

    Public Types

    -
    -enum Enum
    +
    +enum Enum

    Attribute types:

    Values:

    -
    -enumerator Uint8
    +
    +enumerator Uint8

    Uint8.

    -
    -enumerator Uint10
    +
    +enumerator Uint10

    Uint10, availability depends on: BGFX_CAPS_VERTEX_ATTRIB_UINT10.

    -
    -enumerator Int16
    +
    +enumerator Int16

    Int16.

    -
    -enumerator Half
    +
    +enumerator Half

    Half, availability depends on: BGFX_CAPS_VERTEX_ATTRIB_HALF.

    -
    -enumerator Float
    +
    +enumerator Float

    Float.

    -
    -enumerator Count
    +
    +enumerator Count
    @@ -5670,18 +6114,20 @@ otherwise prefer bgfx::setViewScissor.

    -
    -DynamicVertexBufferHandle bgfx::createDynamicVertexBuffer(uint32_t _num, const VertexLayout &_layout, uint16_t _flags = BGFX_BUFFER_NONE)
    +
    +DynamicVertexBufferHandle bgfx::createDynamicVertexBuffer(uint32_t _num, const VertexLayout &_layout, uint16_t _flags = BGFX_BUFFER_NONE)

    Create empty dynamic vertex buffer.

    -
    Return

    Dynamic vertex buffer handle.

    -
    Attention

    C99 equivalent is bgfx_create_dynamic_vertex_buffer.

    -
    Parameters
      -
    • [in] _num: Number of vertices.

    • -
    • [in] _layout: Vertex layout.

    • -
    • [in] _flags: Buffer creation flags.

        +
    +

    +
    +
    Parameters
    +
      +
    • _num[in] Number of vertices.

    • +
    • _layout[in] Vertex layout.

    • +
    • _flags[in] Buffer creation flags.

      • BGFX_BUFFER_NONE - No flags.

      • BGFX_BUFFER_COMPUTE_READ - Buffer will be read from by compute shader.

      • BGFX_BUFFER_COMPUTE_WRITE - Buffer will be written into by compute shader. When buffer is created with BGFX_BUFFER_COMPUTE_WRITE flag it cannot be updated from CPU.

      • @@ -5692,23 +6138,27 @@ otherwise prefer bgfx::setViewScissor.

    +
    Returns
    +

    Dynamic vertex buffer handle.

    +
    -

    -
    -DynamicVertexBufferHandle bgfx::createDynamicVertexBuffer(const Memory *_mem, const VertexLayout &_layout, uint16_t _flags = BGFX_BUFFER_NONE)
    +
    +DynamicVertexBufferHandle bgfx::createDynamicVertexBuffer(const Memory *_mem, const VertexLayout &_layout, uint16_t _flags = BGFX_BUFFER_NONE)

    Create dynamic vertex buffer and initialize it.

    -
    Return

    Dynamic vertex buffer handle.

    -
    Attention

    C99 equivalent is bgfx_create_dynamic_vertex_buffer_mem.

    -
    Parameters
      -
    • [in] _mem: Vertex buffer data.

    • -
    • [in] _layout: Vertex layout.

    • -
    • [in] _flags: Buffer creation flags.

        +
    +

    +
    +
    Parameters
    +
      +
    • _mem[in] Vertex buffer data.

    • +
    • _layout[in] Vertex layout.

    • +
    • _flags[in] Buffer creation flags.

      • BGFX_BUFFER_NONE - No flags.

      • BGFX_BUFFER_COMPUTE_READ - Buffer will be read from by compute shader.

      • BGFX_BUFFER_COMPUTE_WRITE - Buffer will be written into by compute shader. When buffer is created with BGFX_BUFFER_COMPUTE_WRITE flag it cannot be updated from CPU.

      • @@ -5719,88 +6169,104 @@ otherwise prefer bgfx::setViewScissor.

    +
    Returns
    +

    Dynamic vertex buffer handle.

    +
    -

    -
    -void bgfx::update(DynamicVertexBufferHandle _handle, uint32_t _startVertex, const Memory *_mem)
    +
    +void bgfx::update(DynamicVertexBufferHandle _handle, uint32_t _startVertex, const Memory *_mem)

    Update dynamic vertex buffer.

    Attention

    C99 equivalent is bgfx_update_dynamic_vertex_buffer.

    -
    Parameters
      -
    • [in] _handle: Dynamic vertex buffer handle.

    • -
    • [in] _startVertex: Start vertex.

    • -
    • [in] _mem: Vertex buffer data.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] Dynamic vertex buffer handle.

    • +
    • _startVertex[in] Start vertex.

    • +
    • _mem[in] Vertex buffer data.

    -

    -
    -void bgfx::destroy(DynamicVertexBufferHandle _handle)
    +
    +void bgfx::destroy(DynamicVertexBufferHandle _handle)

    Destroy dynamic vertex buffer.

    Attention

    C99 equivalent is bgfx_destroy_dynamic_vertex_buffer.

    -
    Parameters
      -
    • [in] _handle: Dynamic vertex buffer handle.

    • -
    -

    +
    +
    Parameters
    +

    _handle[in] Dynamic vertex buffer handle.

    +
    +
    -
    -uint32_t bgfx::getAvailTransientVertexBuffer(uint32_t _num, const VertexLayout &_layout)
    +
    +uint32_t bgfx::getAvailTransientVertexBuffer(uint32_t _num, const VertexLayout &_layout)

    Returns number of requested or maximum available vertices.

    Attention

    C99 equivalent is bgfx_get_avail_transient_vertex_buffer.

    -
    Parameters
      -
    • [in] _num: Number of required vertices.

    • -
    • [in] _layout: Vertex layout.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _num[in] Number of required vertices.

    • +
    • _layout[in] Vertex layout.

    -

    -
    -void bgfx::allocTransientVertexBuffer(TransientVertexBuffer *_tvb, uint32_t _num, const VertexLayout &_layout)
    +
    +void bgfx::allocTransientVertexBuffer(TransientVertexBuffer *_tvb, uint32_t _num, const VertexLayout &_layout)

    Allocate transient vertex buffer.

    Attention

    C99 equivalent is bgfx_alloc_transient_vertex_buffer.

    -
    Parameters
      -
    • [out] _tvb: TransientVertexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.

    • -
    • [in] _num: Number of vertices to allocate.

    • -
    • [in] _layout: Vertex layout.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _tvb[out] TransientVertexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.

    • +
    • _num[in] Number of vertices to allocate.

    • +
    • _layout[in] Vertex layout.

    -

    -
    -
    + +

    Index Buffers

    -
    -IndexBufferHandle bgfx::createIndexBuffer(const Memory *_mem, uint16_t _flags = BGFX_BUFFER_NONE)
    +
    +IndexBufferHandle bgfx::createIndexBuffer(const Memory *_mem, uint16_t _flags = BGFX_BUFFER_NONE)

    Create static index buffer.

    Attention

    C99 equivalent is bgfx_create_index_buffer.

    -
    Parameters
      -
    • [in] _mem: Index buffer data.

    • -
    • [in] _flags: Buffer creation flags.

        +
    +

    +
    +
    Parameters
    +
      +
    • _mem[in] Index buffer data.

    • +
    • _flags[in] Buffer creation flags.

      • BGFX_BUFFER_NONE - No flags.

      • BGFX_BUFFER_COMPUTE_READ - Buffer will be read from by compute shader.

      • BGFX_BUFFER_COMPUTE_WRITE - Buffer will be written into by compute shader. When buffer is created with BGFX_BUFFER_COMPUTE_WRITE flag it cannot be updated from CPU.

      • @@ -5812,53 +6278,58 @@ otherwise prefer bgfx::setViewScissor.

    -

    -
    -void bgfx::setName(IndexBufferHandle _handle, const char *_name, int32_t _len = INT32_MAX)
    +
    +void bgfx::setName(IndexBufferHandle _handle, const char *_name, int32_t _len = INT32_MAX)

    Set static index buffer debug name.

    Attention

    C99 equivalent is bgfx_set_index_buffer_name.

    -
    Parameters
      -
    • [in] _handle: Static index buffer handle.

    • -
    • [in] _name: Static index buffer name.

    • -
    • [in] _len: Static index buffer name length (if length is INT32_MAX, it’s expected that _name is zero terminated string.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] Static index buffer handle.

    • +
    • _name[in] Static index buffer name.

    • +
    • _len[in] Static index buffer name length (if length is INT32_MAX, it’s expected that _name is zero terminated string.

    -

    -
    -void bgfx::destroy(IndexBufferHandle _handle)
    +
    +void bgfx::destroy(IndexBufferHandle _handle)

    Destroy static index buffer.

    Attention

    C99 equivalent is bgfx_destroy_index_buffer.

    -
    Parameters
      -
    • [in] _handle: Static index buffer handle.

    • -
    -

    +
    +
    Parameters
    +

    _handle[in] Static index buffer handle.

    +
    +
    -
    -DynamicIndexBufferHandle bgfx::createDynamicIndexBuffer(uint32_t _num, uint16_t _flags = BGFX_BUFFER_NONE)
    +
    +DynamicIndexBufferHandle bgfx::createDynamicIndexBuffer(uint32_t _num, uint16_t _flags = BGFX_BUFFER_NONE)

    Create empty dynamic index buffer.

    -
    Return

    Dynamic index buffer handle.

    -
    Attention

    C99 equivalent is bgfx_create_dynamic_index_buffer.

    -
    Parameters
      -
    • [in] _num: Number of indices.

    • -
    • [in] _flags: Buffer creation flags.

        +
    +

    +
    +
    Parameters
    +
      +
    • _num[in] Number of indices.

    • +
    • _flags[in] Buffer creation flags.

      • BGFX_BUFFER_NONE - No flags.

      • BGFX_BUFFER_COMPUTE_READ - Buffer will be read from by compute shader.

      • BGFX_BUFFER_COMPUTE_WRITE - Buffer will be written into by compute shader. When buffer is created with BGFX_BUFFER_COMPUTE_WRITE flag it cannot be updated from CPU.

      • @@ -5869,22 +6340,26 @@ otherwise prefer bgfx::setViewScissor.

    +
    Returns
    +

    Dynamic index buffer handle.

    +
    -

    -
    -DynamicIndexBufferHandle bgfx::createDynamicIndexBuffer(const Memory *_mem, uint16_t _flags = BGFX_BUFFER_NONE)
    +
    +DynamicIndexBufferHandle bgfx::createDynamicIndexBuffer(const Memory *_mem, uint16_t _flags = BGFX_BUFFER_NONE)

    Create dynamic index buffer and initialized it.

    -
    Return

    Dynamic index buffer handle.

    -
    Attention

    C99 equivalent is bgfx_create_dynamic_index_buffer_mem.

    -
    Parameters
      -
    • [in] _mem: Index buffer data.

    • -
    • [in] _flags: Buffer creation flags.

        +
    +

    +
    +
    Parameters
    +
      +
    • _mem[in] Index buffer data.

    • +
    • _flags[in] Buffer creation flags.

      • BGFX_BUFFER_NONE - No flags.

      • BGFX_BUFFER_COMPUTE_READ - Buffer will be read from by compute shader.

      • BGFX_BUFFER_COMPUTE_WRITE - Buffer will be written into by compute shader. When buffer is created with BGFX_BUFFER_COMPUTE_WRITE flag it cannot be updated from CPU.

      • @@ -5895,81 +6370,93 @@ otherwise prefer bgfx::setViewScissor.

    +
    Returns
    +

    Dynamic index buffer handle.

    +
    -

    -
    -void bgfx::update(DynamicIndexBufferHandle _handle, uint32_t _startIndex, const Memory *_mem)
    +
    +void bgfx::update(DynamicIndexBufferHandle _handle, uint32_t _startIndex, const Memory *_mem)

    Update dynamic index buffer.

    Attention

    C99 equivalent is bgfx_update_dynamic_index_buffer.

    -
    Parameters
      -
    • [in] _handle: Dynamic index buffer handle.

    • -
    • [in] _startIndex: Start index.

    • -
    • [in] _mem: Index buffer data.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] Dynamic index buffer handle.

    • +
    • _startIndex[in] Start index.

    • +
    • _mem[in] Index buffer data.

    -

    -
    -void bgfx::destroy(DynamicIndexBufferHandle _handle)
    +
    +void bgfx::destroy(DynamicIndexBufferHandle _handle)

    Destroy dynamic index buffer.

    Attention

    C99 equivalent is bgfx_destroy_dynamic_index_buffer.

    -
    Parameters
      -
    • [in] _handle: Dynamic index buffer handle.

    • -
    -

    +
    +
    Parameters
    +

    _handle[in] Dynamic index buffer handle.

    +
    +
    -
    -uint32_t bgfx::getAvailTransientIndexBuffer(uint32_t _num, bool _index32 = false)
    +
    +uint32_t bgfx::getAvailTransientIndexBuffer(uint32_t _num, bool _index32 = false)

    Returns number of requested or maximum available indices.

    Attention

    C99 equivalent is bgfx_get_avail_transient_index_buffer.

    -
    Parameters
      -
    • [in] _num: Number of required indices.

    • -
    • [in] _index32: Set to true if input indices will be 32-bit.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _num[in] Number of required indices.

    • +
    • _index32[in] Set to true if input indices will be 32-bit.

    -

    -
    -void bgfx::allocTransientIndexBuffer(TransientIndexBuffer *_tib, uint32_t _num, bool _index32 = false)
    +
    +void bgfx::allocTransientIndexBuffer(TransientIndexBuffer *_tib, uint32_t _num, bool _index32 = false)

    Allocate transient index buffer.

    Attention

    C99 equivalent is bgfx_alloc_transient_index_buffer.

    -
    Parameters
      -
    • [out] _tib: TransientIndexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.

    • -
    • [in] _num: Number of indices to allocate.

    • -
    • [in] _index32: Set to true if input indices will be 32-bit.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _tib[out] TransientIndexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.

    • +
    • _num[in] Number of indices to allocate.

    • +
    • _index32[in] Set to true if input indices will be 32-bit.

    -

    -
    -
    + +

    Textures

    -
    -struct bgfx::TextureFormat
    +
    +struct bgfx::TextureFormat

    Texture format enum.

    Notation:

      RGBA16S
       ^   ^ ^
    @@ -5991,466 +6478,466 @@ otherwise prefer bgfx::setViewScissor.

    -

    Public Types

    +

    Public Types

    -
    -enum Enum
    +
    +enum Enum

    Texture formats:

    Values:

    -
    -enumerator BC1
    +
    +enumerator BC1

    DXT1 R5G6B5A1.

    -
    -enumerator BC2
    +
    +enumerator BC2

    DXT3 R5G6B5A4.

    -
    -enumerator BC3
    +
    +enumerator BC3

    DXT5 R5G6B5A8.

    -
    -enumerator BC4
    +
    +enumerator BC4

    LATC1/ATI1 R8.

    -
    -enumerator BC5
    +
    +enumerator BC5

    LATC2/ATI2 RG8.

    -
    -enumerator BC6H
    +
    +enumerator BC6H

    BC6H RGB16F.

    -
    -enumerator BC7
    +
    +enumerator BC7

    BC7 RGB 4-7 bits per color channel, 0-8 bits alpha.

    -
    -enumerator ETC1
    +
    +enumerator ETC1

    ETC1 RGB8.

    -
    -enumerator ETC2
    +
    +enumerator ETC2

    ETC2 RGB8.

    -
    -enumerator ETC2A
    +
    +enumerator ETC2A

    ETC2 RGBA8.

    -
    -enumerator ETC2A1
    +
    +enumerator ETC2A1

    ETC2 RGB8A1.

    -
    -enumerator PTC12
    +
    +enumerator PTC12

    PVRTC1 RGB 2BPP.

    -
    -enumerator PTC14
    +
    +enumerator PTC14

    PVRTC1 RGB 4BPP.

    -
    -enumerator PTC12A
    +
    +enumerator PTC12A

    PVRTC1 RGBA 2BPP.

    -
    -enumerator PTC14A
    +
    +enumerator PTC14A

    PVRTC1 RGBA 4BPP.

    -
    -enumerator PTC22
    +
    +enumerator PTC22

    PVRTC2 RGBA 2BPP.

    -
    -enumerator PTC24
    +
    +enumerator PTC24

    PVRTC2 RGBA 4BPP.

    -
    -enumerator ATC
    +
    +enumerator ATC

    ATC RGB 4BPP.

    -
    -enumerator ATCE
    +
    +enumerator ATCE

    ATCE RGBA 8 BPP explicit alpha.

    -
    -enumerator ATCI
    +
    +enumerator ATCI

    ATCI RGBA 8 BPP interpolated alpha.

    -
    -enumerator ASTC4x4
    +
    +enumerator ASTC4x4

    ASTC 4x4 8.0 BPP.

    -
    -enumerator ASTC5x5
    +
    +enumerator ASTC5x5

    ASTC 5x5 5.12 BPP.

    -
    -enumerator ASTC6x6
    +
    +enumerator ASTC6x6

    ASTC 6x6 3.56 BPP.

    -
    -enumerator ASTC8x5
    +
    +enumerator ASTC8x5

    ASTC 8x5 3.20 BPP.

    -
    -enumerator ASTC8x6
    +
    +enumerator ASTC8x6

    ASTC 8x6 2.67 BPP.

    -
    -enumerator ASTC10x5
    +
    +enumerator ASTC10x5

    ASTC 10x5 2.56 BPP.

    -
    -enumerator Unknown
    +
    +enumerator Unknown
    -
    -enumerator R1
    +
    +enumerator R1
    -
    -enumerator A8
    +
    +enumerator A8
    -
    -enumerator R8
    +
    +enumerator R8
    -
    -enumerator R8I
    +
    +enumerator R8I
    -
    -enumerator R8U
    +
    +enumerator R8U
    -
    -enumerator R8S
    +
    +enumerator R8S
    -
    -enumerator R16
    +
    +enumerator R16
    -
    -enumerator R16I
    +
    +enumerator R16I
    -
    -enumerator R16U
    +
    +enumerator R16U
    -
    -enumerator R16F
    +
    +enumerator R16F
    -
    -enumerator R16S
    +
    +enumerator R16S
    -
    -enumerator R32I
    +
    +enumerator R32I
    -
    -enumerator R32U
    +
    +enumerator R32U
    -
    -enumerator R32F
    +
    +enumerator R32F
    -
    -enumerator RG8
    +
    +enumerator RG8
    -
    -enumerator RG8I
    +
    +enumerator RG8I
    -
    -enumerator RG8U
    +
    +enumerator RG8U
    -
    -enumerator RG8S
    +
    +enumerator RG8S
    -
    -enumerator RG16
    +
    +enumerator RG16
    -
    -enumerator RG16I
    +
    +enumerator RG16I
    -
    -enumerator RG16U
    +
    +enumerator RG16U
    -
    -enumerator RG16F
    +
    +enumerator RG16F
    -
    -enumerator RG16S
    +
    +enumerator RG16S
    -
    -enumerator RG32I
    +
    +enumerator RG32I
    -
    -enumerator RG32U
    +
    +enumerator RG32U
    -
    -enumerator RG32F
    +
    +enumerator RG32F
    -
    -enumerator RGB8
    +
    +enumerator RGB8
    -
    -enumerator RGB8I
    +
    +enumerator RGB8I
    -
    -enumerator RGB8U
    +
    +enumerator RGB8U
    -
    -enumerator RGB8S
    +
    +enumerator RGB8S
    -
    -enumerator RGB9E5F
    +
    +enumerator RGB9E5F
    -
    -enumerator BGRA8
    +
    +enumerator BGRA8
    -
    -enumerator RGBA8
    +
    +enumerator RGBA8
    -
    -enumerator RGBA8I
    +
    +enumerator RGBA8I
    -
    -enumerator RGBA8U
    +
    +enumerator RGBA8U
    -
    -enumerator RGBA8S
    +
    +enumerator RGBA8S
    -
    -enumerator RGBA16
    +
    +enumerator RGBA16
    -
    -enumerator RGBA16I
    +
    +enumerator RGBA16I
    -
    -enumerator RGBA16U
    +
    +enumerator RGBA16U
    -
    -enumerator RGBA16F
    +
    +enumerator RGBA16F
    -
    -enumerator RGBA16S
    +
    +enumerator RGBA16S
    -
    -enumerator RGBA32I
    +
    +enumerator RGBA32I
    -
    -enumerator RGBA32U
    +
    +enumerator RGBA32U
    -
    -enumerator RGBA32F
    +
    +enumerator RGBA32F
    -
    -enumerator R5G6B5
    +
    +enumerator R5G6B5
    -
    -enumerator RGBA4
    +
    +enumerator RGBA4
    -
    -enumerator RGB5A1
    +
    +enumerator RGB5A1
    -
    -enumerator RGB10A2
    +
    +enumerator RGB10A2
    -
    -enumerator RG11B10F
    +
    +enumerator RG11B10F
    -
    -enumerator UnknownDepth
    +
    +enumerator UnknownDepth
    -
    -enumerator D16
    +
    +enumerator D16
    -
    -enumerator D24
    +
    +enumerator D24
    -
    -enumerator D24S8
    +
    +enumerator D24S8
    -
    -enumerator D32
    +
    +enumerator D32
    -
    -enumerator D16F
    +
    +enumerator D16F
    -
    -enumerator D24F
    +
    +enumerator D24F
    -
    -enumerator D32F
    +
    +enumerator D32F
    -
    -enumerator D0S8
    +
    +enumerator D0S8
    -
    -enumerator Count
    +
    +enumerator Count
    @@ -6459,29 +6946,33 @@ otherwise prefer bgfx::setViewScissor.

    -
    -bool bgfx::isTextureValid(uint16_t _depth, bool _cubeMap, uint16_t _numLayers, TextureFormat::Enum _format, uint64_t _flags)
    +
    +bool bgfx::isTextureValid(uint16_t _depth, bool _cubeMap, uint16_t _numLayers, TextureFormat::Enum _format, uint64_t _flags)

    Validate texture parameters.

    -
    Return

    True if texture can be successfully created.

    -
    Attention

    C99 equivalent is bgfx_is_texture_valid.

    -
    Parameters
      -
    • [in] _depth: Depth dimension of volume texture.

    • -
    • [in] _cubeMap: Indicates that texture contains cubemap.

    • -
    • [in] _numLayers: Number of layers in texture array.

    • -
    • [in] _format: Texture format. See: TextureFormat::Enum.

    • -
    • [in] _flags: Texture flags. See BGFX_TEXTURE_*.

    • -
    -

    +
    +
    Parameters
    +
      +
    • _depth[in] Depth dimension of volume texture.

    • +
    • _cubeMap[in] Indicates that texture contains cubemap.

    • +
    • _numLayers[in] Number of layers in texture array.

    • +
    • _format[in] Texture format. See: TextureFormat::Enum.

    • +
    • _flags[in] Texture flags. See BGFX_TEXTURE_*.

    • +
    +
    +
    Returns
    +

    True if texture can be successfully created.

    +
    +
    -
    -struct bgfx::TextureInfo
    +
    +struct bgfx::TextureInfo

    Texture info.

    Attention

    C99 equivalent is bgfx_texture_info_t.

    @@ -6489,58 +6980,58 @@ otherwise prefer bgfx::setViewScissor.

    -

    Public Members

    +

    Public Members

    -
    -TextureFormat::Enum format
    +
    +TextureFormat::Enum format

    Texture format.

    -
    -uint32_t storageSize
    +
    +uint32_t storageSize

    Total amount of bytes required to store texture.

    -
    -uint16_t width
    +
    +uint16_t width

    Texture width.

    -
    -uint16_t height
    +
    +uint16_t height

    Texture height.

    -
    -uint16_t depth
    +
    +uint16_t depth

    Texture depth.

    -
    -uint16_t numLayers
    +
    +uint16_t numLayers

    Number of layers in texture array.

    -
    -uint8_t numMips
    +
    +uint8_t numMips

    Number of MIP maps.

    -
    -uint8_t bitsPerPixel
    +
    +uint8_t bitsPerPixel

    Format bits per pixel.

    -
    -bool cubeMap
    +
    +bool cubeMap

    Texture is cubemap.

    @@ -6548,89 +7039,103 @@ otherwise prefer bgfx::setViewScissor.

    -
    -void bgfx::calcTextureSize(TextureInfo &_info, uint16_t _width, uint16_t _height, uint16_t _depth, bool _cubeMap, bool _hasMips, uint16_t _numLayers, TextureFormat::Enum _format)
    +
    +void bgfx::calcTextureSize(TextureInfo &_info, uint16_t _width, uint16_t _height, uint16_t _depth, bool _cubeMap, bool _hasMips, uint16_t _numLayers, TextureFormat::Enum _format)

    Calculate amount of memory required for texture.

    Attention

    C99 equivalent is bgfx_calc_texture_size.

    -
    Parameters
      -
    • [out] _info: Resulting texture info structure. See: TextureInfo.

    • -
    • [in] _width: Width.

    • -
    • [in] _height: Height.

    • -
    • [in] _depth: Depth dimension of volume texture.

    • -
    • [in] _cubeMap: Indicates that texture contains cubemap.

    • -
    • [in] _hasMips: Indicates that texture contains full mip-map chain.

    • -
    • [in] _numLayers: Number of layers in texture array.

    • -
    • [in] _format: Texture format. See: TextureFormat::Enum.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _info[out] Resulting texture info structure. See: TextureInfo.

    • +
    • _width[in] Width.

    • +
    • _height[in] Height.

    • +
    • _depth[in] Depth dimension of volume texture.

    • +
    • _cubeMap[in] Indicates that texture contains cubemap.

    • +
    • _hasMips[in] Indicates that texture contains full mip-map chain.

    • +
    • _numLayers[in] Number of layers in texture array.

    • +
    • _format[in] Texture format. See: TextureFormat::Enum.

    -

    -
    -TextureHandle bgfx::createTexture(const Memory *_mem, uint64_t _flags = BGFX_TEXTURE_NONE | BGFX_SAMPLER_NONE, uint8_t _skip = 0, TextureInfo *_info = NULL)
    +
    +TextureHandle bgfx::createTexture(const Memory *_mem, uint64_t _flags = BGFX_TEXTURE_NONE | BGFX_SAMPLER_NONE, uint8_t _skip = 0, TextureInfo *_info = NULL)

    Create texture from memory buffer.

    -
    Return

    Texture handle.

    -
    Attention

    C99 equivalent is bgfx_create_texture.

    -
    Parameters
      -
    • [in] _mem: DDS, KTX or PVR texture data.

    • -
    • [in] _flags: Texture creation (see BGFX_TEXTURE_*.), and sampler (see BGFX_SAMPLER_*) flags. Default texture sampling mode is linear, and wrap mode is repeat.

        +
    +

    +
    +
    Parameters
    +
      +
    • _mem[in] DDS, KTX or PVR texture data.

    • +
    • _flags[in] Texture creation (see BGFX_TEXTURE_*.), and sampler (see BGFX_SAMPLER_*) flags. Default texture sampling mode is linear, and wrap mode is repeat.

      • BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP] - Mirror or clamp to edge wrap mode.

      • BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC] - Point or anisotropic sampling.

    • -
    • [in] _skip: Skip top level mips when parsing texture.

    • -
    • [out] _info: When non-NULL is specified it returns parsed texture information.

    • +
    • _skip[in] Skip top level mips when parsing texture.

    • +
    • _info[out] When non-NULL is specified it returns parsed texture information.

    +
    Returns
    +

    Texture handle.

    +
    -

    -
    -TextureHandle bgfx::createTexture2D(uint16_t _width, uint16_t _height, bool _hasMips, uint16_t _numLayers, TextureFormat::Enum _format, uint64_t _flags = BGFX_TEXTURE_NONE | BGFX_SAMPLER_NONE, const Memory *_mem = NULL)
    +
    +TextureHandle bgfx::createTexture2D(uint16_t _width, uint16_t _height, bool _hasMips, uint16_t _numLayers, TextureFormat::Enum _format, uint64_t _flags = BGFX_TEXTURE_NONE | BGFX_SAMPLER_NONE, const Memory *_mem = NULL)

    Create 2D texture.

    Attention

    C99 equivalent is bgfx_create_texture_2d.

    -
    Parameters
      -
    • [in] _width: Width.

    • -
    • [in] _height: Height.

    • -
    • [in] _hasMips: Indicates that texture contains full mip-map chain.

    • -
    • [in] _numLayers: Number of layers in texture array. Must be 1 if caps BGFX_CAPS_TEXTURE_2D_ARRAY flag is not set.

    • -
    • [in] _format: Texture format. See: TextureFormat::Enum.

    • -
    • [in] _flags: Texture creation (see BGFX_TEXTURE_*.), and sampler (see BGFX_SAMPLER_*) flags. Default texture sampling mode is linear, and wrap mode is repeat.

        +
    +

    +
    +
    Parameters
    +
      +
    • _width[in] Width.

    • +
    • _height[in] Height.

    • +
    • _hasMips[in] Indicates that texture contains full mip-map chain.

    • +
    • _numLayers[in] Number of layers in texture array. Must be 1 if caps BGFX_CAPS_TEXTURE_2D_ARRAY flag is not set.

    • +
    • _format[in] Texture format. See: TextureFormat::Enum.

    • +
    • _flags[in] Texture creation (see BGFX_TEXTURE_*.), and sampler (see BGFX_SAMPLER_*) flags. Default texture sampling mode is linear, and wrap mode is repeat.

      • BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP] - Mirror or clamp to edge wrap mode.

      • BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC] - Point or anisotropic sampling.

    • -
    • [in] _mem: Texture data. If _mem is non-NULL, created texture will be immutable. If _mem is NULL content of the texture is uninitialized. When _numLayers is more than 1, expected memory layout is texture and all mips together for each array element.

    • +
    • _mem[in] Texture data. If _mem is non-NULL, created texture will be immutable. If _mem is NULL content of the texture is uninitialized. When _numLayers is more than 1, expected memory layout is texture and all mips together for each array element.

    -

    -
    -TextureHandle bgfx::createTexture2D(BackbufferRatio::Enum _ratio, bool _hasMips, uint16_t _numLayers, TextureFormat::Enum _format, uint64_t _flags = BGFX_TEXTURE_NONE | BGFX_SAMPLER_NONE)
    +
    +TextureHandle bgfx::createTexture2D(BackbufferRatio::Enum _ratio, bool _hasMips, uint16_t _numLayers, TextureFormat::Enum _format, uint64_t _flags = BGFX_TEXTURE_NONE | BGFX_SAMPLER_NONE)

    Create texture with size based on backbuffer ratio. Texture will maintain ratio if back buffer resolution changes.

    Attention

    C99 equivalent is bgfx_create_texture_2d_scaled.

    -
    Parameters
      -
    • [in] _ratio: Frame buffer size in respect to back-buffer size. See: BackbufferRatio::Enum.

    • -
    • [in] _hasMips: Indicates that texture contains full mip-map chain.

    • -
    • [in] _numLayers: Number of layers in texture array. Must be 1 if caps BGFX_CAPS_TEXTURE_2D_ARRAY flag is not set.

    • -
    • [in] _format: Texture format. See: TextureFormat::Enum.

    • -
    • [in] _flags: Texture creation (see BGFX_TEXTURE_*.), and sampler (see BGFX_SAMPLER_*) flags. Default texture sampling mode is linear, and wrap mode is repeat.

        +
    +

    +
    +
    Parameters
    +
      +
    • _ratio[in] Frame buffer size in respect to back-buffer size. See: BackbufferRatio::Enum.

    • +
    • _hasMips[in] Indicates that texture contains full mip-map chain.

    • +
    • _numLayers[in] Number of layers in texture array. Must be 1 if caps BGFX_CAPS_TEXTURE_2D_ARRAY flag is not set.

    • +
    • _format[in] Texture format. See: TextureFormat::Enum.

    • +
    • _flags[in] Texture creation (see BGFX_TEXTURE_*.), and sampler (see BGFX_SAMPLER_*) flags. Default texture sampling mode is linear, and wrap mode is repeat.

      • BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP] - Mirror or clamp to edge wrap mode.

      • BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC] - Point or anisotropic sampling.

      @@ -6638,121 +7143,136 @@ otherwise prefer bgfx::setViewScissor.

    -

    -
    -void bgfx::updateTexture2D(TextureHandle _handle, uint16_t _layer, uint8_t _mip, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height, const Memory *_mem, uint16_t _pitch = UINT16_MAX)
    +
    +void bgfx::updateTexture2D(TextureHandle _handle, uint16_t _layer, uint8_t _mip, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height, const Memory *_mem, uint16_t _pitch = UINT16_MAX)

    Update 2D texture.

    Attention

    It’s valid to update only mutable texture. See bgfx::createTexture2D for more info.

    Attention

    C99 equivalent is bgfx_update_texture_2d.

    -
    Parameters
      -
    • [in] _handle: Texture handle.

    • -
    • [in] _layer: Layers in texture array.

    • -
    • [in] _mip: Mip level.

    • -
    • [in] _x: X offset in texture.

    • -
    • [in] _y: Y offset in texture.

    • -
    • [in] _width: Width of texture block.

    • -
    • [in] _height: Height of texture block.

    • -
    • [in] _mem: Texture update data.

    • -
    • [in] _pitch: Pitch of input image (bytes). When _pitch is set to UINT16_MAX, it will be calculated internally based on _width.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] Texture handle.

    • +
    • _layer[in] Layers in texture array.

    • +
    • _mip[in] Mip level.

    • +
    • _x[in] X offset in texture.

    • +
    • _y[in] Y offset in texture.

    • +
    • _width[in] Width of texture block.

    • +
    • _height[in] Height of texture block.

    • +
    • _mem[in] Texture update data.

    • +
    • _pitch[in] Pitch of input image (bytes). When _pitch is set to UINT16_MAX, it will be calculated internally based on _width.

    -

    -
    -TextureHandle bgfx::createTexture3D(uint16_t _width, uint16_t _height, uint16_t _depth, bool _hasMips, TextureFormat::Enum _format, uint64_t _flags = BGFX_TEXTURE_NONE | BGFX_SAMPLER_NONE, const Memory *_mem = NULL)
    +
    +TextureHandle bgfx::createTexture3D(uint16_t _width, uint16_t _height, uint16_t _depth, bool _hasMips, TextureFormat::Enum _format, uint64_t _flags = BGFX_TEXTURE_NONE | BGFX_SAMPLER_NONE, const Memory *_mem = NULL)

    Create 3D texture.

    Attention

    C99 equivalent is bgfx_create_texture_3d.

    -
    Parameters
      -
    • [in] _width: Width.

    • -
    • [in] _height: Height.

    • -
    • [in] _depth: Depth.

    • -
    • [in] _hasMips: Indicates that texture contains full mip-map chain.

    • -
    • [in] _format: Texture format. See: TextureFormat::Enum.

    • -
    • [in] _flags: Texture creation (see BGFX_TEXTURE_*.), and sampler (see BGFX_SAMPLER_*) flags. Default texture sampling mode is linear, and wrap mode is repeat.

        +
    +

    +
    +
    Parameters
    +
      +
    • _width[in] Width.

    • +
    • _height[in] Height.

    • +
    • _depth[in] Depth.

    • +
    • _hasMips[in] Indicates that texture contains full mip-map chain.

    • +
    • _format[in] Texture format. See: TextureFormat::Enum.

    • +
    • _flags[in] Texture creation (see BGFX_TEXTURE_*.), and sampler (see BGFX_SAMPLER_*) flags. Default texture sampling mode is linear, and wrap mode is repeat.

      • BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP] - Mirror or clamp to edge wrap mode.

      • BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC] - Point or anisotropic sampling.

    • -
    • [in] _mem: Texture data. If _mem is non-NULL, created texture will be immutable. If _mem is NULL content of the texture is uninitialized.

    • +
    • _mem[in] Texture data. If _mem is non-NULL, created texture will be immutable. If _mem is NULL content of the texture is uninitialized.

    -

    -
    -void bgfx::updateTexture3D(TextureHandle _handle, uint8_t _mip, uint16_t _x, uint16_t _y, uint16_t _z, uint16_t _width, uint16_t _height, uint16_t _depth, const Memory *_mem)
    +
    +void bgfx::updateTexture3D(TextureHandle _handle, uint8_t _mip, uint16_t _x, uint16_t _y, uint16_t _z, uint16_t _width, uint16_t _height, uint16_t _depth, const Memory *_mem)

    Update 3D texture.

    Attention

    It’s valid to update only mutable texture. See bgfx::createTexture3D for more info.

    Attention

    C99 equivalent is bgfx_update_texture_3d.

    -
    Parameters
      -
    • [in] _handle: Texture handle.

    • -
    • [in] _mip: Mip level.

    • -
    • [in] _x: X offset in texture.

    • -
    • [in] _y: Y offset in texture.

    • -
    • [in] _z: Z offset in texture.

    • -
    • [in] _width: Width of texture block.

    • -
    • [in] _height: Height of texture block.

    • -
    • [in] _depth: Depth of texture block.

    • -
    • [in] _mem: Texture update data.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] Texture handle.

    • +
    • _mip[in] Mip level.

    • +
    • _x[in] X offset in texture.

    • +
    • _y[in] Y offset in texture.

    • +
    • _z[in] Z offset in texture.

    • +
    • _width[in] Width of texture block.

    • +
    • _height[in] Height of texture block.

    • +
    • _depth[in] Depth of texture block.

    • +
    • _mem[in] Texture update data.

    -

    -
    -TextureHandle bgfx::createTextureCube(uint16_t _size, bool _hasMips, uint16_t _numLayers, TextureFormat::Enum _format, uint64_t _flags = BGFX_TEXTURE_NONE | BGFX_SAMPLER_NONE, const Memory *_mem = NULL)
    +
    +TextureHandle bgfx::createTextureCube(uint16_t _size, bool _hasMips, uint16_t _numLayers, TextureFormat::Enum _format, uint64_t _flags = BGFX_TEXTURE_NONE | BGFX_SAMPLER_NONE, const Memory *_mem = NULL)

    Create Cube texture.

    Attention

    C99 equivalent is bgfx_create_texture_cube.

    -
    Parameters
      -
    • [in] _size: Cube side size.

    • -
    • [in] _hasMips: Indicates that texture contains full mip-map chain.

    • -
    • [in] _numLayers: Number of layers in texture array. Must be 1 if caps BGFX_CAPS_TEXTURE_CUBE_ARRAY flag is not set.

    • -
    • [in] _format: Texture format. See: TextureFormat::Enum.

    • -
    • [in] _flags: Texture creation (see BGFX_TEXTURE_*.), and sampler (see BGFX_SAMPLER_*) flags. Default texture sampling mode is linear, and wrap mode is repeat.

        +
    +

    +
    +
    Parameters
    +
      +
    • _size[in] Cube side size.

    • +
    • _hasMips[in] Indicates that texture contains full mip-map chain.

    • +
    • _numLayers[in] Number of layers in texture array. Must be 1 if caps BGFX_CAPS_TEXTURE_CUBE_ARRAY flag is not set.

    • +
    • _format[in] Texture format. See: TextureFormat::Enum.

    • +
    • _flags[in] Texture creation (see BGFX_TEXTURE_*.), and sampler (see BGFX_SAMPLER_*) flags. Default texture sampling mode is linear, and wrap mode is repeat.

      • BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP] - Mirror or clamp to edge wrap mode.

      • BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC] - Point or anisotropic sampling.

    • -
    • [in] _mem: Texture data. If _mem is non-NULL, created texture will be immutable. If _mem is NULL content of the texture is uninitialized. When _numLayers is more than 1, expected memory layout is texture and all mips together for each array element.

    • +
    • _mem[in] Texture data. If _mem is non-NULL, created texture will be immutable. If _mem is NULL content of the texture is uninitialized. When _numLayers is more than 1, expected memory layout is texture and all mips together for each array element.

    -

    -
    -void bgfx::updateTextureCube(TextureHandle _handle, uint16_t _layer, uint8_t _side, uint8_t _mip, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height, const Memory *_mem, uint16_t _pitch = UINT16_MAX)
    +
    +void bgfx::updateTextureCube(TextureHandle _handle, uint16_t _layer, uint8_t _side, uint8_t _mip, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height, const Memory *_mem, uint16_t _pitch = UINT16_MAX)

    Update Cube texture.

    Attention

    It’s valid to update only mutable texture. See bgfx::createTextureCube for more info.

    Attention

    C99 equivalent is bgfx_update_texture_cube.

    -
    Parameters
      -
    • [in] _handle: Texture handle.

    • -
    • [in] _layer: Layers in texture array.

    • -
    • [in] _side: Cubemap side BGFX_CUBE_MAP_<POSITIVE or NEGATIVE>_<X, Y or Z>, where 0 is +X, 1 is -X, 2 is +Y, 3 is -Y, 4 is +Z, and 5 is -Z.

                 +----------+
      +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] Texture handle.

    • +
    • _layer[in] Layers in texture array.

    • +
    • _side[in] Cubemap side BGFX_CUBE_MAP_<POSITIVE or NEGATIVE>_<X, Y or Z>, where 0 is +X, 1 is -X, 2 is +Y, 3 is -Y, 4 is +Z, and 5 is -Z.

                 +----------+
                  |-z       2|
                  | ^  +y    |
                  | |        |    Unfolded cube:
      @@ -6771,171 +7291,193 @@ otherwise prefer bgfx::setViewScissor.

    • -
    • [in] _mip: Mip level.

    • -
    • [in] _x: X offset in texture.

    • -
    • [in] _y: Y offset in texture.

    • -
    • [in] _width: Width of texture block.

    • -
    • [in] _height: Height of texture block.

    • -
    • [in] _mem: Texture update data.

    • -
    • [in] _pitch: Pitch of input image (bytes). When _pitch is set to UINT16_MAX, it will be calculated internally based on _width.

    • +
    • _mip[in] Mip level.

    • +
    • _x[in] X offset in texture.

    • +
    • _y[in] Y offset in texture.

    • +
    • _width[in] Width of texture block.

    • +
    • _height[in] Height of texture block.

    • +
    • _mem[in] Texture update data.

    • +
    • _pitch[in] Pitch of input image (bytes). When _pitch is set to UINT16_MAX, it will be calculated internally based on _width.

    -

    -
    -uint32_t bgfx::readTexture(TextureHandle _handle, void *_data, uint8_t _mip = 0)
    +
    +uint32_t bgfx::readTexture(TextureHandle _handle, void *_data, uint8_t _mip = 0)

    Read back texture content.

    -
    Return

    Frame number when the result will be available. See: bgfx::frame.

    -
    Attention

    Texture must be created with BGFX_TEXTURE_READ_BACK flag.

    Attention

    Availability depends on: BGFX_CAPS_TEXTURE_READ_BACK.

    Attention

    C99 equivalent is bgfx_read_texture.

    -
    Parameters
      -
    • [in] _handle: Texture handle.

    • -
    • [in] _data: Destination buffer.

    • -
    • [in] _mip: Mip level.

    • -
    -

    +
    +
    Parameters
    +
      +
    • _handle[in] Texture handle.

    • +
    • _data[in] Destination buffer.

    • +
    • _mip[in] Mip level.

    • +
    +
    +
    Returns
    +

    Frame number when the result will be available. See: bgfx::frame.

    +
    +
    -
    -void *bgfx::getDirectAccessPtr(TextureHandle _handle)
    +
    +void *bgfx::getDirectAccessPtr(TextureHandle _handle)

    Returns texture direct access pointer.

    -
    Return

    Pointer to texture memory. If returned pointer is NULL direct access is not available for this texture. If pointer is UINTPTR_MAX sentinel value it means texture is pending creation. Pointer returned can be cached and it will be valid until texture is destroyed.

    -
    Attention

    Availability depends on: BGFX_CAPS_TEXTURE_DIRECT_ACCESS. This feature is available on GPUs that have unified memory architecture (UMA) support.

    Attention

    C99 equivalent is bgfx_get_direct_access_ptr.

    -
    Parameters
      -
    • [in] _handle: Texture handle.

    • -
    -

    +
    +
    Parameters
    +

    _handle[in] Texture handle.

    +
    +
    Returns
    +

    Pointer to texture memory. If returned pointer is NULL direct access is not available for this texture. If pointer is UINTPTR_MAX sentinel value it means texture is pending creation. Pointer returned can be cached and it will be valid until texture is destroyed.

    +
    +
    -
    -void bgfx::destroy(TextureHandle _handle)
    +
    +void bgfx::destroy(TextureHandle _handle)

    Destroy texture.

    Attention

    C99 equivalent is bgfx_destroy_texture.

    -
    Parameters
      -
    • [in] _handle: Texture handle.

    • -
    -

    +
    +
    Parameters
    +

    _handle[in] Texture handle.

    +
    +
    -
    -
    +
    +

    Frame Buffers

    -
    -FrameBufferHandle bgfx::createFrameBuffer(uint16_t _width, uint16_t _height, TextureFormat::Enum _format, uint64_t _textureFlags = BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP)
    +
    +FrameBufferHandle bgfx::createFrameBuffer(uint16_t _width, uint16_t _height, TextureFormat::Enum _format, uint64_t _textureFlags = BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP)

    Create frame buffer (simple).

    -
    Return

    Handle to frame buffer object.

    -
    Attention

    C99 equivalent is bgfx_create_frame_buffer.

    -
    Parameters
      -
    • [in] _width: Texture width.

    • -
    • [in] _height: Texture height.

    • -
    • [in] _format: Texture format. See: TextureFormat::Enum.

    • -
    • [in] _textureFlags: Default texture sampling mode is linear, and wrap mode is repeat.

        +
    +

    +
    +
    Parameters
    +
      +
    • _width[in] Texture width.

    • +
    • _height[in] Texture height.

    • +
    • _format[in] Texture format. See: TextureFormat::Enum.

    • +
    • _textureFlags[in] Default texture sampling mode is linear, and wrap mode is repeat.

      • BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP] - Mirror or clamp to edge wrap mode.

      • BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC] - Point or anisotropic sampling.

    +
    Returns
    +

    Handle to frame buffer object.

    +
    -

    -
    -FrameBufferHandle bgfx::createFrameBuffer(BackbufferRatio::Enum _ratio, TextureFormat::Enum _format, uint64_t _textureFlags = BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP)
    +
    +FrameBufferHandle bgfx::createFrameBuffer(BackbufferRatio::Enum _ratio, TextureFormat::Enum _format, uint64_t _textureFlags = BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP)

    Create frame buffer with size based on backbuffer ratio. Frame buffer will maintain ratio if back buffer resolution changes.

    -
    Return

    Handle to frame buffer object.

    -
    Attention

    C99 equivalent is bgfx_create_frame_buffer_scaled.

    -
    Parameters
      -
    • [in] _ratio: Frame buffer size in respect to back-buffer size. See: BackbufferRatio::Enum.

    • -
    • [in] _format: Texture format. See: TextureFormat::Enum.

    • -
    • [in] _textureFlags: Default texture sampling mode is linear, and wrap mode is repeat.

        +
    +

    +
    +
    Parameters
    +
      +
    • _ratio[in] Frame buffer size in respect to back-buffer size. See: BackbufferRatio::Enum.

    • +
    • _format[in] Texture format. See: TextureFormat::Enum.

    • +
    • _textureFlags[in] Default texture sampling mode is linear, and wrap mode is repeat.

      • BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP] - Mirror or clamp to edge wrap mode.

      • BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC] - Point or anisotropic sampling.

    +
    Returns
    +

    Handle to frame buffer object.

    +
    -

    -
    -FrameBufferHandle bgfx::createFrameBuffer(uint8_t _num, const TextureHandle *_handles, bool _destroyTextures = false)
    +
    +FrameBufferHandle bgfx::createFrameBuffer(uint8_t _num, const TextureHandle *_handles, bool _destroyTextures = false)

    Create MRT frame buffer from texture handles (simple).

    -
    Return

    Handle to frame buffer object.

    -
    Attention

    C99 equivalent is bgfx_create_frame_buffer_from_handles.

    -
    Parameters
      -
    • [in] _num: Number of texture attachments.

    • -
    • [in] _handles: Texture attachments.

    • -
    • [in] _destroyTextures: If true, textures will be destroyed when frame buffer is destroyed.

    • -
    -

    +
    +
    Parameters
    +
      +
    • _num[in] Number of texture attachments.

    • +
    • _handles[in] Texture attachments.

    • +
    • _destroyTextures[in] If true, textures will be destroyed when frame buffer is destroyed.

    • +
    +
    +
    Returns
    +

    Handle to frame buffer object.

    +
    +
    -
    -FrameBufferHandle bgfx::createFrameBuffer(void *_nwh, uint16_t _width, uint16_t _height, TextureFormat::Enum _format = TextureFormat::Count, TextureFormat::Enum _depthFormat = TextureFormat::Count)
    +
    +FrameBufferHandle bgfx::createFrameBuffer(void *_nwh, uint16_t _width, uint16_t _height, TextureFormat::Enum _format = TextureFormat::Count, TextureFormat::Enum _depthFormat = TextureFormat::Count)

    Create frame buffer for multiple window rendering.

    -
    Return

    Handle to frame buffer object.

    -
    Remark

    Frame buffer cannot be used for sampling.

    Attention

    C99 equivalent is bgfx_create_frame_buffer_from_nwh.

    -
    Parameters
      -
    • [in] _nwh: OS’ target native window handle.

    • -
    • [in] _width: Window back buffer width.

    • -
    • [in] _height: Window back buffer height.

    • -
    • [in] _format: Window back buffer color format.

    • -
    • [in] _depthFormat: Window back buffer depth format.

    • -
    -

    +
    +
    Parameters
    +
      +
    • _nwh[in] OS’ target native window handle.

    • +
    • _width[in] Window back buffer width.

    • +
    • _height[in] Window back buffer height.

    • +
    • _format[in] Window back buffer color format.

    • +
    • _depthFormat[in] Window back buffer depth format.

    • +
    +
    +
    Returns
    +

    Handle to frame buffer object.

    +
    +
    -
    -struct bgfx::Attachment
    +
    +struct bgfx::Attachment

    Frame buffer texture attachment info.

    Attention

    C99 equivalent is bgfx_attachment_t.

    @@ -6943,61 +7485,61 @@ otherwise prefer bgfx::setViewScissor.

    -

    Public Functions

    +

    Public Functions

    -
    -void init(TextureHandle _handle, Access::Enum _access = Access::Write, uint16_t _layer = 0, uint16_t _numLayers = 1, uint16_t _mip = 0, uint8_t _resolve = BGFX_RESOLVE_AUTO_GEN_MIPS)
    +
    +void init(TextureHandle _handle, Access::Enum _access = Access::Write, uint16_t _layer = 0, uint16_t _numLayers = 1, uint16_t _mip = 0, uint8_t _resolve = BGFX_RESOLVE_AUTO_GEN_MIPS)

    Init attachment.

    -

    -
    Parameters
      -
    • [in] _handle: Render target texture handle.

    • -
    • [in] _access: Access. See Access::Enum.

    • -
    • [in] _layer: Cubemap side or depth layer/slice to use.

    • -
    • [in] _numLayers: Number of texture layer/slice(s) in array to use.

    • -
    • [in] _mip: Mip level.

    • -
    • [in] _resolve: Resolve flags. See: BGFX_RESOLVE_*

    • +
      +
      Parameters
      +
        +
      • _handle[in] Render target texture handle.

      • +
      • _access[in] Access. See Access::Enum.

      • +
      • _layer[in] Cubemap side or depth layer/slice to use.

      • +
      • _numLayers[in] Number of texture layer/slice(s) in array to use.

      • +
      • _mip[in] Mip level.

      • +
      • _resolve[in] Resolve flags. See: BGFX_RESOLVE_*

      -

    -

    Public Members

    +

    Public Members

    -
    -Access::Enum access
    +
    +Access::Enum access

    Attachment access. See Access::Enum.

    -
    -TextureHandle handle
    +
    +TextureHandle handle

    Render target texture handle.

    -
    -uint16_t mip
    +
    +uint16_t mip

    Mip level.

    -
    -uint16_t layer
    +
    +uint16_t layer

    Cubemap side or depth layer/slice to use.

    -
    -uint16_t numLayers
    +
    +uint16_t numLayers

    Number of texture layer/slice(s) in array to use.

    -
    -uint8_t resolve
    +
    +uint8_t resolve

    Resolve flags. See: BGFX_RESOLVE_*

    @@ -7005,164 +7547,188 @@ otherwise prefer bgfx::setViewScissor.

    -
    -FrameBufferHandle bgfx::createFrameBuffer(uint8_t _num, const Attachment *_attachment, bool _destroyTextures = false)
    +
    +FrameBufferHandle bgfx::createFrameBuffer(uint8_t _num, const Attachment *_attachment, bool _destroyTextures = false)

    Create MRT frame buffer from texture handles with specific layer and mip level.

    -
    Return

    Handle to frame buffer object.

    -
    Attention

    C99 equivalent is bgfx_create_frame_buffer_from_attachment.

    -
    Parameters
      -
    • [in] _num: Number of texture attachments.

    • -
    • [in] _attachment: Attachment texture info. See: bgfx::Attachment.

    • -
    • [in] _destroyTextures: If true, textures will be destroyed when frame buffer is destroyed.

    • -
    -

    +
    +
    Parameters
    +
      +
    • _num[in] Number of texture attachments.

    • +
    • _attachment[in] Attachment texture info. See: bgfx::Attachment.

    • +
    • _destroyTextures[in] If true, textures will be destroyed when frame buffer is destroyed.

    • +
    +
    +
    Returns
    +

    Handle to frame buffer object.

    +
    +
    -
    -TextureHandle bgfx::getTexture(FrameBufferHandle _handle, uint8_t _attachment = 0)
    +
    +TextureHandle bgfx::getTexture(FrameBufferHandle _handle, uint8_t _attachment = 0)

    Obtain texture handle of frame buffer attachment.

    -
    Return

    Returns invalid texture handle if attachment index is not correct, or frame buffer is created with native window handle.

    -
    Attention

    C99 equivalent is bgfx_get_texture.

    -
    Parameters
      -
    • [in] _handle: Frame buffer handle.

    • -
    • [in] _attachment: Frame buffer attachment index.

    • -
    -

    +
    +
    Parameters
    +
      +
    • _handle[in] Frame buffer handle.

    • +
    • _attachment[in] Frame buffer attachment index.

    • +
    +
    +
    Returns
    +

    Returns invalid texture handle if attachment index is not correct, or frame buffer is created with native window handle.

    +
    +
    -
    -void bgfx::setName(FrameBufferHandle _handle, const char *_name, int32_t _len = INT32_MAX)
    +
    +void bgfx::setName(FrameBufferHandle _handle, const char *_name, int32_t _len = INT32_MAX)

    Set frame buffer debug name.

    Attention

    C99 equivalent is bgfx_set_frame_buffer_name.

    -
    Parameters
      -
    • [in] _handle: frame buffer handle.

    • -
    • [in] _name: frame buffer name.

    • -
    • [in] _len: frame buffer name length (if length is INT32_MAX, it’s expected that _name is zero terminated string.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _handle[in] frame buffer handle.

    • +
    • _name[in] frame buffer name.

    • +
    • _len[in] frame buffer name length (if length is INT32_MAX, it’s expected that _name is zero terminated string.

    -

    -
    -void bgfx::destroy(FrameBufferHandle _handle)
    +
    +void bgfx::destroy(FrameBufferHandle _handle)

    Destroy frame buffer.

    Attention

    C99 equivalent is bgfx_destroy_frame_buffer.

    -
    Parameters
      -
    • [in] _handle: Frame buffer handle.

    • -
    -

    +
    +
    Parameters
    +

    _handle[in] Frame buffer handle.

    +
    +
    -
    -
    + +

    Instance Buffer

    -
    -uint32_t bgfx::getAvailInstanceDataBuffer(uint32_t _num, uint16_t _stride)
    +
    +uint32_t bgfx::getAvailInstanceDataBuffer(uint32_t _num, uint16_t _stride)

    Returns number of requested or maximum available instance buffer slots.

    Attention

    C99 equivalent is bgfx_get_avail_instance_data_buffer.

    -
    Parameters
      -
    • [in] _num: Number of required instances.

    • -
    • [in] _stride: Stride per instance.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _num[in] Number of required instances.

    • +
    • _stride[in] Stride per instance.

    -

    -
    -void bgfx::allocInstanceDataBuffer(InstanceDataBuffer *_idb, uint32_t _num, uint16_t _stride)
    +
    +void bgfx::allocInstanceDataBuffer(InstanceDataBuffer *_idb, uint32_t _num, uint16_t _stride)

    Allocate instance data buffer.

    Attention

    C99 equivalent is bgfx_alloc_instance_data_buffer.

    -
    Parameters
      -
    • [out] _idb: InstanceDataBuffer structure is filled and is valid for duration of frame, and it can be reused for multiple draw calls.

    • -
    • [in] _num: Number of instances.

    • -
    • [in] _stride: Instance stride. Must be multiple of 16.

    • +
    +

    +
    +
    Parameters
    +
      +
    • _idb[out] InstanceDataBuffer structure is filled and is valid for duration of frame, and it can be reused for multiple draw calls.

    • +
    • _num[in] Number of instances.

    • +
    • _stride[in] Instance stride. Must be multiple of 16.

    -

    -
    -
    + +

    Indirect Buffer

    -
    -IndirectBufferHandle bgfx::createIndirectBuffer(uint32_t _num)
    +
    +IndirectBufferHandle bgfx::createIndirectBuffer(uint32_t _num)

    Create draw indirect buffer.

    -
    Return

    Indirect buffer handle.

    -
    Attention

    C99 equivalent is bgfx_create_indirect_buffer.

    -
    Parameters
      -
    • [in] _num: Number of indirect calls.

    • -
    -

    +
    +
    Parameters
    +

    _num[in] Number of indirect calls.

    +
    +
    Returns
    +

    Indirect buffer handle.

    +
    +
    -
    -void bgfx::destroy(IndirectBufferHandle _handle)
    +
    +void bgfx::destroy(IndirectBufferHandle _handle)

    Destroy draw indirect buffer.

    Attention

    C99 equivalent is bgfx_destroy_indirect_buffer.

    -
    Parameters
      -
    • [in] _handle: Indirect buffer handle.

    • -
    -

    +
    +
    Parameters
    +

    _handle[in] Indirect buffer handle.

    +
    +
    -
    -
    + +

    Occlusion Query

    -
    -OcclusionQueryHandle bgfx::createOcclusionQuery()
    +
    +OcclusionQueryHandle bgfx::createOcclusionQuery()

    Create occlusion query.

    -
    Return

    Handle to occlusion query object.

    -
    Attention

    C99 equivalent is bgfx_create_occlusion_query.

    +
    +
    Returns
    +

    Handle to occlusion query object.

    +
    +
    -
    -struct bgfx::OcclusionQueryResult
    +
    +struct bgfx::OcclusionQueryResult

    Occlusion query result.

    Attention

    C99 equivalent is bgfx_occlusion_query_result_t.

    @@ -7170,33 +7736,33 @@ otherwise prefer bgfx::setViewScissor.

    -

    Public Types

    +

    Public Types

    -
    -enum Enum
    +
    +enum Enum

    Occlusion query results:

    Values:

    -
    -enumerator Invisible
    +
    +enumerator Invisible

    Query failed test.

    -
    -enumerator Visible
    +
    +enumerator Visible

    Query passed test.

    -
    -enumerator NoResult
    +
    +enumerator NoResult

    Query result is not available yet.

    -
    -enumerator Count
    +
    +enumerator Count
    @@ -7205,70 +7771,67 @@ otherwise prefer bgfx::setViewScissor.

    -
    -OcclusionQueryResult::Enum bgfx::getResult(OcclusionQueryHandle _handle, int32_t *_result = NULL)
    +
    +OcclusionQueryResult::Enum bgfx::getResult(OcclusionQueryHandle _handle, int32_t *_result = NULL)

    Retrieve occlusion query result from previous frame.

    -
    Return

    Occlusion query result.

    -
    Attention

    C99 equivalent is bgfx_get_result.

    -
    Parameters
      -
    • [in] _handle: Handle to occlusion query object.

    • -
    • [out] _result: Number of pixels that passed test. This argument can be NULL if result of occlusion query is not needed.

    • -
    -

    +
    +
    Parameters
    +
      +
    • _handle[in] Handle to occlusion query object.

    • +
    • _result[out] Number of pixels that passed test. This argument can be NULL if result of occlusion query is not needed.

    • +
    +
    +
    Returns
    +

    Occlusion query result.

    +
    +
    -
    -void bgfx::destroy(OcclusionQueryHandle _handle)
    +
    +void bgfx::destroy(OcclusionQueryHandle _handle)

    Destroy occlusion query.

    Attention

    C99 equivalent is bgfx_destroy_occlusion_query.

    -
    Parameters
      -
    • [in] _handle: Handle to occlusion query object.

    • -
    -

    +
    +
    Parameters
    +

    _handle[in] Handle to occlusion query object.

    +
    +
    -
    - - + + +
    - -

    - - © Copyright 2010-2020, Branimir Karadžić + © Copyright 2010-2020, Branimir Karadžić.

    - diff --git a/build.html b/build.html index b839f67cc..70e4d678a 100644 --- a/build.html +++ b/build.html @@ -3,9 +3,10 @@ - - - + + + + Building — bgfx 1.0 documentation @@ -13,23 +14,28 @@ + + + + + + - @@ -51,7 +57,7 @@ - bgfx + bgfx @@ -157,6 +163,8 @@ + +
    - -
    + +

    Linux

    sudo apt-get install libgl1-mesa-dev x11proto-core-dev libx11-dev
     
    -
    -
    + +

    Windows

    Windows users download GnuWin32 utilities:

    @@ -256,14 +264,14 @@
  • http://gnuwin32.sourceforge.net/packages/libintl.htm

  • - - -
    + + +

    Build

    bgfx uses GENie - Project generator tool to generate project files for various platform. Binaries for Linux, OSX, and Windows are included in bx repository.

    -
    +

    General

    cd bgfx
     make
    @@ -280,8 +288,8 @@ directory structure. Deleting .build directory at any time is safe.

    android-release, etc.
    -
    -
    +
    +

    Windows

    Visual Studio 2017 command line:

    make vs2017-release64
    @@ -291,8 +299,8 @@ directory structure. Deleting .build directory at any time is safe.

    start .build/projects/vs2017/bgfx.sln
     
    -
    -
    +
    +

    Xcode

    Xcode command line:

    make osx-release
    @@ -314,14 +322,14 @@ configuration file, it has to be set manually for each example project:

  • Check “Use custom working directory” and enter following path: ${PROJECT_DIR}/../../../examples/runtime.

  • -
    -
    +
    +

    Linux

    make linux-release64
     
    -
    -
    + +

    WinRT / UWP

    ..\bx\tools\bin\windows\genie --vs=winstore100 vs2017
     
    @@ -331,9 +339,9 @@ configuration file, it has to be set manually for each example project:

    Note

    Shaders will need to be compiled with the appropriate target profile for your platform.

    -
    - -
    + + +

    Amalgamated Build

    For ease of integration to other build system bgfx library can be built with single .cpp file. It’s only necessary to build @@ -341,15 +349,15 @@ with single .cpp file. It’s only necessary to build (for OSX/iOS use src/amalgamated.mm instead) inside different build system.

    -
    -
    + +

    Tools

    To build bgfx project files for tools, use --with-tools option:

    ..\bx\tools\bin\windows\genie --with-tools vs2017
     
    -
    -
    + +

    Alternative build systems

    CMake

    @@ -365,44 +373,36 @@ instead) inside different build system.

    https://github.com/floooh/fips#fips

    Conan package https://github.com/firefalcom/bgfx-conan

    -
    -
    + +

    Minimal example without bgfx’ example harness

    This project demonstrates minimal amount of code needed to integrate bgfx with GLFW, but without any of existing bgfx example harness. It also demonstrates how to build bgfx with alternative build system.

    https://github.com/jpcy/bgfx-minimal-example

    -
    - + +
    - -

    - - © Copyright 2010-2020, Branimir Karadžić + © Copyright 2010-2020, Branimir Karadžić.

    - diff --git a/examples.html b/examples.html index 822d91301..1d3502de4 100644 --- a/examples.html +++ b/examples.html @@ -3,9 +3,10 @@ - - - + + + + Examples — bgfx 1.0 documentation @@ -13,23 +14,28 @@ + + + + + + - @@ -51,7 +57,7 @@ - bgfx + bgfx @@ -186,6 +192,8 @@ + +
      @@ -197,7 +205,7 @@
    • - +
    • @@ -209,28 +217,28 @@
      -
      +

      Examples

      Most of the examples require shader/texture/mesh data to be loaded. When running examples your current directory should be examples/runtime.

      <bgfx_path>/examples/runtime $ ../../.build/<config>/bin/example-00-helloworldDebug
       
      -
      +

      00-helloworld

      Initialization and debug text.

      -
      +
      example-00-helloworld -
      -
      -
      + +
      +

      01-cubes

      Rendering simple static mesh.

      -
      +
      example-01-cubes -
      -
      -
      + + +

      02-metaballs

      Rendering with transient buffers and embedding shaders.

      @@ -322,101 +330,101 @@ running examples your current directory should be examples/runtime.

      }; }; -
      -
      +
      +

      03-raymarch

      Updating shader uniforms.

      -
      +
      example-03-raymarch -
      -
      -
      + + +

      04-mesh

      Loading meshes.

      -
      +
      example-04-mesh -
      -
      -
      + + +

      05-instancing

      Geometry instancing.

      -
      +
      example-05-instancing -
      -
      -
      + + +

      06-bump

      Loading textures.

      -
      +
      example-06-bump -
      -
      -
      + + +

      07-callback

      Implementing application specific callbacks for taking screen shots, caching OpenGL binary shaders, and video capture.

      -
      -
      + +

      08-update

      Updating textures.

      -
      -
      + +

      09-hdr

      Using multiple views with frame buffers, and view order remapping.

      -
      +
      example-09-hdr -
      -
      -
      + + +

      10-font

      Use the font system to display text and styled text.

      -
      +
      example-10-font -
      -
      -
      + + +

      11-fontsdf

      Use a single distance field font to render text of various size.

      -
      +
      example-11-fontsdf -
      -
      -
      + + +

      12-lod

      Mesh LOD transitions.

      -
      +
      example-12-lod -
      -
      -
      + + +

      13-stencil

      Stencil reflections and shadows.

      -
      +
      example-13-stencil -
      -
      -
      + + +

      14-shadowvolumes

      Shadow volumes.

      -
      +
      example-14-shadowvolumes -
      -
      -
      + + +

      15-shadowmaps-simple

      -
      +
      example-15-shadowmaps-simple -
      -
      -
      + + +

      16-shadowmaps

      -
      +
      example-16-shadowmaps -
      -
      -
      + + +

      17-drawstress

      -
      +

      60Hz

      Draw stress is CPU stress test to show what is the maximimum number of draw calls while maintaining 60Hz frame rate. bgfx currently has default @@ -883,8 +891,8 @@ changing BGFX_CONFI (on Windows), and layout.frame_rate 500.

    • Chrome 33 command line option: --disable-gpu-vsync.

    -
    -
    + +

    30Hz (test for browsers)

    By default browsers are using vsync, and don’t have option to turn it off programatically.

    @@ -1014,108 +1022,108 @@ off programatically.

    -
    - -
    + + +

    18-ibl

    Image-based lighting.

    -
    +
    example-18-ibl -
    -
    -
    + + +

    19-oit

    Weighted, Blended Order-Independent Transparency

    -
    +
    example-19-oit -
    -
    -
    + + +

    20-nanovg

    NanoVG is small antialiased vector graphics rendering library.

    -
    +
    example-20-nanovg -
    -
    -
    + + +

    21-deferred

    MRT rendering and deferred shading.

    -
    +
    example-21-deferred -
    -
    -
    + + +

    22-windows

    Rendering into multiple windows.

    -
    -
    + +

    23-vectordisplay

    Rendering lines as oldschool vectors.

    -
    +
    example-23-vectordisplay -
    -
    -
    + + +

    24-nbody

    N-body simulation with compute shaders using buffers.

    -
    +
    example-24-nbody -
    -
    -
    + + +

    25-c99

    Initialization and debug text with C99 API.

    -
    -
    + +

    26-occlusion

    Using occlusion query for conditional rendering.

    -
    +
    example-26-occlusion -
    -
    -
    + + +

    27-terrain

    Terrain painting example.

    -
    +
    example-27-terrain -
    -
    -
    + + +

    28-wireframe

    Drawing wireframe mesh.

    -
    +
    example-28-wireframe -
    -
    -
    + + +

    29-debugdraw

    Debug draw.

    -
    +
    example-29-debugdraw -
    -
    -
    + + +

    30-picking

    Mouse picking via GPU readback.

    -
    +
    example-30-picking -
    -
    -
    + + +

    31-rsm

    Global Illumination with Reflective Shadow Map.

    -
    +
    example-31-rsm -
    -
    -
    + + +

    32-particles

    Particles.

    -
    +
    example-32-particles -
    -
    -
    + + +

    33-pom

    Parallax occlusion mapping.

    @@ -1124,32 +1132,32 @@ off programatically.

    -
    +
    example-33-pom -
    -
    -
    + + +

    34-mvs

    Multiple vertex streams.

    -
    +
    example-34-mvs -
    -
    -
    + + +

    35-dynamic

    Dynamic buffers update.

    -
    +
    example-35-dynamic -
    -
    -
    + + +

    36-sky

    Perez dynamic sky model.

    -
    +
    example-36-sky -
    -
    -
    + + +

    37-gpudrivenrendering

    GPU-Driven Rendering.

    @@ -1160,11 +1168,11 @@ off programatically.

    -
    +
    example-37-gpudrivenrendering -
    -
    -
    + + +

    38-bloom

    Bloom.

    @@ -1173,11 +1181,11 @@ off programatically.

    -
    +
    example-38-bloom -
    -
    -
    + + +

    39-assao

    Adaptive Screen Space Ambient Occlusion.

    @@ -1186,18 +1194,18 @@ off programatically.

    -
    +
    example-39-assao -
    -
    -
    + + +

    40-svt

    Sparse Virtual Textures.

    -
    +
    example-40-svt -
    -
    -
    + + +

    41-tess

    Adaptive GPU Tessellation with Compute Shaders

    @@ -1206,11 +1214,11 @@ off programatically.

    -
    +
    example-41-tess -
    -
    -
    + + +

    42-bunnylod

    Simple Polygon Reduction

    @@ -1220,11 +1228,11 @@ off programatically.

    -
    +
    example-42-bunnylod -
    -
    -
    + + +

    43-denoise

    Denoise

    @@ -1235,18 +1243,18 @@ off programatically.

    -
    +
    example-43-denoise -
    -
    -
    + + +

    44-sss

    Screen-Space Shadows

    -
    +
    example-44-sss -
    -
    -
    + + +

    45-bokeh

    Bokeh Depth of Field

    @@ -1255,40 +1263,32 @@ off programatically.

    -
    +
    example-45-bokeh -
    -
    - + + +
    - -

    - - © Copyright 2010-2020, Branimir Karadžić + © Copyright 2010-2020, Branimir Karadžić.

    - diff --git a/genindex.html b/genindex.html index 185045c73..e8691213b 100644 --- a/genindex.html +++ b/genindex.html @@ -3,9 +3,9 @@ - + - + Index — bgfx 1.0 documentation @@ -13,23 +13,28 @@ + + + + + + - @@ -49,7 +54,7 @@ - bgfx + bgfx @@ -132,6 +137,8 @@ + +
    -

    - - © Copyright 2010-2020, Branimir Karadžić + © Copyright 2010-2020, Branimir Karadžić.

    - diff --git a/index.html b/index.html index 3b64412c6..5e6f8500e 100644 --- a/index.html +++ b/index.html @@ -3,9 +3,10 @@ - - - + + + + Documentation — bgfx 1.0 documentation @@ -13,23 +14,28 @@ + + + + + + - @@ -50,7 +56,7 @@ - bgfx + bgfx @@ -133,6 +139,8 @@ + +
    -
    +

    Contents

      @@ -347,35 +355,28 @@ licensed under permissive BSD-2 clause open source license.

    -
    -
    + +
    - -

    - - © Copyright 2010-2020, Branimir Karadžić + © Copyright 2010-2020, Branimir Karadžić.

    - diff --git a/internals.html b/internals.html index 3439e737a..e9a555449 100644 --- a/internals.html +++ b/internals.html @@ -3,9 +3,10 @@ - - - + + + + Internals — bgfx 1.0 documentation @@ -13,23 +14,28 @@ + + + + + + - @@ -51,7 +57,7 @@ - bgfx + bgfx @@ -145,6 +151,8 @@ + +
      @@ -156,7 +164,7 @@
    • - +
    • @@ -168,9 +176,9 @@
      -
      +

      Internals

      -
      +

      Sort based draw call bucketing

      bgfx is using sort-based draw call bucketing. This means that submission order doesn’t necessarily match the rendering order, but on the low-level they will be sorted and ordered correctly. On the high level bgfx uses declarative API and internal sorting allows more optimal way of submitting draw calls for all passes at one place, and on the low-level this allows better optimization of rendering order. This sometimes creates undesired results usually for GUI rendering, where draw order should usually match submit order. bgfx provides way to enable sequential rendering for these cases (see bgfx::setViewMode).

      @@ -178,67 +186,59 @@
    • More detailed description of sort-based draw call bucketing can be found at: Order your graphics draw calls around!

    - -
    + +

    API and render thread

    API thread is thread from which bgfx::init is called. Once bgfx::init is called on thread, internally bgfx assumes that all API calls will be called from the same thread with exception of Resource, View, and Encoder API.

    Render thread from where internal rendering bgfx::renderFrame is called. On most of OS’ it’s required that this call be called on thread that OS created when executing process (some refer to this thread as “main” thread, or thread where main function is called).

    When bgfx is compiled with option BGFX_CONFIG_MULTITHREADED=1 (default is on) bgfx::renderFrame can be called by user. It’s required to be called before bgfx::init from thread that will be used as render thread. If both bgfx::renderFrame and bgfx::init are called from the same thread, bgfx will switch to execute in single threaded mode, and calling bgfx::renderFrame is not required, since it will be called automatically during bgfx::frame call.

    -
    -
    + +

    Resource API

    Any API call starting with bgfx::create*, bgfx::destroy*, bgfx::update*, bgfx::alloc* is considered part of resource API. Internally resource API calls are guarded by mutex. There is no limit of number of threads that can call resource API simultaneously. Calling any resource API is infrequent, and functions are cheap since most of work with resource is done at later point on render thread.

    -
    -
    + +

    View API

    Any API call starting with bgfx::setView* is considered part of view API. View API is not designed to be thread safe at all since all views are independentent from each other. Calling any view API for different views from different threads is safe. What’s not safe is to update the same view from multiple threads. This will lead to undefined behavior. Only view API that has to be set before any draw calls are issued is view mode bgfx::setViewMode. Internal encoder requires view mode to select sort key encoding and if user changes view mode after submit it will cause incorrect sort behavior within the view.

    -
    -
    + +

    Encoder API

    Encoder API can be obtained by calling bgfx::begin. bgfx by default allows 8 simultaneous threads to use encoders. This can be configured by changing Limits.maxEncoders init option of bgfx::Init structure.

    -
    -
    + +

    Customization

    By default each platform has sane default values. For example on Windows default renderer is DirectX, on Linux it is OpenGL, and on OSX it’s Metal. On Windows platform almost all rendering backends are available. For OpenGL ES on desktop you can find more information at:- OpenGL ES 2.0 and EGL on desktop

    If you’re targeting specific mobile hardware, you can find GLES support in their official SDKs: Adreno SDK, Mali SDK, PowerVR SDK.

    All configuration settings are located inside src/config.h.

    Every BGFX_CONFIG_* setting can be changed by passing defines thru compiler switches. For example setting preprocessor define BGFX_CONFIG_RENDERER_OPENGL=1 will change backend renderer to OpenGL 2.1. on Windows. Since rendering APIs are platform specific, this obviously won’t work nor make sense in all cases.

    -
    +

    Options

    BGFX_CONFIG_MULTITHREADED is used to enable/disable threading support inside bgfx. By default set to 1 on all platforms that support threading.

    -
    -
    - + + +
    - -

    - - © Copyright 2010-2020, Branimir Karadžić + © Copyright 2010-2020, Branimir Karadžić.

    - diff --git a/license.html b/license.html index 3a9fa1c72..d369d401f 100644 --- a/license.html +++ b/license.html @@ -3,9 +3,10 @@ - - - + + + + License — bgfx 1.0 documentation @@ -13,23 +14,28 @@ + + + + + + - @@ -50,7 +56,7 @@ - bgfx + bgfx @@ -151,6 +157,8 @@ + +
    - -
    + +

    edtaa3 (MIT)

    Contour Rendering by Distance Fields

    @@ -225,8 +233,8 @@ directory.

  • https://github.com/OpenGLInsights/OpenGLInsightsCode/tree/master/Chapter%2012%202D%20Shape%20Rendering%20by%20Distance%20Fields

  • - -
    + +

    fcpp (BSD)

    Frexx C preprocessor

    @@ -234,24 +242,24 @@ directory.

  • https://github.com/bagder/fcpp

  • - -
    + +

    Forsyth Triangle Order Optimizer (Public Domain)

    -
    - -
    + +

    glsl-optimizer (MIT)

    GLSL optimizer based on Mesa’s GLSL compiler. Used in Unity for mobile shader optimization.

    @@ -260,8 +268,8 @@ shader optimization.

  • https://github.com/aras-p/glsl-optimizer

  • - -
    + +

    NanoVG (ZLIB)

    NanoVG is small antialiased vector graphics rendering library.

    @@ -269,8 +277,8 @@ shader optimization.

  • https://github.com/memononen/nanovg

  • - -
    + +

    ImGui (MIT)

    Bloat-free Immediate Mode Graphical User interface for C++ with minimal dependencies.

    @@ -279,8 +287,8 @@ dependencies.

  • https://github.com/ocornut/imgui

  • - -
    + +

    SDF (MIT)

    Sweep-and-update Euclidean distance transform of an antialised image for contour texturing.

    @@ -289,25 +297,25 @@ contour texturing.

  • https://github.com/memononen/SDF

  • - -
    + +

    stb (Public Domain)

    -
    -
    + +

    Vertex Cache Optimised Index Buffer Compression (BSD)

    -
    - -
    + + +

    Assets

    Bunny

    @@ -418,35 +426,28 @@ contour texturing.

  • https://commons.wikimedia.org/wiki/File:Normal_map_example_with_scene_and_result.png

  • - - + +
    - -

    - - © Copyright 2010-2020, Branimir Karadžić + © Copyright 2010-2020, Branimir Karadžić.

    - diff --git a/objects.inv b/objects.inv index da9a4a75c..d3c84cac9 100644 Binary files a/objects.inv and b/objects.inv differ diff --git a/overview.html b/overview.html index 09c544dc0..4be06e777 100644 --- a/overview.html +++ b/overview.html @@ -3,9 +3,10 @@ - - - + + + + Overview — bgfx 1.0 documentation @@ -13,23 +14,28 @@ + + + + + + - @@ -51,7 +57,7 @@ - bgfx + bgfx @@ -157,6 +163,8 @@ + +
      @@ -168,7 +176,7 @@
    • - +
    • @@ -180,16 +188,16 @@
      -
      +

      Overview

      -
      +

      What is it?

      Cross-platform, graphics API agnostic, “Bring Your Own Engine/Framework” style rendering library, licensed under permissive BSD-2 clause open source license.

      -

      +

      Supported rendering backends

      • Direct3D 9

      • @@ -206,8 +214,8 @@ licensed under permissive BSD-2 clause open source license.

      • WebGL 2.0

      • WebGPU/Dawn (experimental)

      -
      -
      +
      +

      Supported Platforms

      • Android (14+, ARM, x86, MIPS)

      • @@ -222,16 +230,16 @@ licensed under permissive BSD-2 clause open source license.

      • Windows (XP, Vista, 7, 8, 10)

      • UWP (Universal Windows, Xbox One)

      -
      -
      +
      +

      Supported Compilers

      • Clang 3.3 and above

      • GCC 5 and above

      • vs2017 and above

      -
      -
      + +

      Supported Languages

      -
      - -
      + +

      Contact

        @@ -266,11 +274,11 @@ licensed under permissive BSD-2 clause open source license.

      • Twitter @bkaradzic

      -
      -
      -
      + + +

      Debugging and Profiling

      -
      +

      RenderDoc

      Loading of RenderDoc is integrated in bgfx when using DX11 or OpenGL renderer. You can drop in renderdoc.dll from RenderDoc distribution @@ -281,16 +289,16 @@ initialization. This allows frame capture at any time by pressing

      RenderDoc How do I …? documentation.

      Shader debugging with RenderDoc and MSVC.

      -
      -
      +
      +

      IntelGPA

      Right click Intel GPA Monitor tray icon, choose preferences, check “Auto-detect launched applications” option. Find InjectionList.txt in GPA directory and add examples-* to the list.

      Download: IntelGPA

      -
      -
      + +

      Other Debuggers and Profilers

      @@ -455,9 +463,9 @@ in GPA directory and add

      RGP (Radeon GPU Profiler)

    • vogl

    • - - -
      + + +

      SDL, GLFW, etc.

      It is possible to use bgfx with SDL, GLFW and similar cross platform windowing libraries. The main requirement is that windowing library @@ -481,8 +489,8 @@ Each platform has rules about where renderer can be and how multithreading inter with context/device. To disable multithreaded render use BGFX_CONFIG_MULTITHREADED=0 preprocessor define.

      - -
      + +

      Getting Involved

      Everyone is welcome to contribute to bgfx by submitting bug reports, testing on different platforms, writing examples (see ideas), @@ -492,7 +500,7 @@ improving documentation, profiling and optimizing, etc.

      When contributing to the bgfx project you must agree to the BSD 2-clause licensing terms.

      -
      +

      Contributors

      Chrnonological order:

      @@ -585,43 +593,35 @@ and 45-bokeh exampl

      and others

      - -
      + +

      Repository visualization

      -

      - - +

      + +
      - -

      - - © Copyright 2010-2020, Branimir Karadžić + © Copyright 2010-2020, Branimir Karadžić.

      - diff --git a/search.html b/search.html index 7a4b1a69c..31a8354bb 100644 --- a/search.html +++ b/search.html @@ -3,9 +3,9 @@ - + - + Search — bgfx 1.0 documentation @@ -13,13 +13,18 @@ + + + + + + - @@ -51,7 +57,7 @@ - bgfx + bgfx @@ -144,6 +150,8 @@ + +
        @@ -155,7 +163,7 @@
      • - +
      • @@ -167,9 +175,9 @@
        -
        +

        Tools

        -
        +

        Geometry Compiler (geometryc)

        Converts Wavefront .obj, or glTF 2.0 mesh file to format optimal for using with bgfx.

        Usage:

        @@ -252,12 +260,12 @@ More steps slower calculation.

        -
        -
        + +

        Geometry Viewer (geometryv)

        Geometry viewer.

        -
        -
        + +

        Shader Compiler (shaderc)

        bgfx cross-platform shader language is based on GLSL syntax. It’s uses ANSI C preprocessor to transform GLSL like language syntax into HLSL. @@ -347,13 +355,13 @@ macros.

        -
        +

        Building shaders

        Shaders must be compiled for all renderers by using shaderc tool. Makefile to simplify building shaders is provided in examples. D3D shaders can be only compiled on Windows.

        -
        -
        -
        + + +

        Texture Compiler (texturec)

        Convert PNG, TGA, DDS, KTX, PVR texture into bgfx supported texture formats.

        Usage:

        @@ -490,41 +498,33 @@ shaders is provided in examples. D3D shaders can be only compiled on Windows.

        -
        -
        + +

        Texture Viewer (texturev)

        Texture viewer.

        -
        -
      + +
      - -

      - - © Copyright 2010-2020, Branimir Karadžić + © Copyright 2010-2020, Branimir Karadžić.

      -