typedef std::vector< std::string > HintsArray;
-
-struct GeometryTypePair
-{
- const char* name;
- GeometryType type;
-};
-
-const GeometryTypePair GeometryTypeTable[]=
-{
- {"image", GEOMETRY_TYPE_IMAGE },
- {"mesh", GEOMETRY_TYPE_UNTEXTURED_MESH },
- {"textured-mesh", GEOMETRY_TYPE_TEXTURED_MESH },
-};
-
-const unsigned int GeometryTypeTableCount = sizeof(GeometryTypeTable)/sizeof(GeometryTypeTable[0]);
-
struct GeometryHintPair
{
const char* name;
struct ShaderParameters
{
ShaderParameters()
- : mType( GEOMETRY_TYPE_IMAGE),
- mHints( ShaderEffect::HINT_NONE )
+ : mHints( ShaderEffect::HINT_NONE )
{
}
- void SetGeometryType( v8::Isolate* isolate, const std::string& typeName )
- {
- for( unsigned int i = 0; i < GeometryTypeTableCount; ++i )
- {
- if( typeName == GeometryTypeTable[i].name )
- {
- mType = GeometryTypeTable[i].type;
- return;
- }
- }
- DALI_SCRIPT_EXCEPTION( isolate, "Geometry type not found\n");
- }
-
ShaderEffect::GeometryHints GetGeometryHint( const std::string& hint )
{
for( unsigned int i = 0 ; i < GeometryHintTableCount; ++i )
}
}
-
-
ShaderEffect NewShader()
{
return ShaderEffect::NewWithPrefix( mVertexPrefix ,
mVertex,
mFragmentPrefix,
mFragment,
- mType,
mHints);
}
std::string mVertexPrefix;
std::string mVertex;
std::string mFragmentPrefix;
std::string mFragment;
- GeometryType mType;
ShaderEffect::GeometryHints mHints;
};
* @for ShaderEffect
* @method ShaderEffect
* @param {Object} shaderOptions
- * @param {String} [shaderOptions.geometryType] Type of geometry to be rendered with the effect. "image", "text", "mesh", "textured-mesh", default is image.
+ * @param {String} [shaderOptions.geometryType] Type of geometry to be rendered with the effect. "image", "text", "mesh", "texturedMesh", default is image.
* @param {String} [shaderOptions.vertexShaderPrefix] This string will be inserted before the default uniforms for the vertex shader(ideal for #defines)
* @param {String} [shaderOptions.vertexShader] VertexShader code for the effect. If not defined, the default version will be used
* @param {String} [shaderOptions.fragmentShaderPrefix] This string will be inserted before the default uniforms for the fragment shader(ideal for #defines)
v8::Local<v8::Object > obj = args[0]->ToObject();
- v8::Local<v8::Value> geometryTypeValue = obj->Get(v8::String::NewFromUtf8( isolate, "geometryType"));
- if( geometryTypeValue->IsString() )
- {
- std::string geometryTypeName = V8Utils::v8StringToStdString( geometryTypeValue );
- // printf(" geometry type found %s \n", geometryTypeName.c_str() );
- shaderParams.SetGeometryType( isolate, geometryTypeName );
- }
-
v8::Local<v8::Value> vertexPrefixValue = obj->Get(v8::String::NewFromUtf8( isolate, "vertexShaderPrefix"));
if( vertexPrefixValue->IsString() )
{