android.renderscript.renderscriptGL issue

烈酒焚心 提交于 2019-12-13 05:10:55

问题


I've been trying to create a live wallpaper on android.
I'm using the tutorial mentioned below.
http://mobile.tutsplus.com/tutorials/android/getting-started-with-renderscript-on-android/
I've copied the source code and also installed the support libraries.
I however cannot find support v8 in my SDK folders located in my program files in the windows system :(
These imports work for me after i changed my project properties and added

renderscript.target=18

renderscript.support.mode=true

sdk.buildtools=18.1.0


import android.renderscript.Allocation;

import android.renderscript.Element;

import android.renderscript.Float2;

import android.renderscript.Matrix4f;

but these imports still do not work.

import android.renderscript.Mesh;

import android.renderscript.ProgramFragment;

import android.renderscript.ProgramFragmentFixedFunction;

import android.renderscript.ProgramRaster;

import android.renderscript.ProgramRaster.CullMode;

import android.renderscript.ProgramStore;

import android.renderscript.ProgramVertex;

android.renderscript.RenderScriptGL;

How do I get these to work :(. I have been trying for a while.

Write now in my sdk extras I can see support for v4 but nothing for v8 :( so because of that import android.support.v8 will also fail.


回答1:


You cannot use the RenderScript graphics APIs with the support library. You can only use the compute functions.




回答2:


Those imports won't resolve because all those classes are deprecated.




回答3:


renderscript-v8.jar you can find by sdk\build-tools\21.1.2\renderscript\lib

dependencies {
    compile files("libs/renderscript-v8.jar")
}

but if you want use RenderScriptGL you should compileSdkVersion -> 11~13

android { compileSdkVersion 13 buildToolsVersion "25.0.2"

defaultConfig {
    applicationId "com.carapk.noisefield"
    minSdkVersion 13
    targetSdkVersion 25
    versionCode 1
    versionName "1.0"
    renderscriptTargetApi 19
    renderscriptSupportModeEnabled false
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}


来源:https://stackoverflow.com/questions/19760918/android-renderscript-renderscriptgl-issue

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!