示例#1
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);
        }
示例#2
0
        public GenericSceneManager(Device device, GraphicsDeviceSettings outSettings,
                                   Vector3 origin, int size)
            : base(device)
        {
            this.outSettings = outSettings;

            sceneGraph             = new OcTree <T>(size, origin);
            screenEntities         = new List <IScreenSpaceEntity>();
            postSceneWorldEntities = new List <IWorldEntity>();
            postSceneViewEntities  = new List <ViewSpaceEntity>();
            zCompareViewEntities   = new SortedList <float, ViewSpaceEntity>();
            sceneGraphEntities     = sceneGraph.SceneItems;
        }
示例#3
0
        protected virtual void CreateDxDevice()
        {
            if (GraphicsDeviceManager.CheckAdapterMeetsRequirements(0, minReqs))
            {
                GraphicsDeviceSettings outSettings = GraphicsDeviceManager.CreateOutputDescription(0, minReqs, desiredReqs);
                if (!GraphicsDeviceManager.CreateGraphicsDevice3D(outSettings, this, out outSettings, out gDevice, out pParams))
                {
                    deviceFailMsg = "MDX: Failed to create device";
                }

                if (gDevice != null)
                {
                    SetupView();
                }
            }
            else
            {
                deviceFailMsg = "MDX: Adapter does not meet minimum requirements";
                throw new Exception(deviceFailMsg);
            }
        }