IInput: Difference between revisions
Jump to navigation
Jump to search
(Creation) |
m (Added categories) |
||
Line 17: | Line 17: | ||
* in_camera.cpp | * in_camera.cpp | ||
* in_joystick.cpp | * in_joystick.cpp | ||
[[Category:Programming]][[Category:Interfaces]] |
Revision as of 15:29, 22 January 2009
This interface is used by the Source Engine to access input functionality that must be implemented in game code. This class handles mouse and joystick input, keeps track of and modifies key "button" state, and completely controls the position of the camera. The file iinput.h should remain unedited as the engine expects to find the IInput interface as it is currently presented in iinput.h. To implement IInput the game code creates a new class inheriting IInput, and exposing it to engine:
class CMyInput : public CInput { public: }; static CMyInput g_Input; // Expose this interface IInput *input = ( IInput * )&g_Input;
The easiest way to implement this interface is by starting with and modifying the preexisting class CInput. CInput is declared in input.h and is implemented in:
- in_main.cpp
- in_mouse.cpp
- in_camera.cpp
- in_joystick.cpp