2022-04-06 18:29:32 +00:00
|
|
|
/* date = March 30th 2022 9:23 am */
|
|
|
|
|
|
|
|
#ifndef LUMENARIUM_ENGINE_OUTPUT_H
|
|
|
|
#define LUMENARIUM_ENGINE_OUTPUT_H
|
|
|
|
|
|
|
|
typedef u8 Output_Data_Kind;
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
OutputData_Invalid = 0,
|
|
|
|
OutputData_NetworkSACN,
|
|
|
|
OutputData_ComUART,
|
|
|
|
OutputData_Count,
|
|
|
|
};
|
|
|
|
|
2022-04-16 11:00:32 +00:00
|
|
|
typedef struct Output_Data_Network Output_Data_Network;
|
2022-04-06 18:29:32 +00:00
|
|
|
struct Output_Data_Network
|
|
|
|
{
|
|
|
|
// Platform_Socket_Handle socket;
|
|
|
|
u32 v4_addr;
|
|
|
|
u32 port;
|
|
|
|
};
|
|
|
|
|
2022-04-16 11:00:32 +00:00
|
|
|
typedef struct Output_Data_Com Output_Data_Com;
|
2022-04-06 18:29:32 +00:00
|
|
|
struct Output_Data_Com
|
|
|
|
{
|
|
|
|
String port;
|
|
|
|
};
|
|
|
|
|
2022-04-16 11:00:32 +00:00
|
|
|
typedef struct Output_Data Output_Data;
|
2022-04-06 18:29:32 +00:00
|
|
|
struct Output_Data
|
|
|
|
{
|
|
|
|
Output_Data_Kind kind;
|
|
|
|
union
|
|
|
|
{
|
|
|
|
Output_Data_Network network;
|
|
|
|
Output_Data_Com com;
|
|
|
|
};
|
|
|
|
Data data;
|
|
|
|
|
|
|
|
Output_Data* next;
|
|
|
|
};
|
|
|
|
|
2022-04-16 11:00:32 +00:00
|
|
|
typedef struct Output_Data_Queue Output_Data_Queue;
|
2022-04-06 18:29:32 +00:00
|
|
|
struct Output_Data_Queue
|
|
|
|
{
|
|
|
|
Output_Data* first;
|
|
|
|
Output_Data* last;
|
|
|
|
u32 len;
|
|
|
|
Allocator* a;
|
|
|
|
};
|
|
|
|
|
2022-04-22 18:57:52 +00:00
|
|
|
typedef void Output_Method_Update(u8* method_data);
|
|
|
|
typedef void Build_Output_Data_Buffer(App_State* state, u32 assembly_id, Assembly_Pixel_Buffer* pixels, Assembly_Strip* strip, u8* method_data, Output_Data_Queue* queue);
|
2022-04-06 18:29:32 +00:00
|
|
|
|
2022-04-16 11:00:32 +00:00
|
|
|
typedef struct Output_Methods Output_Methods;
|
2022-04-06 18:29:32 +00:00
|
|
|
struct Output_Methods
|
|
|
|
{
|
2022-04-22 18:57:52 +00:00
|
|
|
Output_Method_Update* update_procs[OutputData_Count];
|
2022-04-06 18:29:32 +00:00
|
|
|
Build_Output_Data_Buffer* procs[OutputData_Count];
|
|
|
|
u8* method_data[OutputData_Count];
|
|
|
|
};
|
|
|
|
|
2022-04-16 11:00:32 +00:00
|
|
|
typedef struct Output Output;
|
2022-04-06 18:29:32 +00:00
|
|
|
struct Output
|
|
|
|
{
|
|
|
|
Output_Methods methods;
|
|
|
|
};
|
|
|
|
|
2022-04-22 18:57:52 +00:00
|
|
|
internal void register_output_method(Output* output, Output_Data_Kind kind, Output_Method_Update* update, Build_Output_Data_Buffer* proc, u8* method_data);
|
2022-04-06 18:29:32 +00:00
|
|
|
|
|
|
|
internal Output_Data* output_data_queue_push(Output_Data_Queue* q, u32 size, Output_Data_Kind kind);
|
|
|
|
|
|
|
|
internal void output_data_set_network_addr(Output_Data* d, u32 send_addr, u32 port);
|
|
|
|
|
|
|
|
#endif //LUMENARIUM_ENGINE_OUTPUT_H
|