### Method

# Cogl Snippet set_declarations

#### Declaration [src]

    void
    cogl_snippet_set_declarations (
      CoglSnippet* snippet,
      const char* declarations
    )

#### Description [src]

Sets a source string that will be inserted in the global scope of the generated shader when this snippet is used on a pipeline. This string is typically used to declare uniforms, attributes or functions that will be used by the other parts of the snippets.

This function should only be called before the snippet is attached to its first pipeline. After that the snippet should be considered immutable.

#### Parameters

`declarations`

  Type: `const char*`

  The new source string for the declarations section of this snippet.

  The data is owned by the caller of the function.
  The value is a NUL terminated UTF-8 string.