中国开发网: 论坛: .NET/C#: 贴子 116983
heavenround: 问个初始化D3D的问题?
用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
也不知道为什么?
我是新手经常有很多问题不明白,请多多指教!

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录