예제 #1
0
파일: COutput.cs 프로젝트: Zulkir/Beholder
        public COutput(DisplayDevice glDisplayDevice, int index)
        {
            this.glDisplayDevice = glDisplayDevice;

            outputDesc = new OutputDescription
            {
                DeviceName = string.Format("Display{0}", index.ToString(CultureInfo.InvariantCulture)),
                DesctopCoordinates = new Rectangle(),
                AttachedToDesctop = false,
                Rotation = ModeRotation.Unspecified,
                MonitorHandle = glDisplayDevice
            };
        }
예제 #2
0
파일: COutput.cs 프로젝트: Zulkir/Beholder
        internal COutput(Output dxgiOutput)
        {
            this.dxgiOutput = dxgiOutput;

            var dxgiDesc = dxgiOutput.Description;
            var bounds = dxgiDesc.DesktopBounds;

            desc = new OutputDescription
            {
                DeviceName = dxgiDesc.DeviceName,
                DesctopCoordinates = new Math.Rectangle(bounds.Left, bounds.Top, bounds.Width, bounds.Height),
                AttachedToDesctop = dxgiDesc.IsAttachedToDesktop,
                Rotation = CtBeholder.ModeRotation(dxgiDesc.Rotation),
                MonitorHandle = dxgiDesc.MonitorHandle
            };
        }
예제 #3
0
파일: COutput.cs 프로젝트: Zulkir/Beholder
 public void GetDescription(out OutputDescription description)
 {
     description = outputDesc;
 }
예제 #4
0
파일: CAdapter.cs 프로젝트: Zulkir/Beholder
 void IOutput.GetDescription(out OutputDescription description)
 {
     description = outputDesc;
 }
예제 #5
0
파일: CAdapter.cs 프로젝트: Zulkir/Beholder
        public CAdapter(Direct3D direct3D, AdapterInformation adapterInfo)
        {
            this.direct3D = direct3D;
            this.adapterInfo = adapterInfo;
            desctopDisplayMode = adapterInfo.CurrentDisplayMode;
            caps = adapterInfo.GetCaps(DeviceType.Hardware);
            index = adapterInfo.Adapter;
            var shaderModel = System.Math.Min(caps.VertexShaderVersion.Major, caps.PixelShaderVersion.Major);
            apiVersion = new ApiVersion(9, (byte)shaderModel);
            var details = adapterInfo.Details;
            restrictions = new AdapterRestrictions
            {
                UniformBufferSlots = 256,
                SamplerSlots = caps.MaxSimultaneousTextures,
                ShaderResourceSlots = caps.MaxSimultaneousTextures,
                UnorderedAccessResourceSlots = 0,
                MaxVertexStreams = caps.MaxStreams,
                MaxVertexStreamElementCount = caps.MaxStreamStride / (4 * sizeof(float)),
                MaxStreamOutputTargets = 0,
                MaxViewports = 1,
                MaxRenderTargets = caps.SimultaneousRTCount,
                MaxThreadGroupsX = 0,
                MaxThreadGroupsY = 0,
                MaxThreadGroupsZ = 0,
                MaxThreadGroupsTotal = 0,
            };

            adapterDesc = new AdapterDescription
            {
                Description = details.Description,
                VendorId = details.VendorId,
                DeviceId = details.DeviceId,
                SubSysId = details.SubsystemId,
                Revision = details.Revision,
                DedicatedVideoMemory = 0,
                DedicatedSystemMemory = 0,
                SharedSystemMemory = 0,
                AdapterLuidHigh = 0,
                AdapterLuidLow = 0,
                Flags = AdapterFlags.None
            };

            outputDesc = new OutputDescription
            {
                DeviceName = details.DeviceName,
                DesctopCoordinates = new Math.Rectangle(),
                AttachedToDesctop = false,
                Rotation = ModeRotation.Unspecified,
                MonitorHandle = adapterInfo.Monitor
            };

            outputs = new[] { this };

            formatSupports = ((Format[])Enum.GetValues(typeof(Format))).ToDictionary(f => f, GetFormatSupport);
        }