Sami Näätänen sn.ml at naataset.net
Fri Jul 1 07:28:43 PDT 2011

On 9.6.2011 18:12, Andreas Schiffler wrote:
> I think switching to SDL_Rect would be poor design, as it would be a 
> semantic overload of SDL_Rect ... for resize and move events the 
> SDL_Rect "object" would really be invalid (as it does not describe a 
> "Rect" anymore). It would also break any existing code relying on the 
> data1 and data2 fields.
> One should extend SDL_WindowEvent like this:
> typedef struct SDL_WindowEvent
> {
>      Uint8 type;
>      Uint8 event;
>      int data1;
>      int data2;
>      SDL_WindowID windowID;
>      int data3; // append, so cast can be done without affecting windowID
>      int data4;
> } SDL_WindowEvent;
<removed content>
> Cheers,
> Andreas

It would be better to go through all the structs of SDL 1.3 as it is 
starting to creap closer to first official release and add some reserved 
bytes at the end of the structs.

This would in most cases allow ABI independent extensions in the future 
without severly breaking existing programs (ie no need to recompile for 
the new version if the new features are not used).

As most likely there will come cases where the current structs need 
extending, after SDL 1.3 has been released and it will be selected as 
the base for more and more applications. Where breaking the ABI would be 
quite anoying.


More information about the SDL mailing list