[阅读: 768] 2005-03-20 04:11:32
用C#初始化一个device为什么总是失败?
代码如下:
using Microsoft.DirectX;
..
using Microsoft.DirectX.Direct3D;
class XX:Form
{
//声明成员
..
//初始化
bool init{
..
PresentParameters presentParams = new PresentParameters();
presentParams.Windowed=true;
presentParams.SwapEffect = SwapEffect.Discard;
device = new Device(0, DeviceType.Hardware , this, CreateFlags.SoftwareVertexProcessing, resentParams);
..
}
..
}
帮帮忙,有能初始化成功的给个原码.
还有
AdapterCollection adapterCollection=Manage.Adapter;//收集本地系统上的Aapter,我机器上数量为1
AdapterInformation adapterInfo=(AdapterInformation)adapterCollection.Default;//返回缺省adapter
AdapterDetails adapterDetail=adapterInfo.Information//得到当前adapter的详细信息
就是最后一步总是出现 InvalidCallException
也不知道为什么?
我是新手经常有很多问题不明白,请多多指教!