mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-04 15:12:47 +02:00
Added properties to various SDL objects
The following objects now have properties that can be user modified: * SDL_AudioStream * SDL_Gamepad * SDL_Joystick * SDL_RWops * SDL_Renderer * SDL_Sensor * SDL_Surface * SDL_Texture * SDL_Window
This commit is contained in:
@@ -438,6 +438,18 @@ SDL_AudioStream *SDL_CreateAudioStream(const SDL_AudioSpec *src_spec, const SDL_
|
||||
return retval;
|
||||
}
|
||||
|
||||
SDL_PropertiesID SDL_GetAudioStreamProperties(SDL_AudioStream *stream)
|
||||
{
|
||||
if (!stream) {
|
||||
SDL_InvalidParamError("stream");
|
||||
return 0;
|
||||
}
|
||||
if (stream->props == 0) {
|
||||
stream->props = SDL_CreateProperties();
|
||||
}
|
||||
return stream->props;
|
||||
}
|
||||
|
||||
int SDL_SetAudioStreamGetCallback(SDL_AudioStream *stream, SDL_AudioStreamCallback callback, void *userdata)
|
||||
{
|
||||
if (!stream) {
|
||||
@@ -1161,6 +1173,8 @@ void SDL_DestroyAudioStream(SDL_AudioStream *stream)
|
||||
return;
|
||||
}
|
||||
|
||||
SDL_DestroyProperties(stream->props);
|
||||
|
||||
OnAudioStreamDestroy(stream);
|
||||
|
||||
const SDL_bool simplified = stream->simplified;
|
||||
|
||||
@@ -170,6 +170,8 @@ struct SDL_AudioStream
|
||||
{
|
||||
SDL_Mutex* lock;
|
||||
|
||||
SDL_PropertiesID props;
|
||||
|
||||
SDL_AudioStreamCallback get_callback;
|
||||
void *get_callback_userdata;
|
||||
SDL_AudioStreamCallback put_callback;
|
||||
|
||||
Reference in New Issue
Block a user