8#ifndef SH_SHARED_HOST_H
9#define SH_SHARED_HOST_H
18#pragma warning (disable: 4005 4996 4113)
33#define shLoadShared(path) LoadLibrary(path)
44#define shSharedLoadSymbol(handle, symbol) GetProcAddress(handle, symbol)
53#define shSharedFree(handle) FreeLibrary(handle)
66#define shLoadShared(path) dlopen(path, RTLD_LAZY)
77#define shSharedLoadSymbol(handle, symbol) dlsym(handle, symbol)
86#define shSharedFree(handle) dlclose(handle)
140#define shSharedHostError(condition, msg, failure_expression)\
141 if ((int)(condition)) { printf("shsharedhost error: %s\n", msg); failure_expression; }
173 const char* shared_name,
175 const char* s_update,
176 const char* s_main_cmd_buffer,
177 const char* s_main_renderpass,
178 const char* s_frame_resize,
190#define shSharedRelease(p_shared)\
191 if ((p_shared) != NULL) { if (*(p_shared) != NULL) { shSharedFree(*(p_shared)); *(p_shared) = NULL; } }
uint64_t() ShApplicationThreadFunc(void *)
Represents the function signature for a thread within the application.
Definition shApplicationHost.h:115
uint8_t shGetSharedApplication(const char *shared_name, const char *s_start, const char *s_update, const char *s_main_cmd_buffer, const char *s_main_renderpass, const char *s_frame_resize, const char *s_close, ShApplicationHost *p_application)
Retrieves the shared application information.
Definition shApplicationHost.c:27
uint8_t() ShApplicationFunc(void *)
Represents the function signature for the application's main function.
Definition shApplicationHost.h:106
void * ShSharedHandle
Represents a handle to a loaded shared library.
Definition shApplicationHost.h:97
uint64_t shApplicationRun(void *p_engine, ShApplicationFunc *p_func)
Runs a shared application.
Definition shApplicationHost.c:18
Represents the host for a shared application.
Definition shApplicationHost.h:121
ShSharedHandle shared
Definition shApplicationHost.h:122
ShApplicationFunc * p_close
Definition shApplicationHost.h:128
ShApplicationFunc * p_update
Definition shApplicationHost.h:124
ShApplicationFunc * p_frame_resize
Definition shApplicationHost.h:127
ShApplicationFunc * p_main_cmd_buffer
Definition shApplicationHost.h:125
ShApplicationFunc * p_start
Definition shApplicationHost.h:123
ShApplicationFunc * p_main_renderpass
Definition shApplicationHost.h:126