Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!
Difference between revisions of "List of builtin functions"
From Quake Wiki
m |
m |
||
Line 1: | Line 1: | ||
Builtin functions are functions in QuakeC that perform a callback to a function within the engine itself. This was done to improve performance as some tasks were too expensive to do within QuakeC itself. They're declared by creating a function prototype and assigning it to an index within the internal builtin table. | Builtin functions are functions in QuakeC that perform a callback to a function within the engine itself. This was done to improve performance as some tasks were too expensive to do within QuakeC itself. They're declared by creating a function prototype and assigning it to an index within the internal builtin table. | ||
− | returntype(datatype param1) functionname = #[ | + | returntype(datatype param1) functionname = #[index]; |
− | [ | + | [index] in this case is the actual index of the function within the builtin table. This is not exposed to QuakeC at all so validation must be done by checking the table within the engine itself. For instance, <code>makevectors()</code> is defined as |
void(vector ang) makevectors = #1; | void(vector ang) makevectors = #1; | ||
since the corresponding internal function is at index 1 within the table. | since the corresponding internal function is at index 1 within the table. |
Revision as of 12:53, 31 July 2023
Builtin functions are functions in QuakeC that perform a callback to a function within the engine itself. This was done to improve performance as some tasks were too expensive to do within QuakeC itself. They're declared by creating a function prototype and assigning it to an index within the internal builtin table.
returntype(datatype param1) functionname = #[index];
[index] in this case is the actual index of the function within the builtin table. This is not exposed to QuakeC at all so validation must be done by checking the table within the engine itself. For instance, makevectors()
is defined as
void(vector ang) makevectors = #1;
since the corresponding internal function is at index 1 within the table.