mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-06-08 03:13:52 +00:00
Updated bindings. (#3615)
This commit is contained in:
committed by
GitHub
parent
3e6455e6b0
commit
0c45d90ca7
@@ -2545,7 +2545,9 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Add attribute to VertexLayout.
|
||||
///
|
||||
/// @remarks Must be called between begin/end.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_attrib">Attribute semantics. See: `bgfx::Attrib`</param>
|
||||
@@ -2627,7 +2629,7 @@ public static class bgfx
|
||||
public static extern void vertex_convert(VertexLayout* _dstLayout, void* _dstData, VertexLayout* _srcLayout, void* _srcData, uint32 _num);
|
||||
|
||||
/// <summary>
|
||||
/// Weld vertices.
|
||||
/// Weld vertices. Returns number of unique vertices after welding.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_output">Welded vertices remapping table. The size of buffer must be the same as number of vertices.</param>
|
||||
@@ -2718,8 +2720,10 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Reset graphic settings and back-buffer size.
|
||||
///
|
||||
/// @attention This call doesn’t change the window size, it just resizes
|
||||
/// the back-buffer. Your windowing code controls the window size.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_width">Back-buffer width.</param>
|
||||
@@ -2743,8 +2747,10 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Returns current renderer backend API type.
|
||||
///
|
||||
/// @remarks
|
||||
/// Library must be initialized.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
[LinkName("bgfx_get_renderer_type")]
|
||||
@@ -2752,8 +2758,10 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Returns renderer capabilities.
|
||||
///
|
||||
/// @remarks
|
||||
/// Library must be initialized.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
[LinkName("bgfx_get_caps")]
|
||||
@@ -2761,7 +2769,9 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Returns performance counters.
|
||||
///
|
||||
/// @attention Pointer returned is valid until `bgfx::frame` is called.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
[LinkName("bgfx_get_stats")]
|
||||
@@ -2793,7 +2803,9 @@ public static class bgfx
|
||||
/// 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.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_data">Pointer to data.</param>
|
||||
@@ -2809,7 +2821,9 @@ public static class bgfx
|
||||
/// 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.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_data">Pointer to data.</param>
|
||||
@@ -2909,7 +2923,7 @@ public static class bgfx
|
||||
public static extern void destroy_index_buffer(IndexBufferHandle _handle);
|
||||
|
||||
/// <summary>
|
||||
/// Create vertex layout.
|
||||
/// Create vertex layout. Vertex layouts are used to describe the format of vertex data.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_layout">Vertex layout.</param>
|
||||
@@ -3071,6 +3085,7 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Allocate transient index buffer.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_tib">TransientIndexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.</param>
|
||||
@@ -3095,6 +3110,7 @@ public static class bgfx
|
||||
/// Check for required space and allocate transient vertex and index
|
||||
/// buffers. If both space requirements are satisfied function returns
|
||||
/// true.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_tvb">TransientVertexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.</param>
|
||||
@@ -3138,8 +3154,10 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Create shader from memory buffer.
|
||||
///
|
||||
/// @remarks
|
||||
/// Shader binary is obtained by compiling shader offline with shaderc command line tool.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_mem">Shader binary.</param>
|
||||
@@ -3149,8 +3167,10 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Returns the number of uniforms and uniform handles used inside a shader.
|
||||
///
|
||||
/// @remarks
|
||||
/// Only non-predefined uniforms are returned.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_handle">Shader handle.</param>
|
||||
@@ -3173,8 +3193,10 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Destroy shader.
|
||||
///
|
||||
/// @remark Once a shader program is created with _handle,
|
||||
/// it is safe to destroy that shader.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_handle">Shader handle.</param>
|
||||
@@ -3326,7 +3348,9 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Update 2D texture.
|
||||
///
|
||||
/// @attention It's valid to update only mutable texture. See `bgfx::createTexture2D` for more info.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_handle">Texture handle.</param>
|
||||
@@ -3344,7 +3368,9 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Update 3D texture.
|
||||
///
|
||||
/// @attention It's valid to update only mutable texture. See `bgfx::createTexture3D` for more info.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_handle">Texture handle.</param>
|
||||
@@ -3362,7 +3388,9 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Update Cube texture.
|
||||
///
|
||||
/// @attention It's valid to update only mutable texture. See `bgfx::createTextureCube` for more info.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_handle">Texture handle.</param>
|
||||
@@ -3381,8 +3409,10 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Read back texture content.
|
||||
///
|
||||
/// @attention Texture must be created with `BGFX_TEXTURE_READ_BACK` flag.
|
||||
/// @attention Availability depends on: `BGFX_CAPS_TEXTURE_READ_BACK`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_handle">Texture handle.</param>
|
||||
@@ -3405,8 +3435,10 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_handle">Texture handle.</param>
|
||||
@@ -3472,9 +3504,12 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Create frame buffer for multiple window rendering.
|
||||
///
|
||||
/// @remarks
|
||||
/// Frame buffer cannot be used for sampling.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_SWAP_CHAIN`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_nwh">OS' target native window handle.</param>
|
||||
@@ -3517,12 +3552,14 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Create shader uniform parameter.
|
||||
///
|
||||
/// @remarks
|
||||
/// 1. Uniform names are unique. It's valid to call `bgfx::createUniform`
|
||||
/// multiple times with the same uniform name. The library will always
|
||||
/// return the same handle, but the handle reference count will be
|
||||
/// incremented. This means that the same number of `bgfx::destroyUniform`
|
||||
/// must be called to properly destroy the uniform.
|
||||
///
|
||||
/// 2. Predefined uniforms (declared in `bgfx_shader.sh`):
|
||||
/// - `u_viewRect vec4(x, y, width, height)` - view rectangle for current
|
||||
/// view, in pixels.
|
||||
@@ -3540,6 +3577,7 @@ public static class bgfx
|
||||
/// - `u_invModelView mat4` - inverted concatenated model view matrix.
|
||||
/// - `u_modelViewProj mat4` - concatenated model view projection matrix.
|
||||
/// - `u_alphaRef float` - alpha reference value for alpha test.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_name">Uniform name in shader.</param>
|
||||
@@ -3551,12 +3589,14 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Create shader uniform parameter.
|
||||
///
|
||||
/// @remarks
|
||||
/// 1. Uniform names are unique. It's valid to call `bgfx::createUniform`
|
||||
/// multiple times with the same uniform name. The library will always
|
||||
/// return the same handle, but the handle reference count will be
|
||||
/// incremented. This means that the same number of `bgfx::destroyUniform`
|
||||
/// must be called to properly destroy the uniform.
|
||||
///
|
||||
/// 2. Predefined uniforms (declared in `bgfx_shader.sh`):
|
||||
/// - `u_viewRect vec4(x, y, width, height)` - view rectangle for current
|
||||
/// view, in pixels.
|
||||
@@ -3574,6 +3614,7 @@ public static class bgfx
|
||||
/// - `u_invModelView mat4` - inverted concatenated model view matrix.
|
||||
/// - `u_modelViewProj mat4` - concatenated model view projection matrix.
|
||||
/// - `u_alphaRef float` - alpha reference value for alpha test.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_name">Uniform name in shader.</param>
|
||||
@@ -3604,7 +3645,8 @@ public static class bgfx
|
||||
public static extern void destroy_uniform(UniformHandle _handle);
|
||||
|
||||
/// <summary>
|
||||
/// Create occlusion query.
|
||||
/// Create occlusion query. Occlusion queries allow the GPU to determine
|
||||
/// if any pixels passed the depth test.
|
||||
/// </summary>
|
||||
///
|
||||
[LinkName("bgfx_create_occlusion_query")]
|
||||
@@ -3664,13 +3706,17 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set view name.
|
||||
///
|
||||
/// @remarks
|
||||
/// This is debug only feature.
|
||||
///
|
||||
/// In graphics debugger view name will appear as:
|
||||
///
|
||||
/// "nnnc <view name>"
|
||||
/// ^ ^ ^
|
||||
/// | +--- compute (C)
|
||||
/// +------ view id
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -3756,8 +3802,10 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set view sorting mode.
|
||||
///
|
||||
/// @remarks
|
||||
/// View mode must be set prior calling `bgfx::submit` for the view.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -3768,8 +3816,10 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set view frame buffer.
|
||||
///
|
||||
/// @remarks
|
||||
/// Not persistent after `bgfx::reset` call.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -3803,7 +3853,9 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set view shading rate.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_VARIABLE_RATE_SHADING`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -3852,6 +3904,7 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set render states for draw primitive.
|
||||
///
|
||||
/// @remarks
|
||||
/// 1. To set up more complex states use:
|
||||
/// `BGFX_STATE_ALPHA_REF(_ref)`,
|
||||
@@ -3862,6 +3915,7 @@ public static class bgfx
|
||||
/// `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
|
||||
/// 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
|
||||
/// equation is specified.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_state">State flags. Default state for primitive type is triangles. See: `BGFX_STATE_DEFAULT`. - `BGFX_STATE_DEPTH_TEST_*` - Depth test function. - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC. - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2. - `BGFX_STATE_CULL_*` - Backface culling mode. - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write. - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing. - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.</param>
|
||||
@@ -3892,8 +3946,10 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set scissor for draw primitive.
|
||||
///
|
||||
/// @remark
|
||||
/// To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_x">Position x from the left corner of the window.</param>
|
||||
@@ -3906,8 +3962,10 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set scissor from cache for draw primitive.
|
||||
///
|
||||
/// @remark
|
||||
/// To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_cache">Index in scissor cache.</param>
|
||||
@@ -3938,7 +3996,9 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Reserve matrices in internal matrix cache.
|
||||
///
|
||||
/// @attention Pointer returned can be modified until `bgfx::frame` is called.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_transform">Pointer to `Transform` structure.</param>
|
||||
@@ -3960,7 +4020,9 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set shader uniform parameter for view.
|
||||
///
|
||||
/// @attention Uniform must be created with `bgfx::UniformFreq::View` argument.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -3973,7 +4035,9 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set shader uniform parameter for frame.
|
||||
///
|
||||
/// @attention Uniform must be created with `bgfx::UniformFreq::View` argument.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_handle">Uniform.</param>
|
||||
@@ -4053,6 +4117,16 @@ public static class bgfx
|
||||
[LinkName("bgfx_encoder_set_dynamic_vertex_buffer")]
|
||||
public static extern void encoder_set_dynamic_vertex_buffer(Encoder* _this, uint8 _stream, DynamicVertexBufferHandle _handle, uint32 _startVertex, uint32 _numVertices);
|
||||
|
||||
/// <summary>
|
||||
/// Set vertex buffer for draw primitive.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_stream">Vertex stream.</param>
|
||||
/// <param name="_handle">Dynamic vertex buffer.</param>
|
||||
/// <param name="_startVertex">First vertex to render.</param>
|
||||
/// <param name="_numVertices">Number of vertices to render.</param>
|
||||
/// <param name="_layoutHandle">Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.</param>
|
||||
///
|
||||
[LinkName("bgfx_encoder_set_dynamic_vertex_buffer_with_layout")]
|
||||
public static extern void encoder_set_dynamic_vertex_buffer_with_layout(Encoder* _this, uint8 _stream, DynamicVertexBufferHandle _handle, uint32 _startVertex, uint32 _numVertices, VertexLayoutHandle _layoutHandle);
|
||||
|
||||
@@ -4084,7 +4158,9 @@ public static class bgfx
|
||||
/// <summary>
|
||||
/// Set number of vertices for auto generated vertices use in conjunction
|
||||
/// with gl_VertexID.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_numVertices">Number of vertices.</param>
|
||||
@@ -4128,7 +4204,9 @@ public static class bgfx
|
||||
/// <summary>
|
||||
/// Set number of instances for auto generated instances use in conjunction
|
||||
/// with gl_InstanceID.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_numInstances">Number of instances.</param>
|
||||
@@ -4153,8 +4231,10 @@ public static class bgfx
|
||||
/// 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.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -4190,7 +4270,9 @@ public static class bgfx
|
||||
/// <summary>
|
||||
/// Submit primitive for rendering with index and instance data info from
|
||||
/// indirect buffer.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -4207,7 +4289,9 @@ public static class bgfx
|
||||
/// <summary>
|
||||
/// Submit primitive for rendering with index and instance data info and
|
||||
/// draw count from indirect buffers.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -4330,8 +4414,10 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// 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`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -4354,9 +4440,11 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_handle">Frame buffer handle. If handle is `BGFX_INVALID_HANDLE` request will be made for main window back buffer.</param>
|
||||
@@ -4367,13 +4455,16 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_msecs">Timeout in milliseconds.</param>
|
||||
@@ -4383,7 +4474,9 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set platform data.
|
||||
///
|
||||
/// @warning Must be called before `bgfx::init`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_data">Platform data.</param>
|
||||
@@ -4393,9 +4486,12 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
[LinkName("bgfx_get_internal_data")]
|
||||
@@ -4404,9 +4500,12 @@ public static class bgfx
|
||||
/// <summary>
|
||||
/// 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.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_handle">Texture handle.</param>
|
||||
@@ -4419,11 +4518,15 @@ public static class bgfx
|
||||
/// <summary>
|
||||
/// 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.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_handle">Texture handle.</param>
|
||||
@@ -4449,6 +4552,7 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set render states for draw primitive.
|
||||
///
|
||||
/// @remarks
|
||||
/// 1. To set up more complex states use:
|
||||
/// `BGFX_STATE_ALPHA_REF(_ref)`,
|
||||
@@ -4459,6 +4563,7 @@ public static class bgfx
|
||||
/// `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
|
||||
/// 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
|
||||
/// equation is specified.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_state">State flags. Default state for primitive type is triangles. See: `BGFX_STATE_DEFAULT`. - `BGFX_STATE_DEPTH_TEST_*` - Depth test function. - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC. - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2. - `BGFX_STATE_CULL_*` - Backface culling mode. - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write. - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing. - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.</param>
|
||||
@@ -4489,8 +4594,10 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set scissor for draw primitive.
|
||||
///
|
||||
/// @remark
|
||||
/// To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_x">Position x from the left corner of the window.</param>
|
||||
@@ -4503,8 +4610,10 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set scissor from cache for draw primitive.
|
||||
///
|
||||
/// @remark
|
||||
/// To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_cache">Index in scissor cache.</param>
|
||||
@@ -4535,7 +4644,9 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Reserve matrices in internal matrix cache.
|
||||
///
|
||||
/// @attention Pointer returned can be modified until `bgfx::frame` is called.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_transform">Pointer to `Transform` structure.</param>
|
||||
@@ -4666,7 +4777,9 @@ public static class bgfx
|
||||
/// <summary>
|
||||
/// Set number of vertices for auto generated vertices use in conjunction
|
||||
/// with gl_VertexID.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_numVertices">Number of vertices.</param>
|
||||
@@ -4710,7 +4823,9 @@ public static class bgfx
|
||||
/// <summary>
|
||||
/// Set number of instances for auto generated instances use in conjunction
|
||||
/// with gl_InstanceID.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_numInstances">Number of instances.</param>
|
||||
@@ -4733,8 +4848,10 @@ public static class bgfx
|
||||
/// <summary>
|
||||
/// 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.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -4770,7 +4887,9 @@ public static class bgfx
|
||||
/// <summary>
|
||||
/// Submit primitive for rendering with index and instance data info from
|
||||
/// indirect buffer.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -4787,7 +4906,9 @@ public static class bgfx
|
||||
/// <summary>
|
||||
/// Submit primitive for rendering with index and instance data info and
|
||||
/// draw count from indirect buffers.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -4910,8 +5031,10 @@ public static class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// 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`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
|
||||
@@ -1629,6 +1629,7 @@ struct Init
|
||||
}
|
||||
|
||||
// Memory must be obtained by calling `bgfx::alloc`, `bgfx::copy`, or `bgfx::makeRef`.
|
||||
//
|
||||
// @attention It is illegal to create this structure on stack and pass it to any bgfx API.
|
||||
struct Memory
|
||||
{
|
||||
@@ -1776,6 +1777,7 @@ struct EncoderStats
|
||||
}
|
||||
|
||||
// Renderer statistics data.
|
||||
//
|
||||
// @remarks All time values are high-resolution timestamps, while
|
||||
// time frequencies define timestamps-per-second for that hardware.
|
||||
struct Stats
|
||||
@@ -1941,7 +1943,9 @@ extern fn void attachment_init(Attachment* _this, TextureHandle _handle, Access
|
||||
extern fn VertexLayout* vertex_layout_begin(VertexLayout* _this, RendererType _rendererType) @extern("bgfx_vertex_layout_begin");
|
||||
|
||||
// Add attribute to VertexLayout.
|
||||
//
|
||||
// @remarks Must be called between begin/end.
|
||||
//
|
||||
// _attrib : `Attribute semantics. See: `bgfx::Attrib``
|
||||
// _num : `Number of elements 1, 2, 3 or 4.`
|
||||
// _type : `Element type.`
|
||||
@@ -1989,7 +1993,7 @@ extern fn void vertex_unpack(float _output, Attrib _attr, VertexLayout* _layout,
|
||||
// _num : `Number of vertices to convert from source to destination.`
|
||||
extern fn void vertex_convert(VertexLayout* _dstLayout, void* _dstData, VertexLayout* _srcLayout, void* _srcData, uint _num) @extern("bgfx_vertex_convert");
|
||||
|
||||
// Weld vertices.
|
||||
// Weld vertices. Returns number of unique vertices after welding.
|
||||
// _output : `Welded vertices remapping table. The size of buffer must be the same as number of vertices.`
|
||||
// _layout : `Vertex stream layout.`
|
||||
// _data : `Vertex stream.`
|
||||
@@ -2041,8 +2045,10 @@ extern fn bool init(Init* _init) @extern("bgfx_init");
|
||||
extern fn void shutdown() @extern("bgfx_shutdown");
|
||||
|
||||
// Reset graphic settings and back-buffer size.
|
||||
//
|
||||
// @attention This call doesn’t change the window size, it just resizes
|
||||
// the back-buffer. Your windowing code controls the window size.
|
||||
//
|
||||
// _width : `Back-buffer width.`
|
||||
// _height : `Back-buffer height.`
|
||||
// _flags : `See: `BGFX_RESET_*` for more info. - `BGFX_RESET_NONE` - No reset flags. - `BGFX_RESET_FULLSCREEN` - Not supported yet. - `BGFX_RESET_MSAA_X[2/4/8/16]` - Enable 2, 4, 8 or 16 x MSAA. - `BGFX_RESET_VSYNC` - Enable V-Sync. - `BGFX_RESET_MAXANISOTROPY` - Turn on/off max anisotropy. - `BGFX_RESET_CAPTURE` - Begin screen capture. - `BGFX_RESET_FLUSH_AFTER_RENDER` - Flush rendering after submitting to GPU. - `BGFX_RESET_FLIP_AFTER_RENDER` - This flag specifies where flip occurs. Default behaviour is that flip occurs before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`. - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB back-buffer.`
|
||||
@@ -2056,17 +2062,23 @@ extern fn void reset(uint _width, uint _height, uint _flags, TextureFormat _form
|
||||
extern fn uint frame(char _flags) @extern("bgfx_frame");
|
||||
|
||||
// Returns current renderer backend API type.
|
||||
//
|
||||
// @remarks
|
||||
// Library must be initialized.
|
||||
//
|
||||
extern fn RendererType get_renderer_type() @extern("bgfx_get_renderer_type");
|
||||
|
||||
// Returns renderer capabilities.
|
||||
//
|
||||
// @remarks
|
||||
// Library must be initialized.
|
||||
//
|
||||
extern fn Caps* get_caps() @extern("bgfx_get_caps");
|
||||
|
||||
// Returns performance counters.
|
||||
//
|
||||
// @attention Pointer returned is valid until `bgfx::frame` is called.
|
||||
//
|
||||
extern fn Stats* get_stats() @extern("bgfx_get_stats");
|
||||
|
||||
// Allocate buffer to pass to bgfx calls. Data will be freed inside bgfx.
|
||||
@@ -2084,7 +2096,9 @@ extern fn Memory* copy(void* _data, uint _size) @extern("bgfx_copy");
|
||||
// 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.
|
||||
//
|
||||
// _data : `Pointer to data.`
|
||||
// _size : `Size of data.`
|
||||
extern fn Memory* make_ref(void* _data, uint _size) @extern("bgfx_make_ref");
|
||||
@@ -2095,7 +2109,9 @@ extern fn Memory* make_ref(void* _data, uint _size) @extern("bgfx_make_ref");
|
||||
// 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.
|
||||
//
|
||||
// _data : `Pointer to data.`
|
||||
// _size : `Size of data.`
|
||||
// _releaseFn : `Callback function to release memory after use.`
|
||||
@@ -2150,7 +2166,7 @@ extern fn void set_index_buffer_name(IndexBufferHandle _handle, ZString _name, i
|
||||
// _handle : `Static index buffer handle.`
|
||||
extern fn void destroy_index_buffer(IndexBufferHandle _handle) @extern("bgfx_destroy_index_buffer");
|
||||
|
||||
// Create vertex layout.
|
||||
// Create vertex layout. Vertex layouts are used to describe the format of vertex data.
|
||||
// _layout : `Vertex layout.`
|
||||
extern fn VertexLayoutHandle create_vertex_layout(VertexLayout* _layout) @extern("bgfx_create_vertex_layout");
|
||||
|
||||
@@ -2232,6 +2248,7 @@ extern fn uint get_avail_transient_vertex_buffer(uint _num, VertexLayout* _layou
|
||||
extern fn uint get_avail_instance_data_buffer(uint _num, ushort _stride) @extern("bgfx_get_avail_instance_data_buffer");
|
||||
|
||||
// Allocate transient index buffer.
|
||||
//
|
||||
// _tib : `TransientIndexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.`
|
||||
// _num : `Number of indices to allocate.`
|
||||
// _index32 : `Set to `true` if input indices will be 32-bit.`
|
||||
@@ -2246,6 +2263,7 @@ extern fn void alloc_transient_vertex_buffer(TransientVertexBuffer* _tvb, uint _
|
||||
// Check for required space and allocate transient vertex and index
|
||||
// buffers. If both space requirements are satisfied function returns
|
||||
// true.
|
||||
//
|
||||
// _tvb : `TransientVertexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.`
|
||||
// _layout : `Vertex layout.`
|
||||
// _numVertices : `Number of vertices to allocate.`
|
||||
@@ -2269,14 +2287,18 @@ extern fn IndirectBufferHandle create_indirect_buffer(uint _num) @extern("bgfx_c
|
||||
extern fn void destroy_indirect_buffer(IndirectBufferHandle _handle) @extern("bgfx_destroy_indirect_buffer");
|
||||
|
||||
// Create shader from memory buffer.
|
||||
//
|
||||
// @remarks
|
||||
// Shader binary is obtained by compiling shader offline with shaderc command line tool.
|
||||
//
|
||||
// _mem : `Shader binary.`
|
||||
extern fn ShaderHandle create_shader(Memory* _mem) @extern("bgfx_create_shader");
|
||||
|
||||
// Returns the number of uniforms and uniform handles used inside a shader.
|
||||
//
|
||||
// @remarks
|
||||
// Only non-predefined uniforms are returned.
|
||||
//
|
||||
// _handle : `Shader handle.`
|
||||
// _uniforms : `UniformHandle array where data will be stored.`
|
||||
// _max : `Maximum capacity of array.`
|
||||
@@ -2289,8 +2311,10 @@ extern fn ushort get_shader_uniforms(ShaderHandle _handle, UniformHandle* _unifo
|
||||
extern fn void set_shader_name(ShaderHandle _handle, ZString _name, int _len) @extern("bgfx_set_shader_name");
|
||||
|
||||
// Destroy shader.
|
||||
//
|
||||
// @remark Once a shader program is created with _handle,
|
||||
// it is safe to destroy that shader.
|
||||
//
|
||||
// _handle : `Shader handle.`
|
||||
extern fn void destroy_shader(ShaderHandle _handle) @extern("bgfx_destroy_shader");
|
||||
|
||||
@@ -2382,7 +2406,9 @@ extern fn TextureHandle create_texture_3d(ushort _width, ushort _height, ushort
|
||||
extern fn TextureHandle create_texture_cube(ushort _size, bool _hasMips, ushort _numLayers, TextureFormat _format, ulong _flags, Memory* _mem, ulong _external) @extern("bgfx_create_texture_cube");
|
||||
|
||||
// Update 2D texture.
|
||||
//
|
||||
// @attention It's valid to update only mutable texture. See `bgfx::createTexture2D` for more info.
|
||||
//
|
||||
// _handle : `Texture handle.`
|
||||
// _layer : `Layer in texture array.`
|
||||
// _mip : `Mip level.`
|
||||
@@ -2395,7 +2421,9 @@ extern fn TextureHandle create_texture_cube(ushort _size, bool _hasMips, ushort
|
||||
extern fn void update_texture_2d(TextureHandle _handle, ushort _layer, char _mip, ushort _x, ushort _y, ushort _width, ushort _height, Memory* _mem, ushort _pitch) @extern("bgfx_update_texture_2d");
|
||||
|
||||
// Update 3D texture.
|
||||
//
|
||||
// @attention It's valid to update only mutable texture. See `bgfx::createTexture3D` for more info.
|
||||
//
|
||||
// _handle : `Texture handle.`
|
||||
// _mip : `Mip level.`
|
||||
// _x : `X offset in texture.`
|
||||
@@ -2408,7 +2436,9 @@ extern fn void update_texture_2d(TextureHandle _handle, ushort _layer, char _mip
|
||||
extern fn void update_texture_3d(TextureHandle _handle, char _mip, ushort _x, ushort _y, ushort _z, ushort _width, ushort _height, ushort _depth, Memory* _mem) @extern("bgfx_update_texture_3d");
|
||||
|
||||
// Update Cube texture.
|
||||
//
|
||||
// @attention It's valid to update only mutable texture. See `bgfx::createTextureCube` for more info.
|
||||
//
|
||||
// _handle : `Texture handle.`
|
||||
// _layer : `Layer in texture array.`
|
||||
// _side : `Cubemap side `BGFX_CUBE_MAP_<POSITIVE or NEGATIVE>_<X, Y or Z>`, where 0 is +X, 1 is -X, 2 is +Y, 3 is -Y, 4 is +Z, and 5 is -Z. +----------+ |-z 2| | ^ +y | | | | Unfolded cube: | +---->+x | +----------+----------+----------+----------+ |+y 1|+y 4|+y 0|+y 5| | ^ -x | ^ +z | ^ +x | ^ -z | | | | | | | | | | | +---->+z | +---->+x | +---->-z | +---->-x | +----------+----------+----------+----------+ |+z 3| | ^ -y | | | | | +---->+x | +----------+`
|
||||
@@ -2422,8 +2452,10 @@ extern fn void update_texture_3d(TextureHandle _handle, char _mip, ushort _x, us
|
||||
extern fn void update_texture_cube(TextureHandle _handle, ushort _layer, char _side, char _mip, ushort _x, ushort _y, ushort _width, ushort _height, Memory* _mem, ushort _pitch) @extern("bgfx_update_texture_cube");
|
||||
|
||||
// Read back texture content.
|
||||
//
|
||||
// @attention Texture must be created with `BGFX_TEXTURE_READ_BACK` flag.
|
||||
// @attention Availability depends on: `BGFX_CAPS_TEXTURE_READ_BACK`.
|
||||
//
|
||||
// _handle : `Texture handle.`
|
||||
// _data : `Destination buffer.`
|
||||
// _mip : `Mip level.`
|
||||
@@ -2436,8 +2468,10 @@ extern fn uint read_texture(TextureHandle _handle, void* _data, char _mip) @exte
|
||||
extern fn void set_texture_name(TextureHandle _handle, ZString _name, int _len) @extern("bgfx_set_texture_name");
|
||||
|
||||
// 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.
|
||||
//
|
||||
// _handle : `Texture handle.`
|
||||
extern fn void* get_direct_access_ptr(TextureHandle _handle) @extern("bgfx_get_direct_access_ptr");
|
||||
|
||||
@@ -2473,9 +2507,12 @@ extern fn FrameBufferHandle create_frame_buffer_from_handles(char _num, TextureH
|
||||
extern fn FrameBufferHandle create_frame_buffer_from_attachment(char _num, Attachment* _attachment, bool _destroyTexture) @extern("bgfx_create_frame_buffer_from_attachment");
|
||||
|
||||
// Create frame buffer for multiple window rendering.
|
||||
//
|
||||
// @remarks
|
||||
// Frame buffer cannot be used for sampling.
|
||||
//
|
||||
// @attention Availability depends on: `BGFX_CAPS_SWAP_CHAIN`.
|
||||
//
|
||||
// _nwh : `OS' target native window handle.`
|
||||
// _width : `Window back buffer width.`
|
||||
// _height : `Window back buffer height.`
|
||||
@@ -2498,12 +2535,14 @@ extern fn TextureHandle get_texture(FrameBufferHandle _handle, char _attachment)
|
||||
extern fn void destroy_frame_buffer(FrameBufferHandle _handle) @extern("bgfx_destroy_frame_buffer");
|
||||
|
||||
// Create shader uniform parameter.
|
||||
//
|
||||
// @remarks
|
||||
// 1. Uniform names are unique. It's valid to call `bgfx::createUniform`
|
||||
// multiple times with the same uniform name. The library will always
|
||||
// return the same handle, but the handle reference count will be
|
||||
// incremented. This means that the same number of `bgfx::destroyUniform`
|
||||
// must be called to properly destroy the uniform.
|
||||
//
|
||||
// 2. Predefined uniforms (declared in `bgfx_shader.sh`):
|
||||
// - `u_viewRect vec4(x, y, width, height)` - view rectangle for current
|
||||
// view, in pixels.
|
||||
@@ -2521,18 +2560,21 @@ extern fn void destroy_frame_buffer(FrameBufferHandle _handle) @extern("bgfx_des
|
||||
// - `u_invModelView mat4` - inverted concatenated model view matrix.
|
||||
// - `u_modelViewProj mat4` - concatenated model view projection matrix.
|
||||
// - `u_alphaRef float` - alpha reference value for alpha test.
|
||||
//
|
||||
// _name : `Uniform name in shader.`
|
||||
// _type : `Type of uniform (See: `bgfx::UniformType`).`
|
||||
// _num : `Number of elements in array.`
|
||||
extern fn UniformHandle create_uniform(ZString _name, UniformType _type, ushort _num) @extern("bgfx_create_uniform");
|
||||
|
||||
// Create shader uniform parameter.
|
||||
//
|
||||
// @remarks
|
||||
// 1. Uniform names are unique. It's valid to call `bgfx::createUniform`
|
||||
// multiple times with the same uniform name. The library will always
|
||||
// return the same handle, but the handle reference count will be
|
||||
// incremented. This means that the same number of `bgfx::destroyUniform`
|
||||
// must be called to properly destroy the uniform.
|
||||
//
|
||||
// 2. Predefined uniforms (declared in `bgfx_shader.sh`):
|
||||
// - `u_viewRect vec4(x, y, width, height)` - view rectangle for current
|
||||
// view, in pixels.
|
||||
@@ -2550,6 +2592,7 @@ extern fn UniformHandle create_uniform(ZString _name, UniformType _type, ushort
|
||||
// - `u_invModelView mat4` - inverted concatenated model view matrix.
|
||||
// - `u_modelViewProj mat4` - concatenated model view projection matrix.
|
||||
// - `u_alphaRef float` - alpha reference value for alpha test.
|
||||
//
|
||||
// _name : `Uniform name in shader.`
|
||||
// _freq : `Uniform change frequency (See: `bgfx::UniformFreq`).`
|
||||
// _type : `Type of uniform (See: `bgfx::UniformType`).`
|
||||
@@ -2565,7 +2608,8 @@ extern fn void get_uniform_info(UniformHandle _handle, UniformInfo* _info) @exte
|
||||
// _handle : `Handle to uniform object.`
|
||||
extern fn void destroy_uniform(UniformHandle _handle) @extern("bgfx_destroy_uniform");
|
||||
|
||||
// Create occlusion query.
|
||||
// Create occlusion query. Occlusion queries allow the GPU to determine
|
||||
// if any pixels passed the depth test.
|
||||
extern fn OcclusionQueryHandle create_occlusion_query() @extern("bgfx_create_occlusion_query");
|
||||
|
||||
// Retrieve occlusion query result from previous frame.
|
||||
@@ -2596,13 +2640,17 @@ extern fn void set_palette_color_rgba32f(char _index, float _r, float _g, float
|
||||
extern fn void set_palette_color_rgba8(char _index, uint _rgba) @extern("bgfx_set_palette_color_rgba8");
|
||||
|
||||
// Set view name.
|
||||
//
|
||||
// @remarks
|
||||
// This is debug only feature.
|
||||
//
|
||||
// In graphics debugger view name will appear as:
|
||||
//
|
||||
// "nnnc <view name>"
|
||||
// ^ ^ ^
|
||||
// | +--- compute (C)
|
||||
// +------ view id
|
||||
//
|
||||
// _id : `View id.`
|
||||
// _name : `View name.`
|
||||
// _len : `View name length (if length is INT32_MAX, it's expected that _name is zero terminated string.`
|
||||
@@ -2658,15 +2706,19 @@ extern fn void set_view_clear(ushort _id, ushort _flags, uint _rgba, float _dept
|
||||
extern fn void set_view_clear_mrt(ushort _id, ushort _flags, float _depth, char _stencil, char _c0, char _c1, char _c2, char _c3, char _c4, char _c5, char _c6, char _c7) @extern("bgfx_set_view_clear_mrt");
|
||||
|
||||
// Set view sorting mode.
|
||||
//
|
||||
// @remarks
|
||||
// View mode must be set prior calling `bgfx::submit` for the view.
|
||||
//
|
||||
// _id : `View id.`
|
||||
// _mode : `View sort mode. See `ViewMode::Enum`.`
|
||||
extern fn void set_view_mode(ushort _id, ViewMode _mode) @extern("bgfx_set_view_mode");
|
||||
|
||||
// Set view frame buffer.
|
||||
//
|
||||
// @remarks
|
||||
// Not persistent after `bgfx::reset` call.
|
||||
//
|
||||
// _id : `View id.`
|
||||
// _handle : `Frame buffer handle. Passing `BGFX_INVALID_HANDLE` as frame buffer handle will draw primitives from this view into default back buffer.`
|
||||
extern fn void set_view_frame_buffer(ushort _id, FrameBufferHandle _handle) @extern("bgfx_set_view_frame_buffer");
|
||||
@@ -2685,7 +2737,9 @@ extern fn void set_view_transform(ushort _id, void* _view, void* _proj) @extern(
|
||||
extern fn void set_view_order(ushort _id, ushort _num, ushort* _order) @extern("bgfx_set_view_order");
|
||||
|
||||
// Set view shading rate.
|
||||
//
|
||||
// @attention Availability depends on: `BGFX_CAPS_VARIABLE_RATE_SHADING`.
|
||||
//
|
||||
// _id : `View id.`
|
||||
// _shadingRate : `Shading rate.`
|
||||
extern fn void set_view_shading_rate(ushort _id, ShadingRate _shadingRate) @extern("bgfx_set_view_shading_rate");
|
||||
@@ -2709,6 +2763,7 @@ extern fn void encoder_end(Encoder* _encoder) @extern("bgfx_encoder_end");
|
||||
extern fn void encoder_set_marker(Encoder* _this, ZString _name, int _len) @extern("bgfx_encoder_set_marker");
|
||||
|
||||
// Set render states for draw primitive.
|
||||
//
|
||||
// @remarks
|
||||
// 1. To set up more complex states use:
|
||||
// `BGFX_STATE_ALPHA_REF(_ref)`,
|
||||
@@ -2719,6 +2774,7 @@ extern fn void encoder_set_marker(Encoder* _this, ZString _name, int _len) @exte
|
||||
// `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
|
||||
// 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
|
||||
// equation is specified.
|
||||
//
|
||||
// _state : `State flags. Default state for primitive type is triangles. See: `BGFX_STATE_DEFAULT`. - `BGFX_STATE_DEPTH_TEST_*` - Depth test function. - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC. - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2. - `BGFX_STATE_CULL_*` - Backface culling mode. - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write. - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing. - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.`
|
||||
// _rgba : `Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and `BGFX_STATE_BLEND_INV_FACTOR` blend modes.`
|
||||
extern fn void encoder_set_state(Encoder* _this, ulong _state, uint _rgba) @extern("bgfx_encoder_set_state");
|
||||
@@ -2734,8 +2790,10 @@ extern fn void encoder_set_condition(Encoder* _this, OcclusionQueryHandle _handl
|
||||
extern fn void encoder_set_stencil(Encoder* _this, uint _fstencil, uint _bstencil) @extern("bgfx_encoder_set_stencil");
|
||||
|
||||
// Set scissor for draw primitive.
|
||||
//
|
||||
// @remark
|
||||
// To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
//
|
||||
// _x : `Position x from the left corner of the window.`
|
||||
// _y : `Position y from the top corner of the window.`
|
||||
// _width : `Width of view scissor region.`
|
||||
@@ -2743,8 +2801,10 @@ extern fn void encoder_set_stencil(Encoder* _this, uint _fstencil, uint _bstenci
|
||||
extern fn ushort encoder_set_scissor(Encoder* _this, ushort _x, ushort _y, ushort _width, ushort _height) @extern("bgfx_encoder_set_scissor");
|
||||
|
||||
// Set scissor from cache for draw primitive.
|
||||
//
|
||||
// @remark
|
||||
// To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
//
|
||||
// _cache : `Index in scissor cache.`
|
||||
extern fn void encoder_set_scissor_cached(Encoder* _this, ushort _cache) @extern("bgfx_encoder_set_scissor_cached");
|
||||
|
||||
@@ -2760,7 +2820,9 @@ extern fn uint encoder_set_transform(Encoder* _this, void* _mtx, ushort _num) @e
|
||||
extern fn void encoder_set_transform_cached(Encoder* _this, uint _cache, ushort _num) @extern("bgfx_encoder_set_transform_cached");
|
||||
|
||||
// Reserve matrices in internal matrix cache.
|
||||
//
|
||||
// @attention Pointer returned can be modified until `bgfx::frame` is called.
|
||||
//
|
||||
// _transform : `Pointer to `Transform` structure.`
|
||||
// _num : `Number of matrices.`
|
||||
extern fn uint encoder_alloc_transform(Encoder* _this, Transform* _transform, ushort _num) @extern("bgfx_encoder_alloc_transform");
|
||||
@@ -2772,7 +2834,9 @@ extern fn uint encoder_alloc_transform(Encoder* _this, Transform* _transform, us
|
||||
extern fn void encoder_set_uniform(Encoder* _this, UniformHandle _handle, void* _value, ushort _num) @extern("bgfx_encoder_set_uniform");
|
||||
|
||||
// Set shader uniform parameter for view.
|
||||
//
|
||||
// @attention Uniform must be created with `bgfx::UniformFreq::View` argument.
|
||||
//
|
||||
// _id : `View id.`
|
||||
// _handle : `Uniform.`
|
||||
// _value : `Pointer to uniform data.`
|
||||
@@ -2780,7 +2844,9 @@ extern fn void encoder_set_uniform(Encoder* _this, UniformHandle _handle, void*
|
||||
extern fn void set_view_uniform(ushort _id, UniformHandle _handle, void* _value, ushort _num) @extern("bgfx_set_view_uniform");
|
||||
|
||||
// Set shader uniform parameter for frame.
|
||||
//
|
||||
// @attention Uniform must be created with `bgfx::UniformFreq::View` argument.
|
||||
//
|
||||
// _handle : `Uniform.`
|
||||
// _value : `Pointer to uniform data.`
|
||||
// _num : `Number of elements. Passing `UINT16_MAX` will use the _num passed on uniform creation.`
|
||||
@@ -2826,6 +2892,12 @@ extern fn void encoder_set_vertex_buffer_with_layout(Encoder* _this, char _strea
|
||||
// _numVertices : `Number of vertices to render.`
|
||||
extern fn void encoder_set_dynamic_vertex_buffer(Encoder* _this, char _stream, DynamicVertexBufferHandle _handle, uint _startVertex, uint _numVertices) @extern("bgfx_encoder_set_dynamic_vertex_buffer");
|
||||
|
||||
// Set vertex buffer for draw primitive.
|
||||
// _stream : `Vertex stream.`
|
||||
// _handle : `Dynamic vertex buffer.`
|
||||
// _startVertex : `First vertex to render.`
|
||||
// _numVertices : `Number of vertices to render.`
|
||||
// _layoutHandle : `Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.`
|
||||
extern fn void encoder_set_dynamic_vertex_buffer_with_layout(Encoder* _this, char _stream, DynamicVertexBufferHandle _handle, uint _startVertex, uint _numVertices, VertexLayoutHandle _layoutHandle) @extern("bgfx_encoder_set_dynamic_vertex_buffer_with_layout");
|
||||
|
||||
// Set vertex buffer for draw primitive.
|
||||
@@ -2845,7 +2917,9 @@ extern fn void encoder_set_transient_vertex_buffer_with_layout(Encoder* _this, c
|
||||
|
||||
// Set number of vertices for auto generated vertices use in conjunction
|
||||
// with gl_VertexID.
|
||||
//
|
||||
// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
//
|
||||
// _numVertices : `Number of vertices.`
|
||||
extern fn void encoder_set_vertex_count(Encoder* _this, uint _numVertices) @extern("bgfx_encoder_set_vertex_count");
|
||||
|
||||
@@ -2869,7 +2943,9 @@ extern fn void encoder_set_instance_data_from_dynamic_vertex_buffer(Encoder* _th
|
||||
|
||||
// Set number of instances for auto generated instances use in conjunction
|
||||
// with gl_InstanceID.
|
||||
//
|
||||
// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
//
|
||||
// _numInstances : `Number of instances.`
|
||||
extern fn void encoder_set_instance_count(Encoder* _this, uint _numInstances) @extern("bgfx_encoder_set_instance_count");
|
||||
|
||||
@@ -2884,8 +2960,10 @@ extern fn void encoder_set_texture(Encoder* _this, char _stage, UniformHandle _s
|
||||
// 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.
|
||||
//
|
||||
// _id : `View id.`
|
||||
extern fn void encoder_touch(Encoder* _this, ushort _id) @extern("bgfx_encoder_touch");
|
||||
|
||||
@@ -2906,7 +2984,9 @@ extern fn void encoder_submit_occlusion_query(Encoder* _this, ushort _id, Progra
|
||||
|
||||
// Submit primitive for rendering with index and instance data info from
|
||||
// indirect buffer.
|
||||
//
|
||||
// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
|
||||
//
|
||||
// _id : `View id.`
|
||||
// _program : `Program.`
|
||||
// _indirectHandle : `Indirect buffer.`
|
||||
@@ -2918,7 +2998,9 @@ extern fn void encoder_submit_indirect(Encoder* _this, ushort _id, ProgramHandle
|
||||
|
||||
// Submit primitive for rendering with index and instance data info and
|
||||
// draw count from indirect buffers.
|
||||
//
|
||||
// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
|
||||
//
|
||||
// _id : `View id.`
|
||||
// _program : `Program.`
|
||||
// _indirectHandle : `Indirect buffer.`
|
||||
@@ -2991,8 +3073,10 @@ extern fn void encoder_dispatch_indirect(Encoder* _this, ushort _id, ProgramHand
|
||||
extern fn void encoder_discard(Encoder* _this, char _flags) @extern("bgfx_encoder_discard");
|
||||
|
||||
// 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`.
|
||||
//
|
||||
// _id : `View id.`
|
||||
// _dst : `Destination texture handle.`
|
||||
// _dstMip : `Destination texture mip level.`
|
||||
@@ -3010,40 +3094,53 @@ extern fn void encoder_discard(Encoder* _this, char _flags) @extern("bgfx_encode
|
||||
extern fn void encoder_blit(Encoder* _this, ushort _id, TextureHandle _dst, char _dstMip, ushort _dstX, ushort _dstY, ushort _dstZ, TextureHandle _src, char _srcMip, ushort _srcX, ushort _srcY, ushort _srcZ, ushort _width, ushort _height, ushort _depth) @extern("bgfx_encoder_blit");
|
||||
|
||||
// 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.
|
||||
//
|
||||
// _handle : `Frame buffer handle. If handle is `BGFX_INVALID_HANDLE` request will be made for main window back buffer.`
|
||||
// _filePath : `Will be passed to `bgfx::CallbackI::screenShot` callback.`
|
||||
extern fn void request_screen_shot(FrameBufferHandle _handle, ZString _filePath) @extern("bgfx_request_screen_shot");
|
||||
|
||||
// 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.
|
||||
//
|
||||
// _msecs : `Timeout in milliseconds.`
|
||||
extern fn RenderFrame render_frame(int _msecs) @extern("bgfx_render_frame");
|
||||
|
||||
// Set platform data.
|
||||
//
|
||||
// @warning Must be called before `bgfx::init`.
|
||||
//
|
||||
// _data : `Platform data.`
|
||||
extern fn void set_platform_data(PlatformData* _data) @extern("bgfx_set_platform_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.
|
||||
//
|
||||
extern fn InternalData* get_internal_data() @extern("bgfx_get_internal_data");
|
||||
|
||||
// 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.
|
||||
//
|
||||
// _handle : `Texture handle.`
|
||||
// _ptr : `Native API pointer to texture.`
|
||||
// _layerIndex : `Layer index for texture arrays (only implemented for D3D11).`
|
||||
@@ -3051,11 +3148,15 @@ extern fn uptr override_internal_texture_ptr(TextureHandle _handle, uptr _ptr, u
|
||||
|
||||
// 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.
|
||||
//
|
||||
// _handle : `Texture handle.`
|
||||
// _width : `Width.`
|
||||
// _height : `Height.`
|
||||
@@ -3071,6 +3172,7 @@ extern fn uptr override_internal_texture(TextureHandle _handle, ushort _width, u
|
||||
extern fn void set_marker(ZString _name, int _len) @extern("bgfx_set_marker");
|
||||
|
||||
// Set render states for draw primitive.
|
||||
//
|
||||
// @remarks
|
||||
// 1. To set up more complex states use:
|
||||
// `BGFX_STATE_ALPHA_REF(_ref)`,
|
||||
@@ -3081,6 +3183,7 @@ extern fn void set_marker(ZString _name, int _len) @extern("bgfx_set_marker");
|
||||
// `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
|
||||
// 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
|
||||
// equation is specified.
|
||||
//
|
||||
// _state : `State flags. Default state for primitive type is triangles. See: `BGFX_STATE_DEFAULT`. - `BGFX_STATE_DEPTH_TEST_*` - Depth test function. - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC. - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2. - `BGFX_STATE_CULL_*` - Backface culling mode. - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write. - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing. - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.`
|
||||
// _rgba : `Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and `BGFX_STATE_BLEND_INV_FACTOR` blend modes.`
|
||||
extern fn void set_state(ulong _state, uint _rgba) @extern("bgfx_set_state");
|
||||
@@ -3096,8 +3199,10 @@ extern fn void set_condition(OcclusionQueryHandle _handle, bool _visible) @exter
|
||||
extern fn void set_stencil(uint _fstencil, uint _bstencil) @extern("bgfx_set_stencil");
|
||||
|
||||
// Set scissor for draw primitive.
|
||||
//
|
||||
// @remark
|
||||
// To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
//
|
||||
// _x : `Position x from the left corner of the window.`
|
||||
// _y : `Position y from the top corner of the window.`
|
||||
// _width : `Width of view scissor region.`
|
||||
@@ -3105,8 +3210,10 @@ extern fn void set_stencil(uint _fstencil, uint _bstencil) @extern("bgfx_set_ste
|
||||
extern fn ushort set_scissor(ushort _x, ushort _y, ushort _width, ushort _height) @extern("bgfx_set_scissor");
|
||||
|
||||
// Set scissor from cache for draw primitive.
|
||||
//
|
||||
// @remark
|
||||
// To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
//
|
||||
// _cache : `Index in scissor cache.`
|
||||
extern fn void set_scissor_cached(ushort _cache) @extern("bgfx_set_scissor_cached");
|
||||
|
||||
@@ -3122,7 +3229,9 @@ extern fn uint set_transform(void* _mtx, ushort _num) @extern("bgfx_set_transfor
|
||||
extern fn void set_transform_cached(uint _cache, ushort _num) @extern("bgfx_set_transform_cached");
|
||||
|
||||
// Reserve matrices in internal matrix cache.
|
||||
//
|
||||
// @attention Pointer returned can be modified until `bgfx::frame` is called.
|
||||
//
|
||||
// _transform : `Pointer to `Transform` structure.`
|
||||
// _num : `Number of matrices.`
|
||||
extern fn uint alloc_transform(Transform* _transform, ushort _num) @extern("bgfx_alloc_transform");
|
||||
@@ -3198,7 +3307,9 @@ extern fn void set_transient_vertex_buffer_with_layout(char _stream, TransientVe
|
||||
|
||||
// Set number of vertices for auto generated vertices use in conjunction
|
||||
// with gl_VertexID.
|
||||
//
|
||||
// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
//
|
||||
// _numVertices : `Number of vertices.`
|
||||
extern fn void set_vertex_count(uint _numVertices) @extern("bgfx_set_vertex_count");
|
||||
|
||||
@@ -3222,7 +3333,9 @@ extern fn void set_instance_data_from_dynamic_vertex_buffer(DynamicVertexBufferH
|
||||
|
||||
// Set number of instances for auto generated instances use in conjunction
|
||||
// with gl_InstanceID.
|
||||
//
|
||||
// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
//
|
||||
// _numInstances : `Number of instances.`
|
||||
extern fn void set_instance_count(uint _numInstances) @extern("bgfx_set_instance_count");
|
||||
|
||||
@@ -3235,8 +3348,10 @@ extern fn void set_texture(char _stage, UniformHandle _sampler, TextureHandle _h
|
||||
|
||||
// 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.
|
||||
//
|
||||
// _id : `View id.`
|
||||
extern fn void touch(ushort _id) @extern("bgfx_touch");
|
||||
|
||||
@@ -3257,7 +3372,9 @@ extern fn void submit_occlusion_query(ushort _id, ProgramHandle _program, Occlus
|
||||
|
||||
// Submit primitive for rendering with index and instance data info from
|
||||
// indirect buffer.
|
||||
//
|
||||
// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
|
||||
//
|
||||
// _id : `View id.`
|
||||
// _program : `Program.`
|
||||
// _indirectHandle : `Indirect buffer.`
|
||||
@@ -3269,7 +3386,9 @@ extern fn void submit_indirect(ushort _id, ProgramHandle _program, IndirectBuffe
|
||||
|
||||
// Submit primitive for rendering with index and instance data info and
|
||||
// draw count from indirect buffers.
|
||||
//
|
||||
// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
|
||||
//
|
||||
// _id : `View id.`
|
||||
// _program : `Program.`
|
||||
// _indirectHandle : `Indirect buffer.`
|
||||
@@ -3342,8 +3461,10 @@ extern fn void dispatch_indirect(ushort _id, ProgramHandle _program, IndirectBuf
|
||||
extern fn void discard(char _flags) @extern("bgfx_discard");
|
||||
|
||||
// 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`.
|
||||
//
|
||||
// _id : `View id.`
|
||||
// _dst : `Destination texture handle.`
|
||||
// _dstMip : `Destination texture mip level.`
|
||||
|
||||
@@ -2494,7 +2494,9 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Add attribute to VertexLayout.
|
||||
///
|
||||
/// @remarks Must be called between begin/end.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_attrib">Attribute semantics. See: `bgfx::Attrib`</param>
|
||||
@@ -2576,7 +2578,7 @@ public static partial class bgfx
|
||||
public static extern unsafe void vertex_convert(VertexLayout* _dstLayout, void* _dstData, VertexLayout* _srcLayout, void* _srcData, uint _num);
|
||||
|
||||
/// <summary>
|
||||
/// Weld vertices.
|
||||
/// Weld vertices. Returns number of unique vertices after welding.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_output">Welded vertices remapping table. The size of buffer must be the same as number of vertices.</param>
|
||||
@@ -2668,8 +2670,10 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Reset graphic settings and back-buffer size.
|
||||
///
|
||||
/// @attention This call doesn’t change the window size, it just resizes
|
||||
/// the back-buffer. Your windowing code controls the window size.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_width">Back-buffer width.</param>
|
||||
@@ -2693,8 +2697,10 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Returns current renderer backend API type.
|
||||
///
|
||||
/// @remarks
|
||||
/// Library must be initialized.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
[DllImport(DllName, EntryPoint="bgfx_get_renderer_type", CallingConvention = CallingConvention.Cdecl)]
|
||||
@@ -2702,8 +2708,10 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Returns renderer capabilities.
|
||||
///
|
||||
/// @remarks
|
||||
/// Library must be initialized.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
[DllImport(DllName, EntryPoint="bgfx_get_caps", CallingConvention = CallingConvention.Cdecl)]
|
||||
@@ -2711,7 +2719,9 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Returns performance counters.
|
||||
///
|
||||
/// @attention Pointer returned is valid until `bgfx::frame` is called.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
[DllImport(DllName, EntryPoint="bgfx_get_stats", CallingConvention = CallingConvention.Cdecl)]
|
||||
@@ -2743,7 +2753,9 @@ public static partial class bgfx
|
||||
/// 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.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_data">Pointer to data.</param>
|
||||
@@ -2759,7 +2771,9 @@ public static partial class bgfx
|
||||
/// 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.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_data">Pointer to data.</param>
|
||||
@@ -2859,7 +2873,7 @@ public static partial class bgfx
|
||||
public static extern unsafe void destroy_index_buffer(IndexBufferHandle _handle);
|
||||
|
||||
/// <summary>
|
||||
/// Create vertex layout.
|
||||
/// Create vertex layout. Vertex layouts are used to describe the format of vertex data.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_layout">Vertex layout.</param>
|
||||
@@ -3021,6 +3035,7 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Allocate transient index buffer.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_tib">TransientIndexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.</param>
|
||||
@@ -3045,6 +3060,7 @@ public static partial class bgfx
|
||||
/// Check for required space and allocate transient vertex and index
|
||||
/// buffers. If both space requirements are satisfied function returns
|
||||
/// true.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_tvb">TransientVertexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.</param>
|
||||
@@ -3089,8 +3105,10 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Create shader from memory buffer.
|
||||
///
|
||||
/// @remarks
|
||||
/// Shader binary is obtained by compiling shader offline with shaderc command line tool.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_mem">Shader binary.</param>
|
||||
@@ -3100,8 +3118,10 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Returns the number of uniforms and uniform handles used inside a shader.
|
||||
///
|
||||
/// @remarks
|
||||
/// Only non-predefined uniforms are returned.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_handle">Shader handle.</param>
|
||||
@@ -3124,8 +3144,10 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Destroy shader.
|
||||
///
|
||||
/// @remark Once a shader program is created with _handle,
|
||||
/// it is safe to destroy that shader.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_handle">Shader handle.</param>
|
||||
@@ -3279,7 +3301,9 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Update 2D texture.
|
||||
///
|
||||
/// @attention It's valid to update only mutable texture. See `bgfx::createTexture2D` for more info.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_handle">Texture handle.</param>
|
||||
@@ -3297,7 +3321,9 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Update 3D texture.
|
||||
///
|
||||
/// @attention It's valid to update only mutable texture. See `bgfx::createTexture3D` for more info.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_handle">Texture handle.</param>
|
||||
@@ -3315,7 +3341,9 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Update Cube texture.
|
||||
///
|
||||
/// @attention It's valid to update only mutable texture. See `bgfx::createTextureCube` for more info.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_handle">Texture handle.</param>
|
||||
@@ -3334,8 +3362,10 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Read back texture content.
|
||||
///
|
||||
/// @attention Texture must be created with `BGFX_TEXTURE_READ_BACK` flag.
|
||||
/// @attention Availability depends on: `BGFX_CAPS_TEXTURE_READ_BACK`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_handle">Texture handle.</param>
|
||||
@@ -3358,8 +3388,10 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_handle">Texture handle.</param>
|
||||
@@ -3425,9 +3457,12 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Create frame buffer for multiple window rendering.
|
||||
///
|
||||
/// @remarks
|
||||
/// Frame buffer cannot be used for sampling.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_SWAP_CHAIN`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_nwh">OS' target native window handle.</param>
|
||||
@@ -3470,12 +3505,14 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Create shader uniform parameter.
|
||||
///
|
||||
/// @remarks
|
||||
/// 1. Uniform names are unique. It's valid to call `bgfx::createUniform`
|
||||
/// multiple times with the same uniform name. The library will always
|
||||
/// return the same handle, but the handle reference count will be
|
||||
/// incremented. This means that the same number of `bgfx::destroyUniform`
|
||||
/// must be called to properly destroy the uniform.
|
||||
///
|
||||
/// 2. Predefined uniforms (declared in `bgfx_shader.sh`):
|
||||
/// - `u_viewRect vec4(x, y, width, height)` - view rectangle for current
|
||||
/// view, in pixels.
|
||||
@@ -3493,6 +3530,7 @@ public static partial class bgfx
|
||||
/// - `u_invModelView mat4` - inverted concatenated model view matrix.
|
||||
/// - `u_modelViewProj mat4` - concatenated model view projection matrix.
|
||||
/// - `u_alphaRef float` - alpha reference value for alpha test.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_name">Uniform name in shader.</param>
|
||||
@@ -3504,12 +3542,14 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Create shader uniform parameter.
|
||||
///
|
||||
/// @remarks
|
||||
/// 1. Uniform names are unique. It's valid to call `bgfx::createUniform`
|
||||
/// multiple times with the same uniform name. The library will always
|
||||
/// return the same handle, but the handle reference count will be
|
||||
/// incremented. This means that the same number of `bgfx::destroyUniform`
|
||||
/// must be called to properly destroy the uniform.
|
||||
///
|
||||
/// 2. Predefined uniforms (declared in `bgfx_shader.sh`):
|
||||
/// - `u_viewRect vec4(x, y, width, height)` - view rectangle for current
|
||||
/// view, in pixels.
|
||||
@@ -3527,6 +3567,7 @@ public static partial class bgfx
|
||||
/// - `u_invModelView mat4` - inverted concatenated model view matrix.
|
||||
/// - `u_modelViewProj mat4` - concatenated model view projection matrix.
|
||||
/// - `u_alphaRef float` - alpha reference value for alpha test.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_name">Uniform name in shader.</param>
|
||||
@@ -3557,7 +3598,8 @@ public static partial class bgfx
|
||||
public static extern unsafe void destroy_uniform(UniformHandle _handle);
|
||||
|
||||
/// <summary>
|
||||
/// Create occlusion query.
|
||||
/// Create occlusion query. Occlusion queries allow the GPU to determine
|
||||
/// if any pixels passed the depth test.
|
||||
/// </summary>
|
||||
///
|
||||
[DllImport(DllName, EntryPoint="bgfx_create_occlusion_query", CallingConvention = CallingConvention.Cdecl)]
|
||||
@@ -3617,13 +3659,17 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set view name.
|
||||
///
|
||||
/// @remarks
|
||||
/// This is debug only feature.
|
||||
///
|
||||
/// In graphics debugger view name will appear as:
|
||||
///
|
||||
/// "nnnc <view name>"
|
||||
/// ^ ^ ^
|
||||
/// | +--- compute (C)
|
||||
/// +------ view id
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -3709,8 +3755,10 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set view sorting mode.
|
||||
///
|
||||
/// @remarks
|
||||
/// View mode must be set prior calling `bgfx::submit` for the view.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -3721,8 +3769,10 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set view frame buffer.
|
||||
///
|
||||
/// @remarks
|
||||
/// Not persistent after `bgfx::reset` call.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -3756,7 +3806,9 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set view shading rate.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_VARIABLE_RATE_SHADING`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -3805,6 +3857,7 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set render states for draw primitive.
|
||||
///
|
||||
/// @remarks
|
||||
/// 1. To set up more complex states use:
|
||||
/// `BGFX_STATE_ALPHA_REF(_ref)`,
|
||||
@@ -3815,6 +3868,7 @@ public static partial class bgfx
|
||||
/// `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
|
||||
/// 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
|
||||
/// equation is specified.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_state">State flags. Default state for primitive type is triangles. See: `BGFX_STATE_DEFAULT`. - `BGFX_STATE_DEPTH_TEST_*` - Depth test function. - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC. - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2. - `BGFX_STATE_CULL_*` - Backface culling mode. - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write. - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing. - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.</param>
|
||||
@@ -3845,8 +3899,10 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set scissor for draw primitive.
|
||||
///
|
||||
/// @remark
|
||||
/// To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_x">Position x from the left corner of the window.</param>
|
||||
@@ -3859,8 +3915,10 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set scissor from cache for draw primitive.
|
||||
///
|
||||
/// @remark
|
||||
/// To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_cache">Index in scissor cache.</param>
|
||||
@@ -3891,7 +3949,9 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Reserve matrices in internal matrix cache.
|
||||
///
|
||||
/// @attention Pointer returned can be modified until `bgfx::frame` is called.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_transform">Pointer to `Transform` structure.</param>
|
||||
@@ -3913,7 +3973,9 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set shader uniform parameter for view.
|
||||
///
|
||||
/// @attention Uniform must be created with `bgfx::UniformFreq::View` argument.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -3926,7 +3988,9 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set shader uniform parameter for frame.
|
||||
///
|
||||
/// @attention Uniform must be created with `bgfx::UniformFreq::View` argument.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_handle">Uniform.</param>
|
||||
@@ -4006,6 +4070,16 @@ public static partial class bgfx
|
||||
[DllImport(DllName, EntryPoint="bgfx_encoder_set_dynamic_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern unsafe void encoder_set_dynamic_vertex_buffer(Encoder* _this, byte _stream, DynamicVertexBufferHandle _handle, uint _startVertex, uint _numVertices);
|
||||
|
||||
/// <summary>
|
||||
/// Set vertex buffer for draw primitive.
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_stream">Vertex stream.</param>
|
||||
/// <param name="_handle">Dynamic vertex buffer.</param>
|
||||
/// <param name="_startVertex">First vertex to render.</param>
|
||||
/// <param name="_numVertices">Number of vertices to render.</param>
|
||||
/// <param name="_layoutHandle">Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.</param>
|
||||
///
|
||||
[DllImport(DllName, EntryPoint="bgfx_encoder_set_dynamic_vertex_buffer_with_layout", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern unsafe void encoder_set_dynamic_vertex_buffer_with_layout(Encoder* _this, byte _stream, DynamicVertexBufferHandle _handle, uint _startVertex, uint _numVertices, VertexLayoutHandle _layoutHandle);
|
||||
|
||||
@@ -4037,7 +4111,9 @@ public static partial class bgfx
|
||||
/// <summary>
|
||||
/// Set number of vertices for auto generated vertices use in conjunction
|
||||
/// with gl_VertexID.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_numVertices">Number of vertices.</param>
|
||||
@@ -4081,7 +4157,9 @@ public static partial class bgfx
|
||||
/// <summary>
|
||||
/// Set number of instances for auto generated instances use in conjunction
|
||||
/// with gl_InstanceID.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_numInstances">Number of instances.</param>
|
||||
@@ -4106,8 +4184,10 @@ public static partial class bgfx
|
||||
/// 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.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -4143,7 +4223,9 @@ public static partial class bgfx
|
||||
/// <summary>
|
||||
/// Submit primitive for rendering with index and instance data info from
|
||||
/// indirect buffer.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -4160,7 +4242,9 @@ public static partial class bgfx
|
||||
/// <summary>
|
||||
/// Submit primitive for rendering with index and instance data info and
|
||||
/// draw count from indirect buffers.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -4283,8 +4367,10 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// 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`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -4307,9 +4393,11 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_handle">Frame buffer handle. If handle is `BGFX_INVALID_HANDLE` request will be made for main window back buffer.</param>
|
||||
@@ -4320,13 +4408,16 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_msecs">Timeout in milliseconds.</param>
|
||||
@@ -4336,7 +4427,9 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set platform data.
|
||||
///
|
||||
/// @warning Must be called before `bgfx::init`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_data">Platform data.</param>
|
||||
@@ -4346,9 +4439,12 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// 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.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
[DllImport(DllName, EntryPoint="bgfx_get_internal_data", CallingConvention = CallingConvention.Cdecl)]
|
||||
@@ -4357,9 +4453,12 @@ public static partial class bgfx
|
||||
/// <summary>
|
||||
/// 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.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_handle">Texture handle.</param>
|
||||
@@ -4372,11 +4471,15 @@ public static partial class bgfx
|
||||
/// <summary>
|
||||
/// 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.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_handle">Texture handle.</param>
|
||||
@@ -4402,6 +4505,7 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set render states for draw primitive.
|
||||
///
|
||||
/// @remarks
|
||||
/// 1. To set up more complex states use:
|
||||
/// `BGFX_STATE_ALPHA_REF(_ref)`,
|
||||
@@ -4412,6 +4516,7 @@ public static partial class bgfx
|
||||
/// `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
|
||||
/// 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
|
||||
/// equation is specified.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_state">State flags. Default state for primitive type is triangles. See: `BGFX_STATE_DEFAULT`. - `BGFX_STATE_DEPTH_TEST_*` - Depth test function. - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC. - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2. - `BGFX_STATE_CULL_*` - Backface culling mode. - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write. - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing. - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.</param>
|
||||
@@ -4442,8 +4547,10 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set scissor for draw primitive.
|
||||
///
|
||||
/// @remark
|
||||
/// To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_x">Position x from the left corner of the window.</param>
|
||||
@@ -4456,8 +4563,10 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Set scissor from cache for draw primitive.
|
||||
///
|
||||
/// @remark
|
||||
/// To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_cache">Index in scissor cache.</param>
|
||||
@@ -4488,7 +4597,9 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// Reserve matrices in internal matrix cache.
|
||||
///
|
||||
/// @attention Pointer returned can be modified until `bgfx::frame` is called.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_transform">Pointer to `Transform` structure.</param>
|
||||
@@ -4619,7 +4730,9 @@ public static partial class bgfx
|
||||
/// <summary>
|
||||
/// Set number of vertices for auto generated vertices use in conjunction
|
||||
/// with gl_VertexID.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_numVertices">Number of vertices.</param>
|
||||
@@ -4663,7 +4776,9 @@ public static partial class bgfx
|
||||
/// <summary>
|
||||
/// Set number of instances for auto generated instances use in conjunction
|
||||
/// with gl_InstanceID.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_numInstances">Number of instances.</param>
|
||||
@@ -4686,8 +4801,10 @@ public static partial class bgfx
|
||||
/// <summary>
|
||||
/// 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.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -4723,7 +4840,9 @@ public static partial class bgfx
|
||||
/// <summary>
|
||||
/// Submit primitive for rendering with index and instance data info from
|
||||
/// indirect buffer.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -4740,7 +4859,9 @@ public static partial class bgfx
|
||||
/// <summary>
|
||||
/// Submit primitive for rendering with index and instance data info and
|
||||
/// draw count from indirect buffers.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
@@ -4863,8 +4984,10 @@ public static partial class bgfx
|
||||
|
||||
/// <summary>
|
||||
/// 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`.
|
||||
///
|
||||
/// </summary>
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
|
||||
@@ -661,7 +661,9 @@ enum AttribType: bgfx.impl.AttribType.Enum{
|
||||
|
||||
/**
|
||||
Texture format enum.
|
||||
|
||||
Notation:
|
||||
|
||||
RGBA16S
|
||||
^ ^ ^
|
||||
| | +-- [ ]Unorm
|
||||
@@ -671,6 +673,7 @@ Notation:
|
||||
| | [U]int
|
||||
| +---- Number of bits per component
|
||||
+-------- Components
|
||||
|
||||
@attention Availability depends on Caps (see: formats).
|
||||
*/
|
||||
enum TextureFormat: bgfx.impl.TextureFormat.Enum{
|
||||
@@ -1240,6 +1243,7 @@ extern(C++, "bgfx") struct Init{
|
||||
|
||||
/**
|
||||
Memory must be obtained by calling `bgfx::alloc`, `bgfx::copy`, or `bgfx::makeRef`.
|
||||
|
||||
@attention It is illegal to create this structure on stack and pass it to any bgfx API.
|
||||
*/
|
||||
extern(C++, "bgfx") struct Memory{
|
||||
@@ -1347,6 +1351,7 @@ extern(C++, "bgfx") struct EncoderStats{
|
||||
|
||||
/**
|
||||
Renderer statistics data.
|
||||
|
||||
@remarks All time values are high-resolution timestamps, while
|
||||
time frequencies define timestamps-per-second for that hardware.
|
||||
*/
|
||||
@@ -1412,7 +1417,9 @@ extern(C++, "bgfx") struct VertexLayout{
|
||||
|
||||
/**
|
||||
Add attribute to VertexLayout.
|
||||
|
||||
Remarks: Must be called between begin/end.
|
||||
|
||||
Params:
|
||||
attrib = Attribute semantics. See: `bgfx::Attrib`
|
||||
num = Number of elements 1, 2, 3 or 4.
|
||||
@@ -1473,6 +1480,7 @@ extern(C++, "bgfx") struct Encoder{
|
||||
|
||||
/**
|
||||
Set render states for draw primitive.
|
||||
|
||||
Remarks:
|
||||
1. To set up more complex states use:
|
||||
`BGFX_STATE_ALPHA_REF(_ref)`,
|
||||
@@ -1483,6 +1491,7 @@ extern(C++, "bgfx") struct Encoder{
|
||||
`BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
|
||||
2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
|
||||
equation is specified.
|
||||
|
||||
Params:
|
||||
state = State flags. Default state for primitive type is
|
||||
triangles. See: `BGFX_STATE_DEFAULT`.
|
||||
@@ -1517,8 +1526,10 @@ extern(C++, "bgfx") struct Encoder{
|
||||
|
||||
/**
|
||||
Set scissor for draw primitive.
|
||||
|
||||
Remarks:
|
||||
To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
|
||||
Params:
|
||||
x = Position x from the left corner of the window.
|
||||
y = Position y from the top corner of the window.
|
||||
@@ -1529,8 +1540,10 @@ extern(C++, "bgfx") struct Encoder{
|
||||
|
||||
/**
|
||||
Set scissor from cache for draw primitive.
|
||||
|
||||
Remarks:
|
||||
To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
|
||||
Params:
|
||||
cache = Index in scissor cache.
|
||||
*/
|
||||
@@ -1555,7 +1568,9 @@ extern(C++, "bgfx") struct Encoder{
|
||||
|
||||
/**
|
||||
Reserve matrices in internal matrix cache.
|
||||
|
||||
Attention: Pointer returned can be modified until `bgfx::frame` is called.
|
||||
|
||||
Params:
|
||||
transform = Pointer to `Transform` structure.
|
||||
num = Number of matrices.
|
||||
@@ -1648,6 +1663,18 @@ extern(C++, "bgfx") struct Encoder{
|
||||
handle = Dynamic vertex buffer.
|
||||
*/
|
||||
{q{void}, q{setVertexBuffer}, q{ubyte stream, DynamicVertexBufferHandle handle}, ext: `C++`},
|
||||
|
||||
/**
|
||||
Set vertex buffer for draw primitive.
|
||||
Params:
|
||||
stream = Vertex stream.
|
||||
handle = Dynamic vertex buffer.
|
||||
startVertex = First vertex to render.
|
||||
numVertices = Number of vertices to render.
|
||||
layoutHandle = Vertex layout for aliasing vertex buffer. If invalid
|
||||
handle is used, vertex layout used for creation
|
||||
of vertex buffer will be used.
|
||||
*/
|
||||
{q{void}, q{setVertexBuffer}, q{ubyte stream, DynamicVertexBufferHandle handle, uint startVertex, uint numVertices, VertexLayoutHandle layoutHandle=invalidHandle!VertexLayoutHandle}, ext: `C++`},
|
||||
|
||||
/**
|
||||
@@ -1674,7 +1701,9 @@ extern(C++, "bgfx") struct Encoder{
|
||||
/**
|
||||
Set number of vertices for auto generated vertices use in conjunction
|
||||
with gl_VertexID.
|
||||
|
||||
Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
|
||||
Params:
|
||||
numVertices = Number of vertices.
|
||||
*/
|
||||
@@ -1717,7 +1746,9 @@ extern(C++, "bgfx") struct Encoder{
|
||||
/**
|
||||
Set number of instances for auto generated instances use in conjunction
|
||||
with gl_InstanceID.
|
||||
|
||||
Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
|
||||
Params:
|
||||
numInstances = Number of instances.
|
||||
*/
|
||||
@@ -1743,8 +1774,10 @@ extern(C++, "bgfx") struct Encoder{
|
||||
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.
|
||||
|
||||
Remarks:
|
||||
These empty draw calls will sort before ordinary draw calls.
|
||||
|
||||
Params:
|
||||
id = View id.
|
||||
*/
|
||||
@@ -1774,7 +1807,9 @@ extern(C++, "bgfx") struct Encoder{
|
||||
/**
|
||||
Submit primitive for rendering with index and instance data info from
|
||||
indirect buffer.
|
||||
|
||||
Attention: Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
|
||||
|
||||
Params:
|
||||
id = View id.
|
||||
program = Program.
|
||||
@@ -1789,7 +1824,9 @@ extern(C++, "bgfx") struct Encoder{
|
||||
/**
|
||||
Submit primitive for rendering with index and instance data info and
|
||||
draw count from indirect buffers.
|
||||
|
||||
Attention: Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
|
||||
|
||||
Params:
|
||||
id = View id.
|
||||
program = Program.
|
||||
@@ -1893,8 +1930,10 @@ extern(C++, "bgfx") struct Encoder{
|
||||
|
||||
/**
|
||||
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`.
|
||||
|
||||
Params:
|
||||
id = View id.
|
||||
dst = Destination texture handle.
|
||||
@@ -1910,8 +1949,10 @@ extern(C++, "bgfx") struct Encoder{
|
||||
|
||||
/**
|
||||
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`.
|
||||
|
||||
Params:
|
||||
id = View id.
|
||||
dst = Destination texture handle.
|
||||
@@ -1976,7 +2017,7 @@ mixin(joinFnBinds((){
|
||||
{q{void}, q{vertexConvert}, q{ref const VertexLayout dstLayout, void* dstData, ref const VertexLayout srcLayout, const(void)* srcData, uint num=1}, ext: `C++, "bgfx"`},
|
||||
|
||||
/**
|
||||
* Weld vertices.
|
||||
* Weld vertices. Returns number of unique vertices after welding.
|
||||
Params:
|
||||
output = Welded vertices remapping table. The size of buffer
|
||||
must be the same as number of vertices.
|
||||
@@ -2052,8 +2093,10 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Reset graphic settings and back-buffer size.
|
||||
*
|
||||
* Attention: This call doesn’t change the window size, it just resizes
|
||||
* the back-buffer. Your windowing code controls the window size.
|
||||
*
|
||||
Params:
|
||||
width = Back-buffer width.
|
||||
height = Back-buffer height.
|
||||
@@ -2087,21 +2130,27 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Returns current renderer backend API type.
|
||||
*
|
||||
* Remarks:
|
||||
* Library must be initialized.
|
||||
*
|
||||
*/
|
||||
{q{RendererType}, q{getRendererType}, q{}, ext: `C++, "bgfx"`},
|
||||
|
||||
/**
|
||||
* Returns renderer capabilities.
|
||||
*
|
||||
* Remarks:
|
||||
* Library must be initialized.
|
||||
*
|
||||
*/
|
||||
{q{const(Caps)*}, q{getCaps}, q{}, ext: `C++, "bgfx"`},
|
||||
|
||||
/**
|
||||
* Returns performance counters.
|
||||
*
|
||||
* Attention: Pointer returned is valid until `bgfx::frame` is called.
|
||||
*
|
||||
*/
|
||||
{q{const(Stats)*}, q{getStats}, q{}, ext: `C++, "bgfx"`},
|
||||
|
||||
@@ -2112,7 +2161,9 @@ mixin(joinFnBinds((){
|
||||
* 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.
|
||||
*
|
||||
Params:
|
||||
data = Pointer to data.
|
||||
size = Size of data.
|
||||
@@ -2216,7 +2267,7 @@ mixin(joinFnBinds((){
|
||||
{q{void}, q{destroy}, q{IndexBufferHandle handle}, ext: `C++, "bgfx"`},
|
||||
|
||||
/**
|
||||
* Create vertex layout.
|
||||
* Create vertex layout. Vertex layouts are used to describe the format of vertex data.
|
||||
Params:
|
||||
layout = Vertex layout.
|
||||
*/
|
||||
@@ -2400,6 +2451,7 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Allocate transient index buffer.
|
||||
*
|
||||
Params:
|
||||
tib = TransientIndexBuffer structure will be filled, and will be valid
|
||||
for the duration of frame, and can be reused for multiple draw
|
||||
@@ -2424,6 +2476,7 @@ mixin(joinFnBinds((){
|
||||
* Check for required space and allocate transient vertex and index
|
||||
* buffers. If both space requirements are satisfied function returns
|
||||
* true.
|
||||
*
|
||||
Params:
|
||||
tvb = TransientVertexBuffer structure will be filled, and will be valid
|
||||
for the duration of frame, and can be reused for multiple draw
|
||||
@@ -2465,8 +2518,10 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Create shader from memory buffer.
|
||||
*
|
||||
* Remarks:
|
||||
* Shader binary is obtained by compiling shader offline with shaderc command line tool.
|
||||
*
|
||||
Params:
|
||||
mem = Shader binary.
|
||||
*/
|
||||
@@ -2474,8 +2529,10 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Returns the number of uniforms and uniform handles used inside a shader.
|
||||
*
|
||||
* Remarks:
|
||||
* Only non-predefined uniforms are returned.
|
||||
*
|
||||
Params:
|
||||
handle = Shader handle.
|
||||
uniforms = UniformHandle array where data will be stored.
|
||||
@@ -2495,8 +2552,10 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Destroy shader.
|
||||
*
|
||||
* Remarks: Once a shader program is created with _handle,
|
||||
* it is safe to destroy that shader.
|
||||
*
|
||||
Params:
|
||||
handle = Shader handle.
|
||||
*/
|
||||
@@ -2657,7 +2716,9 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Update 2D texture.
|
||||
*
|
||||
* Attention: It's valid to update only mutable texture. See `bgfx::createTexture2D` for more info.
|
||||
*
|
||||
Params:
|
||||
handle = Texture handle.
|
||||
layer = Layer in texture array.
|
||||
@@ -2674,7 +2735,9 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Update 3D texture.
|
||||
*
|
||||
* Attention: It's valid to update only mutable texture. See `bgfx::createTexture3D` for more info.
|
||||
*
|
||||
Params:
|
||||
handle = Texture handle.
|
||||
mip = Mip level.
|
||||
@@ -2690,7 +2753,9 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Update Cube texture.
|
||||
*
|
||||
* Attention: It's valid to update only mutable texture. See `bgfx::createTextureCube` for more info.
|
||||
*
|
||||
Params:
|
||||
handle = Texture handle.
|
||||
layer = Layer in texture array.
|
||||
@@ -2725,8 +2790,10 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Read back texture content.
|
||||
*
|
||||
* Attention: Texture must be created with `BGFX_TEXTURE_READ_BACK` flag.
|
||||
* Attention: Availability depends on: `BGFX_CAPS_TEXTURE_READ_BACK`.
|
||||
*
|
||||
Params:
|
||||
handle = Texture handle.
|
||||
data = Destination buffer.
|
||||
@@ -2746,8 +2813,10 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
Params:
|
||||
handle = Texture handle.
|
||||
*/
|
||||
@@ -2814,9 +2883,12 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Create frame buffer for multiple window rendering.
|
||||
*
|
||||
* Remarks:
|
||||
* Frame buffer cannot be used for sampling.
|
||||
*
|
||||
* Attention: Availability depends on: `BGFX_CAPS_SWAP_CHAIN`.
|
||||
*
|
||||
Params:
|
||||
nwh = OS' target native window handle.
|
||||
width = Window back buffer width.
|
||||
@@ -2852,12 +2924,14 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Create shader uniform parameter.
|
||||
*
|
||||
* Remarks:
|
||||
* 1. Uniform names are unique. It's valid to call `bgfx::createUniform`
|
||||
* multiple times with the same uniform name. The library will always
|
||||
* return the same handle, but the handle reference count will be
|
||||
* incremented. This means that the same number of `bgfx::destroyUniform`
|
||||
* must be called to properly destroy the uniform.
|
||||
*
|
||||
* 2. Predefined uniforms (declared in `bgfx_shader.sh`):
|
||||
* - `u_viewRect vec4(x, y, width, height)` - view rectangle for current
|
||||
* view, in pixels.
|
||||
@@ -2875,6 +2949,7 @@ mixin(joinFnBinds((){
|
||||
* - `u_invModelView mat4` - inverted concatenated model view matrix.
|
||||
* - `u_modelViewProj mat4` - concatenated model view projection matrix.
|
||||
* - `u_alphaRef float` - alpha reference value for alpha test.
|
||||
*
|
||||
Params:
|
||||
name = Uniform name in shader.
|
||||
type = Type of uniform (See: `bgfx::UniformType`).
|
||||
@@ -2884,12 +2959,14 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Create shader uniform parameter.
|
||||
*
|
||||
* Remarks:
|
||||
* 1. Uniform names are unique. It's valid to call `bgfx::createUniform`
|
||||
* multiple times with the same uniform name. The library will always
|
||||
* return the same handle, but the handle reference count will be
|
||||
* incremented. This means that the same number of `bgfx::destroyUniform`
|
||||
* must be called to properly destroy the uniform.
|
||||
*
|
||||
* 2. Predefined uniforms (declared in `bgfx_shader.sh`):
|
||||
* - `u_viewRect vec4(x, y, width, height)` - view rectangle for current
|
||||
* view, in pixels.
|
||||
@@ -2907,6 +2984,7 @@ mixin(joinFnBinds((){
|
||||
* - `u_invModelView mat4` - inverted concatenated model view matrix.
|
||||
* - `u_modelViewProj mat4` - concatenated model view projection matrix.
|
||||
* - `u_alphaRef float` - alpha reference value for alpha test.
|
||||
*
|
||||
Params:
|
||||
name = Uniform name in shader.
|
||||
freq = Uniform change frequency (See: `bgfx::UniformFreq`).
|
||||
@@ -2931,7 +3009,8 @@ mixin(joinFnBinds((){
|
||||
{q{void}, q{destroy}, q{UniformHandle handle}, ext: `C++, "bgfx"`},
|
||||
|
||||
/**
|
||||
* Create occlusion query.
|
||||
* Create occlusion query. Occlusion queries allow the GPU to determine
|
||||
* if any pixels passed the depth test.
|
||||
*/
|
||||
{q{OcclusionQueryHandle}, q{createOcclusionQuery}, q{}, ext: `C++, "bgfx"`},
|
||||
|
||||
@@ -2980,13 +3059,17 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Set view name.
|
||||
*
|
||||
* Remarks:
|
||||
* This is debug only feature.
|
||||
*
|
||||
* In graphics debugger view name will appear as:
|
||||
*
|
||||
* "nnnc <view name>"
|
||||
* ^ ^ ^
|
||||
* | +--- compute (C)
|
||||
* +------ view id
|
||||
*
|
||||
Params:
|
||||
id = View id.
|
||||
name = View name.
|
||||
@@ -3064,8 +3147,10 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Set view sorting mode.
|
||||
*
|
||||
* Remarks:
|
||||
* View mode must be set prior calling `bgfx::submit` for the view.
|
||||
*
|
||||
Params:
|
||||
id = View id.
|
||||
mode = View sort mode. See `ViewMode::Enum`.
|
||||
@@ -3074,8 +3159,10 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Set view frame buffer.
|
||||
*
|
||||
* Remarks:
|
||||
* Not persistent after `bgfx::reset` call.
|
||||
*
|
||||
Params:
|
||||
id = View id.
|
||||
handle = Frame buffer handle. Passing `BGFX_INVALID_HANDLE` as
|
||||
@@ -3106,7 +3193,9 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Set view shading rate.
|
||||
*
|
||||
* Attention: Availability depends on: `BGFX_CAPS_VARIABLE_RATE_SHADING`.
|
||||
*
|
||||
Params:
|
||||
id = View id.
|
||||
shadingRate = Shading rate.
|
||||
@@ -3136,7 +3225,9 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Set shader uniform parameter for view.
|
||||
*
|
||||
* Attention: Uniform must be created with `bgfx::UniformFreq::View` argument.
|
||||
*
|
||||
Params:
|
||||
id = View id.
|
||||
handle = Uniform.
|
||||
@@ -3148,7 +3239,9 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Set shader uniform parameter for frame.
|
||||
*
|
||||
* Attention: Uniform must be created with `bgfx::UniformFreq::View` argument.
|
||||
*
|
||||
Params:
|
||||
handle = Uniform.
|
||||
value = Pointer to uniform data.
|
||||
@@ -3159,9 +3252,11 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
Params:
|
||||
handle = Frame buffer handle. If handle is `BGFX_INVALID_HANDLE` request will be
|
||||
made for main window back buffer.
|
||||
@@ -3171,13 +3266,16 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
Params:
|
||||
msecs = Timeout in milliseconds.
|
||||
*/
|
||||
@@ -3185,7 +3283,9 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Set platform data.
|
||||
*
|
||||
* Warning: Must be called before `bgfx::init`.
|
||||
*
|
||||
Params:
|
||||
data = Platform data.
|
||||
*/
|
||||
@@ -3193,18 +3293,24 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
{q{const(InternalData)*}, q{getInternalData}, q{}, ext: `C++, "bgfx"`},
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
Params:
|
||||
handle = Texture handle.
|
||||
ptr = Native API pointer to texture.
|
||||
@@ -3215,11 +3321,15 @@ mixin(joinFnBinds((){
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
Params:
|
||||
handle = Texture handle.
|
||||
width = Width.
|
||||
@@ -3247,6 +3357,7 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Set render states for draw primitive.
|
||||
*
|
||||
* Remarks:
|
||||
* 1. To set up more complex states use:
|
||||
* `BGFX_STATE_ALPHA_REF(_ref)`,
|
||||
@@ -3257,6 +3368,7 @@ mixin(joinFnBinds((){
|
||||
* `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
|
||||
* 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
|
||||
* equation is specified.
|
||||
*
|
||||
Params:
|
||||
state = State flags. Default state for primitive type is
|
||||
triangles. See: `BGFX_STATE_DEFAULT`.
|
||||
@@ -3291,8 +3403,10 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Set scissor for draw primitive.
|
||||
*
|
||||
* Remarks:
|
||||
* To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
*
|
||||
Params:
|
||||
x = Position x from the left corner of the window.
|
||||
y = Position y from the top corner of the window.
|
||||
@@ -3303,8 +3417,10 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Set scissor from cache for draw primitive.
|
||||
*
|
||||
* Remarks:
|
||||
* To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
*
|
||||
Params:
|
||||
cache = Index in scissor cache.
|
||||
*/
|
||||
@@ -3329,7 +3445,9 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* Reserve matrices in internal matrix cache.
|
||||
*
|
||||
* Attention: Pointer returned can be modified until `bgfx::frame` is called.
|
||||
*
|
||||
Params:
|
||||
transform = Pointer to `Transform` structure.
|
||||
num = Number of matrices.
|
||||
@@ -3460,7 +3578,9 @@ mixin(joinFnBinds((){
|
||||
/**
|
||||
* Set number of vertices for auto generated vertices use in conjunction
|
||||
* with gl_VertexID.
|
||||
*
|
||||
* Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
*
|
||||
Params:
|
||||
numVertices = Number of vertices.
|
||||
*/
|
||||
@@ -3503,7 +3623,9 @@ mixin(joinFnBinds((){
|
||||
/**
|
||||
* Set number of instances for auto generated instances use in conjunction
|
||||
* with gl_InstanceID.
|
||||
*
|
||||
* Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
*
|
||||
Params:
|
||||
numInstances = Number of instances.
|
||||
*/
|
||||
@@ -3527,8 +3649,10 @@ mixin(joinFnBinds((){
|
||||
/**
|
||||
* Submit an empty primitive for rendering. Uniforms and draw state
|
||||
* will be applied but no geometry will be submitted.
|
||||
*
|
||||
* Remarks:
|
||||
* These empty draw calls will sort before ordinary draw calls.
|
||||
*
|
||||
Params:
|
||||
id = View id.
|
||||
*/
|
||||
@@ -3558,7 +3682,9 @@ mixin(joinFnBinds((){
|
||||
/**
|
||||
* Submit primitive for rendering with index and instance data info from
|
||||
* indirect buffer.
|
||||
*
|
||||
* Attention: Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
|
||||
*
|
||||
Params:
|
||||
id = View id.
|
||||
program = Program.
|
||||
@@ -3573,7 +3699,9 @@ mixin(joinFnBinds((){
|
||||
/**
|
||||
* Submit primitive for rendering with index and instance data info and
|
||||
* draw count from indirect buffers.
|
||||
*
|
||||
* Attention: Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
|
||||
*
|
||||
Params:
|
||||
id = View id.
|
||||
program = Program.
|
||||
@@ -3677,8 +3805,10 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* 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`.
|
||||
*
|
||||
Params:
|
||||
id = View id.
|
||||
dst = Destination texture handle.
|
||||
@@ -3694,8 +3824,10 @@ mixin(joinFnBinds((){
|
||||
|
||||
/**
|
||||
* 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`.
|
||||
*
|
||||
Params:
|
||||
id = View id.
|
||||
dst = Destination texture handle.
|
||||
|
||||
@@ -1595,7 +1595,9 @@ pub const Init = extern struct {
|
||||
return bgfx_vertex_layout_begin(self, _rendererType);
|
||||
}
|
||||
/// Add attribute to VertexLayout.
|
||||
///
|
||||
/// @remarks Must be called between begin/end.
|
||||
///
|
||||
/// <param name="_attrib">Attribute semantics. See: `bgfx::Attrib`</param>
|
||||
/// <param name="_num">Number of elements 1, 2, 3 or 4.</param>
|
||||
/// <param name="_type">Element type.</param>
|
||||
@@ -1633,6 +1635,7 @@ pub const Init = extern struct {
|
||||
return bgfx_encoder_set_marker(self, _name, _len);
|
||||
}
|
||||
/// Set render states for draw primitive.
|
||||
///
|
||||
/// @remarks
|
||||
/// 1. To set up more complex states use:
|
||||
/// `BGFX_STATE_ALPHA_REF(_ref)`,
|
||||
@@ -1643,6 +1646,7 @@ pub const Init = extern struct {
|
||||
/// `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
|
||||
/// 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
|
||||
/// equation is specified.
|
||||
///
|
||||
/// <param name="_state">State flags. Default state for primitive type is triangles. See: `BGFX_STATE_DEFAULT`. - `BGFX_STATE_DEPTH_TEST_*` - Depth test function. - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC. - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2. - `BGFX_STATE_CULL_*` - Backface culling mode. - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write. - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing. - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.</param>
|
||||
/// <param name="_rgba">Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and `BGFX_STATE_BLEND_INV_FACTOR` blend modes.</param>
|
||||
pub inline fn setState(self: ?*Encoder, _state: u64, _rgba: u32) void {
|
||||
@@ -1661,8 +1665,10 @@ pub const Init = extern struct {
|
||||
return bgfx_encoder_set_stencil(self, _fstencil, _bstencil);
|
||||
}
|
||||
/// Set scissor for draw primitive.
|
||||
///
|
||||
/// @remark
|
||||
/// To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
///
|
||||
/// <param name="_x">Position x from the left corner of the window.</param>
|
||||
/// <param name="_y">Position y from the top corner of the window.</param>
|
||||
/// <param name="_width">Width of view scissor region.</param>
|
||||
@@ -1671,8 +1677,10 @@ pub const Init = extern struct {
|
||||
return bgfx_encoder_set_scissor(self, _x, _y, _width, _height);
|
||||
}
|
||||
/// Set scissor from cache for draw primitive.
|
||||
///
|
||||
/// @remark
|
||||
/// To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
///
|
||||
/// <param name="_cache">Index in scissor cache.</param>
|
||||
pub inline fn setScissorCached(self: ?*Encoder, _cache: u16) void {
|
||||
return bgfx_encoder_set_scissor_cached(self, _cache);
|
||||
@@ -1691,7 +1699,9 @@ pub const Init = extern struct {
|
||||
return bgfx_encoder_set_transform_cached(self, _cache, _num);
|
||||
}
|
||||
/// Reserve matrices in internal matrix cache.
|
||||
///
|
||||
/// @attention Pointer returned can be modified until `bgfx::frame` is called.
|
||||
///
|
||||
/// <param name="_transform">Pointer to `Transform` structure.</param>
|
||||
/// <param name="_num">Number of matrices.</param>
|
||||
pub inline fn allocTransform(self: ?*Encoder, _transform: [*c]Transform, _num: u16) u32 {
|
||||
@@ -1750,6 +1760,12 @@ pub const Init = extern struct {
|
||||
pub inline fn setDynamicVertexBuffer(self: ?*Encoder, _stream: u8, _handle: DynamicVertexBufferHandle, _startVertex: u32, _numVertices: u32) void {
|
||||
return bgfx_encoder_set_dynamic_vertex_buffer(self, _stream, _handle, _startVertex, _numVertices);
|
||||
}
|
||||
/// Set vertex buffer for draw primitive.
|
||||
/// <param name="_stream">Vertex stream.</param>
|
||||
/// <param name="_handle">Dynamic vertex buffer.</param>
|
||||
/// <param name="_startVertex">First vertex to render.</param>
|
||||
/// <param name="_numVertices">Number of vertices to render.</param>
|
||||
/// <param name="_layoutHandle">Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.</param>
|
||||
pub inline fn setDynamicVertexBufferWithLayout(self: ?*Encoder, _stream: u8, _handle: DynamicVertexBufferHandle, _startVertex: u32, _numVertices: u32, _layoutHandle: VertexLayoutHandle) void {
|
||||
return bgfx_encoder_set_dynamic_vertex_buffer_with_layout(self, _stream, _handle, _startVertex, _numVertices, _layoutHandle);
|
||||
}
|
||||
@@ -1772,7 +1788,9 @@ pub const Init = extern struct {
|
||||
}
|
||||
/// Set number of vertices for auto generated vertices use in conjunction
|
||||
/// with gl_VertexID.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
///
|
||||
/// <param name="_numVertices">Number of vertices.</param>
|
||||
pub inline fn setVertexCount(self: ?*Encoder, _numVertices: u32) void {
|
||||
return bgfx_encoder_set_vertex_count(self, _numVertices);
|
||||
@@ -1800,7 +1818,9 @@ pub const Init = extern struct {
|
||||
}
|
||||
/// Set number of instances for auto generated instances use in conjunction
|
||||
/// with gl_InstanceID.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
///
|
||||
/// <param name="_numInstances">Number of instances.</param>
|
||||
pub inline fn setInstanceCount(self: ?*Encoder, _numInstances: u32) void {
|
||||
return bgfx_encoder_set_instance_count(self, _numInstances);
|
||||
@@ -1817,8 +1837,10 @@ pub const Init = extern struct {
|
||||
/// 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.
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
pub inline fn touch(self: ?*Encoder, _id: ViewId) void {
|
||||
return bgfx_encoder_touch(self, _id);
|
||||
@@ -1842,7 +1864,9 @@ pub const Init = extern struct {
|
||||
}
|
||||
/// Submit primitive for rendering with index and instance data info from
|
||||
/// indirect buffer.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
/// <param name="_program">Program.</param>
|
||||
/// <param name="_indirectHandle">Indirect buffer.</param>
|
||||
@@ -1855,7 +1879,9 @@ pub const Init = extern struct {
|
||||
}
|
||||
/// Submit primitive for rendering with index and instance data info and
|
||||
/// draw count from indirect buffers.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
/// <param name="_program">Program.</param>
|
||||
/// <param name="_indirectHandle">Indirect buffer.</param>
|
||||
@@ -1938,8 +1964,10 @@ pub const Init = extern struct {
|
||||
return bgfx_encoder_discard(self, _flags);
|
||||
}
|
||||
/// 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`.
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
/// <param name="_dst">Destination texture handle.</param>
|
||||
/// <param name="_dstMip">Destination texture mip level.</param>
|
||||
@@ -2022,7 +2050,9 @@ extern fn bgfx_attachment_init(self: [*c]Attachment, _handle: TextureHandle, _ac
|
||||
extern fn bgfx_vertex_layout_begin(self: [*c]VertexLayout, _rendererType: RendererType) [*c]VertexLayout;
|
||||
|
||||
/// Add attribute to VertexLayout.
|
||||
///
|
||||
/// @remarks Must be called between begin/end.
|
||||
///
|
||||
/// <param name="_attrib">Attribute semantics. See: `bgfx::Attrib`</param>
|
||||
/// <param name="_num">Number of elements 1, 2, 3 or 4.</param>
|
||||
/// <param name="_type">Element type.</param>
|
||||
@@ -2079,7 +2109,7 @@ pub inline fn vertexConvert(_dstLayout: [*c]const VertexLayout, _dstData: ?*anyo
|
||||
}
|
||||
extern fn bgfx_vertex_convert(_dstLayout: [*c]const VertexLayout, _dstData: ?*anyopaque, _srcLayout: [*c]const VertexLayout, _srcData: ?*const anyopaque, _num: u32) void;
|
||||
|
||||
/// Weld vertices.
|
||||
/// Weld vertices. Returns number of unique vertices after welding.
|
||||
/// <param name="_output">Welded vertices remapping table. The size of buffer must be the same as number of vertices.</param>
|
||||
/// <param name="_layout">Vertex stream layout.</param>
|
||||
/// <param name="_data">Vertex stream.</param>
|
||||
@@ -2155,8 +2185,10 @@ pub inline fn shutdown() void {
|
||||
extern fn bgfx_shutdown() void;
|
||||
|
||||
/// Reset graphic settings and back-buffer size.
|
||||
///
|
||||
/// @attention This call doesn’t change the window size, it just resizes
|
||||
/// the back-buffer. Your windowing code controls the window size.
|
||||
///
|
||||
/// <param name="_width">Back-buffer width.</param>
|
||||
/// <param name="_height">Back-buffer height.</param>
|
||||
/// <param name="_flags">See: `BGFX_RESET_*` for more info. - `BGFX_RESET_NONE` - No reset flags. - `BGFX_RESET_FULLSCREEN` - Not supported yet. - `BGFX_RESET_MSAA_X[2/4/8/16]` - Enable 2, 4, 8 or 16 x MSAA. - `BGFX_RESET_VSYNC` - Enable V-Sync. - `BGFX_RESET_MAXANISOTROPY` - Turn on/off max anisotropy. - `BGFX_RESET_CAPTURE` - Begin screen capture. - `BGFX_RESET_FLUSH_AFTER_RENDER` - Flush rendering after submitting to GPU. - `BGFX_RESET_FLIP_AFTER_RENDER` - This flag specifies where flip occurs. Default behaviour is that flip occurs before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`. - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB back-buffer.</param>
|
||||
@@ -2176,23 +2208,29 @@ pub inline fn frame(_flags: u8) u32 {
|
||||
extern fn bgfx_frame(_flags: u8) u32;
|
||||
|
||||
/// Returns current renderer backend API type.
|
||||
///
|
||||
/// @remarks
|
||||
/// Library must be initialized.
|
||||
///
|
||||
pub inline fn getRendererType() RendererType {
|
||||
return bgfx_get_renderer_type();
|
||||
}
|
||||
extern fn bgfx_get_renderer_type() RendererType;
|
||||
|
||||
/// Returns renderer capabilities.
|
||||
///
|
||||
/// @remarks
|
||||
/// Library must be initialized.
|
||||
///
|
||||
pub inline fn getCaps() [*c]const Caps {
|
||||
return bgfx_get_caps();
|
||||
}
|
||||
extern fn bgfx_get_caps() [*c]const Caps;
|
||||
|
||||
/// Returns performance counters.
|
||||
///
|
||||
/// @attention Pointer returned is valid until `bgfx::frame` is called.
|
||||
///
|
||||
pub inline fn getStats() [*c]const Stats {
|
||||
return bgfx_get_stats();
|
||||
}
|
||||
@@ -2219,7 +2257,9 @@ extern fn bgfx_copy(_data: ?*const anyopaque, _size: u32) [*c]const Memory;
|
||||
/// 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.
|
||||
///
|
||||
/// <param name="_data">Pointer to data.</param>
|
||||
/// <param name="_size">Size of data.</param>
|
||||
pub inline fn makeRef(_data: ?*const anyopaque, _size: u32) [*c]const Memory {
|
||||
@@ -2233,7 +2273,9 @@ extern fn bgfx_make_ref(_data: ?*const anyopaque, _size: u32) [*c]const Memory;
|
||||
/// 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.
|
||||
///
|
||||
/// <param name="_data">Pointer to data.</param>
|
||||
/// <param name="_size">Size of data.</param>
|
||||
/// <param name="_releaseFn">Callback function to release memory after use.</param>
|
||||
@@ -2294,7 +2336,7 @@ pub inline fn destroyIndexBuffer(_handle: IndexBufferHandle) void {
|
||||
}
|
||||
extern fn bgfx_destroy_index_buffer(_handle: IndexBufferHandle) void;
|
||||
|
||||
/// Create vertex layout.
|
||||
/// Create vertex layout. Vertex layouts are used to describe the format of vertex data.
|
||||
/// <param name="_layout">Vertex layout.</param>
|
||||
pub inline fn createVertexLayout(_layout: [*c]const VertexLayout) VertexLayoutHandle {
|
||||
return bgfx_create_vertex_layout(_layout);
|
||||
@@ -2424,6 +2466,7 @@ pub inline fn getAvailInstanceDataBuffer(_num: u32, _stride: u16) u32 {
|
||||
extern fn bgfx_get_avail_instance_data_buffer(_num: u32, _stride: u16) u32;
|
||||
|
||||
/// Allocate transient index buffer.
|
||||
///
|
||||
/// <param name="_tib">TransientIndexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.</param>
|
||||
/// <param name="_num">Number of indices to allocate.</param>
|
||||
/// <param name="_index32">Set to `true` if input indices will be 32-bit.</param>
|
||||
@@ -2444,6 +2487,7 @@ extern fn bgfx_alloc_transient_vertex_buffer(_tvb: [*c]TransientVertexBuffer, _n
|
||||
/// Check for required space and allocate transient vertex and index
|
||||
/// buffers. If both space requirements are satisfied function returns
|
||||
/// true.
|
||||
///
|
||||
/// <param name="_tvb">TransientVertexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.</param>
|
||||
/// <param name="_layout">Vertex layout.</param>
|
||||
/// <param name="_numVertices">Number of vertices to allocate.</param>
|
||||
@@ -2479,8 +2523,10 @@ pub inline fn destroyIndirectBuffer(_handle: IndirectBufferHandle) void {
|
||||
extern fn bgfx_destroy_indirect_buffer(_handle: IndirectBufferHandle) void;
|
||||
|
||||
/// Create shader from memory buffer.
|
||||
///
|
||||
/// @remarks
|
||||
/// Shader binary is obtained by compiling shader offline with shaderc command line tool.
|
||||
///
|
||||
/// <param name="_mem">Shader binary.</param>
|
||||
pub inline fn createShader(_mem: [*c]const Memory) ShaderHandle {
|
||||
return bgfx_create_shader(_mem);
|
||||
@@ -2488,8 +2534,10 @@ pub inline fn createShader(_mem: [*c]const Memory) ShaderHandle {
|
||||
extern fn bgfx_create_shader(_mem: [*c]const Memory) ShaderHandle;
|
||||
|
||||
/// Returns the number of uniforms and uniform handles used inside a shader.
|
||||
///
|
||||
/// @remarks
|
||||
/// Only non-predefined uniforms are returned.
|
||||
///
|
||||
/// <param name="_handle">Shader handle.</param>
|
||||
/// <param name="_uniforms">UniformHandle array where data will be stored.</param>
|
||||
/// <param name="_max">Maximum capacity of array.</param>
|
||||
@@ -2508,8 +2556,10 @@ pub inline fn setShaderName(_handle: ShaderHandle, _name: [*c]const u8, _len: i3
|
||||
extern fn bgfx_set_shader_name(_handle: ShaderHandle, _name: [*c]const u8, _len: i32) void;
|
||||
|
||||
/// Destroy shader.
|
||||
///
|
||||
/// @remark Once a shader program is created with _handle,
|
||||
/// it is safe to destroy that shader.
|
||||
///
|
||||
/// <param name="_handle">Shader handle.</param>
|
||||
pub inline fn destroyShader(_handle: ShaderHandle) void {
|
||||
return bgfx_destroy_shader(_handle);
|
||||
@@ -2637,7 +2687,9 @@ pub inline fn createTextureCube(_size: u16, _hasMips: bool, _numLayers: u16, _fo
|
||||
extern fn bgfx_create_texture_cube(_size: u16, _hasMips: bool, _numLayers: u16, _format: TextureFormat, _flags: u64, _mem: [*c]const Memory, _external: u64) TextureHandle;
|
||||
|
||||
/// Update 2D texture.
|
||||
///
|
||||
/// @attention It's valid to update only mutable texture. See `bgfx::createTexture2D` for more info.
|
||||
///
|
||||
/// <param name="_handle">Texture handle.</param>
|
||||
/// <param name="_layer">Layer in texture array.</param>
|
||||
/// <param name="_mip">Mip level.</param>
|
||||
@@ -2653,7 +2705,9 @@ pub inline fn updateTexture2D(_handle: TextureHandle, _layer: u16, _mip: u8, _x:
|
||||
extern fn bgfx_update_texture_2d(_handle: TextureHandle, _layer: u16, _mip: u8, _x: u16, _y: u16, _width: u16, _height: u16, _mem: [*c]const Memory, _pitch: u16) void;
|
||||
|
||||
/// Update 3D texture.
|
||||
///
|
||||
/// @attention It's valid to update only mutable texture. See `bgfx::createTexture3D` for more info.
|
||||
///
|
||||
/// <param name="_handle">Texture handle.</param>
|
||||
/// <param name="_mip">Mip level.</param>
|
||||
/// <param name="_x">X offset in texture.</param>
|
||||
@@ -2669,7 +2723,9 @@ pub inline fn updateTexture3D(_handle: TextureHandle, _mip: u8, _x: u16, _y: u16
|
||||
extern fn bgfx_update_texture_3d(_handle: TextureHandle, _mip: u8, _x: u16, _y: u16, _z: u16, _width: u16, _height: u16, _depth: u16, _mem: [*c]const Memory) void;
|
||||
|
||||
/// Update Cube texture.
|
||||
///
|
||||
/// @attention It's valid to update only mutable texture. See `bgfx::createTextureCube` for more info.
|
||||
///
|
||||
/// <param name="_handle">Texture handle.</param>
|
||||
/// <param name="_layer">Layer in texture array.</param>
|
||||
/// <param name="_side">Cubemap side `BGFX_CUBE_MAP_<POSITIVE or NEGATIVE>_<X, Y or Z>`, where 0 is +X, 1 is -X, 2 is +Y, 3 is -Y, 4 is +Z, and 5 is -Z. +----------+ |-z 2| | ^ +y | | | | Unfolded cube: | +---->+x | +----------+----------+----------+----------+ |+y 1|+y 4|+y 0|+y 5| | ^ -x | ^ +z | ^ +x | ^ -z | | | | | | | | | | | +---->+z | +---->+x | +---->-z | +---->-x | +----------+----------+----------+----------+ |+z 3| | ^ -y | | | | | +---->+x | +----------+</param>
|
||||
@@ -2686,8 +2742,10 @@ pub inline fn updateTextureCube(_handle: TextureHandle, _layer: u16, _side: u8,
|
||||
extern fn bgfx_update_texture_cube(_handle: TextureHandle, _layer: u16, _side: u8, _mip: u8, _x: u16, _y: u16, _width: u16, _height: u16, _mem: [*c]const Memory, _pitch: u16) void;
|
||||
|
||||
/// Read back texture content.
|
||||
///
|
||||
/// @attention Texture must be created with `BGFX_TEXTURE_READ_BACK` flag.
|
||||
/// @attention Availability depends on: `BGFX_CAPS_TEXTURE_READ_BACK`.
|
||||
///
|
||||
/// <param name="_handle">Texture handle.</param>
|
||||
/// <param name="_data">Destination buffer.</param>
|
||||
/// <param name="_mip">Mip level.</param>
|
||||
@@ -2706,8 +2764,10 @@ pub inline fn setTextureName(_handle: TextureHandle, _name: [*c]const u8, _len:
|
||||
extern fn bgfx_set_texture_name(_handle: TextureHandle, _name: [*c]const u8, _len: i32) void;
|
||||
|
||||
/// 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.
|
||||
///
|
||||
/// <param name="_handle">Texture handle.</param>
|
||||
pub inline fn getDirectAccessPtr(_handle: TextureHandle) ?*anyopaque {
|
||||
return bgfx_get_direct_access_ptr(_handle);
|
||||
@@ -2761,9 +2821,12 @@ pub inline fn createFrameBufferFromAttachment(_num: u8, _attachment: [*c]const A
|
||||
extern fn bgfx_create_frame_buffer_from_attachment(_num: u8, _attachment: [*c]const Attachment, _destroyTexture: bool) FrameBufferHandle;
|
||||
|
||||
/// Create frame buffer for multiple window rendering.
|
||||
///
|
||||
/// @remarks
|
||||
/// Frame buffer cannot be used for sampling.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_SWAP_CHAIN`.
|
||||
///
|
||||
/// <param name="_nwh">OS' target native window handle.</param>
|
||||
/// <param name="_width">Window back buffer width.</param>
|
||||
/// <param name="_height">Window back buffer height.</param>
|
||||
@@ -2798,12 +2861,14 @@ pub inline fn destroyFrameBuffer(_handle: FrameBufferHandle) void {
|
||||
extern fn bgfx_destroy_frame_buffer(_handle: FrameBufferHandle) void;
|
||||
|
||||
/// Create shader uniform parameter.
|
||||
///
|
||||
/// @remarks
|
||||
/// 1. Uniform names are unique. It's valid to call `bgfx::createUniform`
|
||||
/// multiple times with the same uniform name. The library will always
|
||||
/// return the same handle, but the handle reference count will be
|
||||
/// incremented. This means that the same number of `bgfx::destroyUniform`
|
||||
/// must be called to properly destroy the uniform.
|
||||
///
|
||||
/// 2. Predefined uniforms (declared in `bgfx_shader.sh`):
|
||||
/// - `u_viewRect vec4(x, y, width, height)` - view rectangle for current
|
||||
/// view, in pixels.
|
||||
@@ -2821,6 +2886,7 @@ extern fn bgfx_destroy_frame_buffer(_handle: FrameBufferHandle) void;
|
||||
/// - `u_invModelView mat4` - inverted concatenated model view matrix.
|
||||
/// - `u_modelViewProj mat4` - concatenated model view projection matrix.
|
||||
/// - `u_alphaRef float` - alpha reference value for alpha test.
|
||||
///
|
||||
/// <param name="_name">Uniform name in shader.</param>
|
||||
/// <param name="_type">Type of uniform (See: `bgfx::UniformType`).</param>
|
||||
/// <param name="_num">Number of elements in array.</param>
|
||||
@@ -2830,12 +2896,14 @@ pub inline fn createUniform(_name: [*c]const u8, _type: UniformType, _num: u16)
|
||||
extern fn bgfx_create_uniform(_name: [*c]const u8, _type: UniformType, _num: u16) UniformHandle;
|
||||
|
||||
/// Create shader uniform parameter.
|
||||
///
|
||||
/// @remarks
|
||||
/// 1. Uniform names are unique. It's valid to call `bgfx::createUniform`
|
||||
/// multiple times with the same uniform name. The library will always
|
||||
/// return the same handle, but the handle reference count will be
|
||||
/// incremented. This means that the same number of `bgfx::destroyUniform`
|
||||
/// must be called to properly destroy the uniform.
|
||||
///
|
||||
/// 2. Predefined uniforms (declared in `bgfx_shader.sh`):
|
||||
/// - `u_viewRect vec4(x, y, width, height)` - view rectangle for current
|
||||
/// view, in pixels.
|
||||
@@ -2853,6 +2921,7 @@ extern fn bgfx_create_uniform(_name: [*c]const u8, _type: UniformType, _num: u16
|
||||
/// - `u_invModelView mat4` - inverted concatenated model view matrix.
|
||||
/// - `u_modelViewProj mat4` - concatenated model view projection matrix.
|
||||
/// - `u_alphaRef float` - alpha reference value for alpha test.
|
||||
///
|
||||
/// <param name="_name">Uniform name in shader.</param>
|
||||
/// <param name="_freq">Uniform change frequency (See: `bgfx::UniformFreq`).</param>
|
||||
/// <param name="_type">Type of uniform (See: `bgfx::UniformType`).</param>
|
||||
@@ -2877,7 +2946,8 @@ pub inline fn destroyUniform(_handle: UniformHandle) void {
|
||||
}
|
||||
extern fn bgfx_destroy_uniform(_handle: UniformHandle) void;
|
||||
|
||||
/// Create occlusion query.
|
||||
/// Create occlusion query. Occlusion queries allow the GPU to determine
|
||||
/// if any pixels passed the depth test.
|
||||
pub inline fn createOcclusionQuery() OcclusionQueryHandle {
|
||||
return bgfx_create_occlusion_query();
|
||||
}
|
||||
@@ -2926,13 +2996,17 @@ pub inline fn setPaletteColorRgba8(_index: u8, _rgba: u32) void {
|
||||
extern fn bgfx_set_palette_color_rgba8(_index: u8, _rgba: u32) void;
|
||||
|
||||
/// Set view name.
|
||||
///
|
||||
/// @remarks
|
||||
/// This is debug only feature.
|
||||
///
|
||||
/// In graphics debugger view name will appear as:
|
||||
///
|
||||
/// "nnnc <view name>"
|
||||
/// ^ ^ ^
|
||||
/// | +--- compute (C)
|
||||
/// +------ view id
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
/// <param name="_name">View name.</param>
|
||||
/// <param name="_len">View name length (if length is INT32_MAX, it's expected that _name is zero terminated string.</param>
|
||||
@@ -3006,8 +3080,10 @@ pub inline fn setViewClearMrt(_id: ViewId, _flags: u16, _depth: f32, _stencil: u
|
||||
extern fn bgfx_set_view_clear_mrt(_id: ViewId, _flags: u16, _depth: f32, _stencil: u8, _c0: u8, _c1: u8, _c2: u8, _c3: u8, _c4: u8, _c5: u8, _c6: u8, _c7: u8) void;
|
||||
|
||||
/// Set view sorting mode.
|
||||
///
|
||||
/// @remarks
|
||||
/// View mode must be set prior calling `bgfx::submit` for the view.
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
/// <param name="_mode">View sort mode. See `ViewMode::Enum`.</param>
|
||||
pub inline fn setViewMode(_id: ViewId, _mode: ViewMode) void {
|
||||
@@ -3016,8 +3092,10 @@ pub inline fn setViewMode(_id: ViewId, _mode: ViewMode) void {
|
||||
extern fn bgfx_set_view_mode(_id: ViewId, _mode: ViewMode) void;
|
||||
|
||||
/// Set view frame buffer.
|
||||
///
|
||||
/// @remarks
|
||||
/// Not persistent after `bgfx::reset` call.
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
/// <param name="_handle">Frame buffer handle. Passing `BGFX_INVALID_HANDLE` as frame buffer handle will draw primitives from this view into default back buffer.</param>
|
||||
pub inline fn setViewFrameBuffer(_id: ViewId, _handle: FrameBufferHandle) void {
|
||||
@@ -3045,7 +3123,9 @@ pub inline fn setViewOrder(_id: ViewId, _num: u16, _order: [*c]const ViewId) voi
|
||||
extern fn bgfx_set_view_order(_id: ViewId, _num: u16, _order: [*c]const ViewId) void;
|
||||
|
||||
/// Set view shading rate.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_VARIABLE_RATE_SHADING`.
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
/// <param name="_shadingRate">Shading rate.</param>
|
||||
pub inline fn setViewShadingRate(_id: ViewId, _shadingRate: ShadingRate) void {
|
||||
@@ -3081,6 +3161,7 @@ extern fn bgfx_encoder_end(_encoder: ?*Encoder) void;
|
||||
extern fn bgfx_encoder_set_marker(self: ?*Encoder, _name: [*c]const u8, _len: i32) void;
|
||||
|
||||
/// Set render states for draw primitive.
|
||||
///
|
||||
/// @remarks
|
||||
/// 1. To set up more complex states use:
|
||||
/// `BGFX_STATE_ALPHA_REF(_ref)`,
|
||||
@@ -3091,6 +3172,7 @@ extern fn bgfx_encoder_set_marker(self: ?*Encoder, _name: [*c]const u8, _len: i3
|
||||
/// `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
|
||||
/// 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
|
||||
/// equation is specified.
|
||||
///
|
||||
/// <param name="_state">State flags. Default state for primitive type is triangles. See: `BGFX_STATE_DEFAULT`. - `BGFX_STATE_DEPTH_TEST_*` - Depth test function. - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC. - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2. - `BGFX_STATE_CULL_*` - Backface culling mode. - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write. - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing. - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.</param>
|
||||
/// <param name="_rgba">Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and `BGFX_STATE_BLEND_INV_FACTOR` blend modes.</param>
|
||||
extern fn bgfx_encoder_set_state(self: ?*Encoder, _state: u64, _rgba: u32) void;
|
||||
@@ -3106,8 +3188,10 @@ extern fn bgfx_encoder_set_condition(self: ?*Encoder, _handle: OcclusionQueryHan
|
||||
extern fn bgfx_encoder_set_stencil(self: ?*Encoder, _fstencil: u32, _bstencil: u32) void;
|
||||
|
||||
/// Set scissor for draw primitive.
|
||||
///
|
||||
/// @remark
|
||||
/// To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
///
|
||||
/// <param name="_x">Position x from the left corner of the window.</param>
|
||||
/// <param name="_y">Position y from the top corner of the window.</param>
|
||||
/// <param name="_width">Width of view scissor region.</param>
|
||||
@@ -3115,8 +3199,10 @@ extern fn bgfx_encoder_set_stencil(self: ?*Encoder, _fstencil: u32, _bstencil: u
|
||||
extern fn bgfx_encoder_set_scissor(self: ?*Encoder, _x: u16, _y: u16, _width: u16, _height: u16) u16;
|
||||
|
||||
/// Set scissor from cache for draw primitive.
|
||||
///
|
||||
/// @remark
|
||||
/// To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
///
|
||||
/// <param name="_cache">Index in scissor cache.</param>
|
||||
extern fn bgfx_encoder_set_scissor_cached(self: ?*Encoder, _cache: u16) void;
|
||||
|
||||
@@ -3132,7 +3218,9 @@ extern fn bgfx_encoder_set_transform(self: ?*Encoder, _mtx: ?*const anyopaque, _
|
||||
extern fn bgfx_encoder_set_transform_cached(self: ?*Encoder, _cache: u32, _num: u16) void;
|
||||
|
||||
/// Reserve matrices in internal matrix cache.
|
||||
///
|
||||
/// @attention Pointer returned can be modified until `bgfx::frame` is called.
|
||||
///
|
||||
/// <param name="_transform">Pointer to `Transform` structure.</param>
|
||||
/// <param name="_num">Number of matrices.</param>
|
||||
extern fn bgfx_encoder_alloc_transform(self: ?*Encoder, _transform: [*c]Transform, _num: u16) u32;
|
||||
@@ -3144,7 +3232,9 @@ extern fn bgfx_encoder_alloc_transform(self: ?*Encoder, _transform: [*c]Transfor
|
||||
extern fn bgfx_encoder_set_uniform(self: ?*Encoder, _handle: UniformHandle, _value: ?*const anyopaque, _num: u16) void;
|
||||
|
||||
/// Set shader uniform parameter for view.
|
||||
///
|
||||
/// @attention Uniform must be created with `bgfx::UniformFreq::View` argument.
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
/// <param name="_handle">Uniform.</param>
|
||||
/// <param name="_value">Pointer to uniform data.</param>
|
||||
@@ -3155,7 +3245,9 @@ pub inline fn setViewUniform(_id: ViewId, _handle: UniformHandle, _value: ?*cons
|
||||
extern fn bgfx_set_view_uniform(_id: ViewId, _handle: UniformHandle, _value: ?*const anyopaque, _num: u16) void;
|
||||
|
||||
/// Set shader uniform parameter for frame.
|
||||
///
|
||||
/// @attention Uniform must be created with `bgfx::UniformFreq::View` argument.
|
||||
///
|
||||
/// <param name="_handle">Uniform.</param>
|
||||
/// <param name="_value">Pointer to uniform data.</param>
|
||||
/// <param name="_num">Number of elements. Passing `UINT16_MAX` will use the _num passed on uniform creation.</param>
|
||||
@@ -3204,6 +3296,12 @@ extern fn bgfx_encoder_set_vertex_buffer_with_layout(self: ?*Encoder, _stream: u
|
||||
/// <param name="_numVertices">Number of vertices to render.</param>
|
||||
extern fn bgfx_encoder_set_dynamic_vertex_buffer(self: ?*Encoder, _stream: u8, _handle: DynamicVertexBufferHandle, _startVertex: u32, _numVertices: u32) void;
|
||||
|
||||
/// Set vertex buffer for draw primitive.
|
||||
/// <param name="_stream">Vertex stream.</param>
|
||||
/// <param name="_handle">Dynamic vertex buffer.</param>
|
||||
/// <param name="_startVertex">First vertex to render.</param>
|
||||
/// <param name="_numVertices">Number of vertices to render.</param>
|
||||
/// <param name="_layoutHandle">Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.</param>
|
||||
extern fn bgfx_encoder_set_dynamic_vertex_buffer_with_layout(self: ?*Encoder, _stream: u8, _handle: DynamicVertexBufferHandle, _startVertex: u32, _numVertices: u32, _layoutHandle: VertexLayoutHandle) void;
|
||||
|
||||
/// Set vertex buffer for draw primitive.
|
||||
@@ -3223,7 +3321,9 @@ extern fn bgfx_encoder_set_transient_vertex_buffer_with_layout(self: ?*Encoder,
|
||||
|
||||
/// Set number of vertices for auto generated vertices use in conjunction
|
||||
/// with gl_VertexID.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
///
|
||||
/// <param name="_numVertices">Number of vertices.</param>
|
||||
extern fn bgfx_encoder_set_vertex_count(self: ?*Encoder, _numVertices: u32) void;
|
||||
|
||||
@@ -3247,7 +3347,9 @@ extern fn bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer(self: ?*Enco
|
||||
|
||||
/// Set number of instances for auto generated instances use in conjunction
|
||||
/// with gl_InstanceID.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
///
|
||||
/// <param name="_numInstances">Number of instances.</param>
|
||||
extern fn bgfx_encoder_set_instance_count(self: ?*Encoder, _numInstances: u32) void;
|
||||
|
||||
@@ -3262,8 +3364,10 @@ extern fn bgfx_encoder_set_texture(self: ?*Encoder, _stage: u8, _sampler: Unifor
|
||||
/// 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.
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
extern fn bgfx_encoder_touch(self: ?*Encoder, _id: ViewId) void;
|
||||
|
||||
@@ -3284,7 +3388,9 @@ extern fn bgfx_encoder_submit_occlusion_query(self: ?*Encoder, _id: ViewId, _pro
|
||||
|
||||
/// Submit primitive for rendering with index and instance data info from
|
||||
/// indirect buffer.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
/// <param name="_program">Program.</param>
|
||||
/// <param name="_indirectHandle">Indirect buffer.</param>
|
||||
@@ -3296,7 +3402,9 @@ extern fn bgfx_encoder_submit_indirect(self: ?*Encoder, _id: ViewId, _program: P
|
||||
|
||||
/// Submit primitive for rendering with index and instance data info and
|
||||
/// draw count from indirect buffers.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
/// <param name="_program">Program.</param>
|
||||
/// <param name="_indirectHandle">Indirect buffer.</param>
|
||||
@@ -3369,8 +3477,10 @@ extern fn bgfx_encoder_dispatch_indirect(self: ?*Encoder, _id: ViewId, _program:
|
||||
extern fn bgfx_encoder_discard(self: ?*Encoder, _flags: u8) void;
|
||||
|
||||
/// 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`.
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
/// <param name="_dst">Destination texture handle.</param>
|
||||
/// <param name="_dstMip">Destination texture mip level.</param>
|
||||
@@ -3388,9 +3498,11 @@ extern fn bgfx_encoder_discard(self: ?*Encoder, _flags: u8) void;
|
||||
extern fn bgfx_encoder_blit(self: ?*Encoder, _id: ViewId, _dst: TextureHandle, _dstMip: u8, _dstX: u16, _dstY: u16, _dstZ: u16, _src: TextureHandle, _srcMip: u8, _srcX: u16, _srcY: u16, _srcZ: u16, _width: u16, _height: u16, _depth: u16) void;
|
||||
|
||||
/// 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.
|
||||
///
|
||||
/// <param name="_handle">Frame buffer handle. If handle is `BGFX_INVALID_HANDLE` request will be made for main window back buffer.</param>
|
||||
/// <param name="_filePath">Will be passed to `bgfx::CallbackI::screenShot` callback.</param>
|
||||
pub inline fn requestScreenShot(_handle: FrameBufferHandle, _filePath: [*c]const u8) void {
|
||||
@@ -3399,13 +3511,16 @@ pub inline fn requestScreenShot(_handle: FrameBufferHandle, _filePath: [*c]const
|
||||
extern fn bgfx_request_screen_shot(_handle: FrameBufferHandle, _filePath: [*c]const u8) void;
|
||||
|
||||
/// 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.
|
||||
///
|
||||
/// <param name="_msecs">Timeout in milliseconds.</param>
|
||||
pub inline fn renderFrame(_msecs: i32) RenderFrame {
|
||||
return bgfx_render_frame(_msecs);
|
||||
@@ -3413,7 +3528,9 @@ pub inline fn renderFrame(_msecs: i32) RenderFrame {
|
||||
extern fn bgfx_render_frame(_msecs: i32) RenderFrame;
|
||||
|
||||
/// Set platform data.
|
||||
///
|
||||
/// @warning Must be called before `bgfx::init`.
|
||||
///
|
||||
/// <param name="_data">Platform data.</param>
|
||||
pub inline fn setPlatformData(_data: [*c]const PlatformData) void {
|
||||
return bgfx_set_platform_data(_data);
|
||||
@@ -3421,9 +3538,12 @@ pub inline fn setPlatformData(_data: [*c]const PlatformData) void {
|
||||
extern fn bgfx_set_platform_data(_data: [*c]const PlatformData) void;
|
||||
|
||||
/// 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.
|
||||
///
|
||||
pub inline fn getInternalData() [*c]const InternalData {
|
||||
return bgfx_get_internal_data();
|
||||
}
|
||||
@@ -3431,9 +3551,12 @@ extern fn bgfx_get_internal_data() [*c]const InternalData;
|
||||
|
||||
/// 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.
|
||||
///
|
||||
/// <param name="_handle">Texture handle.</param>
|
||||
/// <param name="_ptr">Native API pointer to texture.</param>
|
||||
/// <param name="_layerIndex">Layer index for texture arrays (only implemented for D3D11).</param>
|
||||
@@ -3444,11 +3567,15 @@ extern fn bgfx_override_internal_texture_ptr(_handle: TextureHandle, _ptr: usize
|
||||
|
||||
/// 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.
|
||||
///
|
||||
/// <param name="_handle">Texture handle.</param>
|
||||
/// <param name="_width">Width.</param>
|
||||
/// <param name="_height">Height.</param>
|
||||
@@ -3470,6 +3597,7 @@ pub inline fn setMarker(_name: [*c]const u8, _len: i32) void {
|
||||
extern fn bgfx_set_marker(_name: [*c]const u8, _len: i32) void;
|
||||
|
||||
/// Set render states for draw primitive.
|
||||
///
|
||||
/// @remarks
|
||||
/// 1. To set up more complex states use:
|
||||
/// `BGFX_STATE_ALPHA_REF(_ref)`,
|
||||
@@ -3480,6 +3608,7 @@ extern fn bgfx_set_marker(_name: [*c]const u8, _len: i32) void;
|
||||
/// `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
|
||||
/// 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
|
||||
/// equation is specified.
|
||||
///
|
||||
/// <param name="_state">State flags. Default state for primitive type is triangles. See: `BGFX_STATE_DEFAULT`. - `BGFX_STATE_DEPTH_TEST_*` - Depth test function. - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC. - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2. - `BGFX_STATE_CULL_*` - Backface culling mode. - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write. - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing. - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.</param>
|
||||
/// <param name="_rgba">Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and `BGFX_STATE_BLEND_INV_FACTOR` blend modes.</param>
|
||||
pub inline fn setState(_state: u64, _rgba: u32) void {
|
||||
@@ -3504,8 +3633,10 @@ pub inline fn setStencil(_fstencil: u32, _bstencil: u32) void {
|
||||
extern fn bgfx_set_stencil(_fstencil: u32, _bstencil: u32) void;
|
||||
|
||||
/// Set scissor for draw primitive.
|
||||
///
|
||||
/// @remark
|
||||
/// To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
///
|
||||
/// <param name="_x">Position x from the left corner of the window.</param>
|
||||
/// <param name="_y">Position y from the top corner of the window.</param>
|
||||
/// <param name="_width">Width of view scissor region.</param>
|
||||
@@ -3516,8 +3647,10 @@ pub inline fn setScissor(_x: u16, _y: u16, _width: u16, _height: u16) u16 {
|
||||
extern fn bgfx_set_scissor(_x: u16, _y: u16, _width: u16, _height: u16) u16;
|
||||
|
||||
/// Set scissor from cache for draw primitive.
|
||||
///
|
||||
/// @remark
|
||||
/// To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
///
|
||||
/// <param name="_cache">Index in scissor cache.</param>
|
||||
pub inline fn setScissorCached(_cache: u16) void {
|
||||
return bgfx_set_scissor_cached(_cache);
|
||||
@@ -3542,7 +3675,9 @@ pub inline fn setTransformCached(_cache: u32, _num: u16) void {
|
||||
extern fn bgfx_set_transform_cached(_cache: u32, _num: u16) void;
|
||||
|
||||
/// Reserve matrices in internal matrix cache.
|
||||
///
|
||||
/// @attention Pointer returned can be modified until `bgfx::frame` is called.
|
||||
///
|
||||
/// <param name="_transform">Pointer to `Transform` structure.</param>
|
||||
/// <param name="_num">Number of matrices.</param>
|
||||
pub inline fn allocTransform(_transform: [*c]Transform, _num: u16) u32 {
|
||||
@@ -3651,7 +3786,9 @@ extern fn bgfx_set_transient_vertex_buffer_with_layout(_stream: u8, _tvb: [*c]co
|
||||
|
||||
/// Set number of vertices for auto generated vertices use in conjunction
|
||||
/// with gl_VertexID.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
///
|
||||
/// <param name="_numVertices">Number of vertices.</param>
|
||||
pub inline fn setVertexCount(_numVertices: u32) void {
|
||||
return bgfx_set_vertex_count(_numVertices);
|
||||
@@ -3687,7 +3824,9 @@ extern fn bgfx_set_instance_data_from_dynamic_vertex_buffer(_handle: DynamicVert
|
||||
|
||||
/// Set number of instances for auto generated instances use in conjunction
|
||||
/// with gl_InstanceID.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
///
|
||||
/// <param name="_numInstances">Number of instances.</param>
|
||||
pub inline fn setInstanceCount(_numInstances: u32) void {
|
||||
return bgfx_set_instance_count(_numInstances);
|
||||
@@ -3706,8 +3845,10 @@ extern fn bgfx_set_texture(_stage: u8, _sampler: UniformHandle, _handle: Texture
|
||||
|
||||
/// 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.
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
pub inline fn touch(_id: ViewId) void {
|
||||
return bgfx_touch(_id);
|
||||
@@ -3737,7 +3878,9 @@ extern fn bgfx_submit_occlusion_query(_id: ViewId, _program: ProgramHandle, _occ
|
||||
|
||||
/// Submit primitive for rendering with index and instance data info from
|
||||
/// indirect buffer.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
/// <param name="_program">Program.</param>
|
||||
/// <param name="_indirectHandle">Indirect buffer.</param>
|
||||
@@ -3752,7 +3895,9 @@ extern fn bgfx_submit_indirect(_id: ViewId, _program: ProgramHandle, _indirectHa
|
||||
|
||||
/// Submit primitive for rendering with index and instance data info and
|
||||
/// draw count from indirect buffers.
|
||||
///
|
||||
/// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
/// <param name="_program">Program.</param>
|
||||
/// <param name="_indirectHandle">Indirect buffer.</param>
|
||||
@@ -3855,8 +4000,10 @@ pub inline fn discard(_flags: u8) void {
|
||||
extern fn bgfx_discard(_flags: u8) void;
|
||||
|
||||
/// 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`.
|
||||
///
|
||||
/// <param name="_id">View id.</param>
|
||||
/// <param name="_dst">Destination texture handle.</param>
|
||||
/// <param name="_dstMip">Destination texture mip level.</param>
|
||||
|
||||
@@ -157,7 +157,9 @@ typedef enum bgfx_attrib_type
|
||||
|
||||
/**
|
||||
* Texture format enum.
|
||||
*
|
||||
* Notation:
|
||||
*
|
||||
* RGBA16S
|
||||
* ^ ^ ^
|
||||
* | | +-- [ ]Unorm
|
||||
@@ -167,6 +169,7 @@ typedef enum bgfx_attrib_type
|
||||
* | | [U]int
|
||||
* | +---- Number of bits per component
|
||||
* +-------- Components
|
||||
*
|
||||
* @attention Availability depends on Caps (see: formats).
|
||||
*
|
||||
*/
|
||||
@@ -767,6 +770,7 @@ typedef struct bgfx_init_s
|
||||
|
||||
/**
|
||||
* Memory must be obtained by calling `bgfx::alloc`, `bgfx::copy`, or `bgfx::makeRef`.
|
||||
*
|
||||
* @attention It is illegal to create this structure on stack and pass it to any bgfx API.
|
||||
*
|
||||
*/
|
||||
@@ -906,6 +910,7 @@ typedef struct bgfx_encoder_stats_s
|
||||
|
||||
/**
|
||||
* Renderer statistics data.
|
||||
*
|
||||
* @remarks All time values are high-resolution timestamps, while
|
||||
* time frequencies define timestamps-per-second for that hardware.
|
||||
*
|
||||
@@ -1003,6 +1008,7 @@ BGFX_C_API bgfx_vertex_layout_t* bgfx_vertex_layout_begin(bgfx_vertex_layout_t*
|
||||
|
||||
/**
|
||||
* Add attribute to VertexLayout.
|
||||
*
|
||||
* @remarks Must be called between begin/end.
|
||||
*
|
||||
* @param[in] _attrib Attribute semantics. See: `bgfx::Attrib`
|
||||
@@ -1123,7 +1129,7 @@ BGFX_C_API void bgfx_vertex_unpack(float _output[4], bgfx_attrib_t _attr, const
|
||||
BGFX_C_API void bgfx_vertex_convert(const bgfx_vertex_layout_t * _dstLayout, void* _dstData, const bgfx_vertex_layout_t * _srcLayout, const void* _srcData, uint32_t _num);
|
||||
|
||||
/**
|
||||
* Weld vertices.
|
||||
* Weld vertices. Returns number of unique vertices after welding.
|
||||
*
|
||||
* @param[in] _output Welded vertices remapping table. The size of buffer
|
||||
* must be the same as number of vertices.
|
||||
@@ -1224,6 +1230,7 @@ BGFX_C_API void bgfx_shutdown(void);
|
||||
|
||||
/**
|
||||
* Reset graphic settings and back-buffer size.
|
||||
*
|
||||
* @attention This call doesn’t change the window size, it just resizes
|
||||
* the back-buffer. Your windowing code controls the window size.
|
||||
*
|
||||
@@ -1265,6 +1272,7 @@ BGFX_C_API uint32_t bgfx_frame(uint8_t _flags);
|
||||
|
||||
/**
|
||||
* Returns current renderer backend API type.
|
||||
*
|
||||
* @remarks
|
||||
* Library must be initialized.
|
||||
*
|
||||
@@ -1273,6 +1281,7 @@ BGFX_C_API bgfx_renderer_type_t bgfx_get_renderer_type(void);
|
||||
|
||||
/**
|
||||
* Returns renderer capabilities.
|
||||
*
|
||||
* @remarks
|
||||
* Library must be initialized.
|
||||
*
|
||||
@@ -1281,6 +1290,7 @@ BGFX_C_API const bgfx_caps_t* bgfx_get_caps(void);
|
||||
|
||||
/**
|
||||
* Returns performance counters.
|
||||
*
|
||||
* @attention Pointer returned is valid until `bgfx::frame` is called.
|
||||
*
|
||||
*/
|
||||
@@ -1314,6 +1324,7 @@ BGFX_C_API const bgfx_memory_t* bgfx_copy(const void* _data, uint32_t _size);
|
||||
* 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.
|
||||
*
|
||||
* @param[in] _data Pointer to data.
|
||||
@@ -1331,6 +1342,7 @@ BGFX_C_API const bgfx_memory_t* bgfx_make_ref(const void* _data, uint32_t _size)
|
||||
* 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.
|
||||
*
|
||||
* @param[in] _data Pointer to data.
|
||||
@@ -1447,7 +1459,7 @@ BGFX_C_API void bgfx_set_index_buffer_name(bgfx_index_buffer_handle_t _handle, c
|
||||
BGFX_C_API void bgfx_destroy_index_buffer(bgfx_index_buffer_handle_t _handle);
|
||||
|
||||
/**
|
||||
* Create vertex layout.
|
||||
* Create vertex layout. Vertex layouts are used to describe the format of vertex data.
|
||||
*
|
||||
* @param[in] _layout Vertex layout.
|
||||
*
|
||||
@@ -1736,6 +1748,7 @@ BGFX_C_API void bgfx_destroy_indirect_buffer(bgfx_indirect_buffer_handle_t _hand
|
||||
|
||||
/**
|
||||
* Create shader from memory buffer.
|
||||
*
|
||||
* @remarks
|
||||
* Shader binary is obtained by compiling shader offline with shaderc command line tool.
|
||||
*
|
||||
@@ -1748,6 +1761,7 @@ BGFX_C_API bgfx_shader_handle_t bgfx_create_shader(const bgfx_memory_t* _mem);
|
||||
|
||||
/**
|
||||
* Returns the number of uniforms and uniform handles used inside a shader.
|
||||
*
|
||||
* @remarks
|
||||
* Only non-predefined uniforms are returned.
|
||||
*
|
||||
@@ -1773,6 +1787,7 @@ BGFX_C_API void bgfx_set_shader_name(bgfx_shader_handle_t _handle, const char* _
|
||||
|
||||
/**
|
||||
* Destroy shader.
|
||||
*
|
||||
* @remark Once a shader program is created with _handle,
|
||||
* it is safe to destroy that shader.
|
||||
*
|
||||
@@ -1966,6 +1981,7 @@ BGFX_C_API bgfx_texture_handle_t bgfx_create_texture_cube(uint16_t _size, bool _
|
||||
|
||||
/**
|
||||
* Update 2D texture.
|
||||
*
|
||||
* @attention It's valid to update only mutable texture. See `bgfx::createTexture2D` for more info.
|
||||
*
|
||||
* @param[in] _handle Texture handle.
|
||||
@@ -1984,6 +2000,7 @@ BGFX_C_API void bgfx_update_texture_2d(bgfx_texture_handle_t _handle, uint16_t _
|
||||
|
||||
/**
|
||||
* Update 3D texture.
|
||||
*
|
||||
* @attention It's valid to update only mutable texture. See `bgfx::createTexture3D` for more info.
|
||||
*
|
||||
* @param[in] _handle Texture handle.
|
||||
@@ -2001,6 +2018,7 @@ BGFX_C_API void bgfx_update_texture_3d(bgfx_texture_handle_t _handle, uint8_t _m
|
||||
|
||||
/**
|
||||
* Update Cube texture.
|
||||
*
|
||||
* @attention It's valid to update only mutable texture. See `bgfx::createTextureCube` for more info.
|
||||
*
|
||||
* @param[in] _handle Texture handle.
|
||||
@@ -2037,6 +2055,7 @@ BGFX_C_API void bgfx_update_texture_cube(bgfx_texture_handle_t _handle, uint16_t
|
||||
|
||||
/**
|
||||
* Read back texture content.
|
||||
*
|
||||
* @attention Texture must be created with `BGFX_TEXTURE_READ_BACK` flag.
|
||||
* @attention Availability depends on: `BGFX_CAPS_TEXTURE_READ_BACK`.
|
||||
*
|
||||
@@ -2062,6 +2081,7 @@ BGFX_C_API void bgfx_set_texture_name(bgfx_texture_handle_t _handle, const char*
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
@@ -2149,8 +2169,10 @@ BGFX_C_API bgfx_frame_buffer_handle_t bgfx_create_frame_buffer_from_attachment(u
|
||||
|
||||
/**
|
||||
* Create frame buffer for multiple window rendering.
|
||||
*
|
||||
* @remarks
|
||||
* Frame buffer cannot be used for sampling.
|
||||
*
|
||||
* @attention Availability depends on: `BGFX_CAPS_SWAP_CHAIN`.
|
||||
*
|
||||
* @param[in] _nwh OS' target native window handle.
|
||||
@@ -2194,12 +2216,14 @@ BGFX_C_API void bgfx_destroy_frame_buffer(bgfx_frame_buffer_handle_t _handle);
|
||||
|
||||
/**
|
||||
* Create shader uniform parameter.
|
||||
*
|
||||
* @remarks
|
||||
* 1. Uniform names are unique. It's valid to call `bgfx::createUniform`
|
||||
* multiple times with the same uniform name. The library will always
|
||||
* return the same handle, but the handle reference count will be
|
||||
* incremented. This means that the same number of `bgfx::destroyUniform`
|
||||
* must be called to properly destroy the uniform.
|
||||
*
|
||||
* 2. Predefined uniforms (declared in `bgfx_shader.sh`):
|
||||
* - `u_viewRect vec4(x, y, width, height)` - view rectangle for current
|
||||
* view, in pixels.
|
||||
@@ -2229,12 +2253,14 @@ BGFX_C_API bgfx_uniform_handle_t bgfx_create_uniform(const char* _name, bgfx_uni
|
||||
|
||||
/**
|
||||
* Create shader uniform parameter.
|
||||
*
|
||||
* @remarks
|
||||
* 1. Uniform names are unique. It's valid to call `bgfx::createUniform`
|
||||
* multiple times with the same uniform name. The library will always
|
||||
* return the same handle, but the handle reference count will be
|
||||
* incremented. This means that the same number of `bgfx::destroyUniform`
|
||||
* must be called to properly destroy the uniform.
|
||||
*
|
||||
* 2. Predefined uniforms (declared in `bgfx_shader.sh`):
|
||||
* - `u_viewRect vec4(x, y, width, height)` - view rectangle for current
|
||||
* view, in pixels.
|
||||
@@ -2281,7 +2307,8 @@ BGFX_C_API void bgfx_get_uniform_info(bgfx_uniform_handle_t _handle, bgfx_unifor
|
||||
BGFX_C_API void bgfx_destroy_uniform(bgfx_uniform_handle_t _handle);
|
||||
|
||||
/**
|
||||
* Create occlusion query.
|
||||
* Create occlusion query. Occlusion queries allow the GPU to determine
|
||||
* if any pixels passed the depth test.
|
||||
*
|
||||
*/
|
||||
BGFX_C_API bgfx_occlusion_query_handle_t bgfx_create_occlusion_query(void);
|
||||
@@ -2338,9 +2365,12 @@ BGFX_C_API void bgfx_set_palette_color_rgba8(uint8_t _index, uint32_t _rgba);
|
||||
|
||||
/**
|
||||
* Set view name.
|
||||
*
|
||||
* @remarks
|
||||
* This is debug only feature.
|
||||
*
|
||||
* In graphics debugger view name will appear as:
|
||||
*
|
||||
* "nnnc <view name>"
|
||||
* ^ ^ ^
|
||||
* | +--- compute (C)
|
||||
@@ -2428,6 +2458,7 @@ BGFX_C_API void bgfx_set_view_clear_mrt(bgfx_view_id_t _id, uint16_t _flags, flo
|
||||
|
||||
/**
|
||||
* Set view sorting mode.
|
||||
*
|
||||
* @remarks
|
||||
* View mode must be set prior calling `bgfx::submit` for the view.
|
||||
*
|
||||
@@ -2439,6 +2470,7 @@ BGFX_C_API void bgfx_set_view_mode(bgfx_view_id_t _id, bgfx_view_mode_t _mode);
|
||||
|
||||
/**
|
||||
* Set view frame buffer.
|
||||
*
|
||||
* @remarks
|
||||
* Not persistent after `bgfx::reset` call.
|
||||
*
|
||||
@@ -2474,6 +2506,7 @@ BGFX_C_API void bgfx_set_view_order(bgfx_view_id_t _id, uint16_t _num, const bgf
|
||||
|
||||
/**
|
||||
* Set view shading rate.
|
||||
*
|
||||
* @attention Availability depends on: `BGFX_CAPS_VARIABLE_RATE_SHADING`.
|
||||
*
|
||||
* @param[in] _id View id.
|
||||
@@ -2521,6 +2554,7 @@ BGFX_C_API void bgfx_encoder_set_marker(bgfx_encoder_t* _this, const char* _name
|
||||
|
||||
/**
|
||||
* Set render states for draw primitive.
|
||||
*
|
||||
* @remarks
|
||||
* 1. To set up more complex states use:
|
||||
* `BGFX_STATE_ALPHA_REF(_ref)`,
|
||||
@@ -2568,6 +2602,7 @@ BGFX_C_API void bgfx_encoder_set_stencil(bgfx_encoder_t* _this, uint32_t _fstenc
|
||||
|
||||
/**
|
||||
* Set scissor for draw primitive.
|
||||
*
|
||||
* @remark
|
||||
* To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
*
|
||||
@@ -2583,6 +2618,7 @@ BGFX_C_API uint16_t bgfx_encoder_set_scissor(bgfx_encoder_t* _this, uint16_t _x,
|
||||
|
||||
/**
|
||||
* Set scissor from cache for draw primitive.
|
||||
*
|
||||
* @remark
|
||||
* To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
*
|
||||
@@ -2615,6 +2651,7 @@ BGFX_C_API void bgfx_encoder_set_transform_cached(bgfx_encoder_t* _this, uint32_
|
||||
|
||||
/**
|
||||
* Reserve matrices in internal matrix cache.
|
||||
*
|
||||
* @attention Pointer returned can be modified until `bgfx::frame` is called.
|
||||
*
|
||||
* @param[out] _transform Pointer to `Transform` structure.
|
||||
@@ -2638,6 +2675,7 @@ BGFX_C_API void bgfx_encoder_set_uniform(bgfx_encoder_t* _this, bgfx_uniform_han
|
||||
|
||||
/**
|
||||
* Set shader uniform parameter for view.
|
||||
*
|
||||
* @attention Uniform must be created with `bgfx::UniformFreq::View` argument.
|
||||
*
|
||||
* @param[in] _id View id.
|
||||
@@ -2651,6 +2689,7 @@ BGFX_C_API void bgfx_set_view_uniform(bgfx_view_id_t _id, bgfx_uniform_handle_t
|
||||
|
||||
/**
|
||||
* Set shader uniform parameter for frame.
|
||||
*
|
||||
* @attention Uniform must be created with `bgfx::UniformFreq::View` argument.
|
||||
*
|
||||
* @param[in] _handle Uniform.
|
||||
@@ -2726,6 +2765,19 @@ BGFX_C_API void bgfx_encoder_set_vertex_buffer_with_layout(bgfx_encoder_t* _this
|
||||
*
|
||||
*/
|
||||
BGFX_C_API void bgfx_encoder_set_dynamic_vertex_buffer(bgfx_encoder_t* _this, uint8_t _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _numVertices);
|
||||
|
||||
/**
|
||||
* Set vertex buffer for draw primitive.
|
||||
*
|
||||
* @param[in] _stream Vertex stream.
|
||||
* @param[in] _handle Dynamic vertex buffer.
|
||||
* @param[in] _startVertex First vertex to render.
|
||||
* @param[in] _numVertices Number of vertices to render.
|
||||
* @param[in] _layoutHandle Vertex layout for aliasing vertex buffer. If invalid
|
||||
* handle is used, vertex layout used for creation
|
||||
* of vertex buffer will be used.
|
||||
*
|
||||
*/
|
||||
BGFX_C_API void bgfx_encoder_set_dynamic_vertex_buffer_with_layout(bgfx_encoder_t* _this, uint8_t _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
|
||||
|
||||
/**
|
||||
@@ -2756,6 +2808,7 @@ BGFX_C_API void bgfx_encoder_set_transient_vertex_buffer_with_layout(bgfx_encode
|
||||
/**
|
||||
* Set number of vertices for auto generated vertices use in conjunction
|
||||
* with gl_VertexID.
|
||||
*
|
||||
* @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
*
|
||||
* @param[in] _numVertices Number of vertices.
|
||||
@@ -2796,6 +2849,7 @@ BGFX_C_API void bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer(bgfx_e
|
||||
/**
|
||||
* Set number of instances for auto generated instances use in conjunction
|
||||
* with gl_InstanceID.
|
||||
*
|
||||
* @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
*
|
||||
* @param[in] _numInstances Number of instances.
|
||||
@@ -2824,6 +2878,7 @@ BGFX_C_API void bgfx_encoder_set_texture(bgfx_encoder_t* _this, uint8_t _stage,
|
||||
* 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.
|
||||
*
|
||||
@@ -2858,6 +2913,7 @@ BGFX_C_API void bgfx_encoder_submit_occlusion_query(bgfx_encoder_t* _this, bgfx_
|
||||
/**
|
||||
* Submit primitive for rendering with index and instance data info from
|
||||
* indirect buffer.
|
||||
*
|
||||
* @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
|
||||
*
|
||||
* @param[in] _id View id.
|
||||
@@ -2874,6 +2930,7 @@ BGFX_C_API void bgfx_encoder_submit_indirect(bgfx_encoder_t* _this, bgfx_view_id
|
||||
/**
|
||||
* Submit primitive for rendering with index and instance data info and
|
||||
* draw count from indirect buffers.
|
||||
*
|
||||
* @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
|
||||
*
|
||||
* @param[in] _id View id.
|
||||
@@ -2988,6 +3045,7 @@ BGFX_C_API void bgfx_encoder_discard(bgfx_encoder_t* _this, uint8_t _flags);
|
||||
|
||||
/**
|
||||
* 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`.
|
||||
*
|
||||
@@ -3016,6 +3074,7 @@ BGFX_C_API void bgfx_encoder_blit(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgf
|
||||
|
||||
/**
|
||||
* 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.
|
||||
@@ -3029,10 +3088,12 @@ BGFX_C_API void bgfx_request_screen_shot(bgfx_frame_buffer_handle_t _handle, con
|
||||
|
||||
/**
|
||||
* 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.
|
||||
@@ -3046,6 +3107,7 @@ BGFX_C_API bgfx_render_frame_t bgfx_render_frame(int32_t _msecs);
|
||||
|
||||
/**
|
||||
* Set platform data.
|
||||
*
|
||||
* @warning Must be called before `bgfx::init`.
|
||||
*
|
||||
* @param[in] _data Platform data.
|
||||
@@ -3055,8 +3117,10 @@ BGFX_C_API void bgfx_set_platform_data(const bgfx_platform_data_t * _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.
|
||||
*
|
||||
*/
|
||||
@@ -3065,8 +3129,10 @@ BGFX_C_API const bgfx_internal_data_t* bgfx_get_internal_data(void);
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @param[in] _handle Texture handle.
|
||||
@@ -3082,10 +3148,13 @@ BGFX_C_API uintptr_t bgfx_override_internal_texture_ptr(bgfx_texture_handle_t _h
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @param[in] _handle Texture handle.
|
||||
@@ -3119,6 +3188,7 @@ BGFX_C_API void bgfx_set_marker(const char* _name, int32_t _len);
|
||||
|
||||
/**
|
||||
* Set render states for draw primitive.
|
||||
*
|
||||
* @remarks
|
||||
* 1. To set up more complex states use:
|
||||
* `BGFX_STATE_ALPHA_REF(_ref)`,
|
||||
@@ -3166,6 +3236,7 @@ BGFX_C_API void bgfx_set_stencil(uint32_t _fstencil, uint32_t _bstencil);
|
||||
|
||||
/**
|
||||
* Set scissor for draw primitive.
|
||||
*
|
||||
* @remark
|
||||
* To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
*
|
||||
@@ -3181,6 +3252,7 @@ BGFX_C_API uint16_t bgfx_set_scissor(uint16_t _x, uint16_t _y, uint16_t _width,
|
||||
|
||||
/**
|
||||
* Set scissor from cache for draw primitive.
|
||||
*
|
||||
* @remark
|
||||
* To scissor for all primitives in view see `bgfx::setViewScissor`.
|
||||
*
|
||||
@@ -3213,6 +3285,7 @@ BGFX_C_API void bgfx_set_transform_cached(uint32_t _cache, uint16_t _num);
|
||||
|
||||
/**
|
||||
* Reserve matrices in internal matrix cache.
|
||||
*
|
||||
* @attention Pointer returned can be modified until `bgfx::frame` is called.
|
||||
*
|
||||
* @param[out] _transform Pointer to `Transform` structure.
|
||||
@@ -3342,6 +3415,7 @@ BGFX_C_API void bgfx_set_transient_vertex_buffer_with_layout(uint8_t _stream, co
|
||||
/**
|
||||
* Set number of vertices for auto generated vertices use in conjunction
|
||||
* with gl_VertexID.
|
||||
*
|
||||
* @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
*
|
||||
* @param[in] _numVertices Number of vertices.
|
||||
@@ -3382,6 +3456,7 @@ BGFX_C_API void bgfx_set_instance_data_from_dynamic_vertex_buffer(bgfx_dynamic_v
|
||||
/**
|
||||
* Set number of instances for auto generated instances use in conjunction
|
||||
* with gl_InstanceID.
|
||||
*
|
||||
* @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
|
||||
*
|
||||
* @param[in] _numInstances Number of instances.
|
||||
@@ -3408,6 +3483,7 @@ BGFX_C_API void bgfx_set_texture(uint8_t _stage, bgfx_uniform_handle_t _sampler,
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
@@ -3442,6 +3518,7 @@ BGFX_C_API void bgfx_submit_occlusion_query(bgfx_view_id_t _id, bgfx_program_han
|
||||
/**
|
||||
* Submit primitive for rendering with index and instance data info from
|
||||
* indirect buffer.
|
||||
*
|
||||
* @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
|
||||
*
|
||||
* @param[in] _id View id.
|
||||
@@ -3458,6 +3535,7 @@ BGFX_C_API void bgfx_submit_indirect(bgfx_view_id_t _id, bgfx_program_handle_t _
|
||||
/**
|
||||
* Submit primitive for rendering with index and instance data info and
|
||||
* draw count from indirect buffers.
|
||||
*
|
||||
* @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
|
||||
*
|
||||
* @param[in] _id View id.
|
||||
@@ -3572,6 +3650,7 @@ BGFX_C_API void bgfx_discard(uint8_t _flags);
|
||||
|
||||
/**
|
||||
* 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`.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user