PrevUpHomeNext

Sync objects

#include <oglplus/sync.hpp>

Synchronization object operations

class Sync
{
public:
	struct Property
	{
		typedef SyncCondition Condition;

		typedef SyncType Type;

		typedef SyncStatus Status;

		typedef SyncWaitResult WaitResult;
	};

	Sync(const Sync&) = delete;
	Sync(Sync&&);

	Sync(SyncCondition condition = SyncCondition::GPUCommandsComplete); 1

	bool Signaled(void) const; 2

	SyncType Type(void) const; 3

	SyncCondition Condition(void) const; 4

	SyncStatus Status(void) const; 5

	SyncWaitResult ClientWait(GLuint64 timeout) const; 6

	void Wait(GLuint64 timeout) const; 7
	void Wait(void) const; 8
};

1

Creates a new sync object for the specified condition. See glFenceSync.

2

Returns true if this Sync object is in signaled state. See glGetSync, GL_SYNC_STATUS, GL_SIGNALED.

3

Returns the type of this Sync object. See glGetSync, GL_OBJECT_TYPE.

4

Returns the condition of this Sync object. See glGetSync, GL_OBJECT_CONDITION.

5

Returns the status of this Sync object. See glGetSync, GL_SYNC_STATUS.

6

Wait the specified number of nanoseconds or for the condition to be satisfied. See glClientWaitSync.

7

Wait the specified number of nanoseconds or for the condition to be satisfied. See glWaitSync.

8

Wait indefinitely for the condition to be satisfied. See glWaitSync.

Condition

enum class SyncCondition : GLenum
{
	GPUCommandsComplete = GL_SYNC_GPU_COMMANDS_COMPLETE
};

template <>
Range<SyncCondition> EnumValueRange<SyncCondition>(void);

StrCRef EnumValueName(SyncCondition);

Type

enum class SyncType : GLenum
{
	Fence = GL_SYNC_FENCE
};

template <>
Range<SyncType> EnumValueRange<SyncType>(void);

StrCRef EnumValueName(SyncType);

Status

enum class SyncStatus : GLenum
{
	Signaled   = GL_SIGNALED,
	Unsignaled = GL_UNSIGNALED
};

template <>
Range<SyncStatus> EnumValueRange<SyncStatus>(void);

StrCRef EnumValueName(SyncStatus);

Wait result

enum class SyncWaitResult : GLenum
{
	ConditionSatisfied = GL_CONDITION_SATISFIED,
	AlreadySignaled    = GL_ALREADY_SIGNALED,
	TimeoutExpired     = GL_TIMEOUT_EXPIRED,
	WaitFailed         = GL_WAIT_FAILED
};

template <>
Range<SyncWaitResult> EnumValueRange<SyncWaitResult>(void);

StrCRef EnumValueName(SyncWaitResult);

PrevUpHomeNext