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
(The numbering for EXT_BITSHIFT and FTE_STRINGS was wrong (at least according to the pages for EXT_BITSHIFT and FTE_STRINGS).) |
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. |
+ | returntype(datatype param1) functionname = #[number]; | ||
+ | [number] 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; | ||
+ | since the corresponding internal function is at index 1 within the table. | ||
===See Also=== | ===See Also=== |
Revision as of 01:56, 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 = #[number];
[number] 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.