Could not find a Direct3D device that has a Direct3D9-level driver and supports pixel shader 1.1 or greater.终极解决方法
2008-02-21 15:15
399 查看
今天想试试XNA2.0好玩不好玩,结果上来就遇到难题,从网上DOWN下来XNA STUDIO后安装一切顺利,
之后安装了DX9,一切顺利,新建一个项目,运行,报错!
Could not find a Direct3D device that has a Direct3D9-level driver and supports pixel shader 1.1 or greater.
网上先查一查,结果中文资料好少,从一些网站了解到,是由于显示太老,给出的答案是:换显卡;
后来搜到一篇文章中提到,可以更改渲染方式,指定为软件模拟而不使用硬件,由于以前研究过一段时间DX,
感觉这应该是个解决的办法,当然最终还是依靠这个思路解决的,这篇文章并没有最终解决问题的代码,但是也帮了不少的忙,
先看最初的代码吧,
public class Game1 : Microsoft.Xna.Framework.Game {
static class Program {
public class Game1 : Microsoft.Xna.Framework.Game {
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
public Game1() {
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings);
}
void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e) {
e.GraphicsDeviceInformation.CreationOptions = CreateOptions.SoftwareVertexProcessing;
e.GraphicsDeviceInformation.DeviceType = DeviceType.Reference;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType = MultiSampleType.None;
}
F5执行,直接提示我,
错误 2 当前上下文中不存在名称“CreateOptions” E:"WindowsGame1"WindowsGame1"Game1.cs 27 67 WindowsGame1
又从网上搜索,发现此方法已经被Removed,将其注释掉编译通过,
F5执行,提示
Could not find a Direct3D device that has a Direct3D9-level driver and supports pixel shader 1.1 or greater.
晕,这不又回到原点了么,
后来调试发现,此方法似乎并没有执行,为什么没有执行呢?我也没兴趣研究下去了,现在我只想运行出一个窗口来!
终于在一个国外的网站上发现了一个好东西,
通过,将此代码上传,希望对此有研究的高人表笑话,如果此文对您有些许帮助,荣幸之极,
本人在此过程中仅仅充当了一个finder角色,一些东西还停留在学习的阶段,共同进步吧!
/Files/kkun/ReferenceGraphicsDeviceManager.rar
之后安装了DX9,一切顺利,新建一个项目,运行,报错!
Could not find a Direct3D device that has a Direct3D9-level driver and supports pixel shader 1.1 or greater.
网上先查一查,结果中文资料好少,从一些网站了解到,是由于显示太老,给出的答案是:换显卡;
后来搜到一篇文章中提到,可以更改渲染方式,指定为软件模拟而不使用硬件,由于以前研究过一段时间DX,
感觉这应该是个解决的办法,当然最终还是依靠这个思路解决的,这篇文章并没有最终解决问题的代码,但是也帮了不少的忙,
先看最初的代码吧,
public class Game1 : Microsoft.Xna.Framework.Game {
static class Program {
public class Game1 : Microsoft.Xna.Framework.Game {
GraphicsDeviceManager graphics;
SpriteBatch spriteBatch;
public Game1() {
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
graphics.PreparingDeviceSettings += new EventHandler<PreparingDeviceSettingsEventArgs>(graphics_PreparingDeviceSettings);
}
void graphics_PreparingDeviceSettings(object sender, PreparingDeviceSettingsEventArgs e) {
e.GraphicsDeviceInformation.CreationOptions = CreateOptions.SoftwareVertexProcessing;
e.GraphicsDeviceInformation.DeviceType = DeviceType.Reference;
e.GraphicsDeviceInformation.PresentationParameters.MultiSampleType = MultiSampleType.None;
}
F5执行,直接提示我,
错误 2 当前上下文中不存在名称“CreateOptions” E:"WindowsGame1"WindowsGame1"Game1.cs 27 67 WindowsGame1
又从网上搜索,发现此方法已经被Removed,将其注释掉编译通过,
F5执行,提示
Could not find a Direct3D device that has a Direct3D9-level driver and supports pixel shader 1.1 or greater.
晕,这不又回到原点了么,
后来调试发现,此方法似乎并没有执行,为什么没有执行呢?我也没兴趣研究下去了,现在我只想运行出一个窗口来!
终于在一个国外的网站上发现了一个好东西,
ReferenceGraphicsDeviceManager
这个东西基本可以解决问题了,新建一个类ReferenceGraphicsDeviceManager,然后将GraphicsDeviceManager替换为ReferenceGraphicsDeviceManager,再次编译,报错,这个类的作者在写的时候XNA2.0应该还没出呢,于是这次都是一些版本上的错误,一一修改后,编译通过,F5运行...通过,将此代码上传,希望对此有研究的高人表笑话,如果此文对您有些许帮助,荣幸之极,
本人在此过程中仅仅充当了一个finder角色,一些东西还停留在学习的阶段,共同进步吧!
/Files/kkun/ReferenceGraphicsDeviceManager.rar
相关文章推荐
- Could not find a Direct3D device that has a Direct3D9-level driver and supports pixel shader 1.1 or greater.终极解决方法
- Syntax error, annotations are only available if source level is 1.5 or greater解决方法
- Maven报错Please ensure you are using JDK 1.4 or above and not a JRE解决方法
- Android requires compiler compliance level 5.0 or 6.0. 出错原因分析、解决方法
- A context path must either be an empty string or start with a '/' and do not end with a '/' 问题解决方法
- ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired解决方法
- 安卓错误提示Android requires compiler compliance level 5.0 or 6.0. Found '1.7' instead的解决方法
- windows上zend server安装 报The server encountered an internal error or misconfiguration and was unable to complete your request -解决方法 摘自网络
- Maven报错Please ensure you are using JDK 1.4 or above and not a JRE解决方法
- Attribute xx is only used in API level xx and higher (current min is xx)的解决方法
- NaN and infinity literals not allowed by shader model 错误解决方法
- Maven报错Please ensure you are using JDK 1.4 or above and not a JRE解决方法
- Maven报错Please ensure you are using JDK 1.4 or above and not a JRE解决方法!
- Android requires compiler compliance level 5.0 or 6.0. Found '1.4' instead.解决方法
- eclipse svn -- - --- appears to be part of a subversion 1.7 or greater....解决方法
- 关于vc调试出现One or more breakpoints cannot be set and have been disabled解决方法
- 关于vc调试出现One or more breakpoints cannot be set and have been disabled解决方法
- Webdriver Element is not currently visible and so may not be interactedwith 解决方法
- Maven报错Please ensure you are using JDK 1.4 or above and not a JRE解决方法
- HTTP status code is not handled or not allowed的解决方法