Skip to content

cf_make_draw_shader

Category: draw
GitHub: cute_draw.h


Creates a custom draw shader.

CF_Shader cf_make_draw_shader(const char* path);

Remarks

Your shader must be written in GLSL 450, and must follow some specific rules to be compatible with the draw API. For more in-depth explanations, see CF's docs on Draw Shaders. Make sure to call cf_shader_directory first. If you use custom SDF shapes, register them all via cf_make_custom_shape before creating draw shaders -- a draw shader bakes in the set of custom shapes that exist when it compiles, so shapes registered afterwards render invisibly under it.

CF_Shader
cf_draw_push_shader
cf_draw_pop_shader
cf_draw_peek_shader
cf_make_draw_shader_from_source
cf_make_custom_shape