opengl-es - Xamarin : Loading resources via GetManifestResourceStream

标签 opengl-es xamarin xamarin.ios xamarin.forms

我正在开发一个使用 OpenGL/OpenTK 的 Xamarin 表单项目。我正在尝试使用 GetManifestResourceStream 加载着色器。无论我做什么,我都会得到空

代码正在从.Shared项目运行,着色器位于.ios/.Android资源目录中

string prefix;

#if __IOS__ 
prefix = "OpenGLTesting.iOS.";
#endif
#if __ANDROID__
prefix = "OpenGLTesting.Droid.";
#endif

var assembly = typeof(App).GetTypeInfo ().Assembly;
Stream stream = assembly.GetManifestResourceStream (prefix + shaderName + ".glsl");

最佳答案

添加一些调试代码,例如调用assemble.GetManifestResourceNames ();,因此请确保您拥有正确的名称并且它已嵌入到程序集中。

关于opengl-es - Xamarin : Loading resources via GetManifestResourceStream,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30917144/

相关文章:

ios - 在 View 加载时隐藏 UIView - Xamarin iOS 和 MvvmCross

audio - 将数据按原样发送到 Xamarin.Forms 中的音频设备

ios - ipad 3 - kEAGLDrawablePropertyRetainedBacking 和视网膜的 openGL 错误?

c# - 如何在Xamarin.form中使用本地数据库?

c# - 让 ControlTemplate 中的 AutowireViewModel 工作

ios - 在 ios 应用程序中使用 svg 或字体图标

opengl-es - 为 OpenGL (ES) 创建可靠的(帧率稳定的)游戏引擎

android - 如何在 OpenGL ES 中的纹理上添加一些像素

android - OpenGL ES 2.0 中的抗锯齿?

android - 'mono shared runtime' 始终部署到 android 设备