Yup. The API aesthete in me doesn?t really approve of such overloading, but there it is ?.
m.From: sdl-bounces@lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org] On Behalf Of Mason Wheeler
Sent: Thursday, July 01, 2010 12:59 PM
To: SDL Development List
Subject: Re: [SDL] SDL_PeepEvents array size
…oh. facepalm Yeah, it’s right there. Sorry. It was too early in the morning when I wrote that.
So if I understand this code correctly, this is really three functions for the price of one. One of them takes a filled array as an input parameter and pushes all the events in it into the queue, and the other two take an empty array as an output parameter and fill it with events, and optionally either do or do not remove the events from the queue. Is that right?
From: @Vance_Michael (Vance, Michael)
Subject: Re: [SDL] SDL_PeepEvents array size
The array?s size is user-specified with the second parameter. Per the docs, the array will be filled with as many events as are available up to the user-specified amount.
However, internally, the maximum number of events possible in the queue is MAXEVENTS, which is defined to 128 in SDL_events.c.
m.
From: sdl-bounces@lists.libsdl.org [mailto:sdl-bounces at lists.libsdl.org] On Behalf Of Mason Wheeler
Sent: Thursday, July 01, 2010 11:06 AM
To: sdl
Subject: [SDL] SDL_PeepEvents array size
I’m trying to make a translated header of SDL_events.h for Delphi, and I’m a little bit stuck on SDL_PeepEvents. The first parameter is a pointer to a (array of) SDL_Event. But neither the header nor the implementation gives any clue as to how big the array needs to be, and there’s nothing resembling bounds checking to be found.
For the purposes of safety, how big does this array need to be so that it won’t overrun?
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email