Пример #1
0
 /// <summary>
 /// Create a window
 /// </summary>
 /// <param name="title">title for the window</param>
 /// <param name="x">x position</param>
 /// <param name="y">y position</param>
 /// <param name="width">width of the window</param>
 /// <param name="height">height of the window</param>
 /// <param name="flags">flags for window</param>
 public Window(
     string title,
     int x, int y,
     int width, int height,
     WindowFlags flags = (
         WindowFlags.AllowHighDpi |
         WindowFlags.Shown
         )
     ) : base(
         Engine.Instance.GetModule <GraphicsModule>().GraphicsService.PrimaryDevice,
         Convert.ToUInt32(width),
         Convert.ToUInt32(height)
         )
 {
     Windows.Add(this);
     _graphicsModule = Engine.Instance.GetModule <GraphicsModule>();
     _nativeWindow   = new NativeWindow(
         _graphicsModule.GraphicsService,
         title,
         x, y,
         width, height,
         (SDL_WindowFlags)flags
         );
     _swapchain = new Swapchain(
         _graphicsModule.GraphicsService.PrimaryDevice,
         _nativeWindow
         );
     _fence = new Fence(_graphicsModule.GraphicsService.PrimaryDevice);
 }
Пример #2
0
        /// <summary>
        ///
        /// </summary>
        public override void OnEnable()
        {
            _module = Engine.Instance.GetModule <GraphicsModule>();
            _device = _module.GraphicsService.PrimaryDevice;

            _renderCommand = _module.CommandBufferService.GetNewCommand(
                QueueFamilyType.Graphics,
                CommandType.Primary
                );
            _deferredCommand = _module.CommandBufferService.GetNewCommand(
                QueueFamilyType.Graphics,
                CommandType.Primary
                );
            _presentCommand = _module.CommandBufferService.GetNewCommand(
                QueueFamilyType.Graphics,
                CommandType.Primary
                );

            // create semaphore for syncing commands
            _transferCommandSemaphore = new Semaphore(_device);
            _renderCommandSemaphore   = new Semaphore(_device);
            _defferedCommandSemaphore = new Semaphore(_device);
            _presentCommandSemaphore  = new Semaphore(_device);
        }
Пример #3
0
 /// <summary>
 /// Constructor for descriptor service
 /// </summary>
 public DescriptorService()
 {
     _handle = new Dictionary <string, DescriptorObject>();
     _module = Engine.Instance.GetModule <GraphicsModule>();
 }