Eclipse中无法读取RenderScript .RS文件code画幅 [英] Eclipse can't read code format of RenderScript .rs file

查看:661
本文介绍了Eclipse中无法读取RenderScript .RS文件code画幅的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Android的一个非常优秀的Java知识(1年的发展),现在我努力学习了Android RenderScript API(但没有太多的单证它)反正,我有一些问题吧。

I have a very good Java knowledge for Android (1 year of development), and now I'm trying to learn the Android RenderScript API (but there isn't much documentations for it) anyway, I'm having some problems with it.

我了解到,我们需要添加以下行 project.propert

I learned that we need to add the following lines on project.propert:

renderscript.target=19
renderscript.support.mode=true

我创建了 com.mypackage.script A .RS文件名为 FireworkScript ,它具有以下内容:

I created a .rs file in com.mypackage.script called FireworkScript, which has the following:

#pragma version(1)

#pragma rs java_package_name(com.mypackage.script)

#include "rs_graphics.rsh"

int root(){

    return 0;

}

void init(){

} 

Innitially我有一些问题RenderScript V8支持库,但我通过手动添加在 renderscript-v8.jar ,以我的项目固定它(构建路径>>配置构建路径> > >>库添加外部JAR

Innitially I had some problems with the RenderScript v8 support library, but I fixed it by manually adding the renderscript-v8.jar to my project (Build Path >> Configure Build Path >> Libraries >> Add External JARs)

正如预期的那样,Eclipse中产生的 ScriptC_FireworkScript.java 文件夹和 fireworkscript.bc 斌/ RES / BC /原料

As expected, Eclipse generated the ScriptC_FireworkScript.java at gen folder and the fireworkscript.bc at bin/res/bc/raw

但问题是:Eclipse不读的.RS文件中的code,书面方式使用Eclipse的这个文件是一样的书面方式于任何单一的文本编辑器。

But the problem is: Eclipse doesn't "read" the code inside the .rs file, writting on this file using eclipse is the same as writting on any single text editor.

我知道上面的示例需要一个内核,但我怎么能写呢,如果Eclipse不读其code格式?我知道简单的 typedef结构构造函数C,但我不会与内核的声明和参数在C99熟悉

I know the sample above needs a Kernel, but how can I write it, if Eclipse doesn't read its code format? I know the simple typedef struct constructor in C, but I'm not familiarized with kernel declarations and arguments in C99

我只可以用项目&GT发现错误;清洁,似乎要刷新的编译器,但无论如何,我没有任何identation帮助,文本颜色,任何事情,只是上面有黑色的文本文件,我能做些什么来解决这一问题?我也试着打开.RS是开发C ++ 记事本+ + 文件,但我有同样的结果。也许我的机器不知道C99 code格式化?

I can only find errors using project > clean, it seems to "refresh" the compiler, but anyway, I don't have any identation help, text-coloring, anything, only a file with black texts on it, what can I do to fix this? I also tried to open the .rs file with Dev C++ and Notepad++, but I had the same result. Maybe my machine doesn't know the C99 code formating?

有什么我可以做什么?

先谢谢了。

我使用Eclipse月神与ADT pluging,SDK构建工具目前23.0.2,一切都更新到最新版本。

推荐答案

的C99规范RenderScript用于其内核code只是C,这样你就可以使用能够编辑的C任何编辑器/ C ++文件,例如这两个你所提到的。这会帮助你获得的语法至少突出。你只需要配置它们对待.RS文件为C code。例如,见<一href=\"http://allthingsmarked.com/2009/07/29/associate-file-extensions-with-specific-languages-in-notepad-plus-plus/\"相对=nofollow>此页面说明如何做,在记事本+ +。

The C99 specification RenderScript uses for its kernel code is simply C, so you can use any editor capable of editing C/C++ files such as those two you mentioned. This should help you get syntax highlighting at least. You'll just need to configure them to treat .rs files as C code. See for example this page that explains how to do that in Notepad++.

如果你真的想在Eclipse中保持一切虽然,你也可以尝试安装C开发环境Eclipse的,但可能是矫枉过正只是为了获得语法高亮那里。我怀疑你会得到任何实际的上下文/功能帮助或更好的错误与报告,因为RS API仍然没有很好地融入任何IDE反正。

If you really want to keep everything within Eclipse though, you could also try installing the C development environment for Eclipse, but that might be overkill just to get syntax highlighting there. I doubt you would get any actual context/function help or better error reporting with that, since the RS API is still not well integrated into any IDE anyway.

这篇关于Eclipse中无法读取RenderScript .RS文件code画幅的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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