Namespace

Cogl – 14

A Low Level GPU Graphics and Utilities API

Version14
AuthorsMutter Development Team
LicenseGPL-2.0-or-later
Websitehttps://blogs.gnome.org/shell-dev/
Sourcehttps://gitlab.gnome.org/GNOME/mutter/

Build

C headerscogl/cogl.h
pkg-config filesmutter-cogl-14

Dependencies

GObject—2.0 The base type system library
Browse documentation
Graphene—1.0 A thin layer of mathematical types for 3D libraries
Browse documentation

Additional documentation

Classes

AtlasTexture

Functions for managing textures in Cogl’s global set of texture atlases.

Attribute

AttributeBuffer

Functions for creating and manipulating attribute buffers.

Bitmap

Functions for loading images.

Buffer

Common buffer functions, including data upload APIs.

Context

The top level application context.

Display

Common aspects of a display pipeline.

Framebuffer

FrameInfo

Frame information.

IndexBuffer

Functions for creating and manipulating vertex indices.

Indices

Describe vertex indices stored in a CoglIndexBuffer.

MatrixStack

Efficiently tracking many related transformations.

Offscreen

Functions for creating and manipulating offscreen framebuffers.

Onscreen

OnscreenTemplate

Output

Information about an output device.

Pipeline

Functions for creating and manipulating the GPU pipeline.

PixelBuffer

Primitive

Functions for creating, manipulating and drawing primitives.

Program

Renderer

Choosing a means to render.

Scanout

Shader

Functions for accessing the programmable GL pipeline.

Snippet

Functions for creating and manipulating shader snippets.

SubTexture

Functions for creating and manipulating sub-textures.

Texture

Functions for creating and manipulating textures.

Texture2D

Functions for creating and manipulating 2D textures.

Texture2DSliced

Functions for creating and manipulating 2D meta textures that may internally be comprised of multiple 2D textures with power-of-two sizes.

Interfaces

Structs

Color

A generic color definition.

DepthState

Functions for describing the depth testing state of your GPU.

DmaBufHandle

An opaque type that tracks the lifetime of a DMA buffer fd. Release with cogl_dma_buf_handle_free().

Fence

Functions for notification of command completion.

FenceClosure

An opaque type representing one future callback to be made when the GPU command stream has passed a certain point.

FramebufferDriverConfig

FrameClosure

An opaque type that tracks a CoglFrameCallback and associated user data. A CoglFrameClosure pointer will be returned from cogl_onscreen_add_frame_callback() and it allows you to remove a callback later using cogl_onscreen_remove_frame_callback().

MatrixEntry

Represents a single immutable transformation that was retrieved from a CoglMatrixStack using cogl_matrix_stack_get_entry().

OnscreenDirtyClosure

An opaque type that tracks a CoglOnscreenDirtyCallback and associated user data. A CoglOnscreenDirtyClosure pointer will be returned from cogl_onscreen_add_dirty_callback() and it allows you to remove a callback later using cogl_onscreen_remove_dirty_callback().

OnscreenDirtyInfo

A structure passed to callbacks registered using cogl_onscreen_add_dirty_callback(). The members describe a rectangle within the onscreen buffer that should be redrawn.

PollFD

A struct for describing the state of a file descriptor that Cogl needs to block on. The events field contains a bitmask of CoglPollFDEvents that should cause the application to wake up. After the application is woken up from idle it should pass back an array of CoglPollFDs to Cogl and update the revents mask to the actual events that occurred on the file descriptor.

TextureVertex

Used to specify vertex information when calling cogl_polygon().

TimestampQuery

VertexP2

A convenience vertex definition that can be used with cogl_primitive_new_p2().

VertexP2C4

A convenience vertex definition that can be used with cogl_primitive_new_p2c4().

VertexP2T2

A convenience vertex definition that can be used with cogl_primitive_new_p2t2().

VertexP2T2C4

A convenience vertex definition that can be used with cogl_primitive_new_p3t2c4().

VertexP3

A convenience vertex definition that can be used with cogl_primitive_new_p3().

VertexP3C4

A convenience vertex definition that can be used with cogl_primitive_new_p3c4().

VertexP3T2

A convenience vertex definition that can be used with cogl_primitive_new_p3t2().

VertexP3T2C4

A convenience vertex definition that can be used with cogl_primitive_new_p3t2c4().

Aliases

Enumerations

AttributeType

Data types for the components of a vertex attribute.

BitmapError

Error codes that can be thrown when performing bitmap operations.

BlendStringError

Error enumeration for the blend strings parser.

BufferBindTarget

BufferError

Error enumeration for CoglBuffer.

BufferUpdateHint

The update hint on a buffer allows the user to give some detail on how often the buffer data is going to be updated.

DepthTestFunction

When using depth testing one of these functions is used to compare the depth of an incoming fragment against the depth value currently stored in the depth buffer. The function is changed using cogl_depth_state_set_test_function().

Driver

Identifiers for underlying hardware drivers that may be used by Cogl for rendering.

FeatureID

All the capabilities that can vary between different GPUs supported by Cogl. Applications that depend on any of these features should explicitly check for them using cogl_has_feature() or cogl_has_features().

FilterReturn

Return values for the CoglXlibFilterFunc and CoglWin32FilterFunc functions.

FramebufferError

FrameEvent

Identifiers that are passed to CoglFrameCallback functions (registered using cogl_onscreen_add_frame_callback()) that mark the progression of a frame in some way which usually means that new information will have been accumulated in the frame’s corresponding CoglFrameInfo object.

GraphicsResetStatus

All the error values that might be returned by cogl_get_graphics_reset_status(). Each value’s meaning corresponds to the similarly named value defined in the ARB_robustness and NV_robustness_video_memory_purge extensions.

IndicesType

You should aim to use the smallest data type that gives you enough range, since it reduces the size of your index array and can help reduce the demand on memory bandwidth.

PipelineAlphaFunc

Alpha testing happens before blending primitives with the framebuffer and gives an opportunity to discard fragments based on a comparison with the incoming alpha value and a reference alpha value. The CoglPipelineAlphaFunc determines how the comparison is done.

PipelineCullFaceMode

Specifies which faces should be culled. This can be set on a pipeline using cogl_pipeline_set_cull_face_mode().

PipelineFilter

Texture filtering is used whenever the current pixel maps either to more than one texture element (texel) or less than one. These filter enums correspond to different strategies used to come up with a pixel color, by possibly referring to multiple neighbouring texels and taking a weighted average or simply using the nearest texel.

PipelineWrapMode

The wrap mode specifies what happens when texture coordinates outside the range 0→1 are used. Note that if the filter mode is anything but COGL_PIPELINE_FILTER_NEAREST then texels outside the range 0→1 might be used even when the coordinate is exactly 0 or 1 because OpenGL will try to sample neighbouring pixels. For example if you are trying to render the full texture then you may get artifacts around the edges when the pixels from the other side are merged in if the wrap mode is set to repeat.

PixelFormat

Pixel formats used by Cogl. For the formats with a byte per component, the order of the components specify the order in increasing memory addresses. So for example COGL_PIXEL_FORMAT_RGB_888 would have the red component in the lowest address, green in the next address and blue after that regardless of the endianness of the system.

PollFDEvent

A bitmask of events that Cogl may need to wake on for a file descriptor. Note that these all have the same values as the corresponding defines for the poll function call on Unix so they may be directly passed to poll.

RendererError

ScanoutError

ShaderType

Types of shaders.

SnippetHook

CoglSnippetHook is used to specify a location within a CoglPipeline where the code of the snippet should be used when it is attached to a pipeline.

StereoMode

Represents how draw should affect the two buffers of a stereo framebuffer. See cogl_framebuffer_set_stereo_mode().

SubpixelOrder

Some output devices (such as LCD panels) display colors by making each pixel consist of smaller “subpixels” that each have a particular color. By using knowledge of the layout of this subpixel components, it is possible to create image content with higher resolution than the pixel grid.

SystemError

Error enumeration for Cogl.

TextureComponents

See cogl_texture_set_components().

TextureError

Error codes that can be thrown when allocating textures.

VerticesMode

Different ways of interpreting vertices when drawing.

Winding

Enum used to represent the two directions of rotation. This can be used to set the front face for culling by calling cogl_pipeline_set_front_face_winding().

WinsysFeature

WinsysID

Identifies specific window system backends that Cogl supports.

Bitfields

BufferAccess

The access hints for cogl_buffer_set_update_hint().

BufferBit

Types of auxiliary buffers.

BufferMapHint

Hints to Cogl about how you are planning to modify the data once it is mapped.

BufferTarget

Target flags for FBOs.

EglImageFlags

ReadPixelsFlags

Flags for cogl_framebuffer_read_pixels_into_bitmap().

RendererConstraint

These constraint flags are hard-coded features of the different renderer backends. Sometimes a platform may support multiple rendering options which Cogl will usually choose from automatically. Some of these features are important to higher level applications and frameworks though, such as whether a renderer is X11 based because an application might only support X11 based input handling. An application might also need to ensure EGL is used internally too if they depend on access to an EGLDisplay for some purpose.

Callbacks

FeatureCallback

A callback used with cogl_foreach_feature() for enumerating all context level features supported by Cogl.

FenceCallback

The callback prototype used with cogl_framebuffer_add_fence_callback() for notification of GPU command completion.

FrameCallback

Is a callback that can be registered via cogl_onscreen_add_frame_callback() to be called when a frame progresses in some notable way.

MetaTextureCallback

A callback used with cogl_meta_texture_foreach_in_region() to retrieve details of all the low-level CoglTextures that make up a given CoglMetaTexture.

OnscreenDirtyCallback

Is a callback that can be registered via cogl_onscreen_add_dirty_callback() to be called when the windowing system determines that a region of the onscreen window has been lost and the application should redraw it.

PipelineLayerCallback

The callback prototype used with cogl_pipeline_foreach_layer() for iterating all the layers of a pipeline.

PrimitiveAttributeCallback

The callback prototype used with cogl_primitive_foreach_attribute() for iterating all the attributes of a CoglPrimitive.

XlibFilterFunc

Functions

blend_string_error_quark

blit_framebuffer

return FALSE for an immediately detected error, TRUE otherwise.

clutter_winsys_has_feature

create_program

Create a new cogl program object that can be used to replace parts of the GL rendering pipeline with custom code.

deprecated: 1.16 

create_shader

Create a new shader handle, use cogl_shader_source() to set the source code to be used on it.

deprecated: 1.16 

debug_matrix_entry_print

Allows visualizing the operations that build up the given entry for debugging purposes by printing to stdout.

flush

This function should only need to be called in exceptional circumstances.

foreach_feature

Iterates through all the context level features currently supported for a given context and for each feature callback is called.

get_graphics_reset_status

Returns the graphics reset status as reported by GetGraphicsResetStatusARB defined in the ARB_robustness extension.

get_proc_address

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.

get_rectangle_indices

glib_renderer_source_new

Creates a GSource which handles Cogl’s internal system event processing. This can be used as a convenience instead of cogl_poll_renderer_get_info() and cogl_poll_renderer_dispatch() in applications that are already using the GLib main loop. After this is called the GSource should be attached to the main loop using g_source_attach().

glib_source_new

Creates a GSource which handles Cogl’s internal system event processing. This can be used as a convenience instead of cogl_poll_renderer_get_info() and cogl_poll_renderer_dispatch() in applications that are already using the GLib main loop. After this is called the GSource should be attached to the main loop using g_source_attach().

graphene_matrix_project_point

Transforms a point whose position is given and returned as four float components.

graphene_matrix_project_points

Projects an array of input points and writes the result to another array of output points. The input points can either have 2, 3 or 4 components each. The output points always have 4 components (known as homogeneous coordinates). The output array can simply point to the input array to do the transform in-place.

graphene_matrix_transform_points

Transforms an array of input points and writes the result to another array of output points. The input points can either have 2 or 3 components each. The output points always have 3 components. The output array can simply point to the input array to do the transform in-place.

has_feature

Checks if a given feature is currently available.

has_features

Checks if a list of features are all currently available.

is_framebuffer

Gets whether the given object references a CoglFramebuffer.

meta_texture_foreach_in_region

Allows you to manually iterate the low-level textures that define a given region of a high-level CoglMetaTexture.

poll_renderer_dispatch

This should be called whenever an application is woken up from going idle in its main loop. The poll_fds array should contain a list of file descriptors matched with the events that occurred in revents. The events field is ignored. It is safe to pass in extra file descriptors that Cogl didn’t request when calling cogl_poll_renderer_get_info() or a shorter array missing some file descriptors that Cogl requested.

poll_renderer_get_info

Is used to integrate Cogl with an application mainloop that is based on the unix poll(2) api (or select() or something equivalent). This api should be called whenever an application is about to go idle so that Cogl has a chance to describe what file descriptor events it needs to be woken up for.

set_tracing_disabled_on_thread

set_tracing_enabled_on_thread

start_tracing_with_fd

start_tracing_with_path

stop_tracing

xlib_renderer_add_filter

Adds a callback function that will receive all native events. The function can stop further processing of the event by return COGL_FILTER_REMOVE.

xlib_renderer_get_display

xlib_renderer_get_foreign_display

xlib_renderer_handle_event

This function processes a single event; it can be used to hook into external event retrieval (for example that done by Clutter or GDK).

xlib_renderer_remove_filter

Removes a callback that was previously added with cogl_xlib_renderer_add_filter().

xlib_renderer_request_reset_on_video_memory_purge

Sets whether Cogl should make use of the NV_robustness_video_memory_purge extension, if exposed by the driver, by initializing the GLX context appropriately.

xlib_renderer_set_foreign_display

Sets a foreign Xlib display that Cogl will use for and Xlib based winsys backend.

Constants

A_BIT

AFIRST_BIT

BGR_BIT

DEPTH_BIT

PIXEL_FORMAT_MAX_PLANES

The maximum number of planes of a pixel format (see also cogl_pixel_format_get_planes()).

PREMULT_BIT

STENCIL_BIT

TEXTURE_MAX_WASTE