Protocols

The following protocols are available globally.

_ColorSizeCheck Record

  • The _ColorSizeCheckProtocol protocol exposes the methods and properties of an underlying _CoglColorSizeCheck instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see _ColorSizeCheck. Alternatively, use _ColorSizeCheckRef as a lighweight, unowned reference if you already have an instance you just want to use.

    See more

    Declaration

    Swift

    public protocol _ColorSizeCheckProtocol

_MatrixSizeCheck Record

  • The _MatrixSizeCheckProtocol protocol exposes the methods and properties of an underlying _CoglMatrixSizeCheck instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see _MatrixSizeCheck. Alternatively, use _MatrixSizeCheckRef as a lighweight, unowned reference if you already have an instance you just want to use.

    See more

    Declaration

    Swift

    public protocol _MatrixSizeCheckProtocol

_TextureVertexSizeCheck Record

  • The _TextureVertexSizeCheckProtocol protocol exposes the methods and properties of an underlying _CoglTextureVertexSizeCheck instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see _TextureVertexSizeCheck. Alternatively, use _TextureVertexSizeCheckRef as a lighweight, unowned reference if you already have an instance you just want to use.

    See more

    Declaration

    Swift

    public protocol _TextureVertexSizeCheckProtocol

Bitmap Class

  • The BitmapProtocol protocol exposes the methods and properties of an underlying CoglBitmap instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see Bitmap. Alternatively, use BitmapRef as a lighweight, unowned reference if you already have an instance you just want to use.

    See more

    Declaration

    Swift

    public protocol BitmapProtocol

Color Record

  • A structure for holding a color definition. The contents of the CoglColor structure are private and should never by accessed directly.

    The ColorProtocol protocol exposes the methods and properties of an underlying CoglColor instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see Color. Alternatively, use ColorRef as a lighweight, unowned reference if you already have an instance you just want to use.

    See more

    Declaration

    Swift

    public protocol ColorProtocol

Euler Record

  • The EulerProtocol protocol exposes the methods and properties of an underlying CoglEuler instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see Euler. Alternatively, use EulerRef as a lighweight, unowned reference if you already have an instance you just want to use.

    See more

    Declaration

    Swift

    public protocol EulerProtocol

Material Record

  • The MaterialProtocol protocol exposes the methods and properties of an underlying CoglMaterial instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see Material. Alternatively, use MaterialRef as a lighweight, unowned reference if you already have an instance you just want to use.

    See more

    Declaration

    Swift

    public protocol MaterialProtocol

MaterialLayer Record

  • The MaterialLayerProtocol protocol exposes the methods and properties of an underlying CoglMaterialLayer instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see MaterialLayer. Alternatively, use MaterialLayerRef as a lighweight, unowned reference if you already have an instance you just want to use.

    See more

    Declaration

    Swift

    public protocol MaterialLayerProtocol

Matrix Record

  • A CoglMatrix holds a 4x4 transform matrix. This is a single precision, column-major matrix which means it is compatible with what OpenGL expects.

    A CoglMatrix can represent transforms such as, rotations, scaling, translation, sheering, and linear projections. You can combine these transforms by multiplying multiple matrices in the order you want them applied.

    The transformation of a vertex (x, y, z, w) by a CoglMatrix is given by:

      x_new = xx * x + xy * y + xz * z + xw * w
      y_new = yx * x + yy * y + yz * z + yw * w
      z_new = zx * x + zy * y + zz * z + zw * w
      w_new = wx * x + wy * y + wz * z + ww * w
    

    Where w is normally 1

    <note>You must consider the members of the CoglMatrix structure read only, and all matrix modifications must be done via the cogl_matrix API. This allows Cogl to annotate the matrices internally. Violation of this will give undefined results. If you need to initialize a matrix with a constant other than the identity matrix you can use cogl_matrix_init_from_array().</note>

    The MatrixProtocol protocol exposes the methods and properties of an underlying CoglMatrix instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see Matrix. Alternatively, use MatrixRef as a lighweight, unowned reference if you already have an instance you just want to use.

    See more

    Declaration

    Swift

    public protocol MatrixProtocol

Offscreen Class

  • The OffscreenProtocol protocol exposes the methods and properties of an underlying CoglOffscreen instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see Offscreen. Alternatively, use OffscreenRef as a lighweight, unowned reference if you already have an instance you just want to use.

    See more

    Declaration

    Swift

    public protocol OffscreenProtocol

Quaternion Record

  • The QuaternionProtocol protocol exposes the methods and properties of an underlying CoglQuaternion instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see Quaternion. Alternatively, use QuaternionRef as a lighweight, unowned reference if you already have an instance you just want to use.

    See more

    Declaration

    Swift

    public protocol QuaternionProtocol

Texture Interface

  • The TextureProtocol protocol exposes the methods and properties of an underlying CoglTexture instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see Texture. Alternatively, use TextureRef as a lighweight, unowned reference if you already have an instance you just want to use.

    See more

    Declaration

    Swift

    public protocol TextureProtocol

TextureVertex Record

  • Used to specify vertex information when calling cogl_polygon()

    The TextureVertexProtocol protocol exposes the methods and properties of an underlying CoglTextureVertex instance. The default implementation of these can be found in the protocol extension below. For a concrete class that implements these methods and properties, see TextureVertex. Alternatively, use TextureVertexRef as a lighweight, unowned reference if you already have an instance you just want to use.

    See more

    Declaration

    Swift

    public protocol TextureVertexProtocol