Skip to content

Commit 8050f8b

Browse files
committed
document generateshader()
1 parent f9c1dce commit 8050f8b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/engine/render/shader.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,22 @@ extern Shader *lookupshaderbyname(std::string_view name);
6363
* @return pointer to a Shader object corresponding to the name passed
6464
*/
6565
extern Shader *useshaderbyname(std::string_view name);
66+
67+
/**
68+
* @brief Creates a shader and adds it to the shaders map, if one with this key does not exist.
69+
*
70+
* If there is already a shader in the shaders map with the key associated with `name`,
71+
* returns a pointer to that shader and does not construct a new one.
72+
*
73+
* If no such shader exists in `shaders`, creates a new shader by executing in
74+
* Cubescript the passed chain of variadic arguments. The expected format is similar
75+
* to that of printf, with the first parameter being the string and following parameters
76+
* being values inserted into format specifiers (e.g. %f or %d).
77+
*
78+
* @param name the key to associate with the shader object
79+
* @param cmd the command to execute
80+
* @param ... values to insert into format specifiers in cmd
81+
*/
6682
extern Shader *generateshader(std::string_view name, const char *cmd, ...);
6783

6884
/**

0 commit comments

Comments
 (0)