Gjsify LogoGjsify Logo

Hierarchy

Index

Constructors

Properties

gTypeInstance: TypeInstance
name: string

Methods

  • addLayerSnippet(layer: number, snippet: Cogl.Snippet): void
  • Adds a shader snippet that will hook on to the given layer of the pipeline. The exact part of the pipeline that the snippet wraps around depends on the hook that is given to cogl_snippet_new(). Note that some hooks can't be used with a layer and need to be added with cogl_pipeline_add_snippet() instead.

    Parameters

    • layer: number

      The layer to hook the snippet to

    • snippet: Cogl.Snippet

      A #CoglSnippet

    Returns void

  • Adds a shader snippet to pipeline. The snippet will wrap around or replace some part of the pipeline as defined by the hook point in snippet. Note that some hook points are specific to a layer and must be added with cogl_pipeline_add_layer_snippet() instead.

    Parameters

    • snippet: Cogl.Snippet

      The #CoglSnippet to add to the vertex processing hook

    Returns void

  • Creates a binding between source_property on source and target_property on target.

    Whenever the source_property is changed the target_property is updated using the same value. For instance:

      g_object_bind_property (action, "active", widget, "sensitive", 0);
    

    Will result in the "sensitive" property of the widget #GObject instance to be updated with the same value of the "active" property of the action #GObject instance.

    If flags contains %G_BINDING_BIDIRECTIONAL then the binding will be mutual: if target_property on target changes then the source_property on source will be updated as well.

    The binding will automatically be removed when either the source or the target instances are finalized. To remove the binding without affecting the source and the target you can just call g_object_unref() on the returned #GBinding instance.

    Removing the binding by calling g_object_unref() on it must only be done if the binding, source and target are only used from a single thread and it is clear that both source and target outlive the binding. Especially it is not safe to rely on this if the binding, source or target can be finalized from different threads. Keep another reference to the binding and use g_binding_unbind() instead to be on the safe side.

    A #GObject can have multiple bindings.

    Parameters

    • sourceProperty: string

      the property on source to bind

    • target: GObject.Object

      the target #GObject

    • targetProperty: string

      the property on target to bind

    • flags: BindingFlags

      flags to pass to #GBinding

    Returns Binding

  • Creates a binding between source_property on source and target_property on target, allowing you to set the transformation functions to be used by the binding.

    This function is the language bindings friendly version of g_object_bind_property_full(), using #GClosures instead of function pointers.

    Parameters

    • sourceProperty: string

      the property on source to bind

    • target: GObject.Object

      the target #GObject

    • targetProperty: string

      the property on target to bind

    • flags: BindingFlags

      flags to pass to #GBinding

    • transformTo: TClosure<any, any>

      a #GClosure wrapping the transformation function from the source to the target, or %NULL to use the default

    • transformFrom: TClosure<any, any>

      a #GClosure wrapping the transformation function from the target to the source, or %NULL to use the default

    Returns Binding

  • connect(sigName: string, callback: ((...args: any[]) => void)): number
  • Parameters

    • sigName: string
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns number

  • Creates a new pipeline with the configuration copied from the source pipeline.

    We would strongly advise developers to always aim to use cogl_pipeline_copy() instead of cogl_pipeline_new() whenever there will be any similarity between two pipelines. Copying a pipeline helps Cogl keep track of a pipelines ancestry which we may use to help minimize GPU state changes.

    Returns Cogl.Pipeline

  • emit(sigName: string, ...args: any[]): void
  • forceFloating(): void
  • This function is intended for #GObject implementations to re-enforce a [floating][floating-ref] object reference. Doing this is seldom required: all #GInitiallyUnowneds are created with a floating reference which usually just needs to be sunken by calling g_object_ref_sink().

    Returns void

  • Iterates all the layer indices of the given pipeline.

    Parameters

    Returns void

  • freezeNotify(): void
  • Increases the freeze count on object. If the freeze count is non-zero, the emission of "notify" signals on object is stopped. The signals are queued until the freeze count is decreased to zero. Duplicate notifications are squashed so that at most one #GObject::notify signal is emitted for each property modified while the object is frozen.

    This is necessary for accessors that modify multiple properties to prevent premature notification while the object is still being modified.

    Returns void

  • getAlphaTestReference(): number
  • Retrieves the current ambient color for pipeline

    Parameters

    • ambient: Cogl.Color

      The location to store the ambient color

    Returns void

  • Gets the current #CoglColorMask of which channels would be written to the current framebuffer. Each bit set in the mask means that the corresponding color would be written.

    Returns Cogl.ColorMask

  • getData(key?: string): object
  • Gets a named field from the objects table of associations (see g_object_set_data()).

    Parameters

    • Optional key: string

      name of the key for that association

    Returns object

  • Retrieves the current depth state configuration for the given pipeline as previously set using cogl_pipeline_set_depth_state().

    Returns DepthState

  • Retrieves the current diffuse color for pipeline

    Parameters

    • diffuse: Cogl.Color

      The location to store the diffuse color

    Returns void

  • Retrieves the pipelines current emission color.

    Parameters

    • emission: Cogl.Color

      The location to store the emission color

    Returns void

  • The order of the vertices within a primitive specifies whether it is considered to be front or back facing. This function specifies which order is considered to be the front faces. %COGL_WINDING_COUNTER_CLOCKWISE sets the front faces to primitives with vertices in a counter-clockwise order and %COGL_WINDING_CLOCKWISE sets them to be clockwise. The default is %COGL_WINDING_COUNTER_CLOCKWISE.

    Returns Cogl.Winding

  • Retrieves the currently set magnification #CoglPipelineFilter set on the specified layer. The magnification filter determines how the layer should be sampled when up-scaled.

    The default filter is %COGL_PIPELINE_FILTER_LINEAR but this can be changed using cogl_pipeline_set_layer_filters().

    Parameters

    • layerIndex: number

      the layer number to change.

    Returns PipelineFilter

  • Retrieves the currently set minification #CoglPipelineFilter set on the specified layer. The miniifcation filter determines how the layer should be sampled when down-scaled.

    The default filter is %COGL_PIPELINE_FILTER_LINEAR but this can be changed using cogl_pipeline_set_layer_filters().

    Parameters

    • layerIndex: number

      the layer number to change.

    Returns PipelineFilter

  • getLayerPointSpriteCoordsEnabled(layerIndex: number): number
  • Gets whether point sprite coordinate generation is enabled for this texture layer.

    Parameters

    • layerIndex: number

      the layer number to check.

    Returns number

  • Returns the wrap mode for the 'p' coordinate of texture lookups on this layer.

    Parameters

    • layerIndex: number

      the layer number to change.

    Returns PipelineWrapMode

  • Returns the wrap mode for the 's' coordinate of texture lookups on this layer.

    Parameters

    • layerIndex: number

      the layer number to change.

    Returns PipelineWrapMode

  • Returns the wrap mode for the 't' coordinate of texture lookups on this layer.

    Parameters

    • layerIndex: number

      the layer number to change.

    Returns PipelineWrapMode

  • getNLayers(): number
  • Retrieves the number of layers defined for the given pipeline

    Returns number

  • getPerVertexPointSize(): number
  • getPointSize(): number
  • Get the size of points drawn when %COGL_VERTICES_MODE_POINTS is used with the vertex buffer API.

    Returns number

  • getProperty(propertyName?: string, value?: any): void
  • Gets a property of an object.

    The value can be:

    • an empty #GValue initialized by %G_VALUE_INIT, which will be automatically initialized with the expected type of the property (since GLib 2.60)
    • a #GValue initialized with the expected type of the property
    • a #GValue initialized with a type to which the expected type of the property can be transformed

    In general, a copy is made of the property contents and the caller is responsible for freeing the memory by calling g_value_unset().

    Note that g_object_get_property() is really intended for language bindings, g_object_get() is much more convenient for C programming.

    Parameters

    • Optional propertyName: string

      the name of the property to get

    • Optional value: any

      return location for the property value

    Returns void

  • getQdata(quark: number): object
  • This function gets back user data pointers stored via g_object_set_qdata().

    Parameters

    • quark: number

      A #GQuark, naming the user data pointer

    Returns object

  • getShininess(): number
  • Retrieves the pipelines current emission color.

    Returns number

  • Retrieves the pipelines current specular color.

    Parameters

    • specular: Cogl.Color

      The location to store the specular color

    Returns void

  • getUniformLocation(uniformName: string): number
  • This is used to get an integer representing the uniform with the name uniform_name. The integer can be passed to functions such as cogl_pipeline_set_uniform_1f() to set the value of a uniform.

    This function will always return a valid integer. Ie, unlike OpenGL, it does not return -1 if the uniform is not available in this pipeline so it can not be used to test whether uniforms are present. It is not necessary to set the program on the pipeline before calling this function.

    Parameters

    • uniformName: string

      The name of a uniform

    Returns number

  • getUserProgram(): object
  • Queries what user program has been associated with the given pipeline using cogl_pipeline_set_user_program().

    Returns object

  • getv(names: string[], values: any[]): void
  • Gets n_properties properties for an object. Obtained properties will be set to values. All properties must be valid. Warnings will be emitted and undefined behaviour may result if invalid properties are passed in.

    Parameters

    • names: string[]

      the names of each property to get

    • values: any[]

      the values of each property to get

    Returns void

  • isFloating(): boolean
  • notify(propertyName: string): void
  • Emits a "notify" signal for the property property_name on object.

    When possible, eg. when signaling a property change from within the class that registered the property, you should use g_object_notify_by_pspec() instead.

    Note that emission of the notify signal may be blocked with g_object_freeze_notify(). In this case, the signal emissions are queued and will be emitted (in reverse order) when g_object_thaw_notify() is called.

    Parameters

    • propertyName: string

      the name of a property installed on the class of object.

    Returns void

  • Emits a "notify" signal for the property specified by pspec on object.

    This function omits the property name lookup, hence it is faster than g_object_notify().

    One way to avoid using g_object_notify() from within the class that registered the properties, and using g_object_notify_by_pspec() instead, is to store the GParamSpec used with g_object_class_install_property() inside a static array, e.g.:

      enum
    {
    PROP_0,
    PROP_FOO,
    PROP_LAST
    };

    static GParamSpec *properties[PROP_LAST];

    static void
    my_object_class_init (MyObjectClass *klass)
    {
    properties[PROP_FOO] = g_param_spec_int ("foo", "Foo", "The foo",
    0, 100,
    50,
    G_PARAM_READWRITE);
    g_object_class_install_property (gobject_class,
    PROP_FOO,
    properties[PROP_FOO]);
    }

    and then notify a change on the "foo" property with:

      g_object_notify_by_pspec (self, properties[PROP_FOO]);
    

    Parameters

    • pspec: ParamSpec

      the #GParamSpec of a property installed on the class of object.

    Returns void

  • off(sigName: string, callback: ((...args: any[]) => void)): EventEmitter
  • Parameters

    • sigName: string
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    Returns EventEmitter

  • on(sigName: string, callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • Parameters

    • sigName: string
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • once(sigName: string, callback: ((...args: any[]) => void), after?: boolean): EventEmitter
  • Parameters

    • sigName: string
    • callback: ((...args: any[]) => void)
        • (...args: any[]): void
        • Parameters

          • Rest ...args: any[]

          Returns void

    • Optional after: boolean

    Returns EventEmitter

  • Increases the reference count of object.

    Since GLib 2.56, if GLIB_VERSION_MAX_ALLOWED is 2.56 or greater, the type of object will be propagated to the return type (using the GCC typeof() extension), so any casting the caller needs to do on the return type must be explicit.

    Returns GObject.Object

  • Increase the reference count of object, and possibly remove the [floating][floating-ref] reference, if object has a floating reference.

    In other words, if the object is floating, then this call "assumes ownership" of the floating reference, converting it to a normal reference by clearing the floating flag while leaving the reference count unchanged. If the object is not floating, then this call adds a new normal reference increasing the reference count by one.

    Since GLib 2.56, the type of object will be propagated to the return type under the same conditions as for g_object_ref().

    Returns GObject.Object

  • removeLayer(layerIndex: number): void
  • This function removes a layer from your pipeline

    Parameters

    • layerIndex: number

      Specifies the layer you want to remove

    Returns void

  • runDispose(): void
  • Releases all references to other objects. This can be used to break reference cycles.

    This function should only be called from object system implementations.

    Returns void

  • Before a primitive is blended with the framebuffer, it goes through an alpha test stage which lets you discard fragments based on the current alpha value. This function lets you change the function used to evaluate the alpha channel, and thus determine which fragments are discarded and which continue on to the blending stage.

    The default is %COGL_PIPELINE_ALPHA_FUNC_ALWAYS

    Parameters

    • alphaFunc: PipelineAlphaFunc

      A CoglPipelineAlphaFunc constant

    • alphaReference: number

      A reference point that the chosen alpha function uses to compare incoming fragments to.

    Returns void

  • Sets the pipeline's ambient color, in the standard OpenGL lighting model. The ambient color affects the overall color of the object.

    Since the diffuse color will be intense when the light hits the surface directly, the ambient will be most apparent where the light hits at a slant.

    The default value is (0.2, 0.2, 0.2, 1.0)

    Parameters

    • ambient: Cogl.Color

      The components of the desired ambient color

    Returns void

  • setAmbientAndDiffuse(color: Cogl.Color): void
  • Conveniently sets the diffuse and ambient color of pipeline at the same time. See cogl_pipeline_set_ambient() and cogl_pipeline_set_diffuse().

    The default ambient color is (0.2, 0.2, 0.2, 1.0)

    The default diffuse color is (0.8, 0.8, 0.8, 1.0)

    Parameters

    • color: Cogl.Color

      The components of the desired ambient and diffuse colors

    Returns void

  • setBlend(blendString: string): number
  • If not already familiar; please refer here for an overview of what blend strings are, and their syntax.

    Blending occurs after the alpha test function, and combines fragments with the framebuffer.

    Currently the only blend function Cogl exposes is ADD(). So any valid blend statements will be of the form:

    |[ <channel-mask>=ADD(SRC_COLOR*(<factor>), DST_COLOR*(<factor>))



    This is the list of source-names usable as blend factors:
    <itemizedlist>
    <listitem><para>SRC_COLOR: The color of the in comming fragment</para></listitem>
    <listitem><para>DST_COLOR: The color of the framebuffer</para></listitem>
    <listitem><para>CONSTANT: The constant set via cogl_pipeline_set_blend_constant()</para></listitem>
    </itemizedlist>

    The source names can be used according to the
    <link linkend="cogl-Blend-String-syntax">color-source and factor syntax</link>,
    so for example "(1-SRC_COLOR[A])" would be a valid factor, as would
    "(CONSTANT[RGB])"

    These can also be used as factors:
    <itemizedlist>
    <listitem>0: (0, 0, 0, 0)</listitem>
    <listitem>1: (1, 1, 1, 1)</listitem>
    <listitem>SRC_ALPHA_SATURATE_FACTOR: (f,f,f,1) where f = MIN(SRC_COLOR[A],1-DST_COLOR[A])</listitem>
    </itemizedlist>

    <note>Remember; all color components are normalized to the range [0, 1]
    before computing the result of blending.</note>

    <example id="cogl-Blend-Strings-blend-unpremul">
    <title>Blend Strings/1</title>
    <para>Blend a non-premultiplied source over a destination with
    premultiplied alpha:</para>
    <programlisting>
    "RGB = ADD(SRC_COLOR*(SRC_COLOR[A]), DST_COLOR*(1-SRC_COLOR[A]))"
    "A = ADD(SRC_COLOR, DST_COLOR*(1-SRC_COLOR[A]))"
    </programlisting>
    </example>

    <example id="cogl-Blend-Strings-blend-premul">
    <title>Blend Strings/2</title>
    <para>Blend a premultiplied source over a destination with
    premultiplied alpha</para>
    <programlisting>
    "RGBA = ADD(SRC_COLOR, DST_COLOR*(1-SRC_COLOR[A]))"
    </programlisting>
    </example>

    The default blend string is:
    |[
    RGBA = ADD (SRC_COLOR, DST_COLOR*(1-SRC_COLOR[A]))

    That gives normal alpha-blending when the calculated color for the pipeline is in premultiplied form.

    Parameters

    • blendString: string

      A Cogl blend string describing the desired blend function.

    Returns number

  • setBlendConstant(constantColor: Cogl.Color): void
  • When blending is setup to reference a CONSTANT blend factor then blending will depend on the constant set with this function.

    Parameters

    • constantColor: Cogl.Color

      The constant color you want

    Returns void

  • Sets the basic color of the pipeline, used when no lighting is enabled.

    Note that if you don't add any layers to the pipeline then the color will be blended unmodified with the destination; the default blend expects premultiplied colors: for example, use (0.5, 0.0, 0.0, 0.5) for semi-transparent red. See cogl_color_premultiply().

    The default value is (1.0, 1.0, 1.0, 1.0)

    Parameters

    • color: Cogl.Color

      The components of the color

    Returns void

  • setColor4f(red: number, green: number, blue: number, alpha: number): void
  • Sets the basic color of the pipeline, used when no lighting is enabled.

    The default value is (1.0, 1.0, 1.0, 1.0)

    Parameters

    • red: number

      The red component

    • green: number

      The green component

    • blue: number

      The blue component

    • alpha: number

      The alpha component

    Returns void

  • setColor4ub(red: number, green: number, blue: number, alpha: number): void
  • Sets the basic color of the pipeline, used when no lighting is enabled.

    The default value is (0xff, 0xff, 0xff, 0xff)

    Parameters

    • red: number

      The red component

    • green: number

      The green component

    • blue: number

      The blue component

    • alpha: number

      The alpha component

    Returns void

  • Defines a bit mask of which color channels should be written to the current framebuffer. If a bit is set in color_mask that means that color will be written.

    Parameters

    • colorMask: Cogl.ColorMask

      A #CoglColorMask of which color channels to write to the current framebuffer.

    Returns void

  • Sets which faces will be culled when drawing. Face culling can be used to increase efficiency by avoiding drawing faces that would get overridden. For example, if a model has gaps so that it is impossible to see the inside then faces which are facing away from the screen will never be seen so there is no point in drawing them. This can be acheived by setting the cull face mode to %COGL_PIPELINE_CULL_FACE_MODE_BACK.

    Face culling relies on the primitives being drawn with a specific order to represent which faces are facing inside and outside the model. This order can be specified by calling cogl_pipeline_set_front_face_winding().

    Status: Unstable

    Parameters

    Returns void

  • setData(key: string, data?: object): void
  • Each object carries around a table of associations from strings to pointers. This function lets you set an association.

    If the object already had an association with that name, the old association will be destroyed.

    Internally, the key is converted to a #GQuark using g_quark_from_string(). This means a copy of key is kept permanently (even after object has been finalized) — so it is recommended to only use a small, bounded set of values for key in your program, to avoid the #GQuark storage growing unbounded.

    Parameters

    • key: string

      name of the key

    • Optional data: object

      data to associate with that key

    Returns void

  • This commits all the depth state configured in state struct to the given pipeline. The configuration values are copied into the pipeline so there is no requirement to keep the #CoglDepthState struct around if you don't need it any more.

    Note: Since some platforms do not support the depth range feature it is possible for this function to fail and report an error.

    Parameters

    Returns number

  • Sets the pipeline's diffuse color, in the standard OpenGL lighting model. The diffuse color is most intense where the light hits the surface directly - perpendicular to the surface.

    The default value is (0.8, 0.8, 0.8, 1.0)

    Parameters

    • diffuse: Cogl.Color

      The components of the desired diffuse color

    Returns void

  • Sets the pipeline's emissive color, in the standard OpenGL lighting model. It will look like the surface is a light source emitting this color.

    The default value is (0.0, 0.0, 0.0, 1.0)

    Parameters

    • emission: Cogl.Color

      The components of the desired emissive color

    Returns void

  • The order of the vertices within a primitive specifies whether it is considered to be front or back facing. This function specifies which order is considered to be the front faces. %COGL_WINDING_COUNTER_CLOCKWISE sets the front faces to primitives with vertices in a counter-clockwise order and %COGL_WINDING_CLOCKWISE sets them to be clockwise. The default is %COGL_WINDING_COUNTER_CLOCKWISE.

    Status: Unstable

    Parameters

    Returns void

  • setLayerCombine(layerIndex: number, blendString: string): number
  • If not already familiar; you can refer

    here for an overview of what blend strings are and there syntax.

    These are all the functions available for texture combining: REPLACE(arg0) = arg0 MODULATE(arg0, arg1) = arg0 x arg1 ADD(arg0, arg1) = arg0 + arg1 ADD_SIGNED(arg0, arg1) = arg0 + arg1 - 0.5 INTERPOLATE(arg0, arg1, arg2) = arg0 x arg2 + arg1 x (1 - arg2) SUBTRACT(arg0, arg1) = arg0 - arg1 DOT3_RGB(arg0, arg1) = 4 x ((arg0[R] - 0.5)) * (arg1[R] - 0.5) + (arg0[G] - 0.5)) * (arg1[G] - 0.5) + (arg0[B] - 0.5)) * (arg1[B] - 0.5)) DOT3_RGBA(arg0, arg1) = 4 x ((arg0[R] - 0.5)) * (arg1[R] - 0.5) + (arg0[G] - 0.5)) * (arg1[G] - 0.5) + (arg0[B] - 0.5)) * (arg1[B] - 0.5))

    Refer to the

    color-source syntax for describing the arguments. The valid source names for texture combining are: TEXTURE Use the color from the current texture layer TEXTURE_0, TEXTURE_1, etc Use the color from the specified texture layer CONSTANT Use the color from the constant given with cogl_pipeline_set_layer_combine_constant() PRIMARY Use the color of the pipeline as set with cogl_pipeline_set_color() PREVIOUS Either use the texture color from the previous layer, or if this is layer 0, use the color of the pipeline as set with cogl_pipeline_set_color() Layer Combine Examples This is effectively what the default blending is: RGBA = MODULATE (PREVIOUS, TEXTURE) This could be used to cross-fade between two images, using the alpha component of a constant as the interpolator. The constant color is given by calling cogl_pipeline_set_layer_combine_constant(). RGBA = INTERPOLATE (PREVIOUS, TEXTURE, CONSTANT[A])

    You can't give a multiplication factor for arguments as you can with blending.

    Parameters

    • layerIndex: number

      Specifies the layer you want define a combine function for

    • blendString: string

      A Cogl blend string describing the desired texture combine function.

    Returns number

  • setLayerCombineConstant(layerIndex: number, constant: Cogl.Color): void
  • When you are using the 'CONSTANT' color source in a layer combine description then you can use this function to define its value.

    Parameters

    • layerIndex: number

      Specifies the layer you want to specify a constant used for texture combining

    • constant: Cogl.Color

      The constant color you want

    Returns void

  • Changes the decimation and interpolation filters used when a texture is drawn at other scales than 100%.

    It is an error to pass anything other than %COGL_PIPELINE_FILTER_NEAREST or %COGL_PIPELINE_FILTER_LINEAR as magnification filters since magnification doesn't ever need to reference values stored in the mipmap chain.

    Parameters

    • layerIndex: number

      the layer number to change.

    • minFilter: PipelineFilter

      the filter used when scaling a texture down.

    • magFilter: PipelineFilter

      the filter used when magnifying a texture.

    Returns void

  • setLayerMatrix(layerIndex: number, matrix: Cogl.Matrix): void
  • This function lets you set a matrix that can be used to e.g. translate and rotate a single layer of a pipeline used to fill your geometry.

    Parameters

    • layerIndex: number

      the index for the layer inside pipeline

    • matrix: Cogl.Matrix

      the transformation matrix for the layer

    Returns void

  • setLayerNullTexture(layerIndex: number, textureType: Cogl.TextureType): void
  • Sets the texture for this layer to be the default texture for the given type. This is equivalent to calling cogl_pipeline_set_layer_texture() with %NULL for the texture argument except that you can also specify the type of default texture to use. The default texture is a 1x1 pixel white texture.

    This function is mostly useful if you want to create a base pipeline that you want to create multiple copies from using cogl_pipeline_copy(). In that case this function can be used to specify the texture type so that any pipeline copies can share the internal texture type state for efficiency.

    Parameters

    • layerIndex: number

      The layer number to modify

    • textureType: Cogl.TextureType

      The type of the default texture to use

    Returns void

  • setLayerPointSpriteCoordsEnabled(layerIndex: number, enable: number): number
  • When rendering points, if enable is %TRUE then the texture coordinates for this layer will be replaced with coordinates that vary from 0.0 to 1.0 across the primitive. The top left of the point will have the coordinates 0.0,0.0 and the bottom right will have 1.0,1.0. If enable is %FALSE then the coordinates will be fixed for the entire point.

    This function will only work if %COGL_FEATURE_ID_POINT_SPRITE is available. If the feature is not available then the function will return %FALSE and set error.

    Parameters

    • layerIndex: number

      the layer number to change.

    • enable: number

      whether to enable point sprite coord generation.

    Returns number

  • setLayerTexture(layerIndex: number, texture: Cogl.Texture): void
  • Sets the wrap mode for all three coordinates of texture lookups on this layer. This is equivalent to calling cogl_pipeline_set_layer_wrap_mode_s(), cogl_pipeline_set_layer_wrap_mode_t() and cogl_pipeline_set_layer_wrap_mode_p() separately.

    Parameters

    • layerIndex: number

      the layer number to change.

    • mode: PipelineWrapMode

      the new wrap mode

    Returns void

  • Sets the wrap mode for the 'p' coordinate of texture lookups on this layer. 'p' is the third coordinate.

    Parameters

    • layerIndex: number

      the layer number to change.

    • mode: PipelineWrapMode

      the new wrap mode

    Returns void

  • Sets the wrap mode for the 's' coordinate of texture lookups on this layer.

    Parameters

    • layerIndex: number

      the layer number to change.

    • mode: PipelineWrapMode

      the new wrap mode

    Returns void

  • Sets the wrap mode for the 't' coordinate of texture lookups on this layer.

    Parameters

    • layerIndex: number

      the layer number to change.

    • mode: PipelineWrapMode

      the new wrap mode

    Returns void

  • setPerVertexPointSize(enable: number): number
  • Sets whether to use a per-vertex point size or to use the value set by cogl_pipeline_set_point_size(). If per-vertex point size is enabled then the point size can be set for an individual point either by drawing with a #CoglAttribute with the name ‘cogl_point_size_in’ or by writing to the GLSL builtin ‘cogl_point_size_out’ from a vertex shader snippet.

    If per-vertex point size is enabled and this attribute is not used and cogl_point_size_out is not written to then the results are undefined.

    Note that enabling this will only work if the %COGL_FEATURE_ID_PER_VERTEX_POINT_SIZE feature is available. If this is not available then the function will return %FALSE and set a #CoglError.

    Parameters

    • enable: number

      whether to enable per-vertex point size

    Returns number

  • setPointSize(pointSize: number): void
  • Changes the size of points drawn when %COGL_VERTICES_MODE_POINTS is used with the attribute buffer API. Note that typically the GPU will only support a limited minimum and maximum range of point sizes. If the chosen point size is outside that range then the nearest value within that range will be used instead. The size of a point is in screen space so it will be the same regardless of any transformations.

    If the point size is set to 0.0 then drawing points with the pipeline will have undefined results. This is the default value so if an application wants to draw points it must make sure to use a pipeline that has an explicit point size set on it.

    Parameters

    • pointSize: number

      the new point size.

    Returns void

  • setProperty(propertyName: string, value?: any): void
  • Sets a property on an object.

    Parameters

    • propertyName: string

      the name of the property to set

    • Optional value: any

      the value

    Returns void

  • setShininess(shininess: number): void
  • Sets the shininess of the pipeline, in the standard OpenGL lighting model, which determines the size of the specular highlights. A higher shininess will produce smaller highlights which makes the object appear more shiny.

    The default value is 0.0

    Parameters

    • shininess: number

      The desired shininess; must be >= 0.0

    Returns void

  • Sets the pipeline's specular color, in the standard OpenGL lighting model. The intensity of the specular color depends on the viewport position, and is brightest along the lines of reflection.

    The default value is (0.0, 0.0, 0.0, 1.0)

    Parameters

    • specular: Cogl.Color

      The components of the desired specular color

    Returns void

  • setUniform1f(uniformLocation: number, value: number): void
  • Sets a new value for the uniform at uniform_location. If this pipeline has a user program attached and is later used as a source for drawing, the given value will be assigned to the uniform which can be accessed from the shader's source. The value for uniform_location should be retrieved from the string name of the uniform by calling cogl_pipeline_get_uniform_location().

    This function should be used to set uniforms that are of type float. It can also be used to set a single member of a float array uniform.

    Parameters

    • uniformLocation: number

      The uniform's location identifier

    • value: number

      The new value for the uniform

    Returns void

  • setUniform1i(uniformLocation: number, value: number): void
  • Sets a new value for the uniform at uniform_location. If this pipeline has a user program attached and is later used as a source for drawing, the given value will be assigned to the uniform which can be accessed from the shader's source. The value for uniform_location should be retrieved from the string name of the uniform by calling cogl_pipeline_get_uniform_location().

    This function should be used to set uniforms that are of type int. It can also be used to set a single member of a int array uniform or a sampler uniform.

    Parameters

    • uniformLocation: number

      The uniform's location identifier

    • value: number

      The new value for the uniform

    Returns void

  • setUniformFloat(uniformLocation: number, nComponents: number, count: number, value: number): void
  • Sets new values for the uniform at uniform_location. If this pipeline has a user program attached and is later used as a source for drawing, the given values will be assigned to the uniform which can be accessed from the shader's source. The value for uniform_location should be retrieved from the string name of the uniform by calling cogl_pipeline_get_uniform_location().

    This function can be used to set any floating point type uniform, including float arrays and float vectors. For example, to set a single vec4 uniform you would use 4 for n_components and 1 for count. To set an array of 8 float values, you could use 1 for n_components and 8 for count.

    Parameters

    • uniformLocation: number

      The uniform's location identifier

    • nComponents: number

      The number of components in the corresponding uniform's type

    • count: number

      The number of values to set

    • value: number

      Pointer to the new values to set

    Returns void

  • setUniformInt(uniformLocation: number, nComponents: number, count: number, value: number): void
  • Sets new values for the uniform at uniform_location. If this pipeline has a user program attached and is later used as a source for drawing, the given values will be assigned to the uniform which can be accessed from the shader's source. The value for uniform_location should be retrieved from the string name of the uniform by calling cogl_pipeline_get_uniform_location().

    This function can be used to set any integer type uniform, including int arrays and int vectors. For example, to set a single ivec4 uniform you would use 4 for n_components and 1 for count. To set an array of 8 int values, you could use 1 for n_components and 8 for count.

    Parameters

    • uniformLocation: number

      The uniform's location identifier

    • nComponents: number

      The number of components in the corresponding uniform's type

    • count: number

      The number of values to set

    • value: number

      Pointer to the new values to set

    Returns void

  • setUniformMatrix(uniformLocation: number, dimensions: number, count: number, transpose: number, value: number): void
  • Sets new values for the uniform at uniform_location. If this pipeline has a user program attached and is later used as a source for drawing, the given values will be assigned to the uniform which can be accessed from the shader's source. The value for uniform_location should be retrieved from the string name of the uniform by calling cogl_pipeline_get_uniform_location().

    This function can be used to set any matrix type uniform, including matrix arrays. For example, to set a single mat4 uniform you would use 4 for dimensions and 1 for count. To set an array of 8 mat3 values, you could use 3 for dimensions and 8 for count.

    If transpose is %FALSE then the matrix is expected to be in column-major order or if it is %TRUE then the matrix is in row-major order. You can pass a #CoglMatrix by calling by passing the result of cogl_matrix_get_array() in value and setting transpose to %FALSE.

    Parameters

    • uniformLocation: number

      The uniform's location identifier

    • dimensions: number

      The size of the matrix

    • count: number

      The number of values to set

    • transpose: number

      Whether to transpose the matrix

    • value: number

      Pointer to the new values to set

    Returns void

  • setUserProgram(program: object): void
  • Associates a linked CoglProgram with the given pipeline so that the program can take full control of vertex and/or fragment processing.

    This is an example of how it can be used to associate an ARBfp program with a #CoglPipeline: |[ CoglHandle shader; CoglHandle program; CoglPipeline *pipeline;

    shader = cogl_create_shader (COGL_SHADER_TYPE_FRAGMENT); cogl_shader_source (shader, "!!ARBfp1.0\n" "MOV result.color,fragment.color;\n" "END\n"); cogl_shader_compile (shader);

    program = cogl_create_program (); cogl_program_attach_shader (program, shader); cogl_program_link (program);

    pipeline = cogl_pipeline_new (); cogl_pipeline_set_user_program (pipeline, program);

    cogl_set_source_color4ub (0xff, 0x00, 0x00, 0xff); cogl_rectangle (0, 0, 100, 100);



    It is possibly worth keeping in mind that this API is not part of
    the long term design for how we want to expose shaders to Cogl
    developers (We are planning on deprecating the cogl_program and
    cogl_shader APIs in favour of a "snippet" framework) but in the
    meantime we hope this will handle most practical GLSL and ARBfp
    requirements.

    Also remember you need to check for either the
    %COGL_FEATURE_SHADERS_GLSL or %COGL_FEATURE_SHADERS_ARBFP before
    using the cogl_program or cogl_shader API.
    @param program A #CoglHandle to a linked CoglProgram

    Parameters

    • program: object

    Returns void

  • stealData(key?: string): object
  • Remove a specified datum from the object's data associations, without invoking the association's destroy handler.

    Parameters

    • Optional key: string

      name of the key

    Returns object

  • stealQdata(quark: number): object
  • This function gets back user data pointers stored via g_object_set_qdata() and removes the data from object without invoking its destroy() function (if any was set). Usually, calling this function is only required to update user data pointers with a destroy notifier, for example:

    void
    object_add_to_user_list (GObject *object,
    const gchar *new_string)
    {
    // the quark, naming the object data
    GQuark quark_string_list = g_quark_from_static_string ("my-string-list");
    // retrieve the old string list
    GList *list = g_object_steal_qdata (object, quark_string_list);

    // prepend new string
    list = g_list_prepend (list, g_strdup (new_string));
    // this changed 'list', so we need to set it again
    g_object_set_qdata_full (object, quark_string_list, list, free_string_list);
    }
    static void
    free_string_list (gpointer data)
    {
    GList *node, *list = data;

    for (node = list; node; node = node->next)
    g_free (node->data);
    g_list_free (list);
    }

    Using g_object_get_qdata() in the above example, instead of g_object_steal_qdata() would have left the destroy function set, and thus the partial string list would have been freed upon g_object_set_qdata_full().

    Parameters

    • quark: number

      A #GQuark, naming the user data pointer

    Returns object

  • thawNotify(): void
  • Reverts the effect of a previous call to g_object_freeze_notify(). The freeze count is decreased on object and when it reaches zero, queued "notify" signals are emitted.

    Duplicate notifications for each property are squashed so that at most one #GObject::notify signal is emitted for each property, in the reverse order in which they have been queued.

    It is an error to call this function when the freeze count is zero.

    Returns void

  • unref(): void
  • Decreases the reference count of object. When its reference count drops to 0, the object is finalized (i.e. its memory is freed).

    If the pointer to the #GObject may be reused in future (for example, if it is an instance variable of another object), it is recommended to clear the pointer to %NULL rather than retain a dangling pointer to a potentially invalid #GObject instance. Use g_clear_object() for this.

    Returns void

  • watchClosure(closure: TClosure<any, any>): void
  • This function essentially limits the life time of the closure to the life time of the object. That is, when the object is finalized, the closure is invalidated by calling g_closure_invalidate() on it, in order to prevent invocations of the closure with a finalized (nonexisting) object. Also, g_object_ref() and g_object_unref() are added as marshal guards to the closure, to ensure that an extra reference count is held on object during invocation of the closure. Usually, this function will be called on closures that use this object as closure data.

    Parameters

    • closure: TClosure<any, any>

      #GClosure to watch

    Returns void

  • compatControl(what: number, data: object): number
  • Find the #GParamSpec with the given name for an interface. Generally, the interface vtable passed in as g_iface will be the default vtable from g_type_default_interface_ref(), or, if you know the interface has already been loaded, g_type_default_interface_peek().

    Parameters

    • gIface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface

    • propertyName: string

      name of a property to look up.

    Returns ParamSpec

  • Add a property to an interface; this is only useful for interfaces that are added to GObject-derived types. Adding a property to an interface forces all objects classes with that interface to have a compatible property. The compatible property could be a newly created #GParamSpec, but normally g_object_class_override_property() will be used so that the object class only needs to provide an implementation and inherits the property description, default value, bounds, and so forth from the interface property.

    This function is meant to be called from the interface's default vtable initialization function (the class_init member of #GTypeInfo.) It must not be called after after class_init has been called for any object types implementing this interface.

    If pspec is a floating reference, it will be consumed.

    Parameters

    • gIface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface.

    • pspec: ParamSpec

      the #GParamSpec for the new property

    Returns void

  • Lists the properties of an interface.Generally, the interface vtable passed in as g_iface will be the default vtable from g_type_default_interface_ref(), or, if you know the interface has already been loaded, g_type_default_interface_peek().

    Parameters

    • gIface: TypeInterface

      any interface vtable for the interface, or the default vtable for the interface

    Returns ParamSpec[]

  • Creates a new instance of a #GObject subtype and sets its properties.

    Construction parameters (see %G_PARAM_CONSTRUCT, %G_PARAM_CONSTRUCT_ONLY) which are not explicitly specified are set to their default values.

    Parameters

    • objectType: GType<unknown>

      the type id of the #GObject subtype to instantiate

    • parameters: GObject.Parameter[]

      an array of #GParameter

    Returns GObject.Object

  • valueGetObject(value: any): object
  • valueSetObject(value: any, object: object): void

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method