Search code examples
androidrenderscript

Is there any way to check in RenderScrpt if an rs_allocation has been bound properly?


Whenever I define

rs_allocation abcd;

in my renderscript, I am afraid I will forget to bind it from Java, leading to cryptic issues. Is there any way to write

if (abcd == NULL)
    rsDebug("Error");

or

if (!rsIsValidAllocation(abcd))
    rsDebug("Error");

etc ?


Solution

  • You want something like this...

    if(!rsIsObject(abcd))