nyorain / rvg

High level vulkan 2D vector-like graphics api (C++)
Boost Software License 1.0
186 stars 11 forks source link

Configure ny to run with x11 backend? #2

Closed jb55 closed 6 years ago

jb55 commented 6 years ago

When I try to compile with/without wayland it doesn't configure x11 backend, any idea how to do that? When I configure with wayland libs it doesn't show the warning but still fails at runtime with the message:

terminate called after throwing an instance of 'std::runtime_error'
  what():  ny::Backend: no backend available
zsh: abort      ./build/example/example

buildlog

WARNING: building ny without any valid backends

|Executing subproject ny.
|
|Project name: ny
|Native C compiler: gcc (gcc 7.3.0 "gcc (GCC) 7.3.0")
|Native C++ compiler: g++ (gcc 7.3.0 "g++ (GCC) 7.3.0")
|Dependency threads found: YES (cached)
|Dependency dlg from subproject subprojects/dlg found: YES (cached)
|Dependency nytl from subproject subprojects/nytl found: YES (cached)
|Dependency vulkan found: YES (cached)
|Dependency egl found: NO
|Native dependency xkbcommon found: YES 0.8.0
|Native dependency x11 found: YES 1.6.5
|Native dependency x11-xcb found: YES 1.6.5
|Native dependency xi found: YES 1.7.9
|Native dependency xcursor found: YES 1.1.15
|Native dependency xcb found: YES 1.12
|Dependency xcb-ewmh found: NO
|Dependency xcb-icccm found: NO
|Native dependency xcb-shm found: YES 1.12
|Native dependency xcb-xkb found: YES 1.12
|Native dependency xkbcommon-x11 found: YES 0.8.0
|Dependency wayland-client found: NO
|Dependency wayland-cursor found: NO
|Message: WARNING: building ny without any valid backends
|Configuring config.hpp using configuration
|Build targets in project: 15
nyorain commented 6 years ago

You need the xcb-ewmh and xcb-icccm libraries for the x11 backend (see the meson log). I will write an example for glfw as well soon, glfw has fewer dependencies iirc.

nyorain commented 6 years ago

I quickly ported the example to glfw in 6103fcf. Just pull it from master, run meson configure -Dexample-glfw=true in your build directory and then you should be able to run it (call ./example/example_glfw in the builddir, that's where it expects to be called). Make sure you have the x11 glfw package with vulkan support installed.

jb55 commented 6 years ago

that works! thanks!

nyorain commented 6 years ago

glad to hear! Will close both issues then. Please let me know any ideas to improve the library or make its usage/building easier.