-- Attention
-- C99 equivalent is
bgfx_init_t.
+-
+struct
Init
+Initialization parameters used by bgfx::init.
+
+- Attention
C99 equivalent is bgfx_init_t.
+
-
+
Public Members
--
-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
+-
+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
-Vendor PCI id. If set to BGFX_PCI_ID_NONE it will select the first device.
+-
+uint16_t
vendorId
+Vendor PCI id. If set to BGFX_PCI_ID_NONE it will select the first device.
-BGFX_PCI_ID_NONE - Autoselect adapter.
-BGFX_PCI_ID_SOFTWARE_RASTERIZER - Software rasterizer.
-BGFX_PCI_ID_AMD - AMD adapter.
-BGFX_PCI_ID_INTEL - Intel adapter.
-BGFX_PCI_ID_NVIDIA - nVidia adapter.
+BGFX_PCI_ID_NONE - Autoselect adapter.
+BGFX_PCI_ID_SOFTWARE_RASTERIZER - Software rasterizer.
+BGFX_PCI_ID_AMD - AMD adapter.
+BGFX_PCI_ID_INTEL - Intel adapter.
+BGFX_PCI_ID_NVIDIA - nVidia adapter.
--
-uint16_t
deviceId
+-
+uint16_t
deviceId
Device id. If set to 0 it will select first device, or device with matching id.
--
-bool
debug
+-
+bool
debug
Enable device for debuging.
--
-bool
profile
+-
+bool
profile
Enable device for profiling.
--
-PlatformData
platformData
+-
+PlatformData
platformData
Platform data.
--
-Resolution
resolution
-Backbuffer resolution and reset parameters. See: bgfx::Resolution.
+-
+Resolution
resolution
+Backbuffer resolution and reset parameters. See: bgfx::Resolution.
--
-CallbackI *
callback
-Provide application specific callback interface. See: bgfx::CallbackI
+-
+CallbackI *
callback
+Provide application specific callback interface. See: bgfx::CallbackI
--
-bx::AllocatorI *
allocator
+-
+bx::AllocatorI *
allocator
Custom allocator. When a custom allocator is not specified, bgfx uses the CRT allocator. Bgfx assumes custom allocator is thread safe.
--
-struct
Limits
-
+
-
+struct
Limits
+
Public Members
--
-uint16_t
maxEncoders
+-
+uint16_t
maxEncoders
Maximum number of encoder threads.
--
-uint32_t
transientVbSize
+-
+uint32_t
transientVbSize
Maximum transient vertex buffer size.
--
-uint32_t
transientIbSize
+-
+uint32_t
transientIbSize
Maximum transient index buffer size.
@@ -309,49 +332,49 @@ or
--
-struct
bgfx::Resolution
+-
+struct
Resolution
Backbuffer resolution and reset parameters.
-
-- Attention
-- C99 equivalent is
bgfx_resolution_t.
+
+- Attention
C99 equivalent is bgfx_resolution_t.
+
-
+
Public Members
--
-TextureFormat::Enum
format
+-
+TextureFormat::Enum
format
Backbuffer format.
--
-uint32_t
width
+-
+uint32_t
width
Backbuffer width.
--
-uint32_t
height
+-
+uint32_t
height
Backbuffer height.
--
-uint32_t
reset
+-
+uint32_t
reset
Reset parameters.
--
-uint8_t
numBackBuffers
+-
+uint8_t
numBackBuffers
Number of back buffers.
--
-uint8_t
maxFrameLatency
+-
+uint8_t
maxFrameLatency
Maximum frame latency.
@@ -359,17 +382,16 @@ or
--
-bool
bgfx::init(const Init &_init = {})
+-
+bool
bgfx::init(const Init &_init = {})
Initialize bgfx library.
-
-- Return
-true if initialization was successful.
-- Attention
-- C99 equivalent is
bgfx_init.
-- Parameters
-
-_init: Initialization parameters. See: bgfx::Init for more info.
+
+- Return
true if initialization was successful.
+
+- Attention
C99 equivalent is bgfx_init.
+
+- Parameters
-
@@ -378,62 +400,61 @@ or
-
-
BGFX_PCI_ID_NONE
+BGFX_PCI_ID_NONE
Autoselect adapter.
-
-
BGFX_PCI_ID_SOFTWARE_RASTERIZER
+BGFX_PCI_ID_SOFTWARE_RASTERIZER
Software rasterizer.
-
-
BGFX_PCI_ID_AMD
+BGFX_PCI_ID_AMD
AMD adapter.
-
-
BGFX_PCI_ID_INTEL
+BGFX_PCI_ID_INTEL
Intel adapter.
-
-
BGFX_PCI_ID_NVIDIA
+BGFX_PCI_ID_NVIDIA
nVidia adapter.
--
-struct
bgfx::CallbackI
+-
+struct
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.
-- Attention
-- C99 equivalent is
bgfx_callback_interface_t.
+
+- Remark
’fatal’ and ‘trace’ callbacks can be called from any thread. Other callbacks are called from the render thread.
+
+- Attention
C99 equivalent is bgfx_callback_interface_t.
+
-
+
Public Functions
--
-virtual void
fatal(const char *_filePath, uint16_t _line, Fatal::Enum _code, const char *_str) = 0
-This callback is called on unrecoverable errors. It’s not safe to continue (Exluding _code Fatal::DebugCheck), inform the user and terminate the application.
-
-- Remark
-- Not thread safe and it can be called from any thread.
-- Attention
-- C99 equivalent is
bgfx_callback_vtbl.fatal.
-- Parameters
-
-_filePath: File path where fatal message was generated.
-_line: Line where fatal message was generated.
-_code: Fatal error code.
-_str: More information about error.
+-
+virtual void
fatal(const char *_filePath, uint16_t _line, Fatal::Enum _code, const char *_str) = 0
+This callback is called on unrecoverable errors. It’s not safe to continue (Exluding _code Fatal::DebugCheck), inform the user and terminate the application.
+
+- Remark
Not thread safe and it can be called from any thread.
+
+- Attention
C99 equivalent is bgfx_callback_vtbl.fatal.
+
+- Parameters
+[in] _filePath: File path where fatal message was generated.
+[in] _line: Line where fatal message was generated.
+[in] _code: Fatal error code.
+[in] _str: More information about error.
@@ -441,20 +462,19 @@ or
--
-virtual void
traceVargs(const char *_filePath, uint16_t _line, const char *_format, va_list _argList) = 0
+-
+virtual void
traceVargs(const char *_filePath, uint16_t _line, const char *_format, va_list _argList) = 0
Print debug message.
-
-- Remark
-- Not thread safe and it can be called from any thread.
-- Attention
-- C99 equivalent is
bgfx_callback_vtbl.trace_vargs.
-- Parameters
-
-_filePath: File path where debug message was generated.
-_line: Line where debug message was generated.
-_format: printf style format.
-_argList: Variable arguments list initialized with va_start.
+
+- Remark
Not thread safe and it can be called from any thread.
+
+- Attention
C99 equivalent is bgfx_callback_vtbl.trace_vargs.
+
+- Parameters
+[in] _filePath: File path where debug message was generated.
+[in] _line: Line where debug message was generated.
+[in] _format: printf style format.
+[in] _argList: Variable arguments list initialized with va_start.
@@ -462,20 +482,19 @@ or
--
-virtual void
profilerBegin(const char *_name, uint32_t _abgr, const char *_filePath, uint16_t _line) = 0
+-
+virtual void
profilerBegin(const char *_name, uint32_t _abgr, const char *_filePath, uint16_t _line) = 0
Profiler region begin.
-
-- Remark
-- Not thread safe and it can be called from any thread.
-- Attention
-- C99 equivalent is
bgfx_callback_vtbl.profiler_begin.
-- Parameters
-
-_name: Region name, contains dynamic string.
-_abgr: Color of profiler region.
-_filePath: File path where profilerBegin was called.
-_line: Line where profilerBegin was called.
+
+- Remark
Not thread safe and it can be called from any thread.
+
+- Attention
C99 equivalent is bgfx_callback_vtbl.profiler_begin.
+
+- Parameters
+[in] _name: Region name, contains dynamic string.
+[in] _abgr: Color of profiler region.
+[in] _filePath: File path where profilerBegin was called.
+[in] _line: Line where profilerBegin was called.
@@ -483,20 +502,19 @@ or
--
-virtual void
profilerBeginLiteral(const char *_name, uint32_t _abgr, const char *_filePath, uint16_t _line) = 0
+-
+virtual void
profilerBeginLiteral(const char *_name, uint32_t _abgr, const char *_filePath, uint16_t _line) = 0
Profiler region begin with string literal name.
-
-- Remark
-- Not thread safe and it can be called from any thread.
-- Attention
-- C99 equivalent is
bgfx_callback_vtbl.profiler_begin_literal.
-- Parameters
-
--
-virtual uint32_t
cacheReadSize(uint64_t _id) = 0
+-
+virtual uint32_t
cacheReadSize(uint64_t _id) = 0
Returns the size of a cached item. Returns 0 if no cached item was found.
-
-- Return
-- Number of bytes to read.
-- Attention
-- C99 equivalent is
bgfx_callback_vtbl.cache_read_size.
-- Parameters
-
-_id: Cache id.
+
+- Return
Number of bytes to read.
+
+- Attention
C99 equivalent is bgfx_callback_vtbl.cache_read_size.
+
+- Parameters
-
@@ -535,19 +552,18 @@ or
--
-virtual bool
cacheRead(uint64_t _id, void *_data, uint32_t _size) = 0
+-
+virtual bool
cacheRead(uint64_t _id, void *_data, uint32_t _size) = 0
Read cached item.
-
-- Return
-- True if data is read.
-- Attention
-- C99 equivalent is
bgfx_callback_vtbl.cache_read.
-- Parameters
-
-_id: Cache id.
-_data: Buffer where to read data.
-_size: Size of data to read.
+
+- Return
True if data is read.
+
+- Attention
C99 equivalent is bgfx_callback_vtbl.cache_read.
+
+- Parameters
-
@@ -555,17 +571,16 @@ or
--
-virtual void
cacheWrite(uint64_t _id, const void *_data, uint32_t _size) = 0
+-
+virtual void
cacheWrite(uint64_t _id, const void *_data, uint32_t _size) = 0
Write cached item.
-
-- Attention
-- C99 equivalent is
bgfx_callback_vtbl.cache_write.
-- Parameters
-
-_id: Cache id.
-_data: Data to write.
-_size: Size of data to write.
+
+- Attention
C99 equivalent is bgfx_callback_vtbl.cache_write.
+
+- Parameters
-
@@ -573,21 +588,20 @@ or
--
-virtual void
screenShot(const char *_filePath, uint32_t _width, uint32_t _height, uint32_t _pitch, const void *_data, uint32_t _size, bool _yflip) = 0
+-
+virtual void
screenShot(const char *_filePath, uint32_t _width, uint32_t _height, uint32_t _pitch, const void *_data, uint32_t _size, bool _yflip) = 0
Screenshot captured. Screenshot format is always 4-byte BGRA.
-
-- Attention
-- C99 equivalent is
bgfx_callback_vtbl.screen_shot.
-- Parameters
-
-_filePath: File path.
-_width: Image width.
-_height: Image height.
-_pitch: Number of bytes to skip between the start of each horizontal line of the image.
-_data: Image data.
-_size: Image size.
-_yflip: If true, image origin is bottom left.
+
+- Attention
C99 equivalent is bgfx_callback_vtbl.screen_shot.
+
+- Parameters
+[in] _filePath: File path.
+[in] _width: Image width.
+[in] _height: Image height.
+[in] _pitch: Number of bytes to skip between the start of each horizontal line of the image.
+[in] _data: Image data.
+[in] _size: Image size.
+[in] _yflip: If true, image origin is bottom left.
@@ -595,19 +609,18 @@ or
--
-virtual void
captureBegin(uint32_t _width, uint32_t _height, uint32_t _pitch, TextureFormat::Enum _format, bool _yflip) = 0
+-
+virtual void
captureBegin(uint32_t _width, uint32_t _height, uint32_t _pitch, TextureFormat::Enum _format, bool _yflip) = 0
Called when a video capture begins.
-
-- Attention
-- C99 equivalent is
bgfx_callback_vtbl.capture_begin.
-- Parameters
-
--
-virtual void
captureFrame(const void *_data, uint32_t _size) = 0
+-
+virtual void
captureFrame(const void *_data, uint32_t _size) = 0
Captured frame.
-
-- Attention
-- C99 equivalent is
bgfx_callback_vtbl.capture_frame.
-- Parameters
-
@@ -662,31 +674,30 @@ or
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
--
@@ -695,91 +706,90 @@ or
-
-
BGFX_RESET_NONE
+BGFX_RESET_NONE
No reset flags.
-
-
BGFX_RESET_FULLSCREEN
+BGFX_RESET_FULLSCREEN
Not supported yet.
-
-
BGFX_RESET_MSAA_X2
+BGFX_RESET_MSAA_X2
Enable 2x MSAA.
-
-
BGFX_RESET_MSAA_X4
+BGFX_RESET_MSAA_X4
Enable 4x MSAA.
-
-
BGFX_RESET_MSAA_X8
+BGFX_RESET_MSAA_X8
Enable 8x MSAA.
-
-
BGFX_RESET_MSAA_X16
+BGFX_RESET_MSAA_X16
Enable 16x MSAA.
-
-
BGFX_RESET_VSYNC
+BGFX_RESET_VSYNC
Enable V-Sync.
-
-
BGFX_RESET_MAXANISOTROPY
+BGFX_RESET_MAXANISOTROPY
Turn on/off max anisotropy.
-
-
BGFX_RESET_CAPTURE
+BGFX_RESET_CAPTURE
Begin screen capture.
-
-
BGFX_RESET_FLUSH_AFTER_RENDER
-Flush rendering after submitting to GPU.
+BGFX_RESET_FLUSH_AFTER_RENDER
+Flush rendering after submitting to GPU. This flag specifies where flip occurs. Default behavior is that flip occurs before rendering new frame. This flag only has effect when BGFX_CONFIG_MULTITHREADED=0.
-
-
BGFX_RESET_FLIP_AFTER_RENDER
-This flag specifies where flip occurs. Default behavior is that flip occurs before rendering new frame. This flag only has effect when BGFX_CONFIG_MULTITHREADED=0.
-
+BGFX_RESET_FLIP_AFTER_RENDER
+
-
-
BGFX_RESET_SRGB_BACKBUFFER
+BGFX_RESET_SRGB_BACKBUFFER
Enable sRGB backbuffer.
-
-
BGFX_RESET_HDR10
+BGFX_RESET_HDR10
Enable HDR10 rendering.
-
-
BGFX_RESET_HIDPI
+BGFX_RESET_HIDPI
Enable HiDPI rendering.
-
-
BGFX_RESET_DEPTH_CLAMP
+BGFX_RESET_DEPTH_CLAMP
Enable depth clamp.
@@ -787,17 +797,16 @@ or
Frame
--
-uint32_t
bgfx::frame(bool _capture = false)
+-
+uint32_t
bgfx::frame(bool _capture = false)
Advance to next frame. When using multithreaded renderer, this call just swaps internal buffers, kicks render thread, and returns. In singlethreaded renderer this call does frame rendering.
-
-- Return
-- Current frame number. This might be used in conjunction with double/multi buffering data outside the library and passing it to library via
bgfx::makeRef calls.
-- Attention
-- C99 equivalent is
bgfx_frame.
-- Parameters
-
-_capture: Capture frame with graphics debugger.
+
+- Return
Current frame number. This might be used in conjunction with double/multi buffering data outside the library and passing it to library via bgfx::makeRef calls.
+
+- Attention
C99 equivalent is bgfx_frame.
+
+- Parameters
-
@@ -811,22 +820,21 @@ or
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: 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.
+
+- Attention
C99 equivalent is bgfx_set_debug.
+
+- Parameters
@@ -838,37 +846,36 @@ or ¶
-
-
BGFX_DEBUG_NONE
+BGFX_DEBUG_NONE
No debug.
-
-
BGFX_DEBUG_WIREFRAME
-Enable wireframe for all primitives.
+BGFX_DEBUG_WIREFRAME
+Enable wireframe for all primitives. Enable infinitely fast hardware test. No draw calls will be submitted to driver. It’s useful when profiling to quickly assess bottleneck between CPU and GPU.
-
-
BGFX_DEBUG_IFH
-Enable infinitely fast hardware test. No draw calls will be submitted to driver. It’s useful when profiling to quickly assess bottleneck between CPU and GPU.
-
+BGFX_DEBUG_IFH
+
-
-
BGFX_DEBUG_STATS
+BGFX_DEBUG_STATS
Enable statistics display.
-
-
BGFX_DEBUG_TEXT
+BGFX_DEBUG_TEXT
Enable debug text display.
-
-
BGFX_DEBUG_PROFILER
+BGFX_DEBUG_PROFILER
Enable profiler.
@@ -876,16 +883,15 @@ or
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: Background color.
-_small: Default 8x16 or 8x8 font.
+
+- Attention
C99 equivalent is bgfx_dbg_text_clear.
+
+- Parameters
-
@@ -893,17 +899,16 @@ or
--
-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: 2D position from top-left.
-_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).
-_format: printf style format.
+
+- Attention
C99 equivalent is bgfx_dbg_text_printf.
+
+- Parameters
+[in] _x[in] _y: 2D position from top-left.
+[in] _attr: Color palette. Where top 4-bits represent index of background, and bottom 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).
+[in] _format: printf style format.
@@ -911,18 +916,17 @@ or
--
-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: 2D position from top-left.
-_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).
-_format: printf style format.
-_argList: additional arguments for format string
+
+- Attention
C99 equivalent is bgfx_dbg_text_vprintf.
+
+- Parameters
+[in] _x[in] _y: 2D position from top-left.
+[in] _attr: Color palette. Where top 4-bits represent index of background, and bottom 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).
+[in] _format: printf style format.
+[in] _argList: additional arguments for format string
@@ -930,18 +934,17 @@ or
--
-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
-