qmlfrontend/flib.h
author unc0rr
Tue, 02 Jan 2018 23:45:18 +0100
branchqmlfrontend
changeset 12876 b544bbbd0696
parent 12861 488782d9aba9
child 12883 adb1fccc706a
permissions -rw-r--r--
Break engine completely and make it render in frontend window (no actual rendering yet, just white screen)

#ifndef FLIB_H
#define FLIB_H

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

enum MessageType {
    MSG_PREVIEW,
    MSG_PREVIEWHOGCOUNT,
    MSG_TONET,
    MSG_GAMEFINISHED,
};

typedef union string255_ {
    struct {
        unsigned char s[256];
    };
    struct {
        unsigned char len;
        unsigned char str[255];
    };
} string255;

typedef void RunEngine_t(int argc, const char** argv);
typedef void GameTick_t(uint32_t time_delta);
typedef void ipcToEngineRaw_t(const char* msg, uint32_t len);
typedef void ipcSetEngineBarrier_t();
typedef void ipcRemoveBarrierFromEngineQueue_t();

typedef void registerUIMessagesCallback_t(void* context, void (*)(void* context, MessageType mt, const char* msg, uint32_t len));
typedef void flibInit_t(const char* localPrefix, const char* userPrefix);
typedef void flibFree_t();
typedef void passFlibEvent_t(const char* data);

#ifdef __cplusplus
}
#endif

#endif // FLIB_H