예제 #1
0
 public Surface GetRenderSurfaceUnsafe(IDirectXDrawer drawer, Size size)
 {
     CheckSize(size);
     lock (DeviceLock)
     {
         _requestedSizes[drawer] = size;
         Format          format             = _deviceSettings.PresentParameters.BackBufferFormat;
         MultisampleType multisampleType    = _deviceSettings.PresentParameters.Multisample;
         int             multisampleQuality = _deviceSettings.PresentParameters.MultisampleQuality;
         return(Surface.CreateRenderTarget(Device, size.Width, size.Height,
                                           format, multisampleType, multisampleQuality, false));
     }
 }
예제 #2
0
	    public Surface GetRenderSurfaceUnsafe(IDirectXDrawer drawer, Size size)
		{
			CheckSize(size);
			lock(DeviceLock)
			{
				_requestedSizes[drawer] = size;
				Format format = _deviceSettings.PresentParameters.BackBufferFormat;
				MultisampleType multisampleType = _deviceSettings.PresentParameters.Multisample;
				int multisampleQuality = _deviceSettings.PresentParameters.MultisampleQuality;
				return Surface.CreateRenderTarget(Device, size.Width, size.Height,
												format, multisampleType, multisampleQuality, false);
			}
		}
예제 #3
0
		public SwapChain GetSwapChainUnsafe(IDirectXDrawer drawer, Control control)
		{
			Size requestedSize = control.ClientSize;
			CheckSize(requestedSize);
			lock(DeviceLock)
			{
				_requestedSizes[drawer] = requestedSize;
				int width = requestedSize.Width;
				int height = requestedSize.Height;
				PresentParameters paramsCopy = _deviceSettings.PresentParameters.Clone();
				var hndl = GetControl(control);
			    paramsCopy.DeviceWindowHandle = hndl;
				paramsCopy.BackBufferWidth = width;
				paramsCopy.BackBufferHeight = height;
				return new SwapChain(Device, paramsCopy);
			}
		}
예제 #4
0
		public bool ResetIfRequired(IDirectXDrawer drawer, Size updatingSize)
		{
			CheckSize(updatingSize);
			lock(DeviceLock)
			{
				_requestedSizes[drawer] = updatingSize;
				int maxWidth = _requestedSizes.Max(x => x.Value.Width);
				int maxHeight = _requestedSizes.Max(x => x.Value.Height);
				if(maxWidth != _deviceSettings.PresentParameters.BackBufferWidth ||
					maxHeight != _deviceSettings.PresentParameters.BackBufferHeight)
				{
					ResetInternal(maxWidth, maxHeight);
					return true;
				}
				return false;
			}
		}
예제 #5
0
 public bool ResetIfRequired(IDirectXDrawer drawer, Size updatingSize)
 {
     CheckSize(updatingSize);
     lock (DeviceLock)
     {
         _requestedSizes[drawer] = updatingSize;
         int maxWidth  = _requestedSizes.Max(x => x.Value.Width);
         int maxHeight = _requestedSizes.Max(x => x.Value.Height);
         if (maxWidth != _deviceSettings.PresentParameters.BackBufferWidth ||
             maxHeight != _deviceSettings.PresentParameters.BackBufferHeight)
         {
             ResetInternal(maxWidth, maxHeight);
             return(true);
         }
         return(false);
     }
 }
예제 #6
0
        public SwapChain GetSwapChainUnsafe(IDirectXDrawer drawer, Control control)
        {
            Size requestedSize = control.ClientSize;

            CheckSize(requestedSize);
            lock (DeviceLock)
            {
                _requestedSizes[drawer] = requestedSize;
                int width  = requestedSize.Width;
                int height = requestedSize.Height;
                PresentParameters paramsCopy = _deviceSettings.PresentParameters.Clone();
                var hndl = GetControl(control);
                paramsCopy.DeviceWindowHandle = hndl;
                paramsCopy.BackBufferWidth    = width;
                paramsCopy.BackBufferHeight   = height;
                return(new SwapChain(Device, paramsCopy));
            }
        }
예제 #7
0
		public void ReleaseDrawer(IDirectXDrawer drawer)
		{
			lock(DeviceLock)
				_requestedSizes.Remove(drawer);
		}
예제 #8
0
 public void ReleaseDrawer(IDirectXDrawer drawer)
 {
     lock (DeviceLock)
         _requestedSizes.Remove(drawer);
 }