How to exchange data between renderscript and android framework?

前端 未结 1 1137
温柔的废话
温柔的废话 2021-01-03 04:18

I am new to renderscript. I am trying to add two array elements using renderscript.

I am able to pass the value to renderscript from Android by invoke_add

1条回答
  •  借酒劲吻你
    2021-01-03 05:11

    You have to use rsSendToClient(1, &data, sizeof(data)); in your script and decode the data in Java like this:

    RSMessageHandler l_resHandler = new RSMessageHandler()
    {
        @Override
        public void run()
        {
            switch (mID)
            {
                case 1:
                {
                    // Handle mData 
    
                }
                break;
                default: super.run();
                    break;
            }
        }
    
     };
     mRS.setMessageHandler(l_resHandler);
    

    But I could not decode the value yet as I asked here

    0 讨论(0)
提交回复
热议问题