99#include < Aulib/DecoderDrwav.h>
1010#include < Aulib/Stream.h>
1111
12+ #ifdef USE_SDL3
13+ #include < SDL3/SDL_error.h>
14+ #include < SDL3/SDL_iostream.h>
15+ #else
1216#include < SDL.h>
1317#ifdef USE_SDL1
1418#include " utils/sdl2_to_1_2_backports.h"
1519#else
1620#include " utils/sdl2_backports.h"
1721#endif
22+ #endif
1823
1924#include " engine/assets.hpp"
2025#include " options.h"
@@ -67,7 +72,7 @@ std::unique_ptr<Aulib::Decoder> CreateDecoder(bool isMp3)
6772 return std::make_unique<Aulib::DecoderDrwav>();
6873}
6974
70- std::unique_ptr<Aulib::Stream> CreateStream (SDL_RWops *handle, bool isMp3)
75+ std::unique_ptr<Aulib::Stream> CreateStream (SDL_IOStream *handle, bool isMp3)
7176{
7277 auto decoder = CreateDecoder (isMp3);
7378 if (!decoder->open (handle)) // open for `getRate`
@@ -139,7 +144,7 @@ bool SoundSample::Play(int numIterations)
139144
140145int SoundSample::SetChunkStream (std::string filePath, bool isMp3, bool logErrors)
141146{
142- SDL_RWops *handle = OpenAssetAsSdlRwOps (filePath.c_str (), /* threadsafe=*/ true );
147+ SDL_IOStream *handle = OpenAssetAsSdlRwOps (filePath.c_str (), /* threadsafe=*/ true );
143148 if (handle == nullptr ) {
144149 if (logErrors)
145150 LogError (LogCategory::Audio, " OpenAsset failed (from SoundSample::SetChunkStream) for {}: {}" , filePath, SDL_GetError ());
@@ -162,7 +167,7 @@ int SoundSample::SetChunk(ArraySharedPtr<std::uint8_t> fileData, std::size_t dwB
162167 isMp3_ = isMp3;
163168 file_data_ = std::move (fileData);
164169 file_data_size_ = dwBytes;
165- SDL_RWops *buf = SDL_RWFromConstMem (file_data_.get (), static_cast <int >(dwBytes));
170+ SDL_IOStream *buf = SDL_IOFromConstMem (file_data_.get (), static_cast <int >(dwBytes));
166171 if (buf == nullptr ) {
167172 return -1 ;
168173 }
0 commit comments