qmlfrontend/engine_interface.h
author nemo
Mon, 14 Jan 2019 15:11:15 -0500
branch0.9.25
changeset 14594 9c03b3cd6d16
parent 14303 00b56ec8b7df
child 14375 ef2fc0210362
permissions -rw-r--r--
just focus on the unsafe deletes in a hopefully branch-safe fashion
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14159
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
     1
#ifndef ENGINE_H
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
     2
#define ENGINE_H
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
     3
14276
1aac8a62be6f Implement send_ipc and read_ipc in engine lib, send_ipc in frontend
unC0Rr
parents: 14159
diff changeset
     4
#include <stddef.h>
14159
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
     5
#include <stdint.h>
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
     6
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
     7
#ifdef __cplusplus
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
     8
namespace Engine {
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
     9
extern "C" {
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    10
#endif
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    11
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    12
typedef struct _EngineInstance EngineInstance;
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    13
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    14
typedef struct {
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    15
  uint32_t width;
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    16
  uint32_t height;
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    17
  uint8_t hedgehogs_number;
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    18
  unsigned char* land;
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    19
} PreviewInfo;
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    20
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    21
typedef uint32_t protocol_version_t();
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    22
typedef EngineInstance* start_engine_t();
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    23
typedef void generate_preview_t(EngineInstance* engine_state,
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    24
                                PreviewInfo* preview);
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    25
typedef void cleanup_t(EngineInstance* engine_state);
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    26
14276
1aac8a62be6f Implement send_ipc and read_ipc in engine lib, send_ipc in frontend
unC0Rr
parents: 14159
diff changeset
    27
typedef void send_ipc_t(EngineInstance* engine_state, uint8_t* buf,
1aac8a62be6f Implement send_ipc and read_ipc in engine lib, send_ipc in frontend
unC0Rr
parents: 14159
diff changeset
    28
                        size_t size);
1aac8a62be6f Implement send_ipc and read_ipc in engine lib, send_ipc in frontend
unC0Rr
parents: 14159
diff changeset
    29
typedef size_t read_ipc_t(EngineInstance* engine_state, uint8_t* buf,
1aac8a62be6f Implement send_ipc and read_ipc in engine lib, send_ipc in frontend
unC0Rr
parents: 14159
diff changeset
    30
                          size_t size);
1aac8a62be6f Implement send_ipc and read_ipc in engine lib, send_ipc in frontend
unC0Rr
parents: 14159
diff changeset
    31
14299
21be7838a127 Add advance_simulation() function to engine lib, some WIP on frontend
unc0rr
parents: 14276
diff changeset
    32
typedef void setup_current_gl_context_t(EngineInstance* engine_state,
21be7838a127 Add advance_simulation() function to engine lib, some WIP on frontend
unc0rr
parents: 14276
diff changeset
    33
                                        uint16_t width, uint16_t height,
14303
00b56ec8b7df Pass opengl context to engine
unC0Rr
parents: 14299
diff changeset
    34
                                        void (*(const char*))());
14299
21be7838a127 Add advance_simulation() function to engine lib, some WIP on frontend
unc0rr
parents: 14276
diff changeset
    35
typedef void render_frame_t(EngineInstance* engine_state);
21be7838a127 Add advance_simulation() function to engine lib, some WIP on frontend
unc0rr
parents: 14276
diff changeset
    36
21be7838a127 Add advance_simulation() function to engine lib, some WIP on frontend
unc0rr
parents: 14276
diff changeset
    37
typedef bool advance_simulation_t(EngineInstance* engine_state, uint32_t ticks);
21be7838a127 Add advance_simulation() function to engine lib, some WIP on frontend
unc0rr
parents: 14276
diff changeset
    38
14159
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    39
extern protocol_version_t* protocol_version;
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    40
extern start_engine_t* start_engine;
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    41
extern generate_preview_t* generate_preview;
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    42
extern cleanup_t* cleanup;
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    43
14276
1aac8a62be6f Implement send_ipc and read_ipc in engine lib, send_ipc in frontend
unC0Rr
parents: 14159
diff changeset
    44
extern send_ipc_t* send_ipc;
1aac8a62be6f Implement send_ipc and read_ipc in engine lib, send_ipc in frontend
unC0Rr
parents: 14159
diff changeset
    45
extern read_ipc_t* read_ipc;
1aac8a62be6f Implement send_ipc and read_ipc in engine lib, send_ipc in frontend
unC0Rr
parents: 14159
diff changeset
    46
14299
21be7838a127 Add advance_simulation() function to engine lib, some WIP on frontend
unc0rr
parents: 14276
diff changeset
    47
extern setup_current_gl_context_t* setup_current_gl_context;
21be7838a127 Add advance_simulation() function to engine lib, some WIP on frontend
unc0rr
parents: 14276
diff changeset
    48
extern render_frame_t* render_frame;
21be7838a127 Add advance_simulation() function to engine lib, some WIP on frontend
unc0rr
parents: 14276
diff changeset
    49
extern advance_simulation_t* advance_simulation;
21be7838a127 Add advance_simulation() function to engine lib, some WIP on frontend
unc0rr
parents: 14276
diff changeset
    50
14159
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    51
#ifdef __cplusplus
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    52
}
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    53
};
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    54
#endif
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    55
8354b390f1a2 Some refactoring of qmlfrontend. It now shows land preview generated by hedgewars-engine
unC0Rr
parents:
diff changeset
    56
#endif  // ENGINE_H