Gjsify LogoGjsify Logo

Index

Enumerations

Classes

Interfaces

Type Aliases

Variables

Functions

Type Aliases

Angle: number
Bool: number
Buffer: void
Handle: object
MetaTexture: void
PrimitiveTexture: void
UserDataDestroyCallback: GLib.DestroyNotify

Variables

AFIRST_BIT: number
A_BIT: number
BGR_BIT: number
DEPTH_BIT: number
PREMULT_BIT: number
STENCIL_BIT: number
TEXTURE_MAX_WASTE: number
VERSION_COMPONENT_BITS: number
VERSION_MAX_COMPONENT_VALUE: number

Functions

  • bitmapErrorQuark(): number
  • blendStringErrorQuark(): number
  • bufferGetSize(buffer: void): number
  • Retrieves the size of buffer

    Parameters

    • buffer: void

      a buffer object

    Returns number

  • Maps the buffer into the application address space for direct access. This is equivalent to calling cogl_buffer_map_range() with zero as the offset and the size of the entire buffer as the size.

    It is strongly recommended that you pass %COGL_BUFFER_MAP_HINT_DISCARD as a hint if you are going to replace all the buffer's data. This way if the buffer is currently being used by the GPU then the driver won't have to stall the CPU and wait for the hardware to finish because it can instead allocate a new buffer to map.

    The behaviour is undefined if you access the buffer in a way conflicting with the access mask you pass. It is also an error to release your last reference while the buffer is mapped.

    Parameters

    • buffer: void

      a buffer object

    • access: BufferAccess

      how the mapped buffer will be used by the application

    • hints: BufferMapHint

      A mask of #CoglBufferMapHints that tell Cogl how the data will be modified once mapped.

    Returns object | null

  • Maps a sub-region of the buffer into the application's address space for direct access.

    It is strongly recommended that you pass %COGL_BUFFER_MAP_HINT_DISCARD as a hint if you are going to replace all the buffer's data. This way if the buffer is currently being used by the GPU then the driver won't have to stall the CPU and wait for the hardware to finish because it can instead allocate a new buffer to map. You can pass %COGL_BUFFER_MAP_HINT_DISCARD_RANGE instead if you want the regions outside of the mapping to be retained.

    The behaviour is undefined if you access the buffer in a way conflicting with the access mask you pass. It is also an error to release your last reference while the buffer is mapped.

    Parameters

    • buffer: void

      a buffer object

    • offset: number

      Offset within the buffer to start the mapping

    • size: number

      The size of data to map

    • access: BufferAccess

      how the mapped buffer will be used by the application

    • hints: BufferMapHint

      A mask of #CoglBufferMapHints that tell Cogl how the data will be modified once mapped.

    Returns object | null

  • bufferSetData(buffer: void, offset: number, data: object, size: number): Cogl.Bool
  • Updates part of the buffer with new data from data. Where to put this new data is controlled by offset and offset + data should be less than the buffer size.

    Parameters

    • buffer: void

      a buffer object

    • offset: number

      destination offset (in bytes) in the buffer

    • data: object

      a pointer to the data to be copied into the buffer

    • size: number

      number of bytes to copy

    Returns Cogl.Bool

  • Sets the update hint on a buffer. See #CoglBufferUpdateHint for a description of the available hints.

    Parameters

    Returns void

  • bufferUnmap(buffer: void): void
  • Unmaps a buffer previously mapped by cogl_buffer_map().

    Parameters

    • buffer: void

      a buffer object

    Returns void

  • colorEqual(v1: object, v2: object): Cogl.Bool
  • 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.

    Parameters

    • v1: object

      a #CoglColor

    • v2: object

      a #CoglColor

    Returns Cogl.Bool

  • colorInitFromHsl(hue: number, saturation: number, luminance: number): Cogl.Color
  • Converts a color expressed in HLS (hue, luminance and saturation) values into a #CoglColor.

    Parameters

    • hue: number

      hue value, in the 0 .. 360 range

    • saturation: number

      saturation value, in the 0 .. 1 range

    • luminance: number

      luminance value, in the 0 .. 1 range

    Returns Cogl.Color

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

    Parameters

    Returns void

  • Invokes func once for each type of object that Cogl uses and passes a count of the number of objects for that type. This is intended to be used solely for debugging purposes to track down issues with objects leaking.

    Parameters

    Returns void

  • debugObjectPrintInstances(): void
  • Prints a list of all the object types that Cogl uses along with the number of objects of that type that are currently in use. This is intended to be used solely for debugging purposes to track down issues with objects leaking.

    Returns void

  • Makes a copy of error which can later be freed using cogl_error_free().

    Parameters

    • error: GLib.Error

      A #CoglError thrown by the Cogl api

    Returns GLib.Error

  • Frees a #CoglError and associated resources.

    Parameters

    • error: GLib.Error

      A #CoglError thrown by the Cogl api

    Returns void

  • Returns %TRUE if error matches domain and code, %FALSE otherwise. In particular, when error is %NULL, FALSE will be returned.

    Parameters

    • error: GLib.Error

      A #CoglError thrown by the Cogl api or %NULL

    • domain: number

      The error domain

    • code: number

      The error code

    Returns Cogl.Bool

  • eulerEqual(v1: object, v2: object): Cogl.Bool
  • Compares the two given euler angles v1 and v1 and it they are equal returns %TRUE else %FALSE.

    This function only checks that all three components rotations are numerically equal, it does not consider that some rotations can be represented with different component rotations

    Parameters

    • v1: object

      The first euler angle to compare

    • v2: object

      The second euler angle to compare

    Returns Cogl.Bool

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

    Parameters

    Returns void

  • framebufferErrorQuark(): number
  • Returns the current time value from Cogl's internal clock. This clock is used for measuring times such as the presentation time in a #CoglFrameInfo.

    This method is meant for converting timestamps retrieved from Cogl to other time systems, and is not meant to be used as a standalone timing system. For that reason, if this function is called without having retrieved a valid (non-zero) timestamp from Cogl first, it may return 0 to indicate that Cogl has no active internal clock.

    Parameters

    Returns number

  • Returns a pointer to a singleton quaternion constant describing the canonical identity [1 (0, 0, 0)] which represents no rotation.

    If you multiply a quaternion with the identity quaternion you will get back the same value as the original quaternion.

    Returns Cogl.Quaternion

  • Gets an OpenGL ES 2.0 texture handle for a #CoglTexture that can then be referenced by a #CoglGLES2Context. As well as returning a texture handle the texture's target (such as GL_TEXTURE_2D) is also returned.

    If the #CoglTexture can not be shared with a #CoglGLES2Context then this function will return %FALSE.

    This api does not affect the lifetime of the CoglTexture and you must take care not to reference the returned handle after the original texture has been freed.

    This interface is only intended for sharing textures to read from. The behaviour is undefined if the texture is modified by a GLES2 context.

    This function will only return %TRUE for low-level #CoglTextures such as #CoglTexture2D or #CoglTexture3D but not for high level meta textures such as #CoglTexture2DSliced

    The handle returned should not be passed directly to a system OpenGL ES 2.0 library, the handle is only intended to be used via a #CoglGLES2Vtable or via libcogl-gles2.

    Parameters

    • texture: Cogl.Texture

      A #CoglTexture

    • handle: number

      A return location for an OpenGL ES 2.0 texture handle

    • target: number

      A return location for an OpenGL ES 2.0 texture target

    Returns Cogl.Bool

  • 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().

    Parameters

    • renderer: Cogl.Renderer

      A #CoglRenderer

    • priority: number

      The priority of the #GSource

    Returns GLib.Source

  • 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().

    Applications that manually connect to a #CoglRenderer before they create a #CoglContext should instead use cogl_glib_renderer_source_new() so that events may be dispatched before a context has been created. In that case you don't need to use this api in addition later, it is simply enough to use cogl_glib_renderer_source_new() instead.

    This api is actually just a thin convenience wrapper around cogl_glib_renderer_source_new()

    Parameters

    • context: Cogl.Context

      A #CoglContext

    • priority: number

      The priority of the #GSource

    Returns GLib.Source

  • gtypeMatrixGetType(): GType
  • handleUnref(handle: object): void
  • Drecreases the reference count of handle by 1; if the reference count reaches 0, the resources allocated by handle will be freed

    Parameters

    • handle: object

      a #CoglHandle

    Returns void

  • Checks if a given feature is currently available

    Cogl does not aim to be a lowest common denominator API, it aims to expose all the interesting features of GPUs to application which means applications have some responsibility to explicitly check that certain features are available before depending on them.

    Parameters

    Returns Cogl.Bool

  • isAtlasTexture(object: object): Cogl.Bool
  • Checks whether the given object references a #CoglAtlasTexture

    Parameters

    • object: object

      a #CoglObject

    Returns Cogl.Bool

  • Gets whether the given object references a #CoglAttribute.

    Parameters

    • object: object

      A #CoglObject

    Returns Cogl.Bool

  • isAttributeBuffer(object: object): Cogl.Bool
  • Gets whether the given object references a #CoglAttributeBuffer.

    Parameters

    • object: object

      A #CoglObject

    Returns Cogl.Bool

  • Checks whether object is a #CoglBitmap

    Parameters

    • object: object

      a #CoglObject pointer

    Returns Cogl.Bool

  • Checks whether buffer is a buffer object.

    Parameters

    • object: object

      a buffer object

    Returns Cogl.Bool

  • Gets whether the given object references an existing context object.

    Parameters

    • object: object

      An object or %NULL

    Returns Cogl.Bool

  • Gets whether the given object references a #CoglDisplay.

    Parameters

    • object: object

      A #CoglObject pointer

    Returns Cogl.Bool

  • Gets whether the given object references a #CoglFrameInfo.

    Parameters

    • object: object

      A #CoglObject pointer

    Returns Cogl.Bool

  • isFramebuffer(object: object): Cogl.Bool
  • Gets whether the given object references a #CoglFramebuffer.

    Parameters

    • object: object

      A #CoglObject pointer

    Returns Cogl.Bool

  • isGles2Context(object: object): Cogl.Bool
  • Gets whether the given object references a #CoglGLES2Context.

    Parameters

    • object: object

      A #CoglObject pointer

    Returns Cogl.Bool

  • isIndexBuffer(object: object): Cogl.Bool
  • Gets whether the given object references a #CoglIndexBuffer.

    Parameters

    • object: object

      A #CoglObject

    Returns Cogl.Bool

  • Gets whether the given object references a #CoglIndices.

    Parameters

    • object: object

      A #CoglObject pointer

    Returns Cogl.Bool

  • isMatrixStack(object: object): Cogl.Bool
  • Determines if the given #CoglObject refers to a #CoglMatrixStack.

    Parameters

    • object: object

      a #CoglObject

    Returns Cogl.Bool

  • Gets whether the given object references a #CoglOnscreen.

    Parameters

    • object: object

      A #CoglObject pointer

    Returns Cogl.Bool

  • isOnscreenTemplate(object: object): Cogl.Bool
  • Gets whether the given object references a #CoglOnscreenTemplate.

    Parameters

    • object: object

      A #CoglObject pointer

    Returns Cogl.Bool

  • Gets whether the given object references a #CoglOutput.

    Parameters

    • object: object

      A #CoglObject pointer

    Returns Cogl.Bool

  • Gets whether the given object references an existing pipeline object.

    Parameters

    • object: object

      A #CoglObject

    Returns Cogl.Bool

  • isPixelBuffer(object: object): Cogl.Bool
  • Checks whether object is a pixel buffer.

    Parameters

    • object: object

      a #CoglObject to test

    Returns Cogl.Bool

  • Gets whether the given object references a #CoglPrimitive.

    Parameters

    • object: object

      A #CoglObject

    Returns Cogl.Bool

  • isPrimitiveTexture(object: object): Cogl.Bool
  • Gets whether the given object references a primitive texture object.

    Parameters

    • object: object

      A #CoglObject pointer

    Returns Cogl.Bool

  • Determines if the given object is a #CoglRenderer

    Parameters

    • object: object

      A #CoglObject pointer

    Returns Cogl.Bool

  • Gets whether the given object references an existing snippet object.

    Parameters

    • object: object

      A #CoglObject pointer

    Returns Cogl.Bool

  • Checks whether object is a #CoglSubTexture.

    Parameters

    • object: object

      a #CoglObject

    Returns Cogl.Bool

  • Gets whether the given object references a texture object.

    Parameters

    • object: object

      A #CoglObject pointer

    Returns Cogl.Bool

  • Gets whether the given object references an existing #CoglTexture2D object.

    Parameters

    • object: object

      A #CoglObject

    Returns Cogl.Bool

  • isTexture2dSliced(object: object): Cogl.Bool
  • Gets whether the given object references a #CoglTexture2DSliced.

    Parameters

    • object: object

      A #CoglObject pointer

    Returns Cogl.Bool

  • Checks whether the given object references a #CoglTexture3D

    Parameters

    • object: object

      a #CoglObject

    Returns Cogl.Bool

  • isTexturePixmapX11(object: object): Cogl.Bool
  • Checks whether object points to a #CoglTexturePixmapX11 instance.

    Parameters

    • object: object

      A pointer to a #CoglObject

    Returns Cogl.Bool

  • isTextureRectangle(object: object): Cogl.Bool
  • Gets whether the given object references an existing #CoglTextureRectangle object.

    Parameters

    • object: object

      A #CoglObject

    Returns Cogl.Bool

  • Asks Cogl to explicitly reset the crtc output modes at the next #CoglOnscreen swap_buffers request. For applications that support VT switching they may want to re-assert the output modes when switching back to the applications VT since the modes are often not correctly restored automatically.

    The display must have been either explicitly setup via cogl_display_setup() or implicitily setup by having created a context using the display</note>

    Parameters

    Returns void

  • kmsDisplaySetIgnoreCrtc(display: Cogl.Display, id: number, ignore: number): void
  • Tells cogl to ignore (or stop ignoring) a ctrc which means it never flips buffers at this crtc.

    Parameters

    • display: Cogl.Display
    • id: number

      KMS output id

    • ignore: number

      Ignore ouput or not

    Returns void

  • Configures display to use a framebuffer sized width x height, covering the CRTCS in crtcs. width and height must be within the driver framebuffer limits, and crtcs must be valid KMS API IDs.

    Calling this function overrides the automatic mode setting done by Cogl, and for this reason must be called before the first call to cogl_onscreen_swap_buffers().

    If you want to restore the default behaviour, you can call this function with width and height set to -1.

    Parameters

    • display: Cogl.Display
    • width: number

      the framebuffer width

    • height: number

      the framebuffer height

    • crtcs: KmsCrtc

      the array of #CoglKmsCrtc structure with the desired CRTC layout

    • nCrtcs: number

    Returns Cogl.Bool

  • Queries the file descriptor Cogl is using internally for communicating with the kms driver.

    Parameters

    Returns number

  • kmsRendererSetKmsFd(renderer: Cogl.Renderer, fd: number): void
  • Sets the file descriptor Cogl should use to communicate to the kms driver. If -1 (the default), then Cogl will open its own FD by trying to open "/dev/dri/card0".

    Parameters

    • renderer: Cogl.Renderer

      A #CoglRenderer

    • fd: number

      The fd to kms to use

    Returns void

  • matrixEqual(v1: object, v2: object): Cogl.Bool
  • 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.

    Parameters

    • v1: object

      A 4x4 transformation matrix

    • v2: object

      A 4x4 transformation matrix

    Returns Cogl.Bool

  • 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.

    If your application didn't originally create a #CoglRenderer manually then you can easily get a #CoglRenderer pointer by calling cogl_get_renderer().

    Parameters

    • renderer: Cogl.Renderer

      A #CoglRenderer

    • pollFds: Cogl.PollFD

      An array of #CoglPollFDs describing the events that have occurred since the application went idle.

    • nPollFds: number

      The length of the poll_fds array.

    Returns void

  • 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.

    If your application is using the Glib mainloop then you should jump to the cogl_glib_source_new() api as a more convenient way of integrating Cogl with the mainloop.

    After the function is called *poll_fds will contain a pointer to an array of #CoglPollFD structs describing the file descriptors that Cogl expects. The fd and events members will be updated accordingly. After the application has completed its idle it is expected to either update the revents members directly in this array or to create a copy of the array and update them there.

    When the application mainloop returns from calling poll(2) (or its equivalent) then it should call cogl_poll_renderer_dispatch() passing a pointer the array of CoglPollFDs with updated revent values.

    When using the %COGL_WINSYS_ID_WGL winsys (where file descriptors don't make any sense) or %COGL_WINSYS_ID_SDL (where the event handling functions of SDL don't allow blocking on a file descriptor) *n_poll_fds is guaranteed to be zero.

    timeout will contain a maximum amount of time to wait in microseconds before the application should wake up or -1 if the application should wait indefinitely. This can also be 0 if Cogl needs to be woken up immediately.

    Parameters

    • renderer: Cogl.Renderer

      A #CoglRenderer

    • pollFds: Cogl.PollFD

      A return location for a pointer to an array of #CoglPollFDs

    • nPollFds: number

      A return location for the number of entries in *poll_fds

    • timeout: number

      A return location for the maximum length of time to wait in microseconds, or -1 to wait indefinitely.

    Returns number

  • Restores the previously active #CoglGLES2Context if there were nested calls to cogl_push_gles2_context() or otherwise restores the ability to render with the Cogl api instead of OpenGLES 2.0.

    The behaviour is undefined if calls to cogl_pop_gles2_context() are not balenced with the number of corresponding calls to cogl_push_gles2_context().

    Parameters

    Returns void

  • Pushes the given gles2_ctx onto a stack associated with ctx so that the OpenGLES 2.0 api can be used instead of the Cogl rendering apis to read and write to the specified framebuffers.

    Usage of the api available through a #CoglGLES2Vtable is only allowed between cogl_push_gles2_context() and cogl_pop_gles2_context() calls.

    If there is a runtime problem with switching over to the given gles2_ctx then this function will return %FALSE and return an error through error.

    Parameters

    • ctx: Cogl.Context

      A #CoglContext

    • gles2Ctx: GLES2Context

      A #CoglGLES2Context allocated with cogl_gles2_context_new()

    • readBuffer: Cogl.Framebuffer

      A #CoglFramebuffer to access to read operations such as glReadPixels. (must be a #CoglOffscreen framebuffer currently)

    • writeBuffer: Cogl.Framebuffer

      A #CoglFramebuffer to access for drawing operations such as glDrawArrays. (must be a #CoglOffscreen framebuffer currently)

    Returns Cogl.Bool

  • quaternionEqual(v1: object, v2: object): Cogl.Bool
  • Compares that all the components of quaternions a and b are equal.

    An epsilon value is not used to compare the float components, but the == operator is at least used so that 0 and -0 are considered equal.

    Parameters

    • v1: object

      A #CoglQuaternion

    • v2: object

      A #CoglQuaternion

    Returns Cogl.Bool

  • rendererErrorQuark(): number
  • textureErrorQuark(): number
  • vector3Add(result: number, a: number, b: number): void
  • Adds each of the corresponding components in vectors a and b storing the results in result.

    Parameters

    • result: number

      Where you want the result written

    • a: number

      The first vector operand

    • b: number

      The second vector operand

    Returns void

  • vector3Copy(vector: number): number
  • Allocates a new 3 component float vector on the heap initializing the components from the given vector and returns a pointer to the newly allocated vector. You should free the memory using cogl_vector3_free()

    Parameters

    • vector: number

      The 3 component vector you want to copy

    Returns number

  • vector3CrossProduct(result: number, u: number, v: number): void
  • Calculates the cross product between the two vectors u and v.

    The cross product is a vector perpendicular to both u and v. This can be useful for calculating the normal of a polygon by creating two vectors in its plane using the polygons vertices and taking their cross product.

    If the two vectors are parallel then the cross product is 0.

    You can use a right hand rule to determine which direction the perpendicular vector will point: If you place the two vectors tail, to tail and imagine grabbing the perpendicular line that extends through the common tail with your right hand such that you fingers rotate in the direction from u to v then the resulting vector points along your extended thumb.

    Parameters

    • result: number

      Where you want the result written

    • u: number

      Your first 3 component vector

    • v: number

      Your second 3 component vector

    Returns void

  • vector3Distance(a: number, b: number): number
  • If you consider the two given vectors as (x,y,z) points instead then this will compute the distance between those two points.

    Parameters

    • a: number

      The first point

    • b: number

      The second point

    Returns number

  • vector3DivideScalar(vector: number, scalar: number): void
  • Divides each of the vector components by the given scalar.

    Parameters

    • vector: number

      The 3 component vector you want to manipulate

    • scalar: number

      The scalar you want to divide the vector components by

    Returns void

  • vector3DotProduct(a: number, b: number): number
  • Calculates the dot product of the two 3 component vectors. This can be used to determine the magnitude of one vector projected onto another. (for example a surface normal)

    For example if you have a polygon with a given normal vector and some other point for which you want to calculate its distance from the polygon, you can create a vector between one of the polygon vertices and that point and use the dot product to calculate the magnitude for that vector but projected onto the normal of the polygon. This way you don't just get the distance from the point to the edge of the polygon you get the distance from the point to the nearest part of the polygon.

    If you don't use a unit length normal in the above example then you would then also have to divide the result by the magnitude of the normal

    The dot product is calculated as: |[ (a->x * b->x + a->y * b->y + a->z * b->z)



    For reference, the dot product can also be calculated from the
    angle between two vectors as:
    |[
    |a||b|cos𝜃

    Parameters

    • a: number

      Your first 3 component vector

    • b: number

      Your second 3 component vector

    Returns number

  • vector3Equal(v1: object, v2: object): Cogl.Bool
  • Compares the components of two vectors and returns TRUE if they are the same.

    The comparison of the components is done with the '==' operator such that -0 is considered equal to 0, but otherwise there is no fuzziness such as an epsilon to consider vectors that are essentially identical except for some minor precision error differences due to the way they have been manipulated.

    Parameters

    • v1: object

      The first 3 component vector you want to compare

    • v2: object

      The second 3 component vector you want to compare

    Returns Cogl.Bool

  • vector3EqualWithEpsilon(vector0: number, vector1: number, epsilon: number): Cogl.Bool
  • Compares the components of two vectors using the given epsilon and returns TRUE if they are the same, using an internal epsilon for comparing the floats.

    Each component is compared against the epsilon value in this way: |[ if (fabsf (vector0->x - vector1->x) < epsilon)


    @param vector0 The first 3 component vector you want to compare
    @param vector1 The second 3 component vector you want to compare
    @param epsilon The allowable difference between components to still be considered equal

    Parameters

    • vector0: number
    • vector1: number
    • epsilon: number

    Returns Cogl.Bool

  • vector3Free(vector: number): void
  • Frees a 3 component vector that was previously allocated with cogl_vector3_copy()

    Parameters

    • vector: number

      The 3 component you want to free

    Returns void

  • vector3Init(vector: number, x: number, y: number, z: number): void
  • Initializes a 3 component, single precision float vector which can then be manipulated with the cogl_vector convenience APIs. Vectors can also be used in places where a "point" is often desired.

    Parameters

    • vector: number

      The 3 component vector you want to initialize

    • x: number

      The x component

    • y: number

      The y component

    • z: number

      The z component

    Returns void

  • vector3InitZero(vector: number): void
  • Initializes a 3 component, single precision float vector with zero for each component.

    Parameters

    • vector: number

      The 3 component vector you want to initialize

    Returns void

  • vector3Invert(vector: number): void
  • Inverts/negates all the components of the given vector.

    Parameters

    • vector: number

      The 3 component vector you want to manipulate

    Returns void

  • vector3Magnitude(vector: number): number
  • Calculates the scalar magnitude or length of vector.

    Parameters

    • vector: number

      The 3 component vector you want the magnitude for

    Returns number

  • vector3MultiplyScalar(vector: number, scalar: number): void
  • Multiplies each of the vector components by the given scalar.

    Parameters

    • vector: number

      The 3 component vector you want to manipulate

    • scalar: number

      The scalar you want to multiply the vector components by

    Returns void

  • vector3Normalize(vector: number): void
  • Updates the vector so it is a "unit vector" such that the vector<!-- -->s magnitude or length is equal to 1.

    It's safe to use this function with the [0, 0, 0] vector, it will not try to divide components by 0 (its norm) and will leave the vector untouched.

    Parameters

    • vector: number

      The 3 component vector you want to manipulate

    Returns void

  • vector3Subtract(result: number, a: number, b: number): void
  • Subtracts each of the corresponding components in vector b from a storing the results in result.

    Parameters

    • result: number

      Where you want the result written

    • a: number

      The first vector operand

    • b: number

      The second vector operand

    Returns void

  • waylandDisplaySetCompositorDisplay(display: Cogl.Display, waylandDisplay: object): void
  • Informs Cogl of a compositor's Wayland display pointer. This enables Cogl to register private wayland extensions required to pass buffers between the clients and compositor.

    Parameters

    • display: Cogl.Display

      a #CoglDisplay

    • waylandDisplay: object

      A compositor's Wayland display pointer

    Returns void

  • waylandOnscreenGetShellSurface(onscreen: Onscreen): object | null
  • waylandOnscreenGetSurface(onscreen: Onscreen): object | null
  • waylandOnscreenResize(onscreen: Onscreen, width: number, height: number, offsetX: number, offsetY: number): void
  • Resizes the backbuffer of the given onscreen framebuffer to the given size. Since a buffer is usually conceptually scaled with a center point the offset_x and offset_y arguments allow the newly allocated buffer to be positioned relative to the old buffer size.

    For example a buffer that is being resized by moving the bottom right corner, and the top left corner is remaining static would use x and y offsets of (0, 0) since the top-left of the new buffer should have the same position as the old buffer. If the center of the old buffer is being zoomed into then all the corners of the new buffer move out from the center and the x and y offsets would be (-half_x_size_increase, -half_y_size_increase) where x/y_size_increase is how many pixels bigger the buffer is on the x and y axis.

    Note that if some drawing commands have been applied to the framebuffer since the last swap buffers then the resize will be queued and will only take effect in the next swap buffers.

    If multiple calls to cogl_wayland_onscreen_resize() get queued before the next swap buffers request then the relative x and y offsets accumulate instead of being replaced. The width and height values superseed the old values.

    Parameters

    • onscreen: Onscreen

      A #CoglOnscreen framebuffer

    • width: number

      The desired width of the framebuffer

    • height: number

      The desired height of the framebuffer

    • offsetX: number

      A relative x offset for the new framebuffer

    • offsetY: number

      A relative y offset for the new framebuffer

    Returns void

  • waylandOnscreenSetForeignSurface(onscreen: Onscreen, surface: object): void
  • Allows you to explicitly notify Cogl of an existing Wayland surface to use, which prevents Cogl from allocating a surface and shell surface for the onscreen. An allocated surface will not be destroyed when the onscreen is freed.

    This function must be called before onscreen is allocated.

    Parameters

    • onscreen: Onscreen

      An unallocated framebuffer. surface A Wayland surface to associate with the onscreen.

    • surface: object

    Returns void

  • waylandRendererGetDisplay(renderer: Cogl.Renderer): object | null
  • Retrieves the Wayland display that Cogl is using. If a foreign display has been specified using cogl_wayland_renderer_set_foreign_display() then that display will be returned. If no foreign display has been specified then the display that Cogl creates internally will be returned unless the renderer has not yet been connected (either implicitly or explicitly by calling cogl_renderer_connect()) in which case %NULL is returned.

    Parameters

    Returns object | null

  • waylandRendererSetEventDispatchEnabled(renderer: Cogl.Renderer, enable: number): void
  • Sets whether Cogl should handle calling wl_display_dispatch() and wl_display_flush() as part of its main loop integration via cogl_poll_renderer_get_info() and cogl_poll_renderer_dispatch(). The default value is %TRUE. When it is enabled the application can register listeners for Wayland interfaces and the callbacks will be invoked during cogl_poll_renderer_dispatch(). If the application wants to integrate with its own code that is already handling reading from the Wayland display socket, it should disable this to avoid having competing code read from the socket.

    Parameters

    • renderer: Cogl.Renderer

      A #CoglRenderer

    • enable: number

      The new value

    Returns void

  • waylandRendererSetForeignDisplay(renderer: Cogl.Renderer, display: object): void
  • Allows you to explicitly control what Wayland display you want Cogl to work with instead of leaving Cogl to automatically connect to a wayland compositor.

    Parameters

    • renderer: Cogl.Renderer

      A #CoglRenderer

    • display: object

      A Wayland display

    Returns void

  • waylandTextureSetRegionFromShmBuffer(texture: Cogl.Texture, srcX: number, srcY: number, width: number, height: number, shmBuffer: object, dstX: number, dstY: number, level: number): Cogl.Bool
  • Sets the pixels in a rectangular subregion of texture from a Wayland SHM buffer. Generally this would be used in response to wl_surface.damage event in a compositor in order to update the texture with the damaged region. This is just a convenience wrapper around getting the SHM buffer pointer and calling cogl_texture_set_region(). See that function for a description of the level parameter.

    Since the storage for a #CoglTexture is allocated lazily then if the given texture has not previously been allocated then this api can return %FALSE and throw an exceptional error if there is not enough memory to allocate storage for texture.

    Parameters

    • texture: Cogl.Texture

      a #CoglTexture

    • srcX: number

      The X offset within the source bufer to copy from

    • srcY: number

      The Y offset within the source bufer to copy from

    • width: number

      The width of the region to copy

    • height: number

      The height of the region to copy

    • shmBuffer: object

      The source buffer

    • dstX: number

      The X offset within the texture to copy to

    • dstY: number

      The Y offset within the texture to copy to

    • level: number

      The mipmap level of the texture to copy to

    Returns Cogl.Bool

  • x11OnscreenGetVisualXid(onscreen: Onscreen): number
  • x11OnscreenGetWindowXid(onscreen: Onscreen): number
  • Assuming you know the given onscreen framebuffer is based on an x11 window this queries the XID of that window. If cogl_x11_onscreen_set_foreign_window_xid() was previously called then it will return that same XID otherwise it will be the XID of a window Cogl created internally. If the window has not been allocated yet and a foreign xid has not been set then it's undefined what value will be returned.

    It's undefined what this function does if called when not using an x11 based renderer.

    Parameters

    • onscreen: Onscreen

      A #CoglOnscreen framebuffer

    Returns number

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method