mirror of
https://github.com/brl/mutter.git
synced 2024-11-10 07:56:14 -05:00
cogl-material: Don't use the symbol 'near'
The window headers contain the line #define near so it's not possible to use the symbol 'near' in code that's portable to Windows. This replaces it with 'near_val'. I think the define is meant to improve compatibility with code written for Windows 3.1 where near would be a keyword to make it a smaller pointer size.
This commit is contained in:
parent
7cd5908ef0
commit
f95cdfc11e
@ -4129,8 +4129,8 @@ cogl_material_get_depth_test_function (CoglHandle handle)
|
||||
|
||||
gboolean
|
||||
cogl_material_set_depth_range (CoglHandle handle,
|
||||
float near,
|
||||
float far,
|
||||
float near_val,
|
||||
float far_val,
|
||||
GError **error)
|
||||
{
|
||||
#ifndef COGL_HAS_GLES
|
||||
@ -4144,8 +4144,8 @@ cogl_material_set_depth_range (CoglHandle handle,
|
||||
authority = _cogl_material_get_authority (material, state);
|
||||
|
||||
depth_state = &authority->big_state->depth_state;
|
||||
if (depth_state->depth_range_near == near &&
|
||||
depth_state->depth_range_far == far)
|
||||
if (depth_state->depth_range_near == near_val &&
|
||||
depth_state->depth_range_far == far_val)
|
||||
return TRUE;
|
||||
|
||||
/* - Flush journal primitives referencing the current state.
|
||||
@ -4155,8 +4155,8 @@ cogl_material_set_depth_range (CoglHandle handle,
|
||||
*/
|
||||
_cogl_material_pre_change_notify (material, state, NULL);
|
||||
|
||||
material->big_state->depth_state.depth_range_near = near;
|
||||
material->big_state->depth_state.depth_range_far = far;
|
||||
material->big_state->depth_state.depth_range_near = near_val;
|
||||
material->big_state->depth_state.depth_range_far = far_val;
|
||||
|
||||
_cogl_material_update_authority (material, authority, state,
|
||||
_cogl_material_depth_state_equal);
|
||||
@ -4172,8 +4172,8 @@ cogl_material_set_depth_range (CoglHandle handle,
|
||||
|
||||
void
|
||||
cogl_material_get_depth_range (CoglHandle handle,
|
||||
float *near,
|
||||
float *far)
|
||||
float *near_val,
|
||||
float *far_val)
|
||||
{
|
||||
CoglMaterial *material = COGL_MATERIAL (handle);
|
||||
CoglMaterial *authority;
|
||||
@ -4183,8 +4183,8 @@ cogl_material_get_depth_range (CoglHandle handle,
|
||||
authority =
|
||||
_cogl_material_get_authority (material, COGL_MATERIAL_STATE_DEPTH);
|
||||
|
||||
*near = authority->big_state->depth_state.depth_range_near;
|
||||
*far = authority->big_state->depth_state.depth_range_far;
|
||||
*near_val = authority->big_state->depth_state.depth_range_near;
|
||||
*far_val = authority->big_state->depth_state.depth_range_far;
|
||||
}
|
||||
|
||||
unsigned long
|
||||
|
@ -1094,9 +1094,9 @@ cogl_material_get_depth_test_function (CoglHandle handle);
|
||||
/**
|
||||
* cogl_material_set_depth_range:
|
||||
* @handle: A CoglMaterial handle
|
||||
* @near: The near component of the desired depth range which will be
|
||||
* @near_val: The near component of the desired depth range which will be
|
||||
* clamped to the range [0, 1]
|
||||
* @far: The far component of the desired depth range which will be
|
||||
* @far_val: The far component of the desired depth range which will be
|
||||
* clamped to the range [0, 1]
|
||||
* @error: location to store an error of type #CoglError
|
||||
*
|
||||
@ -1128,15 +1128,15 @@ cogl_material_get_depth_test_function (CoglHandle handle);
|
||||
*/
|
||||
gboolean
|
||||
cogl_material_set_depth_range (CoglHandle handle,
|
||||
float near,
|
||||
float far,
|
||||
float near_val,
|
||||
float far_val,
|
||||
GError **error);
|
||||
|
||||
/**
|
||||
* cogl_material_get_depth_range_mapping:
|
||||
* @handle: A CoglMaterial handle
|
||||
* @near: A pointer to store the near component of the depth range
|
||||
* @far: A pointer to store the far component of the depth range
|
||||
* @near_val: A pointer to store the near component of the depth range
|
||||
* @far_val: A pointer to store the far component of the depth range
|
||||
*
|
||||
* Gets the current range to which normalized depth values are mapped
|
||||
* before writing to the depth buffer. This corresponds to the range
|
||||
@ -1146,8 +1146,8 @@ cogl_material_set_depth_range (CoglHandle handle,
|
||||
*/
|
||||
void
|
||||
cogl_material_get_depth_range (CoglHandle handle,
|
||||
float *near,
|
||||
float *far);
|
||||
float *near_val,
|
||||
float *far_val);
|
||||
|
||||
#endif /* COGL_ENABLE_EXPERIMENTAL_API */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user