OGLplus  (0.59.0) a C++ wrapper for rendering APIs

eglplus/001_basic_info.cpp

Copyright Matus Chochlik. Distributed under the Boost Software License, Version 1.0. See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt

#include <eglplus/egl.hpp>
#include <iostream>
auto main() -> int {
using namespace eagine;
using namespace eagine::eglp;
egl_api egl;
if(ok display = egl.get_display()) {
if(auto init_res = egl.initialize(display)) {
auto do_cleanup = egl.terminate.raii(display);
if(ok dev_count{egl.query_devices.count()}) {
std::cout << "Devices: " << dev_count << std::endl;
}
if(ok vendor = egl.query_string(display, egl.vendor)) {
std::cout << "Vendor: " << extract(vendor) << std::endl;
}
if(ok version = egl.query_string(display, egl.version)) {
std::cout << "Version: " << extract(version) << std::endl;
}
} else {
std::cout << "failed to initialize EGL" << std::endl;
}
} else {
std::cout << "failed to get default display" << std::endl;
}
return 0;
}
EGL-related code is placed in this namespace.
Definition: eglplus.hpp:11
Common code is placed in this namespace.
Definition: eagine.hpp:21
static constexpr auto extract(api_result_value< Result, api_result_validity::never > &) noexcept -> Result &
Overload of extract for api_result_value.
Definition: c_api_wrap.hpp:270
Value typically wrapping function call result and success indicator.
Definition: extract.hpp:128
basic_egl_api< egl_api_traits > egl_api
Alias for the default instantation of basic_egl_api.
Definition: egl_api_fwd.hpp:20

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).