API Reference¶
Note
@@ -238,13 +230,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
@@ -252,16 +244,16 @@ tutorial.bgfx_init_t.
-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_NONEit will select the first device.BGFX_PCI_ID_NONE- Autoselect adapter.
@@ -274,63 +266,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).
-
-
-
-PlatformData platformData¶
-
+PlatformData
platformData¶ Platform data.
-
-
-
-Resolution resolution¶
-
+Resolution
resolution¶ Backbuffer resolution and reset parameters. See:
bgfx::Resolution.
-
-
-
-CallbackI *callback¶
-
+CallbackI *
callback¶ Provide application specific callback interface. See:
bgfx::CallbackI
-
-
-
-struct Limits¶
-
+struct
Limits¶ Configurable runtime limits parameters.
- Attention
C99 equivalent is
@@ -338,28 +330,28 @@ tutorial.bgfx_init_limits_t.
-Public Members
+Public Members
@@ -369,8 +361,8 @@ tutorial.-
-
-
-struct bgfx::Resolution¶
-
+struct
bgfx::Resolution¶ Backbuffer resolution and reset parameters.
- Attention
C99 equivalent is
@@ -378,40 +370,40 @@ tutorial.bgfx_resolution_t.
-+Public Members
+Public Members
-
-
-
-TextureFormat::Enum format¶
-
+TextureFormat::Enum
format¶ Backbuffer format.
-
-
-
-bool bgfx::init(const Init &_init = {})¶
-
+bool
bgfx::init(const Init &_init = {})¶ Initialize bgfx library.
-
+
- Return
+trueif initialization was successful.- Attention
C99 equivalent is
bgfx_init.
+- Parameters
-
+
[in] _init: Initialization parameters. See:bgfx::Initfor more info.
+
-
-
- Parameters -
_init – [in] Initialization parameters. See:
-bgfx::Initfor more info.
-- Returns -
-trueif initialization was successful.
-
-
-
-
-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.
@@ -479,102 +469,90 @@ tutorial.
-Public Functions
+Public Functions
-
-
-
-virtual void fatal(const char *_filePath, uint16_t _line, Fatal::Enum _code, const char *_str) = 0¶
-
+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 -
-
-
_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.
+- 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.
-
-
-
-virtual void traceVargs(const char *_filePath, uint16_t _line, const char *_format, va_list _argList) = 0¶
-
+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 -
-
-
_filePath – [in] File path where debug message was generated.
-_line – [in] Line where debug message was generated.
-_format – [in]
printfstyle format.
-_argList – [in] Variable arguments list initialized with
va_start.
+- Parameters
-
+
[in] _filePath: File path where debug message was generated.
+[in] _line: Line where debug message was generated.
+[in] _format:printfstyle format.
+[in] _argList: Variable arguments list initialized withva_start.
-
-
-
-virtual void profilerBegin(const char *_name, uint32_t _abgr, const char *_filePath, uint16_t _line) = 0¶
-
+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 -
-
-
_name – [in] Region name, contains dynamic string.
-_abgr – [in] Color of profiler region.
-_filePath – [in] File path where
profilerBeginwas called.
-_line – [in] Line where
profilerBeginwas called.
+- Parameters
-
+
[in] _name: Region name, contains dynamic string.
+[in] _abgr: Color of profiler region.
+[in] _filePath: File path whereprofilerBeginwas called.
+[in] _line: Line whereprofilerBeginwas called.
-
-
-
-virtual void profilerBeginLiteral(const char *_name, uint32_t _abgr, const char *_filePath, uint16_t _line) = 0¶
-
+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 -
-
-
_name – [in] Region name, contains string literal.
-_abgr – [in] Color of profiler region.
-_filePath – [in] File path where
profilerBeginLiteralwas called.
-_line – [in] Line where
profilerBeginLiteralwas called.
+- Parameters
-
+
[in] _name: Region name, contains string literal.
+[in] _abgr: Color of profiler region.
+[in] _filePath: File path whereprofilerBeginLiteralwas called.
+[in] _line: Line whereprofilerBeginLiteralwas called.
-
-
-
-virtual void profilerEnd() = 0¶
-
+void
profilerEnd() = 0¶ Profiler region end.
- Remark
Not thread safe and it can be called from any thread.
@@ -586,116 +564,101 @@ tutorial.
-
-
-
-virtual uint32_t cacheReadSize(uint64_t _id) = 0¶
-
+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 -
_id – [in] Cache id.
-
-- Returns -
Number of bytes to read.
-
-
-
-
-
-virtual bool cacheRead(uint64_t _id, void *_data, uint32_t _size) = 0¶
Read cached item.
--
-
- Attention
C99 equivalent is
-bgfx_callback_vtbl.cache_read.
-
-
-
- Parameters -
-
-
_id – [in] Cache id.
-_data – [in] Buffer where to read data.
-_size – [in] Size of data to read.
+- Parameters
-
+
[in] _id: Cache id.
-- Returns -
True if data is read.
-
-
-
-
-virtual void cacheWrite(uint64_t _id, const void *_data, uint32_t _size) = 0¶
-
+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.
+
+
-
+
-
+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 -
-
-
_id – [in] Cache id.
-_data – [in] Data to write.
-_size – [in] Size of data to write.
+- Parameters
-
+
[in] _id: Cache id.
+[in] _data: Data to write.
+[in] _size: Size of data to write.
-
-
-
-virtual void screenShot(const char *_filePath, uint32_t _width, uint32_t _height, uint32_t _pitch, const void *_data, uint32_t _size, bool _yflip) = 0¶
-
+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 -
-
-
_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.
+- 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.
-
-
-
-virtual void captureBegin(uint32_t _width, uint32_t _height, uint32_t _pitch, TextureFormat::Enum _format, bool _yflip) = 0¶
-
+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 -
-
-
_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.
+- 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.
-
-
-
-virtual void captureEnd() = 0¶
-
+void
captureEnd() = 0¶ Called when a video capture ends.
- Attention
C99 equivalent is
@@ -705,30 +668,27 @@ tutorial.bgfx_callback_vtbl.capture_end.
-
-
-
-virtual void captureFrame(const void *_data, uint32_t _size) = 0¶
-
+void
captureFrame(const void *_data, uint32_t _size) = 0¶ Captured frame.
- Attention
C99 equivalent is
bgfx_callback_vtbl.capture_frame.
-
-
-
- Parameters -
-
-
_data – [in] Image data.
-_size – [in] Image size.
+- Parameters
-
+
[in] _data: Image data.
+[in] _size: Image size.
+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 -
-
-
_width – [in] Back-buffer width.
-_height – [in] Back-buffer height.
-_flags – [in] See:
BGFX_RESET_*for more info.-
+
- Parameters
-
+
[in] _width: Back-buffer width.
+[in] _height: Back-buffer height.
+[in] _flags: 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.
@@ -770,307 +726,289 @@ tutorial.
BGFX_RESET_SRGB_BACKBUFFER- Enable sRGB backbuffer.
-_format – [in] Texture format. See:
TextureFormat::Enum.
+[in] _format: Texture format. See:TextureFormat::Enum.
-
-
-
-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.
+ +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::makeRefcalls.- 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::makeRefcalls.
-
+ +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 -
_debug – [in] Available flags:
-
+
- Parameters
-
+
[in] _debug: 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_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.
+ +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 -
-
-
_attr – [in] Background color.
-_small – [in] Default 8x16 or 8x8 font.
+- Parameters
-
+
[in] _attr: Background color.
+[in] _small: 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 -
-
-
_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]
printfstyle format.
+- 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:printfstyle 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 -
-
-
_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]
printfstyle format.
-_argList – [in] additional arguments for format string
+- 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:printfstyle format.
+[in] _argList: 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 -
-
-
_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.
+- 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.
+ Querying information¶
-+ +Renderer¶
-
-
-
-uint8_t bgfx::getSupportedRenderers(uint8_t _max = 0, RendererType::Enum *_enum = NULL)¶
-
+uint8_t
bgfx::getSupportedRenderers(uint8_t _max = 0, RendererType::Enum *_enum = NULL)¶ Returns supported backend API renderers.
-
+
- Return
Number of supported renderers.
+- Attention
C99 equivalent is
bgfx_get_supported_renderers.
+- Parameters
-
+
[in] _max: Maximum number of elements in _enum array.
+[inout] _enum: Array where supported renderers will be written.
+
-
-
- 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()¶
-
+RendererType::Enum
bgfx::getRendererType()¶ Returns current renderer backend API type.
- Remark
Library must be initialized.
@@ -1082,8 +1020,8 @@ tutorial.
-
-
-
-struct bgfx::RendererType¶
-
+struct
bgfx::RendererType¶ Renderer backend type enum.
- Attention
C99 equivalent is
@@ -1091,81 +1029,87 @@ tutorial.bgfx_renderer_type_t.
+
Capabilities¶
-
-
-
-const Caps *bgfx::getCaps()¶
-
+const Caps *
bgfx::getCaps()¶ Returns renderer capabilities.
-
+
- Return
Pointer to static
+bgfx::Capsstructure.- Remark
Library must be initialized.
- Attention
C99 equivalent is
bgfx_get_caps.
-
-
- Returns -
Pointer to static
-bgfx::Capsstructure.
-
-
-
-
-struct bgfx::Caps¶
-
+struct
bgfx::Caps¶ Renderer capabilities.
- Attention
C99 equivalent is
@@ -1204,16 +1145,16 @@ tutorial.bgfx_caps_t.
-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
@@ -1223,50 +1164,50 @@ tutorial.BGFX_CAPS_*flags at https://bkaradzic.github.io/bgfx/bgfx.html#available-caps
-
-
-
-bool homogeneousDepth¶
-
+bool
homogeneousDepth¶ True when NDC depth is in [-1, 1] range, otherwise its [0, 1].
-
-
-
-uint16_t formats[TextureFormat::Count]¶
-
+uint16_t
formats[Count]¶ Supported texture format capabilities flags:
BGFX_CAPS_FORMAT_TEXTURE_NONE- Texture format is not supported.
@@ -1292,8 +1233,8 @@ tutorial.
-
-
-
-struct GPU¶
-
+struct
GPU¶ GPU info.
- Attention
C99 equivalent is
@@ -1301,16 +1242,16 @@ tutorial.bgfx_caps_gpu_t.
-Public Members
+Public Members
@@ -1318,8 +1259,8 @@ tutorial.-
-
-
-struct Limits¶
-
+struct
Limits¶ Renderer runtime limits.
- Attention
C99 equivalent is
@@ -1327,148 +1268,148 @@ tutorial.bgfx_caps_limits_t.
-+Public Members
+Public Members
-
-
-
-uint32_t maxFBAttachments¶
-
+uint32_t
maxFBAttachments¶ Maximum number of frame buffer attachments.
-
-
-
-uint32_t maxVertexLayouts¶
-
+uint32_t
maxVertexLayouts¶ Maximum number of vertex format layouts.
-
-
-
-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 maxOcclusionQueries¶
-
+uint32_t
maxOcclusionQueries¶ Maximum number of occlusion query handles.
+ +Available Caps¶
-
-
-
-BGFX_CAPS_CONSERVATIVE_RASTER¶
-
+
BGFX_CAPS_CONSERVATIVE_RASTER¶ Conservative rasterization 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_RENDERER_MULTITHREADED¶
-
+
BGFX_CAPS_RENDERER_MULTITHREADED¶ Renderer is on separate thread.
-
-
-
-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_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.
+ Statistics¶
-
-
-
-const Stats *bgfx::getStats()¶
-
+const Stats *
bgfx::getStats()¶ Returns performance counters.
- Attention
Pointer returned is valid until
@@ -1658,8 +1599,8 @@ tutorial.bgfx::frameis called.
-
-
-
-struct bgfx::Stats¶
-
+struct
bgfx::Stats¶ Renderer statistics data.
- Attention
C99 equivalent is
@@ -1669,238 +1610,238 @@ tutorial.bgfx_stats_t.
-+Public Members
+Public Members
-
-
-
-int64_t cpuTimeFrame¶
-
+int64_t
cpuTimeFrame¶ CPU time between two
bgfx::framecalls.
-
-
-
-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.
-
-
-
-uint16_t numDynamicIndexBuffers¶
-
+uint16_t
numDynamicIndexBuffers¶ Number of used dynamic index buffers.
-
-
-
-uint16_t numDynamicVertexBuffers¶
-
+uint16_t
numDynamicVertexBuffers¶ Number of used dynamic vertex buffers.
-
-
-
-EncoderStats *encoderStats¶
-
+EncoderStats *
encoderStats¶ Array of encoder stats.
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::renderFrameis blocking call. It waits forbgfx::frameto be called from API thread to process frame. If timeout value is passed call will timeout and return even ifbgfx::frameis 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
@@ -2026,23 +1963,21 @@ creating windows.bgfx_render_frame_t.
-
-
-
-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
@@ -2050,34 +1985,34 @@ creating windows.bgfx_platform_data_t.
-Public Members
+Public Members
-
-
-
-void *nwh¶
-
+void *
nwh¶ Native window handle. If
NULLbgfx 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
NULLbgfx will create back-buffer color surface.
-
-
-
-void *backBufferDS¶
-
+void *
backBufferDS¶ Backbuffer depth/stencil. If
NULLbgfx will create back-buffer depth/stencil surface.
-
-
-
-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
@@ -2111,16 +2044,16 @@ creating windows.bgfx_internal_data_t.
-+Public Members
+Public Members
@@ -2128,168 +2061,143 @@ 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.
-
--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.
-
+
- 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.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 -
-
-
_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.
+- 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.
-
-
-
-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 -
-
-
_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.
+- 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.
-
-
-
-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 -
-
-
_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.
+- 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.
-
-
-
-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 totrueif 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
trueif 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
@@ -2297,45 +2205,45 @@ creating windows.bgfx_topology_convert_t.
-+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 TriListFlipWinding¶
-
-
-
-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, seeTopologyConvert::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 totrueif 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
trueif 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
@@ -2379,75 +2283,75 @@ creating windows.bgfx_topology_sort_t.
-+Public Types
+Public Types
@@ -2456,125 +2360,111 @@ 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 -
-
-
_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
trueif input indices are 32-bit.
+- Parameters
-
+
[in] _sort: Sort order, seeTopologySort::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 totrueif 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 -
_flags – [in] Draw/compute states to discard.
+- Parameters
-
+
[in] _flags: 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 -
_id – [in] View id.
+- Parameters
-
+
[in] _id: 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 -
-
-
_index – [in] Index into palette.
-_rgba – [in] Packed 32-bit RGBA value.
+- Parameters
-
+
[in] _index: Index into palette.
+[in] _rgba: 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 -
-
-
_index – [in] Index into palette.
-_rgba – [in] RGBA floating point value.
+- Parameters
-
+
[in] _index: Index into palette.
+[in] _rgba: 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 -
-
-
_index – [in] Index into palette.
-_r, _g, _b, _a – [in] RGBA floating point values.
+- Parameters
-
+
[in] _index: Index into palette.
+[in] _r[in] _g[in] _b[in] _a: 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
@@ -2583,21 +2473,18 @@ creating windows.bgfx::CallbackI::screenShotmust be implemented.- Attention
C99 equivalent is
bgfx_request_screen_shot.
-
-
-
- Parameters -
-
-
_handle – [in] Frame buffer handle. If handle is
BGFX_INVALID_HANDLErequest will be made for main window back buffer.
-_filePath – [in] Will be passed to
bgfx::CallbackI::screenShotcallback.
+- Parameters
-
+
[in] _handle: Frame buffer handle. If handle isBGFX_INVALID_HANDLErequest will be made for main window back buffer.
+[in] _filePath: Will be passed tobgfx::CallbackI::screenShotcallback.
+
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 @@ -2611,11 +2498,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) @@ -2625,6 +2512,11 @@ In graphics debugger view name will appear as:
- Remark
+This is debug only feature.
- Parameters
-
+
[in] _id: View id.
+[in] _name: View name.
+
-
@@ -2632,135 +2524,112 @@ In graphics debugger view name will appear as:
- 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 -
-
-
_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.
+- 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.
-
-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 -
-
-
_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.
+- 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.
-
-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 -
-
-
_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.
+- 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.
-
-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 -
-
-
_id – [in] View id.
-_flags – [in] Clear flags. Use
BGFX_CLEAR_NONEto remove any clear operation. See:BGFX_CLEAR_*.
-_rgba – [in] Color clear value.
-_depth – [in] Depth clear value.
-_stencil – [in] Stencil clear value.
+- Parameters
-
+
[in] _id: View id.
+[in] _flags: Clear flags. UseBGFX_CLEAR_NONEto remove any clear operation. See:BGFX_CLEAR_*.
+[in] _rgba: Color clear value.
+[in] _depth: Depth clear value.
+[in] _stencil: 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::setPaletteColorto setup clear color palette.- Attention
C99 equivalent is
bgfx_set_view_clear_mrt.
-
-
-
- Parameters -
-
-
_id – [in] View id.
-_flags – [in] Clear flags. Use
BGFX_CLEAR_NONEto 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.
+- Parameters
-
+
[in] _id: View id.
+[in] _flags: Clear flags. UseBGFX_CLEAR_NONEto 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.
-
-struct bgfx::ViewMode¶
-
+struct
bgfx::ViewMode¶ View mode sets draw call sort order.
- Attention
C99 equivalent is
@@ -2768,39 +2637,39 @@ In graphics debugger view name will appear as:bgfx_view_mode_t.-Public Types
+Public Types
-
-
-
-enum Enum¶
-
+enum
Enum¶ View modes:
Values:
-
-
-
-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 Sequential¶
-+- -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::submitfor the view.- Attention
C99 equivalent is
bgfx_set_view_mode.
-
-
-
- Parameters -
-
-
_id – [in] View id.
-_mode – [in] View sort mode. See
ViewMode::Enum.
+- Parameters
-
+
[in] _id: View id.
+[in] _mode: View sort mode. SeeViewMode::Enum.
-
-
-
-void bgfx::setViewFrameBuffer(ViewId _id, FrameBufferHandle _handle)¶
-
+void
bgfx::setViewFrameBuffer(ViewId _id, FrameBufferHandle _handle)¶ Set view frame buffer.
- Remark
Not persistent after
bgfx::resetcall.- Attention
C99 equivalent is
bgfx_set_view_frame_buffer.
-
-
-
- Parameters -
-
-
_id – [in] View id.
-_handle – [in] Frame buffer handle. Passing
BGFX_INVALID_HANDLEas frame buffer handle will draw primitives from this view into default back buffer.
+- Parameters
-
+
[in] _id: View id.
+[in] _handle: Frame buffer handle. PassingBGFX_INVALID_HANDLEas 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 -
-
-
_id – [in] View id.
-_view – [in] View matrix.
-_proj – [in] Projection matrix.
+- Parameters
-
+
[in] _id: View id.
+[in] _view: View matrix.
+[in] _proj: 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 -
-
-
_id – [in] First view id.
-_num – [in] Number of views to remap.
-_remap – [in] View remap id table. Passing
NULLwill reset view ids to default state.
+- Parameters
-
+
[in] _id: First view id.
+[in] _num: Number of views to remap.
+[in] _remap: View remap id table. PassingNULLwill 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 -
_id – [in] View id.
+- Parameters
-
+
[in] _id: 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 -
_forThread – [in] Explicitly request an encoder for a worker thread.
+-
+
- Parameters
-
+
[in] _forThread: 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
@@ -2939,10 +2797,10 @@ In graphics debugger view name will appear as:bgfx_encoder.-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
@@ -2952,8 +2810,8 @@ In graphics debugger view name will appear as:bgfx_encoder_set_marker.-- -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
-
@@ -2964,12 +2822,8 @@ In graphics debugger view name will appear as:
- Parameters -
-
-
_state – [in] State flags. Default state for primitive type is triangles. See:
BGFX_STATE_DEFAULT.-
+
- Parameters
-
+
[in] _state: 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.
@@ -2979,534 +2833,464 @@ In graphics debugger view name will appear as: _rgba – [in] Sets blend factor used by
BGFX_STATE_BLEND_FACTORandBGFX_STATE_BLEND_INV_FACTORblend modes.
+[in] _rgba: Sets blend factor used byBGFX_STATE_BLEND_FACTORandBGFX_STATE_BLEND_INV_FACTORblend 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 -
-
-
_handle – [in] Occlusion query handle.
-_visible – [in] Render if occlusion query is visible.
+- Parameters
-
+
[in] _handle: Occlusion query handle.
+[in] _visible: 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 -
-
-
_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.
+- Parameters
-
+
[in] _fstencil: Front stencil state.
+[in] _bstencil: Back stencil state. If back is set toBGFX_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 -
_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)¶
Set model matrix for draw primitive. If it is not called, model will be rendered with identity model matrix.
--
-
- Attention
C99 equivalent is
-bgfx_encoder_set_transform.
-
-
-
- Parameters -
-
-
_mtx – [in] Pointer to first matrix in array.
-_num – [in] Number of matrices in array.
+- Parameters
-
+
[in] _cache: Index in scissor cache. Pass UINT16_MAX to have primitive use view scissor instead.
-- 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
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.
+
+
-
+uint32_t
allocTransform(Transform *_transform, uint16_t _num)¶ Reserve
_nummatrices in internal matrix cache.-
+
- Return
Index into matrix cache.
+- Attention
Pointer returned can be modifed until
bgfx::frameis called.- Attention
C99 equivalent is
bgfx_encoder_alloc_transform.
-
-
-
- Parameters -
-
-
_transform – [in] Pointer to
Transformstructure.
-_num – [in] Number of matrices.
+- Parameters
-
+
[in] _transform: Pointer toTransformstructure.
+[in] _num: 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 -
-
-
_cache – [in] Index in matrix cache.
-_num – [in] Number of matrices from cache.
+- Parameters
-
+
[in] _cache: Index in matrix cache.
+[in] _num: 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 -
-
-
_handle – [in] Uniform.
-_value – [in] Pointer to uniform data.
-_num – [in] Number of elements. Passing
UINT16_MAXwill use the _num passed on uniform creation.
+- Parameters
-
+
[in] _handle: Uniform.
+[in] _value: Pointer to uniform data.
+[in] _num: Number of elements. PassingUINT16_MAXwill 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 -
_handle – [in] Index buffer.
+- Parameters
-
+
[in] _handle: 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 -
-
-
_handle – [in] Index buffer.
-_firstIndex – [in] First index to render.
-_numIndices – [in] Number of indices to render.
+- Parameters
-
+
[in] _handle: Index buffer.
+[in] _firstIndex: First index to render.
+[in] _numIndices: 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 -
_handle – [in] Dynamic index buffer.
+- Parameters
-
+
[in] _handle: 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 -
-
-
_handle – [in] Dynamic index buffer.
-_firstIndex – [in] First index to render.
-_numIndices – [in] Number of indices to render.
+- Parameters
-
+
[in] _handle: Dynamic index buffer.
+[in] _firstIndex: First index to render.
+[in] _numIndices: 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 -
_tib – [in] Transient index buffer.
+- Parameters
-
+
[in] _tib: 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 -
-
-
_tib – [in] Transient index buffer.
-_firstIndex – [in] First index to render.
-_numIndices – [in] Number of indices to render.
+- Parameters
-
+
[in] _tib: Transient index buffer.
+[in] _firstIndex: First index to render.
+[in] _numIndices: 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 -
-
-
_stream – [in] Vertex stream.
-_handle – [in] Vertex buffer.
+- Parameters
-
+
[in] _stream: Vertex stream.
+[in] _handle: 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 -
-
-
_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.
+- 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.
-
-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 -
-
-
_stream – [in] Vertex stream.
-_handle – [in] Dynamic vertex buffer.
+- Parameters
-
+
[in] _stream: Vertex stream.
+[in] _handle: 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 -
-
-
_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.
+- 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.
-
-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 -
-
-
_stream – [in] Vertex stream.
-_tvb – [in] Transient vertex buffer.
+- Parameters
-
+
[in] _stream: Vertex stream.
+[in] _tvb: 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 -
-
-
_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.
+- 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.
-
-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 -
_numVertices – [in] Number of vertices.
-
-
-
-void setInstanceDataBuffer(const InstanceDataBuffer *_idb)¶
Set instance data buffer for draw primitive.
--
-
- Attention
C99 equivalent is
-bgfx_encoder_set_instance_data_buffer.
-
-
-
- Parameters -
_idb – [in] Transient instance data buffer.
-
-
-
-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 -
-
-
_idb – [in] Transient instance data buffer.
-_start – [in] First instance data.
-_num – [in] Number of data instances.
+- Parameters
-
+
[in] _numVertices: Number of vertices.
-
-void setInstanceDataBuffer(VertexBufferHandle _handle, uint32_t _start, uint32_t _num)¶
-
+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.
+
+
-
+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.
+
+
-
+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 -
-
-
_handle – [in] Vertex buffer.
-_start – [in] First instance data.
-_num – [in] Number of data instances.
+- Parameters
-
+
[in] _handle: Vertex buffer.
+[in] _start: First instance data.
+[in] _num: 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 -
-
-
_handle – [in] Vertex buffer.
-_start – [in] First instance data.
-_num – [in] Number of data instances.
+- Parameters
-
+
[in] _handle: Vertex buffer.
+[in] _start: First instance data.
+[in] _num: 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 -
_numInstances – [in] Number of instances.
+- Parameters
-
+
[in] _numInstances: 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 -
-
-
_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.
-
+
- 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.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.
-- -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 -
_id – [in] View id.
+- Parameters
-
+
[in] _id: 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 -
-
-
_id – [in] View id.
-_program – [in] Program.
-_depth – [in] Depth for sorting.
-_flags – [in] Discard or preserve states. See
BGFX_DISCARD_*.
+- Parameters
-
+
[in] _id: View id.
+[in] _program: Program.
+[in] _depth: Depth for sorting.
+[in] _flags: Discard or preserve states. SeeBGFX_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 -
-
-
_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_*.
+- Parameters
-
+
[in] _id: View id.
+[in] _program: Program.
+[in] _occlusionQuery: Occlusion query.
+[in] _depth: Depth for sorting.
+[in] _flags: Discard or preserve states. SeeBGFX_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 -
-
-
_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_*.
+- 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. SeeBGFX_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 -
-
-
_stage – [in] Compute stage.
-_handle – [in] Index buffer handle.
-_access – [in] Buffer access. See
Access::Enum.
+- Parameters
-
+
[in] _stage: Compute stage.
+[in] _handle: Index buffer handle.
+[in] _access: Buffer access. SeeAccess::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 -
-
-
_stage – [in] Compute stage.
-_handle – [in] Vertex buffer handle.
-_access – [in] Buffer access. See
Access::Enum.
+- Parameters
-
+
[in] _stage: Compute stage.
+[in] _handle: Vertex buffer handle.
+[in] _access: Buffer access. SeeAccess::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 -
-
-
_stage – [in] Compute stage.
-_handle – [in] Dynamic index buffer handle.
-_access – [in] Buffer access. See
Access::Enum.
+- Parameters
-
+
[in] _stage: Compute stage.
+[in] _handle: Dynamic index buffer handle.
+[in] _access: Buffer access. SeeAccess::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 -
-
-
_stage – [in] Compute stage.
-_handle – [in] Dynamic vertex buffer handle.
-_access – [in] Buffer access. See
Access::Enum.
+- Parameters
-
+
[in] _stage: Compute stage.
+[in] _handle: Dynamic vertex buffer handle.
+[in] _access: Buffer access. SeeAccess::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 -
-
-
_stage – [in] Compute stage.
-_handle – [in] Indirect buffer handle.
-_access – [in] Buffer access. See
Access::Enum.
+- Parameters
-
+
[in] _stage: Compute stage.
+[in] _handle: Indirect buffer handle.
+[in] _access: Buffer access. SeeAccess::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 -
-
-
_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.
+- Parameters
-
+
[in] _stage: Texture unit.
+[in] _handle: Texture handle.
+[in] _mip: Mip level.
+[in] _access: Texture access. SeeAccess::Enum.
+[in] _format: 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 -
-
-
_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_*.
+- 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. SeeBGFX_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 -
-
-
_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_*.
+- 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. SeeBGFX_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 -
_flags – [in] Draw/compute states to discard.
+- Parameters
-
+
[in] _flags: 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
@@ -3795,28 +3545,25 @@ In graphics debugger view name will appear as:BGFX_TEXTURE_BLIT_DSTflag.bgfx_encoder_blit. - - -+-
-
- 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.
+- 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.
-
-
-
-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
@@ -3825,46 +3572,43 @@ In graphics debugger view name will appear as:BGFX_TEXTURE_BLIT_DSTflag.bgfx_encoder_blit. - - --
-
- 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.
+- 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.
+
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
@@ -3874,51 +3618,45 @@ In graphics debugger view name will appear as:bgfx_set_marker.-+- -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 -
-
-
_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.
+- 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.
-
-
-
-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 -
-
-
_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.
+- 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.
+ 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
-
@@ -3929,12 +3667,8 @@ In graphics debugger view name will appear as:
- Parameters -
-
-
_state – [in] State flags. Default state for primitive type is triangles. See:
BGFX_STATE_DEFAULT.-
+
- Parameters
-
+
[in] _state: 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.
@@ -3944,523 +3678,494 @@ In graphics debugger view name will appear as: _rgba – [in] Sets blend factor used by
BGFX_STATE_BLEND_FACTORandBGFX_STATE_BLEND_INV_FACTORblend modes.
+[in] _rgba: Sets blend factor used byBGFX_STATE_BLEND_FACTORandBGFX_STATE_BLEND_INV_FACTORblend modes.
+
-
--
-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_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_GEQUAL¶
-
+
BGFX_STATE_DEPTH_TEST_GEQUAL¶ Enable depth test, greater or equal.
-
-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_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_REVSUB¶
-
+
BGFX_STATE_BLEND_EQUATION_REVSUB¶ Blend reverse subtract: dst - src.
-
-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_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.
-
-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 -
-
-
_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.
+- Parameters
-
+
[in] _fstencil: Front stencil state.
+[in] _bstencil: Back stencil state. If back is set toBGFX_STENCIL_NONE_fstencil is applied to both front and back facing primitives.
-
-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 -
_cache – [in] Index in scissor cache. Passing UINT16_MAX unset primitive scissor and primitive will use view scissor instead.
+- Parameters
-
+
[in] _cache: Index in scissor cache. Passing UINT16_MAX unset primitive scissor and primitive will use view scissor instead.
+
-
-uint32_t bgfx::allocTransform(Transform *_transform, uint16_t _num)¶
-
+uint32_t
bgfx::allocTransform(Transform *_transform, uint16_t _num)¶ Reserve
_nummatrices in internal matrix cache.-
+
- Return
index into matrix cache.
+- Attention
Pointer returned can be modifed until
bgfx::frameis called.- Attention
C99 equivalent is
bgfx_alloc_transform.
-
-
-
- Parameters -
-
-
_transform – [in] Pointer to
Transformstructure.
-_num – [in] Number of matrices.
+- Parameters
-
+
[in] _transform: Pointer toTransformstructure.
+[in] _num: 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 -
-
-
_cache – [in] Index in matrix cache.
-_num – [in] Number of matrices from cache.
+- Parameters
-
+
[in] _cache: Index in matrix cache.
+[in] _num: Number of matrices from cache.
-
-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 -
-
-
_handle – [in] Occlusion query handle.
-_visible – [in] Render if occlusion query is visible.
+- Parameters
-
+
[in] _handle: Occlusion query handle.
+[in] _visible: Render if occlusion query is visible.
-
-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 -
_handle – [in] Index buffer.
+- Parameters
-
+
[in] _handle: 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 -
-
-
_handle – [in] Index buffer.
-_firstIndex – [in] First index to render.
-_numIndices – [in] Number of indices to render.
+- Parameters
-
+
[in] _handle: Index buffer.
+[in] _firstIndex: First index to render.
+[in] _numIndices: 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 -
_handle – [in] Dynamic index buffer.
+- Parameters
-
+
[in] _handle: 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 -
-
-
_handle – [in] Dynamic index buffer.
-_firstIndex – [in] First index to render.
-_numIndices – [in] Number of indices to render.
+- Parameters
-
+
[in] _handle: Dynamic index buffer.
+[in] _firstIndex: First index to render.
+[in] _numIndices: Number of indices to render.
-
-struct bgfx::TransientIndexBuffer¶
-
+struct
bgfx::TransientIndexBuffer¶ Transient index buffer.
- Attention
C99 equivalent is
@@ -4468,34 +4173,34 @@ otherwise prefer bgfx::setViewScissor.bgfx_transient_index_buffer_t.
-Public Members
+Public Members
-
-
-
-bool isIndex16¶
-
+bool
isIndex16¶ Index buffer format is 16-bits if true, otherwise it is 32-bit.
-
-
-
-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 -
_tib – [in] Transient index buffer.
+- Parameters
-
+
[in] _tib: 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 -
-
-
_tib – [in] Transient index buffer.
-_firstIndex – [in] First index to render.
-_numIndices – [in] Number of indices to render.
+- Parameters
-
+
[in] _tib: Transient index buffer.
+[in] _firstIndex: First index to render.
+[in] _numIndices: 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 -
-
-
_stream – [in] Vertex stream.
-_handle – [in] Vertex buffer.
+- Parameters
-
+
[in] _stream: Vertex stream.
+[in] _handle: 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 -
-
-
_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.
+- 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.
-
-
-
-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 -
-
-
_stream – [in] Vertex stream.
-_handle – [in] Dynamic vertex buffer.
+- Parameters
-
+
[in] _stream: Vertex stream.
+[in] _handle: 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 -
-
-
_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.
+- 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.
-
-
-
-struct bgfx::TransientVertexBuffer¶
-
+struct
bgfx::TransientVertexBuffer¶ Transient vertex buffer.
- Attention
C99 equivalent is
@@ -4630,40 +4319,40 @@ otherwise prefer bgfx::setViewScissor.bgfx_transient_vertex_buffer_t.
-+Public Members
+Public Members
@@ -4671,67 +4360,60 @@ 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 -
-
-
_stream – [in] Vertex stream.
-_tvb – [in] Transient vertex buffer.
+- Parameters
-
+
[in] _stream: Vertex stream.
+[in] _tvb: 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 -
-
-
_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.
+- 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.
-
-
-
-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 -
_numVertices – [in] Number of vertices.
+- Parameters
-
+
[in] _numVertices: Number of vertices.
+
-
-
-
-struct bgfx::InstanceDataBuffer¶
-
+struct
bgfx::InstanceDataBuffer¶ Instance data buffer info.
- Attention
C99 equivalent is
@@ -4739,40 +4421,40 @@ otherwise prefer bgfx::setViewScissor.bgfx_instance_data_buffer_t.
-+Public Members
+Public Members
@@ -4780,118 +4462,103 @@ 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 -
_idb – [in] Transient instance data buffer.
-
-
-
-
-
-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 -
-
-
_idb – [in] Transient instance data buffer.
-_start – [in] First instance data.
-_num – [in] Number of data instances.
+- Parameters
-
+
[in] _idb: Transient instance data buffer.
-
-
-
-void bgfx::setInstanceDataBuffer(VertexBufferHandle _handle, 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.
+
+
-
+
-
+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 -
-
-
_handle – [in] Vertex buffer.
-_start – [in] First instance data.
-_num – [in] Number of data instances.
+- Parameters
-
+
[in] _handle: Vertex buffer.
+[in] _start: First instance data.
+[in] _num: 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 -
-
-
_handle – [in] Vertex buffer.
-_start – [in] First instance data.
-_num – [in] Number of data instances.
+- Parameters
-
+
[in] _handle: Vertex buffer.
+[in] _start: First instance data.
+[in] _num: 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 -
_numInstances – [in] Number of instances.
+- Parameters
-
+
[in] _numInstances: 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 -
-
-
_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.
-
+
- 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.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.
+ +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 -
-
-
_id – [in] View id.
-_program – [in] Program.
-_depth – [in] Depth for sorting.
-_flags – [in] Discard or preserve states. See
BGFX_DISCARD_*.
+- Parameters
-
+
[in] _id: View id.
+[in] _program: Program.
+[in] _depth: Depth for sorting.
+[in] _flags: Discard or preserve states. SeeBGFX_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 -
-
-
_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_*.
+- Parameters
-
+
[in] _id: View id.
+[in] _program: Program.
+[in] _occlusionQuery: Occlusion query.
+[in] _depth: Depth for sorting.
+[in] _flags: Discard or preserve states. SeeBGFX_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 -
-
-
_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_*.
+- 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. SeeBGFX_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
@@ -4990,33 +4649,33 @@ otherwise prefer bgfx::setViewScissor.bgfx_access_t.
-+Public Types
+Public Types
@@ -5025,188 +4684,164 @@ 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 -
-
-
_stage – [in] Compute stage.
-_handle – [in] Index buffer handle.
-_access – [in] Buffer access. See
Access::Enum.
+- Parameters
-
+
[in] _stage: Compute stage.
+[in] _handle: Index buffer handle.
+[in] _access: Buffer access. SeeAccess::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 -
-
-
_stage – [in] Compute stage.
-_handle – [in] Vertex buffer handle.
-_access – [in] Buffer access. See
Access::Enum.
+- Parameters
-
+
[in] _stage: Compute stage.
+[in] _handle: Vertex buffer handle.
+[in] _access: Buffer access. SeeAccess::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 -
-
-
_stage – [in] Compute stage.
-_handle – [in] Dynamic index buffer handle.
-_access – [in] Buffer access. See
Access::Enum.
+- Parameters
-
+
[in] _stage: Compute stage.
+[in] _handle: Dynamic index buffer handle.
+[in] _access: Buffer access. SeeAccess::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 -
-
-
_stage – [in] Compute stage.
-_handle – [in] Dynamic vertex buffer handle.
-_access – [in] Buffer access. See
Access::Enum.
+- Parameters
-
+
[in] _stage: Compute stage.
+[in] _handle: Dynamic vertex buffer handle.
+[in] _access: Buffer access. SeeAccess::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 -
-
-
_stage – [in] Compute stage.
-_handle – [in] Indirect buffer handle.
-_access – [in] Buffer access. See
Access::Enum.
+- Parameters
-
+
[in] _stage: Compute stage.
+[in] _handle: Indirect buffer handle.
+[in] _access: Buffer access. SeeAccess::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 -
-
-
_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.
+- Parameters
-
+
[in] _stage: Texture unit.
+[in] _handle: Texture handle.
+[in] _mip: Mip level.
+[in] _access: Texture access. SeeAccess::Enum.
+[in] _format: 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 -
-
-
_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_*.
+- 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. SeeBGFX_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 -
-
-
_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_*.
+- 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. SeeBGFX_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
@@ -5215,28 +4850,25 @@ otherwise prefer bgfx::setViewScissor.BGFX_TEXTURE_BLIT_DSTflag.- Attention
C99 equivalent is
bgfx_blit.
-
-
-
- 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.
+- 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.
-
-
-
-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
@@ -5245,37 +4877,34 @@ otherwise prefer bgfx::setViewScissor.BGFX_TEXTURE_BLIT_DSTflag.- Attention
C99 equivalent is
bgfx_blit.
-
-
-
- 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.
+- 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.
+ Resources¶
-
-
-
-struct bgfx::Memory¶
-
+struct
bgfx::Memory¶ Memory must be obtained by calling
bgfx::alloc,bgfx::copy, orbgfx::makeRef.- Attention
It is illegal to create this structure on stack and pass it to any bgfx API.
@@ -5285,16 +4914,16 @@ otherwise prefer bgfx::setViewScissor.
-Public Members
+Public Members
@@ -5302,191 +4931,169 @@ 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 -
_size – [in] Size to allocate.
+- Parameters
-
+
[in] _size: 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 -
-
-
_data – [in] Pointer to data to be copied.
-_size – [in] Size of data to be copied.
+- Parameters
-
+
[in] _data: Pointer to data to be copied.
+[in] _size: 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 passReleaseFnfunction pointer to release this memory after it’s consumed, otherwise you must make sure _data is available for at least 2bgfx::framecalls.ReleaseFnfunction must be able to be called from any thread.- Attention
Data passed must be available for at least 2
bgfx::framecalls.- Attention
C99 equivalent are
bgfx_make_ref,bgfx_make_ref_release.
-
-
-
- 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.
+- 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.
+ +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 -
-
-
_handle – [in] Shader handle.
-_uniforms – [in] UniformHandle array where data will be stored.
-_max – [in] Maximum capacity of array.
+- Parameters
-
+
[in] _handle: Shader handle.
+[in] _uniforms: UniformHandle array where data will be stored.
+[in] _max: 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 -
_handle – [in] Shader handle.
+- Parameters
-
+
[in] _handle: 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 -
-
-
_vsh – [in] Vertex shader.
-_fsh – [in] Fragment shader.
-_destroyShaders – [in] If true, shaders will be destroyed when program is destroyed.
+- Parameters
-
+
[in] _vsh: Vertex shader.
+[in] _fsh: Fragment shader.
+[in] _destroyShaders: 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 -
_handle – [in] Program handle.
+- Parameters
-
+
[in] _handle: 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
Uniform names are unique. It’s valid to call
bgfx::createUniformmultiple 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 ofbgfx::destroyUniformmust be called to properly destroy the uniform.Predefined uniforms (declared in
bgfx_shader.sh):-
@@ -5509,60 +5116,50 @@ otherwise prefer bgfx::setViewScissor.
- Attention
C99 equivalent is
bgfx_create_uniform.
-
-
-
- Parameters -
-
-
_name – [in] Uniform name in shader.
-_type – [in] Type of uniform (See:
bgfx::UniformType).
-_num – [in] Number of elements in array.
+- Parameters
-
+
[in] _name: Uniform name in shader.
+[in] _type: Type of uniform (See:bgfx::UniformType).
+[in] _num: 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 -
-
-
_handle – [in] Handle to uniform object.
-_info – [out] Uniform info.
+- Parameters
-
+
[in] _handle: Handle to uniform object.
+[out] _info: Uniform info.
-
-
-
-void bgfx::destroy(UniformHandle _handle)¶
-
+void
bgfx::destroy(UniformHandle _handle)¶ Destroy shader uniform parameter.
- Attention
C99 equivalent is
bgfx_destroy_uniform.
-
-
-
- Parameters -
_handle – [in] Handle to uniform object.
+- Parameters
-
+
[in] _handle: Handle to uniform object.
+
-
-
-
-struct bgfx::UniformType¶
-
+struct
bgfx::UniformType¶ Uniform type enum.
- Attention
C99 equivalent is
@@ -5570,45 +5167,45 @@ otherwise prefer bgfx::setViewScissor.bgfx_uniform_type_t.
-+Public Types
+Public Types
@@ -5617,8 +5214,8 @@ otherwise prefer bgfx::setViewScissor.-
-
-
-struct bgfx::UniformInfo¶
-
+struct
bgfx::UniformInfo¶ Uniform info.
- Attention
C99 equivalent is
@@ -5626,34 +5223,34 @@ otherwise prefer bgfx::setViewScissor.bgfx_uniform_info_t.
+ Vertex Buffers¶
-
-
-
-VertexLayoutHandle bgfx::createVertexLayout(const VertexLayout &_layout)¶
-
+VertexLayoutHandle
bgfx::createVertexLayout(const VertexLayout &_layout)¶ Create vertex layout.
- Attention
C99 equivalent is
@@ -5663,8 +5260,8 @@ otherwise prefer bgfx::setViewScissor.bgfx_create_vertex_layout.
-
-
-
-void bgfx::destroy(VertexLayoutHandle _handle)¶
-
+void
bgfx::destroy(VertexLayoutHandle _handle)¶ Destroy vertex layout.
- Attention
C99 equivalent is
@@ -5674,20 +5271,18 @@ otherwise prefer bgfx::setViewScissor.bgfx_destroy_vertex_layout.
-
-
-
-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 -
-
-
_mem – [in] Vertex buffer data.
-_layout – [in] Vertex layout.
-_flags – [in] Buffer creation flags.
-
+
- Parameters
-
+
[in] _mem: Vertex buffer data.
+[in] _layout: Vertex layout.
+[in] _flags: 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 withBGFX_BUFFER_COMPUTE_WRITEflag it cannot be updated from CPU.
@@ -5698,51 +5293,45 @@ 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 -
-
-
_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.
+- 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.
-
-
-
-void bgfx::destroy(VertexBufferHandle _handle)¶
-
+void
bgfx::destroy(VertexBufferHandle _handle)¶ Destroy static vertex buffer.
- Attention
C99 equivalent is
bgfx_destroy_vertex_buffer.
-
-
-
- Parameters -
_handle – [in] Static vertex buffer handle.
+- Parameters
-
+
[in] _handle: Static vertex buffer handle.
+
-
-
-
-struct bgfx::VertexLayout¶
-
+struct
bgfx::VertexLayout¶ Vertex layout.
- Attention
C99 equivalent is
@@ -5750,29 +5339,27 @@ otherwise prefer bgfx::setViewScissor.bgfx_vertex_layout_t.
-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
-
+
[in] _renderer: Renderer backend type. See:bgfx::RendererType
+
-
-
- Parameters -
_renderer – [in] Renderer backend type. See:
-bgfx::RendererType
-- Returns -
Returns itself.
-
-
-
-
-
-void end()¶
-
+void
end()¶ End VertexLayout.
- Attention
C99 equivalent is
@@ -5782,51 +5369,44 @@ otherwise prefer bgfx::setViewScissor.bgfx_vertex_layout_end.
-
-
-
-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 -
-
-
_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.
+- 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.
-- 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
@@ -5836,87 +5416,87 @@ otherwise prefer bgfx::setViewScissor.bgfx_vertex_layout_decode.
-
-
-
-inline bool has(Attrib::Enum _attrib) const¶
-
+bool
has(Attrib::Enum _attrib) const¶ Returns
trueif VertexLayout contains attribute.-
+
- Return
True if VertexLayout contains attribute.
+- Attention
C99 equivalent is
bgfx_vertex_layout_has.
+- Parameters
-
+
[in] _attrib: Attribute semantics. See:bgfx::Attrib
+
-
-
- Parameters -
_attrib – [in] Attribute semantics. See:
-bgfx::Attrib
-- Returns -
True if VertexLayout contains attribute.
-
-
-
-
-
-inline uint16_t getOffset(Attrib::Enum _attrib) const¶
-
+uint16_t
getOffset(Attrib::Enum _attrib) const¶ Returns relative attribute offset from the vertex.
--
-
- Parameters -
_attrib – [in] Attribute semantics. See:
+bgfx::Attrib-
+
- Return
Relative attribute offset from the vertex.
-- Returns -
Relative attribute offset from the vertex.
+- Parameters
-
+
[in] _attrib: Attribute semantics. See:bgfx::Attrib
+
-
-
-
-inline uint16_t getStride() const¶
-
+uint16_t
getStride() const¶ Returns vertex stride.
--
-
- Returns -
Vertex stride.
+-
+
- Return
Vertex stride.
-
-
-
-inline uint32_t getSize(uint32_t _num) const¶
-
+uint32_t
getSize(uint32_t _num) const¶ Returns size of vertex buffer for number of vertices.
--
-
- Parameters -
_num – [in] Number of vertices.
+-
+
- Return
Size of vertex buffer for number of vertices.
-- Returns -
Size of vertex buffer for number of vertices.
+- Parameters
-
+
[in] _num: Number of vertices.
+
-Public Members
+Public Members
@@ -5924,8 +5504,8 @@ otherwise prefer bgfx::setViewScissor.-
-
-
-struct bgfx::Attrib¶
-
+struct
bgfx::Attrib¶ Vertex attribute enum.
- Attention
C99 equivalent is
@@ -5933,123 +5513,123 @@ otherwise prefer bgfx::setViewScissor.bgfx_attrib_t.
-Public Types
+Public Types
@@ -6058,8 +5638,8 @@ otherwise prefer bgfx::setViewScissor.-
-
-
-struct bgfx::AttribType¶
-
+struct
bgfx::AttribType¶ Vertex attribute type enum.
- Attention
C99 equivalent is
@@ -6067,45 +5647,45 @@ otherwise prefer bgfx::setViewScissor.bgfx_attrib_type_t.
-+Public Types
+Public Types
-
-
-
-enum Enum¶
-
+enum
Enum¶ Attribute types:
Values:
-
-
-
-enumerator Uint10¶
-
+enumerator
Uint10¶ Uint10, availability depends on:
BGFX_CAPS_VERTEX_ATTRIB_UINT10.
-
-enumerator Uint10¶
-
-
-
-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 -
-
-
_num – [in] Number of vertices.
-_layout – [in] Vertex layout.
-_flags – [in] Buffer creation flags.
-
+
- Parameters
-
+
[in] _num: Number of vertices.
+[in] _layout: Vertex layout.
+[in] _flags: 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 withBGFX_BUFFER_COMPUTE_WRITEflag it cannot be updated from CPU.
@@ -6138,27 +5716,23 @@ 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 -
-
-
_mem – [in] Vertex buffer data.
-_layout – [in] Vertex layout.
-_flags – [in] Buffer creation flags.
-
+
- Parameters
-
+
[in] _mem: Vertex buffer data.
+[in] _layout: Vertex layout.
+[in] _flags: 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 withBGFX_BUFFER_COMPUTE_WRITEflag it cannot be updated from CPU.
@@ -6169,104 +5743,88 @@ 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 -
-
-
_handle – [in] Dynamic vertex buffer handle.
-_startVertex – [in] Start vertex.
-_mem – [in] Vertex buffer data.
+- Parameters
-
+
[in] _handle: Dynamic vertex buffer handle.
+[in] _startVertex: Start vertex.
+[in] _mem: 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 -
_handle – [in] Dynamic vertex buffer handle.
+- Parameters
-
+
[in] _handle: 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 -
-
-
_num – [in] Number of required vertices.
-_layout – [in] Vertex layout.
+- Parameters
-
+
[in] _num: Number of required vertices.
+[in] _layout: 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 -
-
-
_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.
+- 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.
+ +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 -
-
-
_mem – [in] Index buffer data.
-_flags – [in] Buffer creation flags.
-
+
- Parameters
-
+
[in] _mem: Index buffer data.
+[in] _flags: 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 withBGFX_BUFFER_COMPUTE_WRITEflag it cannot be updated from CPU.
@@ -6278,58 +5836,53 @@ 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 -
-
-
_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.
+- 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.
-
-
-
-void bgfx::destroy(IndexBufferHandle _handle)¶
-
+void
bgfx::destroy(IndexBufferHandle _handle)¶ Destroy static index buffer.
- Attention
C99 equivalent is
bgfx_destroy_index_buffer.
-
-
-
- Parameters -
_handle – [in] Static index buffer handle.
+- Parameters
-
+
[in] _handle: 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 -
-
-
_num – [in] Number of indices.
-_flags – [in] Buffer creation flags.
-
+
- Parameters
-
+
[in] _num: Number of indices.
+[in] _flags: 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 withBGFX_BUFFER_COMPUTE_WRITEflag it cannot be updated from CPU.
@@ -6340,26 +5893,22 @@ 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 -
-
-
_mem – [in] Index buffer data.
-_flags – [in] Buffer creation flags.
-
+
- Parameters
-
+
[in] _mem: Index buffer data.
+[in] _flags: 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 withBGFX_BUFFER_COMPUTE_WRITEflag it cannot be updated from CPU.
@@ -6370,93 +5919,81 @@ 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 -
-
-
_handle – [in] Dynamic index buffer handle.
-_startIndex – [in] Start index.
-_mem – [in] Index buffer data.
+- Parameters
-
+
[in] _handle: Dynamic index buffer handle.
+[in] _startIndex: Start index.
+[in] _mem: 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 -
_handle – [in] Dynamic index buffer handle.
+- Parameters
-
+
[in] _handle: 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 -
-
-
_num – [in] Number of required indices.
-_index32 – [in] Set to
trueif input indices will be 32-bit.
+- Parameters
-
+
[in] _num: Number of required indices.
+[in] _index32: Set totrueif 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 -
-
-
_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
trueif input indices will be 32-bit.
+- 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 totrueif input indices will be 32-bit.
+ Textures¶
-
-
-
-struct bgfx::TextureFormat¶
-
+struct
bgfx::TextureFormat¶ Texture format enum.
Notation:
diff --git a/build.html b/build.html index 70e4d678a..b839f67cc 100644 --- a/build.html +++ b/build.html @@ -3,10 +3,9 @@ - - - - + + +RGBA16S ^ ^ ^ @@ -6478,466 +6015,466 @@ otherwise prefer bgfx::setViewScissor.
-Public Types
+Public Types
@@ -6946,33 +6483,29 @@ 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. SeeBGFX_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
@@ -6980,58 +6513,58 @@ otherwise prefer bgfx::setViewScissor.bgfx_texture_info_t.
-+Public Members
+Public Members
-
-
-
-TextureFormat::Enum format¶
-
+TextureFormat::Enum
format¶ Texture 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)¶
-
+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 -
-
-
_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.
+- 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.
-
-
-
-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 -
-
-
_mem – [in] DDS, KTX or PVR texture data.
-_flags – [in] Texture creation (see
BGFX_TEXTURE_*.), and sampler (seeBGFX_SAMPLER_*) flags. Default texture sampling mode is linear, and wrap mode is repeat.-
+
- Parameters
-
+
[in] _mem: DDS, KTX or PVR texture data.
+[in] _flags: Texture creation (seeBGFX_TEXTURE_*.), and sampler (seeBGFX_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.
-_skip – [in] Skip top level mips when parsing texture.
-_info – [out] When non-
NULLis specified it returns parsed texture information.
+[in] _skip: Skip top level mips when parsing texture.
+[out] _info: When non-NULLis 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 -
-
-
_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_ARRAYflag is not set.
-_format – [in] Texture format. See:
TextureFormat::Enum.
-_flags – [in] Texture creation (see
BGFX_TEXTURE_*.), and sampler (seeBGFX_SAMPLER_*) flags. Default texture sampling mode is linear, and wrap mode is repeat.-
+
- 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 capsBGFX_CAPS_TEXTURE_2D_ARRAYflag is not set.
+[in] _format: Texture format. See:TextureFormat::Enum.
+[in] _flags: Texture creation (seeBGFX_TEXTURE_*.), and sampler (seeBGFX_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.
-_mem – [in] Texture data. If
_memis non-NULL, created texture will be immutable. If_memis NULL content of the texture is uninitialized. When_numLayersis more than 1, expected memory layout is texture and all mips together for each array element.
+[in] _mem: Texture data. If_memis non-NULL, created texture will be immutable. If_memis NULL content of the texture is uninitialized. When_numLayersis 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 -
-
-
_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_ARRAYflag is not set.
-_format – [in] Texture format. See:
TextureFormat::Enum.
-_flags – [in] Texture creation (see
BGFX_TEXTURE_*.), and sampler (seeBGFX_SAMPLER_*) flags. Default texture sampling mode is linear, and wrap mode is repeat.-
+
- 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 capsBGFX_CAPS_TEXTURE_2D_ARRAYflag is not set.
+[in] _format: Texture format. See:TextureFormat::Enum.
+[in] _flags: Texture creation (seeBGFX_TEXTURE_*.), and sampler (seeBGFX_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.
-
-
-
-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::createTexture2Dfor more info.- Attention
C99 equivalent is
bgfx_update_texture_2d.
-
-
-
- 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.
+- 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.
-
-
-
-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 -
-
-
_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 (seeBGFX_SAMPLER_*) flags. Default texture sampling mode is linear, and wrap mode is repeat.-
+
- 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 (seeBGFX_TEXTURE_*.), and sampler (seeBGFX_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.
-_mem – [in] Texture data. If
_memis non-NULL, created texture will be immutable. If_memis NULL content of the texture is uninitialized.
+[in] _mem: Texture data. If_memis non-NULL, created texture will be immutable. If_memis 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::createTexture3Dfor more info.- Attention
C99 equivalent is
bgfx_update_texture_3d.
-
-
-
- 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.
+- 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.
-
-
-
-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 -
-
-
_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_ARRAYflag is not set.
-_format – [in] Texture format. See:
TextureFormat::Enum.
-_flags – [in] Texture creation (see
BGFX_TEXTURE_*.), and sampler (seeBGFX_SAMPLER_*) flags. Default texture sampling mode is linear, and wrap mode is repeat.-
+
- 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 capsBGFX_CAPS_TEXTURE_CUBE_ARRAYflag is not set.
+[in] _format: Texture format. See:TextureFormat::Enum.
+[in] _flags: Texture creation (seeBGFX_TEXTURE_*.), and sampler (seeBGFX_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.
-_mem – [in] Texture data. If
_memis non-NULL, created texture will be immutable. If_memis NULL content of the texture is uninitialized. When_numLayersis more than 1, expected memory layout is texture and all mips together for each array element.
+[in] _mem: Texture data. If_memis non-NULL, created texture will be immutable. If_memis NULL content of the texture is uninitialized. When_numLayersis 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::createTextureCubefor more info.- Attention
C99 equivalent is
bgfx_update_texture_cube.
-
-
-
- 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.++----------+ +- Parameters
+-
+
[in] _handle: Texture handle.
+[in] _layer: Layers in texture array.
+[in] _side: Cubemap sideBGFX_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: @@ -7291,193 +6795,171 @@ otherwise prefer bgfx::setViewScissor.
-_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.
+[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.
-
-
-
-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_BACKflag.- Attention
Availability depends on:
BGFX_CAPS_TEXTURE_READ_BACK.- Attention
C99 equivalent is
bgfx_read_texture.
-
-
-
- Parameters -
-
-
_handle – [in] Texture handle.
-_data – [in] Destination buffer.
-_mip – [in] Mip level.
+- Parameters
-
+
[in] _handle: Texture handle.
+[in] _data: Destination buffer.
+[in] _mip: 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
+NULLdirect access is not available for this texture. If pointer isUINTPTR_MAXsentinel 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
-NULLdirect access is not available for this texture. If pointer isUINTPTR_MAXsentinel 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 -
_handle – [in] Texture handle.
+- Parameters
-
+
[in] _handle: 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 -
-
-
_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.
-
+
- 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.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 -
-
-
_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.
-
+
- 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.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 -
-
-
_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.
+- 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.
-- Returns -
Handle to frame buffer object.
-
-
-
-
-struct bgfx::Attachment¶
-
+struct
bgfx::Attachment¶ Frame buffer texture attachment info.
- Attention
C99 equivalent is
@@ -7485,61 +6967,61 @@ otherwise prefer bgfx::setViewScissor.bgfx_attachment_t.
-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 -
-
-
_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_*
+- Parameters
-
+
[in] _handle: Render target texture handle.
+[in] _access: Access. SeeAccess::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_*
-
+
-+Public Members
+Public Members
-
-
-
-Access::Enum access¶
-
+Access::Enum
access¶ Attachment access. See
Access::Enum.
-
-
-
-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 -
-
-
_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.
+- 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.
-- 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 -
-
-
_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.
+- 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.
-
-
-
-void bgfx::destroy(FrameBufferHandle _handle)¶
-
+void
bgfx::destroy(FrameBufferHandle _handle)¶ Destroy frame buffer.
- Attention
C99 equivalent is
bgfx_destroy_frame_buffer.
-
-
-
- Parameters -
_handle – [in] Frame buffer handle.
+- Parameters
-
+
[in] _handle: 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 -
-
-
_num – [in] Number of required instances.
-_stride – [in] Stride per instance.
+- Parameters
-
+
[in] _num: Number of required instances.
+[in] _stride: 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 -
-
-
_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.
+- 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.
+ +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 -
_handle – [in] Indirect buffer handle.
+- Parameters
-
+
[in] _handle: 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
@@ -7736,33 +7194,33 @@ otherwise prefer bgfx::setViewScissor.bgfx_occlusion_query_result_t.
-+Public Types
+Public Types
@@ -7771,67 +7229,70 @@ 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 beNULLif 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
NULLif 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 -
_handle – [in] Handle to occlusion query object.
+- Parameters
-
+
[in] _handle: Handle to occlusion query object.
+
Building — bgfx 1.0 documentation @@ -14,28 +13,23 @@ - - - - - - + @@ -57,7 +51,7 @@ - bgfx + bgfx @@ -163,8 +157,6 @@ - - diff --git a/examples.html b/examples.html index 1d3502de4..1b38ce9a5 100644 --- a/examples.html +++ b/examples.html @@ -3,10 +3,9 @@ - - - - + + +Examples — bgfx 1.0 documentation @@ -14,28 +13,23 @@ - - - - - - + @@ -57,7 +51,7 @@ - bgfx + bgfx @@ -146,6 +140,7 @@- 43-denoise
- 44-sss
- 45-bokeh
+- 46-fsr
- API Reference
@@ -192,8 +187,6 @@ - - diff --git a/genindex.html b/genindex.html index e8691213b..302f75fe7 100644 --- a/genindex.html +++ b/genindex.html @@ -3,9 +3,9 @@ - + - +Index — bgfx 1.0 documentation @@ -13,28 +13,23 @@ - - - - - - + @@ -54,7 +49,7 @@ - bgfx + bgfx @@ -137,8 +132,6 @@ - --
-bool bgfx::isTextureValid(uint16_t _depth, bool _cubeMap, uint16_t _numLayers, TextureFormat::Enum _format, uint64_t _flags)¶
BGFX_STATE_PT_[TRISTRIP/LINES/POINTS] - Primitive type. -++ +State Flags¶
Write
-
-
Depth Test
-
-
-
-
Blend Mode
-
-
Blend Equaation
-
-
-
-
Primitive Culling
-
-
Primitive Type
Misc
-
-
-
-
+ +Stencil¶
-
-
+ +Stencil Flags¶
- -+ +Scissor¶
When scissor rectangle is changing per draw call inside the same view use bgfx::setScissor, otherwise prefer bgfx::setViewScissor.
-
-
-
-
+ +Transform¶
-
-
-
-
-
-
+ +Conditional Rendering¶
-
-
+ Buffers¶
-
-
-
-
-
-
-
-
-
-
bgfx_set_state. - - --
-
- -void bgfx::setName(ShaderHandle _handle, const char *_name, int32_t _len = INT32_MAX)¶
BGFX_STATE_PT_[TRISTRIP/LINES/POINTS] - Primitive type. --
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
+
-
-
-
-
-
-
bgfx_encoder_set_state. - - --
-
- -void setState(uint64_t _state, uint32_t _rgba = 0)¶
-
-void setMarker(const char *_marker)¶
-
-enum Enum¶
--
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+