| Cogl 2.0 Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
void (*CoglFuncPtr) (void);
enum CoglPixelFormat;
enum CoglBufferTarget;
enum CoglBufferBit;
enum CoglAttributeType;
void (*CoglFuncPtr) (void);
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.
typedef enum { /*< prefix=COGL_PIXEL_FORMAT >*/
COGL_PIXEL_FORMAT_ANY = 0,
COGL_PIXEL_FORMAT_A_8 = 1 | COGL_A_BIT,
COGL_PIXEL_FORMAT_RGB_565 = 4,
COGL_PIXEL_FORMAT_RGBA_4444 = 5 | COGL_A_BIT,
COGL_PIXEL_FORMAT_RGBA_5551 = 6 | COGL_A_BIT,
COGL_PIXEL_FORMAT_YUV = 7,
COGL_PIXEL_FORMAT_G_8 = 8,
COGL_PIXEL_FORMAT_RGB_888 = COGL_PIXEL_FORMAT_24,
COGL_PIXEL_FORMAT_BGR_888 = (COGL_PIXEL_FORMAT_24 | COGL_BGR_BIT),
COGL_PIXEL_FORMAT_RGBA_8888 = (COGL_PIXEL_FORMAT_32 | COGL_A_BIT),
COGL_PIXEL_FORMAT_BGRA_8888 = (COGL_PIXEL_FORMAT_32 | COGL_A_BIT | COGL_BGR_BIT),
COGL_PIXEL_FORMAT_ARGB_8888 = (COGL_PIXEL_FORMAT_32 | COGL_A_BIT | COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_ABGR_8888 = (COGL_PIXEL_FORMAT_32 | COGL_A_BIT | COGL_BGR_BIT | COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_RGBA_8888_PRE = (COGL_PIXEL_FORMAT_32 | COGL_A_BIT | COGL_PREMULT_BIT),
COGL_PIXEL_FORMAT_BGRA_8888_PRE = (COGL_PIXEL_FORMAT_32 | COGL_A_BIT | COGL_PREMULT_BIT | COGL_BGR_BIT),
COGL_PIXEL_FORMAT_ARGB_8888_PRE = (COGL_PIXEL_FORMAT_32 | COGL_A_BIT | COGL_PREMULT_BIT | COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_ABGR_8888_PRE = (COGL_PIXEL_FORMAT_32 | COGL_A_BIT | COGL_PREMULT_BIT | COGL_BGR_BIT | COGL_AFIRST_BIT),
COGL_PIXEL_FORMAT_RGBA_4444_PRE = (COGL_PIXEL_FORMAT_RGBA_4444 | COGL_A_BIT | COGL_PREMULT_BIT),
COGL_PIXEL_FORMAT_RGBA_5551_PRE = (COGL_PIXEL_FORMAT_RGBA_5551 | COGL_A_BIT | COGL_PREMULT_BIT)
} CoglPixelFormat;
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 endinanness of the system.
For the 16-bit formats the component order specifies the order
within a 16-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.
| Any format | |
| 8 bits alpha mask | |
| RGB, 16 bits | |
| RGBA, 16 bits | |
| RGBA, 16 bits | |
| Not currently supported | |
| Single luminance component | |
| RGB, 24 bits | |
| BGR, 24 bits | |
| RGBA, 32 bits | |
| BGRA, 32 bits | |
| ARGB, 32 bits | |
| ABGR, 32 bits | |
| Premultiplied RGBA, 32 bits | |
| Premultiplied BGRA, 32 bits | |
| Premultiplied ARGB, 32 bits | |
| Premultiplied ABGR, 32 bits | |
| Premultiplied RGBA, 16 bits | |
| Premultiplied RGBA, 16 bits |
Since 0.8
typedef enum
{
COGL_WINDOW_BUFFER = (1 << 1),
COGL_OFFSCREEN_BUFFER = (1 << 2)
} CoglBufferTarget;
Target flags for FBOs.
Since 0.8
typedef enum {
COGL_BUFFER_BIT_COLOR = 1L<<0,
COGL_BUFFER_BIT_DEPTH = 1L<<1,
COGL_BUFFER_BIT_STENCIL = 1L<<2
} CoglBufferBit;
Types of auxiliary buffers
| Selects the primary color buffer | |
| Selects the depth buffer | |
| Selects the stencil buffer |
Since 1.0
typedef enum {
COGL_ATTRIBUTE_TYPE_BYTE = 0x1400,
COGL_ATTRIBUTE_TYPE_UNSIGNED_BYTE = 0x1401,
COGL_ATTRIBUTE_TYPE_SHORT = 0x1402,
COGL_ATTRIBUTE_TYPE_UNSIGNED_SHORT = 0x1403,
COGL_ATTRIBUTE_TYPE_FLOAT = 0x1406
} CoglAttributeType;
Data types for the components of a vertex attribute.
| Data is the same size of a byte | |
| Data is the same size of an unsigned byte | |
| Data is the same size of a short integer | |
| Data is the same size of an unsigned short integer | |
| Data is the same size of a float |
Since 1.0