Example #1
0
 public static extern void bgfx_vertex_decl_begin(ref VertexLayout.Data decl, RendererBackend backend);
Example #2
0
 public static extern byte bgfx_get_supported_renderers(RendererBackend[] backends);
Example #3
0
 public static extern void bgfx_init(RendererBackend backend, ushort vendorId, ushort deviceId, IntPtr callbacks, IntPtr allocator);
Example #4
0
 public static extern sbyte* bgfx_get_renderer_name(RendererBackend backend);
Example #5
0
 /// <summary>
 /// Starts a stream of vertex attribute additions to the layout.
 /// </summary>
 /// <param name="backend">The rendering backend with which to associate the attributes.</param>
 /// <returns>This instance, for use in a fluent API.</returns>
 public VertexLayout Begin(RendererBackend backend = RendererBackend.Null)
 {
     NativeMethods.bgfx_vertex_decl_begin(ref data, backend);
     return this;
 }
Example #6
0
 /// <summary>
 /// Initializes the graphics library on the specified adapter.
 /// </summary>
 /// <param name="backend">The backend API to use for rendering.</param>
 /// <param name="adapter">The adapter on which to create the device.</param>
 /// <param name="callbackHandler">A set of handlers for various library callbacks.</param>
 public static void Init(RendererBackend backend = RendererBackend.Default, Adapter adapter = default(Adapter), ICallbackHandler callbackHandler = null)
 {
     NativeMethods.bgfx_init(
         backend,
         (ushort)adapter.Vendor,
         (ushort)adapter.DeviceId,
         CallbackShim.CreateShim(callbackHandler),
         IntPtr.Zero
     );
 }
Example #7
0
        /// <summary>
        /// Gets the set of supported rendering backends.
        /// </summary>
        /// <returns></returns>
        public static RendererBackend[] GetSupportedBackends()
        {
            var types = new RendererBackend[(int)RendererBackend.Default];
            var count = NativeMethods.bgfx_get_supported_renderers(types);

            return types.Take(count).ToArray();
        }
Example #8
0
 /// <summary>
 /// Gets the friendly name of a specific rendering backend.
 /// </summary>
 /// <param name="backend">The backend for which to retrieve a name.</param>
 /// <returns>The friendly name of the specified backend.</returns>
 public static string GetBackendName(RendererBackend backend)
 {
     return new string(NativeMethods.bgfx_get_renderer_name(backend));
 }