40 lines
944 B
C++
40 lines
944 B
C++
#ifndef WC3RE_RENDER_ALRESOURCE_HH__
|
|
#define WC3RE_RENDER_ALRESOURCE_HH__
|
|
|
|
#include <AL/al.h>
|
|
#include <AL/alc.h>
|
|
#include <memory>
|
|
|
|
#include "GlResource.hh"
|
|
|
|
namespace render {
|
|
struct ALCDeviceDeleter {
|
|
void operator() (ALCdevice *dev) const;
|
|
};
|
|
|
|
struct ALCContextDeleter {
|
|
void operator() (ALCcontext *ctx) const;
|
|
};
|
|
|
|
struct ALSourceDeleter {
|
|
void operator() (ALuint src) const;
|
|
void operator() (ALsizei count, ALuint src[]) const;
|
|
};
|
|
|
|
struct ALBufferDeleter {
|
|
void operator() (ALuint buf) const;
|
|
void operator() (ALsizei count, ALuint buf[]) const;
|
|
};
|
|
|
|
using ALCDeviceUPtr = std::unique_ptr<ALCdevice, ALCDeviceDeleter>;
|
|
using ALCContextUPtr = std::unique_ptr<ALCcontext, ALCContextDeleter>;
|
|
|
|
template<class Deleter>
|
|
using AlResource = GlResource<Deleter, ALuint>;
|
|
|
|
using ALSourceResource = AlResource<ALSourceDeleter>;
|
|
using ALBufferResource = AlResource<ALBufferDeleter>;
|
|
}
|
|
|
|
#endif
|