From 5de96dc1d57d017dd06c6be03260b43154b6fc5e Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Wed, 11 Mar 2020 10:29:16 +0100 Subject: work --- src/windows/platform.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/windows') diff --git a/src/windows/platform.c b/src/windows/platform.c index 8c3abe7..3d6c7dd 100644 --- a/src/windows/platform.c +++ b/src/windows/platform.c @@ -780,6 +780,18 @@ void platform_window_swap_buffers(platform_window *window) SwapBuffers(window->hdc); } +s32 platform_get_file_size(char *path) +{ + FILE *file = fopen(path, "r"); + if (!file) return -1; + + fseek(file, 0 , SEEK_END); + int length = ftell(file); + fseek(file, 0, SEEK_SET); + + return length; +} + file_content platform_read_file_content(char *path, const char *mode) { file_content result; -- cgit v1.2.3-70-g09d2