summaryrefslogtreecommitdiff
path: root/cogl/cogl-driver.h
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2012-09-01 00:04:00 +0100
committerRobert Bragg <robert@linux.intel.com>2013-01-18 10:53:29 +0000
commitce5d06afe1d4f890fb11b885cfeabf253c466a51 (patch)
tree3e9fbbc4ee6c083dc4ee34e91a562d244d4d2eb6 /cogl/cogl-driver.h
parent87bc616d34589beaf972a79ffed35199b3d16d2e (diff)
downloadcogl-ce5d06afe1d4f890fb11b885cfeabf253c466a51.tar.gz
framebuffer: split GL code out from cogl-framebuffer.c
This splits out most of the OpenGL specific code from cogl-framebuffer.c into cogl-framebuffer-gl.c and extends the CoglDriverVtable interface for cogl-framebuffer.c to use. There are hopes to support several different backends for Cogl eventually to hopefully get us closer to the metal so this makes some progress in organizing which parts of Cogl are OpenGL specific so these parts can potentially be switched out later. The only remaining use of OpenGL still in cogl-framebuffer.c is to handle cogl_framebuffer_read_pixels.
Diffstat (limited to 'cogl/cogl-driver.h')
-rw-r--r--cogl/cogl-driver.h57
1 files changed, 57 insertions, 0 deletions
diff --git a/cogl/cogl-driver.h b/cogl/cogl-driver.h
index e22439a3..7b82628d 100644
--- a/cogl/cogl-driver.h
+++ b/cogl/cogl-driver.h
@@ -25,6 +25,8 @@
#define __COGL_DRIVER_H
#include "cogl-context.h"
+#include "cogl-offscreen.h"
+#include "cogl-framebuffer-private.h"
typedef struct _CoglDriverVtable CoglDriverVtable;
@@ -45,6 +47,61 @@ struct _CoglDriverVtable
CoglBool
(* update_features) (CoglContext *context,
GError **error);
+
+ CoglBool
+ (* offscreen_allocate) (CoglOffscreen *offscreen,
+ GError **error);
+
+ void
+ (* offscreen_free) (CoglOffscreen *offscreen);
+
+ void
+ (* framebuffer_flush_state) (CoglFramebuffer *draw_buffer,
+ CoglFramebuffer *read_buffer,
+ CoglFramebufferState state);
+
+ void
+ (* framebuffer_clear) (CoglFramebuffer *framebuffer,
+ unsigned long buffers,
+ float red,
+ float green,
+ float blue,
+ float alpha);
+
+ void
+ (* framebuffer_query_bits) (CoglFramebuffer *framebuffer,
+ int *red,
+ int *green,
+ int *blue,
+ int *alpha);
+
+ void
+ (* framebuffer_finish) (CoglFramebuffer *framebuffer);
+
+ void
+ (* framebuffer_discard_buffers) (CoglFramebuffer *framebuffer,
+ unsigned long buffers);
+
+ void
+ (* framebuffer_draw_attributes) (CoglFramebuffer *framebuffer,
+ CoglPipeline *pipeline,
+ CoglVerticesMode mode,
+ int first_vertex,
+ int n_vertices,
+ CoglAttribute **attributes,
+ int n_attributes,
+ CoglDrawFlags flags);
+
+ void
+ (* framebuffer_draw_indexed_attributes) (CoglFramebuffer *framebuffer,
+ CoglPipeline *pipeline,
+ CoglVerticesMode mode,
+ int first_vertex,
+ int n_vertices,
+ CoglIndices *indices,
+ CoglAttribute **attributes,
+ int n_attributes,
+ CoglDrawFlags flags);
};
#endif /* __COGL_DRIVER_H */