Beispiel #1
0
        private void Form_ClientSizeChanged(object sender, EventArgs e)
        {
            if (!(sender is Form form))
            {
                return;
            }
            if (form.ClientSize.Height == 0 || form.ClientSize.Width == 0)
            {
                return;
            }

            PreReset?.Invoke();

            device.Reset(new PresentParameters
            {
                AutoDepthStencilFormat = Format.D24S8,
                BackBufferCount        = 1,
                BackBufferFormat       = Format.A8R8G8B8,
                BackBufferHeight       = form.ClientSize.Height,
                BackBufferWidth        = form.ClientSize.Width,
                DeviceWindowHandle     = form.Handle,
                EnableAutoDepthStencil = true,
                SwapEffect             = SwapEffect.Discard,
                Windowed = true
            });

            PostReset?.Invoke();
        }
Beispiel #2
0
        internal static void Reset()
        {
            PreReset?.Invoke();

            registeredNodeLookup.Clear();
            registeredModels.Clear();
            updateList.Clear();


            PostReset?.Invoke();
        }