This function can be used to set the backface culling mode. A polygon (primitive) has a front and a back side. The front side is said to be the side where the vertices are defined in counter-clockwise order. Normally both sides are drawn, but if you make a closed shape (like a pyramid) then this is a waste of processing power because the back side of the triangle can never be seen. It's in these cases that you can switch on backface culling, as this saves about half the amount of drawing time, although it means you have the task of defining your polygons in the correct way to prevent issues.
The cull mode value used must be one of the following constants (the default value is cull_noculling):
- cull_noculling - No culling will be done
- cull_clockwise - All clockwise triangles will be culled
- cull_counterclockwise - all counter-clockwise triangles will be culled
|cullmode||The cull mode to use (see list above)|
if gpu_get_cullmode() != cull_clockwise
The above code gets the current cull mode and if it is not cull_clockwise it is set to that constant.