PrevUpHomeNext

Chapter 6. Introduction

Table of Contents

Hello world

EGLplus is a header-only library which implements a thin object-oriented facade over the EGL C-language API. It provides wrappers which automate resource and object management and make the use of EGL in C++ safer and easier.

The following code shows a basic, working example of usage of the EGLplus library.

#include <eglplus/egl.hpp>
#include <eglplus/all.hpp>

#include <iostream>
int main(void)
{
	if(eglplus::LibEGL::HasClientExtensions())
	{
		std::cout << "Client extensions:" << std::endl;
		for(auto r=eglplus::LibEGL::ClientExtensions(); !r.Empty(); r.Next())
			std::cout << '\t' << r.Front() << std::endl;
	}
	else std::cout << "No client extensions." << std::endl;

	eglplus::Display display;

	eglplus::LibEGL egl(display);

	std::cout << "Vendor: " << egl.Vendor() << std::endl;
	std::cout << "Version: " << egl.Version() << std::endl;

	std::cout << "Client APIs:" << std::endl;
	for(auto r=egl.ClientAPIs(); !r.Empty(); r.Next())
		std::cout << '\t' << r.Front() << std::endl;

	std::cout << "Extensions:" << std::endl;
	for(auto r=egl.Extensions(); !r.Empty(); r.Next())
		std::cout << '\t' << r.Front() << std::endl;

	return 0;
}

PrevUpHomeNext