Bases: cg.utils.Disposable
Gateway to using python-cg.
Note
This is the only class that should (or need to) be manually instantiated
by user code.
Note
There should be one instance of this class per process. Having multiple instances, although possible, can result in some unexpected behaviour.
Creates CG context.
Return type: | cg.context.Context |
---|
Bases: cg.utils.Disposable
Wraps Cg context.
Creates effect from source.
Parameters: | source (string) – effect source |
---|---|
Return type: | cg.effect.Effect |
Loads effect source from file and creates effect using it.
Parameters: | filename (string) – file containing effect source. |
---|---|
Return type: | cg.effect.Effect |
Bases: cg.parameter.Parameter
Represents numeric parameter (float, array of ints, matrix of doubles etc.).
Gets parameter column count
Gets parameter row count
Sets the parameter value. Value can be one of the following:
Note
Setting parameter value is a slow operation and should be performed as rarely as possible.
Note
Matrices will be filled with data in row-major order.
Bases: cg.utils.ReprMixin
Effect or program parameter base class.
Gets base type of the parameter (string)
Gets name of the parameter (string)
Gets parameter semantic (string)
Gets type of the parameter (string)
Bases: tuple
Collection of cg.parameter.Parameter. Provides tuple interface (iteration, indexing etc.) and some parameter-specific extensions.
Bases: cg.parameter.Parameter
Represents sampler* parameter.
Bases: abc.WithABCMeta
Exposes method to release resources held by the class.