Cogl.Snippet

g Cogl.Object Cogl.Object Cogl.Snippet Cogl.Snippet Cogl.Object->Cogl.Snippet

Subclasses:

None

Methods

Inherited:

Cogl.Object (2)

class

new (hook, declarations, post)

get_declarations ()

get_hook ()

get_post ()

get_pre ()

get_replace ()

set_declarations (declarations)

set_post (post)

set_pre (pre)

set_replace (replace)

Virtual Methods

None

Fields

None

Class Details

class Cogl.Snippet
Bases:

Cogl.Object

Abstract:

No

classmethod new(hook, declarations, post)
Parameters:
Returns:

a pointer to a new Cogl.Snippet

Return type:

Cogl.Snippet

Allocates and initializes a new snippet with the given source strings.

New in version 1.10.

get_declarations()
Returns:

the source string that was set with Cogl.Snippet.set_declarations() or None if none was set.

Return type:

str

New in version 1.10.

get_hook()
Returns:

the hook that was set when Cogl.Snippet.new() was called.

Return type:

Cogl.SnippetHook

New in version 1.10.

get_post()
Returns:

the source string that was set with Cogl.Snippet.set_post() or None if none was set.

Return type:

str

New in version 1.10.

get_pre()
Returns:

the source string that was set with Cogl.Snippet.set_pre() or None if none was set.

Return type:

str

New in version 1.10.

get_replace()
Returns:

the source string that was set with Cogl.Snippet.set_replace() or None if none was set.

Return type:

str

New in version 1.10.

set_declarations(declarations)
Parameters:

declarations (str) – The new source string for the declarations section of this snippet.

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.

New in version 1.10.

set_post(post)
Parameters:

post (str) – The new source string for the post section of this snippet.

Sets a source string that will be inserted after the hook point in the generated shader for the pipeline that this snippet is attached to. Please see the documentation of each hook point in Cogl.Pipeline for a description of how this string should be used.

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

New in version 1.10.

set_pre(pre)
Parameters:

pre (str) – The new source string for the pre section of this snippet.

Sets a source string that will be inserted before the hook point in the generated shader for the pipeline that this snippet is attached to. Please see the documentation of each hook point in Cogl.Pipeline for a description of how this string should be used.

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

New in version 1.10.

set_replace(replace)
Parameters:

replace (str) – The new source string for the replace section of this snippet.

Sets a source string that will be used instead of any generated source code or any previous snippets for this hook point. Please see the documentation of each hook point in Cogl.Pipeline for a description of how this string should be used.

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

New in version 1.10.