Пример #1
0
        public DefaultWindow(DefaultDevice device, int width, int height, ref SwapChainDescription implicitSwapChainDescription, 
            string title, GameWindowFlags gameWindowFlags, DisplayDevice displayDevice, ref Context glContext)
            : base(width, height, GraphicsMode.Default, title, gameWindowFlags, displayDevice)
        {
            glContext = glContext ?? new Context(Context);
            this.glContext = glContext;

            this.device = device;
            implicitSwapChainDesc = implicitSwapChainDescription;
            swapChainSurfaces = new SwapChainSurfaces(device, width, height, ref implicitSwapChainDescription);

            keyboard = new Keyboard(this);
            mouse = new Mouse(this);
        }
Пример #2
0
        public void Initialize(IAdapter adapter,
            IWindowHandle windowHandle, 
            SwapChainDescription primarySwapChainDesc,
            DeviceInitializationFlags initializationFlags,
            IFileSystem fileSystem)
        {
            if (adapter != adapters[0])
                throw new ArgumentException("Provided adapter is not on of this eye's adapters");

            device = new DefaultDevice(this, (CAdapter)adapter, initializationFlags, (WindowHandle)windowHandle, ref primarySwapChainDesc, fileSystem);

            initialized = true;
        }