void RenderState::setParameterAutoBinding(const char* name, const char* autoBinding) { GP_ASSERT(autoBinding); AutoBinding value = NONE; // Parse the passed in autoBinding string. if (strcmp(autoBinding, "WORLD_MATRIX") == 0) { value = WORLD_MATRIX; } else if (strcmp(autoBinding, "VIEW_MATRIX") == 0) { value = VIEW_MATRIX; } else if (strcmp(autoBinding, "PROJECTION_MATRIX") == 0) { value = PROJECTION_MATRIX; } else if (strcmp(autoBinding, "WORLD_VIEW_MATRIX") == 0) { value = WORLD_VIEW_MATRIX; } else if (strcmp(autoBinding, "VIEW_PROJECTION_MATRIX") == 0) { value = VIEW_PROJECTION_MATRIX; } else if (strcmp(autoBinding, "WORLD_VIEW_PROJECTION_MATRIX") == 0) { value = WORLD_VIEW_PROJECTION_MATRIX; } else if (strcmp(autoBinding, "INVERSE_TRANSPOSE_WORLD_MATRIX") == 0) { value = INVERSE_TRANSPOSE_WORLD_MATRIX; } else if (strcmp(autoBinding, "INVERSE_TRANSPOSE_WORLD_VIEW_MATRIX") == 0) { value = INVERSE_TRANSPOSE_WORLD_VIEW_MATRIX; } else if (strcmp(autoBinding, "CAMERA_WORLD_POSITION") == 0) { value = CAMERA_WORLD_POSITION; } else if (strcmp(autoBinding, "CAMERA_VIEW_POSITION") == 0) { value = CAMERA_VIEW_POSITION; } else if (strcmp(autoBinding, "MATRIX_PALETTE") == 0) { value = MATRIX_PALETTE; } else { // Ignore all other cases (the value was previously set to the default of NONE). } if (value != NONE) { setParameterAutoBinding(name, value); } }
void RenderState::setParameterAutoBinding(const char* name, AutoBinding autoBinding) { setParameterAutoBinding(name, autoBindingToString(autoBinding)); }