Questions about the property API (SDL3)

I’m looking at the property API in SDL3 and I have some questions since there seems to be little in the way of documentation.

  • I noticed a pointer type referenced in the SDL_CategoryType enum but I didn’t see API functions for common pointer types (window, renderer, texture) except for surface (SDL_SetSurfaceProperty/CleanupSurface.) Obviously those functions can be copied for other pointer types but I was wondering if the API was going to include functions for them by default in the future.

  • Is it possible to change the hashing function?

  • Is it feasible to use integer keys, since the key type is char*?

  • As far as performance goes should I prefer a single table for everything or multiple tables for single types? Or would it be too slow for something like an object pool? Or does it matter?

Thanks for your time.

It seems like your questions shift from being about properties to being about hash tables.

SDL does have a hash table implementation but it’s only used internally. It’s not part of the public interface.

The properties API uses the SDL hash table implementation internally but I don’t think the properties API itself should be seen as a hash table. It’s primarily use case seems to be to allow arbitrary data to be attached to objects. Not sure how useful this will be to SDL users in general but it’s apparently useful for the SDL implementers.