Skip to content

Input interface draft

mittorn edited this page Aug 15, 2015 · 8 revisions

Purpose

Clients have different platform-depended input code now. It is bad because we cannot use same functions (if we not rewrite almost half of SDL) on different platforms.

Client part

  • Client will have ability to fully implement touch input. Drawing may be done by HUD.
  • Client will receive basic motion and look events form engine

Client implementation

Client will optionally export some functions to Engine:

  • int IN_ClientTouchEvent ( int fingerID, float x, float y, float dx, float dy );

Return 1 if touch is active, 0 otherwise.

  • void IN_ClientMoveEvent ( float forwardmove, float sidemove );

Client wil accumulate move values before creating commands and flush it on CreateMove.

  • void IN_ClientLookEvent ( float relyaw, float relpitch ); Client will rotate camera when needed as in mouse implementation