示例#1
0
        public RenderingContext3D(Control targetRenderArea, GraphicsProfile profile, CommonDeviceInterface cdi,
                                  HashTableSettings localSettings)
        {
            isDeviceLost = false;
            isActive     = false;
            hasFocus     = false;

            this.targetRenderArea = targetRenderArea;
            outProfile            = profile;
            log = cdi.GeneralLog;

            presentParams = new PresentParameters();
            outCaps       = cdi.DeviceCaps;

            layers = new LayerStack();

            InitializeEnvironment(cdi, localSettings);

            view3D      = new RenderingView3DPer(Matrix.Identity, Matrix.Identity);
            view3D.Near = 0.1f;
            view3D.Far  = 25;

            int sceneSize = 60;

            sManager = new GenericSceneManager <SceneEntity>(gDevice, outSettings,
                                                             new Vector3(sceneSize / 2f, sceneSize / 2f, sceneSize / 2f), sceneSize);
        }
示例#2
0
        protected virtual void InitializeEnvironment(CommonDeviceInterface cdi, HashTableSettings localSettings)
        {
            // Get device settings
            if (outCaps == null)
            {
                outCaps = GraphicsDeviceCaps.GetDefaultAdapterCaps(outProfile.RecommendedVariations[0]);
            }
            // find first recommended settings with full match
            bool fullMatch = false;

            outSettings = GraphicsDeviceSettings.CreateFromRequirements(outProfile.RecommendedVariation,
                                                                        outCaps, outProfile.MinReqs,
                                                                        out fullMatch);

            // Set up the presentation parameters
            presentParams.Windowed               = outProfile.RecommendedVariations[0].Windowed;
            presentParams.SwapEffect             = SwapEffect.Discard;
            presentParams.AutoDepthStencilFormat = outSettings.DepthFormat;
            presentParams.EnableAutoDepthStencil = (outSettings.DepthFormat != DepthFormat.Unknown);
            presentParams.MultiSample            = outSettings.MultiSample;

            CreateDevice();

            devIf = new DeviceInterface(gDevice, cdi, localSettings);

            gPipeline = new GraphicsPipeline(gDevice);
        }
示例#3
0
        public GraphicsDeviceInfoDlg(CommonDeviceInterface cdi)
        {
            InitializeComponent();

            GraphicsDeviceCaps caps = cdi.DeviceCaps;

            AddItem("Adapter Desc", caps.AdapterDetails.Description);
            AddItem("Driver Name", caps.AdapterDetails.DriverName);
            AddItem("Driver Version", caps.AdapterDetails.DriverVersion.ToString());
            AddItem("T&L Support", caps.HardwareTnL.ToString());
            AddItem("Vertex Shader", caps.VertexShaderVersion.ToString());
            AddItem("Pixel Shader", caps.FragmentShaderVersion.ToString());
        }
        public VisRenderingContext3D(ISettings settings, Control targetRenderArea,
                                     CommonDeviceInterface cdi, GraphicsProfile gProfile)
            : base(targetRenderArea, gProfile, cdi, (HashTableSettings)settings)
        {
            /*List<ISharableResource> shared = new List<ISharableResource>();
             * ILayer layer = (ILayer)devIf.GetSharedResource("file://media/ui/common/WelcomeLayer.xml", ref shared);
             * layers.InsertLayer(layer, uint.MinValue);*/

            //deMap = new DigitalElevationMap(new Size(), null);
            //deMap.Init(devIf.Device);

            loadingLayer = new LoadingLayer(devIf, new Point(), new Size(300, 300), "LoadingLayer", null, null);
            layers.InsertLayer(loadingLayer, uint.MinValue);
        }
示例#5
0
        protected virtual void InitializeEnvironment(CommonDeviceInterface cdi)
        {
            // Get device settings
            if (outCaps == null)
            {
                outCaps = OutputCaps.GetDefaultAdapterCaps(outReqs);
            }
            outSettings = OutputSettings.CreateFromRequirements(outReqs, outCaps, outMinReqs);

            // Set up the presentation parameters
            presentParams.Windowed               = outReqs.Windowed;
            presentParams.SwapEffect             = SwapEffect.Discard;
            presentParams.AutoDepthStencilFormat = outSettings.DepthFormat;
            presentParams.EnableAutoDepthStencil = (outSettings.DepthFormat != DepthFormat.Unknown);

            CreateDevice();

            devIf = new DeviceInterface(device, cdi);
        }
        protected override void InitializeEnvironment(CommonDeviceInterface cdi)
        {
            base.InitializeEnvironment(cdi);

            pipeline = new GraphicsFixedPipeline3D(device);//new GraphicsProgramablePipeline3D(device);

            ChemSymbolTextures.GraphicsDevice = device;

            sceneManager = new MoleculeSceneManager(device, outSettings);

            selectionLine           = new Line(device);
            selectionLine.Antialias = false;
            selectionArea           = new Vector2[5];

            molControlLayer = new MoleculeControlLayer(devIf, new Point(), new Size());
            molControlLayer.Show(false);
            molControlLayer.LoadResources();
            layers.InsertLayer(molControlLayer, uint.MaxValue);
        }
        public ChemRenderingContext3DDX9(ISettings settings, Control targetRenderArea,
                                         CommonDeviceInterface cdi)
            : base(targetRenderArea, GetOutputRequirements(),
                   new OutputRequirements(MultiSampleType.None, DeviceType.Software, Format.X8R8G8B8, true, DepthFormat.D16, false, null),
                   cdi)
        {
            this.settings = settings;

            axis = new Axis3D();
            axis.Init(device);
            rotation = Matrix.Identity;

            cStatus = Status.Idle;

            //loadingLayer = new LoadingGUILayer(devIf, 100, 100);
            //loadingLayer.LoadResources();

            selectedAtoms = new List <AtomSelectionEntity>();
            modeEntities  = new List <IEntity>();
        }
示例#8
0
        public RenderingContext3DDX9(Control targetRenderArea, OutputRequirements oRequirements,
                                     OutputRequirements oMinReqs, CommonDeviceInterface cdi)
        {
            isDeviceLost = false;
            isActive     = false;
            hasFocus     = false;

            this.targetRenderArea = targetRenderArea;
            outReqs    = oRequirements;
            outMinReqs = oMinReqs;
            log        = cdi.GeneralLog;

            presentParams = new PresentParameters();
            outCaps       = cdi.DeviceCaps;

            layers = new LayerStack();

            InitializeEnvironment(cdi);

            view3D = new RenderingView3DPer(Matrix.Identity, Matrix.Identity);
        }