gpu_set_cullmode


描述

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):


语法:

gpu_set_cullmode(cullmode);


参数:

参数 描述
cullmode The cull mode to use (see list above)


返回:

N/A(无返回值)


例如:

if gpu_get_cullmode() != cull_clockwise
   {
   gpu_set_cullmode(cull_clockwise);
   }

The above code gets the current cull mode and if it is not cull_clockwise it is set to that constant.


上一页: GPU Functions
下一页: gpu_set_blendmode
© Copyright YoYo Games Ltd. 2018 All Rights Reserved