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.
- 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.
- 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.BufferError(value)¶
Bases:
GLib.Enum
Error enumeration for #CoglBuffer
- BUFFER_ERROR_MAP = 0¶
A buffer could not be mapped either because the feature isn’t supported or because a system limitation was hit.
- class Cogl.BufferUpdateHint(value)¶
Bases:
GLib.Enum
The update hint on a buffer allows the user to give some detail on how often the buffer data is going to be updated.
New in version 1.2.
- STATIC = 0¶
the buffer will not change over time
- DYNAMIC = 1¶
the buffer will change from time to time
- STREAM = 2¶
the buffer will be used once or a couple of times
- 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.DepthState.set_test_function
().The test is only done when depth testing is explicitly enabled. (See
Cogl.DepthState.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.Driver(value)¶
Bases:
GLib.Enum
Identifiers for underlying hardware drivers that may be used by Cogl for rendering.
New in version 1.10.
- ANY = 0¶
Implies no preference for which driver is used
- NOP = 1¶
A No-Op driver.
- GL = 2¶
An OpenGL driver.
- GL3 = 3¶
An OpenGL driver using the core GL 3.1 profile
- GLES1 = 4¶
An OpenGL ES 1.1 driver.
- GLES2 = 5¶
An OpenGL ES 2.0 driver.
- WEBGL = 6¶
A WebGL driver.
- class Cogl.FeatureID(value)¶
Bases:
GLib.Enum
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().New in version 1.10.
- OGL_FEATURE_ID_TEXTURE_NPOT_BASIC = 1¶
The hardware supports non power of two textures, but you also need to check the
Cogl.FeatureID.OGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP
andCogl.FeatureID.OGL_FEATURE_ID_TEXTURE_NPOT_REPEAT
features to know if the hardware supports npot texture mipmaps or repeat modes other thanCogl.PipelineWrapMode.CLAMP_TO_EDGE
respectively.
- OGL_FEATURE_ID_OFFSCREEN_MULTISAMPLE = 10¶
Multisample support for offscreen framebuffers
- OGL_FEATURE_ID_ONSCREEN_MULTIPLE = 11¶
Multiple onscreen framebuffers supported.
- OGL_FEATURE_ID_UNSIGNED_INT_INDICES = 12¶
Set if
Cogl.IndicesType.INT
is supported inCogl.Indices.new
().
- OGL_FEATURE_ID_DEPTH_RANGE = 13¶
cogl_pipeline_set_depth_range() support
- OGL_FEATURE_ID_POINT_SPRITE = 14¶
Whether
Cogl.Pipeline.set_layer_point_sprite_coords_enabled
() is supported.
- OGL_FEATURE_ID_MAP_BUFFER_FOR_READ = 15¶
Whether
Cogl.buffer_map
() is supported withCogl.BufferAccess
including read support.
- OGL_FEATURE_ID_MAP_BUFFER_FOR_WRITE = 16¶
Whether
Cogl.buffer_map
() is supported withCogl.BufferAccess
including write support.
- OGL_FEATURE_ID_MIRRORED_REPEAT = 17¶
Whether
Cogl.PipelineWrapMode.MIRRORED_REPEAT
is supported.
- OGL_FEATURE_ID_SWAP_BUFFERS_EVENT = 18¶
Available if the window system supports reporting an event for swap buffer completions.
- OGL_FEATURE_ID_GLES2_CONTEXT = 19¶
Whether creating new GLES2 contexts is suported.
- OGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP = 2¶
Mipmapping is supported in conjuntion with non power of two textures.
- OGL_FEATURE_ID_DEPTH_TEXTURE = 20¶
Whether
Cogl.Framebuffer
support rendering the depth buffer to a texture.
- OGL_FEATURE_ID_PRESENTATION_TIME = 21¶
Whether frame presentation time stamps will be recorded in
Cogl.FrameInfo
objects.
- OGL_FEATURE_ID_FENCE = 22¶
- OGL_FEATURE_ID_PER_VERTEX_POINT_SIZE = 23¶
Whether cogl_point_size_in can be used as an attribute to set a per-vertex point size.
- OGL_FEATURE_ID_TEXTURE_RG = 24¶
Support for
Cogl.TextureComponents.RG
as the internal components of a texture.
- OGL_FEATURE_ID_BUFFER_AGE = 25¶
Available if the age of
Cogl.Onscreen
back buffers are tracked and soCogl.Onscreen.get_buffer_age
() can be expected to return age values other than 0.
- OGL_FEATURE_ID_TEXTURE_NPOT_REPEAT = 3¶
Repeat modes other than
Cogl.PipelineWrapMode.CLAMP_TO_EDGE
are supported by the hardware.
- OGL_FEATURE_ID_TEXTURE_NPOT = 4¶
Non power of two textures are supported by the hardware. This is a equivalent to the
Cogl.FeatureID.OGL_FEATURE_ID_TEXTURE_NPOT_BASIC
,Cogl.FeatureID.OGL_FEATURE_ID_TEXTURE_NPOT_MIPMAP
andCogl.FeatureID.OGL_FEATURE_ID_TEXTURE_NPOT_REPEAT
features combined.
- OGL_FEATURE_ID_TEXTURE_RECTANGLE = 5¶
Support for rectangular textures with non-normalized texture coordinates.
- OGL_FEATURE_ID_TEXTURE_3D = 6¶
3D texture support
- OGL_FEATURE_ID_GLSL = 7¶
GLSL support
- OGL_FEATURE_ID_ARBFP = 8¶
ARBFP support
- OGL_FEATURE_ID_OFFSCREEN = 9¶
Offscreen rendering support
- 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.FrameEvent(value)¶
Bases:
GLib.Enum
Identifiers that are passed to
Cogl.FrameCallback
functions (registered usingCogl.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 correspondingCogl.FrameInfo
object.The last event that will be sent for a frame will be a
Cogl.FrameEvent.COMPLETE
event and so these are a good opportunity to collect statistics about a frame since theCogl.FrameInfo
should hold the most data at this point.A frame may not be completed before the next frame can start so applications should avoid needing to collect all statistics for a particular frame before they can start a new frame.
New in version 1.14.
- SYNC = 1¶
Notifies that the system compositor has acknowledged a frame and is ready for a new frame to be created.
- COMPLETE = 2¶
Notifies that a frame has ended. This is a good time for applications to collect statistics about the frame since the
Cogl.FrameInfo
should hold the most data at this point. No other events should be expected after aCogl.FrameEvent.COMPLETE
event.
- class Cogl.GLES2ContextError(value)¶
Bases:
GLib.Enum
Error codes that relate to the cogl_gles2_context api.
- UNSUPPORTED = 0¶
Creating GLES2 contexts isn’t supported. Applications should use
Cogl.has_feature
() to check for theCogl.FeatureID.OGL_FEATURE_ID_GLES2_CONTEXT
.
- DRIVER = 1¶
An underlying driver error occured.
- 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 theCogl.FeatureID.OGL_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
- NEVER = 512¶
- LESS = 513¶
- EQUAL = 514¶
- LEQUAL = 515¶
- GREATER = 516¶
- NOTEQUAL = 517¶
- GEQUAL = 518¶
- ALWAYS = 519¶
- class Cogl.MaterialFilter(value)¶
Bases:
GObject.GEnum
- NEAREST = 9728¶
- LINEAR = 9729¶
- NEAREST_MIPMAP_NEAREST = 9984¶
- LINEAR_MIPMAP_NEAREST = 9985¶
- NEAREST_MIPMAP_LINEAR = 9986¶
- LINEAR_MIPMAP_LINEAR = 9987¶
- class Cogl.MaterialLayerType(value)¶
Bases:
GObject.GEnum
- TEXTURE = 0¶
- class Cogl.MaterialWrapMode(value)¶
Bases:
GObject.GEnum
- REPEAT = 10497¶
- CLAMP_TO_EDGE = 33071¶
- AUTOMATIC = 519¶
- class Cogl.PipelineAlphaFunc(value)¶
Bases:
GLib.Enum
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.PipelineAlphaFunc
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.PipelineCullFaceMode(value)¶
Bases:
GLib.Enum
Specifies which faces should be culled. This can be set on a pipeline using
Cogl.Pipeline.set_cull_face_mode
().- NONE = 0¶
Neither face will be culled. This is the default.
- FRONT = 1¶
Front faces will be culled.
- BACK = 2¶
Back faces will be culled.
- BOTH = 3¶
All faces will be culled.
- class Cogl.PipelineFilter(value)¶
Bases:
GLib.Enum
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.PipelineFilter.NEAREST
criterion
- LINEAR_MIPMAP_NEAREST = 9985¶
Select the mimap level whose texel size most closely matches the current pixel, and use the
Cogl.PipelineFilter.LINEAR
criterion
- NEAREST_MIPMAP_LINEAR = 9986¶
Select the two mimap levels whose texel size most closely matches the current pixel, use the
Cogl.PipelineFilter.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.PipelineFilter.LINEAR
criterion on each one and take their weighted average
- class Cogl.PipelineWrapMode(value)¶
Bases:
GLib.Enum
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.PipelineFilter.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 2.0.
- 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.
- MIRRORED_REPEAT = 33648¶
- 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.FeatureID.OGL_FEATURE_ID_TEXTURE_RG
is advertised. SeeCogl.Texture.set_components
() for details.
- ARGB_2101010 = 93¶
ARGB, 32 bits, 10 bpc
- class Cogl.PollFDEvent(value)¶
Bases:
GLib.Enum
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.
New in version 1.10.
- IN = 1¶
there is data to read
- HUP = 16¶
hung up (the connection has been broken, usually for pipes and sockets).
- PRI = 2¶
data can be written (without blocking)
- NVAL = 32¶
invalid request. The file descriptor is not open.
- OUT = 4¶
there is urgent data to read.
- ERR = 8¶
error condition
- class Cogl.RendererError(value)¶
Bases:
GObject.GEnum
- XLIB_DISPLAY_OPEN = 0¶
- BAD_CONSTRAINT = 1¶
- class Cogl.ShaderType(value)¶
Bases:
GObject.GEnum
- VERTEX = 0¶
- FRAGMENT = 1¶
- class Cogl.SnippetHook(value)¶
Bases:
GLib.Enum
Cogl.SnippetHook
is used to specify a location within aCogl.Pipeline
where the code of the snippet should be used when it is attached to a pipeline.Cogl.SnippetHook.VERTEX_GLOBALS
Adds a shader snippet at the beginning of the global section of the shader for the vertex processing. Any declarations here can be shared with all other snippets that are attached to a vertex hook. Only the ‘declarations’ string is used and the other strings are ignored.
Cogl.SnippetHook.FRAGMENT_GLOBALS
Adds a shader snippet at the beginning of the global section of the shader for the fragment processing. Any declarations here can be shared with all other snippets that are attached to a fragment hook. Only the ‘declarations’ string is used and the other strings are ignored.
Adds a shader snippet that will hook on to the vertex processing stage of the pipeline. This gives a chance for the application to modify the vertex attributes generated by the shader. Typically the snippet will modify cogl_color_out or cogl_position_out builtins.
The ‘declarations’ string in snippet will be inserted in the global scope of the shader. Use this to declare any uniforms, attributes or functions that the snippet requires.
The ‘pre’ string in snippet will be inserted at the top of the main() function before any vertex processing is done.
The ‘replace’ string in snippet will be used instead of the generated vertex processing if it is present. This can be used if the application wants to provide a complete vertex shader and doesn’t need the generated output from Cogl.
The ‘post’ string in snippet will be inserted after all of the standard vertex processing is done. This can be used to modify the outputs.
Cogl.SnippetHook.VERTEX_TRANSFORM
Adds a shader snippet that will hook on to the vertex transform stage. Typically the snippet will use the cogl_modelview_matrix, cogl_projection_matrix and cogl_modelview_projection_matrix matrices and the cogl_position_in attribute. The hook must write to cogl_position_out. The default processing for this hook will multiply cogl_position_in by the combined modelview-projection matrix and store it on cogl_position_out.
The ‘declarations’ string in snippet will be inserted in the global scope of the shader. Use this to declare any uniforms, attributes or functions that the snippet requires.
The ‘pre’ string in snippet will be inserted at the top of the main() function before the vertex transform is done.
The ‘replace’ string in snippet will be used instead of the generated vertex transform if it is present.
The ‘post’ string in snippet will be inserted after all of the standard vertex transformation is done. This can be used to modify the cogl_position_out in addition to the default processing.
Adds a shader snippet that will hook on to the point size calculation step within the vertex shader stage. The snippet should write to the builtin cogl_point_size_out with the new point size. The snippet can either read cogl_point_size_in directly and write a new value or first read an existing value in cogl_point_size_out that would be set by a previous snippet. Note that this hook is only used if
Cogl.Pipeline.set_per_vertex_point_size
() is enabled on the pipeline.The ‘declarations’ string in snippet will be inserted in the global scope of the shader. Use this to declare any uniforms, attributes or functions that the snippet requires.
The ‘pre’ string in snippet will be inserted just before calculating the point size.
The ‘replace’ string in snippet will be used instead of the generated point size calculation if it is present.
The ‘post’ string in snippet will be inserted after the standard point size calculation is done. This can be used to modify cogl_point_size_out in addition to the default processing.
Adds a shader snippet that will hook on to the fragment processing stage of the pipeline. This gives a chance for the application to modify the fragment color generated by the shader. Typically the snippet will modify cogl_color_out.
The ‘declarations’ string in snippet will be inserted in the global scope of the shader. Use this to declare any uniforms, attributes or functions that the snippet requires.
The ‘pre’ string in snippet will be inserted at the top of the main() function before any fragment processing is done.
The ‘replace’ string in snippet will be used instead of the generated fragment processing if it is present. This can be used if the application wants to provide a complete fragment shader and doesn’t need the generated output from Cogl.
The ‘post’ string in snippet will be inserted after all of the standard fragment processing is done. At this point the generated value for the rest of the pipeline state will already be in cogl_color_out so the application can modify the result by altering this variable.
Cogl.SnippetHook.TEXTURE_COORD_TRANSFORM
Adds a shader snippet that will hook on to the texture coordinate transformation of a particular layer. This can be used to replace the processing for a layer or to modify the results.
Within the snippet code for this hook there are two extra variables. The first is a mat4 called cogl_matrix which represents the user matrix for this layer. The second is called cogl_tex_coord and represents the incoming and outgoing texture coordinate. On entry to the hook, cogl_tex_coord contains the value of the corresponding texture coordinate attribute for this layer. The hook is expected to modify this variable. The output will be passed as a varying to the fragment processing stage. The default code will just multiply cogl_matrix by cogl_tex_coord and store the result in cogl_tex_coord.
The ‘declarations’ string in snippet will be inserted in the global scope of the shader. Use this to declare any uniforms, attributes or functions that the snippet requires.
The ‘pre’ string in snippet will be inserted just before the fragment processing for this layer. At this point cogl_tex_coord still contains the value of the texture coordinate attribute.
If a ‘replace’ string is given then this will be used instead of the default fragment processing for this layer. The snippet can modify cogl_tex_coord or leave it as is to apply no transformation.
The ‘post’ string in snippet will be inserted just after the transformation. At this point cogl_tex_coord will contain the results of the transformation but it can be further modified by the snippet.
Cogl.SnippetHook.LAYER_FRAGMENT
Adds a shader snippet that will hook on to the fragment processing of a particular layer. This can be used to replace the processing for a layer or to modify the results.
Within the snippet code for this hook there is an extra vec4 variable called ‘cogl_layer’. This contains the resulting color that will be used for the layer. This can be modified in the ‘post’ section or it the default processing can be replaced entirely using the ‘replace’ section.
The ‘declarations’ string in snippet will be inserted in the global scope of the shader. Use this to declare any uniforms, attributes or functions that the snippet requires.
The ‘pre’ string in snippet will be inserted just before the fragment processing for this layer.
If a ‘replace’ string is given then this will be used instead of the default fragment processing for this layer. The snippet must write to the ‘cogl_layer’ variable in that case.
The ‘post’ string in snippet will be inserted just after the fragment processing for the layer. The results can be modified by changing the value of the ‘cogl_layer’ variable.
Cogl.SnippetHook.TEXTURE_LOOKUP
Adds a shader snippet that will hook on to the texture lookup part of a given layer. This gives a chance for the application to modify the coordinates that will be used for the texture lookup or to alter the returned texel.
Within the snippet code for this hook there are three extra variables available. ‘cogl_sampler’ is a sampler object representing the sampler for the layer where the snippet is attached. ‘cogl_tex_coord’ is a vec4 which contains the texture coordinates that will be used for the texture lookup. This can be modified. ‘cogl_texel’ will contain the result of the texture lookup. This can also be modified.
The ‘declarations’ string in snippet will be inserted in the global scope of the shader. Use this to declare any uniforms, attributes or functions that the snippet requires.
The ‘pre’ string in snippet will be inserted at the top of the main() function before any fragment processing is done. This is a good place to modify the cogl_tex_coord variable.
If a ‘replace’ string is given then this will be used instead of a the default texture lookup. The snippet would typically use its own sampler in this case.
The ‘post’ string in snippet will be inserted after texture lookup has been preformed. Here the snippet can modify the cogl_texel variable to alter the returned texel.
New in version 1.10.
- VERTEX = 0¶
A hook for the entire vertex processing stage of the pipeline.
- VERTEX_TRANSFORM = 1¶
A hook for the vertex transformation.
- VERTEX_GLOBALS = 2¶
A hook for declaring global data that can be shared with all other snippets that are on a vertex hook.
- FRAGMENT = 2048¶
A hook for the entire fragment processing stage of the pipeline.
- FRAGMENT_GLOBALS = 2049¶
A hook for declaring global data wthat can be shared with all other snippets that are on a fragment hook.
- POINT_SIZE = 3¶
A hook for manipulating the point size of a vertex. This is only used if
Cogl.Pipeline.set_per_vertex_point_size
() is enabled on the pipeline.
- TEXTURE_COORD_TRANSFORM = 4096¶
A hook for applying the layer matrix to a texture coordinate for a layer.
- LAYER_FRAGMENT = 6144¶
A hook for the fragment processing of a particular layer.
- TEXTURE_LOOKUP = 6145¶
A hook for the texture lookup stage of a given layer in a pipeline.
- 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.SubpixelOrder(value)¶
Bases:
GLib.Enum
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.
New in version 1.14.
- UNKNOWN = 0¶
the layout of subpixel components for the device is unknown.
- NONE = 1¶
the device displays colors without geometrically-separated subpixel components, or the positioning or colors of the components do not match any of the values in the enumeration.
- HORIZONTAL_RGB = 2¶
the device has horizontally arranged components in the order red-green-blue from left to right.
- HORIZONTAL_BGR = 3¶
the device has horizontally arranged components in the order blue-green-red from left to right.
- VERTICAL_RGB = 4¶
the device has vertically arranged components in the order red-green-blue from top to bottom.
- VERTICAL_BGR = 5¶
the device has vertically arranged components in the order blue-green-red from top to bottom.
- 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 whenCogl.FeatureID.OGL_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 singleCogl.Pipeline
</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.FeatureID.OGL_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.
- 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.TexturePixmapX11Error(value)¶
Bases:
GLib.Enum
Error codes that can be thrown when performing texture-pixmap-x11 operations.
New in version 1.10.
- TEXTURE_PIXMAP_X11_ERROR_X11 = 0¶
An X11 protocol error
- class Cogl.TexturePixmapX11ReportLevel(value)¶
Bases:
GLib.Enum
- RAW_RECTANGLES = 0¶
- DELTA_RECTANGLES = 1¶
- BOUNDING_BOX = 2¶
- NON_EMPTY = 3¶
- 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¶
- 3D = 1¶
- _3D = 1¶
- RECTANGLE = 2¶
- 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¶
- class Cogl.WinsysID(value)¶
Bases:
GLib.Enum
Identifies specific window system backends that Cogl supports.
These can be used to query what backend Cogl is using or to try and explicitly select a backend to use.
- ANY = 0¶
Implies no preference for which backend is used
- STUB = 1¶
Use the no-op stub backend
- WGL = 10¶
Use the Microsoft Windows WGL binding API
- SDL = 11¶
Use the SDL window system
- GLX = 2¶
Use the GLX window system binding API
- EGL_XLIB = 3¶
Use EGL with the X window system via XLib
- EGL_GDL = 5¶
Use EGL with the GDL platform
- EGL_WAYLAND = 6¶
Use EGL with the Wayland window system
- EGL_KMS = 7¶
Use EGL with the KMS platform
- EGL_ANDROID = 8¶
Use EGL with the Android platform
- EGL_MIR = 9¶
Use EGL with the Mir server