Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
- Exported types
- Methods
- getAmbient
- getColor
- getDiffuse
- getEmission
- getLayerPointSpriteCoordsEnabled
- getLayerWrapModeP
- getLayerWrapModeS
- getLayerWrapModeT
- getLayers
- getNLayers
- getPointSize
- getShininess
- getSpecular
- getUserProgram
- ref
- removeLayer
- setAlphaTestFunction
- setAmbient
- setAmbientAndDiffuse
- setBlend
- setBlendConstant
- setColor
- setColor4f
- setColor4ub
- setDiffuse
- setEmission
- setLayer
- setLayerCombine
- setLayerCombineConstant
- setLayerFilters
- setLayerMatrix
- setLayerPointSpriteCoordsEnabled
- setLayerWrapMode
- setLayerWrapModeP
- setLayerWrapModeS
- setLayerWrapModeT
- setPointSize
- setShininess
- setSpecular
- setUserProgram
- unref
No description available in the introspection data.
Synopsis
- newtype Material = Material (ManagedPtr Material)
- materialGetAmbient :: (HasCallStack, MonadIO m) => Material -> Color -> m ()
- materialGetColor :: (HasCallStack, MonadIO m) => Material -> m Color
- materialGetDiffuse :: (HasCallStack, MonadIO m) => Material -> Color -> m ()
- materialGetEmission :: (HasCallStack, MonadIO m) => Material -> Color -> m ()
- materialGetLayerPointSpriteCoordsEnabled :: (HasCallStack, MonadIO m) => Material -> Int32 -> m Int32
- materialGetLayerWrapModeP :: (HasCallStack, MonadIO m) => Material -> Int32 -> m MaterialWrapMode
- materialGetLayerWrapModeS :: (HasCallStack, MonadIO m) => Material -> Int32 -> m MaterialWrapMode
- materialGetLayerWrapModeT :: (HasCallStack, MonadIO m) => Material -> Int32 -> m MaterialWrapMode
- materialGetLayers :: (HasCallStack, MonadIO m) => Material -> m [MaterialLayer]
- materialGetNLayers :: (HasCallStack, MonadIO m) => Material -> m Int32
- materialGetPointSize :: (HasCallStack, MonadIO m) => Material -> m Float
- materialGetShininess :: (HasCallStack, MonadIO m) => Material -> m Float
- materialGetSpecular :: (HasCallStack, MonadIO m) => Material -> Color -> m ()
- materialGetUserProgram :: (HasCallStack, MonadIO m) => Material -> m (Ptr ())
- materialRef :: (HasCallStack, MonadIO m) => Ptr () -> m (Ptr ())
- materialRemoveLayer :: (HasCallStack, MonadIO m) => Material -> Int32 -> m ()
- materialSetAlphaTestFunction :: (HasCallStack, MonadIO m) => Material -> MaterialAlphaFunc -> Float -> m ()
- materialSetAmbient :: (HasCallStack, MonadIO m) => Material -> Color -> m ()
- materialSetAmbientAndDiffuse :: (HasCallStack, MonadIO m) => Material -> Color -> m ()
- materialSetBlend :: (HasCallStack, MonadIO m) => Material -> Text -> m Int32
- materialSetBlendConstant :: (HasCallStack, MonadIO m) => Material -> Color -> m ()
- materialSetColor :: (HasCallStack, MonadIO m) => Material -> Color -> m ()
- materialSetColor4f :: (HasCallStack, MonadIO m) => Material -> Float -> Float -> Float -> Float -> m ()
- materialSetColor4ub :: (HasCallStack, MonadIO m) => Material -> Word8 -> Word8 -> Word8 -> Word8 -> m ()
- materialSetDiffuse :: (HasCallStack, MonadIO m) => Material -> Color -> m ()
- materialSetEmission :: (HasCallStack, MonadIO m) => Material -> Color -> m ()
- materialSetLayer :: (HasCallStack, MonadIO m) => Material -> Int32 -> Ptr () -> m ()
- materialSetLayerCombine :: (HasCallStack, MonadIO m) => Material -> Int32 -> Text -> m Int32
- materialSetLayerCombineConstant :: (HasCallStack, MonadIO m) => Material -> Int32 -> Color -> m ()
- materialSetLayerFilters :: (HasCallStack, MonadIO m) => Material -> Int32 -> MaterialFilter -> MaterialFilter -> m ()
- materialSetLayerMatrix :: (HasCallStack, MonadIO m) => Material -> Int32 -> Matrix -> m ()
- materialSetLayerPointSpriteCoordsEnabled :: (HasCallStack, MonadIO m) => Material -> Int32 -> Int32 -> m Int32
- materialSetLayerWrapMode :: (HasCallStack, MonadIO m) => Material -> Int32 -> MaterialWrapMode -> m ()
- materialSetLayerWrapModeP :: (HasCallStack, MonadIO m) => Material -> Int32 -> MaterialWrapMode -> m ()
- materialSetLayerWrapModeS :: (HasCallStack, MonadIO m) => Material -> Int32 -> MaterialWrapMode -> m ()
- materialSetLayerWrapModeT :: (HasCallStack, MonadIO m) => Material -> Int32 -> MaterialWrapMode -> m ()
- materialSetPointSize :: (HasCallStack, MonadIO m) => Material -> Float -> m ()
- materialSetShininess :: (HasCallStack, MonadIO m) => Material -> Float -> m ()
- materialSetSpecular :: (HasCallStack, MonadIO m) => Material -> Color -> m ()
- materialSetUserProgram :: (HasCallStack, MonadIO m) => Material -> Ptr () -> m ()
- materialUnref :: (HasCallStack, MonadIO m) => Ptr () -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Material Source # | |
BoxedPtr Material Source # | |
Defined in GI.Cogl.Structs.Material boxedPtrCopy :: Material -> IO Material boxedPtrFree :: Material -> IO () | |
ManagedPtrNewtype Material Source # | |
Defined in GI.Cogl.Structs.Material toManagedPtr :: Material -> ManagedPtr Material |
Methods
Click to display all available methods, including inherited ones
Methods
Getters
getAmbient, getColor, getDiffuse, getEmission, getLayerPointSpriteCoordsEnabled, getLayerWrapModeP, getLayerWrapModeS, getLayerWrapModeT, getLayers, getNLayers, getPointSize, getShininess, getSpecular, getUserProgram.
Setters
setAlphaTestFunction, setAmbient, setAmbientAndDiffuse, setBlend, setBlendConstant, setColor, setColor4f, setColor4ub, setDiffuse, setEmission, setLayer, setLayerCombine, setLayerCombineConstant, setLayerFilters, setLayerMatrix, setLayerPointSpriteCoordsEnabled, setLayerWrapMode, setLayerWrapModeP, setLayerWrapModeS, setLayerWrapModeT, setPointSize, setShininess, setSpecular, setUserProgram.
getAmbient
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Color |
|
-> m () |
Deprecated: (Since version 1.16)Use the CoglSnippet
shader api for lighting
Retrieves the current ambient color for material
Since: 1.0
getColor
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> m Color |
Deprecated: (Since version 1.16)Use cogl_pipeline_get_color()
instead
Retrieves the current material color.
Since: 1.0
getDiffuse
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Color |
|
-> m () |
Deprecated: (Since version 1.16)Use the CoglSnippet
shader api for lighting
Retrieves the current diffuse color for material
Since: 1.0
getEmission
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Color |
|
-> m () |
Deprecated: (Since version 1.16)Use the CoglSnippet
shader api for lighting
Retrieves the materials current emission color.
Since: 1.0
getLayerPointSpriteCoordsEnabled
materialGetLayerPointSpriteCoordsEnabled Source #
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Int32 |
|
-> m Int32 | Returns: whether the texture coordinates will be replaced with point sprite coordinates. |
Deprecated: (Since version 1.16)Use cogl_pipeline_get_layer_point_sprite_coords_enabled()
instead
Gets whether point sprite coordinate generation is enabled for this texture layer.
Since: 1.4
getLayerWrapModeP
materialGetLayerWrapModeP Source #
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Int32 |
|
-> m MaterialWrapMode | Returns: the wrap mode for the 'p' coordinate of texture lookups on this layer. |
Deprecated: (Since version 1.16)Use cogl_pipeline_get_layer_wrap_mode_p()
instead
Returns the wrap mode for the 'p' coordinate of texture lookups on this layer.
Since: 1.6
getLayerWrapModeS
materialGetLayerWrapModeS Source #
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Int32 |
|
-> m MaterialWrapMode | Returns: the wrap mode for the 's' coordinate of texture lookups on this layer. |
Deprecated: (Since version 1.16)Use cogl_pipeline_get_layer_wrap_mode_s()
instead
Returns the wrap mode for the 's' coordinate of texture lookups on this layer.
Since: 1.6
getLayerWrapModeT
materialGetLayerWrapModeT Source #
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Int32 |
|
-> m MaterialWrapMode | Returns: the wrap mode for the 't' coordinate of texture lookups on this layer. |
Deprecated: (Since version 1.16)Use cogl_pipeline_get_layer_wrap_mode_t()
instead
Returns the wrap mode for the 't' coordinate of texture lookups on this layer.
Since: 1.6
getLayers
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> m [MaterialLayer] | Returns: A
list of |
This function lets you access a material's internal list of layers for iteration.
<note>You should avoid using this API if possible since it was only made public by mistake and will be deprecated when we have suitable alternative.</note>
<note>It's important to understand that the list returned may not remain valid if you modify the material or any of the layers in any way and so you would have to re-get the list in that situation.</note>
getNLayers
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> m Int32 | Returns: the number of layers |
Deprecated: (Since version 1.16)Use cogl_pipeline_get_n_layers()
instead
Retrieves the number of layers defined for the given material
Since: 1.0
getPointSize
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> m Float | Returns: the point size of the material. |
Deprecated: (Since version 1.16)Use cogl_pipeline_get_point_size()
instead
Get the size of points drawn when VerticesModePoints
is
used with the vertex buffer API.
Since: 1.4
getShininess
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> m Float | Returns: The materials current shininess value |
Deprecated: (Since version 1.16)Use the CoglSnippet
shader api for lighting
Retrieves the materials current emission color.
Since: 1.0
getSpecular
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Color |
|
-> m () |
Deprecated: (Since version 1.16)Use the CoglSnippet
shader api for lighting
Retrieves the materials current specular color.
Since: 1.0
getUserProgram
materialGetUserProgram Source #
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> m (Ptr ()) | Returns: The current user program
or |
Deprecated: (Since version 1.16)Use CoglSnippet
api instead instead
Queries what user program has been associated with the given
material
using materialSetUserProgram
.
Since: 1.4
ref
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m (Ptr ()) | Returns: the |
Deprecated: (Since version 1.2)Use cogl_object_ref()
instead
Increment the reference count for a Material
.
Since: 1.0
removeLayer
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Int32 |
|
-> m () |
Deprecated: (Since version 1.16)Use cogl_pipeline_remove_layer()
instead
This function removes a layer from your material
setAlphaTestFunction
materialSetAlphaTestFunction Source #
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> MaterialAlphaFunc |
|
-> Float |
|
-> m () |
Deprecated: (Since version 1.16)Use cogl_pipeline_set_alpha_test_function()
instead
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 MaterialAlphaFuncAlways
Since: 1.0
setAmbient
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Color |
|
-> m () |
Deprecated: (Since version 1.16)Use the CoglSnippet
shader api for lighting
Sets the material'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)
Since: 1.0
setAmbientAndDiffuse
materialSetAmbientAndDiffuse Source #
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Color |
|
-> m () |
Deprecated: (Since version 1.16)Use the CoglSnippet
shader api for lighting
Conveniently sets the diffuse and ambient color of material
at the same
time. See materialSetAmbient
and materialSetDiffuse
.
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)
Since: 1.0
setBlend
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Text |
|
-> m Int32 | Returns: |
Deprecated: (Since version 1.16)Use cogl_pipeline_set_blend()
instead
If not already familiar; please refer <link linkend="cogl-Blend-Strings">here</link> 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>))
<warning>The brackets around blend factors are currently not optional!</warning>
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 materialSetBlendConstant
</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 material is in premultiplied form.
Since: 1.0
setBlendConstant
materialSetBlendConstant Source #
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Color |
|
-> m () |
Deprecated: (Since version 1.16)Use cogl_pipeline_set_blend_constant()
instead
When blending is setup to reference a CONSTANT blend factor then blending will depend on the constant set with this function.
Since: 1.0
setColor
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Color |
|
-> m () |
Deprecated: (Since version 1.16)Use cogl_pipeline_set_color()
instead
Sets the basic color of the material, used when no lighting is enabled.
Note that if you don't add any layers to the material 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 colorPremultiply
.
The default value is (1.0, 1.0, 1.0, 1.0)
Since: 1.0
setColor4f
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> Float |
|
-> m () |
Deprecated: (Since version 1.16)Use cogl_pipeline_set_color4f()
instead
Sets the basic color of the material, used when no lighting is enabled.
The default value is (1.0, 1.0, 1.0, 1.0)
Since: 1.0
setColor4ub
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Word8 |
|
-> Word8 |
|
-> Word8 |
|
-> Word8 |
|
-> m () |
Deprecated: (Since version 1.16)Use cogl_pipeline_set_color4ub()
instead
Sets the basic color of the material, used when no lighting is enabled.
The default value is (0xff, 0xff, 0xff, 0xff)
Since: 1.0
setDiffuse
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Color |
|
-> m () |
Deprecated: (Since version 1.16)Use the CoglSnippet
shader api for lighting
Sets the material'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)
Since: 1.0
setEmission
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Color |
|
-> m () |
Deprecated: (Since version 1.16)Use the CoglSnippet
shader api for lighting
Sets the material'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)
Since: 1.0
setLayer
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Int32 |
|
-> Ptr () |
|
-> m () |
Deprecated: (Since version 1.16)Use cogl_pipeline_set_layer()
instead
In addition to the standard OpenGL lighting model a Cogl material may have one or more layers comprised of textures that can be blended together in order, with a number of different texture combine modes. This function defines a new texture layer.
The index values of multiple layers do not have to be consecutive; it is only their relative order that is important.
<note>In the future, we may define other types of material layers, such as purely GLSL based layers.</note>
Since: 1.0
setLayerCombine
materialSetLayerCombine Source #
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Int32 |
|
-> Text |
|
-> m Int32 | Returns: |
Deprecated: (Since version 1.16)Use cogl_pipeline_set_layer_combine()
instead
If not already familiar; you can refer <link linkend="cogl-Blend-Strings">here</link> for an overview of what blend strings are and there syntax.
These are all the functions available for texture combining: <itemizedlist> <listitem>REPLACE(arg0) = arg0</listitem> <listitem>MODULATE(arg0, arg1) = arg0 x arg1</listitem> <listitem>ADD(arg0, arg1) = arg0 + arg1</listitem> <listitem>ADD_SIGNED(arg0, arg1) = arg0 + arg1 - 0.5</listitem> <listitem>INTERPOLATE(arg0, arg1, arg2) = arg0 x arg2 + arg1 x (1 - arg2)</listitem> <listitem>SUBTRACT(arg0, arg1) = arg0 - arg1</listitem> <listitem> <programlisting> 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)) </programlisting> </listitem> <listitem> <programlisting> 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)) </programlisting> </listitem> </itemizedlist>
Refer to the
<link linkend="cogl-Blend-String-syntax">color-source syntax</link> for
describing the arguments. The valid source names for texture combining
are:
<variablelist>
<varlistentry>
<term>TEXTURE</term>
<listitem>Use the color from the current texture layer</listitem>
</varlistentry>
<varlistentry>
<term>TEXTURE_0, TEXTURE_1, etc</term>
<listitem>Use the color from the specified texture layer</listitem>
</varlistentry>
<varlistentry>
<term>CONSTANT</term>
<listitem>Use the color from the constant given with
cogl_material_set_layer_constant()
</listitem>
</varlistentry>
<varlistentry>
<term>PRIMARY</term>
<listitem>Use the color of the material as set with
materialSetColor
</listitem>
</varlistentry>
<varlistentry>
<term>PREVIOUS</term>
<listitem>Either use the texture color from the previous layer, or
if this is layer 0, use the color of the material as set with
materialSetColor
</listitem>
</varlistentry>
</variablelist>
<refsect2 id="cogl-Layer-Combine-Examples"> <title>Layer Combine Examples</title> <para>This is effectively what the default blending is:</para> <informalexample><programlisting> RGBA = MODULATE (PREVIOUS, TEXTURE) </programlisting></informalexample> <para>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_material_set_layer_constant.</para> <informalexample><programlisting> RGBA = INTERPOLATE (PREVIOUS, TEXTURE, CONSTANT[A]) </programlisting></informalexample> </refsect2>
<note>You can't give a multiplication factor for arguments as you can with blending.</note>
Since: 1.0
setLayerCombineConstant
materialSetLayerCombineConstant Source #
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Int32 |
|
-> Color |
|
-> m () |
Deprecated: (Since version 1.16)Use cogl_pipeline_set_layer_combine_constant()
instead
When you are using the 'CONSTANT' color source in a layer combine description then you can use this function to define its value.
Since: 1.0
setLayerFilters
materialSetLayerFilters Source #
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Int32 |
|
-> MaterialFilter |
|
-> MaterialFilter |
|
-> m () |
Deprecated: (Since version 1.16)Use cogl_pipeline_set_layer_filters()
instead
Changes the decimation and interpolation filters used when a texture is drawn at other scales than 100%.
setLayerMatrix
materialSetLayerMatrix Source #
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Int32 |
|
-> Matrix |
|
-> m () |
Deprecated: (Since version 1.16)Use cogl_pipeline_set_layer_matrix()
instead
This function lets you set a matrix that can be used to e.g. translate and rotate a single layer of a material used to fill your geometry.
setLayerPointSpriteCoordsEnabled
materialSetLayerPointSpriteCoordsEnabled Source #
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Int32 |
|
-> Int32 |
|
-> m Int32 | Returns: |
Deprecated: (Since version 1.16)Use cogl_pipeline_set_layer_point_sprite_coords_enabled()
instead
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 FeatureFlagsPointSprite
is
available. If the feature is not available then the function will
return False
and set error
.
Since: 1.4
setLayerWrapMode
materialSetLayerWrapMode Source #
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Int32 |
|
-> MaterialWrapMode |
|
-> m () |
Deprecated: (Since version 1.16)Use cogl_pipeline_set_layer_wrap_mode()
instead
Sets the wrap mode for all three coordinates of texture lookups on
this layer. This is equivalent to calling
materialSetLayerWrapModeS
,
materialSetLayerWrapModeT
and
materialSetLayerWrapModeP
separately.
Since: 1.4
setLayerWrapModeP
materialSetLayerWrapModeP Source #
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Int32 |
|
-> MaterialWrapMode |
|
-> m () |
Deprecated: (Since version 1.16)Use cogl_pipeline_set_layer_wrap_mode_p()
instead
Sets the wrap mode for the 'p' coordinate of texture lookups on this layer. 'p' is the third coordinate.
Since: 1.4
setLayerWrapModeS
materialSetLayerWrapModeS Source #
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Int32 |
|
-> MaterialWrapMode |
|
-> m () |
Deprecated: (Since version 1.16)Use cogl_pipeline_set_layer_wrap_mode_s()
instead
Sets the wrap mode for the 's' coordinate of texture lookups on this layer.
Since: 1.4
setLayerWrapModeT
materialSetLayerWrapModeT Source #
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Int32 |
|
-> MaterialWrapMode |
|
-> m () |
Deprecated: (Since version 1.16)Use cogl_pipeline_set_layer_wrap_mode_t()
instead
Sets the wrap mode for the 't' coordinate of texture lookups on this layer.
Since: 1.4
setPointSize
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Float |
|
-> m () |
Deprecated: (Since version 1.16)Use cogl_pipeline_set_point_size()
instead
Changes the size of points drawn when VerticesModePoints
is
used with the vertex 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. The default point size is 1.0.
Since: 1.4
setShininess
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Float |
|
-> m () |
Deprecated: (Since version 1.16)Use the CoglSnippet
shader api for lighting
Sets the shininess of the material, 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
Since: 1.0
setSpecular
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Color |
|
-> m () |
Deprecated: (Since version 1.16)Use the CoglSnippet
shader api for lighting
Sets the material'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)
Since: 1.0
setUserProgram
materialSetUserProgram Source #
:: (HasCallStack, MonadIO m) | |
=> Material |
|
-> Ptr () |
|
-> m () |
Deprecated: (Since version 1.16)Use CoglSnippet
api instead instead
Associates a linked CoglProgram with the given material 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 Material
:
>
>CoglHandle shader;
>CoglHandle program;
>CoglMaterial *material;
>
>shader = cogl_create_shader (COGL_SHADER_TYPE_FRAGMENT);
>cogl_shader_source (shader,
> "!!ARBfp1.0n"
> "MOV result.color,fragment.color;n"
> "ENDn");
>cogl_shader_compile (shader);
>
>program = cogl_create_program ();
>cogl_program_attach_shader (program, shader);
>cogl_program_link (program);
>
>material = cogl_material_new ();
>cogl_material_set_user_program (material, 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
FeatureFlagsShadersGlsl
or FeatureFlagsShadersArbfp
before
using the cogl_program or cogl_shader API.
Since: 1.4
unref
:: (HasCallStack, MonadIO m) | |
=> Ptr () |
|
-> m () |
Deprecated: (Since version 1.2)Use cogl_object_unref()
instead
Decrement the reference count for a Material
.
Since: 1.0