vn/code/generated/vn_platform.meta.h

85 lines
4.0 KiB
C
Raw Normal View History

2023-07-19 15:09:41 +00:00
#define PLATFORM_RESERVE(name) void * name(u64 Size)
#define PLATFORM_RELEASE(name) void name(void *Pointer)
#define PLATFORM_COMMIT(name) void name(void *Pointer, u64 Size)
#define PLATFORM_DECOMMIT(name) void name(void *Pointer, u64 Size)
#define PLATFORM_ALLOCATE(name) void * name(u64 Size)
#define PLATFORM_DEALLOCATE(name) void name(void *Pointer)
2023-07-19 15:09:41 +00:00
#define PLATFORM_OPEN_FILE(name) platform_file_handle name(string Path, platform_access_flags FileAccess)
#define PLATFORM_CLOSE_FILE(name) void name(platform_file_handle Handle)
#define PLATFORM_READ_FILE(name) void name(platform_file_handle Handle, void *Dest, u64 Offset, u64 Size)
#define PLATFORM_WRITE_FILE(name) void name(platform_file_handle Handle, void *Source, u64 Offset, u64 Size)
#define PLATFORM_GET_FILE_SIZE(name) u64 name(platform_file_handle Handle)
#define PLATFORM_SET_CURSOR(name) void name(platform_cursor Cursor)
#define PLATFORM_TOGGLE_FULLSCREEN(name) void name(void)
#define PLATFORM_SHOW_MESSAGE(name) void name(string Message, platform_message_type Type)
#define PLATFORM_BEGIN_FILE_ITER(name) platform_file_iter * name(arena *Arena, string Path)
#define PLATFORM_ADVANCE_FILE_ITER(name) b32 name(arena *Arena, platform_file_iter *Iter, platform_file_info *OutInfo)
#define PLATFORM_END_FILE_ITER(name) void name(platform_file_iter *Iter)
2023-08-22 03:19:51 +00:00
#define PLATFORM_SET_CLIPBOARD(name) void name(string String)
#define PLATFORM_GET_CLIPBOARD(name) string name(arena *Arena)
2023-07-19 15:09:41 +00:00
typedef PLATFORM_RESERVE(platform_reserve);
typedef PLATFORM_RELEASE(platform_release);
typedef PLATFORM_COMMIT(platform_commit);
typedef PLATFORM_DECOMMIT(platform_decommit);
typedef PLATFORM_ALLOCATE(platform_allocate);
typedef PLATFORM_DEALLOCATE(platform_deallocate);
2023-07-19 15:09:41 +00:00
typedef PLATFORM_OPEN_FILE(platform_open_file);
typedef PLATFORM_CLOSE_FILE(platform_close_file);
typedef PLATFORM_READ_FILE(platform_read_file);
typedef PLATFORM_WRITE_FILE(platform_write_file);
typedef PLATFORM_GET_FILE_SIZE(platform_get_file_size);
typedef PLATFORM_SET_CURSOR(platform_set_cursor);
typedef PLATFORM_TOGGLE_FULLSCREEN(platform_toggle_fullscreen);
typedef PLATFORM_SHOW_MESSAGE(platform_show_message);
typedef PLATFORM_BEGIN_FILE_ITER(platform_begin_file_iter);
typedef PLATFORM_ADVANCE_FILE_ITER(platform_advance_file_iter);
typedef PLATFORM_END_FILE_ITER(platform_end_file_iter);
2023-08-22 03:19:51 +00:00
typedef PLATFORM_SET_CLIPBOARD(platform_set_clipboard);
typedef PLATFORM_GET_CLIPBOARD(platform_get_clipboard);
2023-07-19 15:09:41 +00:00
struct platform_api
{
platform_reserve *Reserve;
platform_release *Release;
platform_commit *Commit;
platform_decommit *Decommit;
platform_allocate *Allocate;
platform_deallocate *Deallocate;
2023-07-19 15:09:41 +00:00
platform_open_file *OpenFile;
platform_close_file *CloseFile;
platform_read_file *ReadFile;
platform_write_file *WriteFile;
platform_get_file_size *GetFileSize;
platform_set_cursor *SetCursor;
platform_toggle_fullscreen *ToggleFullscreen;
platform_show_message *ShowMessage;
platform_begin_file_iter *BeginFileIter;
platform_advance_file_iter *AdvanceFileIter;
platform_end_file_iter *EndFileIter;
2023-08-22 03:19:51 +00:00
platform_set_clipboard *SetClipboard;
platform_get_clipboard *GetClipboard;
2023-07-19 15:09:41 +00:00
};
#define RegisterPlatformFunctions(PlatformName)\
Platform.Reserve = PlatformName##_Reserve;\
Platform.Release = PlatformName##_Release;\
Platform.Commit = PlatformName##_Commit;\
Platform.Decommit = PlatformName##_Decommit;\
Platform.Allocate = PlatformName##_Allocate;\
Platform.Deallocate = PlatformName##_Deallocate;\
2023-07-19 15:09:41 +00:00
Platform.OpenFile = PlatformName##_OpenFile;\
Platform.CloseFile = PlatformName##_CloseFile;\
Platform.ReadFile = PlatformName##_ReadFile;\
Platform.WriteFile = PlatformName##_WriteFile;\
Platform.GetFileSize = PlatformName##_GetFileSize;\
Platform.SetCursor = PlatformName##_SetCursor;\
Platform.ToggleFullscreen = PlatformName##_ToggleFullscreen;\
Platform.ShowMessage = PlatformName##_ShowMessage;\
Platform.BeginFileIter = PlatformName##_BeginFileIter;\
Platform.AdvanceFileIter = PlatformName##_AdvanceFileIter;\
Platform.EndFileIter = PlatformName##_EndFileIter;\
2023-08-22 03:19:51 +00:00
Platform.SetClipboard = PlatformName##_SetClipboard;\
Platform.GetClipboard = PlatformName##_GetClipboard;\
2023-07-19 15:09:41 +00:00