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

api.hpp
Go to the documentation of this file.
1 #ifndef EGLPLUS_EGL_API_API_HPP
9 #define EGLPLUS_EGL_API_API_HPP
10 
11 #include "c_api.hpp"
12 #include "config_attribs.hpp"
13 #include "context_attribs.hpp"
14 #include "enum_types.hpp"
15 #include "extensions.hpp"
16 #include "image_attribs.hpp"
17 #include "objects.hpp"
18 #include "output_layer_attribs.hpp"
19 #include "output_port_attribs.hpp"
20 #include "platform_attribs.hpp"
21 #include "stream_attribs.hpp"
22 #include "surface_attribs.hpp"
23 #include "sync_attribs.hpp"
24 #include <eagine/scope_exit.hpp>
25 #include <eagine/string_list.hpp>
26 #include <chrono>
27 
28 namespace eagine::eglp {
29 //------------------------------------------------------------------------------
30 #define EGLPAFP(FUNC) decltype(c_api::FUNC), &c_api::FUNC
31 //------------------------------------------------------------------------------
36 template <typename ApiTraits>
37 class basic_egl_operations : public basic_egl_c_api<ApiTraits> {
38 
39 public:
40  using api_traits = ApiTraits;
42 
43  using void_ptr_type = typename egl_types::void_ptr_type;
44  using int_type = typename egl_types::int_type;
45  using bool_type = typename egl_types::char_type;
46  using char_type = typename egl_types::char_type;
47  using enum_type = typename egl_types::enum_type;
48  using attrib_type = typename egl_types::attrib_type;
49  using device_type = typename egl_types::device_type;
50  using native_display_type = typename egl_types::native_display_type;
51  using native_window_type = typename egl_types::native_window_type;
52  using native_pixmap_type = typename egl_types::native_pixmap_type;
53  using client_buffer_type = typename egl_types::client_buffer_type;
54  using config_type = typename egl_types::config_type;
55 
56  // extensions
57  template <typename... Args>
58  using extension = basic_egl_extension<ApiTraits, Args...>;
59 
60  extension<> EXT_device_base;
61  extension<> EXT_device_enumeration;
62  extension<> EXT_device_query;
63  extension<> EXT_device_query_name;
64  extension<device_handle> EXT_device_drm;
65  extension<device_handle> MESA_device_software;
66 
67  extension<> EXT_platform_base;
68  extension<> EXT_platform_device;
69  extension<> EXT_platform_x11;
70  extension<> EXT_platform_xcb;
71  extension<> EXT_platform_wayland;
72  extension<> KHR_platform_gbm;
73  extension<> MESA_platform_surfaceless;
74 
75  extension<display_handle> EXT_create_context_robustness;
76  extension<display_handle> EXT_swap_buffers_with_damage;
77 
78  extension<display_handle> EXT_output_base;
79  extension<display_handle> EXT_output_drm;
80  extension<display_handle> EXT_stream_consumer_egloutput;
81 
82  extension<display_handle> EXT_pixel_format_float;
83 
84  extension<display_handle> MESA_configless_context;
85  extension<display_handle> MESA_query_driver;
86 
87  // functions
88  template <typename W, W c_api::*F, typename Signature = typename W::signature>
89  class func;
90 
91  template <typename W, W c_api::*F, typename RVC, typename... Params>
92  class func<W, F, RVC(Params...)>
93  : public wrapped_c_api_function<c_api, api_traits, nothing_t, W, F> {
94  using base = wrapped_c_api_function<c_api, api_traits, nothing_t, W, F>;
95 
96  private:
97  template <typename Res>
98  constexpr auto _check(Res&& res) const noexcept {
99  res.error_code(this->api().GetError());
100  return std::forward<Res>(res);
101  }
102 
103  protected:
104  template <typename... Args>
105  constexpr auto _chkcall(Args&&... args) const noexcept {
106  return this->_check(this->_call(std::forward<Args>(args)...));
107  }
108 
109  using base::_conv;
110 
111  template <typename... Args>
112  constexpr auto _cnvchkcall(Args&&... args) const noexcept {
113  return this->_chkcall(_conv(std::forward<Args>(args))...)
114  .cast_to(type_identity<RVC>{});
115  }
116 
117  public:
118  using base::base;
119 
120  constexpr auto operator()(Params... params) const noexcept {
121  return this->_chkcall(_conv(params)...)
122  .cast_to(type_identity<RVC>{});
123  }
124  };
125 
126  // numeric query function
127  template <
128  typename PreTypeList,
129  typename QueryClassList,
130  typename PostTypeList,
131  typename QueryResult,
132  typename W,
133  W c_api::*F>
134  struct query_func;
135 
136  template <
137  typename... PreParams,
138  typename... QueryClasses,
139  typename... PostParams,
140  typename QueryResult,
141  typename W,
142  W c_api::*F>
143  struct query_func<
144  mp_list<PreParams...>,
145  mp_list<QueryClasses...>,
146  mp_list<PostParams...>,
147  QueryResult,
148  W,
149  F> : func<W, F> {
150  using func<W, F>::func;
151 
152  template <
153  typename Query,
154  typename = std::enable_if_t<
155  (true || ... || is_enum_class_value_v<QueryClasses, Query>)>,
156  typename = std::enable_if_t<!std::is_array_v<typename Query::tag_type>>>
157  constexpr auto operator()(
158  PreParams... pre_params,
159  Query query,
160  PostParams... post_params) const noexcept {
161  using RV = typename Query::tag_type;
162  QueryResult result{};
163  return this
164  ->_cnvchkcall(
165  pre_params..., int_type(query), post_params..., &result)
166  .replaced_with(result)
167  .cast_to(type_identity<RV>{});
168  }
169 
170  template <
171  typename Query,
172  typename = std::enable_if_t<
173  (true || ... || is_enum_class_value_v<QueryClasses, Query>)>>
174  auto operator()(
175  PreParams... pre_params,
176  Query query,
177  PostParams... post_params,
178  span<QueryResult> dest) const noexcept {
179  EAGINE_ASSERT(dest.size());
180  return this->_cnvchkcall(
181  pre_params..., int_type(query), post_params..., dest.data());
182  }
183  };
184 
185  // query_devices
186  struct : func<EGLPAFP(QueryDevices)> {
187  using func<EGLPAFP(QueryDevices)>::func;
188 
189  auto count() const noexcept {
190  int_type ret_count{0};
191  return this->_cnvchkcall(0, nullptr, &ret_count)
192  .transformed([&ret_count](auto ok) {
193  return limit_cast<span_size_t>(
194  egl_types::bool_true(ok) ? ret_count : 0);
195  });
196  }
197 
198  auto operator()(span<device_type> dest) const noexcept {
199  int_type ret_count{0};
200  return this
201  ->_cnvchkcall(
202  limit_cast<int_type>(dest.size()), dest.data(), &ret_count)
203  .transformed([dest, &ret_count](auto ok) {
204  return head(
205  dest,
206  limit_cast<span_size_t>(
207  egl_types::bool_true(ok) ? ret_count : 0));
208  });
209  }
210  } query_devices;
211 
212  // query_device_string
213  struct : func<EGLPAFP(QueryDeviceString)> {
214  using func<EGLPAFP(QueryDeviceString)>::func;
215 
216  constexpr auto
217  operator()(device_type dev, device_string_query query) const noexcept {
218  return this->_cnvchkcall(dev, query)
219  .cast_to(type_identity<string_view>{});
220  }
221 
222  constexpr auto operator()(device_handle dev, device_string_query query)
223  const noexcept {
224  return (*this)(device_type(dev), query);
225  }
226 
227  constexpr auto operator()() const noexcept {
228  return this->_fake_empty_c_str().cast_to(
230  }
231  } query_device_string;
232 
233  // get_device_extensions
234  auto get_device_extensions(device_type dev) const noexcept {
235 #ifdef EGL_EXTENSIONS
236  return query_device_string(dev, device_string_query(EGL_EXTENSIONS))
237  .transformed(
238  [](auto src) { return split_into_string_list(src, ' '); });
239 #else
240  return this->_fake_empty_c_str();
241 #endif
242  }
243 
244  auto get_device_extensions(device_handle dev) const noexcept {
245  return get_device_extensions(device_type(dev));
246  }
247 
248  // get_platform_display
249  struct : func<EGLPAFP(GetPlatformDisplay)> {
250  using func<EGLPAFP(GetPlatformDisplay)>::func;
251 
252  constexpr auto operator()(device_handle dev) const noexcept {
253 #ifdef EGL_PLATFORM_DEVICE_EXT
254  return this->_cnvchkcall(EGL_PLATFORM_DEVICE_EXT, dev, nullptr)
255  .cast_to(type_identity<display_handle>{});
256 #else
257  EAGINE_MAYBE_UNUSED(dev);
258  return this->_fake().cast_to(type_identity<display_handle>{});
259 #endif
260  }
261 
262  constexpr auto
263  operator()(platform pltf, void_ptr_type disp) const noexcept {
264  return this->_cnvchkcall(pltf, disp, nullptr)
265  .cast_to(type_identity<display_handle>{});
266  }
267 
268  constexpr auto operator()(
269  platform pltf,
270  void_ptr_type disp,
271  span<const attrib_type> attribs) const noexcept {
272  return this->_cnvchkcall(pltf, disp, attribs.data())
273  .cast_to(type_identity<display_handle>{});
274  }
275 
276  template <std::size_t N>
277  constexpr auto operator()(
278  platform pltf,
279  void_ptr_type disp,
280  const platform_attributes<N>& attribs) const noexcept {
281  return (*this)(pltf, disp, attribs.get());
282  }
283  } get_platform_display;
284 
285  // get_display
286  struct : func<EGLPAFP(GetDisplay)> {
287  using func<EGLPAFP(GetDisplay)>::func;
288 
289  constexpr auto operator()(native_display_type disp) const noexcept {
290  return this->_cnvchkcall(disp).cast_to(
292  }
293 
294  constexpr auto operator()() const noexcept {
295 #ifdef EGL_DEFAULT_DISPLAY
296  return this->_cnvchkcall(EGL_DEFAULT_DISPLAY)
297  .cast_to(type_identity<display_handle>{});
298 #else
299  return this->_fake().cast_to(type_identity<display_handle>{});
300 #endif
301  }
302  } get_display;
303 
304  // get_display_driver_name
305  struct : func<EGLPAFP(GetDisplayDriverName)> {
306  using func<EGLPAFP(GetDisplayDriverName)>::func;
307 
308  constexpr auto operator()(display_handle disp) const noexcept {
309  return this->_cnvchkcall(disp).cast_to(
311  }
312  } get_display_driver_name;
313 
314  // initialize
315  struct : func<EGLPAFP(Initialize)> {
316  using base = func<EGLPAFP(Initialize)>;
317  using base::base;
318  using base::operator();
319 
320  constexpr auto
321  operator()(display_handle disp, int* maj, int* min) const noexcept {
322  return this->_cnvchkcall(disp, maj, min)
323  .transformed(
324  [&maj, &min](auto) { return std::make_tuple(maj, min); });
325  }
326 
327  constexpr auto operator()(display_handle disp) const noexcept {
328  int_type maj{-1};
329  int_type min{-1};
330  return (*this)(disp, &maj, &min);
331  }
332  } initialize;
333 
334  // terminate
335  struct : func<EGLPAFP(Terminate)> {
336  using func<EGLPAFP(Terminate)>::func;
337 
338  constexpr auto operator()(display_handle disp) const noexcept {
339  return this->_cnvchkcall(disp);
340  }
341 
342  auto raii(display_handle disp) noexcept {
343  return eagine::finally([=]() { (*this)(disp); });
344  }
345  } terminate;
346 
347  // get_configs
348  struct : func<EGLPAFP(GetConfigs)> {
349  using func<EGLPAFP(GetConfigs)>::func;
350 
351  auto count(display_handle disp) const noexcept {
352  int_type ret_count{0};
353  return this->_cnvchkcall(disp, nullptr, 0, &ret_count)
354  .transformed([&ret_count](auto ok) {
355  return limit_cast<span_size_t>(
356  egl_types::bool_true(ok) ? ret_count : 0);
357  });
358  }
359 
360  auto
361  operator()(display_handle disp, span<config_type> dest) const noexcept {
362  int_type ret_count{0};
363  return this
364  ->_cnvchkcall(
365  disp, dest.data(), limit_cast<int_type>(dest.size()), &ret_count)
366  .transformed([dest, &ret_count](auto ok) {
367  return head(
368  dest,
369  limit_cast<span_size_t>(
370  egl_types::bool_true(ok) ? ret_count : 0));
371  });
372  }
373  } get_configs;
374 
375  // choose_config
376  struct : func<EGLPAFP(ChooseConfig)> {
377  using func<EGLPAFP(ChooseConfig)>::func;
378 
379  auto count(display_handle disp, span<const int_type> attribs)
380  const noexcept {
381  int_type ret_count{0};
382  return this
383  ->_cnvchkcall(disp, attribs.data(), nullptr, 0, &ret_count)
384  .transformed([&ret_count](auto ok) {
385  return limit_cast<span_size_t>(
386  egl_types::bool_true(ok) ? ret_count : 0);
387  });
388  }
389 
390  template <std::size_t N>
391  auto
392  count(display_handle disp, const config_attributes<N>& attribs) const {
393  return count(disp, attribs.get());
394  }
395 
396  auto count(display_handle disp, const config_attribute_value& attribs)
397  const {
398  return count(disp, config_attributes<2>{attribs});
399  }
400 
401  auto operator()(
402  display_handle disp,
403  span<const int_type> attribs,
404  span<config_type> dest) const noexcept {
405  int_type ret_count{0};
406  return this
407  ->_cnvchkcall(
408  disp,
409  attribs.data(),
410  dest.data(),
411  limit_cast<int_type>(dest.size()),
412  &ret_count)
413  .transformed([dest, &ret_count](auto ok) {
414  return head(
415  dest,
416  limit_cast<span_size_t>(
417  egl_types::bool_true(ok) ? ret_count : 0));
418  });
419  }
420 
421  template <std::size_t N>
422  auto operator()(
423  display_handle disp,
424  const config_attributes<N>& attribs,
425  span<config_type> dest) const noexcept {
426  return (*this)(disp, attribs.get(), dest);
427  }
428 
429  template <std::size_t N>
430  auto operator()(
431  display_handle disp,
432  const config_attributes<N>& attribs) const noexcept {
433  config_type result;
434  return (*this)(disp, attribs.get(), cover_one(&result))
435  .replaced_with(result);
436  }
437 
438  auto operator()(
439  display_handle disp,
440  const config_attribute_value& attribs,
441  span<config_type> dest) const noexcept {
442  return (*this)(disp, config_attributes<2>{attribs}, dest);
443  }
444 
445  auto operator()(
446  display_handle disp,
447  const config_attribute_value& attribs) const noexcept {
448  return (*this)(disp, config_attributes<2>{attribs});
449  }
450  } choose_config;
451 
452  // get_config_attrib
453  query_func<
456  mp_list<>,
457  int_type,
458  EGLPAFP(GetConfigAttrib)>
459  get_config_attrib;
460 
461  // create_window_surface
462  struct : func<EGLPAFP(CreateWindowSurface)> {
463  using func<EGLPAFP(CreateWindowSurface)>::func;
464 
465  constexpr auto operator()(
466  display_handle disp,
467  config_type conf,
468  native_window_type win) const noexcept {
469  return this->_cnvchkcall(disp, conf, win, nullptr)
470  .cast_to(type_identity<surface_handle>{});
471  }
472 
473  constexpr auto operator()(
474  display_handle disp,
475  config_type conf,
476  native_window_type win,
477  span<const int_type> attribs) const noexcept {
478  return this->_cnvchkcall(disp, conf, win, attribs.data())
479  .cast_to(type_identity<surface_handle>{});
480  }
481 
482  template <std::size_t N>
483  constexpr auto operator()(
484  display_handle disp,
485  config_type conf,
486  native_window_type win,
487  const surface_attributes<N> attribs) const noexcept {
488  return (*this)(disp, conf, win, attribs.get());
489  }
490  } create_window_surface;
491 
492  // create_pbuffer_surface
493  struct : func<EGLPAFP(CreatePbufferSurface)> {
494  using func<EGLPAFP(CreatePbufferSurface)>::func;
495 
496  constexpr auto
497  operator()(display_handle disp, config_type conf) const noexcept {
498  return this->_cnvchkcall(disp, conf, nullptr)
499  .cast_to(type_identity<surface_handle>{});
500  }
501 
502  constexpr auto operator()(
503  display_handle disp,
504  config_type conf,
505  span<const int_type> attribs) const noexcept {
506  return this->_cnvchkcall(disp, conf, attribs.data())
507  .cast_to(type_identity<surface_handle>{});
508  }
509 
510  template <std::size_t N>
511  constexpr auto operator()(
512  display_handle disp,
513  config_type conf,
514  const surface_attributes<N> attribs) const noexcept {
515  return (*this)(disp, conf, attribs.get());
516  }
517  } create_pbuffer_surface;
518 
519  // create_pixmap_surface
520  struct : func<EGLPAFP(CreatePixmapSurface)> {
521  using func<EGLPAFP(CreatePixmapSurface)>::func;
522 
523  constexpr auto operator()(
524  display_handle disp,
525  config_type conf,
526  native_pixmap_type pmp) const noexcept {
527  return this->_cnvchkcall(disp, conf, pmp, nullptr)
528  .cast_to(type_identity<surface_handle>{});
529  }
530 
531  constexpr auto operator()(
532  display_handle disp,
533  config_type conf,
534  native_pixmap_type pmp,
535  span<const int_type> attribs) const noexcept {
536  return this->_cnvchkcall(disp, conf, pmp, attribs.data())
537  .cast_to(type_identity<surface_handle>{});
538  }
539 
540  template <std::size_t N>
541  constexpr auto operator()(
542  display_handle disp,
543  config_type conf,
544  native_pixmap_type pmp,
545  const surface_attributes<N> attribs) const noexcept {
546  return (*this)(disp, conf, pmp, attribs.get());
547  }
548  } create_pixmap_surface;
549 
550  // destroy_surface
551  struct : func<EGLPAFP(DestroySurface)> {
552  using func<EGLPAFP(DestroySurface)>::func;
553 
554  constexpr auto
555  operator()(display_handle disp, surface_handle surf) const noexcept {
556  return this->_cnvchkcall(disp, surf);
557  }
558 
559  auto raii(display_handle disp, surface_handle surf) noexcept {
560  return eagine::finally([=]() { (*this)(disp, surf); });
561  }
562  } destroy_surface;
563 
564  // get_current_surface
565  struct : func<EGLPAFP(GetCurrentSurface)> {
566  using func<EGLPAFP(GetCurrentSurface)>::func;
567 
568  constexpr auto operator()(read_draw which) const noexcept {
569  return this->_cnvchkcall(which);
570  }
571  } get_current_surface;
572 
573  // surface_attrib
574  struct : func<EGLPAFP(SurfaceAttrib)> {
575  using func<EGLPAFP(SurfaceAttrib)>::func;
576 
577  constexpr auto operator()(
578  display_handle disp,
579  surface_handle surf,
580  surface_attribute attr,
581  int_type value) const noexcept {
582  return this->_cnvchkcall(disp, surf, attr, value);
583  }
584  } surface_attrib;
585 
586  // query_surface
587  query_func<
590  mp_list<>,
591  int_type,
592  EGLPAFP(QuerySurface)>
593  query_surface;
594 
595  // create_stream
596  struct : func<EGLPAFP(CreateStream)> {
597  using func<EGLPAFP(CreateStream)>::func;
598 
599  constexpr auto operator()(display_handle disp) const noexcept {
600  return this->_cnvchkcall(disp, nullptr)
601  .cast_to(type_identity<stream_handle>{});
602  }
603 
604  constexpr auto operator()(
605  display_handle disp,
606  span<const int_type> attribs) const noexcept {
607  return this->_cnvchkcall(disp, attribs.data())
608  .cast_to(type_identity<stream_handle>{});
609  }
610 
611  template <std::size_t N>
612  constexpr auto operator()(
613  display_handle disp,
614  const stream_attributes<N> attribs) const noexcept {
615  return (*this)(disp, attribs.get());
616  }
617  } create_stream;
618 
619  // destroy_stream
620  struct : func<EGLPAFP(DestroyStream)> {
621  using func<EGLPAFP(DestroyStream)>::func;
622 
623  constexpr auto
624  operator()(display_handle disp, stream_handle surf) const noexcept {
625  return this->_cnvchkcall(disp, surf);
626  }
627 
628  auto raii(display_handle disp, stream_handle surf) noexcept {
629  return eagine::finally([=]() { (*this)(disp, surf); });
630  }
631  } destroy_stream;
632 
633  // stream_attrib
634  struct : func<EGLPAFP(StreamAttrib)> {
635  using func<EGLPAFP(StreamAttrib)>::func;
636 
637  constexpr auto operator()(
638  display_handle disp,
639  stream_handle surf,
640  stream_attribute attr,
641  int_type value) const noexcept {
642  return this->_cnvchkcall(disp, surf, attr, value);
643  }
644  } stream_attrib;
645 
646  // query_stream
647  query_func<
650  mp_list<>,
651  int_type,
652  EGLPAFP(QueryStream)>
653  query_stream;
654 
655  // stream_consumer_gl_texture_external
656  struct : func<EGLPAFP(StreamConsumerGLTextureExternal)> {
657  using func<EGLPAFP(StreamConsumerGLTextureExternal)>::func;
658 
659  constexpr auto
660  operator()(display_handle disp, stream_handle surf) const noexcept {
661  return this->_cnvchkcall(disp, surf);
662  }
663  } stream_consumer_gl_texture_external;
664 
665  // stream_consumer_acquire
666  struct : func<EGLPAFP(StreamConsumerAcquire)> {
667  using func<EGLPAFP(StreamConsumerAcquire)>::func;
668 
669  constexpr auto
670  operator()(display_handle disp, stream_handle surf) const noexcept {
671  return this->_cnvchkcall(disp, surf);
672  }
673  } stream_consumer_acquire;
674 
675  // stream_consumer_release
676  struct : func<EGLPAFP(StreamConsumerRelease)> {
677  using func<EGLPAFP(StreamConsumerRelease)>::func;
678 
679  constexpr auto
680  operator()(display_handle disp, stream_handle surf) const noexcept {
681  return this->_cnvchkcall(disp, surf);
682  }
683  } stream_consumer_release;
684 
685  // get_output_layers
686  struct : func<EGLPAFP(GetOutputLayers)> {
687  using func<EGLPAFP(GetOutputLayers)>::func;
688 
689  auto count(display_handle disp) const noexcept {
690  int_type ret_count{0};
691  return this->_cnvchkcall(disp, nullptr, nullptr, 0, &ret_count)
692  .transformed([&ret_count](auto ok) {
693  return limit_cast<span_size_t>(
694  egl_types::bool_true(ok) ? ret_count : 0);
695  });
696  }
697 
698  auto operator()(
699  display_handle disp,
700  span<attrib_type> attr,
701  span<device_type> dest) const noexcept {
702  int_type ret_count{0};
703  return this
704  ->_cnvchkcall(
705  disp,
706  attr.data(),
707  dest.data(),
708  limit_cast<int_type>(dest.size()),
709  &ret_count)
710  .transformed([dest, &ret_count](auto ok) {
711  return head(
712  dest,
713  limit_cast<span_size_t>(
714  egl_types::bool_true(ok) ? ret_count : 0));
715  });
716  }
717 
718  template <std::size_t N>
719  auto operator()(
720  display_handle disp,
722  span<device_type> dest) const noexcept {
723  return (*this)(disp, attr.get(), dest);
724  }
725  } get_output_layers;
726 
727  // output_layer_attrib
728  struct : func<EGLPAFP(OutputLayerAttrib)> {
729  using func<EGLPAFP(OutputLayerAttrib)>::func;
730  auto operator()(
731  display_handle disp,
732  output_layer_handle outl,
733  output_layer_attribute_value attr) const noexcept {
734  return this->_cnvchkcall(disp, outl, attr._key, attr._value);
735  }
736  } output_layer_attrib;
737 
738  // query_output_layer_attrib
739  struct : func<EGLPAFP(QueryOutputLayerAttrib)> {
740  using func<EGLPAFP(QueryOutputLayerAttrib)>::func;
741  auto operator()(
742  display_handle disp,
743  output_layer_handle outl,
744  output_layer_attribute attr) const noexcept {
745  using RV = attrib_type;
746  attrib_type result{0};
747  return this->_cnvchkcall(disp, outl, attr, &result)
748  .replaced_with(result)
749  .cast_to(type_identity<RV>{});
750  }
751  } query_output_layer_attrib;
752 
753  // query_output_layer_string
754  struct : func<EGLPAFP(QueryOutputLayerString)> {
755  using func<EGLPAFP(QueryOutputLayerString)>::func;
756  auto operator()(
757  display_handle disp,
758  output_layer_handle outl,
759  output_layer_string_query qury) const noexcept {
760  return this->_cnvchkcall(disp, outl, qury)
761  .cast_to(type_identity<string_view>{});
762  }
763  } query_output_layer_string;
764 
765  // get_output_ports
766  struct : func<EGLPAFP(GetOutputPorts)> {
767  using func<EGLPAFP(GetOutputPorts)>::func;
768 
769  auto count(display_handle disp) const noexcept {
770  int_type ret_count{0};
771  return this->_cnvchkcall(disp, nullptr, nullptr, 0, &ret_count)
772  .transformed([&ret_count](auto ok) {
773  return limit_cast<span_size_t>(
774  egl_types::bool_true(ok) ? ret_count : 0);
775  });
776  }
777 
778  auto operator()(
779  display_handle disp,
780  span<attrib_type> attr,
781  span<device_type> dest) const noexcept {
782  int_type ret_count{0};
783  return this
784  ->_cnvchkcall(
785  disp,
786  attr.data(),
787  dest.data(),
788  limit_cast<int_type>(dest.size()),
789  &ret_count)
790  .transformed([dest, &ret_count](auto ok) {
791  return head(
792  dest,
793  limit_cast<span_size_t>(
794  egl_types::bool_true(ok) ? ret_count : 0));
795  });
796  }
797 
798  template <std::size_t N>
799  auto operator()(
800  display_handle disp,
802  span<device_type> dest) const noexcept {
803  return (*this)(disp, attr.get(), dest);
804  }
805  } get_output_ports;
806 
807  // output_port_attrib
808  struct : func<EGLPAFP(OutputPortAttrib)> {
809  using func<EGLPAFP(OutputPortAttrib)>::func;
810  auto operator()(
811  display_handle disp,
812  output_port_handle outp,
813  output_port_attribute_value attr) const noexcept {
814  return this->_cnvchkcall(disp, outp, attr._key, attr._value);
815  }
816  } output_port_attrib;
817 
818  // query_output_port_attrib
819  struct : func<EGLPAFP(QueryOutputPortAttrib)> {
820  using func<EGLPAFP(QueryOutputPortAttrib)>::func;
821  auto operator()(
822  display_handle disp,
823  output_port_handle outp,
824  output_port_attribute attr) const noexcept {
825  using RV = attrib_type;
826  attrib_type result{0};
827  return this->_cnvchkcall(disp, outp, attr, &result)
828  .replaced_with(result)
829  .cast_to(type_identity<RV>{});
830  }
831  } query_output_port_attrib;
832 
833  // query_output_port_string
834  struct : func<EGLPAFP(QueryOutputPortString)> {
835  using func<EGLPAFP(QueryOutputPortString)>::func;
836  auto operator()(
837  display_handle disp,
838  output_port_handle outl,
839  output_port_string_query qury) const noexcept {
840  return this->_cnvchkcall(disp, outl, qury)
841  .cast_to(type_identity<string_view>{});
842  }
843  } query_output_port_string;
844 
845  // create_image
846  struct : func<EGLPAFP(CreateImage)> {
847  using func<EGLPAFP(CreateImage)>::func;
848 
849  constexpr auto operator()(
850  display_handle disp,
851  context_handle ctxt,
852  image_target tgt,
853  client_buffer_type buf,
854  span<const attrib_type> attribs) const noexcept {
855  return this->_cnvchkcall(disp, ctxt, tgt, buf, attribs.data())
856  .cast_to(type_identity<image_handle>{});
857  }
858 
859  template <std::size_t N>
860  constexpr auto operator()(
861  display_handle disp,
862  context_handle ctxt,
863  image_target tgt,
864  client_buffer_type buf,
865  const image_attributes<N> attribs) const noexcept {
866  return (*this)(disp, ctxt, tgt, buf, attribs.get());
867  }
868  } create_image;
869 
870  // destroy_image
871  struct : func<EGLPAFP(DestroyImage)> {
872  using func<EGLPAFP(DestroyImage)>::func;
873 
874  constexpr auto
875  operator()(display_handle disp, image_handle imge) const noexcept {
876  return this->_cnvchkcall(disp, imge);
877  }
878 
879  auto raii(display_handle disp, image_handle imge) noexcept {
880  return eagine::finally([=]() { (*this)(disp, imge); });
881  }
882  } destroy_image;
883 
884  // bind_api
885  struct : func<EGLPAFP(BindAPI)> {
886  using func<EGLPAFP(BindAPI)>::func;
887 
888  constexpr auto operator()(client_api api) const noexcept {
889  return this->_cnvchkcall(api);
890  }
891  } bind_api;
892 
893  // query_api
894  struct : func<EGLPAFP(QueryAPI)> {
895  using func<EGLPAFP(QueryAPI)>::func;
896 
897  constexpr auto operator()() const noexcept {
898  return this->_chkcall().cast_to(type_identity<client_api>{});
899  }
900  } query_api;
901 
902  // create_context
903  struct : func<EGLPAFP(CreateContext)> {
904  using func<EGLPAFP(CreateContext)>::func;
905 
906  constexpr auto operator()(
907  display_handle disp,
908  config_type conf,
909  context_handle share_ctxt,
910  span<const int_type> attribs) const noexcept {
911  return this->_cnvchkcall(disp, conf, share_ctxt, attribs.data())
912  .cast_to(type_identity<context_handle>{});
913  }
914 
915  template <std::size_t N>
916  constexpr auto operator()(
917  display_handle disp,
918  config_type conf,
919  const context_attributes<N> attribs) const noexcept {
920  return (*this)(disp, conf, context_handle{}, attribs.get());
921  }
922 
923  template <std::size_t N>
924  constexpr auto operator()(
925  display_handle disp,
926  config_type conf,
927  context_handle share_ctxt,
928  const context_attributes<N> attribs) const noexcept {
929  return (*this)(disp, conf, share_ctxt, attribs.get());
930  }
931  } create_context;
932 
933  // destroy_context
934  struct : func<EGLPAFP(DestroyContext)> {
935  using func<EGLPAFP(DestroyContext)>::func;
936 
937  constexpr auto
938  operator()(display_handle disp, context_handle ctxt) const noexcept {
939  return this->_cnvchkcall(disp, ctxt);
940  }
941 
942  auto raii(display_handle disp, context_handle ctxt) noexcept {
943  return eagine::finally([=]() { (*this)(disp, ctxt); });
944  }
945  } destroy_context;
946 
947  // make_current
948  struct : func<EGLPAFP(MakeCurrent)> {
949  using func<EGLPAFP(MakeCurrent)>::func;
950 
951  constexpr auto operator()(
952  display_handle disp,
953  surface_handle draw,
954  surface_handle read,
955  context_handle ctxt) const noexcept {
956  return this->_cnvchkcall(disp, draw, read, ctxt);
957  }
958 
959  constexpr auto operator()(
960  display_handle disp,
961  surface_handle surf,
962  context_handle ctxt) const noexcept {
963  return this->_cnvchkcall(disp, surf, surf, ctxt);
964  }
965 
966  constexpr auto none(display_handle disp) const noexcept {
967  return (*this)(disp, surface_handle{}, context_handle{});
968  }
969  } make_current;
970 
971  // get_current_context
972  struct : func<EGLPAFP(GetCurrentContext)> {
973  using func<EGLPAFP(GetCurrentContext)>::func;
974 
975  constexpr auto operator()() const noexcept {
976  return this->_cnvchkcall().cast_to(type_identity<context_handle>{});
977  }
978  } get_current_context;
979 
980  // wait_client
981  struct : func<EGLPAFP(WaitClient)> {
982  using func<EGLPAFP(WaitClient)>::func;
983 
984  constexpr auto operator()() const noexcept {
985  return this->_chkcall();
986  }
987  } wait_client;
988 
989  // wait_native
990  struct : func<EGLPAFP(WaitNative)> {
991  using func<EGLPAFP(WaitNative)>::func;
992 
993  constexpr auto operator()() const noexcept {
994 #ifdef EGL_CORE_NATIVE_ENGINEs
995  return this->_chkcall(EGL_CORE_NATIVE_ENGINE);
996 #else
997  return this->_fake();
998 #endif
999  }
1000  } wait_native;
1001 
1002  // create_sync
1003  struct : func<EGLPAFP(CreateSync)> {
1004  using func<EGLPAFP(CreateSync)>::func;
1005 
1006  constexpr auto operator()(
1007  display_handle disp,
1008  sync_type type,
1009  span<const attrib_type> attribs) const noexcept {
1010  return this->_cnvchkcall(disp, type, attribs.data())
1011  .cast_to(type_identity<sync_handle>{});
1012  }
1013 
1014  template <std::size_t N>
1015  constexpr auto operator()(
1016  display_handle disp,
1017  sync_type type,
1018  const sync_attributes<N> attribs) const noexcept {
1019  return (*this)(disp, type, attribs.get());
1020  }
1021  } create_sync;
1022 
1023  // client_wait_sync
1024  struct : func<EGLPAFP(ClientWaitSync)> {
1025  using func<EGLPAFP(ClientWaitSync)>::func;
1026 
1027  template <typename R, typename P>
1028  constexpr auto operator()(
1029  display_handle disp,
1030  sync_handle sync,
1031  std::chrono::duration<R, P> timeout) const noexcept {
1032  return this->_cnvchkcall(
1033  disp, sync, 0, std::chrono::nanoseconds(timeout).count());
1034  }
1035 
1036  template <typename R, typename P>
1037  constexpr auto
1038  forever(display_handle disp, sync_handle sync) const noexcept {
1039 #ifdef EGL_FOREVER
1040  return this->_cnvchkcall(disp, sync, 0, EGL_FOREVER);
1041 #else
1042  return this->_fake({});
1043 #endif
1044  }
1045  } client_wait_sync;
1046 
1047  // wait_sync
1048  struct : func<EGLPAFP(WaitSync)> {
1049  using func<EGLPAFP(WaitSync)>::func;
1050 
1051  constexpr auto
1052  operator()(display_handle disp, sync_handle sync) const noexcept {
1053  return this->_cnvchkcall(disp, sync, 0);
1054  }
1055  } wait_sync;
1056 
1057  // destroy_sync
1058  struct : func<EGLPAFP(DestroySync)> {
1059  using func<EGLPAFP(DestroySync)>::func;
1060 
1061  constexpr auto
1062  operator()(display_handle disp, sync_handle sync) const noexcept {
1063  return this->_cnvchkcall(disp, sync);
1064  }
1065  } destroy_sync;
1066 
1067  // query_string
1068  struct : func<EGLPAFP(QueryString)> {
1069  using func<EGLPAFP(QueryString)>::func;
1070 
1071  constexpr auto
1072  operator()(display_handle disp, string_query query) const noexcept {
1073  return this->_cnvchkcall(disp, query)
1074  .cast_to(type_identity<string_view>{});
1075  }
1076 
1077  constexpr auto operator()() const noexcept {
1078  return this->_fake_empty_c_str().cast_to(
1080  }
1081  } query_string;
1082 
1083  // query_strings
1084  auto query_strings(
1085  display_handle disp,
1086  string_query query,
1087  char separator) noexcept {
1088  return query_string(disp, query).transformed([separator](auto src) {
1089  return split_into_string_list(src, separator);
1090  });
1091  }
1092 
1093  // get_client_apis
1094  auto get_client_apis(display_handle disp) const noexcept {
1095 #ifdef EGL_CLIENT_APIS
1096  return query_string(disp, string_query(EGL_CLIENT_APIS))
1097 #else
1098  return query_string()
1099 #endif
1100  .transformed(
1101  [](auto src) { return split_into_string_list(src, ' '); });
1102  }
1103 
1104  auto get_client_api_bits(display_handle disp) const noexcept {
1105  enum_bitfield<client_api_bit> result{};
1106 
1107  if(ok apis{get_client_apis(disp)}) {
1108  for(auto api : apis) {
1109 #ifdef EGL_OPENGL_BIT
1110  if(are_equal(api, string_view("OpenGL"))) {
1111  result.add(client_api_bit(EGL_OPENGL_BIT));
1112  }
1113 #endif
1114 #ifdef EGL_OPENGL_ES_BIT
1115  if(are_equal(api, string_view("OpenGL_ES"))) {
1116  result.add(client_api_bit(EGL_OPENGL_ES_BIT));
1117  }
1118 #endif
1119 #ifdef EGL_OPENVG_BIT
1120  if(are_equal(api, string_view("OpenVG"))) {
1121  result.add(client_api_bit(EGL_OPENVG_BIT));
1122  }
1123 #endif
1124  }
1125  }
1126 
1127  return result;
1128  }
1129 
1130  // get_extensions
1131  auto get_extensions() const noexcept {
1132 #if defined(EGL_EXTENSIONS) && defined(EGL_NO_DISPLAY)
1133  return query_string(
1134  display_handle(EGL_NO_DISPLAY), string_query(EGL_EXTENSIONS))
1135 #else
1136  return query_string()
1137 #endif
1138  .transformed(
1139  [](auto src) { return split_into_string_list(src, ' '); });
1140  }
1141 
1142  // get_extensions
1143  auto get_extensions(display_handle disp) const noexcept {
1144 #ifdef EGL_EXTENSIONS
1145  return query_string(disp, string_query(EGL_EXTENSIONS))
1146 #else
1147  return query_string()
1148 #endif
1149  .transformed(
1150  [](auto src) { return split_into_string_list(src, ' '); });
1151  }
1152 
1153  // has_extension
1154  auto has_extension(string_view which) const noexcept {
1155  if(ok extensions{get_extensions()}) {
1156  for(auto ext_name : extensions) {
1157  if(ends_with(ext_name, which)) {
1158  return true;
1159  }
1160  }
1161  }
1162  return false;
1163  }
1164 
1165  auto has_extension(device_handle dev, string_view which) const noexcept {
1166  if(ok extensions{get_device_extensions(dev)}) {
1167  for(auto ext_name : extensions) {
1168  if(ends_with(ext_name, which)) {
1169  return true;
1170  }
1171  }
1172  }
1173  return false;
1174  }
1175 
1176  auto has_extension(display_handle disp, string_view which) const noexcept {
1177  if(ok extensions{get_extensions(disp)}) {
1178  for(auto ext_name : extensions) {
1179  if(ends_with(ext_name, which)) {
1180  return true;
1181  }
1182  }
1183  }
1184  return false;
1185  }
1186 
1187  // swap_interval
1188  struct : func<EGLPAFP(SwapInterval)> {
1189  using func<EGLPAFP(SwapInterval)>::func;
1190 
1191  constexpr auto
1192  operator()(display_handle disp, int_type interval) const noexcept {
1193  return this->_cnvchkcall(disp, interval);
1194  }
1195  } swap_interval;
1196 
1197  // swap_buffers
1198  struct : func<EGLPAFP(SwapBuffers)> {
1199  using func<EGLPAFP(SwapBuffers)>::func;
1200 
1201  constexpr auto
1202  operator()(display_handle disp, surface_handle surf) const noexcept {
1203  return this->_cnvchkcall(disp, surf);
1204  }
1205  } swap_buffers;
1206 
1207  // swap_buffers_with_damage
1208  struct : func<EGLPAFP(SwapBuffersWithDamage)> {
1209  using func<EGLPAFP(SwapBuffersWithDamage)>::func;
1210 
1211  constexpr auto operator()(
1212  display_handle disp,
1213  surface_handle surf,
1214  span<const int_type> rects) const noexcept {
1215  EAGINE_ASSERT(rects.size() % 4 == 0);
1216  return this->_cnvchkcall(
1217  disp, surf, rects.data(), limit_cast<int_type>(rects.size()));
1218  }
1219  } swap_buffers_with_damage;
1220 
1221  // release_thread
1222  func<EGLPAFP(ReleaseThread)> release_thread;
1223 
1224  basic_egl_operations(api_traits& traits);
1225 };
1226 //------------------------------------------------------------------------------
1227 #undef OGLPAFP
1228 //------------------------------------------------------------------------------
1229 } // namespace eagine::eglp
1230 
1231 #endif // EGLPLUS_EGL_API_API_HPP
egl_api_function< bool_type(display_type, output_layer_type, int_type, attrib_type *), nullptr > QueryOutputLayerAttrib
Definition: c_api.hpp:338
egl_api_function< bool_type(display_type, stream_type), nullptr > StreamConsumerAcquire
Definition: c_api.hpp:307
Typed enumeration for EGL output layer string query constants.
Definition: enum_types.hpp:145
egl_api_function< bool_type(display_type, output_layer_type, int_type, attrib_type), nullptr > OutputLayerAttrib
Definition: c_api.hpp:331
egl_api_function< bool_type(display_type, sync_type), nullptr > DestroySync
Definition: c_api.hpp:479
basic_handle< display_tag, nothing_t > display_handle
Alias for EGL display handle wrapper.
Definition: objects.hpp:75
static constexpr auto ends_with(basic_span< T1, P1, S1 > spn, basic_span< T2, P2, S2 > with) -> bool
Indicates if span spn ends with the content of with.
Definition: span_algo.hpp:187
basic_string_span< const char > string_view
Alias for const string views.
Definition: string_span.hpp:116
egl_api_function< enum_type(), nullptr > QueryAPI
Definition: c_api.hpp:401
char char_type
String character type.
Definition: config.hpp:57
EGL-related code is placed in this namespace.
Definition: eglplus.hpp:11
Class wrapping the functions from the EGL API.
Definition: api.hpp:37
A single key/value pair for a key/value list.
Definition: key_val_list.hpp:27
egl_api_function< bool_type(display_type, stream_type, int_type, int_type *), nullptr > QueryStream
Definition: c_api.hpp:297
egl_api_function< bool_type(display_type, surface_type, int_type, int_type), nullptr > SurfaceAttrib
Definition: c_api.hpp:266
egl_api_function< int_type(), nullptr > GetError
Definition: c_api.hpp:127
egl_api_function< const char_type *(display_type, int_type), nullptr > QueryString
Definition: c_api.hpp:182
egl_api_function< bool_type(display_type, surface_type, const int_type *, int_type), nullptr > SwapBuffersWithDamage
Definition: c_api.hpp:526
egl_api_function< display_type(enum_type, void_ptr_type, const attrib_type *), nullptr > GetPlatformDisplay
Definition: c_api.hpp:151
egl_api_function< bool_type(display_type, int_type *, int_type *), nullptr > Initialize
Definition: c_api.hpp:170
Typed enumeration for EGL string query constants.
Definition: enum_types.hpp:50
static constexpr auto head(basic_span< T, P, S > s, L l) noexcept -> basic_span< T, P, S >
Returns the first l elements from the front of a span.
Definition: span_algo.hpp:99
egl_api_function< context_type(display_type, config_type, context_type, const int_type *), nullptr > CreateContext
Definition: c_api.hpp:408
EGLConfig config_type
Config handle type.
Definition: config.hpp:89
EGLNativePixmapType native_pixmap_type
Native pixmap handle type.
Definition: config.hpp:80
egl_api_function< bool_type(display_type, stream_type, int_type, int_type), nullptr > StreamAttrib
Definition: c_api.hpp:290
Typed enumeration for EGL image target constants.
Definition: enum_types.hpp:173
egl_api_function< bool_type(display_type, const attrib_type *, output_port_type *, int_type, int_type *), nullptr > GetOutputPorts
Definition: c_api.hpp:357
EGLNativeDisplayType native_display_type
Native display handle type.
Definition: config.hpp:74
egl_api_function< bool_type(display_type, context_type), nullptr > DestroyContext
Definition: c_api.hpp:415
egl_api_function< surface_type(display_type, config_type, native_window_type, const int_type *), nullptr > CreateWindowSurface
Definition: c_api.hpp:217
EGLNativeWindowType native_window_type
Native window handle type.
Definition: config.hpp:77
Non-owning wrapper for C-API opaque handle types.
Definition: handle.hpp:26
egl_api_function< bool_type(), nullptr > WaitClient
Definition: c_api.hpp:439
Typed enumeration for EGL read/draw specifier constants.
Definition: enum_types.hpp:206
egl_api_function< bool_type(display_type, surface_type), nullptr > SwapBuffers
Definition: c_api.hpp:519
egl_api_function< bool_type(display_type, const int_type *, config_type *, int_type, int_type *), nullptr > ChooseConfig
Definition: c_api.hpp:196
typename egl_types::sync_type sync_type
Alias for sync type.
Definition: c_api.hpp:48
egl_api_function< bool_type(display_type, stream_type), nullptr > StreamConsumerRelease
Definition: c_api.hpp:312
EGLenum enum_type
Enumeration type.
Definition: config.hpp:113
egl_api_function< bool_type(enum_type), nullptr > BindAPI
Definition: c_api.hpp:397
void * void_ptr_type
Untyped non-const pointer type.
Definition: config.hpp:54
egl_api_function< const char_type *(display_type, output_layer_type, int_type), nullptr > QueryOutputLayerString
Definition: c_api.hpp:345
Typed enumeration for EGL stream attribute constants.
Definition: enum_types.hpp:124
egl_api_function< bool_type(display_type, sync_type, int_type), nullptr > WaitSync
Definition: c_api.hpp:465
Value typically wrapping function call result and success indicator.
Definition: extract.hpp:128
Typed enumeration for EGL output layer attribute constants.
Definition: enum_types.hpp:138
static auto finally(Func func) -> func_on_scope_exit< Func >
Function constructing on-scope-exit actions.
Definition: scope_exit.hpp:144
Class wrapping the C-functions from the EGL API.
Definition: c_api.hpp:32
egl_api_function< surface_type(display_type, config_type, native_pixmap_type, const int_type *), nullptr > CreatePixmapSurface
Definition: c_api.hpp:238
egl_api_function< bool_type(display_type, surface_type, int_type, int_type *), nullptr > QuerySurface
Definition: c_api.hpp:273
Typed enumeration for EGL output port attribute constants.
Definition: enum_types.hpp:152
egl_api_function< bool_type(display_type, const attrib_type *, output_layer_type *, int_type, int_type *), nullptr > GetOutputLayers
Definition: c_api.hpp:324
auto get() const noexcept -> span< const value_type >
A const view of the internal element array.
Definition: key_val_list.hpp:154
egl_api_function< context_type(), nullptr > GetCurrentContext
Definition: c_api.hpp:427
Typed enumeration for EGL client API type constants.
Definition: enum_types.hpp:97
egl_api_function< bool_type(display_type, image_type), nullptr > DestroyImage
Definition: c_api.hpp:498
Typed enumeration for EGL client API bit constants.
Definition: enum_types.hpp:103
egl_api_function< const char_type *(device_type, int_type), nullptr > QueryDeviceString
Definition: c_api.hpp:144
Template for classes wrapping static key/value typically attribute lists.
Definition: key_val_list.hpp:21
egl_api_function< bool_type(display_type, surface_type), nullptr > DestroySurface
Definition: c_api.hpp:252
egl_api_function< bool_type(display_type, output_port_type, int_type, attrib_type), nullptr > OutputPortAttrib
Definition: c_api.hpp:364
void * device_type
Device handle type.
Definition: config.hpp:60
Typed enumeration for EGL device string query constants.
Definition: enum_types.hpp:56
egl_api_function< surface_type(display_type, const int_type *), nullptr > CreateStream
Definition: c_api.hpp:278
Typed enumeration for EGL platform constants.
Definition: enum_types.hpp:37
egl_api_function< sync_type(display_type, enum_type, const attrib_type *), nullptr > CreateSync
Definition: c_api.hpp:451
EGLClientBuffer client_buffer_type
Client buffer handle type.
Definition: config.hpp:83
egl_api_function< bool_type(display_type), nullptr > Terminate
Definition: c_api.hpp:175
egl_api_function< int_type(display_type, sync_type, int_type, time_type), nullptr > ClientWaitSync
Definition: c_api.hpp:458
Class representing a timeout since construction or reset.
Definition: timeout.hpp:47
egl_api_function< bool_type(int_type), nullptr > WaitNative
Definition: c_api.hpp:444
Typed enumeration for EGL surface attribute constants.
Definition: enum_types.hpp:76
egl_api_function< bool_type(display_type, config_type, int_type, int_type *), nullptr > GetConfigAttrib
Definition: c_api.hpp:203
egl_api_function< surface_type(int_type), nullptr > GetCurrentSurface
Definition: c_api.hpp:259
Compile-time type list template.
Definition: mp_list.hpp:20
egl_api_function< bool_type(display_type, int_type), nullptr > SwapInterval
Definition: c_api.hpp:512
Typed enumeration for EGL output port string query constants.
Definition: enum_types.hpp:159
egl_api_function< surface_type(display_type, stream_type), nullptr > DestroyStream
Definition: c_api.hpp:283
Template type used mostly for function type-tag dispatching.
Definition: type_identity.hpp:19
egl_api_function< surface_type(display_type, config_type, const int_type *), nullptr > CreatePbufferSurface
Definition: c_api.hpp:224
egl_api_function< bool_type(int_type, device_type, int_type *), nullptr > QueryDevices
Definition: c_api.hpp:139
EGLAttrib attrib_type
Config attribute handle type.
Definition: config.hpp:92
egl_api_function< bool_type(display_type, output_port_type, int_type, attrib_type *), nullptr > QueryOutputPortAttrib
Definition: c_api.hpp:371
egl_api_function< bool_type(), nullptr > ReleaseThread
Definition: c_api.hpp:531
egl_api_function< bool_type(display_type, surface_type, surface_type, context_type), nullptr > MakeCurrent
Definition: c_api.hpp:422
egl_api_function< const char_type *(display_type, output_port_type, int_type), nullptr > QueryOutputPortString
Definition: c_api.hpp:378
egl_api_function< const char_type *(display_type), nullptr > GetDisplayDriverName
Definition: c_api.hpp:163
EGLint int_type
Signed integer type.
Definition: config.hpp:116
egl_api_function< image_type(display_type, context_type, enum_type, client_buffer_type, const attrib_type *), nullptr > CreateImage
Definition: c_api.hpp:491
egl_api_function< bool_type(display_type, stream_type), nullptr > StreamConsumerGLTextureExternal
Definition: c_api.hpp:302
egl_api_function< display_type(native_display_type), nullptr > GetDisplay
Definition: c_api.hpp:158
egl_api_function< bool_type(display_type, config_type *, int_type, int_type *), nullptr > GetConfigs
Definition: c_api.hpp:189

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