Windows Phone 自定义着色器错误? [英] Windows Phone custom shaders error?

查看:32
本文介绍了Windows Phone 自定义着色器错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Windows Phone XNA 4.0 中,我在编译时收到以下错误: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.

这真的很烦人,因为我有一个 Xbox 360 版本的项目,还有一个 Windows 版本的项目.

This is really annoying, because I have an Xbox 360 version of the project, and a Windows version of the project as well.

我尝试使用基于编译的 #if !WINDOWS_PHONE#endif,但没有成功.它似乎忽略了这一点.

I tried using the compilation based #if !WINDOWS_PHONE and #endif, but with no luck. It seems as if it ignores this.

如何在 Windows Phone 项目中编译时排除或忽略此文件?

How can I make this file be excluded or ignored when compiled in the Windows Phone project?

推荐答案

作为一种解决方法,您可以:

As a workaround, you could:

  • 为 WP7 和 Xbox 创建单独的游戏和内容项目
  • 在 WP7 上手动将构建操作"从编译"切换为无"(仅适用于受虐狂)
  • 由于资产构建操作是在 .contentproj 文件中定义的,您可以拥有它的 2 个版本或编写一个修改它的脚本(并且该脚本可能会作为编译过程的一部分自动运行)

由于您可能还想在 WP7 上使用比在 Xbox 上使用的更小的纹理等,因此我只需为 WP7 和 Xbox 创建单独的游戏和内容项目,并将通用游戏代码移动到库中.

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 自定义着色器错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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