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)); } }
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); } }
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); } }
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; } }
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); } }
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)); } }
public void ReleaseDrawer(IDirectXDrawer drawer) { lock(DeviceLock) _requestedSizes.Remove(drawer); }
public void ReleaseDrawer(IDirectXDrawer drawer) { lock (DeviceLock) _requestedSizes.Remove(drawer); }