From c3582b77dfc553528e49a8f3a1373a787cf64648 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Mon, 22 Nov 2010 18:32:43 +0000 Subject: [PATCH] cogl-pipeline: Add getters for the alpha test state This adds two public functions: cogl_pipeline_get_alpha_test_function and cogl_pipeline_get_alpha_test_reference. --- clutter/cogl/cogl/cogl-pipeline.c | 25 +++++++++++++++++++++++++ clutter/cogl/cogl/cogl-pipeline.h | 22 ++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/clutter/cogl/cogl/cogl-pipeline.c b/clutter/cogl/cogl/cogl-pipeline.c index 712bde3ce..e04ff9cfb 100644 --- a/clutter/cogl/cogl/cogl-pipeline.c +++ b/clutter/cogl/cogl/cogl-pipeline.c @@ -3920,6 +3920,31 @@ cogl_pipeline_set_alpha_test_function (CoglPipeline *pipeline, _cogl_pipeline_set_alpha_test_function_reference (pipeline, alpha_reference); } +CoglPipelineAlphaFunc +cogl_pipeline_get_alpha_test_function (CoglPipeline *pipeline) +{ + CoglPipeline *authority; + + g_return_val_if_fail (cogl_is_pipeline (pipeline), 0); + + authority = + _cogl_pipeline_get_authority (pipeline, COGL_PIPELINE_STATE_ALPHA_FUNC); + + return authority->big_state->alpha_state.alpha_func; +} + +float +cogl_pipeline_get_alpha_test_reference (CoglPipeline *pipeline) +{ + CoglPipeline *authority; + + g_return_val_if_fail (cogl_is_pipeline (pipeline), 0.0f); + + authority = + _cogl_pipeline_get_authority (pipeline, + COGL_PIPELINE_STATE_ALPHA_FUNC_REFERENCE); + + return authority->big_state->alpha_state.alpha_func_reference; } GLenum diff --git a/clutter/cogl/cogl/cogl-pipeline.h b/clutter/cogl/cogl/cogl-pipeline.h index 57ce83ec0..dea3ac005 100644 --- a/clutter/cogl/cogl/cogl-pipeline.h +++ b/clutter/cogl/cogl/cogl-pipeline.h @@ -475,6 +475,28 @@ cogl_pipeline_set_alpha_test_function (CoglPipeline *pipeline, CoglPipelineAlphaFunc alpha_func, float alpha_reference); +/** + * cogl_pipeline_get_alpha_test_function: + * @pipeline: A #CoglPipeline object + * + * Return value: The alpha test function of @pipeline. + * + * Since: 2.0 + */ +CoglPipelineAlphaFunc +cogl_pipeline_get_alpha_test_function (CoglPipeline *pipeline); + +/** + * cogl_pipeline_get_alpha_test_reference: + * @pipeline: A #CoglPipeline object + * + * Return value: The alpha test reference value of @pipeline. + * + * Since: 2.0 + */ +float +cogl_pipeline_get_alpha_test_reference (CoglPipeline *pipeline); + /** * cogl_pipeline_set_blend: * @pipeline: A #CoglPipeline object