Category:Interfaces: Difference between revisions
Jump to navigation
Jump to search
Warning:Never, ever modify an interface class itself. You should always inherit then cast back.
mNo edit summary |
TomEdwards (talk | contribs) (explained interfaces) |
||
| Line 1: | Line 1: | ||
'''[[Wikipedia:Interface (computer science)|Interfaces]]''' are important C++ classes that are accessed by the engine. To use an interface you create or modify an inherited class, then cast back to the interface class in a global [[pointer]] with a predefined name. | |||
{{warning|'''''Never, ever''''' modify an interface class itself. You should always inherit then cast back.}} | |||
== Example == | |||
<source lang=cpp>IInput* input = new CInput;</source> | |||
This creates the <code>[[IInput]]* input</code> object the engine expects, placing behind it Valve's basic input code from <code>[[CInput]]</code>. | |||
You are free to modify <code>CInput</code> or to create your own inherited class and use that instead; just remember that only the members of <code>IInput</code> are known to the engine. | |||
[[Category:Programming]] | [[Category:Programming]] | ||
Revision as of 13:45, 2 August 2009
Interfaces are important C++ classes that are accessed by the engine. To use an interface you create or modify an inherited class, then cast back to the interface class in a global pointer with a predefined name.
Example
IInput* input = new CInput;
This creates the IInput* input object the engine expects, placing behind it Valve's basic input code from CInput.
You are free to modify CInput or to create your own inherited class and use that instead; just remember that only the members of IInput are known to the engine.
Subcategories
This category has the following 5 subcategories, out of 5 total.
I
- IScheme (1 P)
- ISchemeManager (1 P)
- ISystem (1 P)
- ITextureRegenerator (2 P)
Pages in category "Interfaces"
The following 26 pages are in this category, out of 26 total.