本文整理汇总了C#中System.Script.GetNumber方法的典型用法代码示例。如果您正苦于以下问题:C# Script.GetNumber方法的具体用法?C# Script.GetNumber怎么用?C# Script.GetNumber使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Script
的用法示例。
在下文中一共展示了Script.GetNumber方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeviceEnumeration
public DeviceEnumeration(Direct3D d3d)
{
InitializeComponent();
_displayModes = new List<DisplayMode>();
_settingsScript = new Script("DisplaySettings.txt");
_adapter = d3d.GetAdapterIdentifier(0);
var allowedFormats = new[] {
Format.X1R5G5B5,
Format.A1R5G5B5,
Format.R5G6B5,
Format.X8R8G8B8,
Format.A8R8G8B8,
Format.A2R10G10B10,
};
for (var af = 0; af < allowedFormats.Length; af++) {
var format = allowedFormats[af];
var modes = d3d.GetAdapterModeCount(0, format);
for (var m = 0; m < modes; m++) {
var mode = d3d.EnumerateAdapterModes(0, format, m);
if (mode.Height < 600) continue;
var displayMode = new DisplayMode {
Mode = mode,
Bpp = af < 3 ? "16 bpp" : "32 bpp"
};
_displayModes.Add(displayMode);
}
}
txtAdapterName.Text = _adapter.Description;
txtDriverVersion.Text = _adapter.DriverVersion.ToString();
if (_settingsScript.VariableCount == 0) {
_windowed = true;
rbWindowed.Checked = true;
} else {
if (_settingsScript.GetBool("windowed")) {
_windowed = true;
rbWindowed.Checked = true;
} else {
rbFullscreen.Checked = true;
_windowed = false;
}
}
if (!_windowed) {
// enable fullscreen options
chkVSync.Enabled = true;
cbColorFormat.Enabled = true;
cbResolution.Enabled = true;
cbRefresh.Enabled = true;
chkVSync.Checked = _settingsScript.GetBool("vsync");
ResetColorFormats();
long selectedRes = _settingsScript.GetNumber("resolution");
ResetResolution(selectedRes);
long refresh = _settingsScript.GetNumber("refresh");
ResetRefresh(refresh);
}
}