Beispiel #1
0
        /// <summary>
        /// Initializes a new intance of the <see cref="InitSettings"/> class.
        /// </summary>
        unsafe public InitSettings()
        {
            Native native;

            //var r = sizeof( InstanceDataBuffer.NativeStruct );
            //Console.Write( r.ToString() );

            //var r2 = sizeof( FrameBuffer.NativeAttachment );
            //Console.Write( r2.ToString() );

            //var r3 = sizeof( Capabilities.Caps );
            //Console.Write( r3.ToString() );

            //var r4 = sizeof( PerfStats.ViewStatsNative );
            //Console.Write( r4.ToString() );

            //var r5 = sizeof( PerfStats.Stats );
            //Console.Write( r5.ToString() );


            NativeMethods.bgfx_init_ctor(&native);

            Backend         = native.Backend;
            Adapter         = new Adapter((Vendor)native.VendorId, native.DeviceId);
            Debug           = native.Debug != 0;
            Profiling       = native.Profiling != 0;
            Format          = native.Resolution.Format;
            Width           = (int)native.Resolution.Width;
            Height          = (int)native.Resolution.Height;
            ResetFlags      = (ResetFlags)native.Resolution.Flags;
            BackBufferCount = native.Resolution.NumBackBuffers;
            MaxFrameLatency = native.Resolution.MaxFrameLatency;
            PlatformData    = native.PlatformData;
        }
Beispiel #2
0
        /// <summary>
        /// Sets the handle of the main rendering window.
        /// </summary>
        /// <param name="windowHandle">The handle of the native OS window.</param>
        public static void SetWindowHandle(IntPtr windowHandle)
        {
            var data = new PlatformData {
                WindowHandle = windowHandle
            };

            NativeMethods.bgfx_set_platform_data(ref data);
        }
Beispiel #3
0
        /// <summary>
        /// Initializes a new intance of the <see cref="InitSettings"/> class.
        /// </summary>
        unsafe public InitSettings()
        {
            Native native;

            NativeMethods.bgfx_init_ctor(&native);

            Backend         = native.Backend;
            Adapter         = new Adapter((Vendor)native.VendorId, native.DeviceId);
            Debug           = native.Debug != 0;
            Profiling       = native.Profiling != 0;
            Format          = native.Resolution.Format;
            Width           = (int)native.Resolution.Width;
            Height          = (int)native.Resolution.Height;
            ResetFlags      = (ResetFlags)native.Resolution.Flags;
            BackBufferCount = native.Resolution.NumBackBuffers;
            MaxFrameLatency = native.Resolution.MaxFrameLatency;
            PlatformData    = native.PlatformData;
        }
Beispiel #4
0
 public static extern void bgfx_set_platform_data(ref PlatformData data);
Beispiel #5
0
 public static extern void bgfx_set_platform_data(ref PlatformData data);
Beispiel #6
0
 /// <summary>
 /// Sets platform-specific data pointers to hook into low-level library functionality.
 /// </summary>
 /// <param name="platformData">A collection of platform-specific data pointers.</param>
 public static void SetPlatformData(PlatformData platformData)
 {
     NativeMethods.bgfx_set_platform_data(ref platformData);
 }
Beispiel #7
0
 /// <summary>
 /// Sets the handle of the main rendering window.
 /// </summary>
 /// <param name="windowHandle">The handle of the native OS window.</param>
 public static void SetWindowHandle(IntPtr windowHandle)
 {
     var data = new PlatformData { WindowHandle = windowHandle };
     NativeMethods.bgfx_set_platform_data(ref data);
 }
Beispiel #8
0
 /// <summary>
 /// Sets platform-specific data pointers to hook into low-level library functionality.
 /// </summary>
 /// <param name="platformData">A collection of platform-specific data pointers.</param>
 public static void SetPlatformData(PlatformData platformData)
 {
     NativeMethods.bgfx_set_platform_data(ref platformData);
 }