Exemplo n.º 1
0
        public WindowsContext(IWGL wgl, ILibrary glLibraryProvider, IContext shareContext, ContextCreationParameters parameters)
        {
            if(wgl == null)
                throw new ArgumentNullException("wgl");

            if(glLibraryProvider == null)
                throw new ArgumentNullException("glLibraryProvider");

            if(parameters == null)
                throw new ArgumentNullException("parameters");

            if(parameters.MajorVersion < 3)
                throw new VersionNotSupportedException("OpenGL version below 3.0 is not supported.", parameters);

            if(parameters.Device == 0)
                throw new ContextCreationException("Device cannot be null.", parameters);

            if(parameters.Window == 0)
                throw new ContextCreationException("Window cannot be null.", parameters);

            if(parameters.Display != 0)
                throw new ContextCreationException("Display is not supported on this platform.", parameters);

            _wgl = wgl;
            _glLibraryProvider = glLibraryProvider;
            _hdc = new IntPtr(parameters.Device);
            _contextParameters = parameters;
            _sharedContext = shareContext;


        }
Exemplo n.º 2
0
 public ContextBuilder(IWGL wgl)
 {
     _wgl = wgl;
 }