Enums

Details

class Cogl.AttributeType(value)

Bases: GObject.GEnum

Data types for the components of a vertex attribute.

New in version 1.0.

BYTE = 5120

Data is the same size of a byte

UNSIGNED_BYTE = 5121

Data is the same size of an unsigned byte

SHORT = 5122

Data is the same size of a short integer

UNSIGNED_SHORT = 5123

Data is the same size of an unsigned short integer

FLOAT = 5126

Data is the same size of a float

class Cogl.BitmapError(value)

Bases: GObject.GEnum

Error codes that can be thrown when performing bitmap operations. Note that gdk_pixbuf_new_from_file() can also throw errors directly from the underlying image loading library. For example, if GdkPixbuf is used then errors #GdkPixbufError s will be used directly.

New in version 1.4.

classmethod quark()
Return type:

int

FAILED = 0

Generic failure code, something went wrong.

UNKNOWN_TYPE = 1

Unknown image type.

CORRUPT_IMAGE = 2

An image file was broken somehow.

class Cogl.BlendStringError(value)

Bases: GObject.GEnum

Error enumeration for the blend strings parser

New in version 1.0.

classmethod quark()
Return type:

int

PARSE_ERROR = 0

Generic parse error

ARGUMENT_PARSE_ERROR = 1

Argument parse error

INVALID_ERROR = 2

Internal parser error

GPU_UNSUPPORTED_ERROR = 3

Blend string not supported by the GPU

class Cogl.DepthTestFunction(value)

Bases: GObject.GEnum

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

The test is only done when depth testing is explicitly enabled. (See cogl_depth_state_set_test_enabled())

NEVER = 512

Never passes.

LESS = 513

Passes if the fragment’s depth value is less than the value currently in the depth buffer.

EQUAL = 514

Passes if the fragment’s depth value is equal to the value currently in the depth buffer.

LEQUAL = 515

Passes if the fragment’s depth value is less or equal to the value currently in the depth buffer.

GREATER = 516

Passes if the fragment’s depth value is greater than the value currently in the depth buffer.

NOTEQUAL = 517

Passes if the fragment’s depth value is not equal to the value currently in the depth buffer.

GEQUAL = 518

Passes if the fragment’s depth value greater than or equal to the value currently in the depth buffer.

ALWAYS = 519

Always passes.

class Cogl.FilterReturn(value)

Bases: GObject.GEnum

Return values for the #CoglXlibFilterFunc and #CoglWin32FilterFunc functions.

CONTINUE = 0

The event was not handled, continues the processing

REMOVE = 1

Remove the event, stops the processing

class Cogl.FogMode(value)

Bases: GObject.GEnum

The fog mode determines the equation used to calculate the fogging blend factor while fogging is enabled. The simplest Cogl.FogMode.LINEAR mode determines f as:

f = end - eye_distance / end - start

Where eye_distance is the distance of the current fragment in eye coordinates from the origin.

New in version 1.0.

LINEAR = 0

Calculates the fog blend factor as:

f = end - eye_distance / end - start

EXPONENTIAL = 1

Calculates the fog blend factor as:

f = e ^ -(density * eye_distance)

EXPONENTIAL_SQUARED = 2

Calculates the fog blend factor as:

f = e ^ -(density * eye_distance)^2

class Cogl.IndicesType(value)

Bases: GObject.GEnum

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.

Note that Cogl.IndicesType.INT is only supported if the %COGL_FEATURE_ID_UNSIGNED_INT_INDICES feature is available. This should always be available on OpenGL but on OpenGL ES it will only be available if the GL_OES_element_index_uint extension is advertized.

BYTE = 0

Your indices are unsigned bytes

SHORT = 1

Your indices are unsigned shorts

INT = 2

Your indices are unsigned ints

class Cogl.MaterialAlphaFunc(value)

Bases: GObject.GEnum

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 Cogl.MaterialAlphaFunc determines how the comparison is done.

NEVER = 512

Never let the fragment through.

LESS = 513

Let the fragment through if the incoming alpha value is less than the reference alpha value

EQUAL = 514

Let the fragment through if the incoming alpha value equals the reference alpha value

LEQUAL = 515

Let the fragment through if the incoming alpha value is less than or equal to the reference alpha value

GREATER = 516

Let the fragment through if the incoming alpha value is greater than the reference alpha value

NOTEQUAL = 517

Let the fragment through if the incoming alpha value does not equal the reference alpha value

GEQUAL = 518

Let the fragment through if the incoming alpha value is greater than or equal to the reference alpha value.

ALWAYS = 519

Always let the fragment through.

class Cogl.MaterialFilter(value)

Bases: GObject.GEnum

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.

NEAREST = 9728

Measuring in manhatten distance from the, current pixel center, use the nearest texture texel

LINEAR = 9729

Use the weighted average of the 4 texels nearest the current pixel center

NEAREST_MIPMAP_NEAREST = 9984

Select the mimap level whose texel size most closely matches the current pixel, and use the Cogl.MaterialFilter.NEAREST criterion

LINEAR_MIPMAP_NEAREST = 9985

Select the mimap level whose texel size most closely matches the current pixel, and use the Cogl.MaterialFilter.LINEAR criterion

NEAREST_MIPMAP_LINEAR = 9986

Select the two mimap levels whose texel size most closely matches the current pixel, use the Cogl.MaterialFilter.NEAREST criterion on each one and take their weighted average

LINEAR_MIPMAP_LINEAR = 9987

Select the two mimap levels whose texel size most closely matches the current pixel, use the Cogl.MaterialFilter.LINEAR criterion on each one and take their weighted average

class Cogl.MaterialLayerType(value)

Bases: GObject.GEnum

Available types of layers for a Cogl.Material. This enumeration might be expanded in later versions.

New in version 1.0.

TEXTURE = 0

The layer represents a

‘texture [cogl-Textures]’

class Cogl.MaterialWrapMode(value)

Bases: GObject.GEnum

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

New in version 1.4.

REPEAT = 10497

The texture will be repeated. This is useful for example to draw a tiled background.

CLAMP_TO_EDGE = 33071

The coordinates outside the range 0→1 will sample copies of the edge pixels of the texture. This is useful to avoid artifacts if only one copy of the texture is being rendered.

AUTOMATIC = 519

Cogl will try to automatically decide which of the above two to use. For Cogl.rectangle(), it will use repeat mode if any of the texture coordinates are outside the range 0→1, otherwise it will use clamp to edge. For Cogl.polygon() it will always use repeat mode. For Cogl.vertex_buffer_draw() it will use repeat mode except for layers that have point sprite coordinate generation enabled. This is the default value.

class Cogl.PixelFormat(value)

Bases: GObject.GEnum

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

For the formats with non byte aligned components the component order specifies the order within a 16-bit or 32-bit number from most significant bit to least significant. So for Cogl.PixelFormat.RGB_565, the red component would be in bits 11-15, the green component would be in 6-11 and the blue component would be in 1-5. Therefore the order in memory depends on the endianness of the system.

When uploading a texture Cogl.PixelFormat.ANY can be used as the internal format. Cogl will try to pick the best format to use internally and convert the texture data if necessary.

New in version 0.8.

ANY = 0

Any format

ABGR_8888 = 115

ABGR, 32 bits

ABGR_2101010 = 125

ABGR, 32 bits, 10 bpc

RGBA_8888_PRE = 147

Premultiplied RGBA, 32 bits

RGBA_4444_PRE = 149

Premultiplied RGBA, 16 bits

RGBA_5551_PRE = 150

Premultiplied RGBA, 16 bits

RGBA_1010102_PRE = 157

Premultiplied RGBA, 32 bits, 10 bpc

A_8 = 17

8 bits alpha mask

BGRA_8888_PRE = 179

Premultiplied BGRA, 32 bits

BGRA_1010102_PRE = 189

Premultiplied BGRA, 32 bits, 10 bpc

RGBA_8888 = 19

RGBA, 32 bits

RGB_888 = 2

RGB, 24 bits

RGBA_4444 = 21

RGBA, 16 bits

ARGB_8888_PRE = 211

Premultiplied ARGB, 32 bits

RGBA_5551 = 22

RGBA, 16 bits

ARGB_2101010_PRE = 221

Premultiplied ARGB, 32 bits, 10 bpc

ABGR_8888_PRE = 243

Premultiplied ABGR, 32 bits

ABGR_2101010_PRE = 253

Premultiplied ABGR, 32 bits, 10 bpc

DEPTH_32 = 259
DEPTH_16 = 265
RGBA_1010102 = 29

RGBA, 32 bits, 10 bpc

BGR_888 = 34

BGR, 24 bits

RGB_565 = 4

RGB, 16 bits

BGRA_8888 = 51

BGRA, 32 bits

BGRA_1010102 = 61

BGRA, 32 bits, 10 bpc

YUV = 7

Not currently supported

DEPTH_24_STENCIL_8 = 771
G_8 = 8

Single luminance component

ARGB_8888 = 83

ARGB, 32 bits

RG_88 = 9

RG, 16 bits. Note that red-green textures are only available if %COGL_FEATURE_ID_TEXTURE_RG is advertised. See Cogl.Texture.set_components() for details.

ARGB_2101010 = 93

ARGB, 32 bits, 10 bpc

class Cogl.RendererError(value)

Bases: GObject.GEnum

XLIB_DISPLAY_OPEN = 0
BAD_CONSTRAINT = 1
class Cogl.ShaderType(value)

Bases: GObject.GEnum

Types of shaders

New in version 1.0.

VERTEX = 0

A program for proccessing vertices

FRAGMENT = 1

A program for processing fragments

class Cogl.StereoMode(value)

Bases: GObject.GEnum

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

BOTH = 0

draw to both stereo buffers

LEFT = 1

draw only to the left stereo buffer

RIGHT = 2

draw only to the left stereo buffer

class Cogl.SystemError(value)

Bases: GObject.GEnum

Error enumeration for Cogl

The Cogl.SystemError.COGL_SYSTEM_ERROR_UNSUPPORTED error can be thrown for a variety of reasons. For example:

<itemizedlist> <listitem><para>You’ve tried to use a feature that is not advertised by cogl_has_feature(). This could happen if you create a 2d texture with a non-power-of-two size when %COGL_FEATURE_ID_TEXTURE_NPOT is not advertised.</para></listitem> <listitem><para>The GPU can not handle the configuration you have requested. An example might be if you try to use too many texture layers in a single #CoglPipeline</para></listitem> <listitem><para>The driver does not support some configuration.</para></listiem> </itemizedlist>

Currently this is only used by Cogl API marked as experimental so this enum should also be considered experimental.

New in version 1.4.

COGL_SYSTEM_ERROR_UNSUPPORTED = 0

You tried to use a feature or configuration not currently available.

COGL_SYSTEM_ERROR_NO_MEMORY = 1

You tried to allocate a resource such as a texture and there wasn’t enough memory.

class Cogl.TextureComponents(value)

Bases: GObject.GEnum

See Cogl.Texture.set_components().

New in version 1.18.

A = 1

Only the alpha component

RG = 2

Red and green components. Note that this can only be used if the %COGL_FEATURE_ID_TEXTURE_RG feature is advertised.

RGB = 3

Red, green and blue components

RGBA = 4

Red, green, blue and alpha components

DEPTH = 5

Only a depth component

class Cogl.TextureError(value)

Bases: GObject.GEnum

Error codes that can be thrown when allocating textures.

New in version 1.8.

classmethod quark()
Return type:

int

SIZE = 0

Unsupported size

FORMAT = 1

Unsupported format

BAD_PARAMETER = 2
TYPE = 3

A primitive texture type that is unsupported by the driver was used

class Cogl.TextureType(value)

Bases: GObject.GEnum

Constants representing the underlying hardware texture type of a Cogl.Texture.

New in version 1.10.

2D = 0
_2D = 0

A #CoglTexture2D

3D = 1
_3D = 1

A #CoglTexture3D

RECTANGLE = 2

A #CoglTextureRectangle

class Cogl.VerticesMode(value)

Bases: GObject.GEnum

Different ways of interpreting vertices when drawing.

New in version 1.0.

POINTS = 0

FIXME, equivalent to

GL_POINTS

LINES = 1

FIXME, equivalent to GL_LINES

LINE_LOOP = 2

FIXME, equivalent to

GL_LINE_LOOP

LINE_STRIP = 3

FIXME, equivalent to

GL_LINE_STRIP

TRIANGLES = 4

FIXME, equivalent to

GL_TRIANGLES

TRIANGLE_STRIP = 5

FIXME, equivalent to

GL_TRIANGLE_STRIP

TRIANGLE_FAN = 6

FIXME, equivalent to GL_TRIANGLE_FAN

class Cogl.Winding(value)

Bases: GObject.GEnum

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

CLOCKWISE = 0

Vertices are in a clockwise order

COUNTER_CLOCKWISE = 1

Vertices are in a counter-clockwise order

class Cogl.WinsysFeature(value)

Bases: GObject.GEnum

MULTIPLE_ONSCREEN = 0
SWAP_THROTTLE = 1
SYNC_AND_COMPLETE_EVENT = 10
N_FEATURES = 11
VBLANK_COUNTER = 2
VBLANK_WAIT = 3
TEXTURE_FROM_PIXMAP = 4
SWAP_BUFFERS_EVENT = 5
SWAP_REGION = 6
SWAP_REGION_THROTTLE = 7
SWAP_REGION_SYNCHRONIZED = 8
BUFFER_AGE = 9