Class bgfx
Namespace: Bgfx
Syntax
public static class bgfx
Methods
alloc(UInt32)
Allocate buffer to pass to bgfx calls. Data will be freed inside bgfx.
Declaration
public static bgfx.Memory*alloc(uint _size)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt32 | _size | Size to allocate. |
Returns
| Type | Description |
|---|---|
| bgfx.Memory* |
alloc_instance_data_buffer(bgfx.InstanceDataBuffer*, UInt32, UInt16)
Allocate instance data buffer.
Declaration
public static void alloc_instance_data_buffer(bgfx.InstanceDataBuffer*_idb, uint _num, ushort _stride)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.InstanceDataBuffer* | _idb | InstanceDataBuffer structure is filled and is valid for duration of frame, and it can be reused for multiple draw calls. |
| UInt32 | _num | Number of instances. |
| UInt16 | _stride | Instance stride. Must be multiple of 16. |
alloc_transform(bgfx.Transform*, UInt16)
Reserve matrices in internal matrix cache.
@attention Pointer returned can be modifed until bgfx::frame is called.
Declaration
public static uint alloc_transform(bgfx.Transform*_transform, ushort _num)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Transform* | _transform | Pointer to |
| UInt16 | _num | Number of matrices. |
Returns
| Type | Description |
|---|---|
| UInt32 |
alloc_transient_buffers(bgfx.TransientVertexBuffer*, bgfx.VertexLayout*, UInt32, bgfx.TransientIndexBuffer*, UInt32)
Check for required space and allocate transient vertex and index buffers. If both space requirements are satisfied function returns true. @remarks Only 16-bit index buffer is supported.
Declaration
public static bool alloc_transient_buffers(bgfx.TransientVertexBuffer*_tvb, bgfx.VertexLayout*_layout, uint _numVertices, bgfx.TransientIndexBuffer*_tib, uint _numIndices)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.TransientVertexBuffer* | _tvb | TransientVertexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls. |
| bgfx.VertexLayout* | _layout | Vertex layout. |
| UInt32 | _numVertices | Number of vertices to allocate. |
| bgfx.TransientIndexBuffer* | _tib | TransientIndexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls. |
| UInt32 | _numIndices | Number of indices to allocate. |
Returns
| Type | Description |
|---|---|
| Boolean |
alloc_transient_index_buffer(bgfx.TransientIndexBuffer*, UInt32)
Allocate transient index buffer. @remarks Only 16-bit index buffer is supported.
Declaration
public static void alloc_transient_index_buffer(bgfx.TransientIndexBuffer*_tib, uint _num)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.TransientIndexBuffer* | _tib | TransientIndexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls. |
| UInt32 | _num | Number of indices to allocate. |
alloc_transient_vertex_buffer(bgfx.TransientVertexBuffer*, UInt32, bgfx.VertexLayout*)
Allocate transient vertex buffer.
Declaration
public static void alloc_transient_vertex_buffer(bgfx.TransientVertexBuffer*_tvb, uint _num, bgfx.VertexLayout*_layout)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.TransientVertexBuffer* | _tvb | TransientVertexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls. |
| UInt32 | _num | Number of vertices to allocate. |
| bgfx.VertexLayout* | _layout | Vertex layout. |
AllocatorInit()
Declaration
public static IntPtr AllocatorInit()
Returns
| Type | Description |
|---|---|
| IntPtr |
attachment_init(bgfx.Attachment*, bgfx.TextureHandle, bgfx.Access, UInt16, UInt16, Byte)
Init attachment.
Declaration
public static void attachment_init(bgfx.Attachment*_this, bgfx.TextureHandle _handle, bgfx.Access _access, ushort _layer, ushort _mip, byte _resolve)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Attachment* | _this | |
| bgfx.TextureHandle | _handle | Render target texture handle. |
| bgfx.Access | _access | Access. See |
| UInt16 | _layer | Cubemap side or depth layer/slice. |
| UInt16 | _mip | Mip level. |
| Byte | _resolve | Resolve flags. See: |
blit(UInt16, bgfx.TextureHandle, Byte, UInt16, UInt16, UInt16, bgfx.TextureHandle, Byte, UInt16, UInt16, UInt16, UInt16, UInt16, UInt16)
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.
Declaration
public static void blit(ushort _id, bgfx.TextureHandle _dst, byte _dstMip, ushort _dstX, ushort _dstY, ushort _dstZ, bgfx.TextureHandle _src, byte _srcMip, ushort _srcX, ushort _srcY, ushort _srcZ, ushort _width, ushort _height, ushort _depth)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _id | View id. |
| bgfx.TextureHandle | _dst | Destination texture handle. |
| Byte | _dstMip | Destination texture mip level. |
| UInt16 | _dstX | Destination texture X position. |
| UInt16 | _dstY | Destination texture Y position. |
| UInt16 | _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. |
| bgfx.TextureHandle | _src | Source texture handle. |
| Byte | _srcMip | Source texture mip level. |
| UInt16 | _srcX | Source texture X position. |
| UInt16 | _srcY | Source texture Y position. |
| UInt16 | _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. |
| UInt16 | _width | Width of region. |
| UInt16 | _height | Height of region. |
| UInt16 | _depth | If texture is 3D this argument represents depth of region, otherwise it's unused. |
calc_texture_size(bgfx.TextureInfo*, UInt16, UInt16, UInt16, Boolean, Boolean, UInt16, bgfx.TextureFormat)
Calculate amount of memory required for texture.
Declaration
public static void calc_texture_size(bgfx.TextureInfo*_info, ushort _width, ushort _height, ushort _depth, bool _cubeMap, bool _hasMips, ushort _numLayers, bgfx.TextureFormat _format)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.TextureInfo* | _info | Resulting texture info structure. See: |
| UInt16 | _width | Width. |
| UInt16 | _height | Height. |
| UInt16 | _depth | Depth dimension of volume texture. |
| Boolean | _cubeMap | Indicates that texture contains cubemap. |
| Boolean | _hasMips | Indicates that texture contains full mip-map chain. |
| UInt16 | _numLayers | Number of layers in texture array. |
| bgfx.TextureFormat | _format | Texture format. See: |
CallbacksDeInit()
Declaration
public static void CallbacksDeInit()
CallbacksInit(IntPtr, IntPtr)
Declaration
public static IntPtr CallbacksInit(IntPtr funcBegin, IntPtr funcEnd)
Parameters
| Type | Name | Description |
|---|---|---|
| IntPtr | funcBegin | |
| IntPtr | funcEnd |
Returns
| Type | Description |
|---|---|
| IntPtr |
CallbacksLock(Byte**, bgfx.CallbackEntry**)
Declaration
public static int CallbacksLock(byte **destMem, bgfx.CallbackEntry**destLog)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte** | destMem | |
| bgfx.CallbackEntry** | destLog |
Returns
| Type | Description |
|---|---|
| Int32 |
CallbacksUnlockAndClear()
Declaration
public static void CallbacksUnlockAndClear()
copy(Void*, UInt32)
Allocate buffer and copy data into it. Data will be freed inside bgfx.
Declaration
public static bgfx.Memory*copy(void *_data, uint _size)
Parameters
| Type | Name | Description |
|---|---|---|
| Void* | _data | Pointer to data to be copied. |
| UInt32 | _size | Size of data to be copied. |
Returns
| Type | Description |
|---|---|
| bgfx.Memory* |
create_compute_program(bgfx.ShaderHandle, Boolean)
Create program with compute shader.
Declaration
public static bgfx.ProgramHandle create_compute_program(bgfx.ShaderHandle _csh, bool _destroyShaders)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.ShaderHandle | _csh | Compute shader. |
| Boolean | _destroyShaders | If true, shaders will be destroyed when program is destroyed. |
Returns
| Type | Description |
|---|---|
| bgfx.ProgramHandle |
create_dynamic_index_buffer(UInt32, UInt16)
Create empty dynamic index buffer.
Declaration
public static bgfx.DynamicIndexBufferHandle create_dynamic_index_buffer(uint _num, ushort _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt32 | _num | Number of indices. |
| UInt16 | _flags | Buffer creation flags. - |
Returns
| Type | Description |
|---|---|
| bgfx.DynamicIndexBufferHandle |
create_dynamic_index_buffer_mem(bgfx.Memory*, UInt16)
Create dynamic index buffer and initialized it.
Declaration
public static bgfx.DynamicIndexBufferHandle create_dynamic_index_buffer_mem(bgfx.Memory*_mem, ushort _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Memory* | _mem | Index buffer data. |
| UInt16 | _flags | Buffer creation flags. - |
Returns
| Type | Description |
|---|---|
| bgfx.DynamicIndexBufferHandle |
create_dynamic_vertex_buffer(UInt32, bgfx.VertexLayout*, UInt16)
Create empty dynamic vertex buffer.
Declaration
public static bgfx.DynamicVertexBufferHandle create_dynamic_vertex_buffer(uint _num, bgfx.VertexLayout*_layout, ushort _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt32 | _num | Number of vertices. |
| bgfx.VertexLayout* | _layout | Vertex layout. |
| UInt16 | _flags | Buffer creation flags. - |
Returns
| Type | Description |
|---|---|
| bgfx.DynamicVertexBufferHandle |
create_dynamic_vertex_buffer_mem(bgfx.Memory*, bgfx.VertexLayout*, UInt16)
Create dynamic vertex buffer and initialize it.
Declaration
public static bgfx.DynamicVertexBufferHandle create_dynamic_vertex_buffer_mem(bgfx.Memory*_mem, bgfx.VertexLayout*_layout, ushort _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Memory* | _mem | Vertex buffer data. |
| bgfx.VertexLayout* | _layout | Vertex layout. |
| UInt16 | _flags | Buffer creation flags. - |
Returns
| Type | Description |
|---|---|
| bgfx.DynamicVertexBufferHandle |
create_frame_buffer(UInt16, UInt16, bgfx.TextureFormat, UInt64)
Create frame buffer (simple).
Declaration
public static bgfx.FrameBufferHandle create_frame_buffer(ushort _width, ushort _height, bgfx.TextureFormat _format, ulong _textureFlags)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _width | Texture width. |
| UInt16 | _height | Texture height. |
| bgfx.TextureFormat | _format | Texture format. See: |
| UInt64 | _textureFlags | Texture creation (see |
Returns
| Type | Description |
|---|---|
| bgfx.FrameBufferHandle |
create_frame_buffer_from_attachment(Byte, bgfx.Attachment*, Boolean)
Create MRT frame buffer from texture handles with specific layer and mip level.
Declaration
public static bgfx.FrameBufferHandle create_frame_buffer_from_attachment(byte _num, bgfx.Attachment*_attachment, bool _destroyTexture)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte | _num | Number of attachements. |
| bgfx.Attachment* | _attachment | Attachment texture info. See: |
| Boolean | _destroyTexture | If true, textures will be destroyed when frame buffer is destroyed. |
Returns
| Type | Description |
|---|---|
| bgfx.FrameBufferHandle |
create_frame_buffer_from_handles(Byte, bgfx.TextureHandle*, Boolean)
Create MRT frame buffer from texture handles (simple).
Declaration
public static bgfx.FrameBufferHandle create_frame_buffer_from_handles(byte _num, bgfx.TextureHandle*_handles, bool _destroyTexture)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte | _num | Number of texture handles. |
| bgfx.TextureHandle* | _handles | Texture attachments. |
| Boolean | _destroyTexture | If true, textures will be destroyed when frame buffer is destroyed. |
Returns
| Type | Description |
|---|---|
| bgfx.FrameBufferHandle |
create_frame_buffer_from_nwh(Void*, UInt16, UInt16, bgfx.TextureFormat, bgfx.TextureFormat)
Create frame buffer for multiple window rendering.
@remarks
Frame buffer cannot be used for sampling.
@attention Availability depends on: BGFX_CAPS_SWAP_CHAIN.
Declaration
public static bgfx.FrameBufferHandle create_frame_buffer_from_nwh(void *_nwh, ushort _width, ushort _height, bgfx.TextureFormat _format, bgfx.TextureFormat _depthFormat)
Parameters
| Type | Name | Description |
|---|---|---|
| Void* | _nwh | OS' target native window handle. |
| UInt16 | _width | Window back buffer width. |
| UInt16 | _height | Window back buffer height. |
| bgfx.TextureFormat | _format | Window back buffer color format. |
| bgfx.TextureFormat | _depthFormat | Window back buffer depth format. |
Returns
| Type | Description |
|---|---|
| bgfx.FrameBufferHandle |
create_frame_buffer_scaled(bgfx.BackbufferRatio, bgfx.TextureFormat, UInt64)
Create frame buffer with size based on backbuffer ratio. Frame buffer will maintain ratio if back buffer resolution changes.
Declaration
public static bgfx.FrameBufferHandle create_frame_buffer_scaled(bgfx.BackbufferRatio _ratio, bgfx.TextureFormat _format, ulong _textureFlags)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.BackbufferRatio | _ratio | Frame buffer size in respect to back-buffer size. See: |
| bgfx.TextureFormat | _format | Texture format. See: |
| UInt64 | _textureFlags | Texture creation (see |
Returns
| Type | Description |
|---|---|
| bgfx.FrameBufferHandle |
create_index_buffer(bgfx.Memory*, UInt16)
Create static index buffer.
Declaration
public static bgfx.IndexBufferHandle create_index_buffer(bgfx.Memory*_mem, ushort _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Memory* | _mem | Index buffer data. |
| UInt16 | _flags | Buffer creation flags. - |
Returns
| Type | Description |
|---|---|
| bgfx.IndexBufferHandle |
create_indirect_buffer(UInt32)
Create draw indirect buffer.
Declaration
public static bgfx.IndirectBufferHandle create_indirect_buffer(uint _num)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt32 | _num | Number of indirect calls. |
Returns
| Type | Description |
|---|---|
| bgfx.IndirectBufferHandle |
create_occlusion_query()
Create occlusion query.
Declaration
public static bgfx.OcclusionQueryHandle create_occlusion_query()
Returns
| Type | Description |
|---|---|
| bgfx.OcclusionQueryHandle |
create_program(bgfx.ShaderHandle, bgfx.ShaderHandle, Boolean)
Create program with vertex and fragment shaders.
Declaration
public static bgfx.ProgramHandle create_program(bgfx.ShaderHandle _vsh, bgfx.ShaderHandle _fsh, bool _destroyShaders)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.ShaderHandle | _vsh | Vertex shader. |
| bgfx.ShaderHandle | _fsh | Fragment shader. |
| Boolean | _destroyShaders | If true, shaders will be destroyed when program is destroyed. |
Returns
| Type | Description |
|---|---|
| bgfx.ProgramHandle |
create_shader(bgfx.Memory*)
Create shader from memory buffer.
Declaration
public static bgfx.ShaderHandle create_shader(bgfx.Memory*_mem)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Memory* | _mem | Shader binary. |
Returns
| Type | Description |
|---|---|
| bgfx.ShaderHandle |
create_texture(bgfx.Memory*, UInt64, Byte, bgfx.TextureInfo*)
Create texture from memory buffer.
Declaration
public static bgfx.TextureHandle create_texture(bgfx.Memory*_mem, ulong _flags, byte _skip, bgfx.TextureInfo*_info)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Memory* | _mem | DDS, KTX or PVR texture binary data. |
| UInt64 | _flags | Texture creation (see |
| Byte | _skip | Skip top level mips when parsing texture. |
| bgfx.TextureInfo* | _info | When non- |
Returns
| Type | Description |
|---|---|
| bgfx.TextureHandle |
create_texture_2d(UInt16, UInt16, Boolean, UInt16, bgfx.TextureFormat, UInt64, bgfx.Memory*)
Create 2D texture.
Declaration
public static bgfx.TextureHandle create_texture_2d(ushort _width, ushort _height, bool _hasMips, ushort _numLayers, bgfx.TextureFormat _format, ulong _flags, bgfx.Memory*_mem)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _width | Width. |
| UInt16 | _height | Height. |
| Boolean | _hasMips | Indicates that texture contains full mip-map chain. |
| UInt16 | _numLayers | Number of layers in texture array. Must be 1 if caps |
| bgfx.TextureFormat | _format | Texture format. See: |
| UInt64 | _flags | Texture creation (see |
| bgfx.Memory* | _mem | Texture data. If |
Returns
| Type | Description |
|---|---|
| bgfx.TextureHandle |
create_texture_2d_scaled(bgfx.BackbufferRatio, Boolean, UInt16, bgfx.TextureFormat, UInt64)
Create texture with size based on backbuffer ratio. Texture will maintain ratio if back buffer resolution changes.
Declaration
public static bgfx.TextureHandle create_texture_2d_scaled(bgfx.BackbufferRatio _ratio, bool _hasMips, ushort _numLayers, bgfx.TextureFormat _format, ulong _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.BackbufferRatio | _ratio | Texture size in respect to back-buffer size. See: |
| Boolean | _hasMips | Indicates that texture contains full mip-map chain. |
| UInt16 | _numLayers | Number of layers in texture array. Must be 1 if caps |
| bgfx.TextureFormat | _format | Texture format. See: |
| UInt64 | _flags | Texture creation (see |
Returns
| Type | Description |
|---|---|
| bgfx.TextureHandle |
create_texture_3d(UInt16, UInt16, UInt16, Boolean, bgfx.TextureFormat, UInt64, bgfx.Memory*)
Create 3D texture.
Declaration
public static bgfx.TextureHandle create_texture_3d(ushort _width, ushort _height, ushort _depth, bool _hasMips, bgfx.TextureFormat _format, ulong _flags, bgfx.Memory*_mem)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _width | Width. |
| UInt16 | _height | Height. |
| UInt16 | _depth | Depth. |
| Boolean | _hasMips | Indicates that texture contains full mip-map chain. |
| bgfx.TextureFormat | _format | Texture format. See: |
| UInt64 | _flags | Texture creation (see |
| bgfx.Memory* | _mem | Texture data. If |
Returns
| Type | Description |
|---|---|
| bgfx.TextureHandle |
create_texture_cube(UInt16, Boolean, UInt16, bgfx.TextureFormat, UInt64, bgfx.Memory*)
Create Cube texture.
Declaration
public static bgfx.TextureHandle create_texture_cube(ushort _size, bool _hasMips, ushort _numLayers, bgfx.TextureFormat _format, ulong _flags, bgfx.Memory*_mem)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _size | Cube side size. |
| Boolean | _hasMips | Indicates that texture contains full mip-map chain. |
| UInt16 | _numLayers | Number of layers in texture array. Must be 1 if caps |
| bgfx.TextureFormat | _format | Texture format. See: |
| UInt64 | _flags | Texture creation (see |
| bgfx.Memory* | _mem | Texture data. If |
Returns
| Type | Description |
|---|---|
| bgfx.TextureHandle |
create_uniform(String, bgfx.UniformType, UInt16)
Create shader uniform parameter. @remarks
- 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): u_viewRect vec4(x, y, width, height)- view rectangle for current view, in pixels.u_viewTexel vec4(1.0/width, 1.0/height, undef, undef)- inverse width and heightu_view mat4- view matrixu_invView mat4- inverted view matrixu_proj mat4- projection matrixu_invProj mat4- inverted projection matrixu_viewProj mat4- concatenated view projection matrixu_invViewProj mat4- concatenated inverted view projection matrixu_model mat4[BGFX_CONFIG_MAX_BONES]- array of model matrices.u_modelView mat4- concatenated model view matrix, only first model matrix from array is used.u_modelViewProj mat4- concatenated model view projection matrix.u_alphaRef float- alpha reference value for alpha test.
Declaration
public static bgfx.UniformHandle create_uniform(string _name, bgfx.UniformType _type, ushort _num)
Parameters
| Type | Name | Description |
|---|---|---|
| String | _name | Uniform name in shader. |
| bgfx.UniformType | _type | Type of uniform (See: |
| UInt16 | _num | Number of elements in array. |
Returns
| Type | Description |
|---|---|
| bgfx.UniformHandle |
create_vertex_buffer(bgfx.Memory*, bgfx.VertexLayout*, UInt16)
Create static vertex buffer.
Declaration
public static bgfx.VertexBufferHandle create_vertex_buffer(bgfx.Memory*_mem, bgfx.VertexLayout*_layout, ushort _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Memory* | _mem | Vertex buffer data. |
| bgfx.VertexLayout* | _layout | Vertex layout. |
| UInt16 | _flags | Buffer creation flags. - |
Returns
| Type | Description |
|---|---|
| bgfx.VertexBufferHandle |
create_vertex_layout(bgfx.VertexLayout*)
Create vertex layout.
Declaration
public static bgfx.VertexLayoutHandle create_vertex_layout(bgfx.VertexLayout*_layout)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.VertexLayout* | _layout | Vertex layout. |
Returns
| Type | Description |
|---|---|
| bgfx.VertexLayoutHandle |
dbg_text_clear(Byte, Boolean)
Clear internal debug text buffer.
Declaration
public static void dbg_text_clear(byte _attr, bool _small)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte | _attr | Background color. |
| Boolean | _small | Default 8x16 or 8x8 font. |
dbg_text_image(UInt16, UInt16, UInt16, UInt16, Void*, UInt16)
Draw image into internal debug text buffer.
Declaration
public static void dbg_text_image(ushort _x, ushort _y, ushort _width, ushort _height, void *_data, ushort _pitch)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _x | Position x from the left corner of the window. |
| UInt16 | _y | Position y from the top corner of the window. |
| UInt16 | _width | Image width. |
| UInt16 | _height | Image height. |
| Void* | _data | Raw image data (character/attribute raw encoding). |
| UInt16 | _pitch | Image pitch in bytes. |
dbg_text_printf(UInt16, UInt16, Byte, String, String)
Print formatted data to internal debug text character-buffer (VGA-compatible text mode).
Declaration
public static void dbg_text_printf(ushort _x, ushort _y, byte _attr, string _format, string args)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _x | Position x from the left corner of the window. |
| UInt16 | _y | Position y from the top corner of the window. |
| Byte | _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). |
| String | _format |
|
| String | args |
dbg_text_vprintf(UInt16, UInt16, Byte, String, IntPtr)
Print formatted data from variable argument list to internal debug text character-buffer (VGA-compatible text mode).
Declaration
public static void dbg_text_vprintf(ushort _x, ushort _y, byte _attr, string _format, IntPtr _argList)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _x | Position x from the left corner of the window. |
| UInt16 | _y | Position y from the top corner of the window. |
| Byte | _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). |
| String | _format |
|
| IntPtr | _argList | Variable arguments list for format string. |
destroy_dynamic_index_buffer(bgfx.DynamicIndexBufferHandle)
Destroy dynamic index buffer.
Declaration
public static void destroy_dynamic_index_buffer(bgfx.DynamicIndexBufferHandle _handle)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.DynamicIndexBufferHandle | _handle | Dynamic index buffer handle. |
destroy_dynamic_vertex_buffer(bgfx.DynamicVertexBufferHandle)
Destroy dynamic vertex buffer.
Declaration
public static void destroy_dynamic_vertex_buffer(bgfx.DynamicVertexBufferHandle _handle)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.DynamicVertexBufferHandle | _handle | Dynamic vertex buffer handle. |
destroy_frame_buffer(bgfx.FrameBufferHandle)
Destroy frame buffer.
Declaration
public static void destroy_frame_buffer(bgfx.FrameBufferHandle _handle)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.FrameBufferHandle | _handle | Frame buffer handle. |
destroy_index_buffer(bgfx.IndexBufferHandle)
Destroy static index buffer.
Declaration
public static void destroy_index_buffer(bgfx.IndexBufferHandle _handle)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.IndexBufferHandle | _handle | Static index buffer handle. |
destroy_indirect_buffer(bgfx.IndirectBufferHandle)
Destroy draw indirect buffer.
Declaration
public static void destroy_indirect_buffer(bgfx.IndirectBufferHandle _handle)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.IndirectBufferHandle | _handle | Indirect buffer handle. |
destroy_occlusion_query(bgfx.OcclusionQueryHandle)
Destroy occlusion query.
Declaration
public static void destroy_occlusion_query(bgfx.OcclusionQueryHandle _handle)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.OcclusionQueryHandle | _handle | Handle to occlusion query object. |
destroy_program(bgfx.ProgramHandle)
Destroy program.
Declaration
public static void destroy_program(bgfx.ProgramHandle _handle)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.ProgramHandle | _handle | Program handle. |
destroy_shader(bgfx.ShaderHandle)
Destroy shader. @remark Once a shader program is created with _handle, it is safe to destroy that shader.
Declaration
public static void destroy_shader(bgfx.ShaderHandle _handle)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.ShaderHandle | _handle | Shader handle. |
destroy_texture(bgfx.TextureHandle)
Destroy texture.
Declaration
public static void destroy_texture(bgfx.TextureHandle _handle)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.TextureHandle | _handle | Texture handle. |
destroy_uniform(bgfx.UniformHandle)
Destroy shader uniform parameter.
Declaration
public static void destroy_uniform(bgfx.UniformHandle _handle)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.UniformHandle | _handle | Handle to uniform object. |
destroy_vertex_buffer(bgfx.VertexBufferHandle)
Destroy static vertex buffer.
Declaration
public static void destroy_vertex_buffer(bgfx.VertexBufferHandle _handle)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.VertexBufferHandle | _handle | Static vertex buffer handle. |
destroy_vertex_layout(bgfx.VertexLayoutHandle)
Destroy vertex layout.
Declaration
public static void destroy_vertex_layout(bgfx.VertexLayoutHandle _layoutHandle)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.VertexLayoutHandle | _layoutHandle | Vertex layout handle. |
discard(Byte)
Discard previously set state for draw or compute call.
Declaration
public static void discard(byte _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte | _flags | Draw/compute states to discard. |
dispatch(UInt16, bgfx.ProgramHandle, UInt32, UInt32, UInt32, Byte)
Dispatch compute.
Declaration
public static void dispatch(ushort _id, bgfx.ProgramHandle _program, uint _numX, uint _numY, uint _numZ, byte _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _id | View id. |
| bgfx.ProgramHandle | _program | Compute program. |
| UInt32 | _numX | Number of groups X. |
| UInt32 | _numY | Number of groups Y. |
| UInt32 | _numZ | Number of groups Z. |
| Byte | _flags | Discard or preserve states. See |
dispatch_indirect(UInt16, bgfx.ProgramHandle, bgfx.IndirectBufferHandle, UInt16, UInt16, Byte)
Dispatch compute indirect.
Declaration
public static void dispatch_indirect(ushort _id, bgfx.ProgramHandle _program, bgfx.IndirectBufferHandle _indirectHandle, ushort _start, ushort _num, byte _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _id | View id. |
| bgfx.ProgramHandle | _program | Compute program. |
| bgfx.IndirectBufferHandle | _indirectHandle | Indirect buffer. |
| UInt16 | _start | First element in indirect buffer. |
| UInt16 | _num | Number of dispatches. |
| Byte | _flags | Discard or preserve states. See |
encoder_alloc_transform(bgfx.Encoder*, bgfx.Transform*, UInt16)
Reserve matrices in internal matrix cache.
@attention Pointer returned can be modifed until bgfx::frame is called.
Declaration
public static uint encoder_alloc_transform(bgfx.Encoder*_this, bgfx.Transform*_transform, ushort _num)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| bgfx.Transform* | _transform | Pointer to |
| UInt16 | _num | Number of matrices. |
Returns
| Type | Description |
|---|---|
| UInt32 |
encoder_begin(Boolean)
Begin submitting draw calls from thread.
Declaration
public static bgfx.Encoder*encoder_begin(bool _forThread)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | _forThread | Explicitly request an encoder for a worker thread. |
Returns
| Type | Description |
|---|---|
| bgfx.Encoder* |
encoder_blit(bgfx.Encoder*, UInt16, bgfx.TextureHandle, Byte, UInt16, UInt16, UInt16, bgfx.TextureHandle, Byte, UInt16, UInt16, UInt16, UInt16, UInt16, UInt16)
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.
Declaration
public static void encoder_blit(bgfx.Encoder*_this, ushort _id, bgfx.TextureHandle _dst, byte _dstMip, ushort _dstX, ushort _dstY, ushort _dstZ, bgfx.TextureHandle _src, byte _srcMip, ushort _srcX, ushort _srcY, ushort _srcZ, ushort _width, ushort _height, ushort _depth)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| UInt16 | _id | View id. |
| bgfx.TextureHandle | _dst | Destination texture handle. |
| Byte | _dstMip | Destination texture mip level. |
| UInt16 | _dstX | Destination texture X position. |
| UInt16 | _dstY | Destination texture Y position. |
| UInt16 | _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. |
| bgfx.TextureHandle | _src | Source texture handle. |
| Byte | _srcMip | Source texture mip level. |
| UInt16 | _srcX | Source texture X position. |
| UInt16 | _srcY | Source texture Y position. |
| UInt16 | _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. |
| UInt16 | _width | Width of region. |
| UInt16 | _height | Height of region. |
| UInt16 | _depth | If texture is 3D this argument represents depth of region, otherwise it's unused. |
encoder_discard(bgfx.Encoder*, Byte)
Discard previously set state for draw or compute call.
Declaration
public static void encoder_discard(bgfx.Encoder*_this, byte _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| Byte | _flags | Discard or preserve states. See |
encoder_dispatch(bgfx.Encoder*, UInt16, bgfx.ProgramHandle, UInt32, UInt32, UInt32, Byte)
Dispatch compute.
Declaration
public static void encoder_dispatch(bgfx.Encoder*_this, ushort _id, bgfx.ProgramHandle _program, uint _numX, uint _numY, uint _numZ, byte _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| UInt16 | _id | View id. |
| bgfx.ProgramHandle | _program | Compute program. |
| UInt32 | _numX | Number of groups X. |
| UInt32 | _numY | Number of groups Y. |
| UInt32 | _numZ | Number of groups Z. |
| Byte | _flags | Discard or preserve states. See |
encoder_dispatch_indirect(bgfx.Encoder*, UInt16, bgfx.ProgramHandle, bgfx.IndirectBufferHandle, UInt16, UInt16, Byte)
Dispatch compute indirect.
Declaration
public static void encoder_dispatch_indirect(bgfx.Encoder*_this, ushort _id, bgfx.ProgramHandle _program, bgfx.IndirectBufferHandle _indirectHandle, ushort _start, ushort _num, byte _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| UInt16 | _id | View id. |
| bgfx.ProgramHandle | _program | Compute program. |
| bgfx.IndirectBufferHandle | _indirectHandle | Indirect buffer. |
| UInt16 | _start | First element in indirect buffer. |
| UInt16 | _num | Number of dispatches. |
| Byte | _flags | Discard or preserve states. See |
encoder_end(bgfx.Encoder*)
End submitting draw calls from thread.
Declaration
public static void encoder_end(bgfx.Encoder*_encoder)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _encoder | Encoder. |
encoder_set_compute_dynamic_index_buffer(bgfx.Encoder*, Byte, bgfx.DynamicIndexBufferHandle, bgfx.Access)
Set compute dynamic index buffer.
Declaration
public static void encoder_set_compute_dynamic_index_buffer(bgfx.Encoder*_this, byte _stage, bgfx.DynamicIndexBufferHandle _handle, bgfx.Access _access)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| Byte | _stage | Compute stage. |
| bgfx.DynamicIndexBufferHandle | _handle | Dynamic index buffer handle. |
| bgfx.Access | _access | Buffer access. See |
encoder_set_compute_dynamic_vertex_buffer(bgfx.Encoder*, Byte, bgfx.DynamicVertexBufferHandle, bgfx.Access)
Set compute dynamic vertex buffer.
Declaration
public static void encoder_set_compute_dynamic_vertex_buffer(bgfx.Encoder*_this, byte _stage, bgfx.DynamicVertexBufferHandle _handle, bgfx.Access _access)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| Byte | _stage | Compute stage. |
| bgfx.DynamicVertexBufferHandle | _handle | Dynamic vertex buffer handle. |
| bgfx.Access | _access | Buffer access. See |
encoder_set_compute_index_buffer(bgfx.Encoder*, Byte, bgfx.IndexBufferHandle, bgfx.Access)
Set compute index buffer.
Declaration
public static void encoder_set_compute_index_buffer(bgfx.Encoder*_this, byte _stage, bgfx.IndexBufferHandle _handle, bgfx.Access _access)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| Byte | _stage | Compute stage. |
| bgfx.IndexBufferHandle | _handle | Index buffer handle. |
| bgfx.Access | _access | Buffer access. See |
encoder_set_compute_indirect_buffer(bgfx.Encoder*, Byte, bgfx.IndirectBufferHandle, bgfx.Access)
Set compute indirect buffer.
Declaration
public static void encoder_set_compute_indirect_buffer(bgfx.Encoder*_this, byte _stage, bgfx.IndirectBufferHandle _handle, bgfx.Access _access)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| Byte | _stage | Compute stage. |
| bgfx.IndirectBufferHandle | _handle | Indirect buffer handle. |
| bgfx.Access | _access | Buffer access. See |
encoder_set_compute_vertex_buffer(bgfx.Encoder*, Byte, bgfx.VertexBufferHandle, bgfx.Access)
Set compute vertex buffer.
Declaration
public static void encoder_set_compute_vertex_buffer(bgfx.Encoder*_this, byte _stage, bgfx.VertexBufferHandle _handle, bgfx.Access _access)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| Byte | _stage | Compute stage. |
| bgfx.VertexBufferHandle | _handle | Vertex buffer handle. |
| bgfx.Access | _access | Buffer access. See |
encoder_set_condition(bgfx.Encoder*, bgfx.OcclusionQueryHandle, Boolean)
Set condition for rendering.
Declaration
public static void encoder_set_condition(bgfx.Encoder*_this, bgfx.OcclusionQueryHandle _handle, bool _visible)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| bgfx.OcclusionQueryHandle | _handle | Occlusion query handle. |
| Boolean | _visible | Render if occlusion query is visible. |
encoder_set_dynamic_index_buffer(bgfx.Encoder*, bgfx.DynamicIndexBufferHandle, UInt32, UInt32)
Set index buffer for draw primitive.
Declaration
public static void encoder_set_dynamic_index_buffer(bgfx.Encoder*_this, bgfx.DynamicIndexBufferHandle _handle, uint _firstIndex, uint _numIndices)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| bgfx.DynamicIndexBufferHandle | _handle | Dynamic index buffer. |
| UInt32 | _firstIndex | First index to render. |
| UInt32 | _numIndices | Number of indices to render. |
encoder_set_dynamic_vertex_buffer(bgfx.Encoder*, Byte, bgfx.DynamicVertexBufferHandle, UInt32, UInt32, bgfx.VertexLayoutHandle)
Set vertex buffer for draw primitive.
Declaration
public static void encoder_set_dynamic_vertex_buffer(bgfx.Encoder*_this, byte _stream, bgfx.DynamicVertexBufferHandle _handle, uint _startVertex, uint _numVertices, bgfx.VertexLayoutHandle _layoutHandle)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| Byte | _stream | Vertex stream. |
| bgfx.DynamicVertexBufferHandle | _handle | Dynamic vertex buffer. |
| UInt32 | _startVertex | First vertex to render. |
| UInt32 | _numVertices | Number of vertices to render. |
| bgfx.VertexLayoutHandle | _layoutHandle | Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used. |
encoder_set_image(bgfx.Encoder*, Byte, bgfx.TextureHandle, Byte, bgfx.Access, bgfx.TextureFormat)
Set compute image from texture.
Declaration
public static void encoder_set_image(bgfx.Encoder*_this, byte _stage, bgfx.TextureHandle _handle, byte _mip, bgfx.Access _access, bgfx.TextureFormat _format)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| Byte | _stage | Compute stage. |
| bgfx.TextureHandle | _handle | Texture handle. |
| Byte | _mip | Mip level. |
| bgfx.Access | _access | Image access. See |
| bgfx.TextureFormat | _format | Texture format. See: |
encoder_set_index_buffer(bgfx.Encoder*, bgfx.IndexBufferHandle, UInt32, UInt32)
Set index buffer for draw primitive.
Declaration
public static void encoder_set_index_buffer(bgfx.Encoder*_this, bgfx.IndexBufferHandle _handle, uint _firstIndex, uint _numIndices)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| bgfx.IndexBufferHandle | _handle | Index buffer. |
| UInt32 | _firstIndex | First index to render. |
| UInt32 | _numIndices | Number of indices to render. |
encoder_set_instance_count(bgfx.Encoder*, UInt32)
Set number of instances for auto generated instances use in conjuction
with gl_InstanceID.
@attention Availability depends on: BGFX_CAPS_VERTEX_ID.
Declaration
public static void encoder_set_instance_count(bgfx.Encoder*_this, uint _numInstances)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| UInt32 | _numInstances |
encoder_set_instance_data_buffer(bgfx.Encoder*, bgfx.InstanceDataBuffer*, UInt32, UInt32)
Set instance data buffer for draw primitive.
Declaration
public static void encoder_set_instance_data_buffer(bgfx.Encoder*_this, bgfx.InstanceDataBuffer*_idb, uint _start, uint _num)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| bgfx.InstanceDataBuffer* | _idb | Transient instance data buffer. |
| UInt32 | _start | First instance data. |
| UInt32 | _num | Number of data instances. |
encoder_set_instance_data_from_dynamic_vertex_buffer(bgfx.Encoder*, bgfx.DynamicVertexBufferHandle, UInt32, UInt32)
Set instance data buffer for draw primitive.
Declaration
public static void encoder_set_instance_data_from_dynamic_vertex_buffer(bgfx.Encoder*_this, bgfx.DynamicVertexBufferHandle _handle, uint _startVertex, uint _num)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| bgfx.DynamicVertexBufferHandle | _handle | Dynamic vertex buffer. |
| UInt32 | _startVertex | First instance data. |
| UInt32 | _num | Number of data instances. |
encoder_set_instance_data_from_vertex_buffer(bgfx.Encoder*, bgfx.VertexBufferHandle, UInt32, UInt32)
Set instance data buffer for draw primitive.
Declaration
public static void encoder_set_instance_data_from_vertex_buffer(bgfx.Encoder*_this, bgfx.VertexBufferHandle _handle, uint _startVertex, uint _num)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| bgfx.VertexBufferHandle | _handle | Vertex buffer. |
| UInt32 | _startVertex | First instance data. |
| UInt32 | _num | Number of data instances. Set instance data buffer for draw primitive. |
encoder_set_marker(bgfx.Encoder*, String)
Sets a debug marker. This allows you to group graphics calls together for easy browsing in graphics debugging tools.
Declaration
public static void encoder_set_marker(bgfx.Encoder*_this, string _marker)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| String | _marker | Marker string. |
encoder_set_scissor(bgfx.Encoder*, UInt16, UInt16, UInt16, UInt16)
Set scissor for draw primitive.
@remark
To scissor for all primitives in view see bgfx::setViewScissor.
Declaration
public static ushort encoder_set_scissor(bgfx.Encoder*_this, ushort _x, ushort _y, ushort _width, ushort _height)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| UInt16 | _x | Position x from the left corner of the window. |
| UInt16 | _y | Position y from the top corner of the window. |
| UInt16 | _width | Width of view scissor region. |
| UInt16 | _height | Height of view scissor region. |
Returns
| Type | Description |
|---|---|
| UInt16 |
encoder_set_scissor_cached(bgfx.Encoder*, UInt16)
Set scissor from cache for draw primitive.
@remark
To scissor for all primitives in view see bgfx::setViewScissor.
Declaration
public static void encoder_set_scissor_cached(bgfx.Encoder*_this, ushort _cache)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| UInt16 | _cache | Index in scissor cache. |
encoder_set_state(bgfx.Encoder*, UInt64, UInt32)
Set render states for draw primitive. @remarks
- To setup more complex states use:
BGFX_STATE_ALPHA_REF(_ref),BGFX_STATE_POINT_SIZE(_size),BGFX_STATE_BLEND_FUNC(_src, _dst),BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA),BGFX_STATE_BLEND_EQUATION(_equation),BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA) BGFX_STATE_BLEND_EQUATION_ADDis set when no other blend equation is specified.
Declaration
public static void encoder_set_state(bgfx.Encoder*_this, ulong _state, uint _rgba)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| UInt64 | _state | State flags. Default state for primitive type is triangles. See: |
| UInt32 | _rgba | Sets blend factor used by |
encoder_set_stencil(bgfx.Encoder*, UInt32, UInt32)
Set stencil test state.
Declaration
public static void encoder_set_stencil(bgfx.Encoder*_this, uint _fstencil, uint _bstencil)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| UInt32 | _fstencil | Front stencil state. |
| UInt32 | _bstencil | Back stencil state. If back is set to |
encoder_set_texture(bgfx.Encoder*, Byte, bgfx.UniformHandle, bgfx.TextureHandle, UInt32)
Set texture stage for draw primitive.
Declaration
public static void encoder_set_texture(bgfx.Encoder*_this, byte _stage, bgfx.UniformHandle _sampler, bgfx.TextureHandle _handle, uint _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| Byte | _stage | Texture unit. |
| bgfx.UniformHandle | _sampler | Program sampler. |
| bgfx.TextureHandle | _handle | Texture handle. |
| UInt32 | _flags | Texture sampling mode. Default value UINT32_MAX uses texture sampling settings from the texture. - |
encoder_set_transform(bgfx.Encoder*, Void*, UInt16)
Set model matrix for draw primitive. If it is not called, the model will be rendered with an identity model matrix.
Declaration
public static uint encoder_set_transform(bgfx.Encoder*_this, void *_mtx, ushort _num)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| Void* | _mtx | Pointer to first matrix in array. |
| UInt16 | _num | Number of matrices in array. |
Returns
| Type | Description |
|---|---|
| UInt32 |
encoder_set_transform_cached(bgfx.Encoder*, UInt32, UInt16)
Set model matrix from matrix cache for draw primitive.
Declaration
public static void encoder_set_transform_cached(bgfx.Encoder*_this, uint _cache, ushort _num)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| UInt32 | _cache | Index in matrix cache. |
| UInt16 | _num | Number of matrices from cache. |
encoder_set_transient_index_buffer(bgfx.Encoder*, bgfx.TransientIndexBuffer*, UInt32, UInt32)
Set index buffer for draw primitive.
Declaration
public static void encoder_set_transient_index_buffer(bgfx.Encoder*_this, bgfx.TransientIndexBuffer*_tib, uint _firstIndex, uint _numIndices)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| bgfx.TransientIndexBuffer* | _tib | Transient index buffer. |
| UInt32 | _firstIndex | First index to render. |
| UInt32 | _numIndices | Number of indices to render. |
encoder_set_transient_vertex_buffer(bgfx.Encoder*, Byte, bgfx.TransientVertexBuffer*, UInt32, UInt32, bgfx.VertexLayoutHandle)
Set vertex buffer for draw primitive.
Declaration
public static void encoder_set_transient_vertex_buffer(bgfx.Encoder*_this, byte _stream, bgfx.TransientVertexBuffer*_tvb, uint _startVertex, uint _numVertices, bgfx.VertexLayoutHandle _layoutHandle)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| Byte | _stream | Vertex stream. |
| bgfx.TransientVertexBuffer* | _tvb | Transient vertex buffer. |
| UInt32 | _startVertex | First vertex to render. |
| UInt32 | _numVertices | Number of vertices to render. |
| bgfx.VertexLayoutHandle | _layoutHandle | Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used. |
encoder_set_uniform(bgfx.Encoder*, bgfx.UniformHandle, Void*, UInt16)
Set shader uniform parameter for draw primitive.
Declaration
public static void encoder_set_uniform(bgfx.Encoder*_this, bgfx.UniformHandle _handle, void *_value, ushort _num)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| bgfx.UniformHandle | _handle | Uniform. |
| Void* | _value | Pointer to uniform data. |
| UInt16 | _num | Number of elements. Passing |
encoder_set_vertex_buffer(bgfx.Encoder*, Byte, bgfx.VertexBufferHandle, UInt32, UInt32, bgfx.VertexLayoutHandle)
Set vertex buffer for draw primitive.
Declaration
public static void encoder_set_vertex_buffer(bgfx.Encoder*_this, byte _stream, bgfx.VertexBufferHandle _handle, uint _startVertex, uint _numVertices, bgfx.VertexLayoutHandle _layoutHandle)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| Byte | _stream | Vertex stream. |
| bgfx.VertexBufferHandle | _handle | Vertex buffer. |
| UInt32 | _startVertex | First vertex to render. |
| UInt32 | _numVertices | Number of vertices to render. |
| bgfx.VertexLayoutHandle | _layoutHandle | Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used. |
encoder_set_vertex_count(bgfx.Encoder*, UInt32)
Set number of vertices for auto generated vertices use in conjuction
with gl_VertexID.
@attention Availability depends on: BGFX_CAPS_VERTEX_ID.
Declaration
public static void encoder_set_vertex_count(bgfx.Encoder*_this, uint _numVertices)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| UInt32 | _numVertices | Number of vertices. |
encoder_submit(bgfx.Encoder*, UInt16, bgfx.ProgramHandle, UInt32, Byte)
Submit primitive for rendering.
Declaration
public static void encoder_submit(bgfx.Encoder*_this, ushort _id, bgfx.ProgramHandle _program, uint _depth, byte _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| UInt16 | _id | View id. |
| bgfx.ProgramHandle | _program | Program. |
| UInt32 | _depth | Depth for sorting. |
| Byte | _flags | Discard or preserve states. See |
encoder_submit_indirect(bgfx.Encoder*, UInt16, bgfx.ProgramHandle, bgfx.IndirectBufferHandle, UInt16, UInt16, UInt32, Byte)
Submit primitive for rendering with index and instance data info from indirect buffer.
Declaration
public static void encoder_submit_indirect(bgfx.Encoder*_this, ushort _id, bgfx.ProgramHandle _program, bgfx.IndirectBufferHandle _indirectHandle, ushort _start, ushort _num, uint _depth, byte _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| UInt16 | _id | View id. |
| bgfx.ProgramHandle | _program | Program. |
| bgfx.IndirectBufferHandle | _indirectHandle | Indirect buffer. |
| UInt16 | _start | First element in indirect buffer. |
| UInt16 | _num | Number of dispatches. |
| UInt32 | _depth | Depth for sorting. |
| Byte | _flags | Discard or preserve states. See |
encoder_submit_occlusion_query(bgfx.Encoder*, UInt16, bgfx.ProgramHandle, bgfx.OcclusionQueryHandle, UInt32, Byte)
Submit primitive with occlusion query for rendering.
Declaration
public static void encoder_submit_occlusion_query(bgfx.Encoder*_this, ushort _id, bgfx.ProgramHandle _program, bgfx.OcclusionQueryHandle _occlusionQuery, uint _depth, byte _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| UInt16 | _id | View id. |
| bgfx.ProgramHandle | _program | Program. |
| bgfx.OcclusionQueryHandle | _occlusionQuery | Occlusion query. |
| UInt32 | _depth | Depth for sorting. |
| Byte | _flags | Discard or preserve states. See |
encoder_touch(bgfx.Encoder*, UInt16)
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.
Declaration
public static void encoder_touch(bgfx.Encoder*_this, ushort _id)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Encoder* | _this | |
| UInt16 | _id | View id. |
frame(Boolean)
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.
Declaration
public static uint frame(bool _capture)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | _capture | Capture frame with graphics debugger. |
Returns
| Type | Description |
|---|---|
| UInt32 |
get_avail_instance_data_buffer(UInt32, UInt16)
Returns number of requested or maximum available instance buffer slots.
Declaration
public static uint get_avail_instance_data_buffer(uint _num, ushort _stride)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt32 | _num | Number of required instances. |
| UInt16 | _stride | Stride per instance. |
Returns
| Type | Description |
|---|---|
| UInt32 |
get_avail_transient_index_buffer(UInt32)
Returns number of requested or maximum available indices.
Declaration
public static uint get_avail_transient_index_buffer(uint _num)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt32 | _num | Number of required indices. |
Returns
| Type | Description |
|---|---|
| UInt32 |
get_avail_transient_vertex_buffer(UInt32, bgfx.VertexLayout*)
Returns number of requested or maximum available vertices.
Declaration
public static uint get_avail_transient_vertex_buffer(uint _num, bgfx.VertexLayout*_layout)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt32 | _num | Number of required vertices. |
| bgfx.VertexLayout* | _layout | Vertex layout. |
Returns
| Type | Description |
|---|---|
| UInt32 |
get_caps()
Returns renderer capabilities. @remarks Library must be initialized.
Declaration
public static bgfx.Caps*get_caps()
Returns
| Type | Description |
|---|---|
| bgfx.Caps* |
get_direct_access_ptr(bgfx.TextureHandle)
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.
Declaration
public static void *get_direct_access_ptr(bgfx.TextureHandle _handle)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.TextureHandle | _handle | Texture handle. |
Returns
| Type | Description |
|---|---|
| Void* |
get_internal_data()
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.
Declaration
public static bgfx.InternalData*get_internal_data()
Returns
| Type | Description |
|---|---|
| bgfx.InternalData* |
get_renderer_name(bgfx.RendererType)
Returns name of renderer.
Declaration
public static IntPtr get_renderer_name(bgfx.RendererType _type)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.RendererType | _type | Renderer backend type. See: |
Returns
| Type | Description |
|---|---|
| IntPtr |
get_renderer_type()
Returns current renderer backend API type. @remarks Library must be initialized.
Declaration
public static bgfx.RendererType get_renderer_type()
Returns
| Type | Description |
|---|---|
| bgfx.RendererType |
get_result(bgfx.OcclusionQueryHandle, Int32*)
Retrieve occlusion query result from previous frame.
Declaration
public static bgfx.OcclusionQueryResult get_result(bgfx.OcclusionQueryHandle _handle, int *_result)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.OcclusionQueryHandle | _handle | Handle to occlusion query object. |
| Int32* | _result | Number of pixels that passed test. This argument can be |
Returns
| Type | Description |
|---|---|
| bgfx.OcclusionQueryResult |
get_shader_uniforms(bgfx.ShaderHandle, bgfx.UniformHandle*, UInt16)
Returns the number of uniforms and uniform handles used inside a shader. @remarks Only non-predefined uniforms are returned.
Declaration
public static ushort get_shader_uniforms(bgfx.ShaderHandle _handle, bgfx.UniformHandle*_uniforms, ushort _max)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.ShaderHandle | _handle | Shader handle. |
| bgfx.UniformHandle* | _uniforms | UniformHandle array where data will be stored. |
| UInt16 | _max | Maximum capacity of array. |
Returns
| Type | Description |
|---|---|
| UInt16 |
get_stats()
Returns performance counters.
@attention Pointer returned is valid until bgfx::frame is called.
Declaration
public static bgfx.Stats*get_stats()
Returns
| Type | Description |
|---|---|
| bgfx.Stats* |
get_supported_renderers(Byte, bgfx.RendererType*)
Returns supported backend API renderers.
Declaration
public static byte get_supported_renderers(byte _max, bgfx.RendererType*_enum)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte | _max | Maximum number of elements in _enum array. |
| bgfx.RendererType* | _enum | Array where supported renderers will be written. |
Returns
| Type | Description |
|---|---|
| Byte |
get_texture(bgfx.FrameBufferHandle, Byte)
Obtain texture handle of frame buffer attachment.
Declaration
public static bgfx.TextureHandle get_texture(bgfx.FrameBufferHandle _handle, byte _attachment)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.FrameBufferHandle | _handle | Frame buffer handle. |
| Byte | _attachment |
Returns
| Type | Description |
|---|---|
| bgfx.TextureHandle |
get_uniform_info(bgfx.UniformHandle, bgfx.UniformInfo*)
Retrieve uniform info.
Declaration
public static void get_uniform_info(bgfx.UniformHandle _handle, bgfx.UniformInfo*_info)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.UniformHandle | _handle | Handle to uniform object. |
| bgfx.UniformInfo* | _info | Uniform info. |
init(bgfx.Init*)
Initialize bgfx library.
Declaration
public static bool init(bgfx.Init*_init)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Init* | _init | Initialization parameters. See: |
Returns
| Type | Description |
|---|---|
| Boolean |
init_ctor(bgfx.Init*)
Declaration
public static void init_ctor(bgfx.Init*_init)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.Init* | _init |
is_texture_valid(UInt16, Boolean, UInt16, bgfx.TextureFormat, UInt64)
Validate texture parameters.
Declaration
public static bool is_texture_valid(ushort _depth, bool _cubeMap, ushort _numLayers, bgfx.TextureFormat _format, ulong _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _depth | Depth dimension of volume texture. |
| Boolean | _cubeMap | Indicates that texture contains cubemap. |
| UInt16 | _numLayers | Number of layers in texture array. |
| bgfx.TextureFormat | _format | Texture format. See: |
| UInt64 | _flags | Texture flags. See |
Returns
| Type | Description |
|---|---|
| Boolean |
make_ref(Void*, UInt32)
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.
Declaration
public static bgfx.Memory*make_ref(void *_data, uint _size)
Parameters
| Type | Name | Description |
|---|---|---|
| Void* | _data | Pointer to data. |
| UInt32 | _size | Size of data. |
Returns
| Type | Description |
|---|---|
| bgfx.Memory* |
make_ref_release(Void*, UInt32, IntPtr, Void*)
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.
Declaration
public static bgfx.Memory*make_ref_release(void *_data, uint _size, IntPtr _releaseFn, void *_userData)
Parameters
| Type | Name | Description |
|---|---|---|
| Void* | _data | Pointer to data. |
| UInt32 | _size | Size of data. |
| IntPtr | _releaseFn | Callback function to release memory after use. |
| Void* | _userData | User data to be passed to callback function. |
Returns
| Type | Description |
|---|---|
| bgfx.Memory* |
override_internal_texture(bgfx.TextureHandle, UInt16, UInt16, Byte, bgfx.TextureFormat, UInt64)
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.
Declaration
public static UIntPtr override_internal_texture(bgfx.TextureHandle _handle, ushort _width, ushort _height, byte _numMips, bgfx.TextureFormat _format, ulong _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.TextureHandle | _handle | Texture handle. |
| UInt16 | _width | Width. |
| UInt16 | _height | Height. |
| Byte | _numMips | Number of mip-maps. |
| bgfx.TextureFormat | _format | Texture format. See: |
| UInt64 | _flags | Texture creation (see |
Returns
| Type | Description |
|---|---|
| UIntPtr |
override_internal_texture_ptr(bgfx.TextureHandle, UIntPtr)
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.
Declaration
public static UIntPtr override_internal_texture_ptr(bgfx.TextureHandle _handle, UIntPtr _ptr)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.TextureHandle | _handle | Texture handle. |
| UIntPtr | _ptr | Native API pointer to texture. |
Returns
| Type | Description |
|---|---|
| UIntPtr |
read_texture(bgfx.TextureHandle, Void*, Byte)
Read back texture content.
@attention Texture must be created with BGFX_TEXTURE_READ_BACK flag.
@attention Availability depends on: BGFX_CAPS_TEXTURE_READ_BACK.
Declaration
public static uint read_texture(bgfx.TextureHandle _handle, void *_data, byte _mip)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.TextureHandle | _handle | Texture handle. |
| Void* | _data | Destination buffer. |
| Byte | _mip | Mip level. |
Returns
| Type | Description |
|---|---|
| UInt32 |
render_frame(Int32)
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.
Declaration
public static bgfx.RenderFrame render_frame(int _msecs)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | _msecs | Timeout in milliseconds. |
Returns
| Type | Description |
|---|---|
| bgfx.RenderFrame |
request_screen_shot(bgfx.FrameBufferHandle, String)
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.
Declaration
public static void request_screen_shot(bgfx.FrameBufferHandle _handle, string _filePath)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.FrameBufferHandle | _handle | Frame buffer handle. If handle is |
| String | _filePath | Will be passed to |
reset(UInt32, UInt32, UInt32, bgfx.TextureFormat)
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.
Declaration
public static void reset(uint _width, uint _height, uint _flags, bgfx.TextureFormat _format)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt32 | _width | Back-buffer width. |
| UInt32 | _height | Back-buffer height. |
| UInt32 | _flags | See: |
| bgfx.TextureFormat | _format | Texture format. See: |
reset_view(UInt16)
Reset all view settings to default.
Declaration
public static void reset_view(ushort _id)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _id |
set_compute_dynamic_index_buffer(Byte, bgfx.DynamicIndexBufferHandle, bgfx.Access)
Set compute dynamic index buffer.
Declaration
public static void set_compute_dynamic_index_buffer(byte _stage, bgfx.DynamicIndexBufferHandle _handle, bgfx.Access _access)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte | _stage | Compute stage. |
| bgfx.DynamicIndexBufferHandle | _handle | Dynamic index buffer handle. |
| bgfx.Access | _access | Buffer access. See |
set_compute_dynamic_vertex_buffer(Byte, bgfx.DynamicVertexBufferHandle, bgfx.Access)
Set compute dynamic vertex buffer.
Declaration
public static void set_compute_dynamic_vertex_buffer(byte _stage, bgfx.DynamicVertexBufferHandle _handle, bgfx.Access _access)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte | _stage | Compute stage. |
| bgfx.DynamicVertexBufferHandle | _handle | Dynamic vertex buffer handle. |
| bgfx.Access | _access | Buffer access. See |
set_compute_index_buffer(Byte, bgfx.IndexBufferHandle, bgfx.Access)
Set compute index buffer.
Declaration
public static void set_compute_index_buffer(byte _stage, bgfx.IndexBufferHandle _handle, bgfx.Access _access)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte | _stage | Compute stage. |
| bgfx.IndexBufferHandle | _handle | Index buffer handle. |
| bgfx.Access | _access | Buffer access. See |
set_compute_indirect_buffer(Byte, bgfx.IndirectBufferHandle, bgfx.Access)
Set compute indirect buffer.
Declaration
public static void set_compute_indirect_buffer(byte _stage, bgfx.IndirectBufferHandle _handle, bgfx.Access _access)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte | _stage | Compute stage. |
| bgfx.IndirectBufferHandle | _handle | Indirect buffer handle. |
| bgfx.Access | _access | Buffer access. See |
set_compute_vertex_buffer(Byte, bgfx.VertexBufferHandle, bgfx.Access)
Set compute vertex buffer.
Declaration
public static void set_compute_vertex_buffer(byte _stage, bgfx.VertexBufferHandle _handle, bgfx.Access _access)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte | _stage | Compute stage. |
| bgfx.VertexBufferHandle | _handle | Vertex buffer handle. |
| bgfx.Access | _access | Buffer access. See |
set_condition(bgfx.OcclusionQueryHandle, Boolean)
Set condition for rendering.
Declaration
public static void set_condition(bgfx.OcclusionQueryHandle _handle, bool _visible)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.OcclusionQueryHandle | _handle | Occlusion query handle. |
| Boolean | _visible | Render if occlusion query is visible. |
set_debug(UInt32)
Set debug flags.
Declaration
public static void set_debug(uint _debug)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt32 | _debug | Available flags: - |
set_dynamic_index_buffer(bgfx.DynamicIndexBufferHandle, UInt32, UInt32)
Set index buffer for draw primitive.
Declaration
public static void set_dynamic_index_buffer(bgfx.DynamicIndexBufferHandle _handle, uint _firstIndex, uint _numIndices)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.DynamicIndexBufferHandle | _handle | Dynamic index buffer. |
| UInt32 | _firstIndex | First index to render. |
| UInt32 | _numIndices | Number of indices to render. |
set_dynamic_vertex_buffer(Byte, bgfx.DynamicVertexBufferHandle, UInt32, UInt32)
Set vertex buffer for draw primitive.
Declaration
public static void set_dynamic_vertex_buffer(byte _stream, bgfx.DynamicVertexBufferHandle _handle, uint _startVertex, uint _numVertices)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte | _stream | Vertex stream. |
| bgfx.DynamicVertexBufferHandle | _handle | Dynamic vertex buffer. |
| UInt32 | _startVertex | First vertex to render. |
| UInt32 | _numVertices | Number of vertices to render. |
set_frame_buffer_name(bgfx.FrameBufferHandle, String, Int32)
Set frame buffer debug name.
Declaration
public static void set_frame_buffer_name(bgfx.FrameBufferHandle _handle, string _name, int _len)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.FrameBufferHandle | _handle | Frame buffer handle. |
| String | _name | Frame buffer name. |
| Int32 | _len | Frame buffer name length (if length is INT32_MAX, it's expected that _name is zero terminated string. |
set_image(Byte, bgfx.TextureHandle, Byte, bgfx.Access, bgfx.TextureFormat)
Set compute image from texture.
Declaration
public static void set_image(byte _stage, bgfx.TextureHandle _handle, byte _mip, bgfx.Access _access, bgfx.TextureFormat _format)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte | _stage | Compute stage. |
| bgfx.TextureHandle | _handle | Texture handle. |
| Byte | _mip | Mip level. |
| bgfx.Access | _access | Image access. See |
| bgfx.TextureFormat | _format | Texture format. See: |
set_index_buffer(bgfx.IndexBufferHandle, UInt32, UInt32)
Set index buffer for draw primitive.
Declaration
public static void set_index_buffer(bgfx.IndexBufferHandle _handle, uint _firstIndex, uint _numIndices)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.IndexBufferHandle | _handle | Index buffer. |
| UInt32 | _firstIndex | First index to render. |
| UInt32 | _numIndices | Number of indices to render. |
set_index_buffer_name(bgfx.IndexBufferHandle, String, Int32)
Set static index buffer debug name.
Declaration
public static void set_index_buffer_name(bgfx.IndexBufferHandle _handle, string _name, int _len)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.IndexBufferHandle | _handle | Static index buffer handle. |
| String | _name | Static index buffer name. |
| Int32 | _len | Static index buffer name length (if length is INT32_MAX, it's expected that _name is zero terminated string. |
set_instance_count(UInt32)
Set number of instances for auto generated instances use in conjuction
with gl_InstanceID.
@attention Availability depends on: BGFX_CAPS_VERTEX_ID.
Declaration
public static void set_instance_count(uint _numInstances)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt32 | _numInstances |
set_instance_data_buffer(bgfx.InstanceDataBuffer*, UInt32, UInt32)
Set instance data buffer for draw primitive.
Declaration
public static void set_instance_data_buffer(bgfx.InstanceDataBuffer*_idb, uint _start, uint _num)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.InstanceDataBuffer* | _idb | Transient instance data buffer. |
| UInt32 | _start | First instance data. |
| UInt32 | _num | Number of data instances. |
set_instance_data_from_dynamic_vertex_buffer(bgfx.DynamicVertexBufferHandle, UInt32, UInt32)
Set instance data buffer for draw primitive.
Declaration
public static void set_instance_data_from_dynamic_vertex_buffer(bgfx.DynamicVertexBufferHandle _handle, uint _startVertex, uint _num)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.DynamicVertexBufferHandle | _handle | Dynamic vertex buffer. |
| UInt32 | _startVertex | First instance data. |
| UInt32 | _num | Number of data instances. |
set_instance_data_from_vertex_buffer(bgfx.VertexBufferHandle, UInt32, UInt32)
Set instance data buffer for draw primitive.
Declaration
public static void set_instance_data_from_vertex_buffer(bgfx.VertexBufferHandle _handle, uint _startVertex, uint _num)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.VertexBufferHandle | _handle | Vertex buffer. |
| UInt32 | _startVertex | First instance data. |
| UInt32 | _num | Number of data instances. Set instance data buffer for draw primitive. |
set_marker(String)
Sets a debug marker. This allows you to group graphics calls together for easy browsing in graphics debugging tools.
Declaration
public static void set_marker(string _marker)
Parameters
| Type | Name | Description |
|---|---|---|
| String | _marker | Marker string. |
set_palette_color(Byte, Single)
Set palette color value.
Declaration
public static void set_palette_color(byte _index, float _rgba)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte | _index | Index into palette. |
| Single | _rgba | RGBA floating point values. |
set_palette_color_rgba8(Byte, UInt32)
Set palette color value.
Declaration
public static void set_palette_color_rgba8(byte _index, uint _rgba)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte | _index | Index into palette. |
| UInt32 | _rgba | Packed 32-bit RGBA value. |
set_platform_data(bgfx.PlatformData*)
Set platform data.
@warning Must be called before bgfx::init.
Declaration
public static void set_platform_data(bgfx.PlatformData*_data)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.PlatformData* | _data | Platform data. |
set_scissor(UInt16, UInt16, UInt16, UInt16)
Set scissor for draw primitive.
@remark
To scissor for all primitives in view see bgfx::setViewScissor.
Declaration
public static ushort set_scissor(ushort _x, ushort _y, ushort _width, ushort _height)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _x | Position x from the left corner of the window. |
| UInt16 | _y | Position y from the top corner of the window. |
| UInt16 | _width | Width of view scissor region. |
| UInt16 | _height | Height of view scissor region. |
Returns
| Type | Description |
|---|---|
| UInt16 |
set_scissor_cached(UInt16)
Set scissor from cache for draw primitive.
@remark
To scissor for all primitives in view see bgfx::setViewScissor.
Declaration
public static void set_scissor_cached(ushort _cache)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _cache | Index in scissor cache. |
set_shader_name(bgfx.ShaderHandle, String, Int32)
Set shader debug name.
Declaration
public static void set_shader_name(bgfx.ShaderHandle _handle, string _name, int _len)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.ShaderHandle | _handle | Shader handle. |
| String | _name | Shader name. |
| Int32 | _len | Shader name length (if length is INT32_MAX, it's expected that _name is zero terminated string). |
set_state(UInt64, UInt32)
Set render states for draw primitive. @remarks
- To setup more complex states use:
BGFX_STATE_ALPHA_REF(_ref),BGFX_STATE_POINT_SIZE(_size),BGFX_STATE_BLEND_FUNC(_src, _dst),BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA),BGFX_STATE_BLEND_EQUATION(_equation),BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA) BGFX_STATE_BLEND_EQUATION_ADDis set when no other blend equation is specified.
Declaration
public static void set_state(ulong _state, uint _rgba)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt64 | _state | State flags. Default state for primitive type is triangles. See: |
| UInt32 | _rgba | Sets blend factor used by |
set_stencil(UInt32, UInt32)
Set stencil test state.
Declaration
public static void set_stencil(uint _fstencil, uint _bstencil)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt32 | _fstencil | Front stencil state. |
| UInt32 | _bstencil | Back stencil state. If back is set to |
set_texture(Byte, bgfx.UniformHandle, bgfx.TextureHandle, UInt32)
Set texture stage for draw primitive.
Declaration
public static void set_texture(byte _stage, bgfx.UniformHandle _sampler, bgfx.TextureHandle _handle, uint _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte | _stage | Texture unit. |
| bgfx.UniformHandle | _sampler | Program sampler. |
| bgfx.TextureHandle | _handle | Texture handle. |
| UInt32 | _flags | Texture sampling mode. Default value UINT32_MAX uses texture sampling settings from the texture. - |
set_texture_name(bgfx.TextureHandle, String, Int32)
Set texture debug name.
Declaration
public static void set_texture_name(bgfx.TextureHandle _handle, string _name, int _len)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.TextureHandle | _handle | Texture handle. |
| String | _name | Texture name. |
| Int32 | _len | Texture name length (if length is INT32_MAX, it's expected that _name is zero terminated string. |
set_transform(Void*, UInt16)
Set model matrix for draw primitive. If it is not called, the model will be rendered with an identity model matrix.
Declaration
public static uint set_transform(void *_mtx, ushort _num)
Parameters
| Type | Name | Description |
|---|---|---|
| Void* | _mtx | Pointer to first matrix in array. |
| UInt16 | _num | Number of matrices in array. |
Returns
| Type | Description |
|---|---|
| UInt32 |
set_transform_cached(UInt32, UInt16)
Set model matrix from matrix cache for draw primitive.
Declaration
public static void set_transform_cached(uint _cache, ushort _num)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt32 | _cache | Index in matrix cache. |
| UInt16 | _num | Number of matrices from cache. |
set_transient_index_buffer(bgfx.TransientIndexBuffer*, UInt32, UInt32)
Set index buffer for draw primitive.
Declaration
public static void set_transient_index_buffer(bgfx.TransientIndexBuffer*_tib, uint _firstIndex, uint _numIndices)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.TransientIndexBuffer* | _tib | Transient index buffer. |
| UInt32 | _firstIndex | First index to render. |
| UInt32 | _numIndices | Number of indices to render. |
set_transient_vertex_buffer(Byte, bgfx.TransientVertexBuffer*, UInt32, UInt32)
Set vertex buffer for draw primitive.
Declaration
public static void set_transient_vertex_buffer(byte _stream, bgfx.TransientVertexBuffer*_tvb, uint _startVertex, uint _numVertices)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte | _stream | Vertex stream. |
| bgfx.TransientVertexBuffer* | _tvb | Transient vertex buffer. |
| UInt32 | _startVertex | First vertex to render. |
| UInt32 | _numVertices | Number of vertices to render. |
set_uniform(bgfx.UniformHandle, Void*, UInt16)
Set shader uniform parameter for draw primitive.
Declaration
public static void set_uniform(bgfx.UniformHandle _handle, void *_value, ushort _num)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.UniformHandle | _handle | Uniform. |
| Void* | _value | Pointer to uniform data. |
| UInt16 | _num | Number of elements. Passing |
set_vertex_buffer(Byte, bgfx.VertexBufferHandle, UInt32, UInt32)
Set vertex buffer for draw primitive.
Declaration
public static void set_vertex_buffer(byte _stream, bgfx.VertexBufferHandle _handle, uint _startVertex, uint _numVertices)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte | _stream | Vertex stream. |
| bgfx.VertexBufferHandle | _handle | Vertex buffer. |
| UInt32 | _startVertex | First vertex to render. |
| UInt32 | _numVertices | Number of vertices to render. |
set_vertex_buffer_name(bgfx.VertexBufferHandle, String, Int32)
Set static vertex buffer debug name.
Declaration
public static void set_vertex_buffer_name(bgfx.VertexBufferHandle _handle, string _name, int _len)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.VertexBufferHandle | _handle | Static vertex buffer handle. |
| String | _name | Static vertex buffer name. |
| Int32 | _len | Static vertex buffer name length (if length is INT32_MAX, it's expected that _name is zero terminated string. |
set_vertex_count(UInt32)
Set number of vertices for auto generated vertices use in conjuction
with gl_VertexID.
@attention Availability depends on: BGFX_CAPS_VERTEX_ID.
Declaration
public static void set_vertex_count(uint _numVertices)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt32 | _numVertices | Number of vertices. |
set_view_clear(UInt16, UInt16, UInt32, Single, Byte)
Set view clear flags.
Declaration
public static void set_view_clear(ushort _id, ushort _flags, uint _rgba, float _depth, byte _stencil)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _id | View id. |
| UInt16 | _flags | Clear flags. Use |
| UInt32 | _rgba | Color clear value. |
| Single | _depth | Depth clear value. |
| Byte | _stencil | Stencil clear value. |
set_view_clear_mrt(UInt16, UInt16, Single, Byte, Byte, Byte, Byte, Byte, Byte, Byte, Byte, Byte)
Set view clear flags with different clear color for each
frame buffer texture. Must use bgfx::setPaletteColor to setup clear color
palette.
Declaration
public static void set_view_clear_mrt(ushort _id, ushort _flags, float _depth, byte _stencil, byte _c0, byte _c1, byte _c2, byte _c3, byte _c4, byte _c5, byte _c6, byte _c7)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _id | View id. |
| UInt16 | _flags | Clear flags. Use |
| Single | _depth | Depth clear value. |
| Byte | _stencil | Stencil clear value. |
| Byte | _c0 | Palette index for frame buffer attachment 0. |
| Byte | _c1 | Palette index for frame buffer attachment 1. |
| Byte | _c2 | Palette index for frame buffer attachment 2. |
| Byte | _c3 | Palette index for frame buffer attachment 3. |
| Byte | _c4 | Palette index for frame buffer attachment 4. |
| Byte | _c5 | Palette index for frame buffer attachment 5. |
| Byte | _c6 | Palette index for frame buffer attachment 6. |
| Byte | _c7 | Palette index for frame buffer attachment 7. |
set_view_frame_buffer(UInt16, bgfx.FrameBufferHandle)
Set view frame buffer.
@remarks
Not persistent after bgfx::reset call.
Declaration
public static void set_view_frame_buffer(ushort _id, bgfx.FrameBufferHandle _handle)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _id | View id. |
| bgfx.FrameBufferHandle | _handle | Frame buffer handle. Passing |
set_view_mode(UInt16, bgfx.ViewMode)
Set view sorting mode.
@remarks
View mode must be set prior calling bgfx::submit for the view.
Declaration
public static void set_view_mode(ushort _id, bgfx.ViewMode _mode)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _id | View id. |
| bgfx.ViewMode | _mode | View sort mode. See |
set_view_name(UInt16, String)
Declaration
public static void set_view_name(ushort _id, string _name)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _id | |
| String | _name |
set_view_order(UInt16, UInt16, UInt16*)
Post submit view reordering.
Declaration
public static void set_view_order(ushort _id, ushort _num, ushort *_order)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _id | First view id. |
| UInt16 | _num | Number of views to remap. |
| UInt16* | _order | View remap id table. Passing |
set_view_rect(UInt16, UInt16, UInt16, UInt16, UInt16)
Set view rectangle. Draw primitive outside view will be clipped.
Declaration
public static void set_view_rect(ushort _id, ushort _x, ushort _y, ushort _width, ushort _height)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _id | View id. |
| UInt16 | _x | Position x from the left corner of the window. |
| UInt16 | _y | Position y from the top corner of the window. |
| UInt16 | _width | Width of view port region. |
| UInt16 | _height | Height of view port region. |
set_view_rect_ratio(UInt16, UInt16, UInt16, bgfx.BackbufferRatio)
Set view rectangle. Draw primitive outside view will be clipped.
Declaration
public static void set_view_rect_ratio(ushort _id, ushort _x, ushort _y, bgfx.BackbufferRatio _ratio)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _id | View id. |
| UInt16 | _x | Position x from the left corner of the window. |
| UInt16 | _y | Position y from the top corner of the window. |
| bgfx.BackbufferRatio | _ratio | Width and height will be set in respect to back-buffer size. See: |
set_view_scissor(UInt16, UInt16, UInt16, UInt16, UInt16)
Set view scissor. Draw primitive outside view will be clipped. When _x, _y, _width and _height are set to 0, scissor will be disabled.
Declaration
public static void set_view_scissor(ushort _id, ushort _x, ushort _y, ushort _width, ushort _height)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _id | View id. |
| UInt16 | _x | Position x from the left corner of the window. |
| UInt16 | _y | Position y from the top corner of the window. |
| UInt16 | _width | Width of view scissor region. |
| UInt16 | _height | Height of view scissor region. |
set_view_transform(UInt16, Void*, Void*)
Set view view and projection matrices, all draw primitives in this view will use these matrices.
Declaration
public static void set_view_transform(ushort _id, void *_view, void *_proj)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _id | View id. |
| Void* | _view | View matrix. |
| Void* | _proj | Projection matrix. |
shutdown()
Shutdown bgfx library.
Declaration
public static void shutdown()
submit(UInt16, bgfx.ProgramHandle, UInt32, Byte)
Submit primitive for rendering.
Declaration
public static void submit(ushort _id, bgfx.ProgramHandle _program, uint _depth, byte _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _id | View id. |
| bgfx.ProgramHandle | _program | Program. |
| UInt32 | _depth | Depth for sorting. |
| Byte | _flags | Which states to discard for next draw. See BGFX_DISCARD_ |
submit_indirect(UInt16, bgfx.ProgramHandle, bgfx.IndirectBufferHandle, UInt16, UInt16, UInt32, Byte)
Submit primitive for rendering with index and instance data info from indirect buffer.
Declaration
public static void submit_indirect(ushort _id, bgfx.ProgramHandle _program, bgfx.IndirectBufferHandle _indirectHandle, ushort _start, ushort _num, uint _depth, byte _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _id | View id. |
| bgfx.ProgramHandle | _program | Program. |
| bgfx.IndirectBufferHandle | _indirectHandle | Indirect buffer. |
| UInt16 | _start | First element in indirect buffer. |
| UInt16 | _num | Number of dispatches. |
| UInt32 | _depth | Depth for sorting. |
| Byte | _flags | Which states to discard for next draw. See BGFX_DISCARD_ |
submit_occlusion_query(UInt16, bgfx.ProgramHandle, bgfx.OcclusionQueryHandle, UInt32, Byte)
Submit primitive with occlusion query for rendering.
Declaration
public static void submit_occlusion_query(ushort _id, bgfx.ProgramHandle _program, bgfx.OcclusionQueryHandle _occlusionQuery, uint _depth, byte _flags)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _id | View id. |
| bgfx.ProgramHandle | _program | Program. |
| bgfx.OcclusionQueryHandle | _occlusionQuery | Occlusion query. |
| UInt32 | _depth | Depth for sorting. |
| Byte | _flags | Which states to discard for next draw. See BGFX_DISCARD_ |
topology_convert(bgfx.TopologyConvert, Void*, UInt32, Void*, UInt32, Boolean)
Convert index buffer for use with different primitive topologies.
Declaration
public static uint topology_convert(bgfx.TopologyConvert _conversion, void *_dst, uint _dstSize, void *_indices, uint _numIndices, bool _index32)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.TopologyConvert | _conversion | Conversion type, see |
| Void* | _dst | Destination index buffer. If this argument is NULL function will return number of indices after conversion. |
| UInt32 | _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. |
| Void* | _indices | Source indices. |
| UInt32 | _numIndices | Number of input indices. |
| Boolean | _index32 | Set to |
Returns
| Type | Description |
|---|---|
| UInt32 |
topology_sort_tri_list(bgfx.TopologySort, Void*, UInt32, Single, Single, Void*, UInt32, Void*, UInt32, Boolean)
Sort indices.
Declaration
public static void topology_sort_tri_list(bgfx.TopologySort _sort, void *_dst, uint _dstSize, float _dir, float _pos, void *_vertices, uint _stride, void *_indices, uint _numIndices, bool _index32)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.TopologySort | _sort | Sort order, see |
| Void* | _dst | Destination index buffer. |
| UInt32 | _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. |
| Single | _dir | Direction (vector must be normalized). |
| Single | _pos | Position. |
| Void* | _vertices | Pointer to first vertex represented as float x, y, z. Must contain at least number of vertices referencende by index buffer. |
| UInt32 | _stride | Vertex stride. |
| Void* | _indices | Source indices. |
| UInt32 | _numIndices | Number of input indices. |
| Boolean | _index32 | Set to |
touch(UInt16)
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.
Declaration
public static void touch(ushort _id)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt16 | _id | View id. |
update_dynamic_index_buffer(bgfx.DynamicIndexBufferHandle, UInt32, bgfx.Memory*)
Update dynamic index buffer.
Declaration
public static void update_dynamic_index_buffer(bgfx.DynamicIndexBufferHandle _handle, uint _startIndex, bgfx.Memory*_mem)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.DynamicIndexBufferHandle | _handle | Dynamic index buffer handle. |
| UInt32 | _startIndex | Start index. |
| bgfx.Memory* | _mem | Index buffer data. |
update_dynamic_vertex_buffer(bgfx.DynamicVertexBufferHandle, UInt32, bgfx.Memory*)
Update dynamic vertex buffer.
Declaration
public static void update_dynamic_vertex_buffer(bgfx.DynamicVertexBufferHandle _handle, uint _startVertex, bgfx.Memory*_mem)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.DynamicVertexBufferHandle | _handle | Dynamic vertex buffer handle. |
| UInt32 | _startVertex | Start vertex. |
| bgfx.Memory* | _mem | Vertex buffer data. |
update_texture_2d(bgfx.TextureHandle, UInt16, Byte, UInt16, UInt16, UInt16, UInt16, bgfx.Memory*, UInt16)
Update 2D texture.
@attention It's valid to update only mutable texture. See bgfx::createTexture2D for more info.
Declaration
public static void update_texture_2d(bgfx.TextureHandle _handle, ushort _layer, byte _mip, ushort _x, ushort _y, ushort _width, ushort _height, bgfx.Memory*_mem, ushort _pitch)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.TextureHandle | _handle | Texture handle. |
| UInt16 | _layer | Layer in texture array. |
| Byte | _mip | Mip level. |
| UInt16 | _x | X offset in texture. |
| UInt16 | _y | Y offset in texture. |
| UInt16 | _width | Width of texture block. |
| UInt16 | _height | Height of texture block. |
| bgfx.Memory* | _mem | Texture update data. |
| UInt16 | _pitch | Pitch of input image (bytes). When _pitch is set to UINT16_MAX, it will be calculated internally based on _width. |
update_texture_3d(bgfx.TextureHandle, Byte, UInt16, UInt16, UInt16, UInt16, UInt16, UInt16, bgfx.Memory*)
Update 3D texture.
@attention It's valid to update only mutable texture. See bgfx::createTexture3D for more info.
Declaration
public static void update_texture_3d(bgfx.TextureHandle _handle, byte _mip, ushort _x, ushort _y, ushort _z, ushort _width, ushort _height, ushort _depth, bgfx.Memory*_mem)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.TextureHandle | _handle | Texture handle. |
| Byte | _mip | Mip level. |
| UInt16 | _x | X offset in texture. |
| UInt16 | _y | Y offset in texture. |
| UInt16 | _z | Z offset in texture. |
| UInt16 | _width | Width of texture block. |
| UInt16 | _height | Height of texture block. |
| UInt16 | _depth | Depth of texture block. |
| bgfx.Memory* | _mem | Texture update data. |
update_texture_cube(bgfx.TextureHandle, UInt16, Byte, Byte, UInt16, UInt16, UInt16, UInt16, bgfx.Memory*, UInt16)
Declaration
public static void update_texture_cube(bgfx.TextureHandle _handle, ushort _layer, byte _side, byte _mip, ushort _x, ushort _y, ushort _width, ushort _height, bgfx.Memory*_mem, ushort _pitch)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.TextureHandle | _handle | |
| UInt16 | _layer | |
| Byte | _side | |
| Byte | _mip | |
| UInt16 | _x | |
| UInt16 | _y | |
| UInt16 | _width | |
| UInt16 | _height | |
| bgfx.Memory* | _mem | |
| UInt16 | _pitch |
vertex_convert(bgfx.VertexLayout*, Void*, bgfx.VertexLayout*, Void*, UInt32)
Converts vertex stream data from one vertex stream format to another.
Declaration
public static void vertex_convert(bgfx.VertexLayout*_dstLayout, void *_dstData, bgfx.VertexLayout*_srcLayout, void *_srcData, uint _num)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.VertexLayout* | _dstLayout | Destination vertex stream layout. |
| Void* | _dstData | Destination vertex stream. |
| bgfx.VertexLayout* | _srcLayout | Source vertex stream layout. |
| Void* | _srcData | Source vertex stream data. |
| UInt32 | _num | Number of vertices to convert from source to destination. |
vertex_layout_add(bgfx.VertexLayout*, bgfx.Attrib, Byte, bgfx.AttribType, Boolean, Boolean)
Add attribute to VertexLayout. @remarks Must be called between begin/end.
Declaration
public static bgfx.VertexLayout*vertex_layout_add(bgfx.VertexLayout*_this, bgfx.Attrib _attrib, byte _num, bgfx.AttribType _type, bool _normalized, bool _asInt)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.VertexLayout* | _this | |
| bgfx.Attrib | _attrib | Attribute semantics. See: |
| Byte | _num | Number of elements 1, 2, 3 or 4. |
| bgfx.AttribType | _type | Element type. |
| Boolean | _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. |
| Boolean | _asInt | Packaging rule for vertexPack, vertexUnpack, and vertexConvert for AttribType::Uint8 and AttribType::Int16. Unpacking code must be implemented inside vertex shader. |
Returns
| Type | Description |
|---|---|
| bgfx.VertexLayout* |
vertex_layout_begin(bgfx.VertexLayout*, bgfx.RendererType)
Start VertexLayout.
Declaration
public static bgfx.VertexLayout*vertex_layout_begin(bgfx.VertexLayout*_this, bgfx.RendererType _rendererType)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.VertexLayout* | _this | |
| bgfx.RendererType | _rendererType |
Returns
| Type | Description |
|---|---|
| bgfx.VertexLayout* |
vertex_layout_decode(bgfx.VertexLayout*, bgfx.Attrib, Byte*, bgfx.AttribType*, Boolean*, Boolean*)
Decode attribute.
Declaration
public static void vertex_layout_decode(bgfx.VertexLayout*_this, bgfx.Attrib _attrib, byte *_num, bgfx.AttribType*_type, bool *_normalized, bool *_asInt)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.VertexLayout* | _this | |
| bgfx.Attrib | _attrib | Attribute semantics. See: |
| Byte* | _num | Number of elements. |
| bgfx.AttribType* | _type | Element type. |
| Boolean* | _normalized | Attribute is normalized. |
| Boolean* | _asInt | Attribute is packed as int. |
vertex_layout_end(bgfx.VertexLayout*)
End VertexLayout.
Declaration
public static void vertex_layout_end(bgfx.VertexLayout*_this)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.VertexLayout* | _this |
vertex_layout_has(bgfx.VertexLayout*, bgfx.Attrib)
Returns true if VertexLayout contains attribute.
Declaration
public static bool vertex_layout_has(bgfx.VertexLayout*_this, bgfx.Attrib _attrib)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.VertexLayout* | _this | |
| bgfx.Attrib | _attrib | Attribute semantics. See: |
Returns
| Type | Description |
|---|---|
| Boolean |
vertex_layout_skip(bgfx.VertexLayout*, Byte)
Skip _num bytes in vertex stream.
Declaration
public static bgfx.VertexLayout*vertex_layout_skip(bgfx.VertexLayout*_this, byte _num)
Parameters
| Type | Name | Description |
|---|---|---|
| bgfx.VertexLayout* | _this | |
| Byte | _num |
Returns
| Type | Description |
|---|---|
| bgfx.VertexLayout* |
vertex_pack(Single, Boolean, bgfx.Attrib, bgfx.VertexLayout*, Void*, UInt32)
Pack vertex attribute into vertex stream format.
Declaration
public static void vertex_pack(float _input, bool _inputNormalized, bgfx.Attrib _attr, bgfx.VertexLayout*_layout, void *_data, uint _index)
Parameters
| Type | Name | Description |
|---|---|---|
| Single | _input | Value to be packed into vertex stream. |
| Boolean | _inputNormalized |
|
| bgfx.Attrib | _attr | Attribute to pack. |
| bgfx.VertexLayout* | _layout | Vertex stream layout. |
| Void* | _data | Destination vertex stream where data will be packed. |
| UInt32 | _index | Vertex index that will be modified. |
vertex_unpack(Single, bgfx.Attrib, bgfx.VertexLayout*, Void*, UInt32)
Unpack vertex attribute from vertex stream format.
Declaration
public static void vertex_unpack(float _output, bgfx.Attrib _attr, bgfx.VertexLayout*_layout, void *_data, uint _index)
Parameters
| Type | Name | Description |
|---|---|---|
| Single | _output | Result of unpacking. |
| bgfx.Attrib | _attr | Attribute to unpack. |
| bgfx.VertexLayout* | _layout | Vertex stream layout. |
| Void* | _data | Source vertex stream from where data will be unpacked. |
| UInt32 | _index | Vertex index that will be unpacked. |
weld_vertices(Void*, bgfx.VertexLayout*, Void*, UInt32, Boolean, Single)
Weld vertices.
Declaration
public static uint weld_vertices(void *_output, bgfx.VertexLayout*_layout, void *_data, uint _num, bool _index32, float _epsilon)
Parameters
| Type | Name | Description |
|---|---|---|
| Void* | _output | Welded vertices remapping table. The size of buffer must be the same as number of vertices. |
| bgfx.VertexLayout* | _layout | Vertex stream layout. |
| Void* | _data | Vertex stream. |
| UInt32 | _num | Number of vertices in vertex stream. |
| Boolean | _index32 | Set to |
| Single | _epsilon | Error tolerance for vertex position comparison. |
Returns
| Type | Description |
|---|---|
| UInt32 |