123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- #ifndef CORE_WINDOW_MANAGER_H
- #define CORE_WINDOW_MANAGER_H
- #include <core/Vector.h>
- typedef bool (*CoreWindowRunHandler)(void* data);
- typedef void (*CoreWindowTickHandler)(void* data);
- typedef void (*CoreWindowRenderHandler)(void* data, float lag);
- typedef struct {
- CoreIntVector2 size;
- bool fullscreen;
- const char* name;
- } CoreWindowOptions;
- bool coreOpenWindow(const CoreWindowOptions* options);
- void coreCloseWindow(void);
- void coreShowWindow(void);
- void coreTrapWindowCursor(void);
- void coreFreeWindowCursor(void);
- bool coreIsWindowCursorTrapped(void);
- const CoreIntVector2* coreGetWindowSize(void);
- bool coreHasWindowSizeChanged(void);
- bool coreShouldWindowClose(void);
- void coreSetWindowRunHandler(CoreWindowRunHandler wr, void* data);
- void coreSetWindowTickHandler(CoreWindowTickHandler t, void* data);
- void coreSetWindowRenderHandler(CoreWindowRenderHandler r, void* data);
- void coreSetWindowNanosPerTick(i64 nanos);
- void coreRunWindow(void);
- float coreGetWindowTicksPerSecond(void);
- float coreGetWindowFramesPerSecond(void);
- void coreSetInputLimit(size_t limit);
- void coreResetInput(void);
- void coreEnableInput(void);
- void coreDisableInput(void);
- bool coreIsInputEnabled(void);
- void coreFillInput(const char* s);
- size_t coreGetInputCursor(void);
- void coreSetInputCursor(size_t index);
- const char* coreGetInputString(void);
- typedef size_t CoreButton;
- CoreButton coreAddButton(const char* name);
- void coreBindKeyToButton(CoreButton b, int key);
- void coreBindGamepadToButton(CoreButton b, int gamepadButton);
- void coreBindMouseToButton(CoreButton b, int mouseButton);
- CoreVector2 coreGetLastMousePosition(void);
- CoreVector2 coreGetMousePosition(void);
- CoreVector2 coreGetLeftGamepadAxis(void);
- CoreVector2 coreGetRightGamepadAxis(void);
- float coreGetLeftGamepadTrigger(void);
- float coreGetRightGamepadTrigger(void);
- bool coreIsButtonDown(CoreButton b);
- int coreGetButtonDownTime(CoreButton b);
- bool coreWasButtonReleased(CoreButton b);
- const char* coreGetButtonName(CoreButton b);
- #ifdef IMPORT_CORE
- #define WindowRunHandler CoreWindowRunHandler
- #define WindowTickHandler CoreWindowTickHandler
- #define WindowRenderHandler CoreWindowRenderHandler
- #define WindowOptions CoreWindowOptions
- #define openWindow coreOpenWindow
- #define closeWindow coreCloseWindow
- #define showWindow coreShowWindow
- #define trapWindowCursor coreTrapWindowCursor
- #define freeWindowCursor coreFreeWindowCursor
- #define isWindowCursorTrapped coreIsWindowCursorTrapped
- #define getWindowSize coreGetWindowSize
- #define hasWindowSizeChanged coreHasWindowSizeChanged
- #define shouldWindowClose coreShouldWindowClose
- #define setWindowRunHandler coreSetWindowRunHandler
- #define setWindowTickHandler coreSetWindowTickHandler
- #define setWindowRenderHandler coreSetWindowRenderHandler
- #define setWindowNanosPerTick coreSetWindowNanosPerTick
- #define runWindow coreRunWindow
- #define getWindowTicksPerSecond coreGetWindowTicksPerSecond
- #define getWindowFramesPerSecond coreGetWindowFramesPerSecond
- #define setInputLimit coreSetInputLimit
- #define resetInput coreResetInput
- #define enableInput coreEnableInput
- #define disableInput coreDisableInput
- #define isInputEnabled coreIsInputEnabled
- #define fillInput coreFillInput
- #define getInputCursor coreGetInputCursor
- #define setInputCursor coreSetInputCursor
- #define getInputString coreGetInputString
- #define Button CoreButton
- #define addButton coreAddButton
- #define bindKeyToButton coreBindKeyToButton
- #define bindGamepadToButton coreBindGamepadToButton
- #define bindMouseToButton coreBindMouseToButton
- #define getLastMousePosition coreGetLastMousePosition
- #define getMousePosition coreGetMousePosition
- #define getLeftGamepadAxis coreGetLeftGamepadAxis
- #define getRightGamepadAxis coreGetRightGamepadAxis
- #define getLeftGamepadTrigger coreGetLeftGamepadTrigger
- #define getRightGamepadTrigger coreGetRightGamepadTrigger
- #define isButtonDown coreIsButtonDown
- #define getButtonDownTime coreGetButtonDownTime
- #define wasButtonReleased coreWasButtonReleased
- #define getButtonName coreGetButtonName
- #endif
- #endif
|