如何解决错误+ D3DERR_NOTAVAILABLE + directX + c#。我使用的是Windows XP [英] how to resolve error+D3DERR_NOTAVAILABLE+directX+c#. I am using Windows XP

查看:326
本文介绍了如何解决错误+ D3DERR_NOTAVAILABLE + directX + c#。我使用的是Windows XP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在C#中使用DirectX。它无法创建设备,并且提供错误为"D3DERR_NOTAVAILABLE"。任何人都可以帮助我。


private void InitDirectX()

        {

           试试
            {

                PresentParameters presentParamaters = new PresentParameters();


                if(presentParamaters == null)

                {

                    MessageBox.Show("创建演示参数时出错!");
$
               ;      Application.Exit();&
                }


                this.Width = 800;

                this.Height = 600;


                presentParamaters.Windowed = true;

                presentParamaters.SwapEffect = SwapEffect.Discard;

                presentParamaters.BackBufferWidth = 640;

                presentParamaters.BackBufferHeight = 480;


                设备=新的设备(0,DeviceType.Hardware,为此,

       &NBSP ;            CreateFlags.SoftwareVertexProcessing,

&NBSP ;                   presentParamaters); ---------------------> 此部分投入
错误


              &NBSP ; if(device == null)

                {

                    MessageBox.Show(QUOT;错误创建的Direct3D设备");

              &NBSP ;     Application.Exit();&
                }
                string信息; // =新的字符串();

                msg =" Width =" + this.Width.ToString()+",Height =" + this.Height.ToString();

                MessageBox.Show(msg);

            }
            catch(DirectXException e)

            {

                MessageBox.Show(e.ToString()," Error"); //处理所有例外情况

            }


        }

解决方案

您有更好的机会得到答案的一个直接X论坛:的
http://xboxforums.create.msdn.com/forums/


虽然看起来像你'重新使用古老的Managed DirectX库,这个库已经过时了,这对答案没有帮助......


I want to use DirectX with C#. it is not able to create Device and it is giving error as "D3DERR_NOTAVAILABLE". Can anyone please help me on this.

private void InitDirectX()
        {
            try
            {
                PresentParameters presentParamaters = new PresentParameters();

                if (presentParamaters == null)
                {
                    MessageBox.Show("Error creating Presentation Parameters!");
                    Application.Exit();
                }

                this.Width = 800;
                this.Height = 600;

                presentParamaters.Windowed = true;
                presentParamaters.SwapEffect = SwapEffect.Discard;
                presentParamaters.BackBufferWidth = 640;
                presentParamaters.BackBufferHeight = 480;

                device = new Device(0, DeviceType.Hardware, this,
                    CreateFlags.SoftwareVertexProcessing,
                    presentParamaters);---------------------> This portion is throwing error

                if (device == null)
                {
                    MessageBox.Show("Error creating Direct3D Device");
                    Application.Exit();
                }
                string msg;// = new string();
                msg = "Width = " + this.Width.ToString() + ", Height = " + this.Height.ToString();
                MessageBox.Show(msg);
            }
            catch (DirectXException e)
            {
                MessageBox.Show(e.ToString(), "Error"); // Handle all the exceptions
            }

        }

解决方案

You have a better chance to get an answer in a Direct X forum: http://xboxforums.create.msdn.com/forums/

Though it seems that you're using the ancient Managed DirectX library which is obsolete, that doesn't exactly help with answers...


这篇关于如何解决错误+ D3DERR_NOTAVAILABLE + directX + c#。我使用的是Windows XP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆