Cleanup: GPU: Encapsulate glFrontFace

This commit is contained in:
Clément Foucault 2020-07-17 20:13:11 +02:00
parent 5993c53a6d
commit 264b1e1e15
3 changed files with 7 additions and 1 deletions

View File

@ -126,7 +126,7 @@ void ED_draw_object_facemap(Depsgraph *depsgraph,
}
}
glFrontFace((ob->transflag & OB_NEG_SCALE) ? GL_CW : GL_CCW);
GPU_front_facing(ob->transflag & OB_NEG_SCALE);
/* Just to create the data to pass to immediate mode, grr! */
const int *facemap_data = CustomData_get_layer(&me->pdata, CD_FACEMAP);

View File

@ -59,6 +59,7 @@ void GPU_blend_set_func_separate(eGPUBlendFunction src_rgb,
eGPUBlendFunction src_alpha,
eGPUBlendFunction dst_alpha);
void GPU_face_culling(eGPUFaceCull culling);
void GPU_front_facing(bool invert);
void GPU_depth_range(float near, float far);
void GPU_depth_test(bool enable);
bool GPU_depth_test_enabled(void);

View File

@ -89,6 +89,11 @@ void GPU_face_culling(eGPUFaceCull culling)
}
}
void GPU_front_facing(bool invert)
{
glFrontFace((invert) ? GL_CW : GL_CCW);
}
void GPU_depth_range(float near, float far)
{
/* glDepthRangef is only for OpenGL 4.1 or higher */