试编一段程序出现点问题~public bool InitializeGraphics()
我在做《Direct3D和XNA游戏开发基础(C#语言版)》上边第六章的第一个例子(哪位要是也有这本书麻烦联系一下,哈哈,谢谢了)从运行结果看来,是下边这段代码中的bool值为false,不太明白这段代码的具体意义,谁能帮我解答一下,在怎样的情况下,这个bool值才会是false呢~谢谢大家了
public bool InitializeGraphics()
{
try
{
PresentParameters presentParams = new PresentParameters();
presentParams.Windowed = true;
presentParams.SwapEffect = SwapEffect.Discard;
presentParams.EnableAutoDepthStencil = true;
presentParams.AutoDepthStencilFormat = DepthFormat.D16;
device = new Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, presentParams);
device.DeviceReset += new System.EventHandler(this.OnResetDevice);
this.OnCreateDevice(device, null);
this.OnResetDevice(device, null);
}
catch (DirectXException)
{
return false;
}
return true;
} --------------------编程问答-------------------- 没人理我~~自己顶先,呵呵 --------------------编程问答-------------------- 帮顶^_^帮顶^_^帮顶^_^帮顶^_^帮顶^_^帮顶^_^帮顶^_^ --------------------编程问答-------------------- 帮顶
居然被判定恶意灌水。。
--------------------编程问答-------------------- 萧条啊,难道现在来的人不多了? --------------------编程问答-------------------- InitializeGraphics()方法就是根据一些设定的设备参数以及根据当前机器的硬件性能来生成一个设备对象
不能初始化3D设备就为false --------------------编程问答-------------------- 楼上,具体在什么情况下会不能初始化3d设备哩~try里边的几句不是很明白 --------------------编程问答-------------------- 学习下,字数,,字数,,字数
补充:.NET技术 , C#