46
53
(* update_features) (CoglContext *context,
57
(* offscreen_allocate) (CoglOffscreen *offscreen,
61
(* offscreen_free) (CoglOffscreen *offscreen);
64
(* framebuffer_flush_state) (CoglFramebuffer *draw_buffer,
65
CoglFramebuffer *read_buffer,
66
CoglFramebufferState state);
69
(* framebuffer_clear) (CoglFramebuffer *framebuffer,
70
unsigned long buffers,
77
(* framebuffer_query_bits) (CoglFramebuffer *framebuffer,
78
CoglFramebufferBits *bits);
81
(* framebuffer_finish) (CoglFramebuffer *framebuffer);
84
(* framebuffer_discard_buffers) (CoglFramebuffer *framebuffer,
85
unsigned long buffers);
88
(* framebuffer_draw_attributes) (CoglFramebuffer *framebuffer,
89
CoglPipeline *pipeline,
90
CoglVerticesMode mode,
93
CoglAttribute **attributes,
98
(* framebuffer_draw_indexed_attributes) (CoglFramebuffer *framebuffer,
99
CoglPipeline *pipeline,
100
CoglVerticesMode mode,
103
CoglIndices *indices,
104
CoglAttribute **attributes,
106
CoglDrawFlags flags);
109
(* framebuffer_read_pixels_into_bitmap) (CoglFramebuffer *framebuffer,
112
CoglReadPixelsFlags source,
116
/* Destroys any driver specific resources associated with the given
119
(* texture_2d_free) (CoglTexture2D *tex_2d);
121
/* Returns TRUE if the driver can support creating a 2D texture with
122
* the given geometry and specified internal format.
125
(* texture_2d_can_create) (CoglContext *ctx,
128
CoglPixelFormat internal_format);
130
/* Initializes driver private state before allocating any specific
131
* storage for a 2D texture, where base texture and texture 2D
132
* members will already be initialized before passing control to
136
(* texture_2d_init) (CoglTexture2D *tex_2d);
138
/* Allocates (uninitialized) storage for the given texture according
139
* to the configured size and format of the texture */
141
(* texture_2d_allocate) (CoglTexture *tex,
144
/* Instantiates a new CoglTexture2D object with storage initialized
145
* with the contents of the given bitmap, using the specified
149
(* texture_2d_new_from_bitmap) (CoglBitmap *bmp,
150
CoglPixelFormat internal_format,
153
#if defined (COGL_HAS_EGL_SUPPORT) && defined (EGL_KHR_image_base)
154
/* Instantiates a new CoglTexture2D object with storage initialized
155
* with the contents of the given EGL image.
157
* This is optional for drivers to support
160
(* egl_texture_2d_new_from_image) (CoglContext *ctx,
163
CoglPixelFormat format,
168
/* Initialize the specified region of storage of the given texture
169
* with the contents of the specified framebuffer region
172
(* texture_2d_copy_from_framebuffer) (CoglTexture2D *tex_2d,
177
CoglFramebuffer *src_fb,
182
/* If the given texture has a corresponding OpenGL texture handle
188
(* texture_2d_get_gl_handle) (CoglTexture2D *tex_2d);
190
/* Update all mipmap levels > 0 */
192
(* texture_2d_generate_mipmap) (CoglTexture2D *tex_2d);
194
/* Initialize the specified region of storage of the given texture
195
* with the contents of the specified bitmap region
197
* Since this may need to create the underlying storage first
198
* it may throw a NO_MEMORY error.
201
(* texture_2d_copy_from_bitmap) (CoglTexture2D *tex_2d,
212
/* Reads back the full contents of the given texture and write it to
213
* @data in the given @format and with the given @rowstride.
218
(* texture_2d_get_data) (CoglTexture2D *tex_2d,
219
CoglPixelFormat format,
223
/* Prepares for drawing by flushing the journal, framebuffer state,
224
* pipeline state and attribute state.
227
(* flush_attributes_state) (CoglFramebuffer *framebuffer,
228
CoglPipeline *pipeline,
229
CoglFlushLayerState *layer_state,
231
CoglAttribute **attributes,
234
/* Flushes the clip stack to the GPU using a combination of the
235
* stencil buffer, scissor and clip plane state.
238
(* clip_stack_flush) (CoglClipStack *stack, CoglFramebuffer *framebuffer);
240
/* Enables the driver to create some meta data to represent a buffer
241
* but with no corresponding storage allocated yet.
244
(* buffer_create) (CoglBuffer *buffer);
247
(* buffer_destroy) (CoglBuffer *buffer);
249
/* Maps a buffer into the CPU */
251
(* buffer_map_range) (CoglBuffer *buffer,
254
CoglBufferAccess access,
255
CoglBufferMapHint hints,
258
/* Unmaps a buffer */
260
(* buffer_unmap) (CoglBuffer *buffer);
262
/* Uploads data to the buffer without needing to map it necessarily
265
(* buffer_set_data) (CoglBuffer *buffer,
272
#define COGL_DRIVER_ERROR (_cogl_driver_error_quark ())
274
typedef enum { /*< prefix=COGL_DRIVER_ERROR >*/
275
COGL_DRIVER_ERROR_UNKNOWN_VERSION,
276
COGL_DRIVER_ERROR_INVALID_VERSION,
277
COGL_DRIVER_ERROR_NO_SUITABLE_DRIVER_FOUND,
278
COGL_DRIVER_ERROR_FAILED_TO_LOAD_LIBRARY
282
_cogl_driver_error_quark (void);
50
284
#endif /* __COGL_DRIVER_H */