From cae19b3363ef2c2825fce08684ae0bea5f1c37ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Kurucz?= Date: Thu, 14 May 2020 23:39:25 +0200 Subject: [PATCH 1/2] Added virtual HandleEvent to SDLApp for ease in case it's needed (imgui binding for example handles all events like this. Removed duplicated Quit event type handling. --- BeefLibs/SDL2/src/SDLApp.bf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/BeefLibs/SDL2/src/SDLApp.bf b/BeefLibs/SDL2/src/SDLApp.bf index c4da5827..922a0fb8 100644 --- a/BeefLibs/SDL2/src/SDLApp.bf +++ b/BeefLibs/SDL2/src/SDLApp.bf @@ -166,6 +166,11 @@ namespace SDL2 } + public virtual void HandleEvent(SDL.Event evt) + { + + } + public void Draw(Image image, float x, float y) { SDL.Rect srcRect = .(0, 0, image.mSurface.w, image.mSurface.h); @@ -226,8 +231,7 @@ namespace SDL2 default: } - if (event.type == .Quit) - return; + HandleEvent(event); waitTime = 0; } From 10ad3514a486e9c1390b5cf3c0155f09c46e58fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Kurucz?= Date: Thu, 14 May 2020 23:52:18 +0200 Subject: [PATCH 2/2] Made malloc and free public in SDL binding (used for freeing up clipboard text data in imgui binding) --- BeefLibs/SDL2/src/SDL2.bf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BeefLibs/SDL2/src/SDL2.bf b/BeefLibs/SDL2/src/SDL2.bf index ac494dc0..2374b3ec 100644 --- a/BeefLibs/SDL2/src/SDL2.bf +++ b/BeefLibs/SDL2/src/SDL2.bf @@ -52,10 +52,10 @@ namespace SDL2 } [LinkName("SDL_malloc")] - static extern void* malloc(int size); + public static extern void* malloc(int size); [LinkName("SDL_free")] - static extern void free(void* memblock); + public static extern void free(void* memblock); public struct RWOps;