Data types for the components of cogl_vertex_buffer_add() Loads an image file from disk. This function can be safely called from within a thread. %NULL if loading the image failed. a #CoglBitmap to the new loaded image data, or the file to load. Error codes that can be thrown when performing bitmap operations. Note that gdk_pixbuf_new_from_file() can also throw errors directly from the underlying image loading library. For example, if GdkPixbuf is used then errors #GdkPixbufError<!-- -->s will be used directly. Error enumeration for the blend strings parser The access hints for cogl_buffer_set_update_hint() Types of auxiliary buffers all the buffer's contents. Hints to Cogl about how you are planning to modify the data once it is mapped. Target flags for FBOs. The update hint on a buffer allows the user to give some detail on how often the buffer data is going to be updated. A structure for holding a color definition. The contents of the CoglColor structure are private and should never by accessed directly. Creates a new (empty) color to free the allocated resources a newly-allocated #CoglColor. Use cogl_color_free() Creates a copy of @color to free the allocate resources a newly-allocated #CoglColor. Use cogl_color_free() Frees the resources allocated by cogl_color_new() and cogl_color_copy() Sets the values of the passed channels into a #CoglColor. value of the red channel, between 0 and 255 value of the green channel, between 0 and 255 value of the blue channel, between 0 and 255 value of the alpha channel, between 0 and 255 Sets the values of the passed channels into a #CoglColor. value of the red channel, between 0 and 255 value of the green channel, between 0 and 255 value of the blue channel, between 0 and 255 value of the alpha channel, between 0 and 255 Sets the values of the passed channels into a #CoglColor value of the red channel, between 0 and %1.0 value of the green channel, between 0 and %1.0 value of the blue channel, between 0 and %1.0 value of the alpha channel, between 0 and %1.0 Sets the values of the passed channels into a #CoglColor value of the red channel, between 0 and %1.0 value of the green channel, between 0 and %1.0 value of the blue channel, between 0 and %1.0 value of the alpha channel, between 0 and %1.0 Sets the values of the passed channels into a #CoglColor a pointer to an array of 4 float color components Retrieves the red channel of @color as a byte value between 0 and 255 the red channel of the passed color Retrieves the green channel of @color as a byte value between 0 and 255 the green channel of the passed color Retrieves the blue channel of @color as a byte value between 0 and 255 the blue channel of the passed color Retrieves the alpha channel of @color as a byte value between 0 and 255 the alpha channel of the passed color Retrieves the red channel of @color as a floating point value between 0.0 and 1.0 the red channel of the passed color Retrieves the green channel of @color as a floating point value between 0.0 and 1.0 the green channel of the passed color Retrieves the blue channel of @color as a floating point value between 0.0 and 1.0 the blue channel of the passed color Retrieves the alpha channel of @color as a floating point value between 0.0 and 1.0 the alpha channel of the passed color Retrieves the red channel of @color as a fixed point value between 0 and %1.0. the red channel of the passed color Retrieves the green channel of @color as a fixed point value between 0 and %1.0. the green channel of the passed color Retrieves the blue channel of @color as a fixed point value between 0 and %1.0. the blue channel of the passed color Retrieves the alpha channel of @color as a fixed point value between 0 and %1.0. the alpha channel of the passed color Sets the red channel of @color to @red. a byte value between 0 and 255 Sets the green channel of @color to @green. a byte value between 0 and 255 Sets the blue channel of @color to @blue. a byte value between 0 and 255 Sets the alpha channel of @color to @alpha. a byte value between 0 and 255 Sets the red channel of @color to @red. a float value between 0.0f and 1.0f Sets the green channel of @color to @green. a float value between 0.0f and 1.0f Sets the blue channel of @color to @blue. a float value between 0.0f and 1.0f Sets the alpha channel of @color to @alpha. a float value between 0.0f and 1.0f Sets the red channel of @color to @red. a float value between 0.0f and 1.0f Sets the green channel of @color to @green. a float value between 0.0f and 1.0f Sets the blue channel of @color to @blue. a float value between 0.0f and 1.0f Sets the alpha channel of @color to @alpha. a float value between 0.0f and 1.0f Converts a non-premultiplied color to a pre-multiplied color. For example, semi-transparent red is (1.0, 0, 0, 0.5) when non-premultiplied and (0.5, 0, 0, 0.5) when premultiplied. Converts a pre-multiplied color to a non-premultiplied color. For example, semi-transparent red is (0.5, 0, 0, 0.5) when premultiplied and (1.0, 0, 0, 0.5) when non-premultiplied. When using depth testing one of these functions is used to compare the depth of an incoming fragment against the depth value currently stored in the depth buffer. The function is changed using cogl_material_set_depth_test_function(). The test is only done when depth testing is explicitly enabled. (See cogl_material_set_depth_test_enabled()) Error enumeration for Cogl The @COGL_ERROR_UNSUPPORTED error can be thrown for a variety of reasons. For example: <itemizedlist> <listitem><para>You've tried to use a feature that is not advertised by cogl_get_features(). This could happen if you create a non-sliced texture with a non-power-of-two size when %COGL_FEATURE_TEXTURE_NPOT is not advertised.</para></listitem> <listitem><para>The GPU can not handle the configuration you have requested. An example might be if you try to use too many texture layers in a single #CoglMaterial</para></listitem> <listitem><para>The driver does not support some configuration.</para></listiem> </itemizedlist> Currently this is only used by Cogl API marked as experimental so this enum should also be considered experimental. Flags for the supported features. The fog mode determines the equation used to calculate the fogging blend factor while fogging is enabled. The simplest %COGL_FOG_MODE_LINEAR mode determines f as: |[ f = end - eye_distance / end - start ]| Where eye_distance is the distance of the current fragment in eye coordinates from the origin. The type used by cogl for function pointers, note that this type is used as a generic catch-all cast for function pointers and the actual arguments and return type may be different. Increases the reference count of @handle by 1 the handle, with its reference count increased Drecreases the reference count of @handle by 1; if the reference count reaches 0, the resources allocated by @handle will be freed You should aim to use the smallest data type that gives you enough range, since it reduces the size of your index array and can help reduce the demand on memory bandwidth. Note that %COGL_INDICES_TYPE_UNSIGNED_INT is only supported if the %COGL_FEATURE_UNSIGNED_INT_INDICES feature is available. This should always be available on OpenGL but on OpenGL ES it will only be available if the GL_OES_element_index_uint extension is advertized. Allocates and initializes a blank white material a pointer to a new #CoglMaterial Creates a new material with the configuration copied from the source material. We would strongly advise developers to always aim to use cogl_material_copy() instead of cogl_material_new() whenever there will be any similarity between two materials. Copying a material helps Cogl keep track of a materials ancestry which we may use to help minimize GPU state changes. a pointer to the newly allocated #CoglMaterial 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 semi-transparent red. See cogl_color_premultiply(). The default value is (1.0, 1.0, 1.0, 1.0) The components of the color Sets the basic color of the material, used when no lighting is enabled. The default value is (0xff, 0xff, 0xff, 0xff) The red component The green component The blue component The alpha component 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) The red component The green component The blue component The alpha component Retrieves the current material color. The location to store the color 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) The components of the desired ambient color Retrieves the current ambient color for @material The location to store the ambient color 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) The components of the desired diffuse color Retrieves the current diffuse color for @material The location to store the diffuse color Conveniently sets the diffuse and ambient color of @material at the same time. See cogl_material_set_ambient() and cogl_material_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) The components of the desired ambient and diffuse colors 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) The components of the desired specular color Retrieves the materials current specular color. The location to store the specular color 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 The desired shininess; must be >= 0.0 Retrieves the materials current emission color. The materials current shininess value 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) The components of the desired emissive color Retrieves the materials current emission color. The location to store the emission color 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_MATERIAL_ALPHA_FUNC_ALWAYS A @CoglMaterialAlphaFunc constant A reference point that the chosen alpha function uses to compare incoming fragments to. 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: |[ &lt;channel-mask&gt;=ADD(SRC_COLOR*(&lt;factor&gt;), DST_COLOR*(&lt;factor&gt;)) ]| <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 cogl_material_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 material is in premultiplied form. described blending is supported by the underlying driver/hardware. If there was an error, %FALSE is returned and @error is set accordingly (if present). %TRUE if the blend string was successfully parsed, and the A <link linkend="cogl-Blend-Strings">Cogl blend string</link> describing the desired blend function. When blending is setup to reference a CONSTANT blend factor then blending will depend on the constant set with this function. The constant color you want Queries what user program has been associated with the given The current user program or %COGL_INVALID_HANDLE. 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 #CoglMaterial: |[ CoglHandle shader; CoglHandle program; CoglMaterial *material; 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); 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 %COGL_FEATURE_SHADERS_GLSL or %COGL_FEATURE_SHADERS_ARBFP before using the cogl_program or cogl_shader API. A #CoglHandle to a linked CoglProgram 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> the index of the layer a #CoglHandle for the layer object This function removes a layer from your material Specifies the layer you want to remove 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 cogl_material_set_color()</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 cogl_material_set_color()</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> described texture combining is supported by the underlying driver and or hardware. On failure, %FALSE is returned and @error is set %TRUE if the blend string was successfully parsed, and the Specifies the layer you want define a combine function for A <link linkend="cogl-Blend-Strings">Cogl blend string</link> describing the desired texture combine function. When you are using the 'CONSTANT' color source in a layer combine description then you can use this function to define its value. Specifies the layer you want to specify a constant used for texture combining The constant color you want 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. the index for the layer inside @material the transformation matrix for the layer 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> list of #CoglMaterialLayer<!-- -->'s that can be passed to the cogl_material_layer_* functions. The list is owned by Cogl and it should not be modified or freed A Retrieves the number of layers defined for the given @material the number of layers Changes the decimation and interpolation filters used when a texture is drawn at other scales than 100%. the layer number to change. the filter used when scaling a texture down. the filter used when magnifying a texture. 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_POINT_SPRITE is available. If the feature is not available then the function will return %FALSE and set @error. %TRUE if the function succeeds, %FALSE otherwise. the layer number to change. whether to enable point sprite coord generation. Gets whether point sprite coordinate generation is enabled for this texture layer. point sprite coordinates. whether the texture coordinates will be replaced with the layer number to check. Sets the wrap mode for the 's' coordinate of texture lookups on this layer. the layer number to change. the new wrap mode Sets the wrap mode for the 't' coordinate of texture lookups on this layer. the layer number to change. the new wrap mode Sets the wrap mode for the 'p' coordinate of texture lookups on this layer. 'p' is the third coordinate. the layer number to change. the new wrap mode Sets the wrap mode for all three coordinates of texture lookups on this layer. This is equivalent to calling cogl_material_set_layer_wrap_mode_s(), cogl_material_set_layer_wrap_mode_t() and cogl_material_set_layer_wrap_mode_p() separately. the layer number to change. the new wrap mode Enables or disables depth testing according to the value of If depth testing is enable then the #CoglDepthTestFunction set using cogl_material_set_depth_test_function() us used to evaluate the depth value of incoming fragments against the corresponding value stored in the current depth buffer, and if the test passes then the fragments depth value is used to update the depth buffer. (unless you have disabled depth writing via cogl_material_set_depth_writing_enabled ()) By default depth testing is disabled. The enable state you want Gets the current depth test enabled state as previously set by cogl_material_set_depth_test_enabled(). The material's current depth test enabled state. Enables or disables depth buffer writing according to the value of between a fragment's depth value and the corresponding depth buffer value passes then the fragment's depth is written to the depth buffer unless writing is disabled here. By default depth writing is enabled The enable state you want Gets the depth writing enable state as set by the corresponding cogl_material_set_depth_writing_enabled. The current depth writing enable state Sets the #CoglDepthTestFunction used to compare the depth value of an incoming fragment against the corresponding value in the current depth buffer. The #CoglDepthTestFunction to set Gets the current depth test enable state as previously set via cogl_material_set_depth_test_enabled(). The current depth test enable state. Sets the range to map depth values in normalized device coordinates to before writing out to a depth buffer. After your geometry has be transformed, clipped and had perspective division applied placing it in normalized device coordinates all depth values between the near and far z clipping planes are in the range -1 to 1. Before writing any depth value to the depth buffer though the value is mapped into the range [0, 1]. With this function you can change the range which depth values are mapped too although the range must still lye within the range [0, 1]. If your driver does not support this feature (for example you are using GLES 1 drivers) then this will return %FALSE and set an error if @error isn't NULL. You can check ahead of time for the %COGL_FEATURE_DEPTH_RANGE feature with cogl_features_available() to know if this function will succeed. By default normalized device coordinate depth values are mapped to the full range of depth buffer values, [0, 1]. %TRUE if driver support is available else %FALSE. The near component of the desired depth range which will be clamped to the range [0, 1] The far component of the desired depth range which will be clamped to the range [0, 1] Alpha testing happens before blending primitives with the framebuffer and gives an opportunity to discard fragments based on a comparison with the incoming alpha value and a reference alpha value. The #CoglMaterialAlphaFunc determines how the comparison is done. Texture filtering is used whenever the current pixel maps either to more than one texture element (texel) or less than one. These filter enums correspond to different strategies used to come up with a pixel color, by possibly referring to multiple neighbouring texels and taking a weighted average or simply using the nearest texel. Extracts a texture handle for a specific layer. <note>In the future Cogl may support purely GLSL based layers; for those layers this function which will likely return %COGL_INVALID_HANDLE if you try to get the texture handle from them. Considering this scenario, you should call cogl_material_layer_get_type() first in order check it is of type %COGL_MATERIAL_LAYER_TYPE_TEXTURE before calling this function.</note> a #CoglHandle for the texture inside the layer Queries the currently set downscaling filter for a material layer the current downscaling filter Queries the currently set downscaling filter for a material later the current downscaling filter Gets the wrap mode for the 's' coordinate of texture lookups on this layer. the wrap mode value for the s coordinate. Gets the wrap mode for the 't' coordinate of texture lookups on this layer. the wrap mode value for the t coordinate. Gets the wrap mode for the 'p' coordinate of texture lookups on this layer. 'p' is the third coordinate. the wrap mode value for the p coordinate. Available types of layers for a #CoglMaterial. This enumeration might be expanded in later versions. The wrap mode specifies what happens when texture coordinates outside the range 0→1 are used. Note that if the filter mode is anything but %COGL_MATERIAL_FILTER_NEAREST then texels outside the range 0→1 might be used even when the coordinate is exactly 0 or 1 because OpenGL will try to sample neighbouring pixels. For example if you are trying to render the full texture then you may get artifacts around the edges when the pixels from the other side are merged in if the wrap mode is set to repeat. A CoglMatrix holds a 4x4 transform matrix. This is a single precision, column-major matrix which means it is compatible with what OpenGL expects. A CoglMatrix can represent transforms such as, rotations, scaling, translation, sheering, and linear projections. You can combine these transforms by multiplying multiple matrices in the order you want them applied. The transformation of a vertex (x, y, z, w) by a CoglMatrix is given by: |[ x_new = xx * x + xy * y + xz * z + xw * w y_new = yx * x + yy * y + yz * z + yw * w z_new = zx * x + zy * y + zz * z + zw * w w_new = wx * x + wy * y + wz * z + ww * w ]| Where w is normally 1 <note>You must consider the members of the CoglMatrix structure read only, and all matrix modifications must be done via the cogl_matrix API. This allows Cogl to annotate the matrices internally. Violation of this will give undefined results. If you need to initialize a matrix with a constant other than the identity matrix you can use cogl_matrix_init_from_array().</note> Resets matrix to the identity matrix: |[ .xx=1; .xy=0; .xz=0; .xw=0; .yx=0; .yy=1; .yz=0; .yw=0; .zx=0; .zy=0; .zz=1; .zw=0; .wx=0; .wy=0; .wz=0; .ww=1; ]| Multiplies the two supplied matrices together and stores the resulting matrix inside @result A 4x4 transformation matrix A 4x4 transformation matrix Multiplies @matrix with a rotation matrix that applies a rotation of @angle degrees around the specified 3D vector. The angle you want to rotate in degrees X component of your rotation vector Y component of your rotation vector Z component of your rotation vector Multiplies @matrix with a transform matrix that translates along the X, Y and Z axis. The X translation you want to apply The Y translation you want to apply The Z translation you want to apply Multiplies @matrix with a transform matrix that scales along the X, Y and Z axis. The X scale factor The Y scale factor The Z scale factor Multiplies @matrix by the given frustum perspective matrix. coord of left vertical clipping plane coord of right vertical clipping plane coord of bottom horizontal clipping plane coord of top horizontal clipping plane positive distance to near depth clipping plane positive distance to far depth clipping plane Multiplies @matrix by the described perspective matrix <note>You should be careful not to have to great a @z_far / @z_near ratio since that will reduce the effectiveness of depth testing since there wont be enough precision to identify the depth of objects near to each other.</note> A field of view angle for the Y axis The ratio of width to height determining the field of view angle for the x axis. The distance to the near clip plane. Never pass 0 and always pass a positive number. The distance to the far clip plane. (Should always be positive) Multiplies @matrix by a parallel projection matrix. The coordinate for the left clipping plane The coordinate for the right clipping plane The coordinate for the bottom clipping plane The coordinate for the top clipping plane The coordinate for the near clipping plane (may be negative if the plane is behind the viewer) The coordinate for the far clipping plane (may be negative if the plane is behind the viewer) Initializes @matrix with the contents of @array A linear array of 16 floats (column-major order) Casts @matrix to a float array which can be directly passed to OpenGL. a pointer to the float array Gets the inverse transform of a given matrix and uses it to initialize a new #CoglMatrix. <note>Although the first parameter is annotated as const to indicate that the transform it represents isn't modified this function may technically save a copy of the inverse transform within the given #CoglMatrix so that subsequent requests for the inverse transform may avoid costly inversion calculations.</note> for degenerate transformations that can't be inverted (in this case the %TRUE if the inverse was successfully calculated or %FALSE The destination for a 4x4 inverse transformation matrix Transforms a point whos position is given and returned as four float components. The X component of your points position The Y component of your points position The Z component of your points position The W component of your points position Associates some private @user_data with a given #CoglObject. To later remove the association call cogl_object_set_user_data() with the same @key but NULL for the @user_data. The address of a #CoglUserDataKey which provides a unique value with which to index the private data. The data to associate with the given object, or NULL to remove a previous association. A #CoglUserDataDestroyCallback to call if the object is destroyed or if the association is removed by later setting NULL data for the same key. Finds the user data previously associated with @object using the given @key. If no user data has been associated with @object for the given @key this function returns NULL. the given @key; or NULL if no associated data is found. The user data previously associated with @object using The address of a #CoglUserDataKey which provides a unique value with which to index the private data. Returns a new copy of the path in @path. The new path has a reference count of 1 so you should unref it with cogl_object_unref() if you no longer need it. Internally the path will share the data until one of the paths is modified so copying paths should be relatively cheap. a copy of the path in @path. #CoglPathFillRule is used to determine how a path is filled. There are two options - 'non-zero' and 'even-odd'. To work out whether any point will be filled imagine drawing an infinetely long line in any direction from that point. The number of times and the direction that the edges of the path crosses this line determines whether the line is filled as described below. Any open sub paths are treated as if there was an extra line joining the first point and the last point. The default fill rule is %COGL_PATH_FILL_RULE_EVEN_ODD. The fill rule is attached to the current path so preserving a path with cogl_get_path() also preserves the fill rule. Calling cogl_path_new() resets the current fill rule to the default. <figure id="fill-rule-non-zero"> <title>Example of filling various paths using the non-zero rule</title> <graphic fileref="fill-rule-non-zero.png" format="PNG"/> </figure> <figure id="fill-rule-even-odd"> <title>Example of filling various paths using the even-odd rule</title> <graphic fileref="fill-rule-even-odd.png" format="PNG"/> </figure> Pixel formats used by COGL. For the formats with a byte per component, the order of the components specify the order in increasing memory addresses. So for example %COGL_PIXEL_FORMAT_RGB_888 would have the red component in the lowest address, green in the next address and blue after that regardless of the endinanness of the system. For the 16-bit formats the component order specifies the order within a 16-bit number from most significant bit to least significant. So for %COGL_PIXEL_FORMAT_RGB_565, the red component would be in bits 11-15, the green component would be in 6-11 and the blue component would be in 1-5. Therefore the order in memory depends on the endianness of the system. When uploading a texture %COGL_PIXEL_FORMAT_ANY can be used as the internal format. Cogl will try to pick the best format to use internally and convert the texture data if necessary. Flags for cogl_read_pixels() Types of shaders Flags to pass to the cogl_texture_new_* family of functions. Used to specify vertex information when calling cogl_polygon() When associating private data with a #CoglObject a callback can be given which will be called either if the object is destroyed or if cogl_object_set_user_data() is called with NULL user_data for the same key. The data whos association with a #CoglObject has been destoyed. A #CoglUserDataKey is used to declare a key for attaching data to a #CoglObject using cogl_object_set_user_data. The typedef only exists as a formality to make code self documenting since only the unique address of a #CoglUserDataKey is used. Typically you would declare a static #CoglUserDataKey and set private data on an object something like this: |[ static CoglUserDataKey path_private_key; static void destroy_path_private_cb (void *data) { g_free (data); } static void my_path_set_data (CoglPath *path, void *data) { cogl_object_set_user_data (COGL_OBJECT (path), &private_key, data, destroy_path_private_cb); } ]| How vertices passed to cogl_vertex_buffer_draw() and cogl_vertex_buffer_draw_elements() should be interpreted Computes the cosine of @angle the cosine of the passed angle an angle expressed using #CoglAngle Computes the sine of @angle the sine of the passed angle an angle expressed using #CoglAngle Computes the tangent of @angle the tangent of the passed angle an angle expressed using #CoglAngle We do not advise nor reliably support the interleaving of raw GL drawing and Cogl drawing functions, but if you insist, cogl_begin_gl() and cogl_end_gl() provide a simple mechanism that may at least give you a fighting chance of succeeding. through the modification of GL state; that will never be reliably supported, but if you are trying to do something like: |[ { - setup some OpenGL state. - draw using OpenGL (e.g. glDrawArrays() ) - reset modified OpenGL state. - continue using Cogl to draw } ]| You should surround blocks of drawing using raw GL with cogl_begin_gl() and cogl_end_gl(): |[ { cogl_begin_gl (); - setup some OpenGL state. - draw using OpenGL (e.g. glDrawArrays() ) - reset modified OpenGL state. cogl_end_gl (); - continue using Cogl to draw } ]| Don't ever try and do: |[ { - setup some OpenGL state. - use Cogl to draw - reset modified OpenGL state. } ]| When the internals of Cogl evolves, this is very liable to break. This function will flush all batched primitives, and subsequently flush all internal Cogl state to OpenGL as if it were going to draw something itself. The result is that the OpenGL modelview matrix will be setup; the state corresponding to the current source material will be set up and other world state such as backface culling, depth and fogging enabledness will be sent to OpenGL. <note>No special material state is flushed, so if you want Cogl to setup a simplified material state it is your responsibility to set a simple source material before calling cogl_begin_gl(). E.g. by calling cogl_set_source_color4ub().</note> <note>It is your responsibility to restore any OpenGL state that you modify to how it was after calling cogl_begin_gl() if you don't do this then the result of further Cogl calls is undefined.</note> <note>You can not nest begin/end blocks.</note> Again we would like to stress, we do not advise the use of this API and if possible we would prefer to improve Cogl than have developers require raw OpenGL. Parses an image file enough to extract the width and height of the bitmap. %TRUE if the image was successfully parsed the file to check return location for the bitmap width, or %NULL return location for the bitmap height, or %NULL Check whether @name occurs in list of extensions in @ext. not appropriate to expose OpenGL extensions through the Cogl API. This function can be replaced by the following equivalent code: |[ ]| %TRUE if the extension occurs in the list, %FALSE otherwise. extension to check for list of extensions Clears all the auxiliary buffers identified in the @buffers mask, and if that includes the color buffer then the specified @color is used. Background color to clear to A mask of #CoglBufferBit<!-- -->'s identifying which auxiliary buffers to clear Ensures that the current clipping region has been set in GL. This will automatically be called before any Cogl primitives but it maybe be neccessary to call if you are using raw GL calls with clipping. Reverts the clipping region to the state before the last call to cogl_clip_push(). Specifies a rectangular clipping area for all subsequent drawing operations. Any drawing commands that extend outside the rectangle will be clipped so that only the portion inside the rectangle will be displayed. The rectangle dimensions are transformed by the current model-view matrix. The rectangle is intersected with the current clip region. To undo the effect of this function, call cogl_clip_pop(). with other API that specify rectangles in model space, and when used with a coordinate space that puts the origin at the center and y+ extending up, it's awkward to use. Please use cogl_clip_push_rectangle() instead left edge of the clip rectangle top edge of the clip rectangle width of the clip rectangle height of the clip rectangle Sets a new clipping area using the current path. The current path is then cleared. The clipping area is intersected with the previous clipping area. To restore the previous clipping area, call cogl_clip_pop(). Sets a new clipping area using the current path. The current path is then cleared. The clipping area is intersected with the previous clipping area. To restore the previous clipping area, call cogl_clip_pop(). Specifies a rectangular clipping area for all subsequent drawing operations. Any drawing commands that extend outside the rectangle will be clipped so that only the portion inside the rectangle will be displayed. The rectangle dimensions are transformed by the current model-view matrix. The rectangle is intersected with the current clip region. To undo the effect of this function, call cogl_clip_pop(). x coordinate for top left corner of the clip rectangle y coordinate for top left corner of the clip rectangle x coordinate for bottom right corner of the clip rectangle y coordinate for bottom right corner of the clip rectangle Specifies a rectangular clipping area for all subsequent drawing operations. Any drawing commands that extend outside the rectangle will be clipped so that only the portion inside the rectangle will be displayed. The rectangle dimensions are not transformed by the current model-view matrix. The rectangle is intersected with the current clip region. To undo the effect of this function, call cogl_clip_pop(). left edge of the clip rectangle in window coordinates top edge of the clip rectangle in window coordinates width of the clip rectangle height of the clip rectangle Specifies a rectangular clipping area for all subsequent drawing operations. Any drawing commands that extend outside the rectangle will be clipped so that only the portion inside the rectangle will be displayed. The rectangle dimensions are not transformed by the current model-view matrix. The rectangle is intersected with the current clip region. To undo the effect of this function, call cogl_clip_pop(). left edge of the clip rectangle in window coordinates top edge of the clip rectangle in window coordinates width of the clip rectangle height of the clip rectangle Restore the state of the clipping stack that was previously saved by cogl_clip_stack_save(). the clip stack when switching back from an offscreen framebuffer, but it's not necessary anymore given that framebuffers now own separate clip stacks which will be automatically switched between when a new buffer is set. Calling this function has no effect Save the entire state of the clipping stack and then clear all clipping. The previous state can be returned to with cogl_clip_stack_restore(). Each call to cogl_clip_push() after this must be matched by a call to cogl_clip_pop() before calling cogl_clip_stack_restore(). clip stack when switching to an offscreen framebuffer, but it's not necessary anymore given that framebuffers now own separate clip stacks which will be automatically switched between when a new buffer is set. Calling this function has no effect Compares two #CoglColor<!-- -->s and checks if they are the same. This function can be passed to g_hash_table_new() as the @key_equal_func parameter, when using #CoglColor<!-- -->s as keys in a #GHashTable. %TRUE if the two colors are the same. a #CoglColor a #CoglColor Create a new cogl program object that can be used to replace parts of the GL rendering pipeline with custom code. a new cogl program. Create a new shader handle, use #cogl_shader_source to set the source code to be used on it. a new shader handle. COGL_SHADER_TYPE_VERTEX or COGL_SHADER_TYPE_FRAGMENT. This function disables fogging, so primitives drawn afterwards will not be blended with any previously set fog color. This is the counterpart to cogl_begin_gl() used to delimit blocks of drawing code using raw OpenGL. Please refer to cogl_begin_gl() for full details. Checks whether the given COGL features are available. Multiple features can be checked for by or-ing them together with the '|' operator. %TRUE is only returned if all of the requested features are available. %TRUE if the features are available, %FALSE otherwise. A bitmask of features to check for Computes the arc tangent of @a. the arc tangent of the passed value, in fixed point notation a #CoglFixed number Computes the arc tangent of @a / @b but uses the sign of both arguments to return the angle in right quadrant. notation the arc tangent of the passed fraction, in fixed point the numerator as a #CoglFixed number the denominator as a #CoglFixed number Computes the cosine of @angle. the cosine of the passed angle, in fixed point notation a #CoglFixed number Calculates base 2 logarithm. This function is some 2.5 times faster on x86, and over 12 times faster on fpu-less arm, than using libc log(). base 2 logarithm. value to calculate base 2 logarithm from Calculates @x to the @y power. the power of @x to the @y base #CoglFixed exponent Calculates 2 to the @x power. This function is around 11 times faster on x86, and around 22 times faster on fpu-less arm than libc pow(2, x). the power of 2 to the passed value a #CoglFixed number Computes the sine of @angle. the sine of the passed angle, in fixed point notation a #CoglFixed number Computes the square root of @x. notation the square root of the passed value, in floating point a #CoglFixed number Computes the tangent of @angle. the tangent of the passed angle, in fixed point notation a #CoglFixed number This function should only need to be called in exceptional circumstances. As an optimization Cogl drawing functions may batch up primitives internally, so if you are trying to use raw GL outside of Cogl you stand a better chance of being successful if you ask Cogl to flush any batched geometry before making your state changes. It only ensure that the underlying driver is issued all the commands necessary to draw the batched primitives. It provides no guarantees about when the driver will complete the rendering. This provides no guarantees about the GL state upon returning and to avoid confusing Cogl you should aim to restore any changes you make before resuming use of Cogl. If you are making state changes with the intention of affecting Cogl drawing primitives you are 100% on your own since you stand a good chance of conflicting with Cogl internals. For example clutter-gst which currently uses direct GL calls to bind ARBfp programs will very likely break when Cogl starts to use ARBfb programs itself for the material API. Replaces the current projection matrix with a perspective matrix for the given viewing frustum. Left clipping plane Right clipping plane Bottom clipping plane Top clipping plane Nearest visible point Furthest visible point along the z-axis Queries if backface culling has been enabled via cogl_set_backface_culling_enabled() %TRUE if backface culling is enabled, and %FALSE otherwise Gets the number of bitplanes used for each of the color components in the color buffer. Pass %NULL for any of the arguments if the value is not required. Return location for the number of red bits or %NULL Return location for the number of green bits or %NULL Return location for the number of blue bits or %NULL Return location for the number of alpha bits or %NULL Queries if depth testing has been enabled via cogl_set_depth_test_enable() instead. %TRUE if depth testing is enabled, and %FALSE otherwise Returns all of the features supported by COGL. A logical OR of all the supported COGL features. Stores the current model-view matrix in @matrix. return location for the model-view matrix Retrieves the #GOptionGroup used by COGL to parse the command line options. Clutter uses this to handle the COGL command line options during its initialization process. a #GOptionGroup Gets a pointer to the current path. The path can later be used again by calling cogl_path_set(). Note that the path isn't copied so if you later call any functions to add to the path it will affect the returned object too. No reference is taken on the path so if you want to retain it you should take your own reference with cogl_object_ref(). a pointer to the current path. Gets a pointer to a given GL or GL ES extension function. This acts as a wrapper around glXGetProcAddress() or whatever is the appropriate function for the current backend. function is not available. a pointer to the requested function or %NULL if the the name of the function. Stores the current projection matrix in @matrix. return location for the projection matrix Stores the current viewport in @v. @v[0] and @v[1] get the x and y position of the viewport and @v[2] and @v[3] get the width and height. pointer to a 4 element array of #float<!-- -->s to receive the viewport dimensions. Checks whether @handle is a #CoglHandle for a bitmap and %FALSE otherwise %TRUE if the passed handle represents a bitmap, a #CoglHandle for a bitmap Gets whether the given handle references an existing material object. %FALSE otherwise %TRUE if the handle references a #CoglMaterial, A CoglHandle Determines whether the given #CoglHandle references an offscreen buffer object. %FALSE otherwise %TRUE if the handle references an offscreen buffer, A CoglHandle for an offscreen buffer Gets whether the given handle references an existing path object. %FALSE otherwise %TRUE if the handle references a #CoglPath, A CoglHandle Gets whether the given handle references an existing program object. %FALSE otherwise %TRUE if the handle references a program, A CoglHandle Gets whether the given handle references an existing shader object. %FALSE otherwise %TRUE if the handle references a shader, A CoglHandle Gets whether the given handle references an existing texture object. %FALSE otherwise %TRUE if the handle references a texture, and A CoglHandle Checks whether @handle is a Vertex Buffer Object otherwise %TRUE if the handle is a VBO, and %FALSE a #CoglHandle for a vertex buffer object Checks whether @handle is a handle to the indices for a vertex buffer object otherwise %TRUE if the handle is indices, and %FALSE a #CoglHandle Get the size of points drawn when %COGL_VERTICES_MODE_POINTS is used with the vertex buffer API. the point size of the material. a #CoglHandle to a material. Retrieves the type of the layer Currently there is only one type of layer defined: %COGL_MATERIAL_LAYER_TYPE_TEXTURE, but considering we may add purely GLSL based layers in the future, you should write code that checks the type first. the type of the layer A #CoglMaterialLayer object Increment the reference count for a #CoglMaterial. the @material. Changes the size of points drawn when %COGL_VERTICES_MODE_POINTS 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. a #CoglHandle to a material. Decrement the reference count for a #CoglMaterial. Compares two matrices to see if they represent the same transformation. Although internally the matrices may have different annotations associated with them and may potentially have a cached inverse matrix these are not considered in the comparison. A 4x4 transformation matrix A 4x4 transformation matrix Increases the reference count of @handle by 1 the @object, with its reference count increased a #CoglObject Drecreases the reference count of @object by 1; if the reference count reaches 0, the resources allocated by @object will be freed a #CoglObject This creates an offscreen buffer object using the given texture as the primary color buffer. It doesn't just initialize the contents of the offscreen buffer with the texture; they are tightly bound so that drawing to the offscreen buffer effectivly updates the contents of the given texture. You don't need to destroy the offscreen buffer before you can use the texture again. if it wasn't possible to create the buffer. a #CoglHandle for the new offscreen buffer or %COGL_INVALID_HANDLE A CoglHandle for a Cogl texture Increments the reference count on the offscreen buffer. For convenience it returns the given CoglHandle A CoglHandle for an offscreen buffer Decreases the reference count for the offscreen buffer and frees it when the count reaches 0. A CoglHandle for an offscreen buffer Replaces the current projection matrix with an orthographic projection matrix. See <xref linkend="cogl-ortho-matrix"/> to see how the matrix is calculated. <figure id="cogl-ortho-matrix"> <title></title> <graphic fileref="cogl_ortho.png" format="PNG"/> </figure> <note>This function copies the arguments from OpenGL's glOrtho() even though they are unnecessarily confusing due to the z near and z far arguments actually being a "distance" from the origin, where negative values are behind the viewer, instead of coordinates for the z clipping planes which would have been consistent with the left, right bottom and top arguments.</note> The coordinate for the left clipping plane The coordinate for the right clipping plane The coordinate for the bottom clipping plane The coordinate for the top clipping plane The <emphasis>distance</emphasis> to the near clipping plane (negative if the plane is behind the viewer) The <emphasis>distance</emphasis> for the far clipping plane (negative if the plane is behind the viewer) Adds an elliptical arc segment to the current path. A straight line segment will link the current pen location with the first vertex of the arc. If you perform a move_to to the arcs start just before drawing it you create a free standing arc. The angles are measured in degrees where 0° is in the direction of the positive X axis and 90° is in the direction of the positive Y axis. The angle of the arc begins at @angle_1 and heads towards otherwise it will increase). X coordinate of the elliptical arc center Y coordinate of the elliptical arc center X radius of the elliptical arc Y radius of the elliptical arc Angle in degrees at which the arc begin Angle in degrees at which the arc ends Closes the path being constructed by adding a straight line segment to it that ends at the first vertex of the path. Adds a cubic bezier curve segment to the current path with the given second, third and fourth control points and using current pen location as the first control point. X coordinate of the second bezier control point Y coordinate of the second bezier control point X coordinate of the third bezier control point Y coordinate of the third bezier control point X coordinate of the fourth bezier control point Y coordinate of the fourth bezier control point Constructs an ellipse shape. If there is an existing path this will start a new disjoint sub-path. X coordinate of the ellipse center Y coordinate of the ellipse center X radius of the ellipse Y radius of the ellipse Fills the interior of the constructed shape using the current drawing color. The current path is then cleared. To use the path again, call cogl_path_fill_preserve() instead. The interior of the shape is determined using the fill rule of the path. See %CoglPathFillRule for details. Fills the interior of the constructed shape using the current drawing color and preserves the path to be used again. See cogl_path_fill() for a description what is considered the interior of the shape. the fill rule that is used for the current path. Constructs a straight line shape starting and ending at the given coordinates. If there is an existing path this will start a new disjoint sub-path. X coordinate of the start line vertex Y coordinate of the start line vertex X coordinate of the end line vertex Y coordinate of the end line vertex Adds a straight line segment to the current path that ends at the given coordinates. X coordinate of the end line vertex Y coordinate of the end line vertex Moves the pen to the given location. If there is an existing path this will start a new disjoint subpath. X coordinate of the pen location to move to. Y coordinate of the pen location to move to. Clears the current path and starts a new one. Creating a new path also resets the fill rule to the default which is %COGL_PATH_FILL_RULE_EVEN_ODD. Constructs a polygonal shape of the given number of vertices. If there is an existing path this will start a new disjoint sub-path. The coords array must contain 2 * num_points values. The first value represents the X coordinate of the first vertex, the second value represents the Y coordinate of the first vertex, continuing in the same fashion for the rest of the vertices. A pointer to the first element of an array of fixed-point values that specify the vertex coordinates. The total number of vertices. Constructs a series of straight line segments, starting from the first given vertex coordinate. If there is an existing path this will start a new disjoint sub-path. Each subsequent segment starts where the previous one ended and ends at the next given vertex coordinate. The coords array must contain 2 * num_points values. The first value represents the X coordinate of the first vertex, the second value represents the Y coordinate of the first vertex, continuing in the same fashion for the rest of the vertices. (num_points - 1) segments will be constructed. A pointer to the first element of an array of fixed-point values that specify the vertex coordinates. The total number of vertices. Constructs a rectangular shape at the given coordinates. If there is an existing path this will start a new disjoint sub-path. X coordinate of the top-left corner. Y coordinate of the top-left corner. X coordinate of the bottom-right corner. Y coordinate of the bottom-right corner. Adds a cubic bezier curve segment to the current path with the given second, third and fourth control points and using current pen location as the first control point. The given coordinates are relative to the current pen location. X coordinate of the second bezier control point Y coordinate of the second bezier control point X coordinate of the third bezier control point Y coordinate of the third bezier control point X coordinate of the fourth bezier control point Y coordinate of the fourth bezier control point Adds a straight line segment to the current path that ends at the given coordinates relative to the current pen location. X offset from the current pen location of the end line vertex Y offset from the current pen location of the end line vertex Moves the pen to the given offset relative to the current pen location. If there is an existing path this will start a new disjoint subpath. X offset from the current pen location to move the pen to. Y offset from the current pen location to move the pen to. Constructs a rectangular shape with rounded corners. If there is an existing path this will start a new disjoint sub-path. X coordinate of the top-left corner. Y coordinate of the top-left corner. X coordinate of the bottom-right corner. Y coordinate of the bottom-right corner. Radius of the corner arcs. Angle increment resolution for subdivision of the corner arcs. Sets the fill rule of the current path to @fill_rule. This will affect how the path is filled when cogl_path_fill() is later called. Note that the fill rule state is attached to the path so calling cogl_get_path() will preserve the fill rule and calling cogl_path_new() will reset the fill rule back to the default. The new fill rule. Strokes the constructed shape using the current drawing color and a width of 1 pixel (regardless of the current transformation matrix). To current path is then cleared. To use the path again, call cogl_path_stroke_preserve() instead. Strokes the constructed shape using the current drawing color and preserves the path to be used again. Replaces the current projection matrix with a perspective matrix based on the provided values. Vertical of view angle in degrees. Aspect ratio of diesplay Nearest visible point Furthest visible point along the z-axis Draws a convex polygon using the current source material to fill / texture with according to the texture coordinates passed. If @use_color is %TRUE then the color will be changed for each vertex using the value specified in the color member of #CoglTextureVertex. This can be used for example to make the texture fade out by setting the alpha value of the color. All of the texture coordinates must be in the range [0,1] and repeating the texture is not supported. Because of the way this function is implemented it will currently only work if either the texture is not sliced or the backend is not OpenGL ES and the minifying and magnifying functions are both set to COGL_MATERIAL_FILTER_NEAREST. An array of #CoglTextureVertex structs The length of the vertices array %TRUE if the color member of #CoglTextureVertex should be used Restore cogl_set_draw_buffer() state. Restores the framebuffer that was previously at the top of the stack. All subsequent drawing will be redirected to this framebuffer. Restores the current model-view matrix from the matrix stack. Attaches a shader to a program object, a program can have one vertex shader and one fragment shader attached. a #CoglHandle for a shdaer program. a #CoglHandle for a vertex of fragment shader. Retrieve the location (offset) of a uniform variable in a shader program, a uniform is a variable that is constant for all vertices/fragments for a shader object and is possible to modify as an external parameter. This uniform can be set using cogl_program_uniform_1f() when the program is in use. the offset of a uniform in a specified program. a #CoglHandle for a shader program. the name of a uniform. Links a program making it ready for use. a #CoglHandle for a shader program. Add an extra reference to a program. @handle A #CoglHandle to a program. Changes the value of a floating point uniform for the given linked A #CoglHandle for a linked program the uniform location retrieved from cogl_program_get_uniform_location(). the new value of the uniform. Changes the value of an integer uniform for the given linked A #CoglHandle for a linked program the uniform location retrieved from cogl_program_get_uniform_location(). the new value of the uniform. Changes the value of a float vector uniform, or uniform array for the given linked @program. A #CoglHandle for a linked program the uniform location retrieved from cogl_program_get_uniform_location(). The number of components for the uniform. For example with glsl you'd use 3 for a vec3 or 4 for a vec4. For uniform arrays this is the array length otherwise just pass 1 the new value of the uniform[s]. Changes the value of a int vector uniform, or uniform array for the given linked @program. A #CoglHandle for a linked program the uniform location retrieved from cogl_program_get_uniform_location(). The number of components for the uniform. For example with glsl you'd use 3 for a vec3 or 4 for a vec4. For uniform arrays this is the array length otherwise just pass 1 the new value of the uniform[s]. Changes the value of a matrix uniform, or uniform array in the given linked @program. A #CoglHandle for a linked program the uniform location retrieved from cogl_program_get_uniform_location(). The dimensions of the matrix. So for for example pass 2 for a 2x2 matrix or 3 for 3x3. For uniform arrays this is the array length otherwise just pass 1 Whether to transpose the matrix when setting the uniform. the new value of the uniform. Changes the value of a floating point uniform in the currently used (see cogl_program_use()) shader program. the uniform to set. the new value of the uniform. Changes the value of an integer uniform in the currently used (see cogl_program_use()) shader program. the uniform to set. the new value of the uniform. Changes the value of a float vector uniform, or uniform array in the currently used (see cogl_program_use()) shader program. the uniform to set. Size of float vector. Size of array of uniforms. the new value of the uniform. Changes the value of a int vector uniform, or uniform array in the currently used (see cogl_program_use()) shader program. the uniform to set. Size of int vector. Size of array of uniforms. the new value of the uniform. Changes the value of a matrix uniform, or uniform array in the currently used (see cogl_program_use()) shader program. The @size parameter is used to determine the square size of the matrix. the uniform to set. Size of matrix. Size of array of uniforms. Whether to transpose the matrix when setting the uniform. the new value of the uniform. Removes a reference to a program. If it was the last reference the program object will be destroyed. A #CoglHandle to a program. Activate a specific shader program replacing that part of the GL rendering pipeline, if passed in %COGL_INVALID_HANDLE the default behavior of GL is reinstated. a #CoglHandle for a shader program or %COGL_INVALID_HANDLE. Save cogl_set_draw_buffer() state. Redirects all subsequent drawing to the specified framebuffer. This can either be an offscreen buffer created with cogl_offscreen_new_to_texture () or in the future it may be an onscreen framebuffer too. You should understand that a framebuffer owns the following state: <itemizedlist> <listitem><simpara>The projection matrix</simpara></listitem> <listitem><simpara>The modelview matrix stack</simpara></listitem> <listitem><simpara>The viewport</simpara></listitem> <listitem><simpara>The clip stack</simpara></listitem> </itemizedlist> So these items will automatically be saved and restored when you push and pop between different framebuffers. Also remember a newly allocated framebuffer will have an identity matrix for the projection and modelview matrices which gives you a coordinate space like OpenGL with (-1, -1) corresponding to the top left of the viewport, (1, 1) corresponding to the bottom right and +z coming out towards the viewer. If you want to set up a coordinate space like Clutter does with (0, 0) corresponding to the top left and (framebuffer_width, framebuffer_height) corresponding to the bottom right you can do so like this: |[ static void setup_viewport (unsigned int width, unsigned int height, float fovy, float aspect, float z_near, float z_far) { float z_camera; CoglMatrix projection_matrix; CoglMatrix mv_matrix; cogl_set_viewport (0, 0, width, height); cogl_perspective (fovy, aspect, z_near, z_far); cogl_get_projection_matrix (&amp;projection_matrix); z_camera = 0.5 * projection_matrix.xx; cogl_matrix_init_identity (&amp;mv_matrix); cogl_matrix_translate (&amp;mv_matrix, -0.5f, -0.5f, -z_camera); cogl_matrix_scale (&amp;mv_matrix, 1.0f / width, -1.0f / height, 1.0f / width); cogl_matrix_translate (&amp;mv_matrix, 0.0f, -1.0 * height, 0.0f); cogl_set_modelview_matrix (&amp;mv_matrix); } static void my_init_framebuffer (ClutterStage *stage, CoglFramebuffer *framebuffer, unsigned int framebuffer_width, unsigned int framebuffer_height) { ClutterPerspective perspective; clutter_stage_get_perspective (stage, &perspective); cogl_push_framebuffer (framebuffer); setup_viewport (framebuffer_width, framebuffer_height, perspective.fovy, perspective.aspect, perspective.z_near, perspective.z_far); } ]| The previous framebuffer can be restored by calling cogl_pop_framebuffer() A #CoglFramebuffer object, either onscreen or offscreen. Stores the current model-view matrix on the matrix stack. The matrix can later be restored with cogl_pop_matrix(). This reads a rectangle of pixels from the current framebuffer where position (0, 0) is the top left. The pixel at (x, y) is the first read, and the data is returned with a rowstride of (width * 4). Currently Cogl assumes that the framebuffer is in a premultiplied format so if @format is non-premultiplied it will convert it. To read the pixel values without any conversion you should either specify a format that doesn't use an alpha channel or use one of the formats ending in PRE. The window x position to start reading from The window y position to start reading from The width of the rectangle you want to read The height of the rectangle you want to read Identifies which auxillary buffer you want to read (only COGL_READ_PIXELS_COLOR_BUFFER supported currently) The pixel format you want the result in (only COGL_PIXEL_FORMAT_RGBA_8888 supported currently) The location to write the pixel data. Fills a rectangle at the given coordinates with the current source material X coordinate of the top-left corner Y coordinate of the top-left corner X coordinate of the bottom-right corner Y coordinate of the bottom-right corner This function draws a rectangle using the current source material to texture or fill with. As a material may contain multiple texture layers this interface lets you supply texture coordinates for each layer of the material. The first pair of coordinates are for the first layer (with the smallest layer index) and if you supply less texture coordinates than there are layers in the current source material then default texture coordinates (0.0, 0.0, 1.0, 1.0) are generated. x coordinate upper left on screen. y coordinate upper left on screen. x coordinate lower right on screen. y coordinate lower right on screen. An array containing groups of 4 float values: [tx1, ty1, tx2, ty2] that are interpreted as two texture coordinates; one for the upper left texel, and one for the lower right texel. Each value should be between 0.0 and 1.0, where the coordinate (0.0, 0.0) represents the top left of the texture, and (1.0, 1.0) the bottom right. The length of the tex_coords array. (e.g. for one layer and one group of texture coordinates, this would be 4) Draw a rectangle using the current material and supply texture coordinates to be used for the first texture layer of the material. To draw the entire texture pass in @tx1=0.0 @ty1=0.0 @tx2=1.0 @ty2=1.0. x coordinate upper left on screen. y coordinate upper left on screen. x coordinate lower right on screen. y coordinate lower right on screen. x part of texture coordinate to use for upper left pixel y part of texture coordinate to use for upper left pixel x part of texture coordinate to use for lower right pixel y part of texture coordinate to use for left pixel Draws a series of rectangles in the same way that cogl_rectangle() does. In some situations it can give a significant performance boost to use this function rather than calling cogl_rectangle() separately for each rectangle. parameters x1, y1, x2, and y2, and have the same meaning as in cogl_rectangle(). an array of vertices number of rectangles to draw Draws a series of rectangles in the same way that cogl_rectangle_with_texture_coords() does. In some situations it can give a significant performance boost to use this function rather than calling cogl_rectangle_with_texture_coords() separately for each rectangle. parameters x1, y1, x2, y2, tx1, ty1, tx2 and ty2 and have the same meaning as in cogl_rectangle_with_texture_coords(). an array of vertices number of rectangles to draw Multiplies the current model-view matrix by one that rotates the model around the vertex specified by @x, @y and @z. The rotation follows the right-hand thumb rule so for example rotating by 10 degrees about the vertex (0, 0, 1) causes a small counter-clockwise rotation. Angle in degrees to rotate. X-component of vertex to rotate around. Y-component of vertex to rotate around. Z-component of vertex to rotate around. Multiplies the current model-view matrix by one that scales the x, y and z axes by the given values. Amount to scale along the x-axis Amount to scale along the y-axis Amount to scale along the z-axis Sets whether textures positioned so that their backface is showing should be hidden. This can be used to efficiently draw two-sided textures or fully closed cubes without enabling depth testing. This only affects calls to the cogl_rectangle* family of functions and cogl_vertex_buffer_draw*. Backface culling is disabled by default. %TRUE to enable backface culling or %FALSE to disable. Sets whether depth testing is enabled. If it is disabled then the order that actors are layered on the screen depends solely on the order specified using clutter_actor_raise() and clutter_actor_lower(), otherwise it will also take into account the actor's depth. Depth testing is disabled by default. instead. %TRUE to enable depth testing or %FALSE to disable. Redirects all subsequent drawing to the specified framebuffer. This can either be an offscreen buffer created with cogl_offscreen_new_to_texture () or you can revert to your original on screen window buffer. the type of CoglHandle given instead. A #CoglBufferTarget that specifies what kind of framebuffer you are setting as the render target. If you are setting a framebuffer of type COGL_OFFSCREEN_BUFFER then this is a CoglHandle for the offscreen buffer. Enables fogging. Fogging causes vertices that are further away from the eye to be rendered with a different color. The color is determined according to the chosen fog mode; at it's simplest the color is linearly interpolated so that vertices at @z_near are drawn fully with their original color and vertices at @z_far are drawn fully with @fog_color. Fogging will remain enabled until you call cogl_disable_fog(). <note>The fogging functions only work correctly when primitives use unmultiplied alpha colors. By default Cogl will premultiply textures and cogl_set_source_color() will premultiply colors, so unless you explicitly load your textures requesting an unmultiplied internal format and use cogl_material_set_color() you can only use fogging with fully opaque primitives. This might improve in the future when we can depend on fragment shaders.</note> The color of the fog A #CoglFogMode that determines the equation used to calculate the fogging blend factor. Used by %COGL_FOG_MODE_EXPONENTIAL and by %COGL_FOG_MODE_EXPONENTIAL_SQUARED equations. Position along Z axis where no fogging should be applied Position along Z axis where full fogging should be applied This redirects all subsequent drawing to the specified framebuffer. This can either be an offscreen buffer created with cogl_offscreen_new_to_texture () or in the future it may be an onscreen framebuffers too. A #CoglFramebuffer object, either onscreen or offscreen. Loads @matrix as the new model-view matrix. the new model-view matrix Replaces the current path with @path. A reference is taken on the object so if you no longer need the path you should unref with cogl_object_unref(). A #CoglPath object Loads matrix as the new projection matrix. the new projection matrix This function sets the source material that will be used to fill subsequent geometry emitted via the cogl API. <note>In the future we may add the ability to set a front facing material, and a back facing material, in which case this function will set both to the same.</note> A #CoglHandle for a material This is a convenience function for creating a solid fill source material from the given color. This color will be used for any subsequent drawing operation. The color will be premultiplied by Cogl, so the color should be semi-transparent red. See also cogl_set_source_color4ub() and cogl_set_source_color4f() if you already have the color components. a #CoglColor This is a convenience function for creating a solid fill source material from the given color using normalized values for each component. This color will be used for any subsequent drawing operation. The value for each component is a fixed point number in the range between 0 and %1.0. If the values passed in are outside that range, they will be clamped. value of the red channel, between 0 and %1.0 value of the green channel, between 0 and %1.0 value of the blue channel, between 0 and %1.0 value of the alpha channel, between 0 and %1.0 This is a convenience function for creating a solid fill source material from the given color using unsigned bytes for each component. This color will be used for any subsequent drawing operation. The value for each component is an unsigned byte in the range between 0 and 255. value of the red channel, between 0 and 255 value of the green channel, between 0 and 255 value of the blue channel, between 0 and 255 value of the alpha channel, between 0 and 255 This is a convenience function for creating a material with the first layer set to #texture_handle and setting that material as the source with cogl_set_source. and cogl_set_source_texture. If you need to blend a texture with a color then you can create a simple material like this: <programlisting> material = cogl_material_new (); cogl_material_set_color4ub (material, 0xff, 0x00, 0x00, 0x80); cogl_material_set_layer (material, 0, tex_handle); cogl_set_source (material); </programlisting> The Cogl texture you want as your source Replaces the current viewport with the given values. X offset of the viewport Y offset of the viewport Width of the viewport Height of the viewport Compiles the shader, no return value, but the shader is now ready for linking into a program. #CoglHandle for a shader. Retrieves the information log for a coglobject, can be used in conjunction with cogl_shader_get_parameteriv() to retrieve the compiler warnings/error messages that caused a shader to not compile correctly, mainly useful for debugging purposes. g_free() to free it a newly allocated string containing the info log. Use #CoglHandle for a shader. Retrieves the type of a shader #CoglHandle or %COGL_SHADER_TYPE_FRAGMENT if the shader is a frament processor %COGL_SHADER_TYPE_VERTEX if the shader is a vertex processor #CoglHandle for a shader. Retrieves whether a shader #CoglHandle has been compiled %TRUE if the shader object has sucessfully be compiled #CoglHandle for a shader. Add an extra reference to a shader. @handle A #CoglHandle to a shader. Replaces the current GLSL source associated with a shader with a new one. #CoglHandle for a shader. GLSL shader source. Removes a reference to a shader. If it was the last reference the shader object will be destroyed. A #CoglHandle to a shader. Very fast fixed point implementation of square root for integers. This function is at least 6x faster than clib sqrt() on x86, and (this is not a typo!) about 500x faster on ARM without FPU. It's error is less than 5% for arguments smaller than %COGL_SQRTI_ARG_5_PERCENT and less than 10% for narguments smaller than %COGL_SQRTI_ARG_10_PERCENT. The maximum argument that can be passed to this function is %COGL_SQRTI_ARG_MAX. integer square root. integer value Copies the pixel data from a cogl texture to system memory. is not valid the size of the texture data in bytes, or 0 if the texture a #CoglHandle for a texture. the #CoglPixelFormat to store the texture as. the rowstride of @data or retrieved from texture if none is specified. memory location to write contents of buffer, or %NULL if we're only querying the data size through the return value. Queries the #CoglPixelFormat of a cogl texture. the #CoglPixelFormat of the GPU side texture a #CoglHandle for a texture. Queries the GL handles for a GPU side texture through its #CoglHandle. If the texture is spliced the data for the first sub texture will be queried. if the handle was invalid %TRUE if the handle was successfully retrieved, %FALSE a #CoglHandle for a texture. pointer to return location for the textures GL handle, or %NULL. pointer to return location for the GL target type, or %NULL. Queries the height of a cogl texture. the height of the GPU side texture in pixels a #CoglHandle for a texture. Queries the maximum wasted (unused) pixels in one dimension of a GPU side texture. the maximum waste a #CoglHandle for a texture. Queries the rowstride of a cogl texture. the offset in bytes between each consequetive row of pixels a #CoglHandle for a texture. Queries the width of a cogl texture. the width of the GPU side texture in pixels a #CoglHandle for a texture. Queries if a texture is sliced (stored as multiple GPU side tecture objects). is stored as a single GPU texture %TRUE if the texture is sliced, %FALSE if the texture a #CoglHandle for a texture. Creates a COGL texture from a CoglBitmap. %COGL_INVALID_HANDLE on failure a #CoglHandle to the newly created texture or A CoglBitmap handle Optional flags for the texture, or %COGL_TEXTURE_NONE the #CoglPixelFormat to use for the GPU storage of the texture Creates a new texture using the buffer specified by @handle. If the buffer has been created using cogl_pixel_buffer_new_for_size() it's possible to omit the height and width values already specified at creation time. failure a #CoglHandle to the new texture or %COGL_INVALID_HANDLE on the #CoglHandle of a pixel buffer width of texture in pixels or 0 height of texture in pixels or 0 optional flags for the texture, or %COGL_TEXTURE_NONE the #CoglPixelFormat the buffer is stored in in RAM the #CoglPixelFormat that will be used for storing the buffer on the GPU. If %COGL_PIXEL_FORMAT_ANY is given then a premultiplied format similar to the format of the source data will be used. The default blending equations of Cogl expect premultiplied color data; the main use of passing a non-premultiplied format here is if you have non-premultiplied source data and are going to adjust the blend mode (see cogl_material_set_blend()) or use the data for something other than straight blending the memory offset in bytes between the starts of scanlines in @data. If 0 is given the row stride will be deduced from offset in bytes in @buffer from where the texture data starts Creates a new COGL texture based on data residing in memory. %COGL_INVALID_HANDLE on failure a #CoglHandle to the newly created texture or width of texture in pixels height of texture in pixels Optional flags for the texture, or %COGL_TEXTURE_NONE the #CoglPixelFormat the buffer is stored in in RAM the #CoglPixelFormat that will be used for storing the buffer on the GPU. If COGL_PIXEL_FORMAT_ANY is given then a premultiplied format similar to the format of the source data will be used. The default blending equations of Cogl expect premultiplied color data; the main use of passing a non-premultiplied format here is if you have non-premultiplied source data and are going to adjust the blend mode (see cogl_material_set_blend()) or use the data for something other than straight blending. the memory offset in bytes between the starts of scanlines in @data pointer the memory region where the source buffer resides Creates a COGL texture from an image file. %COGL_INVALID_HANDLE on failure a #CoglHandle to the newly created texture or the file to load Optional flags for the texture, or %COGL_TEXTURE_NONE the #CoglPixelFormat to use for the GPU storage of the texture. If %COGL_PIXEL_FORMAT_ANY is given then a premultiplied format similar to the format of the source data will be used. The default blending equations of Cogl expect premultiplied color data; the main use of passing a non-premultiplied format here is if you have non-premultiplied source data and are going to adjust the blend mode (see cogl_material_set_blend()) or use the data for something other than straight blending. Creates a COGL texture based on an existing OpenGL texture; the width, height and format are passed along since it is not always possible to query these from OpenGL. The waste arguments allow you to create a Cogl texture that maps to a region smaller than the real OpenGL texture. For instance if your hardware only supports power-of-two textures you may load a non-power-of-two image into a larger power-of-two texture and use the waste arguments to tell Cogl which region should be mapped to the texture coordinate range [0:1]. %COGL_INVALID_HANDLE on failure a #CoglHandle to the newly created texture or opengl handle of foreign texture. opengl target type of foreign texture width of foreign texture height of foreign texture. horizontal waste on the right hand edge of the texture. vertical waste on the bottom edge of the texture. format of the foreign texture. Creates a new texture which represents a subregion of another texture. The GL resources will be shared so that no new texture data is actually allocated. Sub textures have undefined behaviour texture coordinates outside of the range [0,1] are used. They also do not work with CoglVertexBuffers. The sub texture will keep a reference to the full texture so you do not need to keep one separately if you only want to use the sub texture. a #CoglHandle to the new texture. a #CoglHandle to an existing texture X coordinate of the top-left of the subregion Y coordinate of the top-left of the subregion Width in pixels of the subregion Height in pixels of the subregion Creates a new COGL texture with the specified dimensions and pixel format. %COGL_INVALID_HANDLE on failure a #CoglHandle to the newly created texture or width of texture in pixels. height of texture in pixels. Optional flags for the texture, or %COGL_TEXTURE_NONE the #CoglPixelFormat to use for the GPU storage of the texture. Increment the reference count for a cogl texture. the @handle. a @CoglHandle. Sets the pixels in a rectangular subregion of @handle from an in-memory buffer containing pixel data. %FALSE otherwise %TRUE if the subregion upload was successful, and a #CoglHandle. upper left coordinate to use from source data. upper left coordinate to use from source data. upper left destination horizontal coordinate. upper left destination vertical coordinate. width of destination region to write. height of destination region to write. width of source data buffer. height of source data buffer. the #CoglPixelFormat used in the source buffer. rowstride of source buffer (computed from width if none specified) the actual pixel data. Decrement the reference count for a cogl texture. a @CoglHandle. Multiplies the current model-view matrix by the given matrix. the matrix to multiply with the current model-view Multiplies the current model-view matrix by one that translates the model along all three axes according to the given values. Distance to translate along the x-axis Distance to translate along the y-axis Distance to translate along the z-axis Adds an attribute to a buffer. You either can use one of the built-in names such as "gl_Vertex", or "gl_MultiTexCoord0" to add standard attributes, like positions, colors and normals, or you can add custom attributes for use in shaders. The number of vertices declared when calling cogl_vertex_buffer_new() determines how many attribute values will be read from the supplied The data for your attribute isn't copied anywhere until you call cogl_vertex_buffer_submit(), or issue a draw call which automatically submits pending attribute changes. so the supplied pointer must remain valid until then. If you are updating an existing attribute (done by re-adding it) then you still need to re-call cogl_vertex_buffer_submit() to commit the changes to the GPU. Be carefull to minimize the number of calls to cogl_vertex_buffer_submit(), though. <note>If you are interleving attributes it is assumed that each interleaved attribute starts no farther than +- stride bytes from the other attributes it is interleved with. I.e. this is ok: <programlisting> |-0-0-0-0-0-0-0-0-0-0| </programlisting> This is not ok: <programlisting> |- - - - -0-0-0-0-0-0 0 0 0 0| </programlisting> (Though you can have multiple groups of interleved attributes)</note> A vertex buffer handle The name of your attribute. It should be a valid GLSL variable name and standard attribute types must use one of following built-in names: (Note: they correspond to the built-in names of GLSL) <itemizedlist> <listitem>"gl_Color"</listitem> <listitem>"gl_Normal"</listitem> <listitem>"gl_MultiTexCoord0, gl_MultiTexCoord1, ..."</listitem> <listitem>"gl_Vertex"</listitem> </itemizedlist> To support adding multiple variations of the same attribute the name can have a detail component, E.g. "gl_Color::active" or "gl_Color::inactive" The number of components per attribute and must be 1, 2, 3 or 4 a #CoglAttributeType specifying the data type of each component. If %TRUE, this specifies that values stored in an integer format should be mapped into the range [-1.0, 1.0] or [0.0, 1.0] for unsigned values. If %FALSE they are converted to floats directly. This specifies the number of bytes from the start of one attribute value to the start of the next value (for the same attribute). So, for example, with a position interleved with color like this: XYRGBAXYRGBAXYRGBA, then if each letter represents a byte, the stride for both attributes is 6. The special value 0 means the values are stored sequentially in memory. This addresses the first attribute in the vertex array. This must remain valid until you either call cogl_vertex_buffer_submit() or issue a draw call. Deletes an attribute from a buffer. You will need to call cogl_vertex_buffer_submit() or issue a draw call to commit this change to the GPU. A vertex buffer handle The name of a previously added attribute Disables a previosuly added attribute. Since it can be costly to add and remove new attributes to buffers; to make individual buffers more reuseable it is possible to enable and disable attributes before using a buffer for drawing. You don't need to call cogl_vertex_buffer_submit() after using this function. A vertex buffer handle The name of the attribute you want to disable Allows you to draw geometry using all or a subset of the vertices in a vertex buffer. Any un-submitted attribute changes are automatically submitted before drawing. A vertex buffer handle A #CoglVerticesMode specifying how the vertices should be interpreted. Specifies the index of the first vertex you want to draw with Specifies the number of vertices you want to draw. This function lets you use an array of indices to specify the vertices within your vertex buffer that you want to draw. The indices themselves are created by calling cogl_vertex_buffer_indices_new () Any un-submitted attribute changes are automatically submitted before drawing. A vertex buffer handle A #CoglVerticesMode specifying how the vertices should be interpreted. A CoglHandle for a set of indices allocated via cogl_vertex_buffer_indices_new () Specifies the minimum vertex index contained in indices Specifies the maximum vertex index contained in indices An offset into named indices. The offset marks the first index to use for drawing. Specifies the number of vertices you want to draw. Enables a previosuly disabled attribute. Since it can be costly to add and remove new attributes to buffers; to make individual buffers more reuseable it is possible to enable and disable attributes before using a buffer for drawing. You don't need to call cogl_vertex_buffer_submit() after using this function A vertex buffer handle The name of the attribute you want to enable Retrieves the number of vertices that @handle represents the number of vertices A vertex buffer handle Creates a vertex buffer containing the indices needed to draw pairs of triangles from a list of vertices grouped as quads. There will be at least @n_indices entries in the buffer (but there may be more). The indices will follow this pattern: 0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7 ... etc For example, if you submit vertices for a quad like like that shown in <xref linkend="quad-indices-order"/> then you can request 6 indices to render two triangles like those shown in <xref linkend="quad-indices-triangles"/>. <figure id="quad-indices-order"> <title>Example of vertices submitted to form a quad</title> <graphic fileref="quad-indices-order.png" format="PNG"/> </figure> <figure id="quad-indices-triangles"> <title>Illustration of the triangle indices that will be generated</title> <graphic fileref="quad-indices-triangles.png" format="PNG"/> </figure> owned by Cogl and should not be modified or unref'd. A %CoglHandle containing the indices. The handled is the number of indices in the vertex buffer. Queries back the data type used for the given indices The CoglIndicesType used Depending on how much geometry you are submitting it can be worthwhile optimizing the number of redundant vertices you submit. Using an index array allows you to reference vertices multiple times, for example during triangle strips. cogl_vertex_buffer_draw_elements(). A CoglHandle for the indices which you can pass to a #CoglIndicesType specifying the data type used for the indices. Specifies the address of your array of indices The number of indices in indices_array Creates a new vertex buffer that you can use to add attributes. a new #CoglHandle The number of vertices that your attributes will correspond to. Increment the reference count for a vertex buffer the @handle. a @CoglHandle. Submits all the user added attributes to the GPU; once submitted, the attributes can be used for drawing. You should aim to minimize calls to this function since it implies validating your data; it potentially incurs a transport cost (especially if you are using GLX indirect rendering) and potentially a format conversion cost if the GPU doesn't natively support any of the given attribute formats. A vertex buffer handle Decrement the reference count for a vertex buffer a @CoglHandle. Replace the current viewport with the given values. Width of the viewport Height of the viewport