提问,暴弱智的问题.望高手解答.
是这样的,我下载了DirectX9.0的SDK里面有Managed DirectX的代码示例,在
Microsoft DirectX SDK (August 2007)\Samples\Managed\Direct3D\Tutorials\Tutorial1目录中.
里面有一个
public bool InitializeGraphics() { try { // Now let's setup our D3D stuff PresentParameters presentParams = new PresentParameters(); presentParams.Windowed = true; presentParams.SwapEffect = SwapEffect.Discard; device = new Device(0, DeviceType.Hardware, this, CreateFlags.SoftwareVertexProcessing, presentParams); this.OnCreateDevice(device, null); return true; } catch (DirectXException) { return false; } }