Windows Phone 自定义着色器错误?
在 Windows Phone XNA 4.0 中,我在编译时收到以下错误:Windows Phone 平台不支持自定义着色器。
这真的很烦人,因为我有一个 Xbox 360 版本的项目,还有一个 Windows 版本的项目。
我尝试使用基于编译的 #if !WINDOWS_PHONE
和 #endif
,但没有成功。似乎忽略了这一点。
如何在 Windows Phone 项目中编译时排除或忽略此文件?
In Windows Phone XNA 4.0, I am receiving the following error when compiling: the windows phone platform does not support custom shaders.
This is really annoying, because I have an Xbox 360 version of the project, and a Windows version of the project as well.
I tried using the compilation based #if !WINDOWS_PHONE
and #endif
, but with no luck. It seems as if it ignores this.
How can I make this file be excluded or ignored when compiled in the Windows Phone project?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
只是猜测,但您可以使用
#ifndef WINDOWS_PHONE
代替吗?Just a guess, but can you use
#ifndef WINDOWS_PHONE
instead?作为解决方法,您可以:
因为您可能还想在与您在 Xbox 上使用的 WP7 相比,我只需为 WP7 和 Xbox 创建单独的游戏和内容项目,并将通用游戏代码移至库中。
哦,请告诉我您是否知道如何根据解决方案配置等选择不同的内容项目,以便不需要单独的游戏项目:)
As a workaround, you could:
Since you might also want to use smaller textures etc. on WP7 than you are using on Xbox, I'd just create separate game and content projects for WP7 and Xbox and move the common game code to a library.
Oh, and tell me if you figure how to select a different content project based on, e.g., the solution configuration so that the separate game project is not needed :)
Windows Phone 7 上不支持 XNA 游戏的自定义着色器,但我不知道 SilverLight 的任何功能。
但是,有几种可以在 XNA 中使用的内置效果:
•SkinnedEffect
•EnvironmentMapEffect
•DualTextureEffect
•AlphaTestEffect
针对 XNA
Reach
配置文件的游戏将是跨平台的,因为 Reach 配置文件包含以下元素:在 XNA 的所有实现中共享。要使用更高级的选项,需要以Hi-Def
配置文件为目标。但Hi-Def
与 Windows Phone 不兼容。Custom shaders for XNA games, on Windows Phone 7, are not supported, but I don't know about any capabilities for SilverLight.
There are several built in effects that can be used in XNA however:
•SkinnedEffect
•EnvironmentMapEffect
•DualTextureEffect
•AlphaTestEffect
Games that target the XNA
Reach
profile are going to be cross platform as the Reach profile contains elements that are shared across all implementations of XNA. To use more advanced options theHi-Def
profile would need to be targetted. ButHi-Def
doesn't have compatibility with Windows Phone.