Cogl.Snippet¶
- Subclasses:
None
Methods¶
- Inherited:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
None
Fields¶
None
Class Details¶
- class Cogl.Snippet¶
- Bases:
- Abstract:
No
- classmethod new(hook, declarations, post)¶
- Parameters:
hook (
Cogl.SnippetHook
) – The point in the pipeline that this snippet will wrap around or replace.declarations (
str
) – The source code for the declarations for this snippet orNone
. SeeCogl.Snippet.set_declarations
().post (
str
) – The source code to run after the hook point where this shader snippet is attached orNone
. SeeCogl.Snippet.set_post
().
- Returns:
a pointer to a new
Cogl.Snippet
- Return type:
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
() orNone
if none was set.- Return type:
New in version 1.10.
- get_hook()¶
- Returns:
the hook that was set when
Cogl.Snippet.new
() was called.- Return type:
New in version 1.10.
- get_post()¶
- Returns:
the source string that was set with
Cogl.Snippet.set_post
() orNone
if none was set.- Return type:
New in version 1.10.
- get_pre()¶
- Returns:
the source string that was set with
Cogl.Snippet.set_pre
() orNone
if none was set.- Return type:
New in version 1.10.
- get_replace()¶
- Returns:
the source string that was set with
Cogl.Snippet.set_replace
() orNone
if none was set.- Return type:
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.