Magnum::Platform::XEglApplication class

X/EGL application.

Application using pure X11 and EGL. Supports keyboard and mouse handling.

This application library is available on both desktop OpenGL and OpenGL ES on Linux. It depends on X11 and EGL libraries and is built if WITH_XEGLAPPLICATION is enabled in CMake.

Bootstrap application

The usage is very similar to Sdl2Application, for which fully contained base application along with CMake setup is available, see its documentation for more information.

General usage

In order to use this library from CMake, you need to copy FindEGL.cmake from the modules directory in Magnum source to the modules/ dir in your project (so it is able to find the EGL library). Request the XEglApplication component of the Magnum package and link to the Magnum::XEglApplication target:

find_package(Magnum REQUIRED XEglApplication)

# ...
target_link_libraries(your-app Magnum::XEglApplication)

If no other application is requested, you can also use the generic Magnum::Application alias to simplify porting. Again, see Downloading and building and Usage with CMake for more information.

In C++ code you need to implement at least drawEvent() to be able to draw on the screen. The subclass can be then used directly in main() — see convenience macro MAGNUM_XEGLAPPLICATION_MAIN(). See Platform support for more information.

class MyApplication: public Platform::XEglApplication {
    // implement required methods...

If no other application header is included, this class is also aliased to Platform::Application and the macro is aliased to MAGNUM_APPLICATION_MAIN() to simplify porting.

Base classes

class AbstractXApplication
Base for X11-based applications.

Constructors, destructors, conversion operators

XEglApplication(const Arguments& arguments, const Configuration& configuration = Configuration()) explicit
Default constructor.
XEglApplication(const Arguments& arguments, NoCreateT) explicit
XEglApplication(const Arguments& arguments, std::nullptr_t) deprecated explicit

Function documentation

Magnum::Platform::XEglApplication::XEglApplication(const Arguments& arguments, const Configuration& configuration = Configuration()) explicit

Default constructor.

arguments Application arguments
configuration Configuration

Creates application with default or user-specified configuration. See Configuration for more information. The program exits if the context cannot be created, see below for an alternative.

Magnum::Platform::XEglApplication::XEglApplication(const Arguments& arguments, NoCreateT) explicit


arguments Application arguments

Unlike above, the context is not created and must be created later with createContext() or tryCreateContext().

Magnum::Platform::XEglApplication::XEglApplication(const Arguments& arguments, std::nullptr_t) explicit