shithub: npe

Download patch

ref: a6aae696352131bc5f41bb104b7df9401aae7d2a
parent: c653369e862d2b2235133cfcb0391bc4809ce4b1
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Tue Feb 7 07:09:01 EST 2023

sdl: SDL_WaitEvent

--- a/include/npe/SDL2/SDL_events.h
+++ b/include/npe/SDL2/SDL_events.h
@@ -77,6 +77,7 @@
 int SDL_EventState(Uint32, int);
 int SDL_PollEvent(SDL_Event *event);
 int SDL_PushEvent(SDL_Event *event);
+int SDL_WaitEvent(SDL_Event *event);
 int SDL_RegisterEvents(int);
 int SDL_PeepEvents(SDL_Event *events, int numevents, SDL_eventaction action, Uint32 minType, Uint32 maxType);
 
--- a/libnpe_sdl2/events.c
+++ b/libnpe_sdl2/events.c
@@ -169,6 +169,18 @@
 	return 0;
 }
 
+int
+SDL_WaitEvent(SDL_Event *e)
+{
+	int r;
+
+	salt[Numchan].op = CHANEND;
+	r = SDL_PollEvent(e);
+	salt[Numchan].op = CHANNOBLK;
+
+	return r;
+}
+
 static int
 rune2scancode(Rune r)
 {