Beispiel #1
0
	/**
	 *  @eglsymbols
	 *  @eglfunref{SwapInterval}
	 */
	bool SwapInterval(EGLint interval)
	{
		EGLBoolean result = EGLPLUS_EGLFUNC(SwapInterval)(
			_handle,
			interval
		);
		EGLPLUS_CHECK(EGLPLUS_ERROR_INFO(SwapInterval));
		return result == EGL_TRUE;
	}
Beispiel #2
0
/**
 *  @eglsymbols
 *  @eglfunref{BindAPI}
 */
inline Boolean BindAPI(RenderingAPI api)
{
	Boolean result(
		EGLPLUS_EGLFUNC(BindAPI)(EGLenum(api)),
		std::nothrow
	);
	EGLPLUS_VERIFY_SIMPLE(BindAPI);
	return result;
}
Beispiel #3
0
	/**
	 *  @eglsymbols
	 *  @eglfunref{QueryContext}
	 */
	bool Query(ContextAttrib attrib, EGLint& value) const
	{
		EGLBoolean result = EGLPLUS_EGLFUNC(QueryContext)(
			GetEGLHandle(_display),
			_handle,
			EGLint(EGLenum(attrib)),
			&value
		);
		EGLPLUS_CHECK_SIMPLE(QueryContext);
		return result == EGL_TRUE;
	}
Beispiel #4
0
	/**
	 *  @eglsymbols
	 *  @eglfunref{MakeCurrent}
	 */
	bool Release(void)
	{
		EGLBoolean result = EGLPLUS_EGLFUNC(MakeCurrent)(
			GetEGLHandle(_display),
			EGL_NO_SURFACE,
			EGL_NO_SURFACE,
			EGL_NO_CONTEXT
		);
		EGLPLUS_CHECK_SIMPLE(MakeCurrent);
		return result == EGL_TRUE;
	}
Beispiel #5
0
	/**
	 *  @eglsymbols
	 *  @eglfunref{DestroyContext}
	 */
	~Context(void)
	{
		if(_handle != EGL_NO_CONTEXT)
		{
			EGLPLUS_EGLFUNC(DestroyContext)(
				GetEGLHandle(_display),
				_handle
			);
			EGLPLUS_VERIFY_SIMPLE(DestroyContext);
		}
	}
Beispiel #6
0
	/**
	 *  @eglsymbols
	 *  @eglfunref{MakeCurrent}
	 */
	bool MakeCurrent(const Surface& surface)
	{
		EGLBoolean result = EGLPLUS_EGLFUNC(MakeCurrent)(
			GetEGLHandle(_display),
			GetEGLHandle(surface),
			GetEGLHandle(surface),
			_handle
		);
		EGLPLUS_CHECK_SIMPLE(MakeCurrent);
		return result == EGL_TRUE;
	}
Beispiel #7
0
	/**
	 *  @eglsymbols
	 *  @eglfunref{MakeCurrent}
	 */
	bool ReleaseContext(void)
	{
		EGLBoolean result = EGLPLUS_EGLFUNC(MakeCurrent)(
			_handle,
			EGL_NO_SURFACE,
			EGL_NO_SURFACE,
			EGL_NO_CONTEXT
		);
		EGLPLUS_CHECK(EGLPLUS_ERROR_INFO(MakeCurrent));
		return result == EGL_TRUE;
	}
Beispiel #8
0
	/**
	 *  @eglsymbols
	 *  @eglfunref{GetConfigAttrib}
	 */
	EGLint GetAttrib(ConfigAttrib attrib) const
	{
		EGLint result = 0;
		EGLPLUS_EGLFUNC(GetConfigAttrib)(
			FriendOf<Display>::GetHandle(_display),
			this->_handle,
			EGLint(EGLenum(attrib)),
			&result
		);
		EGLPLUS_VERIFY(EGLPLUS_ERROR_INFO(GetConfigAttrib));
		return result;
	}
Beispiel #9
0
	/**
	 *  @eglsymbols
	 *  @eglfunref{QueryContext}
	 */
	EGLint ConfigId(void) const
	{
		EGLint result = 0;
		EGLPLUS_EGLFUNC(QueryContext)(
			GetEGLHandle(_display),
			_handle,
			EGLint(EGL_CONFIG_ID),
			&result
		);
		EGLPLUS_CHECK_SIMPLE(QueryContext);
		return result;
	}
Beispiel #10
0
	void _get_all(void)
	{
		EGLint num = 0;
		EGLPLUS_EGLFUNC(GetConfigs)(
			FriendOf<Display>::GetHandle(_display),
			nullptr,
			0,
			&num
		);
		EGLPLUS_VERIFY(EGLPLUS_ERROR_INFO(GetConfigs));
		if(num)
		{
			_configs.resize(num);
			EGLPLUS_EGLFUNC(GetConfigs)(
				FriendOf<Display>::GetHandle(_display),
				_configs.data(),
				num,
				&num
			);
			EGLPLUS_VERIFY(EGLPLUS_ERROR_INFO(GetConfigs));
		}
	}
Beispiel #11
0
	void _choose(const FinishedConfigAttribs& attribs)
	{
		EGLint num = 0;
		EGLPLUS_EGLFUNC(ChooseConfig)(
			FriendOf<Display>::GetHandle(_display),
			attribs.Get(),
			nullptr,
			0,
			&num
		);
		EGLPLUS_VERIFY(EGLPLUS_ERROR_INFO(ChooseConfig));
		if(num)
		{
			_configs.resize(num);
			EGLPLUS_EGLFUNC(ChooseConfig)(
				FriendOf<Display>::GetHandle(_display),
				attribs.Get(),
				_configs.data(),
				num,
				&num
			);
			EGLPLUS_VERIFY(EGLPLUS_ERROR_INFO(ChooseConfig));
		}
	}
Beispiel #12
0
	static ::EGLContext _init(
		const Display& display,
		const Config& config,
		::EGLContext share_context,
		const EGLint* attribs
	)
	{
		::EGLContext result = EGLPLUS_EGLFUNC(CreateContext)(
			GetEGLHandle(display),
			GetEGLHandle(config),
			share_context,
			attribs
		);
		EGLPLUS_VERIFY_SIMPLE(CreateContext);
		return result;
	}
Beispiel #13
0
	/**
	 *  @eglsymbols
	 *  @eglfunref{GetDisplay}
	 */
	Display(::EGLNativeDisplayType display_id)
	 : _handle(EGLPLUS_EGLFUNC(GetDisplay)(display_id))
	{
		EGLPLUS_CHECK(EGLPLUS_ERROR_INFO(GetDisplay));
	}
Beispiel #14
0
	/**
	 *  @eglsymbols
	 *  @eglfunref{GetDisplay}
	 *  @egldefref{DEFAULT_DISPLAY}
	 */
	Display(void)
	 : _handle(EGLPLUS_EGLFUNC(GetDisplay)(EGL_DEFAULT_DISPLAY))
	{
		EGLPLUS_CHECK(EGLPLUS_ERROR_INFO(GetDisplay));
	}
Beispiel #15
0
/**
 *  @eglsymbols
 *  @eglfunref{QueryAPI}
 */
inline RenderingAPI QueryAPI(void)
{
	EGLenum result = EGLPLUS_EGLFUNC(QueryAPI)();
	EGLPLUS_VERIFY_SIMPLE(QueryAPI);
	return RenderingAPI(result);
}
Beispiel #16
0
	/**
	 *  @eglsymbols
	 *  @eglfunref{WaitNative}
	 */
	bool WaitNative(EGLint engine) const
	{
		EGLBoolean result = EGLPLUS_EGLFUNC(WaitNative)(engine);
		EGLPLUS_VERIFY_SIMPLE(WaitNative);
		return result == EGL_TRUE;
	}
Beispiel #17
0
	/**
	 *  @eglsymbols
	 *  @eglfunref{WaitGL}
	 */
	bool WaitGL(void) const
	{
		EGLBoolean result = EGLPLUS_EGLFUNC(WaitGL)();
		EGLPLUS_VERIFY_SIMPLE(WaitGL);
		return result == EGL_TRUE;
	}