-
Notifications
You must be signed in to change notification settings - Fork 0
/
SNIIS_C.h
45 lines (36 loc) · 1.4 KB
/
SNIIS_C.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/** @file SNIIS.h
* Basic C interface. Currently very lacking.
*/
#pragma once
#include <stdint.h>
/// -------------------------------------------------------------------------------------------------------------------
#if defined(_WIN32) || defined(USE_WINE)
#define SNIIS_SYSTEM_WINDOWS 1
#elif defined(__linux__)
#define SNIIS_SYSTEM_LINUX 1
#elif defined(__MACH__) && defined(__APPLE__)
#define SNIIS_SYSTEM_MAC 1
#else
#error Platform not implemented
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef void (*LogCallback)(const char* msg);
/// Assigns the log callback to receive occasional log messages. Can be done at any time, recommended to assign
/// even before initializing. Assign nullptr to disable logging.
void SNIIS_SetLogCallback( LogCallback callback);
/// Creates the global input instance. Returns zero if successful or non-zero on error.
/// Windows: pass the HWND window handle
/// Linux: pass the X Window handle
/// Mac OSX: pass the Cocoa window id
int SNIIS_Initialize( void* pInitArgs);
/// Shuts down the global input instance
void SNIIS_Shutdown();
/// Per-frame update cycle: does the input processing. To be called before the message loop
void SNIIS_InputSystem_Update();
/// Notifies SNIIS about focus loss/gain. Non-Zero for focus gain, zero for focus loss
void SNIIS_InputSystem_SetFocus( int pFocus);
#ifdef __cplusplus
}
#endif