Import line: | Cogl = imports.gi.Cogl; |
GIR File: | Cogl-1.0.gir |
C documentation: | Cogl |
Namespace : | Cogl |
Show / Hide Inherited methods, properties and signals |
Properties | |
---|---|
Number Cogl.AFIRST_BIT : 64
|
|
Number Cogl.A_BIT : 16
|
|
Number Cogl.BGR_BIT : 32
|
|
Number Cogl.CLUTTER_COGL_HAS_GL : 1
|
|
Number Cogl.FIXED_0_5 : 32768
|
|
Number Cogl.FIXED_1 : 1
|
|
Number Cogl.FIXED_2_PI : 411775
|
|
Number Cogl.FIXED_BITS : 32
|
|
Number Cogl.FIXED_EPSILON : 1
|
|
Number Cogl.FIXED_MAX : 2147483647
|
|
Number Cogl.FIXED_MIN : 2147483647
|
|
Number Cogl.FIXED_PI : 205887
|
|
Number Cogl.FIXED_PI_2 : 102944
|
|
Number Cogl.FIXED_PI_4 : 51472
|
|
Number Cogl.FIXED_Q : -16
|
|
Number Cogl.HAS_GL : 1
|
|
Number Cogl.PIXEL_FORMAT_24 : 2
|
|
Number Cogl.PIXEL_FORMAT_32 : 3
|
|
Number Cogl.PREMULT_BIT : 128
|
|
Number Cogl.RADIANS_TO_DEGREES : 3754936
|
|
Number Cogl.SQRTI_ARG_10_PERCENT : 5590
|
|
Number Cogl.SQRTI_ARG_5_PERCENT : 210
|
|
Number Cogl.SQRTI_ARG_MAX : 4194303
|
|
Number Cogl.TEXTURE_MAX_WASTE : 127
|
|
Number Cogl.UNORDERED_MASK : 15
|
|
Number Cogl.UNPREMULT_MASK : 127
|
None |
Method / Constructor | Defined By | |
---|---|---|
Cogl | ||
Cogl | ||
Cogl | ||
Cogl.begin_gl
()
:
none
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.
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.
|
Cogl | |
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Retrieves the update hints set using cogl_buffer_set_update_hint()
Retrieves the update hints set using cogl_buffer_set_update_hint()
|
Cogl | |
|
Cogl | |
Retrieves the usage hint set using cogl_buffer_set_usage_hint()
Retrieves the usage hint set using cogl_buffer_set_usage_hint()
|
Cogl | |
|
Cogl | |
Maps the buffer into the application address space for direct access.
Maps the buffer into the application address space for direct access.
|
Cogl | |
|
Cogl | |
Updates part of the buffer with new data from data.
Updates part of the buffer with new data from data. Where to put this new data is controlled by offset and offset + data should be less than the buffer size.
|
Cogl | |
Cogl | ||
Sets the update hint on a buffer.
Sets the update hint on a buffer. See CoglBufferUpdateHint for a description of the available hints.
|
Cogl | |
|
Cogl | |
Sets the usage hint on a buffer.
Sets the usage hint on a buffer. See CoglBufferUsageHint for a description of the available hints.
|
Cogl | |
|
Cogl | |
Cogl.buffer_unmap
(void* handle)
:
none
Unmaps a buffer previously mapped by cogl_buffer_map().
Unmaps a buffer previously mapped by cogl_buffer_map().
|
Cogl | |
Cogl.buffer_unmap_EXP
(void* handle)
:
none
|
Cogl | |
Cogl | ||
Clears all the auxiliary buffers identified in the buffers mask, and if that includes the color buffer then the specified color is used.
Clears all the auxiliary buffers identified in the buffers mask, and if that includes the color buffer then the specified color is used.
|
Cogl | |
Cogl.clip_ensure
()
:
none
Ensures that the current clipping region has been set in GL.
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.
|
Cogl | |
Cogl.clip_pop
()
:
none
Reverts the clipping region to the state before the last call to cogl_clip_push().
Reverts the clipping region to the state before the last call to cogl_clip_push().
|
Cogl | |
Specifies a rectangular clipping area for all subsequent drawing operations.
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().
|
Cogl | |
Cogl.clip_push_from_path
()
:
none
Sets a new clipping area using the current path.
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().
|
Cogl | |
Cogl.clip_push_from_path_preserve
()
:
none
Sets a new clipping area using the current path.
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().
|
Cogl | |
Specifies a rectangular clipping area for all subsequent drawing operations.
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().
|
Cogl | |
Specifies a rectangular clipping area for all subsequent drawing operations.
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().
|
Cogl | |
Cogl.clip_push_window_rectangle
(Number x_offset, Number y_offset, Number width, Number height)
:
none
Specifies a rectangular clipping area for all subsequent drawing operations.
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().
|
Cogl | |
Cogl.clip_stack_restore
()
:
none
Restore the state of the clipping stack that was previously saved by cogl_clip_stack_save().
Restore the state of the clipping stack that was previously saved by cogl_clip_stack_save().
|
Cogl | |
Cogl.clip_stack_save
()
:
none
Save the entire state of the clipping stack and then clear all clipping.
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().
|
Cogl | |
Compares two CoglColors and checks if they are the same.
|
Cogl | |
Cogl.create_program
()
:
void*
Create a new cogl program object that can be used to replace parts of the GL rendering pipeline with custom code.
Create a new cogl program object that can be used to replace parts of the GL rendering pipeline with custom code.
|
Cogl | |
Create a new shader handle, use cogl_shader_source to set the source code to be used on it.
Create a new shader handle, use cogl_shader_source to set the source code to be used on it.
|
Cogl | |
Cogl.disable_fog
()
:
none
This function disables fogging, so primitives drawn afterwards will not be blended with any previously set fog color.
This function disables fogging, so primitives drawn afterwards will not be blended with any previously set fog color.
|
Cogl | |
Cogl | ||
Cogl | ||
Cogl | ||
Cogl.end_gl
()
:
none
This is the counterpart to cogl_begin_gl() used to delimit blocks of drawing code using raw OpenGL.
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.
|
Cogl | |
Checks whether the given COGL features are available.
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.
|
Cogl | |
Computes the arc tangent of a / b but uses the sign of both arguments to return the angle in right quadrant.
|
Cogl | |
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl.flush
()
:
none
This function should only need to be called in exceptional circumstances.
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.
|
Cogl | |
Cogl.frustum
(Number left, Number right, Number bottom, Number top, Number z_near, Number z_far)
:
none
Replaces the current projection matrix with a perspective matrix for the given viewing frustum.
Replaces the current projection matrix with a perspective matrix for the given viewing frustum.
|
Cogl | |
Cogl.get_backface_culling_enabled
()
:
Boolean
Queries if backface culling has been enabled via cogl_set_backface_culling_enabled()
Queries if backface culling has been enabled via cogl_set_backface_culling_enabled()
|
Cogl | |
Cogl.get_bitmasks
()
:
Object
Gets the number of bitplanes used for each of the color components in the color buffer.
|
Cogl | |
Cogl.get_depth_test_enabled
()
:
Boolean
Queries if depth testing has been enabled via cogl_set_depth_test_enable()
Queries if depth testing has been enabled via cogl_set_depth_test_enable()
|
Cogl | |
Cogl.get_features
()
:
Cogl.FeatureFlags
Returns all of the features supported by COGL.
Returns all of the features supported by COGL.
|
Cogl | |
Cogl.get_modelview_matrix
()
:
Cogl.Matrix
Stores the current model-view matrix in matrix.
Stores the current model-view matrix in matrix.
|
Cogl | |
Cogl.get_option_group
()
:
GLib.OptionGroup
Retrieves the GOptionGroup used by COGL to parse the command line options.
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.
|
Cogl | |
Gets a pointer to a given GL or GL ES extension function.
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.
|
Cogl | |
Cogl.get_projection_matrix
()
:
Cogl.Matrix
Stores the current projection matrix in matrix.
Stores the current projection matrix in matrix.
|
Cogl | |
Cogl.get_viewport
()
:
Array
Stores the current viewport in v.
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.
|
Cogl | |
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Creates a new material handle with the configuration copied from the source material.
Creates a new material handle 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.
|
Cogl | |
Retrieves the current ambient color for material
Retrieves the current ambient color for material
|
Cogl | |
Retrieves the current material color.
Retrieves the current material color.
|
Cogl | |
Retrieves the current diffuse color for material
Retrieves the current diffuse color for material
|
Cogl | |
Retrieves the materials current emission color.
Retrieves the materials current emission color.
|
Cogl | |
This function lets you access a materials internal list of layers for iteration.
|
Cogl | |
Cogl | ||
Cogl | ||
Retrieves the materials current specular color.
Retrieves the materials current specular color.
|
Cogl | |
Queries the currently set downscaling filter for a material later
Queries the currently set downscaling filter for a material later
|
Cogl | |
Queries the currently set downscaling filter for a material layer
Queries the currently set downscaling filter for a material layer
|
Cogl | |
Extracts a texture handle for a specific layer.
Extracts a texture handle for a specific layer.
|
Cogl | |
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.
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.
|
Cogl | |
Gets the wrap mode for the 's' coordinate of texture lookups on this layer.
Gets the wrap mode for the 's' coordinate of texture lookups on this layer.
|
Cogl | |
Gets the wrap mode for the 't' coordinate of texture lookups on this layer.
Gets the wrap mode for the 't' coordinate of texture lookups on this layer.
|
Cogl | |
Cogl.material_new
()
:
void*
Allocates and initializes a blank white material
Allocates and initializes a blank white material
|
Cogl | |
Cogl | ||
Cogl.material_set_alpha_test_function
(void* material, MaterialAlphaFunc alpha_func, Number alpha_reference)
:
none
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.
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
|
Cogl | |
Sets the material's ambient color, in the standard OpenGL lighting model.
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)
|
Cogl | |
Conveniently sets the diffuse and ambient color of material at the same time.
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)
|
Cogl | |
If not already familiar; please refer here for an overview of what blend strings are, and their syntax.
If not already familiar; please refer here for an overview of what blend strings are, and their syntax. Blending occurs after the alpha test function, and combines fragments with the framebuffer. Currently the only blend function Cogl exposes is ADD(). So any valid blend statements will be of the form: |[ <channel-mask>=ADD(SRC_COLOR*(<factor>), DST_COLOR*(<factor>)) ]|
|
Cogl | |
When blending is setup to reference a CONSTANT blend factor then blending will depend on the constant set with this function.
When blending is setup to reference a CONSTANT blend factor then blending will depend on the constant set with this function.
|
Cogl | |
Sets the basic color of the material, used when no lighting is enabled.
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)
|
Cogl | |
Cogl.material_set_color4f
(void* material, Number red, Number green, Number blue, Number alpha)
:
none
Sets the basic color of the material, used when no lighting is enabled.
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)
|
Cogl | |
Cogl.material_set_color4ub
(void* material, Number red, Number green, Number blue, Number alpha)
:
none
Sets the basic color of the material, used when no lighting is enabled.
Sets the basic color of the material, used when no lighting is enabled. The default value is (0xff, 0xff, 0xff, 0xff)
|
Cogl | |
Sets the material's diffuse color, in the standard OpenGL lighting model.
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)
|
Cogl | |
Sets the material's emissive color, in the standard OpenGL lighting model.
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)
|
Cogl | |
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.
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.
|
Cogl | |
If not already familiar; you can refer here for an overview of what blend strings are and there syntax.
If not already familiar; you can refer here for an overview of what blend strings are and there syntax. These are all the functions available for texture combining:
|
Cogl | |
Cogl.material_set_layer_combine_constant
(void* material, Number layer_index, Color constant)
:
none
When you are using the 'CONSTANT' color source in a layer combine description then you can use this function to define its value.
When you are using the 'CONSTANT' color source in a layer combine description then you can use this function to define its value.
|
Cogl | |
Cogl.material_set_layer_filters
(void* material, Number layer_index, MaterialFilter min_filter, MaterialFilter mag_filter)
:
none
Changes the decimation and interpolation filters used when a texture is drawn at other scales than 100%.
Changes the decimation and interpolation filters used when a texture is drawn at other scales than 100%.
|
Cogl | |
This function lets you set a matrix that can be used to e.g.
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.
|
Cogl | |
Cogl.material_set_layer_wrap_mode
(void* material, Number layer_index, MaterialWrapMode mode)
:
none
Sets the wrap mode for both coordinates of texture lookups on this layer.
Sets the wrap mode for both coordinates of texture lookups on this layer. This is equivalent to calling cogl_material_set_layer_wrap_mode_s() and cogl_material_set_layer_wrap_mode_t() separately.
|
Cogl | |
Cogl.material_set_layer_wrap_mode_s
(void* material, Number layer_index, MaterialWrapMode mode)
:
none
Sets the wrap mode for the 's' coordinate of texture lookups on this layer.
Sets the wrap mode for the 's' coordinate of texture lookups on this layer.
|
Cogl | |
Cogl.material_set_layer_wrap_mode_t
(void* material, Number layer_index, MaterialWrapMode mode)
:
none
Sets the wrap mode for the 't' coordinate of texture lookups on this layer.
Sets the wrap mode for the 't' coordinate of texture lookups on this layer.
|
Cogl | |
Sets the materials shininess, in the standard OpenGL lighting model, which determines how specular highlights are calculated.
|
Cogl | |
Sets the material's specular color, in the standard OpenGL lighting model.
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)
|
Cogl | |
This creates an offscreen buffer object using the given texture as the primary color buffer.
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.
|
Cogl | |
Replaces the current projection matrix with a parallel projection matrix.
Replaces the current projection matrix with a parallel projection matrix.
|
Cogl | |
Cogl.path_arc
(Number center_x, Number center_y, Number radius_x, Number radius_y, Number angle_1, Number angle_2)
:
none
Adds an elliptical arc segment to the current path.
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).
|
Cogl | |
Cogl.path_close
()
:
none
Closes the path being constructed by adding a straight line segment to it that ends at the first vertex of the path.
Closes the path being constructed by adding a straight line segment to it that ends at the first vertex of the path.
|
Cogl | |
Returns a new copy of the path in handle.
Returns a new copy of the path in handle. The new path has a reference count of 1 so you should unref it with cogl_handle_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.
|
Cogl | |
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.
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.
|
Cogl | |
Cogl | ||
Cogl.path_fill
()
:
none
Fills the interior of the constructed shape using the current drawing color.
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 'even-odd' rule. Any open sub-paths are treated as if there is an extra line joining the last point and first point. You can work out whether any point in the stage will be filled if you imagine drawing an infinitely long line in any direction from that point and then counting the number times it crosses a line in the path. If the number is odd it will be filled, otherwise it will not. See
|
Cogl | |
Cogl.path_fill_preserve
()
:
none
Fills the interior of the constructed shape using the current drawing color and preserves the path to be used again.
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.
|
Cogl | |
Cogl.path_get
()
:
void*
Gets a handle to the current path.
Gets a handle 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 handle too. No reference is taken on the path so if you want to retain it you should take your own reference with cogl_handle_ref().
|
Cogl | |
Constructs a straight line shape starting and ending at the given coordinates.
|
Cogl | |
Cogl | ||
Cogl | ||
Cogl.path_new
()
:
none
Clears the current path and starts a new one.
Clears the current path and starts a new one.
|
Cogl | |
an array of fixed-point values that specify the vertex coordinates.
an array of fixed-point values that specify the vertex coordinates. 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.
|
Cogl | |
array of fixed-point values that specify the vertex coordinates.
array of fixed-point values that specify the vertex coordinates. 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.
|
Cogl | |
Constructs a rectangular shape at the given coordinates.
|
Cogl | |
Cogl.path_rel_curve_to
(Number x_1, Number y_1, Number x_2, Number y_2, Number x_3, Number y_3)
:
none
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.
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.
|
Cogl | |
Adds a straight line segment to the current path that ends at the given coordinates relative to the current pen location.
|
Cogl | |
Cogl | ||
Cogl.path_round_rectangle
(Number x_1, Number y_1, Number x_2, Number y_2, Number radius, Number arc_step)
:
none
the corner arcs.
the corner arcs. Constructs a rectangular shape with rounded corners. If there is an existing path this will start a new disjoint sub-path.
|
Cogl | |
Cogl.path_set
(void* handle)
:
none
Replaces the current path with handle.
Replaces the current path with handle. A reference is taken on the handle so if you no longer need the path you should unref with cogl_handle_unref().
|
Cogl | |
Cogl.path_stroke
()
:
none
Strokes the constructed shape using the current drawing color and a width of 1 pixel (regardless of the current transformation matrix).
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.
|
Cogl | |
Cogl.path_stroke_preserve
()
:
none
Strokes the constructed shape using the current drawing color and preserves the path to be used again.
Strokes the constructed shape using the current drawing color and preserves the path to be used again.
|
Cogl | |
Replaces the current projection matrix with a perspective matrix based on the provided values.
|
Cogl | |
Cogl | ||
Cogl | ||
Cogl.pixel_buffer_new_for_size
(Number width, Number height, PixelFormat format, Object out_values)
:
void*
Creates a new buffer to store pixel data.
Creates a new buffer to store pixel data.
|
Cogl | |
Cogl.pixel_buffer_new_for_size_EXP
(Number width, Number height, PixelFormat format, Object out_values)
:
void*
|
Cogl | |
Draws a convex polygon using the current source material to fill / texture with according to the texture coordinates passed.
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.
|
Cogl | |
Cogl.pop_draw_buffer
()
:
none
Restore cogl_set_draw_buffer() state.
Restore cogl_set_draw_buffer() state.
|
Cogl | |
Cogl.pop_framebuffer
()
:
none
Restores the framebuffer that was previously at the top of the stack.
Restores the framebuffer that was previously at the top of the stack. All subsequent drawing will be redirected to this framebuffer.
|
Cogl | |
Cogl.pop_matrix
()
:
none
Restores the current model-view matrix from the matrix stack.
Restores the current model-view matrix from the matrix stack.
|
Cogl | |
Attaches a shader to a program object, a program can have one vertex shader and one fragment shader attached.
|
Cogl | |
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.
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.
|
Cogl | |
Cogl.program_link
(void* handle)
:
none
Links a program making it ready for use.
Links a program making it ready for use.
|
Cogl | |
Changes the value of a floating point uniform in the currently used (see cogl_program_use()) shader program.
|
Cogl | |
Changes the value of an integer uniform in the currently used (see cogl_program_use()) shader program.
|
Cogl | |
Changes the value of a float vector uniform, or uniform array in the currently used (see cogl_program_use()) shader program.
Changes the value of a float vector uniform, or uniform array in the currently used (see cogl_program_use()) shader program.
|
Cogl | |
Changes the value of a int vector uniform, or uniform array in the currently used (see cogl_program_use()) shader program.
Changes the value of a int vector uniform, or uniform array in the currently used (see cogl_program_use()) shader program.
|
Cogl | |
Cogl.program_uniform_matrix
(Number uniform_no, Number size, Number count, Boolean transpose, Array value)
:
none
Changes the value of a matrix uniform, or uniform array in the currently used (see cogl_program_use()) shader program.
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.
|
Cogl | |
Cogl.program_use
(void* handle)
:
none
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.
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.
|
Cogl | |
Cogl.push_draw_buffer
()
:
none
Save cogl_set_draw_buffer() state.
Save cogl_set_draw_buffer() state.
|
Cogl | |
Cogl.push_framebuffer
(void* buffer)
:
none
Redirects all subsequent drawing to the specified framebuffer.
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:
|
Cogl | |
Cogl.push_matrix
()
:
none
Stores the current model-view matrix on the matrix stack.
Stores the current model-view matrix on the matrix stack. The matrix can later be restored with cogl_pop_matrix().
|
Cogl | |
Cogl.read_pixels
(Number x, Number y, Number width, Number height, ReadPixelsFlags source, PixelFormat format, String pixels)
:
none
This reads a rectangle of pixels from the current framebuffer where position (0, 0) is the top left.
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.
|
Cogl | |
Fills a rectangle at the given coordinates with the current source material
|
Cogl | |
Cogl.rectangle_with_multitexture_coords
(Number x1, Number y1, Number x2, Number y2, Array tex_coords, Number tex_coords_len)
:
none
This function draws a rectangle using the current source material to texture or fill with.
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.
|
Cogl | |
Cogl.rectangle_with_texture_coords
(Number x1, Number y1, Number x2, Number y2, Number tx1, Number ty1, Number tx2, Number ty2)
:
none
Draw a rectangle using the current material and supply texture coordinates to be used for the first texture layer of the material.
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.
|
Cogl | |
Draws a series of rectangles in the same way that cogl_rectangle() does.
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().
|
Cogl | |
Draws a series of rectangles in the same way that cogl_rectangle_with_texture_coords() does.
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().
|
Cogl | |
Multiplies the current model-view matrix by one that rotates the model around the vertex specified by x, y and z.
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.
|
Cogl | |
Multiplies the current model-view matrix by one that scales the x, y and z axes by the given values.
|
Cogl | |
Cogl.set_backface_culling_enabled
(Boolean setting)
:
none
Sets whether textures positioned so that their backface is showing should be hidden.
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.
|
Cogl | |
Cogl.set_depth_test_enabled
(Boolean setting)
:
none
Sets whether depth testing is enabled.
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.
|
Cogl | |
Redirects all subsequent drawing to the specified framebuffer.
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.
|
Cogl | |
Enables fogging.
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().
|
Cogl | |
Cogl.set_framebuffer
(void* buffer)
:
none
This redirects all subsequent drawing to the specified framebuffer.
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.
|
Cogl | |
Cogl.set_modelview_matrix
(Matrix matrix)
:
none
Loads matrix as the new model-view matrix.
Loads matrix as the new model-view matrix.
|
Cogl | |
Cogl.set_projection_matrix
(Matrix matrix)
:
none
Loads matrix as the new projection matrix.
Loads matrix as the new projection matrix.
|
Cogl | |
Cogl.set_source
(void* material)
:
none
This function sets the source material that will be used to fill subsequent geometry emitted via the cogl API.
This function sets the source material that will be used to fill subsequent geometry emitted via the cogl API.
|
Cogl | |
Cogl.set_source_color
(Color color)
:
none
This is a convenience function for creating a solid fill source material from the given color.
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.
|
Cogl | |
This is a convenience function for creating a solid fill source material from the given color using normalized values for each component.
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.
|
Cogl | |
This is a convenience function for creating a solid fill source material from the given color using unsigned bytes for each component.
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.
|
Cogl | |
Cogl.set_source_texture
(void* texture_handle)
:
none
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.
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:
|
Cogl | |
Cogl | ||
Cogl.shader_compile
(void* handle)
:
none
Compiles the shader, no return value, but the shader is now ready for linking into a program.
Compiles the shader, no return value, but the shader is now ready for linking into a program.
|
Cogl | |
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.
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.
|
Cogl | |
Retrieves the type of a shader CoglHandle
Retrieves the type of a shader CoglHandle
|
Cogl | |
Cogl | ||
Cogl | ||
Very fast fixed point implementation of square root for integers.
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.
|
Cogl | |
specified.
specified. only querying the data size through the return value. Copies the pixel data from a cogl texture to system memory.
|
Cogl | |
Queries the CoglPixelFormat of a cogl texture.
Queries the CoglPixelFormat of a cogl texture.
|
Cogl | |
Queries the GL handles for a GPU side texture through its CoglHandle.
|
Cogl | |
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl.texture_new_from_bitmap
(void* bmp_handle, TextureFlags flags, PixelFormat internal_format)
:
void*
texture Creates a COGL texture from a CoglBitmap.
texture Creates a COGL texture from a CoglBitmap.
|
Cogl | |
Cogl.texture_new_from_data
(Number width, Number height, TextureFlags flags, PixelFormat format, PixelFormat internal_format, Number rowstride, String data)
:
void*
Creates a new COGL texture based on data residing in memory.
Creates a new COGL texture based on data residing in memory.
|
Cogl | |
Cogl.texture_new_from_file
(String filename, TextureFlags flags, PixelFormat internal_format)
:
void*
Creates a COGL texture from an image file.
Creates a COGL texture from an image file.
|
Cogl | |
Cogl.texture_new_from_foreign
(uint gl_handle, enum gl_target, uint width, uint height, uint x_pot_waste, uint y_pot_waste, PixelFormat format)
:
void*
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.
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 | |
Cogl.texture_new_from_sub_texture
(void* full_texture, Number sub_x, Number sub_y, Number sub_width, Number sub_height)
:
void*
Creates a new texture which represents a subregion of another 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.
|
Cogl | |
Cogl.texture_new_with_size
(Number width, Number height, TextureFlags flags, PixelFormat internal_format)
:
void*
Creates a new COGL texture with the specified dimensions and pixel format.
Creates a new COGL texture with the specified dimensions and pixel format.
|
Cogl | |
Cogl.texture_set_region
(void* handle, Number src_x, Number src_y, Number dst_x, Number dst_y, Number dst_width, Number dst_height, Number width, Number height, PixelFormat format, Number rowstride, String data)
:
Boolean
specified) Sets the pixels in a rectangular subregion of handle from an in-memory buffer containing pixel data.
specified) Sets the pixels in a rectangular subregion of handle from an in-memory buffer containing pixel data.
|
Cogl | |
Cogl.transform
(Matrix matrix)
:
none
Multiplies the current model-view matrix by the given matrix.
Multiplies the current model-view matrix by the given matrix.
|
Cogl | |
Multiplies the current model-view matrix by one that translates the model along all three axes according to the given values.
|
Cogl | |
Cogl.vertex_buffer_add
(void* handle, String attribute_name, Number n_components, AttributeType type, Boolean normalized, Number stride, void* pointer)
:
none
Adds an attribute to a buffer.
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.
|
Cogl | |
Cogl | ||
Disables a previosuly 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.
|
Cogl | |
Allows you to draw geometry using all or a subset of the vertices in a vertex buffer.
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.
|
Cogl | |
Cogl.vertex_buffer_draw_elements
(void* handle, VerticesMode mode, void* indices, Number min_index, Number max_index, Number indices_offset, Number count)
:
none
This function lets you use an array of indices to specify the vertices within your vertex buffer that 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.
|
Cogl | |
Enables a previosuly disabled attribute.
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
|
Cogl | |
Cogl | ||
Creates a vertex buffer containing the indices needed to draw pairs of triangles from a list of vertices grouped as quads.
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 this: |[ 0 3 ######## # # # # ######## 1 2 ]| Then you can request 6 indices to render two triangles like this: |[ 0 0 3 ## ######## # ## ## # # ## ## # ######## ## 1 2 2 ]| owned by Cogl and should not be modified or unref'd.
|
Cogl | |
Queries back the data type used for the given indices
Queries back the data type used for the given indices
|
Cogl | |
Cogl.vertex_buffer_indices_new
(IndicesType indices_type, Array indices_array, Number indices_len)
:
void*
Depending on how much geometry you are submitting it can be worthwhile optimizing the number of redundant vertices you submit.
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 | |
Cogl | ||
Cogl.vertex_buffer_submit
(void* handle)
:
none
Submits all the user added attributes to the GPU; once submitted, the attributes can be used for drawing.
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.
|
Cogl | |
Cogl |
None |