Functions
The following functions are available globally.
-
Computes the cosine of
angle
Declaration
Swift
@inlinable public func angleCos(angle: CoglAngle) -> CoglFixed
-
Computes the sine of
angle
Declaration
Swift
@inlinable public func angleSin(angle: CoglAngle) -> CoglFixed
-
Computes the tangent of
angle
Declaration
Swift
@inlinable public func angleTan(angle: CoglAngle) -> CoglFixed
-
We do not advise nor reliably support the interleaving of raw GL drawing and Cogl drawing functions, but if you insist,
cogl_begin_gl()
andcogl_end_gl()
provide a simple mechanism that may at least give you a fighting chance of succeeding.Note: this doesn’t help you modify the behaviour of Cogl drawing functions 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()
andcogl_end_gl()
:{ cogl_begin_gl (); - setup some OpenGL state. - draw using OpenGL (e.g. glDrawArrays() ) - reset modified OpenGL state. cogl_end_gl (); - continue using Cogl to draw }
Don’t ever try and do:
{ - setup some OpenGL state. - use Cogl to draw - reset modified OpenGL state. }
When the internals of Cogl evolves, this is very liable to break.
This function will flush all batched primitives, and subsequently flush all internal Cogl state to OpenGL as if it were going to draw something itself.
The result is that the OpenGL modelview matrix will be setup; the state corresponding to the current source material will be set up and other world state such as backface culling, depth and fogging enabledness will be sent to OpenGL.
<note>No special material state is flushed, so if you want Cogl to setup a simplified material state it is your responsibility to set a simple source material before calling
cogl_begin_gl()
. E.g. by callingcogl_set_source_color4ub()
.</note><note>It is your responsibility to restore any OpenGL state that you modify to how it was after calling
cogl_begin_gl()
if you don’t do this then the result of further Cogl calls is undefined.</note><note>You can not nest begin/end blocks.</note>
Again we would like to stress, we do not advise the use of this API and if possible we would prefer to improve Cogl than have developers require raw OpenGL.
begin_gl is deprecated: Use the #CoglGLES2Context api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func beginGl()
-
Undocumented
Declaration
Swift
@inlinable public func bitmapErrorQuark() -> UInt32
-
Undocumented
Declaration
Swift
@inlinable public func blendStringErrorQuark() -> UInt32
-
Check whether
name
occurs in list of extensions inext
.check_extension is deprecated: OpenGL is an implementation detail for Cogl and so it’s not appropriate to expose OpenGL extensions through the Cogl API. This function can be replaced by the following equivalent code: |[ CoglBool retval = (strstr (ext, name) != NULL) ? TRUE : FALSE; ]|
Declaration
Swift
@available(*, deprecated) @inlinable public func checkExtension(name: UnsafePointer<CChar>!, ext: UnsafePointer<CChar>!) -> CoglBool
-
Clears all the auxiliary buffers identified in the
buffers
mask, and if that includes the color buffer then the specifiedcolor
is used.clear is deprecated: Use cogl_framebuffer_clear() api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func clear<ColorT>(color: ColorT, buffers: Int) where ColorT : ColorProtocol
-
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.
clip_ensure is deprecated: Calling this function has no effect
Declaration
Swift
@available(*, deprecated) @inlinable public func clipEnsure()
-
Reverts the clipping region to the state before the last call to
cogl_clip_push()
.clip_pop is deprecated: Use cogl_framebuffer_pop_clip() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func clipPop()
-
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()
.clip_push is deprecated: The x, y, width, height arguments are inconsistent 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_framebuffer_push_rectangle_clip()
Declaration
Swift
@available(*, deprecated) @inlinable public func clipPush(xOffset: CFloat, yOffset: CFloat, width: CFloat, height: CFloat)
-
Sets a new clipping area using a 2D shaped described with a
CoglPrimitive
. The shape must not contain self overlapping geometry and must lie on a single 2D plane. A bounding box of the 2D shape in local coordinates (the same coordinates used to describe the shape) must be given. It is acceptable for the bounds to be larger than the true bounds but behaviour is undefined if the bounds are smaller than the true bounds.The primitive is transformed by the current model-view matrix and the silhouette is intersected with the previous clipping area. To restore the previous clipping area, call
cogl_clip_pop()
.clip_push_primitive is deprecated: Use cogl_framebuffer_push_primitive_clip() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func clipPush(primitive: UnsafeMutablePointer<CoglPrimitive>!, boundsX1: CFloat, boundsY1: CFloat, boundsX2: CFloat, boundsY2: CFloat)
-
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()
.clip_push_rectangle is deprecated: Use cogl_framebuffer_push_rectangle_clip() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func clipPushRectangle(x0: CFloat, y0: CFloat, x1: CFloat, y1: CFloat)
-
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()
.clip_push_window_rect is deprecated: Use cogl_framebuffer_push_scissor_clip() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func clipPushWindowRect(xOffset: CFloat, yOffset: CFloat, width: CFloat, height: CFloat)
-
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()
.clip_push_window_rectangle is deprecated: Use cogl_framebuffer_push_scissor_clip() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func clipPushWindowRectangle(xOffset: Int, yOffset: Int, width: Int, height: Int)
-
Restore the state of the clipping stack that was previously saved by
cogl_clip_stack_save()
.clip_stack_restore is deprecated: This was originally added to allow us to restore 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
Declaration
Swift
@available(*, deprecated) @inlinable public func clipStackRestore()
-
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 tocogl_clip_push()
after this must be matched by a call tocogl_clip_pop()
before callingcogl_clip_stack_restore()
.clip_stack_save is deprecated: This was originally added to allow us to save the 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
Declaration
Swift
@available(*, deprecated) @inlinable public func clipStackSave()
-
Undocumented
Declaration
Swift
@inlinable public func clutterCheckExtensionCLUTTER(name: UnsafePointer<CChar>!, ext: UnsafePointer<CChar>!) -> CoglBool
-
Undocumented
Declaration
Swift
@inlinable public func clutterWinsysHasFeatureCLUTTER(feature: CoglWinsysFeature) -> CoglBool
-
Compares two
CoglColor
<!– –>s and checks if they are the same.This function can be passed to
g_hash_table_new()
as thekey_equal_func
parameter, when usingCoglColor
<!– –>s as keys in aGHashTable
.Declaration
Swift
@inlinable public func colorEqual(v1: UnsafeMutableRawPointer? = nil, v2: UnsafeMutableRawPointer? = nil) -> CoglBool
-
Converts a color expressed in HLS (hue, luminance and saturation) values into a
CoglColor
.Declaration
Swift
@inlinable public func colorInitFromHsl<ColorT>(color: ColorT, hue: CFloat, saturation: CFloat, luminance: CFloat) where ColorT : ColorProtocol
-
Create a new cogl program object that can be used to replace parts of the GL rendering pipeline with custom code.
create_program is deprecated: Use #CoglSnippet api
Declaration
Swift
@available(*, deprecated) @inlinable public func createProgram() -> CoglHandle!
-
Create a new shader handle, use
cogl_shader_source()
to set the source code to be used on it.create_shader is deprecated: Use #CoglSnippet api
Declaration
Swift
@available(*, deprecated) @inlinable public func createShader(shaderType: CoglShaderType) -> CoglHandle!
-
Prints the contents of a
CoglMatrix
to stdout.Declaration
Swift
@inlinable public func debugMatrixPrint<MatrixT>(matrix: MatrixT) where MatrixT : MatrixProtocol
-
This function disables fogging, so primitives drawn afterwards will not be blended with any previously set fog color.
disable_fog is deprecated: Use #CoglSnippet shader api for fog
Declaration
Swift
@available(*, deprecated) @inlinable public func disableFog()
-
Undocumented
Declaration
Swift
@inlinable public func doubleToFixed(value: CDouble) -> CoglFixed
-
Undocumented
Declaration
Swift
@inlinable public func doubleToInt(value: CDouble) -> Int
-
Undocumented
Declaration
Swift
@inlinable public func doubleToUint(value: CDouble) -> Int
-
This is the counterpart to
cogl_begin_gl()
used to delimit blocks of drawing code using raw OpenGL. Please refer tocogl_begin_gl()
for full details.end_gl is deprecated: Use the #CoglGLES2Context api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func endGl()
-
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.features_available is deprecated: Use cogl_has_feature() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func featuresAvailable(features: FeatureFlags) -> CoglBool
-
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.
Declaration
Swift
@inlinable public func flush()
-
Queries the common
CoglPixelFormat
of all color buffers attached to this framebuffer. For an offscreen framebuffer created withcogl_offscreen_new_with_texture()
this will correspond to the format of the texture.This API is deprecated because it is missleading to report a
CoglPixelFormat
for the internal format of theframebuffer
sinceCoglPixelFormat
is such a precise format description and it’s only the set of components and the premultiplied alpha status that is really known.Declaration
Swift
@available(*, deprecated) @inlinable public func framebufferGetColorFormat(framebuffer: UnsafeMutablePointer<CoglFramebuffer>!) -> CoglPixelFormat
-
Replaces the current projection matrix with a perspective matrix for a given viewing frustum defined by 4 side clip planes that all cross through the origin and 2 near and far clip planes.
frustum is deprecated: Use cogl_framebuffer_frustum() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func frustum(left: CFloat, right: CFloat, bottom: CFloat, top: CFloat, zNear: CFloat, zFar: CFloat)
-
Queries if backface culling has been enabled via
cogl_set_backface_culling_enabled()
get_backface_culling_enabled is deprecated: Use cogl_pipeline_get_cull_face_mode() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func getBackfaceCullingEnabled() -> CoglBool
-
Gets the number of bitplanes used for each of the color components in the color buffer. Pass
nil
for any of the arguments if the value is not required.get_bitmasks is deprecated: Use cogl_framebuffer_get_red/green/blue/alpha_bits() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func getBitmasks(red: UnsafeMutablePointer<gint>!, green: UnsafeMutablePointer<gint>!, blue: UnsafeMutablePointer<gint>!, alpha: UnsafeMutablePointer<gint>!)
-
Queries if depth testing has been enabled via
cogl_set_depth_test_enable()
get_depth_test_enabled is deprecated: Use cogl_pipeline_set_depth_state() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func getDepthTestEnabled() -> CoglBool
-
Returns all of the features supported by COGL.
get_features is deprecated: Use cogl_foreach_feature() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func getFeatures() -> Cogl.FeatureFlags
-
Stores the current model-view matrix in
matrix
.get_modelview_matrix is deprecated: Use cogl_framebuffer_get_modelview_matrix() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func getModelview<MatrixT>(matrix: MatrixT) where MatrixT : MatrixProtocol
-
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.get_option_group is deprecated: Not replaced
Declaration
Swift
@available(*, deprecated) @inlinable public func getOptionGroup() -> GLib.OptionGroupRef!
-
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.<note>This function should not be used to query core opengl API symbols since eglGetProcAddress for example doesn’t allow this and and may return a junk pointer if you do.</note>
Declaration
Swift
@inlinable public func getProcAddress(name: UnsafePointer<CChar>!) -> CoglFuncPtr!
-
Stores the current projection matrix in
matrix
.get_projection_matrix is deprecated: Use cogl_framebuffer_get_projection_matrix() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func getProjection<MatrixT>(matrix: MatrixT) where MatrixT : MatrixProtocol
-
Returns the current source material as previously set using
cogl_set_source()
.<note>You should typically consider the returned material immutable and not try to change any of its properties unless you own a reference to that material. At times you may be able to get a reference to an internally managed materials and the result of modifying such materials is undefined.</note>
get_source is deprecated: Latest drawing apis all take an explicit #CoglPipeline argument so this stack of #CoglMaterial<!– –>s shouldn’t be used.
Declaration
Swift
@available(*, deprecated) @inlinable public func getSource() -> UnsafeMutableRawPointer?
-
Stores the current viewport in
v
.v
[0] andv
[1] get the x and y position of the viewport andv
[2] andv
[3] get the width and height.get_viewport is deprecated: Use cogl_framebuffer_get_viewport4fv() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func getViewport(v: UnsafeMutablePointer<CFloat>!)
-
gtype_matrix_get_type is deprecated: Use cogl_matrix_get_gtype() instead.
Declaration
Swift
@available(*, deprecated) @inlinable public func gtypeMatrixGetType() -> GType
-
Undocumented
Declaration
Swift
@inlinable public func handleGetType() -> GType
-
Increases the reference count of
handle
by 1Declaration
Swift
@inlinable public func handleRef(handle: CoglHandle) -> CoglHandle!
-
Drecreases the reference count of
handle
by 1; if the reference count reaches 0, the resources allocated byhandle
will be freedDeclaration
Swift
@inlinable public func handleUnref(handle: CoglHandle)
-
Checks whether
object
is aCoglBitmap
Declaration
Swift
@inlinable public func isBitmap(object: UnsafeMutableRawPointer? = nil) -> CoglBool
-
Gets whether the given handle references an existing material object.
is_material is deprecated: Use cogl_is_pipeline() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func isMaterial(handle: CoglHandle) -> CoglBool
-
Determines whether the given
CoglObject
references an offscreen framebuffer object.Declaration
Swift
@inlinable public func isOffscreen(object: UnsafeMutableRawPointer? = nil) -> CoglBool
-
Gets whether the given handle references an existing program object.
is_program is deprecated: Use #CoglSnippet api
Declaration
Swift
@available(*, deprecated) @inlinable public func isProgram(handle: CoglHandle) -> CoglBool
-
Gets whether the given handle references an existing shader object.
is_shader is deprecated: Use #CoglSnippet api
Declaration
Swift
@available(*, deprecated) @inlinable public func isShader(handle: CoglHandle) -> CoglBool
-
Gets whether the given object references a texture object.
Declaration
Swift
@inlinable public func isTexture(object: UnsafeMutableRawPointer? = nil) -> CoglBool
-
Checks whether
handle
is a Vertex Buffer Objectis_vertex_buffer is deprecated: Use the #CoglPrimitive api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func isVertexBuffer(handle: CoglHandle) -> CoglBool
-
Checks whether
handle
is a handle to the indices for a vertex buffer objectis_vertex_buffer_indices is deprecated: Use the #CoglPrimitive api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func isVertexBufferIndices(handle: CoglHandle) -> CoglBool
-
Increment the reference count for a
CoglMaterial
.material_ref is deprecated: Use cogl_object_ref() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func materialRef(material: CoglHandle) -> CoglHandle!
-
Decrement the reference count for a
CoglMaterial
.material_unref is deprecated: Use cogl_object_unref() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func materialUnref(material: CoglHandle)
-
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.
Declaration
Swift
@inlinable public func matrixEqual(v1: UnsafeMutableRawPointer? = nil, v2: UnsafeMutableRawPointer? = nil) -> CoglBool
-
Undocumented
Declaration
Swift
@inlinable public func onscreenClutterBackendSetSizeCLUTTER(width: Int, height: Int)
-
Replaces the current projection matrix with an orthographic projection matrix. See <xref linkend=“cogl-ortho-matrix”/> to see how the matrix is calculated.
<figure id=“cogl-ortho-matrix”> <title></title> <graphic fileref=“cogl_ortho.png” format=“PNG”/> </figure>
<note>This function copies the arguments from OpenGL’s
glOrtho()
even though they are unnecessarily confusing due to the z near and z far arguments actually being a “distance” from the origin, where negative values are behind the viewer, instead of coordinates for the z clipping planes which would have been consistent with the left, right bottom and top arguments.</note>ortho is deprecated: Use cogl_framebuffer_orthographic() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func ortho(left: CFloat, right: CFloat, bottom: CFloat, top: CFloat, near: CFloat, far: CFloat)
-
Replaces the current projection matrix with a perspective matrix based on the provided values.
<note>You should be careful not to have to great a
z_far
/z_near
ratio since that will reduce the effectiveness of depth testing since there wont be enough precision to identify the depth of objects near to each other.</note>perspective is deprecated: Use cogl_framebuffer_perspective() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func perspective(fovy: CFloat, aspect: CFloat, zNear: CFloat, zFar: CFloat)
-
Draws a convex polygon using the current source material to fill / texture with according to the texture coordinates passed.
If
use_color
istrue
then the color will be changed for each vertex using the value specified in the color member ofCoglTextureVertex
. 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.
Declaration
Swift
@inlinable public func polygon<TextureVertexT>(vertices: TextureVertexT, nVertices: Int, useColor: CoglBool) where TextureVertexT : TextureVertexProtocol
-
Restore
cogl_set_draw_buffer()
state.pop_draw_buffer is deprecated: The latest drawing apis take explicit #CoglFramebuffer arguments so this stack of framebuffers shouldn’t be used anymore.
Declaration
Swift
@available(*, deprecated) @inlinable public func popDrawBuffer()
-
Restores the framebuffer that was previously at the top of the stack. All subsequent drawing will be redirected to this framebuffer.
pop_framebuffer is deprecated: The latest drawing apis take explicit #CoglFramebuffer arguments so this stack of framebuffers shouldn’t be used anymore.
Declaration
Swift
@available(*, deprecated) @inlinable public func popFramebuffer()
-
Restores the current model-view matrix from the matrix stack.
pop_matrix is deprecated: Use cogl_framebuffer_pop_matrix() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func popMatrix()
-
Removes the material at the top of the source stack. The material at the top of this stack defines the GPU state used to process later primitives as defined by
cogl_set_source()
.pop_source is deprecated: Latest drawing apis all take an explicit #CoglPipeline argument so this stack of #CoglMaterial<!– –>s shouldn’t be used.
Declaration
Swift
@available(*, deprecated) @inlinable public func popSource()
-
Attaches a shader to a program object. A program can have multiple vertex or fragment shaders but only one of them may provide a
main()
function. It is allowed to use a program with only a vertex shader or only a fragment shader.program_attach_shader is deprecated: Use #CoglSnippet api
Declaration
Swift
@available(*, deprecated) @inlinable public func programAttachShader(programHandle: CoglHandle, shaderHandle: CoglHandle)
-
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.
program_get_uniform_location is deprecated: Use #CoglSnippet api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func programGetUniformLocation(handle: CoglHandle, uniformName: UnsafePointer<CChar>!) -> Int
-
Links a program making it ready for use. Note that calling this function is optional. If it is not called the program will automatically be linked the first time it is used.
program_link is deprecated: Use #CoglSnippet api
Declaration
Swift
@available(*, deprecated) @inlinable public func programLink(handle: CoglHandle)
-
Add an extra reference to a program.
program_ref is deprecated: Use #CoglSnippet api
Declaration
Swift
@available(*, deprecated) @inlinable public func programRef(handle: CoglHandle) -> CoglHandle!
-
Changes the value of a floating point uniform for the given linked
program
.program_set_uniform_1f is deprecated: Use #CoglSnippet api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func programSetUniform1f(program: CoglHandle, uniformLocation: Int, value: CFloat)
-
Changes the value of an integer uniform for the given linked
program
.program_set_uniform_1i is deprecated: Use #CoglSnippet api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func programSetUniform1i(program: CoglHandle, uniformLocation: Int, value: Int)
-
Changes the value of a float vector uniform, or uniform array for the given linked
program
.program_set_uniform_float is deprecated: Use #CoglSnippet api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func programSetUniformFloat(program: CoglHandle, uniformLocation: Int, nComponents: Int, count: Int, value: UnsafePointer<CFloat>!)
-
Changes the value of a int vector uniform, or uniform array for the given linked
program
.program_set_uniform_int is deprecated: Use #CoglSnippet api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func programSetUniformInt(program: CoglHandle, uniformLocation: Int, nComponents: Int, count: Int, value: UnsafePointer<CInt>!)
-
Changes the value of a matrix uniform, or uniform array in the given linked
program
.program_set_uniform_matrix is deprecated: Use #CoglSnippet api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func programSetUniformMatrix(program: CoglHandle, uniformLocation: Int, dimensions: Int, count: Int, transpose: CoglBool, value: UnsafePointer<CFloat>!)
-
Changes the value of a floating point uniform in the currently used (see
cogl_program_use()
) shader program.program_uniform_1f is deprecated: Use #CoglSnippet api
Declaration
Swift
@available(*, deprecated) @inlinable public func programUniform1f(uniformNo: Int, value: CFloat)
-
Changes the value of an integer uniform in the currently used (see
cogl_program_use()
) shader program.program_uniform_1i is deprecated: Use #CoglSnippet api
Declaration
Swift
@available(*, deprecated) @inlinable public func programUniform1i(uniformNo: Int, value: Int)
-
Changes the value of a float vector uniform, or uniform array in the currently used (see
cogl_program_use()
) shader program.program_uniform_float is deprecated: Use #CoglSnippet api
Declaration
Swift
@available(*, deprecated) @inlinable public func programUniformFloat(uniformNo: Int, size: Int, count: Int, value: UnsafePointer<CFloat>!)
-
Changes the value of a int vector uniform, or uniform array in the currently used (see
cogl_program_use()
) shader program.program_uniform_int is deprecated: Use #CoglSnippet api
Declaration
Swift
@available(*, deprecated) @inlinable public func programUniformInt(uniformNo: Int, size: Int, count: Int, value: UnsafePointer<CInt>!)
-
Changes the value of a matrix uniform, or uniform array in the currently used (see
cogl_program_use()
) shader program. Thesize
parameter is used to determine the square size of the matrix.program_uniform_matrix is deprecated: Use #CoglSnippet api
Declaration
Swift
@available(*, deprecated) @inlinable public func programUniformMatrix(uniformNo: Int, size: Int, count: Int, transpose: CoglBool, value: UnsafePointer<CFloat>!)
-
Removes a reference to a program. If it was the last reference the program object will be destroyed.
program_unref is deprecated: Use #CoglSnippet api
Declaration
Swift
@available(*, deprecated) @inlinable public func programUnref(handle: CoglHandle)
-
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.This function affects the global state of the current Cogl context. It is much more efficient to attach the shader to a specific material used for rendering instead by calling
cogl_material_set_user_program()
.program_use is deprecated: Use #CoglSnippet api
Declaration
Swift
@available(*, deprecated) @inlinable public func programUse(handle: CoglHandle)
-
Save
cogl_set_draw_buffer()
state.push_draw_buffer is deprecated: The latest drawing apis take explicit #CoglFramebuffer arguments so this stack of framebuffers shouldn’t be used anymore.
Declaration
Swift
@available(*, deprecated) @inlinable public func pushDrawBuffer()
-
Redirects all subsequent drawing to the specified framebuffer. This can either be an offscreen buffer created with cogl_offscreen_new_to_texture () or in the future it may be an onscreen framebuffer too.
You should understand that a framebuffer owns the following state: <itemizedlist> <listitem><simpara>The projection matrix</simpara></listitem> <listitem><simpara>The modelview matrix stack</simpara></listitem> <listitem><simpara>The viewport</simpara></listitem> <listitem><simpara>The clip stack</simpara></listitem> </itemizedlist> So these items will automatically be saved and restored when you push and pop between different framebuffers.
Also remember a newly allocated framebuffer will have an identity matrix for the projection and modelview matrices which gives you a coordinate space like OpenGL with (-1, -1) corresponding to the top left of the viewport, (1, 1) corresponding to the bottom right and +z coming out towards the viewer.
If you want to set up a coordinate space like Clutter does with (0, 0) corresponding to the top left and (framebuffer_width, framebuffer_height) corresponding to the bottom right you can do so like this:
static void setup_viewport (unsigned int width, unsigned int height, float fovy, float aspect, float z_near, float z_far) { float z_camera; CoglMatrix projection_matrix; CoglMatrix mv_matrix; cogl_set_viewport (0, 0, width, height); cogl_perspective (fovy, aspect, z_near, z_far); cogl_get_projection_matrix (&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()
push_framebuffer is deprecated: The latest drawing apis take explicit #CoglFramebuffer arguments so this stack of framebuffers shouldn’t be used anymore.
Declaration
Swift
@available(*, deprecated) @inlinable public func pushFramebuffer(buffer: UnsafeMutablePointer<CoglFramebuffer>!)
-
Stores the current model-view matrix on the matrix stack. The matrix can later be restored with
cogl_pop_matrix()
.push_matrix is deprecated: Use cogl_framebuffer_push_matrix() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func pushMatrix()
-
Pushes the given
material
to the top of the source stack. The material at the top of this stack defines the GPU state used to process later primitives as defined bycogl_set_source()
.push_source is deprecated: Latest drawing apis all take an explicit #CoglPipeline argument so this stack of #CoglMaterial<!– –>s shouldn’t be used.
Declaration
Swift
@available(*, deprecated) @inlinable public func pushSource(material: UnsafeMutableRawPointer? = nil)
-
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.read_pixels is deprecated: Use cogl_framebuffer_read_pixels() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func readPixels(x: Int, y: Int, width: Int, height: Int, source: ReadPixelsFlags, format: CoglPixelFormat, pixels: UnsafeMutablePointer<UInt8>!)
-
Fills a rectangle at the given coordinates with the current source material
Declaration
Swift
@inlinable public func rectangle(x1: CFloat, y1: CFloat, x2: CFloat, y2: CFloat)
-
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.
Declaration
Swift
@inlinable public func rectangleWithMultitextureCoords(x1: CFloat, y1: CFloat, x2: CFloat, y2: CFloat, texCoords: UnsafePointer<CFloat>!, texCoordsLen: Int)
-
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.0ty1
=0.0tx2
=1.0ty2
=1.0.Declaration
Swift
@inlinable public func rectangleWithTextureCoords(x1: CFloat, y1: CFloat, x2: CFloat, y2: CFloat, tx1: CFloat, ty1: CFloat, tx2: CFloat, ty2: CFloat)
-
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 callingcogl_rectangle()
separately for each rectangle.verts
should point to an array offloat
<!– –>s withn_rects
* 4 elements. Each group of 4 values corresponds to the parameters x1, y1, x2, and y2, and have the same meaning as incogl_rectangle()
.Declaration
Swift
@inlinable public func rectangles(verts: UnsafePointer<CFloat>!, nRects: Int)
-
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 callingcogl_rectangle_with_texture_coords()
separately for each rectangle.verts
should point to an array offloat
<!– –>s withn_rects
* 8 elements. Each group of 8 values corresponds to the parameters x1, y1, x2, y2, tx1, ty1, tx2 and ty2 and have the same meaning as incogl_rectangle_with_texture_coords()
.Declaration
Swift
@inlinable public func rectanglesWithTextureCoords(verts: UnsafePointer<CFloat>!, nRects: Int)
-
Multiplies the current model-view matrix by one that rotates the model around the vertex specified by
x
,y
andz
. 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.rotate is deprecated: Use cogl_framebuffer_rotate() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func rotate(angle: CFloat, x: CFloat, y: CFloat, z: CFloat)
-
Multiplies the current model-view matrix by one that scales the x, y and z axes by the given values.
scale is deprecated: Use cogl_framebuffer_pop_matrix() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func scale(x: CFloat, y: CFloat, z: CFloat)
-
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.
set_backface_culling_enabled is deprecated: Use cogl_pipeline_set_cull_face_mode() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func setBackfaceCullingEnabled(setting: CoglBool)
-
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()
andclutter_actor_lower()
, otherwise it will also take into account the actor’s depth. Depth testing is disabled by default.set_depth_test_enabled is deprecated: Use cogl_pipeline_set_depth_state() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func setDepthTestEnabled(setting: CoglBool)
-
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.
set_draw_buffer is deprecated: The latest drawing apis take explicit #CoglFramebuffer arguments so this stack of framebuffers shouldn’t be used anymore.
Declaration
Swift
@available(*, deprecated) @inlinable public func setDrawBuffer(target: BufferTarget, offscreen: CoglHandle)
-
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 atz_far
are drawn fully withfog_color
. Fogging will remain enabled until you callcogl_disable_fog()
.<note>The fogging functions only work correctly when primitives use unmultiplied alpha colors. By default Cogl will premultiply textures and
cogl_set_source_color()
will premultiply colors, so unless you explicitly load your textures requesting an unmultiplied internal format and usecogl_material_set_color()
you can only use fogging with fully opaque primitives. This might improve in the future when we can depend on fragment shaders.</note>set_fog is deprecated: Use #CoglSnippet shader api for fog
Declaration
Swift
@available(*, deprecated) @inlinable public func setFog<ColorT>(fogColor: ColorT, mode: CoglFogMode, density: CFloat, zNear: CFloat, zFar: CFloat) where ColorT : ColorProtocol
-
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.
set_framebuffer is deprecated: The latest drawing apis take explicit #CoglFramebuffer arguments so this stack of framebuffers shouldn’t be used anymore.
Declaration
Swift
@available(*, deprecated) @inlinable public func setFramebuffer(buffer: UnsafeMutablePointer<CoglFramebuffer>!)
-
Loads
matrix
as the new model-view matrix.set_modelview_matrix is deprecated: Use cogl_framebuffer_set_modelview_matrix() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func setModelview<MatrixT>(matrix: MatrixT) where MatrixT : MatrixProtocol
-
Loads matrix as the new projection matrix.
set_projection_matrix is deprecated: Use cogl_framebuffer_set_projection_matrix() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func setProjection<MatrixT>(matrix: MatrixT) where MatrixT : MatrixProtocol
-
This function changes the material at the top of the source stack. The material at the top of this stack defines the GPU state used to process subsequent primitives, such as rectangles drawn with
cogl_rectangle()
or vertices drawn usingcogl_vertex_buffer_draw()
.set_source is deprecated: Latest drawing apis all take an explicit #CoglPipeline argument so this stack of #CoglMaterial<!– –>s shouldn’t be used.
Declaration
Swift
@available(*, deprecated) @inlinable public func setSource(material: UnsafeMutableRawPointer? = nil)
-
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 non-premultiplied. For example: use (1.0, 0.0, 0.0, 0.5) for semi-transparent red.
See also
cogl_set_source_color4ub()
andcogl_set_source_color4f()
if you already have the color components.set_source_color is deprecated: Latest drawing apis all take an explicit #CoglPipeline argument so this stack of #CoglMaterial<!– –>s shouldn’t be used.
Declaration
Swift
@available(*, deprecated) @inlinable public func setSource<ColorT>(color: ColorT) where ColorT : ColorProtocol
-
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.set_source_color4f is deprecated: Latest drawing apis all take an explicit #CoglPipeline argument so this stack of #CoglMaterial<!– –>s shouldn’t be used.
Declaration
Swift
@available(*, deprecated) @inlinable public func setSourceColor4f(red: CFloat, green: CFloat, blue: CFloat, alpha: CFloat)
-
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.
set_source_color4ub is deprecated: Latest drawing apis all take an explicit #CoglPipeline argument so this stack of #CoglMaterial<!– –>s shouldn’t be used.
Declaration
Swift
@available(*, deprecated) @inlinable public func setSourceColor4ub(red: UInt8, green: UInt8, blue: UInt8, alpha: UInt8)
-
This is a convenience function for creating a material with the first layer set to
texture
and setting that material as the source with cogl_set_source.Note: There is no interaction between calls to cogl_set_source_color and cogl_set_source_texture. If you need to blend a texture with a color then you can create a simple material like this: <programlisting> material = cogl_material_new (); cogl_material_set_color4ub (material, 0xff, 0x00, 0x00, 0x80); cogl_material_set_layer (material, 0, tex_handle); cogl_set_source (material); </programlisting>
set_source_texture is deprecated: Latest drawing apis all take an explicit #CoglPipeline argument so this stack of #CoglMaterial<!– –>s shouldn’t be used.
Declaration
Swift
@available(*, deprecated) @inlinable public func setSource<TextureT>(texture: TextureT) where TextureT : TextureProtocol
-
Replaces the current viewport with the given values.
set_viewport is deprecated: Use cogl_framebuffer_set_viewport() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func setViewport(x: Int, y: Int, width: Int, height: Int)
-
Compiles the shader, no return value, but the shader is now ready for linking into a program. Note that calling this function is optional. If it is not called then the shader will be automatically compiled when it is linked.
shader_compile is deprecated: Use #CoglSnippet api
Declaration
Swift
@available(*, deprecated) @inlinable public func shaderCompile(handle: CoglHandle)
-
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.shader_get_info_log is deprecated: Use #CoglSnippet api
Declaration
Swift
@available(*, deprecated) @inlinable public func shaderGetInfoLog(handle: CoglHandle) -> String!
-
Retrieves the type of a shader
CoglHandle
shader_get_type is deprecated: Use #CoglSnippet api
Declaration
Swift
@available(*, deprecated) @inlinable public func shaderGetType(handle: CoglHandle) -> CoglShaderType
-
Retrieves whether a shader
CoglHandle
has been compiledshader_is_compiled is deprecated: Use #CoglSnippet api
Declaration
Swift
@available(*, deprecated) @inlinable public func shaderIsCompiled(handle: CoglHandle) -> CoglBool
-
Add an extra reference to a shader.
shader_ref is deprecated: Use #CoglSnippet api
Declaration
Swift
@available(*, deprecated) @inlinable public func shaderRef(handle: CoglHandle) -> CoglHandle!
-
Replaces the current source associated with a shader with a new one.
Please see <link linkend=“cogl-Shaders-and-Programmable-Pipeline.description”>above</link> for a description of the recommended format for the shader code.
shader_source is deprecated: Use #CoglSnippet api
Declaration
Swift
@available(*, deprecated) @inlinable public func shaderSource(shader: CoglHandle, source: UnsafePointer<CChar>!)
-
Removes a reference to a shader. If it was the last reference the shader object will be destroyed.
shader_unref is deprecated: Use #CoglSnippet api
Declaration
Swift
@available(*, deprecated) @inlinable public func shaderUnref(handle: CoglHandle)
-
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 thanCOGL_SQRTI_ARG_5_PERCENT
and less than 10% for narguments smaller thanCOGL_SQRTI_ARG_10_PERCENT
. The maximum argument that can be passed to this function isCOGL_SQRTI_ARG_MAX
.Declaration
Swift
@inlinable public func sqrti(x: Int) -> Int
-
Undocumented
Declaration
Swift
@inlinable public func textureErrorQuark() -> UInt32
-
Increment the reference count for a cogl texture.
texture_ref is deprecated: Use cogl_object_ref() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func textureRef(texture: UnsafeMutableRawPointer? = nil) -> UnsafeMutableRawPointer?
-
Decrement the reference count for a cogl texture.
texture_unref is deprecated: Use cogl_object_unref() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func textureUnref(texture: UnsafeMutableRawPointer? = nil)
-
Multiplies the current model-view matrix by the given matrix.
transform is deprecated: Use cogl_framebuffer_transform() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func transform<MatrixT>(matrix: MatrixT) where MatrixT : MatrixProtocol
-
Multiplies the current model-view matrix by one that translates the model along all three axes according to the given values.
translate is deprecated: Use cogl_framebuffer_translate() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func translate(x: CFloat, y: CFloat, z: CFloat)
-
Adds an attribute to a buffer, or replaces a previously added attribute with the same name.
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 suppliedpointer
.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-callcogl_vertex_buffer_submit()
to commit the changes to the GPU. Be carefull to minimize the number of calls tocogl_vertex_buffer_submit()
, though.<note>If you are interleving attributes it is assumed that each interleaved attribute starts no farther than +- stride bytes from the other attributes it is interleved with. I.e. this is ok: <programlisting> |-0-0-0-0-0-0-0-0-0-0| </programlisting> This is not ok: <programlisting> |- - - - -0-0-0-0-0-0 0 0 0 0| </programlisting> (Though you can have multiple groups of interleved attributes)</note>
vertex_buffer_add is deprecated: Use the #CoglPrimitive api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func vertexBufferAdd(handle: CoglHandle, attributeName: UnsafePointer<CChar>!, nComponents: UInt8, type: CoglAttributeType, normalized: CoglBool, stride: UInt16, pointer: UnsafeMutableRawPointer? = nil)
-
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.vertex_buffer_delete is deprecated: Use the #CoglPrimitive api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func vertexBufferDelete(handle: CoglHandle, attributeName: UnsafePointer<CChar>!)
-
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.vertex_buffer_disable is deprecated: Use the #CoglPrimitive api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func vertexBufferDisable(handle: CoglHandle, attributeName: UnsafePointer<CChar>!)
-
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.
vertex_buffer_draw is deprecated: Use the #CoglPrimitive api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func vertexBufferDraw(handle: CoglHandle, mode: CoglVerticesMode, first: Int, count: Int)
-
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.
vertex_buffer_draw_elements is deprecated: Use the #CoglPrimitive api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func vertexBufferDrawElements(handle: CoglHandle, mode: CoglVerticesMode, indices: CoglHandle, minIndex: Int, maxIndex: Int, indicesOffset: Int, count: Int)
-
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 functionvertex_buffer_enable is deprecated: Use the #CoglPrimitive api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func vertexBufferEnable(handle: CoglHandle, attributeName: UnsafePointer<CChar>!)
-
Retrieves the number of vertices that
handle
representsvertex_buffer_get_n_vertices is deprecated: Use the #CoglPrimitive api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func vertexBufferGetNVertices(handle: CoglHandle) -> Int
-
Creates a vertex buffer containing the indices needed to draw pairs of triangles from a list of vertices grouped as quads. There will be at least
n_indices
entries in the buffer (but there may be more).The indices will follow this pattern:
0, 1, 2, 0, 2, 3, 4, 5, 6, 4, 6, 7 … etc
For example, if you submit vertices for a quad like like that shown in <xref linkend=“quad-indices-order”/> then you can request 6 indices to render two triangles like those shown in <xref linkend=“quad-indices-triangles”/>.
<figure id=“quad-indices-order”> <title>Example of vertices submitted to form a quad</title> <graphic fileref=“quad-indices-order.png” format=“PNG”/> </figure>
<figure id=“quad-indices-triangles”> <title>Illustration of the triangle indices that will be generated</title> <graphic fileref=“quad-indices-triangles.png” format=“PNG”/> </figure>
vertex_buffer_indices_get_for_quads is deprecated: Use the #CoglPrimitive api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func vertexBufferIndicesGetForQuads(nIndices: Int) -> CoglHandle!
-
Queries back the data type used for the given indices
vertex_buffer_indices_get_type is deprecated: Use the #CoglPrimitive api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func vertexBufferIndicesGetType(indices: CoglHandle) -> CoglIndicesType
-
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.
vertex_buffer_indices_new is deprecated: Use the #CoglPrimitive api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func vertexBufferIndicesNew(indicesType: CoglIndicesType, indicesArray: UnsafeMutableRawPointer!, indicesLen: Int) -> CoglHandle!
-
Creates a new vertex buffer that you can use to add attributes.
vertex_buffer_new is deprecated: Use the #CoglPrimitive api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func vertexBufferNew(nVertices: Int) -> CoglHandle!
-
Increment the reference count for a vertex buffer
vertex_buffer_ref is deprecated: Use cogl_object_ref() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func vertexBufferRef(handle: CoglHandle) -> CoglHandle!
-
Submits all the user added attributes to the GPU; once submitted, the attributes can be used for drawing.
You should aim to minimize calls to this function since it implies validating your data; it potentially incurs a transport cost (especially if you are using GLX indirect rendering) and potentially a format conversion cost if the GPU doesn’t natively support any of the given attribute formats.
vertex_buffer_submit is deprecated: Use the #CoglPrimitive api instead
Declaration
Swift
@available(*, deprecated) @inlinable public func vertexBufferSubmit(handle: CoglHandle)
-
Decrement the reference count for a vertex buffer
vertex_buffer_unref is deprecated: Use cogl_object_unref() instead
Declaration
Swift
@available(*, deprecated) @inlinable public func vertexBufferUnref(handle: CoglHandle)
-
Replace the current viewport with the given values.
viewport is deprecated: Use cogl_framebuffer_set_viewport instead
Declaration
Swift
@available(*, deprecated) @inlinable public func viewport(width: Int, height: Int)
-
Calculate the sine of the given angle in fixed-point notation
-
Calculate the cosine of the given angle in fixed-point notation
-
Calculate the tangent of the given angle in fixed-point notation
-
Calculate computes the principal value of the arc tangent of
a
in fixed point notation -
Compute the principal value in fixed point notation of the arc tangent of
y/x
, using the signs of both arguments to determine the quadrant of the return value. -
Multiply two fixed-point numbers.
-
Divide two fixed-point numbers.
-
Multiplies two fixed-point values and then divide the result by a third fixed-point value.
-
Calculate the square root of a fixed-point number
-
Calculate the base-2 logarithm of a given, positive integer as a fixed-point number.
Declaration
Swift
public func log2(_ x: Int) -> Fixed
-
Calculate the integral pow(2, a) of a given fixed-point number.
Declaration
Swift
public func pow2(_ a: Fixed) -> Int
-
Calculate x to the power of a.
Declaration
Swift
public func pow(_ x: Int, _ a: Fixed) -> Int