-
- int numImages = !gNinePatch ? NUM_IMAGES : NUM_NINEPATCH_IMAGES;
- static Renderer* renderers = new Renderer[numImages];
- if( !renderers[index] )
- {
- //Create the renderer
- Shader shader = Shader::New( VERTEX_SHADER_TEXTURE, FRAGMENT_SHADER_TEXTURE );
-
- const char* imagePath = !gNinePatch ? IMAGE_PATH[index] : NINEPATCH_IMAGE_PATH[index];
- Image image = ResourceImage::New( imagePath );
-
- TextureSet textureSet = TextureSet::New();
- textureSet.SetImage( 0u, image );
- renderers[index] = Renderer::New( QuadMesh(), shader );
- renderers[index].SetTextures( textureSet );
- renderers[index].SetProperty( Renderer::Property::BLENDING_MODE, BlendingMode::OFF );
-
- }
- return renderers[index];
+ Renderer renderer = Renderer::New( geometry, shader );
+ const char* imagePath = !gNinePatch ? IMAGE_PATH[index] : NINEPATCH_IMAGE_PATH[index];
+ Texture texture = DemoHelper::LoadTexture( imagePath );
+ TextureSet textureSet = TextureSet::New();
+ textureSet.SetTexture( 0u, texture );
+ renderer.SetTextures( textureSet );
+ renderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::OFF );
+ return renderer;