예제 #1
0
 public DeviceInterface(Device device, CommonDeviceInterface cdi)
 {
     this.device      = device;
     this.cdi         = cdi;
     this.resourceSet = new ResourceSet(device);
     cdi.Resources.AddSet(resourceSet);
 }
        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);
        }
 public DeviceInterface(Device device, CommonDeviceInterface cdi)
 {
     this.device = device;
     this.cdi = cdi;
     this.resourceSet = new ResourceSet(device);
     cdi.Resources.AddSet(resourceSet);
 }
        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);
        }