Type Aliases
The following type aliases are available globally.
-
Integer representation of an angle such that 1024 corresponds to full circle (i.e., 2 * pi).
Declaration
Swift
public typealias Angle = CoglAngle
-
A boolean data type used throughout the Cogl C api. This should be used in conjunction with the
true
andfalse
macro defines for setting and testing boolean values.Declaration
Swift
public typealias Bool_ = CoglBool
-
Type used for storing references to cogl objects, the CoglHandle is a fully opaque type without any public data members.
Declaration
Swift
public typealias Handle = CoglHandle
-
The type used by cogl for function pointers, note that this type is used as a generic catch-all cast for function pointers and the actual arguments and return type may be different.
Declaration
Swift
public typealias FuncPtr = CoglFuncPtr
-
Data types for the components of a vertex attribute.
Declaration
Swift
public typealias AttributeType = CoglAttributeType
-
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 errorsGdkPixbufError
<!– –>s will be used directly.Declaration
Swift
public typealias BitmapError = CoglBitmapError
-
Error enumeration for the blend strings parser
Declaration
Swift
public typealias BlendStringError = CoglBlendStringError
-
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()
)Declaration
Swift
public typealias DepthTestFunction = CoglDepthTestFunction
-
Return values for the
CoglXlibFilterFunc
andCoglWin32FilterFunc
functions.Declaration
Swift
public typealias FilterReturn = CoglFilterReturn
-
The fog mode determines the equation used to calculate the fogging blend factor while fogging is enabled. The simplest
COGL_FOG_MODE_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.
Declaration
Swift
public typealias FogMode = CoglFogMode
-
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_INDICES_TYPE_UNSIGNED_INT
is only supported if theCOGL_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.Declaration
Swift
public typealias IndicesType = CoglIndicesType
-
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
CoglMaterialAlphaFunc
determines how the comparison is done.Declaration
Swift
public typealias MaterialAlphaFunc = CoglMaterialAlphaFunc
-
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.
Declaration
Swift
public typealias MaterialFilter = CoglMaterialFilter
-
Available types of layers for a
CoglMaterial
. This enumeration might be expanded in later versions.Declaration
Swift
public typealias MaterialLayerType = CoglMaterialLayerType
-
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_MATERIAL_FILTER_NEAREST
then texels outside the range 0→1 might be used even when the coordinate is exactly 0 or 1 because OpenGL will try to sample neighbouring pixels. For example if you are trying to render the full texture then you may get artifacts around the edges when the pixels from the other side are merged in if the wrap mode is set to repeat.Declaration
Swift
public typealias MaterialWrapMode = CoglMaterialWrapMode
-
Pixel formats used by Cogl. For the formats with a byte per component, the order of the components specify the order in increasing memory addresses. So for example
COGL_PIXEL_FORMAT_RGB_888
would have the red component in the lowest address, green in the next address and blue after that regardless of the endianness of the system.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_PIXEL_FORMAT_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_PIXEL_FORMAT_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.Declaration
Swift
public typealias PixelFormat = CoglPixelFormat
-
Undocumented
Declaration
Swift
public typealias RendererError = CoglRendererError
-
Types of shaders
Declaration
Swift
public typealias ShaderType = CoglShaderType
-
Represents how draw should affect the two buffers of a stereo framebuffer. See
cogl_framebuffer_set_stereo_mode()
.Declaration
Swift
public typealias StereoMode = CoglStereoMode
-
Error enumeration for Cogl
The
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_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 singleCoglPipeline
</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.
Declaration
Swift
public typealias SystemError = CoglSystemError
-
See
cogl_texture_set_components()
.Declaration
Swift
public typealias TextureComponents = CoglTextureComponents
-
Error codes that can be thrown when allocating textures.
Declaration
Swift
public typealias TextureError = CoglTextureError
-
Constants representing the underlying hardware texture type of a
CoglTexture
.Declaration
Swift
public typealias TextureType = CoglTextureType
-
Different ways of interpreting vertices when drawing.
Declaration
Swift
public typealias VerticesMode = CoglVerticesMode
-
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()
.Declaration
Swift
public typealias Winding = CoglWinding
-
Undocumented
Declaration
Swift
public typealias WinsysFeature = CoglWinsysFeature
-
A Cogl texture
Declaration
Swift
public typealias CoglTexture = _CoglTexture
-
Cogl frame buffer
Declaration
Swift
public typealias CoglFramebuffer = _CoglTexture
-
Fixed point number, particularly fast on machines without and FPU
Declaration
Swift
public typealias Fixed = CoglFixed