summaryrefslogtreecommitdiff
path: root/cogl/cogl-attribute-private.h
diff options
context:
space:
mode:
authorRobert Bragg <robert@linux.intel.com>2012-01-08 02:59:04 +0000
committerRobert Bragg <robert@linux.intel.com>2012-02-09 13:09:15 +0000
commit92c306301492a619037a8d13c8da8e4c5c1ebf94 (patch)
tree138ca612fe2376d2fa281ecc63dd8a2025e5be28 /cogl/cogl-attribute-private.h
parent0365f6cda3df89335d243548053d85aaf66f1630 (diff)
downloadcogl-92c306301492a619037a8d13c8da8e4c5c1ebf94.tar.gz
framebuffer: Add cogl_framebuffer draw methods
This adds cogl_framebuffer_ apis for drawing attributes and primitives that replace corresponding apis that depend on the default CoglContext. This is part of the on going effort to adapt the Cogl api so it no longer depends on a global context variable. All the new drawing functions also take an explicit pipeline argument since we are also aiming to avoid being a stateful api like Cairo and OpenGL. Being stateless makes it easier for orthogonal components to share access to the GPU. Being stateless should also minimize any impedance miss-match for those wanting to build higher level stateless apis on top of Cogl. Note: none of the legacy, global state options such as cogl_set_depth_test_enabled(), cogl_set_backface_culling_enabled() or cogl_program_use() are supported by these new drawing apis and if set will simply be silently ignored. Reviewed-by: Neil Roberts <neil@linux.intel.com>
Diffstat (limited to 'cogl/cogl-attribute-private.h')
-rw-r--r--cogl/cogl-attribute-private.h25
1 files changed, 8 insertions, 17 deletions
diff --git a/cogl/cogl-attribute-private.h b/cogl/cogl-attribute-private.h
index 68ed52d0..d977376f 100644
--- a/cogl/cogl-attribute-private.h
+++ b/cogl/cogl-attribute-private.h
@@ -69,13 +69,14 @@ typedef enum
COGL_DRAW_SKIP_JOURNAL_FLUSH = 1 << 0,
COGL_DRAW_SKIP_PIPELINE_VALIDATION = 1 << 1,
COGL_DRAW_SKIP_FRAMEBUFFER_FLUSH = 1 << 2,
+ COGL_DRAW_SKIP_LEGACY_STATE = 1 << 3,
/* By default the vertex attribute drawing code will assume that if
there is a color attribute array enabled then we can't determine
if the colors will be opaque so we need to enabling
blending. However when drawing from the journal we know what the
contents of the color array is so we can override this by passing
this flag. */
- COGL_DRAW_COLOR_ATTRIBUTE_IS_OPAQUE = 1 << 3
+ COGL_DRAW_COLOR_ATTRIBUTE_IS_OPAQUE = 1 << 4
} CoglDrawFlags;
/* During CoglContext initialization we register the "cogl_color_in"
@@ -95,24 +96,14 @@ void
_cogl_attribute_immutable_unref (CoglAttribute *attribute);
void
-_cogl_draw_attributes (CoglVerticesMode mode,
- int first_vertex,
- int n_vertices,
- CoglAttribute **attributes,
- int n_attributes,
- CoglDrawFlags flags);
-
-void
-_cogl_draw_indexed_attributes (CoglVerticesMode mode,
- int first_vertex,
- int n_vertices,
- CoglIndices *indices,
- CoglAttribute **attributes,
- int n_attributes,
- CoglDrawFlags flags);
+_cogl_attribute_disable_cached_arrays (void);
void
-_cogl_attribute_disable_cached_arrays (void);
+_cogl_flush_attributes_state (CoglFramebuffer *framebuffer,
+ CoglPipeline *pipeline,
+ CoglDrawFlags flags,
+ CoglAttribute **attributes,
+ int n_attributes);
#endif /* __COGL_ATTRIBUTE_PRIVATE_H */