Import line: | Cogl = imports.gi.Cogl; |
GIR File: | Cogl-1.0.gir |
C documentation: | Cogl |
Namespace : | Cogl |
Properties | |
---|---|
gint32 Cogl.AFIRST_BIT : 0
|
|
gint32 Cogl.A_BIT : 0
|
|
gint32 Cogl.BGR_BIT : 0
|
|
gint32 Cogl.FIXED_0_5 : 0
|
|
gint32 Cogl.FIXED_1 : 0
|
|
gint32 Cogl.FIXED_2_PI : 0
|
|
gint32 Cogl.FIXED_BITS : 0
|
|
gint32 Cogl.FIXED_EPSILON : 0
|
|
gint32 Cogl.FIXED_MAX : 0
|
|
gint32 Cogl.FIXED_MIN : 0
|
|
gint32 Cogl.FIXED_PI : 0
|
|
gint32 Cogl.FIXED_PI_2 : 0
|
|
gint32 Cogl.FIXED_PI_4 : 0
|
|
gint32 Cogl.FIXED_Q : 0
|
|
gint32 Cogl.PIXEL_FORMAT_24 : 0
|
|
gint32 Cogl.PIXEL_FORMAT_32 : 0
|
|
gint32 Cogl.PREMULT_BIT : 0
|
|
gint32 Cogl.RADIANS_TO_DEGREES : 0
|
|
gint32 Cogl.SQRTI_ARG_10_PERCENT : 0
|
|
gint32 Cogl.SQRTI_ARG_5_PERCENT : 0
|
|
gint32 Cogl.SQRTI_ARG_MAX : 0
|
|
gint32 Cogl.TEXTURE_MAX_WASTE : 0
|
|
gint32 Cogl.UNORDERED_MASK : 0
|
|
gint32 Cogl.UNPREMULT_MASK : 0
|
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. 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(). to how it was after calling cogl_begin_gl() if you don't do this then the result of further Cogl calls is undefined. 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.
|
Cogl | |
Cogl.bitmap_error_quark
()
:
guint32
|
Cogl | |
Parses an image file enough to extract the width and height
of the bitmap. |
Cogl | |
Cogl.blend_string_error_quark
()
:
guint32
|
Cogl | |
Check whether name occurs in list of extensions in ext.
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: |[ ]|
|
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(). 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
|
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
(gint32 x_offset, gint32 y_offset, gint32 width, gint32 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(). 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
|
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(). 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
|
Cogl | |
Compares two CoglColors and checks if they are the same.
Compares two CoglColors 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 CoglColors as keys in a GHashTable.
|
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.draw_attributes_array
(VerticesMode mode, gint32 first_vertex, gint32 n_vertices, Attribute attributes)
:
none
|
Cogl | |
Cogl.draw_indexed_attributes_array
(VerticesMode mode, gint32 first_vertex, gint32 n_vertices, Indices indices, Attribute attributes)
:
none
|
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 | |
Cogl | ||
Computes the arc tangent of a / b but uses the sign of both
arguments to return the angle in right quadrant.
Computes the arc tangent of a / b but uses the sign of both
arguments to return the angle in right quadrant. notation
|
Cogl | |
Cogl | ||
Cogl | ||
Cogl.fixed_get_type
()
:
Number
|
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
(gfloat left, gfloat right, gfloat bottom, gfloat top, gfloat z_near, gfloat 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
()
:
gboolean
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
|
Cogl | |
Cogl.get_depth_test_enabled
()
:
gboolean
Queries if depth testing has been enabled via cogl_set_depth_test_enable()
instead.
Queries if depth testing has been enabled via cogl_set_depth_test_enable()
instead.
|
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_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.handle_get_type
()
:
Number
|
Cogl | |
|
Cogl | |
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Determines whether the given CoglHandle references an offscreen buffer
object. |
Cogl | |
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
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 | |
Compares two matrices to see if they represent the same
transformation.
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.
|
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. if it wasn't possible to create the buffer.
|
Cogl | |
Replaces the current projection matrix with an orthographic projection
matrix.
Replaces the current projection matrix with an orthographic projection
matrix. See calculated. 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.
|
Cogl | |
Cogl.path_arc
(gfloat center_x, gfloat center_y, gfloat radius_x, gfloat radius_y, gfloat angle_1, gfloat 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 | |
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 | |
Constructs an ellipse shape.
Constructs an ellipse shape. If there is an existing path this will
start a new disjoint sub-path.
|
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 fill rule of the path. See CoglPathFillRule for details.
|
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_fill_rule
()
:
Cogl.PathFillRule
|
Cogl | |
Constructs a straight line shape starting and ending at the given
coordinates.
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.
|
Cogl | |
Adds a straight line segment to the current path that ends at the
given coordinates. |
Cogl | |
Moves the pen to the given location.
|
Cogl | |
Cogl.path_new
()
:
none
Clears the current path and starts a new one.
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.
|
Cogl | |
Constructs a polygonal shape of the given number of vertices.
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 | |
Constructs a series of straight line segments, starting from the
first given vertex coordinate.
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.
Constructs a rectangular shape at the given coordinates. If there
is an existing path this will start a new disjoint sub-path.
|
Cogl | |
Cogl.path_rel_curve_to
(gfloat x_1, gfloat y_1, gfloat x_2, gfloat y_2, gfloat x_3, gfloat 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.
Adds a straight line segment to the current path that ends at the
given coordinates relative to the current pen location.
|
Cogl | |
Moves the pen to the given offset relative to the current pen
location.
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.
|
Cogl | |
Cogl.path_round_rectangle
(gfloat x_1, gfloat y_1, gfloat x_2, gfloat y_2, gfloat radius, gfloat arc_step)
:
none
Constructs a rectangular shape with rounded corners.
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_fill_rule
(PathFillRule fill_rule)
:
none
Sets the fill rule of the current path to fill_rule.
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.
|
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.
Replaces the current projection matrix with a perspective matrix
based on the provided values.
|
Cogl | |
Cogl | ||
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 | |
Cogl.pop_source
()
:
none
|
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. This uniform can be set using cogl_program_uniform_1f() when the program is in use.
|
Cogl | |
Cogl.program_link
(void* handle)
:
none
Links a program making it ready for use.
Links a program making it ready for use.
|
Cogl | |
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
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
(gint32 uniform_no, gint32 size, gint32 count, gboolean 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
(Framebuffer 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: 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 (&projection_matrix); z_camera = 0.5 * projection_matrix.xx; cogl_matrix_init_identity (&mv_matrix); cogl_matrix_translate (&mv_matrix, -0.5f, -0.5f, -z_camera); cogl_matrix_scale (&mv_matrix, 1.0f / width, -1.0f / height, 1.0f / width); cogl_matrix_translate (&mv_matrix, 0.0f, -1.0 * height, 0.0f); cogl_set_modelview_matrix (&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()
|
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.push_source
(void* material)
:
none
|
Cogl | |
Cogl.read_pixels
(gint32 x, gint32 y, gint32 width, gint32 height, ReadPixelsFlags source, PixelFormat format, guint8 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
Fills a rectangle at the given coordinates with the current source material
|
Cogl | |
Cogl.rectangle_with_multitexture_coords
(gfloat x1, gfloat y1, gfloat x2, gfloat y2, Array tex_coords, gint32 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
(gfloat x1, gfloat y1, gfloat x2, gfloat y2, gfloat tx1, gfloat ty1, gfloat tx2, gfloat 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.
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
(gboolean 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
(gboolean 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. instead.
|
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. the type of CoglHandle given instead.
|
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(). 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.
|
Cogl | |
Cogl.set_framebuffer
(Framebuffer 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. and a back facing material, in which case this function will set both to the same.
|
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: 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);
|
Cogl | |
Replaces the current viewport with the given values.
|
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. g_free() to free it
|
Cogl | |
Retrieves the type of a shader CoglHandle
or COGL_SHADER_TYPE_FRAGMENT if the shader is a frament processor
Retrieves the type of a shader CoglHandle
or COGL_SHADER_TYPE_FRAGMENT if the shader is a frament processor
|
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 | |
Copies the pixel data from a cogl texture to system memory.
Copies the pixel data from a cogl texture to system memory.
is not valid
|
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.
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
|
Cogl | |
Cogl | ||
Cogl | ||
Cogl | ||
Cogl | ||
Queries if a texture is sliced (stored as multiple GPU side tecture
objects). |
Cogl | |
Cogl.texture_set_region
(void* handle, gint32 src_x, gint32 src_y, gint32 dst_x, gint32 dst_y, guint32 dst_width, guint32 dst_height, gint32 width, gint32 height, PixelFormat format, guint32 rowstride, guint8 data)
:
gboolean
Sets the pixels in a rectangular subregion of handle from an in-memory
buffer containing pixel data.
Sets the pixels in a rectangular subregion of handle from an in-memory
buffer containing pixel data. FALSE otherwise
|
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.
Multiplies the current model-view matrix by one that translates the
model along all three axes according to the given values.
|
Cogl | |
Cogl | ||
Cogl.vertex_buffer_add
(void* handle, String attribute_name, guint8 n_components, AttributeType type, gboolean normalized, guint16 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. attribute starts no farther than +- stride bytes from the other attributes it is interleved with. I.e. this is ok: |-0-0-0-0-0-0-0-0-0-0| This is not ok: |- - - - -0-0-0-0-0-0 0 0 0 0| (Though you can have multiple groups of interleved attributes)
|
Cogl | |
Deletes an attribute from a buffer.
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.
|
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, gint32 min_index, gint32 max_index, gint32 indices_offset, gint32 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 | ||
Queries back the data type used for the given indices
Queries back the data type used for the given indices
|
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 |