-void WrapAndSetProgram( Internal::ShaderEffect& effect,
- GeometryType actualGeometryType, GeometryType expectedGeometryType,
- const std::string& vertexPrefix, const std::string& fragmentPrefix,
- const std::string& vertexBody, const std::string& fragmentBody,
- bool modifiesGeometry )
-{
- // if geometry type matches and there is some real data in the strings
- if( ( actualGeometryType & expectedGeometryType )&&
- ( ( vertexPrefix.length() > 0 )||
- ( fragmentPrefix.length() > 0 )||
- ( vertexBody.length() > 0 )||
- ( fragmentBody.length() > 0 ) ) )
- {
- std::string vertexSource = vertexPrefix;
- std::string fragmentSource = fragmentPrefix;
-
- // create complete shader program strings for the given geometry type
- unsigned int index = 0;
- switch( expectedGeometryType )
- {
- case GEOMETRY_TYPE_IMAGE:
- {
- index = 0;
- break;
- }
- case GEOMETRY_TYPE_UNTEXTURED_MESH:
- {
- index = 1;
- break;
- }
- case GEOMETRY_TYPE_TEXTURED_MESH:
- {
- index = 2;
- break;
- }
- case GEOMETRY_TYPE_LAST:
- {
- DALI_ASSERT_DEBUG(0 && "Wrong geometry type");
- break;
- }
- }