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.
This commit is contained in:
Neil Roberts 2010-11-22 18:32:43 +00:00
parent 959846326f
commit c3582b77df
2 changed files with 47 additions and 0 deletions

View File

@ -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

View File

@ -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