mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-17 16:58:13 +00:00
Simplified SDL_Surface
SDL_Surface has been simplified and internal details are no longer in the public structure. The `format` member of SDL_Surface is now an enumerated pixel format value. You can get the full details of the pixel format by calling `SDL_GetPixelFormatDetails(surface->format)`. You can get the palette associated with the surface by calling SDL_GetSurfacePalette(). You can get the clip rectangle by calling SDL_GetSurfaceClipRect(). SDL_PixelFormat has been renamed SDL_PixelFormatDetails and just describes the pixel format, it does not include a palette for indexed pixel types. SDL_PixelFormatEnum has been renamed SDL_PixelFormat and is used instead of Uint32 for API functions that refer to pixel format by enumerated value. SDL_MapRGB(), SDL_MapRGBA(), SDL_GetRGB(), and SDL_GetRGBA() take an optional palette parameter for indexed color lookups.
This commit is contained in:
@@ -29,30 +29,32 @@ typedef Uint32 (*SDL_HashTable_HashFn)(const void *key, void *data);
|
||||
typedef SDL_bool (*SDL_HashTable_KeyMatchFn)(const void *a, const void *b, void *data);
|
||||
typedef void (*SDL_HashTable_NukeFn)(const void *key, const void *value, void *data);
|
||||
|
||||
SDL_HashTable *SDL_CreateHashTable(void *data,
|
||||
const Uint32 num_buckets,
|
||||
const SDL_HashTable_HashFn hashfn,
|
||||
const SDL_HashTable_KeyMatchFn keymatchfn,
|
||||
const SDL_HashTable_NukeFn nukefn,
|
||||
const SDL_bool stackable);
|
||||
extern SDL_HashTable *SDL_CreateHashTable(void *data,
|
||||
const Uint32 num_buckets,
|
||||
const SDL_HashTable_HashFn hashfn,
|
||||
const SDL_HashTable_KeyMatchFn keymatchfn,
|
||||
const SDL_HashTable_NukeFn nukefn,
|
||||
const SDL_bool stackable);
|
||||
|
||||
void SDL_EmptyHashTable(SDL_HashTable *table);
|
||||
void SDL_DestroyHashTable(SDL_HashTable *table);
|
||||
SDL_bool SDL_InsertIntoHashTable(SDL_HashTable *table, const void *key, const void *value);
|
||||
SDL_bool SDL_RemoveFromHashTable(SDL_HashTable *table, const void *key);
|
||||
SDL_bool SDL_FindInHashTable(const SDL_HashTable *table, const void *key, const void **_value);
|
||||
SDL_bool SDL_HashTableEmpty(SDL_HashTable *table);
|
||||
extern void SDL_EmptyHashTable(SDL_HashTable *table);
|
||||
extern void SDL_DestroyHashTable(SDL_HashTable *table);
|
||||
extern SDL_bool SDL_InsertIntoHashTable(SDL_HashTable *table, const void *key, const void *value);
|
||||
extern SDL_bool SDL_RemoveFromHashTable(SDL_HashTable *table, const void *key);
|
||||
extern SDL_bool SDL_FindInHashTable(const SDL_HashTable *table, const void *key, const void **_value);
|
||||
extern SDL_bool SDL_HashTableEmpty(SDL_HashTable *table);
|
||||
|
||||
// iterate all values for a specific key. This only makes sense if the hash is stackable. If not-stackable, just use SDL_FindInHashTable().
|
||||
SDL_bool SDL_IterateHashTableKey(const SDL_HashTable *table, const void *key, const void **_value, void **iter);
|
||||
extern SDL_bool SDL_IterateHashTableKey(const SDL_HashTable *table, const void *key, const void **_value, void **iter);
|
||||
|
||||
// iterate all key/value pairs in a hash (stackable hashes can have duplicate keys with multiple values).
|
||||
SDL_bool SDL_IterateHashTable(const SDL_HashTable *table, const void **_key, const void **_value, void **iter);
|
||||
extern SDL_bool SDL_IterateHashTable(const SDL_HashTable *table, const void **_key, const void **_value, void **iter);
|
||||
|
||||
Uint32 SDL_HashString(const void *key, void *unused);
|
||||
SDL_bool SDL_KeyMatchString(const void *a, const void *b, void *unused);
|
||||
extern Uint32 SDL_HashString(const void *key, void *unused);
|
||||
extern SDL_bool SDL_KeyMatchString(const void *a, const void *b, void *unused);
|
||||
|
||||
Uint32 SDL_HashID(const void *key, void *unused);
|
||||
SDL_bool SDL_KeyMatchID(const void *a, const void *b, void *unused);
|
||||
extern Uint32 SDL_HashID(const void *key, void *unused);
|
||||
extern SDL_bool SDL_KeyMatchID(const void *a, const void *b, void *unused);
|
||||
|
||||
extern void SDL_NukeFreeValue(const void *key, const void *value, void *unused);
|
||||
|
||||
#endif /* SDL_hashtable_h_ */
|
||||
|
Reference in New Issue
Block a user