const char* imagePath = !gNinePatch ? IMAGE_PATH[index] : NINEPATCH_IMAGE_PATH[index];
Image image = ResourceImage::New(imagePath);
- Sampler textureSampler = Sampler::New( image, "sTexture" );
Material material = Material::New( shader );
- material.AddSampler(textureSampler);
+ material.AddTexture( image, "sTexture" );
material.SetBlendMode( BlendingMode::OFF );
renderers[index] = Renderer::New( QuadMesh(), material );
}
// Hide the indicator bar
application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE );
- mImage = ResourceImage::New( MATERIAL_SAMPLE );
- mSampler = Sampler::New(mImage, "sTexture");
mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
mMaterial = Material::New( mShader );
- mMaterial.AddSampler( mSampler );
+ mImage = ResourceImage::New( MATERIAL_SAMPLE );
+ mMaterial.AddTexture(mImage, "sTexture");
mGeometry = CreateGeometry();
bool OnTimer()
{
Image image = ResourceImage::New( MATERIAL_SAMPLE2 );
- mSampler.SetImage( image );
+
+ mMaterial.SetTextureImage(0,image);
return false;
}
Vector3 mStageSize; ///< The size of the stage
Image mImage;
- Sampler mSampler;
Shader mShader;
Material mMaterial;
Geometry mGeometry;
for( unsigned i=0; i<NUMBER_OF_SAMPLES; ++i)
{
Image image = ResourceImage::New( MATERIAL_SAMPLES[i] );
- Sampler sampler = Sampler::New(image, "sTexture");
Material material = Material::New( mShader );
- material.AddSampler( sampler );
+ material.AddTexture(image, "sTexture");
if( i==0 ) { firstMat = material; }
Renderer renderer = Renderer::New( mGeometry, material );
// Create a textured mesh
Image effectImage = ResourceImage::New(EFFECT_IMAGE);
- Sampler sampler = Sampler::New(effectImage, "sTexture");
-
Shader shaderTextureMesh = Shader::New( VERTEX_TEXTURE_MESH, FRAGMENT_TEXTURE_MESH );
Material textureMeshMaterial = Material::New( shaderTextureMesh );
- textureMeshMaterial.AddSampler( sampler );
+ textureMeshMaterial.AddTexture(effectImage, "sTexture");
Renderer textureMeshRenderer = Renderer::New( meshGeometry, textureMeshMaterial );
Actor textureMeshActor = Actor::New();
mImage = ResourceImage::New( MATERIAL_SAMPLE );
Image image = ResourceImage::New( MATERIAL_SAMPLE2 );
- mSampler1 = Sampler::New(mImage, "sTexture1");
- mSampler2 = Sampler::New(image, "sTexture2");
mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
mMaterial = Material::New( mShader );
- mMaterial.AddSampler( mSampler1 );
- mMaterial.AddSampler( mSampler2 );
+ mMaterial.AddTexture(mImage, "sTexture1");
+ mMaterial.AddTexture(image, "sTexture2");
mGeometry = CreateGeometry();
Vector3 mStageSize; ///< The size of the stage
Image mImage;
- Sampler mSampler1;
- Sampler mSampler2;
Shader mShader;
Material mMaterial;
Geometry mGeometry;
mGeometry = CreateGeometry( MESH_FILES[mCurrentMeshId] );
Image texture = LoadStageFillingImage( TEXTURE_IMAGES[mCurrentTextureId] );
- mSampler = Sampler::New( texture, "sTexture" );
mMaterial = Material::New( mShaderFlat );
- mMaterial.AddSampler( mSampler );
+ mMaterial.AddTexture( texture, "sTexture" );
mRenderer = Renderer::New( mGeometry, mMaterial );
{
mCurrentTextureId = ( mCurrentTextureId + 1 ) % NUM_TEXTURE_IMAGES;
Image texture = LoadStageFillingImage( TEXTURE_IMAGES[mCurrentTextureId] );
- mSampler.SetImage( texture );
+ mMaterial.SetTextureImage( 0, texture );
return true;
}
Application& mApplication;
Layer mContent;
-
- Sampler mSampler;
Material mMaterial;
Geometry mGeometry;
Renderer mRenderer;
// Hide the indicator bar
application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE );
- mImage = ResourceImage::New( MATERIAL_SAMPLE, ResourceImage::ON_DEMAND, Image::NEVER );
- mSampler1 = Sampler::New(mImage, "sTexture");
-
+ mImage = ResourceImage::New( MATERIAL_SAMPLE );
Image image = ResourceImage::New( MATERIAL_SAMPLE2 );
- mSampler2 = Sampler::New(image, "sTexture");
mShader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
mMaterial1 = Material::New( mShader );
- mMaterial1.AddSampler( mSampler1 );
+ mMaterial1.AddTexture(mImage, "sTexture");
mMaterial2 = Material::New( mShader );
- mMaterial2.AddSampler( mSampler2 );
+ mMaterial2.AddTexture(image, "sTexture");
mGeometry = CreateGeometry();
Vector3 mStageSize; ///< The size of the stage
Image mImage;
- Sampler mSampler1;
- Sampler mSampler2;
Shader mShader;
Material mMaterial1;
Material mMaterial2;