Allocate buffer to pass to bgfx calls. Data will be freed inside bgfx.
Allocate instance data buffer.
Reserve matrices in internal matrix cache.
@attention Pointer returned can be modified until bgfx::frame
is called.
Check for required space and allocate transient vertex and index
buffers. If both space requirements are satisfied function returns
true.
Allocate transient index buffer.
Allocate transient vertex buffer.
Init attachment.
Blit 2D texture region between two 2D textures.
@attention Destination texture must be created with BGFX_TEXTURE_BLIT_DST
flag.
@attention Availability depends on: BGFX_CAPS_TEXTURE_BLIT
.
Calculate amount of memory required for texture.
Allocate buffer and copy data into it. Data will be freed inside bgfx.
Create program with compute shader.
Create empty dynamic index buffer.
Create a dynamic index buffer and initialize it.
Create empty dynamic vertex buffer.
Create dynamic vertex buffer and initialize it.
Create frame buffer (simple).
Create MRT frame buffer from texture handles with specific layer and
mip level.
Create MRT frame buffer from texture handles (simple).
Create frame buffer for multiple window rendering.
@remarks
Frame buffer cannot be used for sampling.
@attention Availability depends on: BGFX_CAPS_SWAP_CHAIN
.
Create frame buffer with size based on back-buffer ratio. Frame buffer will maintain ratio
if back buffer resolution changes.
Create static index buffer.
Create draw indirect buffer.
Create occlusion query.
Create program with vertex and fragment shaders.
Create shader from memory buffer.
Create texture from memory buffer.
Create 2D texture.
Create texture with size based on back-buffer ratio. Texture will maintain ratio
if back buffer resolution changes.
Create 3D texture.
Create Cube texture.
Create shader uniform parameter.
@remarks
Create static vertex buffer.
Create vertex layout.
Clear internal debug text buffer.
Draw image into internal debug text buffer.
Print formatted data to internal debug text character-buffer (VGA-compatible text mode).
Print formatted data from variable argument list to internal debug text character-buffer (VGA-compatible text mode).
Destroy dynamic index buffer.
Destroy dynamic vertex buffer.
Destroy frame buffer.
Destroy static index buffer.
Destroy draw indirect buffer.
Destroy occlusion query.
Destroy program.
Destroy shader.
@remark Once a shader program is created with _handle,
it is safe to destroy that shader.
Destroy texture.
Destroy shader uniform parameter.
Destroy static vertex buffer.
Destroy vertex layout.
Discard previously set state for draw or compute call.
Dispatch compute.
Dispatch compute indirect.
Reserve matrices in internal matrix cache.
@attention Pointer returned can be modified until bgfx::frame
is called.
Begin submitting draw calls from thread.
Blit 2D texture region between two 2D textures.
@attention Destination texture must be created with BGFX_TEXTURE_BLIT_DST
flag.
@attention Availability depends on: BGFX_CAPS_TEXTURE_BLIT
.
Discard previously set state for draw or compute call.
Dispatch compute.
Dispatch compute indirect.
End submitting draw calls from thread.
Set compute dynamic index buffer.
Set compute dynamic vertex buffer.
Set compute index buffer.
Set compute indirect buffer.
Set compute vertex buffer.
Set condition for rendering.
Set index buffer for draw primitive.
Set vertex buffer for draw primitive.
Set compute image from texture.
Set index buffer for draw primitive.
Set number of instances for auto generated instances use in conjunction
with gl_InstanceID.
@attention Availability depends on: BGFX_CAPS_VERTEX_ID
.
Set instance data buffer for draw primitive.
Set instance data buffer for draw primitive.
Set instance data buffer for draw primitive.
Sets a debug marker. This allows you to group graphics calls together for easy browsing in
graphics debugging tools.
Set scissor for draw primitive.
@remark
To scissor for all primitives in view see bgfx::setViewScissor
.
Set scissor from cache for draw primitive.
@remark
To scissor for all primitives in view see bgfx::setViewScissor
.
Set render states for draw primitive.
@remarks
Set stencil test state.
Set texture stage for draw primitive.
Set model matrix for draw primitive. If it is not called,
the model will be rendered with an identity model matrix.
Set model matrix from matrix cache for draw primitive.
Set index buffer for draw primitive.
Set vertex buffer for draw primitive.
Set vertex buffer for draw primitive.
Set shader uniform parameter for draw primitive.
Set vertex buffer for draw primitive.
Set vertex buffer for draw primitive.
Set number of vertices for auto generated vertices use in conjunction
with gl_VertexID.
@attention Availability depends on: BGFX_CAPS_VERTEX_ID
.
Submit primitive for rendering.
Submit primitive for rendering with index and instance data info from
indirect buffer.
@attention Availability depends on: BGFX_CAPS_DRAW_INDIRECT
.
Submit primitive for rendering with index and instance data info and
draw count from indirect buffers.
@attention Availability depends on: BGFX_CAPS_DRAW_INDIRECT_COUNT
.
Submit primitive with occlusion query for rendering.
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.
@remark
These empty draw calls will sort before ordinary draw calls.
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.
Returns number of requested or maximum available instance buffer slots.
Returns number of requested or maximum available indices.
Returns number of requested or maximum available vertices.
Returns renderer capabilities.
@remarks
Library must be initialized.
Returns texture direct access pointer.
@attention Availability depends on: BGFX_CAPS_TEXTURE_DIRECT_ACCESS
. This feature
is available on GPUs that have unified memory architecture (UMA) support.
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.
Returns name of renderer.
Returns current renderer backend API type.
@remarks
Library must be initialized.
Retrieve occlusion query result from previous frame.
Returns the number of uniforms and uniform handles used inside a shader.
@remarks
Only non-predefined uniforms are returned.
Returns performance counters.
@attention Pointer returned is valid until bgfx::frame
is called.
Returns supported backend API renderers.
Obtain texture handle of frame buffer attachment.
Retrieve uniform info.
Initialize the bgfx library.
Validate frame buffer parameters.
Validate texture parameters.
Make reference to data to pass to bgfx. Unlike bgfx::alloc
, this call
doesn’t allocate memory for data. It just copies the _data pointer. You
can pass ReleaseFn
function pointer to release this memory after it’s
consumed, otherwise you must make sure _data is available for at least 2
bgfx::frame
calls. ReleaseFn
function must be able to be called
from any thread.
@attention Data passed must be available for at least 2 bgfx::frame
calls.
Make reference to data to pass to bgfx. Unlike bgfx::alloc
, this call
doesn’t allocate memory for data. It just copies the _data pointer. You
can pass ReleaseFn
function pointer to release this memory after it’s
consumed, otherwise you must make sure _data is available for at least 2
bgfx::frame
calls. ReleaseFn
function must be able to be called
from any thread.
@attention Data passed must be available for at least 2 bgfx::frame
calls.
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.
@returns 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.
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.
@warning Must be called only on render thread.
Read back texture content.
@attention Texture must be created with BGFX_TEXTURE_READ_BACK
flag.
@attention Availability depends on: BGFX_CAPS_TEXTURE_READ_BACK
.
Render frame.
@attention bgfx::renderFrame
is blocking call. It waits for
bgfx::frame
to be called from API thread to process frame.
If timeout value is passed call will timeout and return even
if bgfx::frame
is not called.
@warning This call should be only used on platforms that don’t
allow creating separate rendering thread. If it is called before
to bgfx::init, render thread won’t be created by bgfx::init call.
Request screen shot of window back buffer.
@remarks
bgfx::CallbackI::screenShot
must be implemented.
@attention Frame buffer handle must be created with OS’ target native window handle.
Reset graphic settings and back-buffer size.
@attention This call doesn’t change the window size, it just resizes
the back-buffer. Your windowing code controls the window size.
Reset all view settings to default.
Set compute dynamic index buffer.
Set compute dynamic vertex buffer.
Set compute index buffer.
Set compute indirect buffer.
Set compute vertex buffer.
Set condition for rendering.
Set debug flags.
Set index buffer for draw primitive.
Set vertex buffer for draw primitive.
Set vertex buffer for draw primitive.
Set frame buffer debug name.
Set compute image from texture.
Set index buffer for draw primitive.
Set static index buffer debug name.
Set number of instances for auto generated instances use in conjunction
with gl_InstanceID.
@attention Availability depends on: BGFX_CAPS_VERTEX_ID
.
Set instance data buffer for draw primitive.
Set instance data buffer for draw primitive.
Set instance data buffer for draw primitive.
Sets a debug marker. This allows you to group graphics calls together for easy browsing in
graphics debugging tools.
Set palette color value.
Set palette color value.
Set platform data.
@warning Must be called before bgfx::init
.
Set scissor for draw primitive.
@remark
To scissor for all primitives in view see bgfx::setViewScissor
.
Set scissor from cache for draw primitive.
@remark
To scissor for all primitives in view see bgfx::setViewScissor
.
Set shader debug name.
Set render states for draw primitive.
@remarks
Set stencil test state.
Set texture stage for draw primitive.
Set texture debug name.
Set model matrix for draw primitive. If it is not called,
the model will be rendered with an identity model matrix.
Set model matrix from matrix cache for draw primitive.
Set index buffer for draw primitive.
Set vertex buffer for draw primitive.
Set vertex buffer for draw primitive.
Set shader uniform parameter for draw primitive.
Set vertex buffer for draw primitive.
Set static vertex buffer debug name.
Set vertex buffer for draw primitive.
Set number of vertices for auto generated vertices use in conjunction
with gl_VertexID.
@attention Availability depends on: BGFX_CAPS_VERTEX_ID
.
Set view clear flags.
Set view clear flags with different clear color for each
frame buffer texture. bgfx::setPaletteColor
must be used to set up a
clear color palette.
Set view frame buffer.
@remarks
Not persistent after bgfx::reset
call.
Set view sorting mode.
@remarks
View mode must be set prior calling bgfx::submit
for the view.
Set view name.
@remarks
This is debug only feature.
In graphics debugger view name will appear as:
“nnnc ”
^ ^ ^
| +— compute (C)
+—— view id
Post submit view reordering.
Set view rectangle. Draw primitive outside view will be clipped.
Set view rectangle. Draw primitive outside view will be clipped.
Set view scissor. Draw primitive outside view will be clipped. When
_x, _y, _width and _height are set to 0, scissor will be disabled.
Set view’s view matrix and projection matrix,
all draw primitives in this view will use these two matrices.
Shutdown bgfx library.
Submit primitive for rendering.
Submit primitive for rendering with index and instance data info from
indirect buffer.
@attention Availability depends on: BGFX_CAPS_DRAW_INDIRECT
.
Submit primitive for rendering with index and instance data info and
draw count from indirect buffers.
@attention Availability depends on: BGFX_CAPS_DRAW_INDIRECT_COUNT
.
Submit primitive with occlusion query for rendering.
Convert index buffer for use with different primitive topologies.
Sort indices.
Submit an empty primitive for rendering. Uniforms and draw state
will be applied but no geometry will be submitted.
@remark
These empty draw calls will sort before ordinary draw calls.
Update dynamic index buffer.
Update dynamic vertex buffer.
Update 2D texture.
@attention It’s valid to update only mutable texture. See bgfx::createTexture2D
for more info.
Update 3D texture.
@attention It’s valid to update only mutable texture. See bgfx::createTexture3D
for more info.
Update Cube texture.
@attention It’s valid to update only mutable texture. See bgfx::createTextureCube
for more info.
Converts vertex stream data from one vertex stream format to another.
Add attribute to VertexLayout.
@remarks Must be called between begin/end.
Start VertexLayout.
Decode attribute.
End VertexLayout.
Returns true
if VertexLayout contains attribute.
Skip _num
bytes in vertex stream.
Pack vertex attribute into vertex stream format.
Unpack vertex attribute from vertex stream format.
Weld vertices.