January 2012
Intermediate to advanced
282 pages
7h 4m
English
Let's modify Listing 9–5 a little bit to learn more about the reflected layer. So far, we only saw how the hello_world routine from the script was reflected in Listing 9–2. Here we are going to add more variables in the script, which we will call hellorendering2.rs, as shown in Listing 9–9.
Listing 9–9. Changing Background Color (Second Version)
#pragma version(1)
#pragma rs java_package_name(com.apress.proandroid.ch9)
#include "rs_graphics.rsh"
// we removed init() as it was empty anyway
float red = 0.0f; // initialized to 1.0f
float green; // purposely not initialized
static float blue; // purposely not initialized, static
const float alpha = 1.0f; // constant
int root() { // clear the background color ...