コード例 #1
0
 public DeviceInterface(Device device, CommonDeviceInterface cdi, HashTableSettings localSettings)
 {
     this.device        = device;
     this.cdi           = cdi;
     this.localSettings = localSettings;
     resourceSet        = new ResourceSet(device);
     cdi.Resources.AddSet(resourceSet);
 }
コード例 #2
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());
        }
コード例 #3
0
        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);
        }
コード例 #4
0
 public DeviceInterface(Device device, CommonDeviceInterface cdi, HashTableSettings localSettings)
 {
     this.device = device;
     this.cdi = cdi;
     this.localSettings = localSettings;
     resourceSet = new ResourceSet(device);
     cdi.Resources.AddSet(resourceSet);
 }
コード例 #5
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);
        }
コード例 #6
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);
        }