Exemple #1
0
        public WindowImpl()
        {
#if USE_MANAGED_DRAG
            _managedDrag = new ManagedWindowResizeDragHelper(this, capture =>
            {
                if (capture)
                {
                    UnmanagedMethods.SetCapture(Handle.Handle);
                }
                else
                {
                    UnmanagedMethods.ReleaseCapture();
                }
            });
#endif
            CreateWindow();
            _framebuffer = new FramebufferManager(_hwnd);
            if (Win32GlManager.EglFeature != null)
            {
                _gl = new EglGlPlatformSurface((EglDisplay)Win32GlManager.EglFeature.Display,
                                               Win32GlManager.EglFeature.DeferredContext, this);
            }

            s_instances.Add(this);
        }
Exemple #2
0
        public WindowImpl()
        {
            _touchDevice = new TouchDevice();
            _mouseDevice = new WindowsMouseDevice();

#if USE_MANAGED_DRAG
            _managedDrag = new ManagedWindowResizeDragHelper(this, capture =>
            {
                if (capture)
                    UnmanagedMethods.SetCapture(Handle.Handle);
                else
                    UnmanagedMethods.ReleaseCapture();
            });
#endif

            _windowProperties = new WindowProperties
            {
                ShowInTaskbar = false,
                IsResizable = true,
                Decorations = SystemDecorations.Full
            };
            _rendererLock = new ManagedDeferredRendererLock();


            CreateWindow();
            _framebuffer = new FramebufferManager(_hwnd);

            if (Win32GlManager.EglFeature != null)
                _gl = new EglGlPlatformSurface(Win32GlManager.EglFeature.DeferredContext, this);

            Screen = new ScreenImpl();

            _nativeControlHost = new Win32NativeControlHost(this);
            s_instances.Add(this);
        }
Exemple #3
0
 public void Dispose()
 {
     _framebuffer?.Dispose();
     _framebuffer = null;
     if (_hwnd != IntPtr.Zero)
     {
         UnmanagedMethods.DestroyWindow(_hwnd);
         _hwnd = IntPtr.Zero;
     }
     if (_className != null)
     {
         UnmanagedMethods.UnregisterClass(_className, UnmanagedMethods.GetModuleHandle(null));
         _className = null;
     }
 }
        public WindowImpl()
        {
            _touchDevice = new TouchDevice();
            _mouseDevice = new WindowsMouseDevice();

#if USE_MANAGED_DRAG
            _managedDrag = new ManagedWindowResizeDragHelper(this, capture =>
            {
                if (capture)
                {
                    UnmanagedMethods.SetCapture(Handle.Handle);
                }
                else
                {
                    UnmanagedMethods.ReleaseCapture();
                }
            });
#endif

            _windowProperties = new WindowProperties
            {
                ShowInTaskbar = false,
                IsResizable   = true,
                Decorations   = SystemDecorations.Full
            };
            _rendererLock = new ManagedDeferredRendererLock();


            CreateWindow();
            _framebuffer = new FramebufferManager(_hwnd);

            var glPlatform = AvaloniaLocator.Current.GetService <IPlatformOpenGlInterface>();

            if (glPlatform is EglPlatformOpenGlInterface egl)
            {
                _gl = new EglGlPlatformSurface(egl, this);
            }
            else if (glPlatform is WglPlatformOpenGlInterface wgl)
            {
                _gl = new WglGlPlatformSurface(wgl.PrimaryContext, this);
            }

            Screen = new ScreenImpl();

            _nativeControlHost = new Win32NativeControlHost(this);
            s_instances.Add(this);
        }
Exemple #5
0
        public WindowImpl()
        {
#if USE_MANAGED_DRAG
            _managedDrag = new ManagedWindowResizeDragHelper(this, capture =>
            {
                if (capture)
                {
                    UnmanagedMethods.SetCapture(Handle.Handle);
                }
                else
                {
                    UnmanagedMethods.ReleaseCapture();
                }
            });
#endif
            CreateWindow();
            _framebuffer = new FramebufferManager(_hwnd);
            s_instances.Add(this);
        }
Exemple #6
0
 public WindowImpl()
 {
     CreateWindow();
     _framebuffer = new FramebufferManager(_hwnd);
     s_instances.Add(this);
 }