[SDL] Suggestion for dynamic, custom events
nfries88 at yahoo.com
Tue Mar 2 19:22:33 PST 2010
Donny Viszneki wrote:
> Yes, it was the example use, like using the CPP macro naming convention (ALL_CAPS) for a variable: the common use of the SDL_Event::type field is a switch() statement, and you can't use a variable as a switch case!
Well, the macro naming convention was to add the feeling without it actually being a macro.
I don't see a reliable way for this to be a constant using my implementation, period, so these values can't be used in a switch statement anyway.
> The only thing I might tweak is having SDL print out an error message if it overflows the custom event space.
SDL_SetError("Failed to register user event: Too many user event types registered.");
Is "register" really the right word for it anyway? Maybe "reserve" or "request" would be better (since there's no sort of coercion here, just assignment of a value that could theoretically be ignored)?
Oh, and does this actually accomplish what's on the wishlist? I might have misunderstood.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SDL