/*
* Copyright 2011-2019 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
*
* AUTO GENERATED! DO NOT EDIT!
*
*/
using System;
using System.Runtime.InteropServices;
namespace Bgfx
{
public static partial class bgfx
{
[Flags]
public enum StateFlags : ulong
{
///
/// Enable R write.
///
WriteR = 0x0000000000000001,
///
/// Enable G write.
///
WriteG = 0x0000000000000002,
///
/// Enable B write.
///
WriteB = 0x0000000000000004,
///
/// Enable alpha write.
///
WriteA = 0x0000000000000008,
///
/// Enable depth write.
///
WriteZ = 0x0000004000000000,
///
/// Enable RGB write.
///
WriteRgb = 0x0000000000000007,
///
/// Write all channels mask.
///
WriteMask = 0x000000400000000f,
///
/// Enable depth test, less.
///
DepthTestLess = 0x0000000000000010,
///
/// Enable depth test, less or equal.
///
DepthTestLequal = 0x0000000000000020,
///
/// Enable depth test, equal.
///
DepthTestEqual = 0x0000000000000030,
///
/// Enable depth test, greater or equal.
///
DepthTestGequal = 0x0000000000000040,
///
/// Enable depth test, greater.
///
DepthTestGreater = 0x0000000000000050,
///
/// Enable depth test, not equal.
///
DepthTestNotequal = 0x0000000000000060,
///
/// Enable depth test, never.
///
DepthTestNever = 0x0000000000000070,
///
/// Enable depth test, always.
///
DepthTestAlways = 0x0000000000000080,
DepthTestShift = 4,
DepthTestMask = 0x00000000000000f0,
///
/// 0, 0, 0, 0
///
BlendZero = 0x0000000000001000,
///
/// 1, 1, 1, 1
///
BlendOne = 0x0000000000002000,
///
/// Rs, Gs, Bs, As
///
BlendSrcColor = 0x0000000000003000,
///
/// 1-Rs, 1-Gs, 1-Bs, 1-As
///
BlendInvSrcColor = 0x0000000000004000,
///
/// As, As, As, As
///
BlendSrcAlpha = 0x0000000000005000,
///
/// 1-As, 1-As, 1-As, 1-As
///
BlendInvSrcAlpha = 0x0000000000006000,
///
/// Ad, Ad, Ad, Ad
///
BlendDstAlpha = 0x0000000000007000,
///
/// 1-Ad, 1-Ad, 1-Ad ,1-Ad
///
BlendInvDstAlpha = 0x0000000000008000,
///
/// Rd, Gd, Bd, Ad
///
BlendDstColor = 0x0000000000009000,
///
/// 1-Rd, 1-Gd, 1-Bd, 1-Ad
///
BlendInvDstColor = 0x000000000000a000,
///
/// f, f, f, 1; f = min(As, 1-Ad)
///
BlendSrcAlphaSat = 0x000000000000b000,
///
/// Blend factor
///
BlendFactor = 0x000000000000c000,
///
/// 1-Blend factor
///
BlendInvFactor = 0x000000000000d000,
BlendShift = 12,
BlendMask = 0x000000000ffff000,
///
/// Blend add: src + dst.
///
BlendEquationAdd = 0x0000000000000000,
///
/// Blend subtract: src - dst.
///
BlendEquationSub = 0x0000000010000000,
///
/// Blend reverse subtract: dst - src.
///
BlendEquationRevsub = 0x0000000020000000,
///
/// Blend min: min(src, dst).
///
BlendEquationMin = 0x0000000030000000,
///
/// Blend max: max(src, dst).
///
BlendEquationMax = 0x0000000040000000,
BlendEquationShift = 28,
BlendEquationMask = 0x00000003f0000000,
///
/// Cull clockwise triangles.
///
CullCw = 0x0000001000000000,
///
/// Cull counter-clockwise triangles.
///
CullCcw = 0x0000002000000000,
CullShift = 36,
CullMask = 0x0000003000000000,
AlphaRefShift = 40,
AlphaRefMask = 0x0000ff0000000000,
///
/// Tristrip.
///
PtTristrip = 0x0001000000000000,
///
/// Lines.
///
PtLines = 0x0002000000000000,
///
/// Line strip.
///
PtLinestrip = 0x0003000000000000,
///
/// Points.
///
PtPoints = 0x0004000000000000,
PtShift = 48,
PtMask = 0x0007000000000000,
PointSizeShift = 52,
PointSizeMask = 0x00f0000000000000,
///
/// Enable MSAA rasterization.
///
Msaa = 0x0100000000000000,
///
/// Enable line AA rasterization.
///
Lineaa = 0x0200000000000000,
///
/// Enable conservative rasterization.
///
ConservativeRaster = 0x0400000000000000,
///
/// No state.
///
None = 0x0000000000000000,
///
/// Enable blend independent.
///
BlendIndependent = 0x0000000400000000,
///
/// Enable alpha to coverage.
///
BlendAlphaToCoverage = 0x0000000800000000,
///
/// Default state is write to RGB, alpha, and depth with depth test less enabled, with clockwise
/// culling and MSAA (when writing into MSAA frame buffer, otherwise this flag is ignored).
///
Default = 0x010000500000001f,
Mask = 0xffffffffffffffff,
ReservedShift = 61,
ReservedMask = 0xe000000000000000,
}
[Flags]
public enum StencilFlags : uint
{
FuncRefShift = 0,
FuncRefMask = 0x000000ff,
FuncRmaskShift = 8,
FuncRmaskMask = 0x0000ff00,
None = 0x00000000,
Mask = 0xffffffff,
Default = 0x00000000,
///
/// Enable stencil test, less.
///
TestLess = 0x00010000,
///
/// Enable stencil test, less or equal.
///
TestLequal = 0x00020000,
///
/// Enable stencil test, equal.
///
TestEqual = 0x00030000,
///
/// Enable stencil test, greater or equal.
///
TestGequal = 0x00040000,
///
/// Enable stencil test, greater.
///
TestGreater = 0x00050000,
///
/// Enable stencil test, not equal.
///
TestNotequal = 0x00060000,
///
/// Enable stencil test, never.
///
TestNever = 0x00070000,
///
/// Enable stencil test, always.
///
TestAlways = 0x00080000,
TestShift = 16,
TestMask = 0x000f0000,
///
/// Zero.
///
OpFailSZero = 0x00000000,
///
/// Keep.
///
OpFailSKeep = 0x00100000,
///
/// Replace.
///
OpFailSReplace = 0x00200000,
///
/// Increment and wrap.
///
OpFailSIncr = 0x00300000,
///
/// Increment and clamp.
///
OpFailSIncrsat = 0x00400000,
///
/// Decrement and wrap.
///
OpFailSDecr = 0x00500000,
///
/// Decrement and clamp.
///
OpFailSDecrsat = 0x00600000,
///
/// Invert.
///
OpFailSInvert = 0x00700000,
OpFailSShift = 20,
OpFailSMask = 0x00f00000,
///
/// Zero.
///
OpFailZZero = 0x00000000,
///
/// Keep.
///
OpFailZKeep = 0x01000000,
///
/// Replace.
///
OpFailZReplace = 0x02000000,
///
/// Increment and wrap.
///
OpFailZIncr = 0x03000000,
///
/// Increment and clamp.
///
OpFailZIncrsat = 0x04000000,
///
/// Decrement and wrap.
///
OpFailZDecr = 0x05000000,
///
/// Decrement and clamp.
///
OpFailZDecrsat = 0x06000000,
///
/// Invert.
///
OpFailZInvert = 0x07000000,
OpFailZShift = 24,
OpFailZMask = 0x0f000000,
///
/// Zero.
///
OpPassZZero = 0x00000000,
///
/// Keep.
///
OpPassZKeep = 0x10000000,
///
/// Replace.
///
OpPassZReplace = 0x20000000,
///
/// Increment and wrap.
///
OpPassZIncr = 0x30000000,
///
/// Increment and clamp.
///
OpPassZIncrsat = 0x40000000,
///
/// Decrement and wrap.
///
OpPassZDecr = 0x50000000,
///
/// Decrement and clamp.
///
OpPassZDecrsat = 0x60000000,
///
/// Invert.
///
OpPassZInvert = 0x70000000,
OpPassZShift = 28,
OpPassZMask = 0xf0000000,
}
[Flags]
public enum ClearFlags : ushort
{
///
/// No clear flags.
///
None = 0x0000,
///
/// Clear color.
///
Color = 0x0001,
///
/// Clear depth.
///
Depth = 0x0002,
///
/// Clear stencil.
///
Stencil = 0x0004,
///
/// Discard frame buffer attachment 0.
///
DiscardColor0 = 0x0008,
///
/// Discard frame buffer attachment 1.
///
DiscardColor1 = 0x0010,
///
/// Discard frame buffer attachment 2.
///
DiscardColor2 = 0x0020,
///
/// Discard frame buffer attachment 3.
///
DiscardColor3 = 0x0040,
///
/// Discard frame buffer attachment 4.
///
DiscardColor4 = 0x0080,
///
/// Discard frame buffer attachment 5.
///
DiscardColor5 = 0x0100,
///
/// Discard frame buffer attachment 6.
///
DiscardColor6 = 0x0200,
///
/// Discard frame buffer attachment 7.
///
DiscardColor7 = 0x0400,
///
/// Discard frame buffer depth attachment.
///
DiscardDepth = 0x0800,
///
/// Discard frame buffer stencil attachment.
///
DiscardStencil = 0x1000,
DiscardColorMask = 0x07f8,
DiscardMask = 0x1ff8,
}
[Flags]
public enum DebugFlags : uint
{
///
/// No debug.
///
None = 0x00000000,
///
/// Enable wireframe for all primitives.
///
Wireframe = 0x00000001,
///
/// Enable infinitely fast hardware test. No draw calls will be submitted to driver.
/// It's useful when profiling to quickly assess bottleneck between CPU and GPU.
///
Ifh = 0x00000002,
///
/// Enable statistics display.
///
Stats = 0x00000004,
///
/// Enable debug text display.
///
Text = 0x00000008,
///
/// Enable profiler.
///
Profiler = 0x00000010,
}
[Flags]
public enum BufferFlags : ushort
{
///
/// 1 8-bit value
///
ComputeFormat8x1 = 0x0001,
///
/// 2 8-bit values
///
ComputeFormat8x2 = 0x0002,
///
/// 4 8-bit values
///
ComputeFormat8x4 = 0x0003,
///
/// 1 16-bit value
///
ComputeFormat16x1 = 0x0004,
///
/// 2 16-bit values
///
ComputeFormat16x2 = 0x0005,
///
/// 4 16-bit values
///
ComputeFormat16x4 = 0x0006,
///
/// 1 32-bit value
///
ComputeFormat32x1 = 0x0007,
///
/// 2 32-bit values
///
ComputeFormat32x2 = 0x0008,
///
/// 4 32-bit values
///
ComputeFormat32x4 = 0x0009,
ComputeFormatShift = 0,
ComputeFormatMask = 0x000f,
///
/// Type `int`.
///
ComputeTypeInt = 0x0010,
///
/// Type `uint`.
///
ComputeTypeUint = 0x0020,
///
/// Type `float`.
///
ComputeTypeFloat = 0x0030,
ComputeTypeShift = 4,
ComputeTypeMask = 0x0030,
None = 0x0000,
///
/// Buffer will be read by shader.
///
ComputeRead = 0x0100,
///
/// Buffer will be used for writing.
///
ComputeWrite = 0x0200,
///
/// Buffer will be used for storing draw indirect commands.
///
DrawIndirect = 0x0400,
///
/// Allow dynamic index/vertex buffer resize during update.
///
AllowResize = 0x0800,
///
/// Index buffer contains 32-bit indices.
///
Index32 = 0x1000,
ComputeReadWrite = 0x0300,
}
[Flags]
public enum TextureFlags : ulong
{
None = 0x0000000000000000,
///
/// Texture will be used for MSAA sampling.
///
MsaaSample = 0x0000000800000000,
///
/// Render target no MSAA.
///
Rt = 0x0000001000000000,
///
/// Texture will be used for compute write.
///
ComputeWrite = 0x0000100000000000,
///
/// Sample texture as sRGB.
///
Srgb = 0x0000200000000000,
///
/// Texture will be used as blit destination.
///
BlitDst = 0x0000400000000000,
///
/// Texture will be used for read back from GPU.
///
ReadBack = 0x0000800000000000,
///
/// Render target MSAAx2 mode.
///
RtMsaaX2 = 0x0000002000000000,
///
/// Render target MSAAx4 mode.
///
RtMsaaX4 = 0x0000003000000000,
///
/// Render target MSAAx8 mode.
///
RtMsaaX8 = 0x0000004000000000,
///
/// Render target MSAAx16 mode.
///
RtMsaaX16 = 0x0000005000000000,
RtMsaaShift = 36,
RtMsaaMask = 0x0000007000000000,
///
/// Render target will be used for writing
///
RtWriteOnly = 0x0000008000000000,
RtShift = 36,
RtMask = 0x000000f000000000,
}
[Flags]
public enum SamplerFlags : uint
{
///
/// Wrap U mode: Mirror
///
UMirror = 0x00000001,
///
/// Wrap U mode: Clamp
///
UClamp = 0x00000002,
///
/// Wrap U mode: Border
///
UBorder = 0x00000003,
UShift = 0,
UMask = 0x00000003,
///
/// Wrap V mode: Mirror
///
VMirror = 0x00000004,
///
/// Wrap V mode: Clamp
///
VClamp = 0x00000008,
///
/// Wrap V mode: Border
///
VBorder = 0x0000000c,
VShift = 2,
VMask = 0x0000000c,
///
/// Wrap W mode: Mirror
///
WMirror = 0x00000010,
///
/// Wrap W mode: Clamp
///
WClamp = 0x00000020,
///
/// Wrap W mode: Border
///
WBorder = 0x00000030,
WShift = 4,
WMask = 0x00000030,
///
/// Min sampling mode: Point
///
MinPoint = 0x00000040,
///
/// Min sampling mode: Anisotropic
///
MinAnisotropic = 0x00000080,
MinShift = 6,
MinMask = 0x000000c0,
///
/// Mag sampling mode: Point
///
MagPoint = 0x00000100,
///
/// Mag sampling mode: Anisotropic
///
MagAnisotropic = 0x00000200,
MagShift = 8,
MagMask = 0x00000300,
///
/// Mip sampling mode: Point
///
MipPoint = 0x00000400,
MipShift = 10,
MipMask = 0x00000400,
///
/// Compare when sampling depth texture: less.
///
CompareLess = 0x00010000,
///
/// Compare when sampling depth texture: less or equal.
///
CompareLequal = 0x00020000,
///
/// Compare when sampling depth texture: equal.
///
CompareEqual = 0x00030000,
///
/// Compare when sampling depth texture: greater or equal.
///
CompareGequal = 0x00040000,
///
/// Compare when sampling depth texture: greater.
///
CompareGreater = 0x00050000,
///
/// Compare when sampling depth texture: not equal.
///
CompareNotequal = 0x00060000,
///
/// Compare when sampling depth texture: never.
///
CompareNever = 0x00070000,
///
/// Compare when sampling depth texture: always.
///
CompareAlways = 0x00080000,
CompareShift = 16,
CompareMask = 0x000f0000,
BorderColorShift = 24,
BorderColorMask = 0x0f000000,
ReservedShift = 28,
ReservedMask = 0xf0000000,
None = 0x00000000,
///
/// Sample stencil instead of depth.
///
SampleStencil = 0x00100000,
Point = 0x00000540,
UvwMirror = 0x00000015,
UvwClamp = 0x0000002a,
UvwBorder = 0x0000003f,
BitsMask = 0x000f07ff,
}
[Flags]
public enum ResetFlags : uint
{
///
/// Enable 2x MSAA.
///
MsaaX2 = 0x00000010,
///
/// Enable 4x MSAA.
///
MsaaX4 = 0x00000020,
///
/// Enable 8x MSAA.
///
MsaaX8 = 0x00000030,
///
/// Enable 16x MSAA.
///
MsaaX16 = 0x00000040,
MsaaShift = 4,
MsaaMask = 0x00000070,
///
/// No reset flags.
///
None = 0x00000000,
///
/// Not supported yet.
///
Fullscreen = 0x00000001,
///
/// Enable V-Sync.
///
Vsync = 0x00000080,
///
/// Turn on/off max anisotropy.
///
Maxanisotropy = 0x00000100,
///
/// Begin screen capture.
///
Capture = 0x00000200,
///
/// Flush rendering after submitting to GPU.
///
FlushAfterRender = 0x00002000,
///
/// This flag specifies where flip occurs. Default behavior is that flip occurs
/// before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
///
FlipAfterRender = 0x00004000,
///
/// Enable sRGB backbuffer.
///
SrgbBackbuffer = 0x00008000,
///
/// Enable HDR10 rendering.
///
Hdr10 = 0x00010000,
///
/// Enable HiDPI rendering.
///
Hidpi = 0x00020000,
///
/// Enable depth clamp.
///
DepthClamp = 0x00040000,
///
/// Suspend rendering.
///
Suspend = 0x00080000,
FullscreenShift = 0,
FullscreenMask = 0x00000001,
ReservedShift = 31,
ReservedMask = 0x80000000,
}
[Flags]
public enum CapsFlags : ulong
{
///
/// Alpha to coverage is supported.
///
AlphaToCoverage = 0x0000000000000001,
///
/// Blend independent is supported.
///
BlendIndependent = 0x0000000000000002,
///
/// Compute shaders are supported.
///
Compute = 0x0000000000000004,
///
/// Conservative rasterization is supported.
///
ConservativeRaster = 0x0000000000000008,
///
/// Draw indirect is supported.
///
DrawIndirect = 0x0000000000000010,
///
/// Fragment depth is accessible in fragment shader.
///
FragmentDepth = 0x0000000000000020,
///
/// Fragment ordering is available in fragment shader.
///
FragmentOrdering = 0x0000000000000040,
///
/// Read/Write frame buffer attachments are supported.
///
FramebufferRw = 0x0000000000000080,
///
/// Graphics debugger is present.
///
GraphicsDebugger = 0x0000000000000100,
Reserved = 0x0000000000000200,
///
/// HDR10 rendering is supported.
///
Hdr10 = 0x0000000000000400,
///
/// HiDPI rendering is supported.
///
Hidpi = 0x0000000000000800,
///
/// 32-bit indices are supported.
///
Index32 = 0x0000000000001000,
///
/// Instancing is supported.
///
Instancing = 0x0000000000002000,
///
/// Occlusion query is supported.
///
OcclusionQuery = 0x0000000000004000,
///
/// Renderer is on separate thread.
///
RendererMultithreaded = 0x0000000000008000,
///
/// Multiple windows are supported.
///
SwapChain = 0x0000000000010000,
///
/// 2D texture array is supported.
///
Texture2dArray = 0x0000000000020000,
///
/// 3D textures are supported.
///
Texture3d = 0x0000000000040000,
///
/// Texture blit is supported.
///
TextureBlit = 0x0000000000080000,
///
/// All texture compare modes are supported.
///
TextureCompareReserved = 0x0000000000100000,
///
/// Texture compare less equal mode is supported.
///
TextureCompareLequal = 0x0000000000200000,
///
/// Cubemap texture array is supported.
///
TextureCubeArray = 0x0000000000400000,
///
/// CPU direct access to GPU texture memory.
///
TextureDirectAccess = 0x0000000000800000,
///
/// Read-back texture is supported.
///
TextureReadBack = 0x0000000001000000,
///
/// Vertex attribute half-float is supported.
///
VertexAttribHalf = 0x0000000002000000,
///
/// Vertex attribute 10_10_10_2 is supported.
///
VertexAttribUint10 = 0x0000000004000000,
///
/// Rendering with VertexID only is supported.
///
VertexId = 0x0000000008000000,
///
/// All texture compare modes are supported.
///
TextureCompareAll = 0x0000000000300000,
}
[Flags]
public enum CapsFormatFlags : ushort
{
///
/// Texture format is not supported.
///
TextureNone = 0x0000,
///
/// Texture format is supported.
///
Texture2d = 0x0001,
///
/// Texture as sRGB format is supported.
///
Texture2dSrgb = 0x0002,
///
/// Texture format is emulated.
///
Texture2dEmulated = 0x0004,
///
/// Texture format is supported.
///
Texture3d = 0x0008,
///
/// Texture as sRGB format is supported.
///
Texture3dSrgb = 0x0010,
///
/// Texture format is emulated.
///
Texture3dEmulated = 0x0020,
///
/// Texture format is supported.
///
TextureCube = 0x0040,
///
/// Texture as sRGB format is supported.
///
TextureCubeSrgb = 0x0080,
///
/// Texture format is emulated.
///
TextureCubeEmulated = 0x0100,
///
/// Texture format can be used from vertex shader.
///
TextureVertex = 0x0200,
///
/// Texture format can be used as image from compute shader.
///
TextureImage = 0x0400,
///
/// Texture format can be used as frame buffer.
///
TextureFramebuffer = 0x0800,
///
/// Texture format can be used as MSAA frame buffer.
///
TextureFramebufferMsaa = 0x1000,
///
/// Texture can be sampled as MSAA.
///
TextureMsaa = 0x2000,
///
/// Texture format supports auto-generated mips.
///
TextureMipAutogen = 0x4000,
}
[Flags]
public enum ResolveFlags : uint
{
///
/// No resolve flags.
///
None = 0x00000000,
///
/// Auto-generate mip maps on resolve.
///
AutoGenMips = 0x00000001,
}
[Flags]
public enum PciIdFlags : ushort
{
///
/// Autoselect adapter.
///
None = 0x0000,
///
/// Software rasterizer.
///
SoftwareRasterizer = 0x0001,
///
/// AMD adapter.
///
Amd = 0x1002,
///
/// Intel adapter.
///
Intel = 0x8086,
///
/// nVidia adapter.
///
Nvidia = 0x10de,
}
[Flags]
public enum CubeMapFlags : uint
{
///
/// Cubemap +x.
///
PositiveX = 0x00000000,
///
/// Cubemap -x.
///
NegativeX = 0x00000001,
///
/// Cubemap +y.
///
PositiveY = 0x00000002,
///
/// Cubemap -y.
///
NegativeY = 0x00000003,
///
/// Cubemap +z.
///
PositiveZ = 0x00000004,
///
/// Cubemap -z.
///
NegativeZ = 0x00000005,
}
public enum Fatal
{
DebugCheck,
InvalidShader,
UnableToInitialize,
UnableToCreateTexture,
DeviceLost,
Count
}
public enum RendererType
{
///
/// No rendering.
///
Noop,
///
/// Direct3D 9.0
///
Direct3D9,
///
/// Direct3D 11.0
///
Direct3D11,
///
/// Direct3D 12.0
///
Direct3D12,
///
/// GNM
///
Gnm,
///
/// Metal
///
Metal,
///
/// NVN
///
Nvn,
///
/// OpenGL ES 2.0+
///
OpenGLES,
///
/// OpenGL 2.1+
///
OpenGL,
///
/// Vulkan
///
Vulkan,
Count
}
public enum Access
{
///
/// Read.
///
Read,
///
/// Write.
///
Write,
///
/// Read and write.
///
ReadWrite,
Count
}
public enum Attrib
{
///
/// a_position
///
Position,
///
/// a_normal
///
Normal,
///
/// a_tangent
///
Tangent,
///
/// a_bitangent
///
Bitangent,
///
/// a_color0
///
Color0,
///
/// a_color1
///
Color1,
///
/// a_color2
///
Color2,
///
/// a_color3
///
Color3,
///
/// a_indices
///
Indices,
///
/// a_weight
///
Weight,
///
/// a_texcoord0
///
TexCoord0,
///
/// a_texcoord1
///
TexCoord1,
///
/// a_texcoord2
///
TexCoord2,
///
/// a_texcoord3
///
TexCoord3,
///
/// a_texcoord4
///
TexCoord4,
///
/// a_texcoord5
///
TexCoord5,
///
/// a_texcoord6
///
TexCoord6,
///
/// a_texcoord7
///
TexCoord7,
Count
}
public enum AttribType
{
///
/// Uint8
///
Uint8,
///
/// Uint10, availability depends on: `BGFX_CAPS_VERTEX_ATTRIB_UINT10`.
///
Uint10,
///
/// Int16
///
Int16,
///
/// Half, availability depends on: `BGFX_CAPS_VERTEX_ATTRIB_HALF`.
///
Half,
///
/// Float
///
Float,
Count
}
public enum TextureFormat
{
///
/// DXT1 R5G6B5A1
///
BC1,
///
/// DXT3 R5G6B5A4
///
BC2,
///
/// DXT5 R5G6B5A8
///
BC3,
///
/// LATC1/ATI1 R8
///
BC4,
///
/// LATC2/ATI2 RG8
///
BC5,
///
/// BC6H RGB16F
///
BC6H,
///
/// BC7 RGB 4-7 bits per color channel, 0-8 bits alpha
///
BC7,
///
/// ETC1 RGB8
///
ETC1,
///
/// ETC2 RGB8
///
ETC2,
///
/// ETC2 RGBA8
///
ETC2A,
///
/// ETC2 RGB8A1
///
ETC2A1,
///
/// PVRTC1 RGB 2BPP
///
PTC12,
///
/// PVRTC1 RGB 4BPP
///
PTC14,
///
/// PVRTC1 RGBA 2BPP
///
PTC12A,
///
/// PVRTC1 RGBA 4BPP
///
PTC14A,
///
/// PVRTC2 RGBA 2BPP
///
PTC22,
///
/// PVRTC2 RGBA 4BPP
///
PTC24,
///
/// ATC RGB 4BPP
///
ATC,
///
/// ATCE RGBA 8 BPP explicit alpha
///
ATCE,
///
/// ATCI RGBA 8 BPP interpolated alpha
///
ATCI,
///
/// ASTC 4x4 8.0 BPP
///
ASTC4x4,
///
/// ASTC 5x5 5.12 BPP
///
ASTC5x5,
///
/// ASTC 6x6 3.56 BPP
///
ASTC6x6,
///
/// ASTC 8x5 3.20 BPP
///
ASTC8x5,
///
/// ASTC 8x6 2.67 BPP
///
ASTC8x6,
///
/// ASTC 10x5 2.56 BPP
///
ASTC10x5,
///
/// Compressed formats above.
///
Unknown,
R1,
A8,
R8,
R8I,
R8U,
R8S,
R16,
R16I,
R16U,
R16F,
R16S,
R32I,
R32U,
R32F,
RG8,
RG8I,
RG8U,
RG8S,
RG16,
RG16I,
RG16U,
RG16F,
RG16S,
RG32I,
RG32U,
RG32F,
RGB8,
RGB8I,
RGB8U,
RGB8S,
RGB9E5F,
BGRA8,
RGBA8,
RGBA8I,
RGBA8U,
RGBA8S,
RGBA16,
RGBA16I,
RGBA16U,
RGBA16F,
RGBA16S,
RGBA32I,
RGBA32U,
RGBA32F,
R5G6B5,
RGBA4,
RGB5A1,
RGB10A2,
RG11B10F,
///
/// Depth formats below.
///
UnknownDepth,
D16,
D24,
D24S8,
D32,
D16F,
D24F,
D32F,
D0S8,
Count
}
public enum UniformType
{
///
/// Sampler.
///
Sampler,
///
/// Reserved, do not use.
///
End,
///
/// 4 floats vector.
///
Vec4,
///
/// 3x3 matrix.
///
Mat3,
///
/// 4x4 matrix.
///
Mat4,
Count
}
public enum BackbufferRatio
{
///
/// Equal to backbuffer.
///
Equal,
///
/// One half size of backbuffer.
///
Half,
///
/// One quarter size of backbuffer.
///
Quarter,
///
/// One eighth size of backbuffer.
///
Eighth,
///
/// One sixteenth size of backbuffer.
///
Sixteenth,
///
/// Double size of backbuffer.
///
Double,
Count
}
public enum OcclusionQueryResult
{
///
/// Query failed test.
///
Invisible,
///
/// Query passed test.
///
Visible,
///
/// Query result is not available yet.
///
NoResult,
Count
}
public enum Topology
{
///
/// Triangle list.
///
TriList,
///
/// Triangle strip.
///
TriStrip,
///
/// Line list.
///
LineList,
///
/// Line strip.
///
LineStrip,
///
/// Point list.
///
PointList,
Count
}
public enum TopologyConvert
{
///
/// Flip winding order of triangle list.
///
TriListFlipWinding,
///
/// Flip winding order of trinagle strip.
///
TriStripFlipWinding,
///
/// Convert triangle list to line list.
///
TriListToLineList,
///
/// Convert triangle strip to triangle list.
///
TriStripToTriList,
///
/// Convert line strip to line list.
///
LineStripToLineList,
Count
}
public enum TopologySort
{
DirectionFrontToBackMin,
DirectionFrontToBackAvg,
DirectionFrontToBackMax,
DirectionBackToFrontMin,
DirectionBackToFrontAvg,
DirectionBackToFrontMax,
DistanceFrontToBackMin,
DistanceFrontToBackAvg,
DistanceFrontToBackMax,
DistanceBackToFrontMin,
DistanceBackToFrontAvg,
DistanceBackToFrontMax,
Count
}
public enum ViewMode
{
///
/// Default sort order.
///
Default,
///
/// Sort in the same order in which submit calls were called.
///
Sequential,
///
/// Sort draw call depth in ascending order.
///
DepthAscending,
///
/// Sort draw call depth in descending order.
///
DepthDescending,
Count
}
public enum RenderFrame
{
///
/// Renderer context is not created yet.
///
NoContext,
///
/// Renderer context is created and rendering.
///
Render,
///
/// Renderer context wait for main thread signal timed out without rendering.
///
Timeout,
///
/// Renderer context is getting destroyed.
///
Exiting,
Count
}
public unsafe struct Caps
{
public unsafe struct GPU
{
public ushort vendorId;
public ushort deviceId;
}
public unsafe struct Limits
{
public uint maxDrawCalls;
public uint maxBlits;
public uint maxTextureSize;
public uint maxTextureLayers;
public uint maxViews;
public uint maxFrameBuffers;
public uint maxFBAttachments;
public uint maxPrograms;
public uint maxShaders;
public uint maxTextures;
public uint maxTextureSamplers;
public uint maxComputeBindings;
public uint maxVertexDecls;
public uint maxVertexStreams;
public uint maxIndexBuffers;
public uint maxVertexBuffers;
public uint maxDynamicIndexBuffers;
public uint maxDynamicVertexBuffers;
public uint maxUniforms;
public uint maxOcclusionQueries;
public uint maxEncoders;
public uint transientVbSize;
public uint transientIbSize;
}
public RendererType rendererType;
public ulong supported;
public ushort vendorId;
public ushort deviceId;
public byte homogeneousDepth;
public byte originBottomLeft;
public byte numGPUs;
public fixed uint gpu[4];
public Limits limits;
public fixed ushort formats[85];
}
public unsafe struct InternalData
{
public Caps* caps;
public void* context;
}
public unsafe struct PlatformData
{
public void* ndt;
public void* nwh;
public void* context;
public void* backBuffer;
public void* backBufferDS;
}
public unsafe struct Resolution
{
public TextureFormat format;
public uint width;
public uint height;
public uint reset;
public byte numBackBuffers;
public byte maxFrameLatency;
}
public unsafe struct Init
{
public unsafe struct Limits
{
public ushort maxEncoders;
public uint transientVbSize;
public uint transientIbSize;
}
public RendererType type;
public ushort vendorId;
public ushort deviceId;
public byte debug;
public byte profile;
public PlatformData platformData;
public Resolution resolution;
public Limits limits;
public IntPtr callback;
public IntPtr allocator;
}
public unsafe struct Memory
{
public byte* data;
public uint size;
}
public unsafe struct TransientIndexBuffer
{
public byte* data;
public uint size;
public uint startIndex;
public IndexBufferHandle handle;
}
public unsafe struct TransientVertexBuffer
{
public byte* data;
public uint size;
public uint startVertex;
public ushort stride;
public VertexBufferHandle handle;
public VertexDeclHandle decl;
}
public unsafe struct InstanceDataBuffer
{
public byte* data;
public uint size;
public uint offset;
public uint num;
public ushort stride;
public VertexBufferHandle handle;
}
public unsafe struct TextureInfo
{
public TextureFormat format;
public uint storageSize;
public ushort width;
public ushort height;
public ushort depth;
public ushort numLayers;
public byte numMips;
public byte bitsPerPixel;
public byte cubeMap;
}
public unsafe struct UniformInfo
{
public fixed byte name[256];
public UniformType type;
public ushort num;
}
public unsafe struct Attachment
{
public Access access;
public TextureHandle handle;
public ushort mip;
public ushort layer;
public byte resolve;
}
public unsafe struct Transform
{
public float* data;
public ushort num;
}
public unsafe struct ViewStats
{
public fixed byte name[256];
public ushort view;
public long cpuTimeElapsed;
public long gpuTimeElapsed;
}
public unsafe struct EncoderStats
{
public long cpuTimeBegin;
public long cpuTimeEnd;
}
public unsafe struct Stats
{
public long cpuTimeFrame;
public long cpuTimeBegin;
public long cpuTimeEnd;
public long cpuTimerFreq;
public long gpuTimeBegin;
public long gpuTimeEnd;
public long gpuTimerFreq;
public long waitRender;
public long waitSubmit;
public uint numDraw;
public uint numCompute;
public uint numBlit;
public uint maxGpuLatency;
public ushort numDynamicIndexBuffers;
public ushort numDynamicVertexBuffers;
public ushort numFrameBuffers;
public ushort numIndexBuffers;
public ushort numOcclusionQueries;
public ushort numPrograms;
public ushort numShaders;
public ushort numTextures;
public ushort numUniforms;
public ushort numVertexBuffers;
public ushort numVertexDecls;
public long textureMemoryUsed;
public long rtMemoryUsed;
public int transientVbUsed;
public int transientIbUsed;
public fixed uint numPrims[5];
public long gpuMemoryMax;
public long gpuMemoryUsed;
public ushort width;
public ushort height;
public ushort textWidth;
public ushort textHeight;
public ushort numViews;
public ViewStats* viewStats;
public byte numEncoders;
public EncoderStats* encoderStats;
}
public unsafe struct VertexDecl
{
public uint hash;
public ushort stride;
public fixed ushort offset[18];
public fixed ushort attributes[18];
}
public unsafe struct Encoder
{
}
public struct DynamicIndexBufferHandle{ public ushort idx; }
public struct DynamicVertexBufferHandle{ public ushort idx; }
public struct FrameBufferHandle{ public ushort idx; }
public struct IndexBufferHandle{ public ushort idx; }
public struct IndirectBufferHandle{ public ushort idx; }
public struct OcclusionQueryHandle{ public ushort idx; }
public struct ProgramHandle{ public ushort idx; }
public struct ShaderHandle{ public ushort idx; }
public struct TextureHandle{ public ushort idx; }
public struct UniformHandle{ public ushort idx; }
public struct VertexBufferHandle{ public ushort idx; }
public struct VertexDeclHandle{ public ushort idx; }
///
/// Init attachment.
///
///
/// Render target texture handle.
/// Access. See `Access::Enum`.
/// Cubemap side or depth layer/slice.
/// Mip level.
/// Resolve flags. See: `BGFX_RESOLVE_*`
///
[DllImport(DllName, EntryPoint="bgfx_attachment_init", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void attachment_init(Attachment* _this, TextureHandle _handle, Access _access, ushort _layer, ushort _mip, byte _resolve);
///
/// Start VertexDecl.
///
///
[DllImport(DllName, EntryPoint="bgfx_vertex_decl_begin", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe VertexDecl* vertex_decl_begin(VertexDecl* _this, RendererType _rendererType);
///
/// Add attribute to VertexDecl.
/// @remarks Must be called between begin/end.
///
///
/// Attribute semantics. See: `bgfx::Attrib`
/// Number of elements 1, 2, 3 or 4.
/// Element type.
/// When using fixed point AttribType (f.e. Uint8) value will be normalized for vertex shader usage. When normalized is set to true, AttribType::Uint8 value in range 0-255 will be in range 0.0-1.0 in vertex shader.
/// Packaging rule for vertexPack, vertexUnpack, and vertexConvert for AttribType::Uint8 and AttribType::Int16. Unpacking code must be implemented inside vertex shader.
///
[DllImport(DllName, EntryPoint="bgfx_vertex_decl_add", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe VertexDecl* vertex_decl_add(VertexDecl* _this, Attrib _attrib, byte _num, AttribType _type, bool _normalized, bool _asInt);
///
/// Decode attribute.
///
///
/// Attribute semantics. See: `bgfx::Attrib`
/// Number of elements.
/// Element type.
/// Attribute is normalized.
/// Attribute is packed as int.
///
[DllImport(DllName, EntryPoint="bgfx_vertex_decl_decode", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void vertex_decl_decode(VertexDecl* _this, Attrib _attrib, byte * _num, AttribType* _type, bool* _normalized, bool* _asInt);
///
/// Returns true if VertexDecl contains attribute.
///
///
/// Attribute semantics. See: `bgfx::Attrib`
///
[DllImport(DllName, EntryPoint="bgfx_vertex_decl_has", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern unsafe bool vertex_decl_has(VertexDecl* _this, Attrib _attrib);
///
/// Skip `_num` bytes in vertex stream.
///
///
[DllImport(DllName, EntryPoint="bgfx_vertex_decl_skip", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe VertexDecl* vertex_decl_skip(VertexDecl* _this, byte _num);
///
/// End VertexDecl.
///
///
[DllImport(DllName, EntryPoint="bgfx_vertex_decl_end", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void vertex_decl_end(VertexDecl* _this);
///
/// Pack vertex attribute into vertex stream format.
///
///
/// Value to be packed into vertex stream.
/// `true` if input value is already normalized.
/// Attribute to pack.
/// Vertex stream declaration.
/// Destination vertex stream where data will be packed.
/// Vertex index that will be modified.
///
[DllImport(DllName, EntryPoint="bgfx_vertex_pack", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void vertex_pack(float _input, bool _inputNormalized, Attrib _attr, VertexDecl* _decl, void* _data, uint _index);
///
/// Unpack vertex attribute from vertex stream format.
///
///
/// Result of unpacking.
/// Attribute to unpack.
/// Vertex stream declaration.
/// Source vertex stream from where data will be unpacked.
/// Vertex index that will be unpacked.
///
[DllImport(DllName, EntryPoint="bgfx_vertex_unpack", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void vertex_unpack(float _output, Attrib _attr, VertexDecl* _decl, void* _data, uint _index);
///
/// Converts vertex stream data from one vertex stream format to another.
///
///
/// Destination vertex stream declaration.
/// Destination vertex stream.
/// Source vertex stream declaration.
/// Source vertex stream data.
/// Number of vertices to convert from source to destination.
///
[DllImport(DllName, EntryPoint="bgfx_vertex_convert", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void vertex_convert(VertexDecl* _dstDecl, void* _dstData, VertexDecl* _srcDecl, void* _srcData, uint _num);
///
/// Weld vertices.
///
///
/// Welded vertices remapping table. The size of buffer must be the same as number of vertices.
/// Vertex stream declaration.
/// Vertex stream.
/// Number of vertices in vertex stream.
/// Error tolerance for vertex position comparison.
///
[DllImport(DllName, EntryPoint="bgfx_weld_vertices", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe ushort weld_vertices(ushort* _output, VertexDecl* _decl, void* _data, ushort _num, float _epsilon);
///
/// Convert index buffer for use with different primitive topologies.
///
///
/// Conversion type, see `TopologyConvert::Enum`.
/// Destination index buffer. If this argument is NULL function will return number of indices after conversion.
/// Destination index buffer in bytes. It must be large enough to contain output indices. If destination size is insufficient index buffer will be truncated.
/// Source indices.
/// Number of input indices.
/// Set to `true` if input indices are 32-bit.
///
[DllImport(DllName, EntryPoint="bgfx_topology_convert", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe uint topology_convert(TopologyConvert _conversion, void* _dst, uint _dstSize, void* _indices, uint _numIndices, bool _index32);
///
/// Sort indices.
///
///
/// Sort order, see `TopologySort::Enum`.
/// Destination index buffer.
/// Destination index buffer in bytes. It must be large enough to contain output indices. If destination size is insufficient index buffer will be truncated.
/// Direction (vector must be normalized).
/// Position.
/// Pointer to first vertex represented as float x, y, z. Must contain at least number of vertices referencende by index buffer.
/// Vertex stride.
/// Source indices.
/// Number of input indices.
/// Set to `true` if input indices are 32-bit.
///
[DllImport(DllName, EntryPoint="bgfx_topology_sort_tri_list", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void topology_sort_tri_list(TopologySort _sort, void* _dst, uint _dstSize, float _dir, float _pos, void* _vertices, uint _stride, void* _indices, uint _numIndices, bool _index32);
///
/// Returns supported backend API renderers.
///
///
/// Maximum number of elements in _enum array.
/// Array where supported renderers will be written.
///
[DllImport(DllName, EntryPoint="bgfx_get_supported_renderers", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe byte get_supported_renderers(byte _max, RendererType* _enum);
///
/// Returns name of renderer.
///
///
/// Renderer backend type. See: `bgfx::RendererType`
///
[DllImport(DllName, EntryPoint="bgfx_get_renderer_name", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe IntPtr get_renderer_name(RendererType _type);
[DllImport(DllName, EntryPoint="bgfx_init_ctor", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void init_ctor(Init* _init);
///
/// Initialize bgfx library.
///
///
/// Initialization parameters. See: `bgfx::Init` for more info.
///
[DllImport(DllName, EntryPoint="bgfx_init", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern unsafe bool init(Init* _init);
///
/// Shutdown bgfx library.
///
///
[DllImport(DllName, EntryPoint="bgfx_shutdown", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void shutdown();
///
/// Reset graphic settings and back-buffer size.
/// @attention This call doesn't actually change window size, it just
/// resizes back-buffer. Windowing code has to change window size.
///
///
/// Back-buffer width.
/// Back-buffer height.
/// 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 behavior is that flip occurs before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`. - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB backbuffer.
/// Texture format. See: `TextureFormat::Enum`.
///
[DllImport(DllName, EntryPoint="bgfx_reset", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void reset(uint _width, uint _height, uint _flags, TextureFormat _format);
///
/// Advance to next frame. When using multithreaded renderer, this call
/// just swaps internal buffers, kicks render thread, and returns. In
/// singlethreaded renderer this call does frame rendering.
///
///
/// Capture frame with graphics debugger.
///
[DllImport(DllName, EntryPoint="bgfx_frame", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe uint frame(bool _capture);
///
/// Returns current renderer backend API type.
/// @remarks
/// Library must be initialized.
///
///
[DllImport(DllName, EntryPoint="bgfx_get_renderer_type", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe RendererType get_renderer_type();
///
/// Returns renderer capabilities.
/// @remarks
/// Library must be initialized.
///
///
[DllImport(DllName, EntryPoint="bgfx_get_caps", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe Caps* get_caps();
///
/// Returns performance counters.
/// @attention Pointer returned is valid until `bgfx::frame` is called.
///
///
[DllImport(DllName, EntryPoint="bgfx_get_stats", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe Stats* get_stats();
///
/// Allocate buffer to pass to bgfx calls. Data will be freed inside bgfx.
///
///
/// Size to allocate.
///
[DllImport(DllName, EntryPoint="bgfx_alloc", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe Memory* alloc(uint _size);
///
/// Allocate buffer and copy data into it. Data will be freed inside bgfx.
///
///
/// Pointer to data to be copied.
/// Size of data to be copied.
///
[DllImport(DllName, EntryPoint="bgfx_copy", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe Memory* copy(void* _data, uint _size);
///
/// Make reference to data to pass to bgfx. Unlike `bgfx::alloc`, this call
/// doesn't allocate memory for data. It just copies the _data pointer. You
/// can pass `ReleaseFn` function pointer to release this memory after it's
/// consumed, otherwise you must make sure _data is available for at least 2
/// `bgfx::frame` calls. `ReleaseFn` function must be able to be called
/// from any thread.
/// @attention Data passed must be available for at least 2 `bgfx::frame` calls.
///
///
/// Pointer to data.
/// Size of data.
///
[DllImport(DllName, EntryPoint="bgfx_make_ref", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe Memory* make_ref(void* _data, uint _size);
///
/// Make reference to data to pass to bgfx. Unlike `bgfx::alloc`, this call
/// doesn't allocate memory for data. It just copies the _data pointer. You
/// can pass `ReleaseFn` function pointer to release this memory after it's
/// consumed, otherwise you must make sure _data is available for at least 2
/// `bgfx::frame` calls. `ReleaseFn` function must be able to be called
/// from any thread.
/// @attention Data passed must be available for at least 2 `bgfx::frame` calls.
///
///
/// Pointer to data.
/// Size of data.
/// Callback function to release memory after use.
/// User data to be passed to callback function.
///
[DllImport(DllName, EntryPoint="bgfx_make_ref_release", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe Memory* make_ref_release(void* _data, uint _size, IntPtr _releaseFn, void* _userData);
///
/// Set debug flags.
///
///
/// Available flags: - `BGFX_DEBUG_IFH` - Infinitely fast hardware. When this flag is set all rendering calls will be skipped. This is useful when profiling to quickly assess potential bottlenecks between CPU and GPU. - `BGFX_DEBUG_PROFILER` - Enable profiler. - `BGFX_DEBUG_STATS` - Display internal statistics. - `BGFX_DEBUG_TEXT` - Display debug text. - `BGFX_DEBUG_WIREFRAME` - Wireframe rendering. All rendering primitives will be rendered as lines.
///
[DllImport(DllName, EntryPoint="bgfx_set_debug", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_debug(uint _debug);
///
/// Clear internal debug text buffer.
///
///
/// Background color.
/// Default 8x16 or 8x8 font.
///
[DllImport(DllName, EntryPoint="bgfx_dbg_text_clear", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void dbg_text_clear(byte _attr, bool _small);
///
/// Print formatted data to internal debug text character-buffer (VGA-compatible text mode).
///
///
/// Position x from the left corner of the window.
/// Position y from the top corner of the window.
/// Color palette. Where top 4-bits represent index of background, and bottom 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).
/// `printf` style format.
///
[DllImport(DllName, EntryPoint="bgfx_dbg_text_printf", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void dbg_text_printf(ushort _x, ushort _y, byte _attr, [MarshalAs(UnmanagedType.LPStr)] string _format, [MarshalAs(UnmanagedType.LPStr)] string args );
///
/// Print formatted data from variable argument list to internal debug text character-buffer (VGA-compatible text mode).
///
///
/// Position x from the left corner of the window.
/// Position y from the top corner of the window.
/// Color palette. Where top 4-bits represent index of background, and bottom 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).
/// `printf` style format.
/// Variable arguments list for format string.
///
[DllImport(DllName, EntryPoint="bgfx_dbg_text_vprintf", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void dbg_text_vprintf(ushort _x, ushort _y, byte _attr, [MarshalAs(UnmanagedType.LPStr)] string _format, IntPtr _argList);
///
/// Draw image into internal debug text buffer.
///
///
/// Position x from the left corner of the window.
/// Position y from the top corner of the window.
/// Image width.
/// Image height.
/// Raw image data (character/attribute raw encoding).
/// Image pitch in bytes.
///
[DllImport(DllName, EntryPoint="bgfx_dbg_text_image", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void dbg_text_image(ushort _x, ushort _y, ushort _width, ushort _height, void* _data, ushort _pitch);
///
/// Create static index buffer.
///
///
/// Index buffer data.
/// Buffer creation flags. - `BGFX_BUFFER_NONE` - No flags. - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of data is passed. If this flag is not specified, and more data is passed on update, the buffer will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers. - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.
///
[DllImport(DllName, EntryPoint="bgfx_create_index_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe IndexBufferHandle create_index_buffer(Memory* _mem, ushort _flags);
///
/// Set static index buffer debug name.
///
///
/// Static index buffer handle.
/// Static index buffer name.
/// Static index buffer name length (if length is INT32_MAX, it's expected that _name is zero terminated string.
///
[DllImport(DllName, EntryPoint="bgfx_set_index_buffer_name", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_index_buffer_name(IndexBufferHandle _handle, [MarshalAs(UnmanagedType.LPStr)] string _name, int _len);
///
/// Destroy static index buffer.
///
///
/// Static index buffer handle.
///
[DllImport(DllName, EntryPoint="bgfx_destroy_index_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void destroy_index_buffer(IndexBufferHandle _handle);
///
/// Create vertex declaration.
///
///
/// Vertex declaration.
///
[DllImport(DllName, EntryPoint="bgfx_create_vertex_decl", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe VertexDeclHandle create_vertex_decl(VertexDecl* _decl);
///
/// Destroy vertex declaration.
///
///
/// Vertex declaration handle.
///
[DllImport(DllName, EntryPoint="bgfx_destroy_vertex_decl", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void destroy_vertex_decl(VertexDeclHandle _handle);
///
/// Create static vertex buffer.
///
///
/// Vertex buffer data.
/// Vertex declaration.
/// Buffer creation flags. - `BGFX_BUFFER_NONE` - No flags. - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of data is passed. If this flag is not specified, and more data is passed on update, the buffer will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers. - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.
///
[DllImport(DllName, EntryPoint="bgfx_create_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe VertexBufferHandle create_vertex_buffer(Memory* _mem, VertexDecl* _decl, ushort _flags);
///
/// Set static vertex buffer debug name.
///
///
/// Static vertex buffer handle.
/// Static vertex buffer name.
/// Static vertex buffer name length (if length is INT32_MAX, it's expected that _name is zero terminated string.
///
[DllImport(DllName, EntryPoint="bgfx_set_vertex_buffer_name", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_vertex_buffer_name(VertexBufferHandle _handle, [MarshalAs(UnmanagedType.LPStr)] string _name, int _len);
///
/// Destroy static vertex buffer.
///
///
/// Static vertex buffer handle.
///
[DllImport(DllName, EntryPoint="bgfx_destroy_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void destroy_vertex_buffer(VertexBufferHandle _handle);
///
/// Create empty dynamic index buffer.
///
///
/// Number of indices.
/// Buffer creation flags. - `BGFX_BUFFER_NONE` - No flags. - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of data is passed. If this flag is not specified, and more data is passed on update, the buffer will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers. - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.
///
[DllImport(DllName, EntryPoint="bgfx_create_dynamic_index_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe DynamicIndexBufferHandle create_dynamic_index_buffer(uint _num, ushort _flags);
///
/// Create dynamic index buffer and initialized it.
///
///
/// Index buffer data.
/// Buffer creation flags. - `BGFX_BUFFER_NONE` - No flags. - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of data is passed. If this flag is not specified, and more data is passed on update, the buffer will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers. - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.
///
[DllImport(DllName, EntryPoint="bgfx_create_dynamic_index_buffer_mem", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe DynamicIndexBufferHandle create_dynamic_index_buffer_mem(Memory* _mem, ushort _flags);
///
/// Update dynamic index buffer.
///
///
/// Dynamic index buffer handle.
/// Start index.
/// Index buffer data.
///
[DllImport(DllName, EntryPoint="bgfx_update_dynamic_index_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void update_dynamic_index_buffer(DynamicIndexBufferHandle _handle, uint _startIndex, Memory* _mem);
///
/// Destroy dynamic index buffer.
///
///
/// Dynamic index buffer handle.
///
[DllImport(DllName, EntryPoint="bgfx_destroy_dynamic_index_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void destroy_dynamic_index_buffer(DynamicIndexBufferHandle _handle);
///
/// Create empty dynamic vertex buffer.
///
///
/// Number of vertices.
/// Vertex declaration.
/// Buffer creation flags. - `BGFX_BUFFER_NONE` - No flags. - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of data is passed. If this flag is not specified, and more data is passed on update, the buffer will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers. - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.
///
[DllImport(DllName, EntryPoint="bgfx_create_dynamic_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe DynamicVertexBufferHandle create_dynamic_vertex_buffer(uint _num, VertexDecl* _decl, ushort _flags);
///
/// Create dynamic vertex buffer and initialize it.
///
///
/// Vertex buffer data.
/// Vertex declaration.
/// Buffer creation flags. - `BGFX_BUFFER_NONE` - No flags. - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of data is passed. If this flag is not specified, and more data is passed on update, the buffer will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers. - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.
///
[DllImport(DllName, EntryPoint="bgfx_create_dynamic_vertex_buffer_mem", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe DynamicVertexBufferHandle create_dynamic_vertex_buffer_mem(Memory* _mem, VertexDecl* _decl, ushort _flags);
///
/// Update dynamic vertex buffer.
///
///
/// Dynamic vertex buffer handle.
/// Start vertex.
/// Vertex buffer data.
///
[DllImport(DllName, EntryPoint="bgfx_update_dynamic_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void update_dynamic_vertex_buffer(DynamicVertexBufferHandle _handle, uint _startVertex, Memory* _mem);
///
/// Destroy dynamic vertex buffer.
///
///
/// Dynamic vertex buffer handle.
///
[DllImport(DllName, EntryPoint="bgfx_destroy_dynamic_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void destroy_dynamic_vertex_buffer(DynamicVertexBufferHandle _handle);
///
/// Returns number of requested or maximum available indices.
///
///
/// Number of required indices.
///
[DllImport(DllName, EntryPoint="bgfx_get_avail_transient_index_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe uint get_avail_transient_index_buffer(uint _num);
///
/// Returns number of requested or maximum available vertices.
///
///
/// Number of required vertices.
/// Vertex declaration.
///
[DllImport(DllName, EntryPoint="bgfx_get_avail_transient_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe uint get_avail_transient_vertex_buffer(uint _num, VertexDecl* _decl);
///
/// Returns number of requested or maximum available instance buffer slots.
///
///
/// Number of required instances.
/// Stride per instance.
///
[DllImport(DllName, EntryPoint="bgfx_get_avail_instance_data_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe uint get_avail_instance_data_buffer(uint _num, ushort _stride);
///
/// Allocate transient index buffer.
/// @remarks
/// Only 16-bit index buffer is supported.
///
///
/// TransientIndexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.
/// Number of indices to allocate.
///
[DllImport(DllName, EntryPoint="bgfx_alloc_transient_index_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void alloc_transient_index_buffer(TransientIndexBuffer* _tib, uint _num);
///
/// Allocate transient vertex buffer.
///
///
/// TransientVertexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.
/// Number of vertices to allocate.
/// Vertex declaration.
///
[DllImport(DllName, EntryPoint="bgfx_alloc_transient_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void alloc_transient_vertex_buffer(TransientVertexBuffer* _tvb, uint _num, VertexDecl* _decl);
///
/// Check for required space and allocate transient vertex and index
/// buffers. If both space requirements are satisfied function returns
/// true.
/// @remarks
/// Only 16-bit index buffer is supported.
///
///
/// TransientVertexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.
/// Number of vertices to allocate.
/// Vertex declaration.
/// TransientIndexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.
/// Number of indices to allocate.
///
[DllImport(DllName, EntryPoint="bgfx_alloc_transient_buffers", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern unsafe bool alloc_transient_buffers(TransientVertexBuffer* _tvb, VertexDecl* _decl, uint _numVertices, TransientIndexBuffer* _tib, uint _numIndices);
///
/// Allocate instance data buffer.
///
///
/// InstanceDataBuffer structure is filled and is valid for duration of frame, and it can be reused for multiple draw calls.
/// Number of instances.
/// Instance stride. Must be multiple of 16.
///
[DllImport(DllName, EntryPoint="bgfx_alloc_instance_data_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void alloc_instance_data_buffer(InstanceDataBuffer* _idb, uint _num, ushort _stride);
///
/// Create draw indirect buffer.
///
///
/// Number of indirect calls.
///
[DllImport(DllName, EntryPoint="bgfx_create_indirect_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe IndirectBufferHandle create_indirect_buffer(uint _num);
///
/// Destroy draw indirect buffer.
///
///
/// Indirect buffer handle.
///
[DllImport(DllName, EntryPoint="bgfx_destroy_indirect_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void destroy_indirect_buffer(IndirectBufferHandle _handle);
///
/// Create shader from memory buffer.
///
///
/// Shader binary.
///
[DllImport(DllName, EntryPoint="bgfx_create_shader", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe ShaderHandle create_shader(Memory* _mem);
///
/// Returns the number of uniforms and uniform handles used inside a shader.
/// @remarks
/// Only non-predefined uniforms are returned.
///
///
/// Shader handle.
/// UniformHandle array where data will be stored.
/// Maximum capacity of array.
///
[DllImport(DllName, EntryPoint="bgfx_get_shader_uniforms", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe ushort get_shader_uniforms(ShaderHandle _handle, UniformHandle* _uniforms, ushort _max);
///
/// Set shader debug name.
///
///
/// Shader handle.
/// Shader name.
/// Shader name length (if length is INT32_MAX, it's expected that _name is zero terminated string).
///
[DllImport(DllName, EntryPoint="bgfx_set_shader_name", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_shader_name(ShaderHandle _handle, [MarshalAs(UnmanagedType.LPStr)] string _name, int _len);
///
/// Destroy shader.
/// @remark Once a shader program is created with _handle,
/// it is safe to destroy that shader.
///
///
/// Shader handle.
///
[DllImport(DllName, EntryPoint="bgfx_destroy_shader", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void destroy_shader(ShaderHandle _handle);
///
/// Create program with vertex and fragment shaders.
///
///
/// Vertex shader.
/// Fragment shader.
/// If true, shaders will be destroyed when program is destroyed.
///
[DllImport(DllName, EntryPoint="bgfx_create_program", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe ProgramHandle create_program(ShaderHandle _vsh, ShaderHandle _fsh, bool _destroyShaders);
///
/// Create program with compute shader.
///
///
/// Compute shader.
/// If true, shaders will be destroyed when program is destroyed.
///
[DllImport(DllName, EntryPoint="bgfx_create_compute_program", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe ProgramHandle create_compute_program(ShaderHandle _csh, bool _destroyShaders);
///
/// Destroy program.
///
///
/// Program handle.
///
[DllImport(DllName, EntryPoint="bgfx_destroy_program", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void destroy_program(ProgramHandle _handle);
///
/// Validate texture parameters.
///
///
/// Depth dimension of volume texture.
/// Indicates that texture contains cubemap.
/// Number of layers in texture array.
/// Texture format. See: `TextureFormat::Enum`.
/// Texture flags. See `BGFX_TEXTURE_*`.
///
[DllImport(DllName, EntryPoint="bgfx_is_texture_valid", CallingConvention = CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
public static extern unsafe bool is_texture_valid(ushort _depth, bool _cubeMap, ushort _numLayers, TextureFormat _format, ulong _flags);
///
/// Calculate amount of memory required for texture.
///
///
/// Resulting texture info structure. See: `TextureInfo`.
/// Width.
/// Height.
/// Depth dimension of volume texture.
/// Indicates that texture contains cubemap.
/// Indicates that texture contains full mip-map chain.
/// Number of layers in texture array.
/// Texture format. See: `TextureFormat::Enum`.
///
[DllImport(DllName, EntryPoint="bgfx_calc_texture_size", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void calc_texture_size(TextureInfo* _info, ushort _width, ushort _height, ushort _depth, bool _cubeMap, bool _hasMips, ushort _numLayers, TextureFormat _format);
///
/// Create texture from memory buffer.
///
///
/// DDS, KTX or PVR texture binary data.
/// Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.
/// Skip top level mips when parsing texture.
/// When non-`NULL` is specified it returns parsed texture information.
///
[DllImport(DllName, EntryPoint="bgfx_create_texture", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe TextureHandle create_texture(Memory* _mem, ulong _flags, byte _skip, TextureInfo* _info);
///
/// Create 2D texture.
///
///
/// Width.
/// Height.
/// Indicates that texture contains full mip-map chain.
/// Number of layers in texture array. Must be 1 if caps `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.
/// Texture format. See: `TextureFormat::Enum`.
/// Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.
/// Texture data. If `_mem` is non-NULL, created texture will be immutable. If `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than 1, expected memory layout is texture and all mips together for each array element.
///
[DllImport(DllName, EntryPoint="bgfx_create_texture_2d", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe TextureHandle create_texture_2d(ushort _width, ushort _height, bool _hasMips, ushort _numLayers, TextureFormat _format, ulong _flags, Memory* _mem);
///
/// Create texture with size based on backbuffer ratio. Texture will maintain ratio
/// if back buffer resolution changes.
///
///
/// Texture size in respect to back-buffer size. See: `BackbufferRatio::Enum`.
/// Indicates that texture contains full mip-map chain.
/// Number of layers in texture array. Must be 1 if caps `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.
/// Texture format. See: `TextureFormat::Enum`.
/// Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.
///
[DllImport(DllName, EntryPoint="bgfx_create_texture_2d_scaled", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe TextureHandle create_texture_2d_scaled(BackbufferRatio _ratio, bool _hasMips, ushort _numLayers, TextureFormat _format, ulong _flags);
///
/// Create 3D texture.
///
///
/// Width.
/// Height.
/// Depth.
/// Indicates that texture contains full mip-map chain.
/// Texture format. See: `TextureFormat::Enum`.
/// Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.
/// Texture data. If `_mem` is non-NULL, created texture will be immutable. If `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than 1, expected memory layout is texture and all mips together for each array element.
///
[DllImport(DllName, EntryPoint="bgfx_create_texture_3d", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe TextureHandle create_texture_3d(ushort _width, ushort _height, ushort _depth, bool _hasMips, TextureFormat _format, ulong _flags, Memory* _mem);
///
/// Create Cube texture.
///
///
/// Cube side size.
/// Indicates that texture contains full mip-map chain.
/// Number of layers in texture array. Must be 1 if caps `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.
/// Texture format. See: `TextureFormat::Enum`.
/// Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.
/// Texture data. If `_mem` is non-NULL, created texture will be immutable. If `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than 1, expected memory layout is texture and all mips together for each array element.
///
[DllImport(DllName, EntryPoint="bgfx_create_texture_cube", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe TextureHandle create_texture_cube(ushort _size, bool _hasMips, ushort _numLayers, TextureFormat _format, ulong _flags, Memory* _mem);
///
/// Update 2D texture.
/// @attention It's valid to update only mutable texture. See `bgfx::createTexture2D` for more info.
///
///
/// Texture handle.
/// Layer in texture array.
/// Mip level.
/// X offset in texture.
/// Y offset in texture.
/// Width of texture block.
/// Height of texture block.
/// Texture update data.
/// Pitch of input image (bytes). When _pitch is set to UINT16_MAX, it will be calculated internally based on _width.
///
[DllImport(DllName, EntryPoint="bgfx_update_texture_2d", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void update_texture_2d(TextureHandle _handle, ushort _layer, byte _mip, ushort _x, ushort _y, ushort _width, ushort _height, Memory* _mem, ushort _pitch);
///
/// Update 3D texture.
/// @attention It's valid to update only mutable texture. See `bgfx::createTexture3D` for more info.
///
///
/// Texture handle.
/// Mip level.
/// X offset in texture.
/// Y offset in texture.
/// Z offset in texture.
/// Width of texture block.
/// Height of texture block.
/// Depth of texture block.
/// Texture update data.
///
[DllImport(DllName, EntryPoint="bgfx_update_texture_3d", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void update_texture_3d(TextureHandle _handle, byte _mip, ushort _x, ushort _y, ushort _z, ushort _width, ushort _height, ushort _depth, Memory* _mem);
///
/// Update Cube texture.
/// @attention It's valid to update only mutable texture. See `bgfx::createTextureCube` for more info.
///
///
/// Texture handle.
/// Layer in texture array.
/// Cubemap side `BGFX_CUBE_MAP__`, 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 | +----------+
/// Mip level.
/// X offset in texture.
/// Y offset in texture.
/// Width of texture block.
/// Height of texture block.
/// Texture update data.
/// Pitch of input image (bytes). When _pitch is set to UINT16_MAX, it will be calculated internally based on _width.
///
[DllImport(DllName, EntryPoint="bgfx_update_texture_cube", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void update_texture_cube(TextureHandle _handle, ushort _layer, byte _side, byte _mip, ushort _x, ushort _y, ushort _width, ushort _height, Memory* _mem, ushort _pitch);
///
/// Read back texture content.
/// @attention Texture must be created with `BGFX_TEXTURE_READ_BACK` flag.
/// @attention Availability depends on: `BGFX_CAPS_TEXTURE_READ_BACK`.
///
///
/// Texture handle.
/// Destination buffer.
/// Mip level.
///
[DllImport(DllName, EntryPoint="bgfx_read_texture", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe uint read_texture(TextureHandle _handle, void* _data, byte _mip);
///
/// Set texture debug name.
///
///
/// Texture handle.
/// Texture name.
/// Texture name length (if length is INT32_MAX, it's expected that _name is zero terminated string.
///
[DllImport(DllName, EntryPoint="bgfx_set_texture_name", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_texture_name(TextureHandle _handle, [MarshalAs(UnmanagedType.LPStr)] string _name, int _len);
///
/// 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.
///
///
/// Texture handle.
///
[DllImport(DllName, EntryPoint="bgfx_get_direct_access_ptr", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void* get_direct_access_ptr(TextureHandle _handle);
///
/// Destroy texture.
///
///
/// Texture handle.
///
[DllImport(DllName, EntryPoint="bgfx_destroy_texture", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void destroy_texture(TextureHandle _handle);
///
/// Create frame buffer (simple).
///
///
/// Texture width.
/// Texture height.
/// Texture format. See: `TextureFormat::Enum`.
/// Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.
///
[DllImport(DllName, EntryPoint="bgfx_create_frame_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe FrameBufferHandle create_frame_buffer(ushort _width, ushort _height, TextureFormat _format, ulong _textureFlags);
///
/// Create frame buffer with size based on backbuffer ratio. Frame buffer will maintain ratio
/// if back buffer resolution changes.
///
///
/// Frame buffer size in respect to back-buffer size. See: `BackbufferRatio::Enum`.
/// Texture format. See: `TextureFormat::Enum`.
/// Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.
///
[DllImport(DllName, EntryPoint="bgfx_create_frame_buffer_scaled", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe FrameBufferHandle create_frame_buffer_scaled(BackbufferRatio _ratio, TextureFormat _format, ulong _textureFlags);
///
/// Create MRT frame buffer from texture handles (simple).
///
///
/// Number of texture handles.
/// Texture attachments.
/// If true, textures will be destroyed when frame buffer is destroyed.
///
[DllImport(DllName, EntryPoint="bgfx_create_frame_buffer_from_handles", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe FrameBufferHandle create_frame_buffer_from_handles(byte _num, TextureHandle* _handles, bool _destroyTexture);
///
/// Create MRT frame buffer from texture handles with specific layer and
/// mip level.
///
///
/// Number of attachements.
/// Attachment texture info. See: `bgfx::Attachment`.
/// If true, textures will be destroyed when frame buffer is destroyed.
///
[DllImport(DllName, EntryPoint="bgfx_create_frame_buffer_from_attachment", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe FrameBufferHandle create_frame_buffer_from_attachment(byte _num, Attachment* _attachment, bool _destroyTexture);
///
/// Create frame buffer for multiple window rendering.
/// @remarks
/// Frame buffer cannot be used for sampling.
/// @attention Availability depends on: `BGFX_CAPS_SWAP_CHAIN`.
///
///
/// OS' target native window handle.
/// Window back buffer width.
/// Window back buffer height.
/// Window back buffer color format.
/// Window back buffer depth format.
///
[DllImport(DllName, EntryPoint="bgfx_create_frame_buffer_from_nwh", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe FrameBufferHandle create_frame_buffer_from_nwh(void* _nwh, ushort _width, ushort _height, TextureFormat _format, TextureFormat _depthFormat);
///
/// Set frame buffer debug name.
///
///
/// Frame buffer handle.
/// Frame buffer name.
/// Frame buffer name length (if length is INT32_MAX, it's expected that _name is zero terminated string.
///
[DllImport(DllName, EntryPoint="bgfx_set_frame_buffer_name", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_frame_buffer_name(FrameBufferHandle _handle, [MarshalAs(UnmanagedType.LPStr)] string _name, int _len);
///
/// Obtain texture handle of frame buffer attachment.
///
///
/// Frame buffer handle.
///
[DllImport(DllName, EntryPoint="bgfx_get_texture", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe TextureHandle get_texture(FrameBufferHandle _handle, byte _attachment);
///
/// Destroy frame buffer.
///
///
/// Frame buffer handle.
///
[DllImport(DllName, EntryPoint="bgfx_destroy_frame_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void destroy_frame_buffer(FrameBufferHandle _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.
/// - `u_viewTexel vec4(1.0/width, 1.0/height, undef, undef)` - inverse
/// width and height
/// - `u_view mat4` - view matrix
/// - `u_invView mat4` - inverted view matrix
/// - `u_proj mat4` - projection matrix
/// - `u_invProj mat4` - inverted projection matrix
/// - `u_viewProj mat4` - concatenated view projection matrix
/// - `u_invViewProj mat4` - concatenated inverted view projection matrix
/// - `u_model mat4[BGFX_CONFIG_MAX_BONES]` - array of model matrices.
/// - `u_modelView mat4` - concatenated model view matrix, only first
/// model matrix from array is used.
/// - `u_modelViewProj mat4` - concatenated model view projection matrix.
/// - `u_alphaRef float` - alpha reference value for alpha test.
///
///
/// Uniform name in shader.
/// Type of uniform (See: `bgfx::UniformType`).
/// Number of elements in array.
///
[DllImport(DllName, EntryPoint="bgfx_create_uniform", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe UniformHandle create_uniform([MarshalAs(UnmanagedType.LPStr)] string _name, UniformType _type, ushort _num);
///
/// Retrieve uniform info.
///
///
/// Handle to uniform object.
/// Uniform info.
///
[DllImport(DllName, EntryPoint="bgfx_get_uniform_info", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void get_uniform_info(UniformHandle _handle, UniformInfo* _info);
///
/// Destroy shader uniform parameter.
///
///
/// Handle to uniform object.
///
[DllImport(DllName, EntryPoint="bgfx_destroy_uniform", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void destroy_uniform(UniformHandle _handle);
///
/// Create occlusion query.
///
///
[DllImport(DllName, EntryPoint="bgfx_create_occlusion_query", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe OcclusionQueryHandle create_occlusion_query();
///
/// Retrieve occlusion query result from previous frame.
///
///
/// Handle to occlusion query object.
/// Number of pixels that passed test. This argument can be `NULL` if result of occlusion query is not needed.
///
[DllImport(DllName, EntryPoint="bgfx_get_result", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe OcclusionQueryResult get_result(OcclusionQueryHandle _handle, int* _result);
///
/// Destroy occlusion query.
///
///
/// Handle to occlusion query object.
///
[DllImport(DllName, EntryPoint="bgfx_destroy_occlusion_query", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void destroy_occlusion_query(OcclusionQueryHandle _handle);
///
/// Set palette color value.
///
///
/// Index into palette.
/// RGBA floating point values.
///
[DllImport(DllName, EntryPoint="bgfx_set_palette_color", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_palette_color(byte _index, float _rgba);
///
/// Set palette color value.
///
///
/// Index into palette.
/// Packed 32-bit RGBA value.
///
[DllImport(DllName, EntryPoint="bgfx_set_palette_color_rgba8", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_palette_color_rgba8(byte _index, uint _rgba);
///
/// Set view name.
/// @remarks
/// This is debug only feature.
/// In graphics debugger view name will appear as:
/// "nnnc "
/// ^ ^ ^
/// | +--- compute (C)
/// +------ view id
///
///
/// View id.
/// View name.
///
[DllImport(DllName, EntryPoint="bgfx_set_view_name", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_view_name(ushort _id, [MarshalAs(UnmanagedType.LPStr)] string _name);
///
/// Set view rectangle. Draw primitive outside view will be clipped.
///
///
/// View id.
/// Position x from the left corner of the window.
/// Position y from the top corner of the window.
/// Width of view port region.
/// Height of view port region.
///
[DllImport(DllName, EntryPoint="bgfx_set_view_rect", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_view_rect(ushort _id, ushort _x, ushort _y, ushort _width, ushort _height);
///
/// Set view rectangle. Draw primitive outside view will be clipped.
///
///
/// View id.
/// Position x from the left corner of the window.
/// Position y from the top corner of the window.
/// Width and height will be set in respect to back-buffer size. See: `BackbufferRatio::Enum`.
///
[DllImport(DllName, EntryPoint="bgfx_set_view_rect_ratio", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_view_rect_ratio(ushort _id, ushort _x, ushort _y, BackbufferRatio _ratio);
///
/// Set view scissor. Draw primitive outside view will be clipped. When
/// _x, _y, _width and _height are set to 0, scissor will be disabled.
///
///
/// View id.
/// Position x from the left corner of the window.
/// Position y from the top corner of the window.
/// Width of view scissor region.
/// Height of view scissor region.
///
[DllImport(DllName, EntryPoint="bgfx_set_view_scissor", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_view_scissor(ushort _id, ushort _x, ushort _y, ushort _width, ushort _height);
///
/// Set view clear flags.
///
///
/// View id.
/// Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear operation. See: `BGFX_CLEAR_*`.
/// Color clear value.
/// Depth clear value.
/// Stencil clear value.
///
[DllImport(DllName, EntryPoint="bgfx_set_view_clear", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_view_clear(ushort _id, ushort _flags, uint _rgba, float _depth, byte _stencil);
///
/// Set view clear flags with different clear color for each
/// frame buffer texture. Must use `bgfx::setPaletteColor` to setup clear color
/// palette.
///
///
/// View id.
/// Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear operation. See: `BGFX_CLEAR_*`.
/// Depth clear value.
/// Stencil clear value.
/// Palette index for frame buffer attachment 0.
/// Palette index for frame buffer attachment 1.
/// Palette index for frame buffer attachment 2.
/// Palette index for frame buffer attachment 3.
/// Palette index for frame buffer attachment 4.
/// Palette index for frame buffer attachment 5.
/// Palette index for frame buffer attachment 6.
/// Palette index for frame buffer attachment 7.
///
[DllImport(DllName, EntryPoint="bgfx_set_view_clear_mrt", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_view_clear_mrt(ushort _id, ushort _flags, float _depth, byte _stencil, byte _c0, byte _c1, byte _c2, byte _c3, byte _c4, byte _c5, byte _c6, byte _c7);
///
/// Set view sorting mode.
/// @remarks
/// View mode must be set prior calling `bgfx::submit` for the view.
///
///
/// View id.
/// View sort mode. See `ViewMode::Enum`.
///
[DllImport(DllName, EntryPoint="bgfx_set_view_mode", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_view_mode(ushort _id, ViewMode _mode);
///
/// Set view frame buffer.
/// @remarks
/// Not persistent after `bgfx::reset` call.
///
///
/// View id.
/// Frame buffer handle. Passing `BGFX_INVALID_HANDLE` as frame buffer handle will draw primitives from this view into default back buffer.
///
[DllImport(DllName, EntryPoint="bgfx_set_view_frame_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_view_frame_buffer(ushort _id, FrameBufferHandle _handle);
///
/// Set view view and projection matrices, all draw primitives in this
/// view will use these matrices.
///
///
/// View id.
/// View matrix.
/// Projection matrix.
///
[DllImport(DllName, EntryPoint="bgfx_set_view_transform", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_view_transform(ushort _id, void* _view, void* _proj);
///
/// Post submit view reordering.
///
///
/// First view id.
/// Number of views to remap.
/// View remap id table. Passing `NULL` will reset view ids to default state.
///
[DllImport(DllName, EntryPoint="bgfx_set_view_order", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_view_order(ushort _id, ushort _num, ushort* _order);
///
/// Begin submitting draw calls from thread.
///
///
/// Explicitly request an encoder for a worker thread.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_begin", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe Encoder* encoder_begin(bool _forThread);
///
/// End submitting draw calls from thread.
///
///
/// Encoder.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_end", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_end(Encoder* _encoder);
///
/// Sets a debug marker. This allows you to group graphics calls together for easy browsing in
/// graphics debugging tools.
///
///
/// Marker string.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_marker", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_marker(Encoder* _this, [MarshalAs(UnmanagedType.LPStr)] string _marker);
///
/// Set render states for draw primitive.
/// @remarks
/// 1. To setup more complex states use:
/// `BGFX_STATE_ALPHA_REF(_ref)`,
/// `BGFX_STATE_POINT_SIZE(_size)`,
/// `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
/// `BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA)`,
/// `BGFX_STATE_BLEND_EQUATION(_equation)`,
/// `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
/// 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
/// equation is specified.
///
///
/// 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.
/// Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and `BGFX_STATE_BLEND_INV_FACTOR` blend modes.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_state", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_state(Encoder* _this, ulong _state, uint _rgba);
///
/// Set condition for rendering.
///
///
/// Occlusion query handle.
/// Render if occlusion query is visible.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_condition", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_condition(Encoder* _this, OcclusionQueryHandle _handle, bool _visible);
///
/// Set stencil test state.
///
///
/// Front stencil state.
/// Back stencil state. If back is set to `BGFX_STENCIL_NONE` _fstencil is applied to both front and back facing primitives.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_stencil", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_stencil(Encoder* _this, uint _fstencil, uint _bstencil);
///
/// Set scissor for draw primitive.
/// @remark
/// To scissor for all primitives in view see `bgfx::setViewScissor`.
///
///
/// Position x from the left corner of the window.
/// Position y from the top corner of the window.
/// Width of view scissor region.
/// Height of view scissor region.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_scissor", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe ushort encoder_set_scissor(Encoder* _this, ushort _x, ushort _y, ushort _width, ushort _height);
///
/// Set scissor from cache for draw primitive.
/// @remark
/// To scissor for all primitives in view see `bgfx::setViewScissor`.
///
///
/// Index in scissor cache.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_scissor_cached", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_scissor_cached(Encoder* _this, ushort _cache);
///
/// Set model matrix for draw primitive. If it is not called,
/// the model will be rendered with an identity model matrix.
///
///
/// Pointer to first matrix in array.
/// Number of matrices in array.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_transform", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe uint encoder_set_transform(Encoder* _this, void* _mtx, ushort _num);
///
/// Set model matrix from matrix cache for draw primitive.
///
///
/// Index in matrix cache.
/// Number of matrices from cache.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_transform_cached", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_transform_cached(Encoder* _this, uint _cache, ushort _num);
///
/// Reserve matrices in internal matrix cache.
/// @attention Pointer returned can be modifed until `bgfx::frame` is called.
///
///
/// Pointer to `Transform` structure.
/// Number of matrices.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_alloc_transform", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe uint encoder_alloc_transform(Encoder* _this, Transform* _transform, ushort _num);
///
/// Set shader uniform parameter for draw primitive.
///
///
/// Uniform.
/// Pointer to uniform data.
/// Number of elements. Passing `UINT16_MAX` will use the _num passed on uniform creation.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_uniform", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_uniform(Encoder* _this, UniformHandle _handle, void* _value, ushort _num);
///
/// Set index buffer for draw primitive.
///
///
/// Index buffer.
/// First index to render.
/// Number of indices to render.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_index_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_index_buffer(Encoder* _this, IndexBufferHandle _handle, uint _firstIndex, uint _numIndices);
///
/// Set index buffer for draw primitive.
///
///
/// Dynamic index buffer.
/// First index to render.
/// Number of indices to render.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_dynamic_index_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_dynamic_index_buffer(Encoder* _this, DynamicIndexBufferHandle _handle, uint _firstIndex, uint _numIndices);
///
/// Set index buffer for draw primitive.
///
///
/// Transient index buffer.
/// First index to render.
/// Number of indices to render.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_transient_index_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_transient_index_buffer(Encoder* _this, TransientIndexBuffer* _tib, uint _firstIndex, uint _numIndices);
///
/// Set vertex buffer for draw primitive.
///
///
/// Vertex stream.
/// Vertex buffer.
/// First vertex to render.
/// Number of vertices to render.
/// VertexDecl handle for aliasing vertex buffer.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_vertex_buffer(Encoder* _this, byte _stream, VertexBufferHandle _handle, uint _startVertex, uint _numVertices, VertexDeclHandle _declHandle);
///
/// Set vertex buffer for draw primitive.
///
///
/// Vertex stream.
/// Dynamic vertex buffer.
/// First vertex to render.
/// Number of vertices to render.
/// VertexDecl handle for aliasing vertex buffer.
///
[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, VertexDeclHandle _declHandle);
///
/// Set vertex buffer for draw primitive.
///
///
/// Vertex stream.
/// Transient vertex buffer.
/// First vertex to render.
/// Number of vertices to render.
/// VertexDecl handle for aliasing vertex buffer.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_transient_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_transient_vertex_buffer(Encoder* _this, byte _stream, TransientVertexBuffer* _tvb, uint _startVertex, uint _numVertices, VertexDeclHandle _declHandle);
///
/// Set number of vertices for auto generated vertices use in conjuction
/// with gl_VertexID.
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
///
///
/// Number of vertices.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_vertex_count", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_vertex_count(Encoder* _this, uint _numVertices);
///
/// Set instance data buffer for draw primitive.
///
///
/// Transient instance data buffer.
/// First instance data.
/// Number of data instances.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_instance_data_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_instance_data_buffer(Encoder* _this, InstanceDataBuffer* _idb, uint _start, uint _num);
///
/// Set instance data buffer for draw primitive.
///
///
/// Vertex buffer.
/// First instance data.
/// Number of data instances. Set instance data buffer for draw primitive.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_instance_data_from_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_instance_data_from_vertex_buffer(Encoder* _this, VertexBufferHandle _handle, uint _startVertex, uint _num);
///
/// Set instance data buffer for draw primitive.
///
///
/// Dynamic vertex buffer.
/// First instance data.
/// Number of data instances.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_instance_data_from_dynamic_vertex_buffer(Encoder* _this, DynamicVertexBufferHandle _handle, uint _startVertex, uint _num);
///
/// Set number of instances for auto generated instances use in conjuction
/// with gl_InstanceID.
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
///
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_instance_count", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_instance_count(Encoder* _this, uint _numInstances);
///
/// Set texture stage for draw primitive.
///
///
/// Texture unit.
/// Program sampler.
/// Texture handle.
/// Texture sampling mode. Default value UINT32_MAX uses texture sampling settings from the texture. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_texture", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_texture(Encoder* _this, byte _stage, UniformHandle _sampler, TextureHandle _handle, uint _flags);
///
/// 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.
///
///
/// View id.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_touch", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_touch(Encoder* _this, ushort _id);
///
/// Submit primitive for rendering.
///
///
/// View id.
/// Program.
/// Depth for sorting.
/// Preserve internal draw state for next draw call submit.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_submit", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_submit(Encoder* _this, ushort _id, ProgramHandle _program, uint _depth, bool _preserveState);
///
/// Submit primitive with occlusion query for rendering.
///
///
/// View id.
/// Program.
/// Occlusion query.
/// Depth for sorting.
/// Preserve internal draw state for next draw call submit.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_submit_occlusion_query", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_submit_occlusion_query(Encoder* _this, ushort _id, ProgramHandle _program, OcclusionQueryHandle _occlusionQuery, uint _depth, bool _preserveState);
///
/// Submit primitive for rendering with index and instance data info from
/// indirect buffer.
///
///
/// View id.
/// Program.
/// Indirect buffer.
/// First element in indirect buffer.
/// Number of dispatches.
/// Depth for sorting.
/// Preserve internal draw state for next draw call submit.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_submit_indirect", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_submit_indirect(Encoder* _this, ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, ushort _start, ushort _num, uint _depth, bool _preserveState);
///
/// Set compute index buffer.
///
///
/// Compute stage.
/// Index buffer handle.
/// Buffer access. See `Access::Enum`.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_compute_index_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_compute_index_buffer(Encoder* _this, byte _stage, IndexBufferHandle _handle, Access _access);
///
/// Set compute vertex buffer.
///
///
/// Compute stage.
/// Vertex buffer handle.
/// Buffer access. See `Access::Enum`.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_compute_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_compute_vertex_buffer(Encoder* _this, byte _stage, VertexBufferHandle _handle, Access _access);
///
/// Set compute dynamic index buffer.
///
///
/// Compute stage.
/// Dynamic index buffer handle.
/// Buffer access. See `Access::Enum`.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_compute_dynamic_index_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_compute_dynamic_index_buffer(Encoder* _this, byte _stage, DynamicIndexBufferHandle _handle, Access _access);
///
/// Set compute dynamic vertex buffer.
///
///
/// Compute stage.
/// Dynamic vertex buffer handle.
/// Buffer access. See `Access::Enum`.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_compute_dynamic_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_compute_dynamic_vertex_buffer(Encoder* _this, byte _stage, DynamicVertexBufferHandle _handle, Access _access);
///
/// Set compute indirect buffer.
///
///
/// Compute stage.
/// Indirect buffer handle.
/// Buffer access. See `Access::Enum`.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_compute_indirect_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_compute_indirect_buffer(Encoder* _this, byte _stage, IndirectBufferHandle _handle, Access _access);
///
/// Set compute image from texture.
///
///
/// Compute stage.
/// Texture handle.
/// Mip level.
/// Image access. See `Access::Enum`.
/// Texture format. See: `TextureFormat::Enum`.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_set_image", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_set_image(Encoder* _this, byte _stage, TextureHandle _handle, byte _mip, Access _access, TextureFormat _format);
///
/// Dispatch compute.
///
///
/// View id.
/// Compute program.
/// Number of groups X.
/// Number of groups Y.
/// Number of groups Z.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_dispatch", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_dispatch(Encoder* _this, ushort _id, ProgramHandle _program, uint _numX, uint _numY, uint _numZ);
///
/// Dispatch compute indirect.
///
///
/// View id.
/// Compute program.
/// Indirect buffer.
/// First element in indirect buffer.
/// Number of dispatches.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_dispatch_indirect", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_dispatch_indirect(Encoder* _this, ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, ushort _start, ushort _num);
///
/// Discard all previously set state for draw or compute call.
///
///
[DllImport(DllName, EntryPoint="bgfx_encoder_discard", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_discard(Encoder* _this);
///
/// 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`.
///
///
/// View id.
/// Destination texture handle.
/// Destination texture mip level.
/// Destination texture X position.
/// Destination texture Y position.
/// If texture is 2D this argument should be 0. If destination texture is cube this argument represents destination texture cube face. For 3D texture this argument represents destination texture Z position.
/// Source texture handle.
/// Source texture mip level.
/// Source texture X position.
/// Source texture Y position.
/// If texture is 2D this argument should be 0. If source texture is cube this argument represents source texture cube face. For 3D texture this argument represents source texture Z position.
/// Width of region.
/// Height of region.
/// If texture is 3D this argument represents depth of region, otherwise it's unused.
///
[DllImport(DllName, EntryPoint="bgfx_encoder_blit", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void encoder_blit(Encoder* _this, ushort _id, TextureHandle _dst, byte _dstMip, ushort _dstX, ushort _dstY, ushort _dstZ, TextureHandle _src, byte _srcMip, ushort _srcX, ushort _srcY, ushort _srcZ, ushort _width, ushort _height, ushort _depth);
///
/// 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.
///
///
/// Frame buffer handle. If handle is `BGFX_INVALID_HANDLE` request will be made for main window back buffer.
/// Will be passed to `bgfx::CallbackI::screenShot` callback.
///
[DllImport(DllName, EntryPoint="bgfx_request_screen_shot", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void request_screen_shot(FrameBufferHandle _handle, [MarshalAs(UnmanagedType.LPStr)] string _filePath);
///
/// 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.
///
///
/// Timeout in milliseconds.
///
[DllImport(DllName, EntryPoint="bgfx_render_frame", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe RenderFrame render_frame(int _msecs);
///
/// Set platform data.
/// @warning Must be called before `bgfx::init`.
///
///
/// Platform data.
///
[DllImport(DllName, EntryPoint="bgfx_set_platform_data", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_platform_data(PlatformData* _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.
///
///
[DllImport(DllName, EntryPoint="bgfx_get_internal_data", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe InternalData* 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.
///
///
/// Texture handle.
/// Native API pointer to texture.
///
[DllImport(DllName, EntryPoint="bgfx_override_internal_texture_ptr", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe UIntPtr override_internal_texture_ptr(TextureHandle _handle, UIntPtr _ptr);
///
/// 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.
///
///
/// Texture handle.
/// Width.
/// Height.
/// Number of mip-maps.
/// Texture format. See: `TextureFormat::Enum`.
/// Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.
///
[DllImport(DllName, EntryPoint="bgfx_override_internal_texture", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe UIntPtr override_internal_texture(TextureHandle _handle, ushort _width, ushort _height, byte _numMips, TextureFormat _format, ulong _flags);
///
/// Sets a debug marker. This allows you to group graphics calls together for easy browsing in
/// graphics debugging tools.
///
///
/// Marker string.
///
[DllImport(DllName, EntryPoint="bgfx_set_marker", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_marker([MarshalAs(UnmanagedType.LPStr)] string _marker);
///
/// Set render states for draw primitive.
/// @remarks
/// 1. To setup more complex states use:
/// `BGFX_STATE_ALPHA_REF(_ref)`,
/// `BGFX_STATE_POINT_SIZE(_size)`,
/// `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
/// `BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA)`,
/// `BGFX_STATE_BLEND_EQUATION(_equation)`,
/// `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
/// 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
/// equation is specified.
///
///
/// 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.
/// Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and `BGFX_STATE_BLEND_INV_FACTOR` blend modes.
///
[DllImport(DllName, EntryPoint="bgfx_set_state", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_state(ulong _state, uint _rgba);
///
/// Set condition for rendering.
///
///
/// Occlusion query handle.
/// Render if occlusion query is visible.
///
[DllImport(DllName, EntryPoint="bgfx_set_condition", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_condition(OcclusionQueryHandle _handle, bool _visible);
///
/// Set stencil test state.
///
///
/// Front stencil state.
/// Back stencil state. If back is set to `BGFX_STENCIL_NONE` _fstencil is applied to both front and back facing primitives.
///
[DllImport(DllName, EntryPoint="bgfx_set_stencil", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_stencil(uint _fstencil, uint _bstencil);
///
/// Set scissor for draw primitive.
/// @remark
/// To scissor for all primitives in view see `bgfx::setViewScissor`.
///
///
/// Position x from the left corner of the window.
/// Position y from the top corner of the window.
/// Width of view scissor region.
/// Height of view scissor region.
///
[DllImport(DllName, EntryPoint="bgfx_set_scissor", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe ushort set_scissor(ushort _x, ushort _y, ushort _width, ushort _height);
///
/// Set scissor from cache for draw primitive.
/// @remark
/// To scissor for all primitives in view see `bgfx::setViewScissor`.
///
///
/// Index in scissor cache.
///
[DllImport(DllName, EntryPoint="bgfx_set_scissor_cached", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_scissor_cached(ushort _cache);
///
/// Set model matrix for draw primitive. If it is not called,
/// the model will be rendered with an identity model matrix.
///
///
/// Pointer to first matrix in array.
/// Number of matrices in array.
///
[DllImport(DllName, EntryPoint="bgfx_set_transform", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe uint set_transform(void* _mtx, ushort _num);
///
/// Set model matrix from matrix cache for draw primitive.
///
///
/// Index in matrix cache.
/// Number of matrices from cache.
///
[DllImport(DllName, EntryPoint="bgfx_set_transform_cached", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_transform_cached(uint _cache, ushort _num);
///
/// Reserve matrices in internal matrix cache.
/// @attention Pointer returned can be modifed until `bgfx::frame` is called.
///
///
/// Pointer to `Transform` structure.
/// Number of matrices.
///
[DllImport(DllName, EntryPoint="bgfx_alloc_transform", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe uint alloc_transform(Transform* _transform, ushort _num);
///
/// Set shader uniform parameter for draw primitive.
///
///
/// Uniform.
/// Pointer to uniform data.
/// Number of elements. Passing `UINT16_MAX` will use the _num passed on uniform creation.
///
[DllImport(DllName, EntryPoint="bgfx_set_uniform", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_uniform(UniformHandle _handle, void* _value, ushort _num);
///
/// Set index buffer for draw primitive.
///
///
/// Index buffer.
/// First index to render.
/// Number of indices to render.
///
[DllImport(DllName, EntryPoint="bgfx_set_index_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_index_buffer(IndexBufferHandle _handle, uint _firstIndex, uint _numIndices);
///
/// Set index buffer for draw primitive.
///
///
/// Dynamic index buffer.
/// First index to render.
/// Number of indices to render.
///
[DllImport(DllName, EntryPoint="bgfx_set_dynamic_index_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_dynamic_index_buffer(DynamicIndexBufferHandle _handle, uint _firstIndex, uint _numIndices);
///
/// Set index buffer for draw primitive.
///
///
/// Transient index buffer.
/// First index to render.
/// Number of indices to render.
///
[DllImport(DllName, EntryPoint="bgfx_set_transient_index_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_transient_index_buffer(TransientIndexBuffer* _tib, uint _firstIndex, uint _numIndices);
///
/// Set vertex buffer for draw primitive.
///
///
/// Vertex stream.
/// Vertex buffer.
/// First vertex to render.
/// Number of vertices to render.
///
[DllImport(DllName, EntryPoint="bgfx_set_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_vertex_buffer(byte _stream, VertexBufferHandle _handle, uint _startVertex, uint _numVertices);
///
/// Set vertex buffer for draw primitive.
///
///
/// Vertex stream.
/// Dynamic vertex buffer.
/// First vertex to render.
/// Number of vertices to render.
///
[DllImport(DllName, EntryPoint="bgfx_set_dynamic_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_dynamic_vertex_buffer(byte _stream, DynamicVertexBufferHandle _handle, uint _startVertex, uint _numVertices);
///
/// Set vertex buffer for draw primitive.
///
///
/// Vertex stream.
/// Transient vertex buffer.
/// First vertex to render.
/// Number of vertices to render.
///
[DllImport(DllName, EntryPoint="bgfx_set_transient_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_transient_vertex_buffer(byte _stream, TransientVertexBuffer* _tvb, uint _startVertex, uint _numVertices);
///
/// Set number of vertices for auto generated vertices use in conjuction
/// with gl_VertexID.
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
///
///
/// Number of vertices.
///
[DllImport(DllName, EntryPoint="bgfx_set_vertex_count", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_vertex_count(uint _numVertices);
///
/// Set instance data buffer for draw primitive.
///
///
/// Transient instance data buffer.
/// First instance data.
/// Number of data instances.
///
[DllImport(DllName, EntryPoint="bgfx_set_instance_data_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_instance_data_buffer(InstanceDataBuffer* _idb, uint _start, uint _num);
///
/// Set instance data buffer for draw primitive.
///
///
/// Vertex buffer.
/// First instance data.
/// Number of data instances. Set instance data buffer for draw primitive.
///
[DllImport(DllName, EntryPoint="bgfx_set_instance_data_from_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_instance_data_from_vertex_buffer(VertexBufferHandle _handle, uint _startVertex, uint _num);
///
/// Set instance data buffer for draw primitive.
///
///
/// Dynamic vertex buffer.
/// First instance data.
/// Number of data instances.
///
[DllImport(DllName, EntryPoint="bgfx_set_instance_data_from_dynamic_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_instance_data_from_dynamic_vertex_buffer(DynamicVertexBufferHandle _handle, uint _startVertex, uint _num);
///
/// Set number of instances for auto generated instances use in conjuction
/// with gl_InstanceID.
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
///
///
[DllImport(DllName, EntryPoint="bgfx_set_instance_count", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_instance_count(uint _numInstances);
///
/// Set texture stage for draw primitive.
///
///
/// Texture unit.
/// Program sampler.
/// Texture handle.
/// Texture sampling mode. Default value UINT32_MAX uses texture sampling settings from the texture. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.
///
[DllImport(DllName, EntryPoint="bgfx_set_texture", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_texture(byte _stage, UniformHandle _sampler, TextureHandle _handle, uint _flags);
///
/// 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.
///
///
/// View id.
///
[DllImport(DllName, EntryPoint="bgfx_touch", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void touch(ushort _id);
///
/// Submit primitive for rendering.
///
///
/// View id.
/// Program.
/// Depth for sorting.
/// Preserve internal draw state for next draw call submit.
///
[DllImport(DllName, EntryPoint="bgfx_submit", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void submit(ushort _id, ProgramHandle _program, uint _depth, bool _preserveState);
///
/// Submit primitive with occlusion query for rendering.
///
///
/// View id.
/// Program.
/// Occlusion query.
/// Depth for sorting.
/// Preserve internal draw state for next draw call submit.
///
[DllImport(DllName, EntryPoint="bgfx_submit_occlusion_query", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void submit_occlusion_query(ushort _id, ProgramHandle _program, OcclusionQueryHandle _occlusionQuery, uint _depth, bool _preserveState);
///
/// Submit primitive for rendering with index and instance data info from
/// indirect buffer.
///
///
/// View id.
/// Program.
/// Indirect buffer.
/// First element in indirect buffer.
/// Number of dispatches.
/// Depth for sorting.
/// Preserve internal draw state for next draw call submit.
///
[DllImport(DllName, EntryPoint="bgfx_submit_indirect", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void submit_indirect(ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, ushort _start, ushort _num, uint _depth, bool _preserveState);
///
/// Set compute index buffer.
///
///
/// Compute stage.
/// Index buffer handle.
/// Buffer access. See `Access::Enum`.
///
[DllImport(DllName, EntryPoint="bgfx_set_compute_index_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_compute_index_buffer(byte _stage, IndexBufferHandle _handle, Access _access);
///
/// Set compute vertex buffer.
///
///
/// Compute stage.
/// Vertex buffer handle.
/// Buffer access. See `Access::Enum`.
///
[DllImport(DllName, EntryPoint="bgfx_set_compute_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_compute_vertex_buffer(byte _stage, VertexBufferHandle _handle, Access _access);
///
/// Set compute dynamic index buffer.
///
///
/// Compute stage.
/// Dynamic index buffer handle.
/// Buffer access. See `Access::Enum`.
///
[DllImport(DllName, EntryPoint="bgfx_set_compute_dynamic_index_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_compute_dynamic_index_buffer(byte _stage, DynamicIndexBufferHandle _handle, Access _access);
///
/// Set compute dynamic vertex buffer.
///
///
/// Compute stage.
/// Dynamic vertex buffer handle.
/// Buffer access. See `Access::Enum`.
///
[DllImport(DllName, EntryPoint="bgfx_set_compute_dynamic_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_compute_dynamic_vertex_buffer(byte _stage, DynamicVertexBufferHandle _handle, Access _access);
///
/// Set compute indirect buffer.
///
///
/// Compute stage.
/// Indirect buffer handle.
/// Buffer access. See `Access::Enum`.
///
[DllImport(DllName, EntryPoint="bgfx_set_compute_indirect_buffer", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_compute_indirect_buffer(byte _stage, IndirectBufferHandle _handle, Access _access);
///
/// Set compute image from texture.
///
///
/// Compute stage.
/// Texture handle.
/// Mip level.
/// Image access. See `Access::Enum`.
/// Texture format. See: `TextureFormat::Enum`.
///
[DllImport(DllName, EntryPoint="bgfx_set_image", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void set_image(byte _stage, TextureHandle _handle, byte _mip, Access _access, TextureFormat _format);
///
/// Dispatch compute.
///
///
/// View id.
/// Compute program.
/// Number of groups X.
/// Number of groups Y.
/// Number of groups Z.
///
[DllImport(DllName, EntryPoint="bgfx_dispatch", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void dispatch(ushort _id, ProgramHandle _program, uint _numX, uint _numY, uint _numZ);
///
/// Dispatch compute indirect.
///
///
/// View id.
/// Compute program.
/// Indirect buffer.
/// First element in indirect buffer.
/// Number of dispatches.
///
[DllImport(DllName, EntryPoint="bgfx_dispatch_indirect", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void dispatch_indirect(ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, ushort _start, ushort _num);
///
/// Discard all previously set state for draw or compute call.
///
///
[DllImport(DllName, EntryPoint="bgfx_discard", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void 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`.
///
///
/// View id.
/// Destination texture handle.
/// Destination texture mip level.
/// Destination texture X position.
/// Destination texture Y position.
/// If texture is 2D this argument should be 0. If destination texture is cube this argument represents destination texture cube face. For 3D texture this argument represents destination texture Z position.
/// Source texture handle.
/// Source texture mip level.
/// Source texture X position.
/// Source texture Y position.
/// If texture is 2D this argument should be 0. If source texture is cube this argument represents source texture cube face. For 3D texture this argument represents source texture Z position.
/// Width of region.
/// Height of region.
/// If texture is 3D this argument represents depth of region, otherwise it's unused.
///
[DllImport(DllName, EntryPoint="bgfx_blit", CallingConvention = CallingConvention.Cdecl)]
public static extern unsafe void blit(ushort _id, TextureHandle _dst, byte _dstMip, ushort _dstX, ushort _dstY, ushort _dstZ, TextureHandle _src, byte _srcMip, ushort _srcX, ushort _srcY, ushort _srcZ, ushort _width, ushort _height, ushort _depth);
#if !BGFX_CSHARP_CUSTOM_DLLNAME
#if DEBUG
const string DllName = "bgfx_debug.dll";
#else
const string DllName = "bgfx.dll";
#endif
#endif
}
}