13 #ifndef OALPLUS_CONTEXT_1303201648_HPP
14 #define OALPLUS_CONTEXT_1303201648_HPP
23 #include <oalplus/error/alc.hpp>
25 #include <oalplus/detail/sep_str_range.hpp>
29 struct ContextValueTypeToContextAttrib
31 static std::integral_constant<int, -1> MaxValueType(
void);
36 typedef AttributeList<
38 ContextValueTypeToContextAttrib,
43 typedef FinishedAttributeList<
58 ::ALCcontext* _context;
85 const ALchar* str = OALPLUS_ALFUNC(
GetString)(ALenum(query));
123 #if OALPLUS_DOCUMENTATION_ONLY
134 return aux::SepStrRange(
154 bool result = OALPLUS_ALCFUNC(MakeContextCurrent)(_context);
155 OALPLUS_VERIFY_SIMPLE_ALC(_device, MakeContextCurrent);
166 OALPLUS_ALCFUNC(ProcessContext)(_context);
167 OALPLUS_VERIFY_SIMPLE_ALC(_device, ProcessContext);
177 OALPLUS_ALCFUNC(SuspendContext)(_context);
178 OALPLUS_VERIFY_SIMPLE_ALC(_device, SuspendContext);
189 OALPLUS_VERIFY_SIMPLE(DistanceModel);
201 OALPLUS_ALFUNC(GetIntegerv(
205 OALPLUS_VERIFY_SIMPLE(GetIntegerv);
206 return oalplus::DistanceModel(result);
229 OALPLUS_ALFUNC(GetFloatv(
233 OALPLUS_VERIFY_SIMPLE(GetFloatv);
257 OALPLUS_ALFUNC(GetFloatv(
261 OALPLUS_VERIFY_SIMPLE(GetFloatv);
281 OALPLUS_ALCFUNC(CreateContext)(device._device, nullptr)
284 OALPLUS_CHECK_SIMPLE_ALC(_device, CreateContext);
297 OALPLUS_ALCFUNC(CreateContext)(
303 OALPLUS_CHECK_SIMPLE_ALC(_device, CreateContext);
310 tmp._context =
nullptr;
323 OALPLUS_ALCFUNC(MakeContextCurrent)(
nullptr);
324 OALPLUS_ALCFUNC(DestroyContext)(_context);
374 #endif // include guard
OpenAL string query enumeration.
bool MakeCurrent(void)
Makes this context current.
Definition: context.hpp:152
static ALfloat DopplerFactor(void)
Returns the doppler factor used by the current context.
Definition: context.hpp:226
Audio playback device.
Definition: device.hpp:257
Wrapper around a OpenAL device.
~Context(void)
Destroys this context.
Definition: context.hpp:319
Class implementing audio playback device-specific operations.
Definition: device.hpp:116
static ALfloat SpeedOfSound(void)
Returns the value of speed of sound used by the current context.
Definition: context.hpp:254
Template for OpenAL context attribute list.
OpenAL context attribute type enumeration.
Compile-time configuration options.
static const char * Version(void)
Returns the version string.
Definition: context.hpp:107
Helper macro expanding into OpenAL function name.
static const ALchar * GetString(StringQuery query)
Queries a string from the current OpenAL context.
Definition: context.hpp:83
Context(const Device &device, const FinishedContextAttribs &attribs)
Construct a context with the specified attributes using the device.
Definition: context.hpp:292
CurrentContext(const Device &device)
Creates a new context and makes it current.
Definition: context.hpp:340
static void DopplerFactor(ALfloat doppler_factor)
Sets the doppler factor for the current context.
Definition: context.hpp:214
CurrentContext(CurrentContext &&tmp)
CurrentContext is move-constructible.
Definition: context.hpp:365
static void SpeedOfSound(ALfloat speed_of_sound)
Sets the value of speed of sound for the current context.
Definition: context.hpp:242
static oalplus::DistanceModel DistanceModel(void)
Returns the distance model used by the current context.
Definition: context.hpp:198
AttributeList< ContextAttrib, ContextValueTypeToContextAttrib, AttributeListTraits > ContextAttribs
Attribute list for context attributes.
Definition: context.hpp:40
Context(const Device &device)
Construct a context using the specified device.
Definition: context.hpp:278
DeviceOps< tag::Playback > ContextsDevice(void) const
Returns the device of this context.
Definition: context.hpp:142
ContextAttrib
OpenAL context attribute enumeration.
Definition: context_attrib.hpp:24
OpenAL string query enumeration.
FinishedAttributeList< ContextAttrib, AttributeListTraits > FinishedContextAttribs
Finished list of context attribute values.
Definition: context.hpp:46
A context that is made current right after construction.
Definition: context.hpp:330
static ContextOps Current(void)
Returns the current OpenAL context.
static void DistanceModel(oalplus::DistanceModel dist_model)
Sets the distance model to be used by the current context.
Definition: context.hpp:186
static const char * Vendor(void)
Returns the vendor name.
Definition: context.hpp:96
void Process(void)
Processes this context.
Definition: context.hpp:164
CurrentContext(const Device &device, const FinishedContextAttribs &attribs)
Creates a new context and makes it current.
Definition: context.hpp:352
static Range< String > Extensions(void)
Returns a range of extension strings.
void Suspend(void)
Suspends this context.
Definition: context.hpp:175
Wrapper for OpenAL context operations.
Definition: context.hpp:267
Context(Context &&tmp)
Contexts are move-only.
Definition: context.hpp:307
Base wrapper for OpenAL context operations.
Definition: context.hpp:54
static const char * Renderer(void)
Returns the renderer name.
Definition: context.hpp:118