PrevUpHomeNext

Context

#include <oalplus/context.hpp>

Attributes

typedef AttributeList<ContextAttrib, ...> ContextAttribs; 1

typedef FinishedAttributeList<ContextAttrib, ...> FinishedContextAttribs; 2

1

Attribute list type for context attributes.

2

Finished list of context attribute values.

Operations

ContextOps is a base wrapper for OpenAL context operations.

[Note] Note

Do not use this class directly, use Context instead.

class ContextOps
{
public:
	static ContextOps Current(void); 1

	static StrCRef GetString(StringQuery query); 2

	static const char* Vendor(void); 3
	static const char* Version(void); 4
	static const char* Renderer(void); 5

	static Range<StrCRef> Extensions(void); 6


	DeviceOps<tag::Playback> ContextsDevice(void) const; 7

	bool MakeCurrent(void); 8

	void Process(void); 9
	void Suspend(void); 10

1

Returns the current OpenAL context. See alcGetCurrentContext, alcGetContextsDevice.

2

Queries a string from the current OpenAL context. See alcGetString.

3

Returns the vendor name. See alcGetString, ALC_VENDOR.

4

Returns the version string. See alcGetString, ALC_VENDOR.

5

Returns the renderer name. See alcGetString, ALC_VENDOR.

6

Returns a range of extension strings. See alcGetString, ALC_EXTENSIONS.

7

Returns the audio device of this context.

8

Makes this context current. See alcMakeContextCurrent.

9

Processes this context. See alcProcessContext.

10

Suspends this context. See alcSuspendContext.

	static void DistanceModel(DistanceModel dist_model); 1
	static DistanceModel DistanceModel(void); 2

	static void DopplerFactor(ALfloat doppler_factor); 3
	static ALfloat DopplerFactor(void); 4

	static void SpeedOfSound(ALfloat speed_of_sound); 5
	static ALfloat SpeedOfSound(void); 6
};

1

Sets the distance model to be used by the current context. See alcDistanceModel.

2

Returns the distance model used by the current context. See alcGetIntegerv, ALC_DISTANCE_MODEL.

3

Sets the doppler factor for the current context. See alcDopplerFactor.

4

Returns the doppler factor used by the current context. See alcGetFloatv, ALC_DOPPLER_FACTOR.

5

Sets the value of speed of sound for the current context. See alcSpeedOfSound.

6

Returns the value of speed of sound used by the current context. See alcGetFloatv, ALC_SPEED_OF_SOUND.

Context

class Context
 : public ContextOps
{
public:
	Context(const Context&) = delete;
	Context(Context&&);

	Context(const Device& device); 1

	Context(
		const Device& device,
		const FinishedContextAttribs& attribs
	); 2

	~Context(void); 3
};

1

Constructs a context using the specified device. See alcCreateContext.

2

Construct a context with the specified attributes using the device. See alcCreateContext.

3

Destroys this context. See alcMakeContextCurrent, alcDestroyContext.

Context made current

ContextMadeCurrent is a specialization of Context which also makes the wrapped context current before the constructor finishes.

class ContextMadeCurrent
 : public Context
{
public:
	ContextMadeCurrent(const ContextMadeCurrent&) = delete;
	ContextMadeCurrent(ContextMadeCurrent&&);

	ContextMadeCurrent(const Device& device); 1

	ContextMadeCurrent(
		const Device& device,
		const FinishedContextAttribs& attribs
	); 2
};

1

Constructs a context using the specified device and makes it current. See alcCreateContext, alcMakeCurrent.

2

Construct a context with the specified attributes using the specified device and makes it current See alcCreateContext, alcMakeCurrent.


PrevUpHomeNext