//
// Created by sebastian on 04.08.26.
//

#ifndef COLORRACE_AUDIODEVICE_H
#define COLORRACE_AUDIODEVICE_H
#include <iostream>
#include <ostream>

#include "al.h"
#include "alc.h"


namespace engine::audio {
    class AudioDevice {
    public:
        AudioDevice();

        ~AudioDevice();
        // Kein Kopieren/Verschieben nötig für den Anfang
        AudioDevice(const AudioDevice&) = delete;
        AudioDevice& operator=(const AudioDevice&) = delete;
    private:
        ALCdevice* m_device = nullptr;
        ALCcontext* m_context = nullptr;
    };

    inline void checkAlError(const char* location) {
        ALenum err = alGetError();
        if (err != AL_NO_ERROR) {
            std::cerr << "OpenAL Error: " << alGetString(err) << " at " << location << std::endl;
        }
    }
}


#endif //COLORRACE_AUDIODEVICE_H
