summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-13 23:41:31 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-13 23:41:31 +0300
commit76073fe5fad8799e5850805f2f090af2cb62c741 (patch)
tree9658019babe4760a3634bdab4da0731a10e42e68 /meson.build
parentdd1775a9927922c14f8679ccbc4d3ca8d5917e20 (diff)
Simplify the public event and CPU API
Applications now need far less ceremony: hello.c is a 20-line loop that handles REFRESH, CLOSE and QUIT and draws into the surface's own pixels. - Fold GEOMETRY, STATE and FOCUS into one WINDOW event carrying size, scale and state; unchanged values send nothing. - Guarantee REFRESH once a window has a size and after every resize, never at size zero. - Merge DROP_HOVER into DROP with over/leave/data actions and give drag and drop actions enums. - Keep event strings valid until the next wait and drop yasl_event_release; empty or failed waits report NONE. - Replace copy-in presentation with a lent pixel buffer: yasl_cpu_pixels and yasl_cpu_present. - Remove yasl_poll_event, yasl_cpu_read_pixels, unused event fields and comments that restated names. - Wayland: resize floating windows in request_size instead of reporting it unsupported, and stop marking new GPU surfaces as Vulkan so yasl_vulkan_create_surface no longer fails with NATIVE_WINDOW_IN_USE. Also includes the in-progress public API refactor that was uncommitted in the tree (removal of the app/loop layer, new surface, GL and Vulkan entry points). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build30
1 files changed, 26 insertions, 4 deletions
diff --git a/meson.build b/meson.build
index 9a59016..4d7d7ce 100644
--- a/meson.build
+++ b/meson.build
@@ -21,6 +21,8 @@ sources = []
has_wayland = false
has_x11 = false
has_dbus = false
+has_egl = false
+has_vulkan = false
has_cocoa = system == 'darwin'
if system == 'linux'
@@ -46,6 +48,17 @@ if system == 'linux'
if has_dbus
deps += [dbus]
endif
+ egl_dep = dependency('egl', required: false)
+ wayland_egl_dep = dependency('wayland-egl', required: false)
+ has_egl = egl_dep.found() and (not has_wayland or wayland_egl_dep.found())
+ if has_egl
+ deps += egl_dep
+ if has_wayland
+ deps += wayland_egl_dep
+ endif
+ endif
+ vulkan_dep = dependency('vulkan', required: false)
+ has_vulkan = vulkan_dep.found()
m_dep = cc.find_library('m', required: false)
rt_dep = cc.find_library('rt', required: false)
deps += [m_dep, rt_dep]
@@ -63,17 +76,24 @@ elif system == 'darwin'
error('Cocoa requires macOS 14 or newer. Set MACOSX_DEPLOYMENT_TARGET=14.0 or a newer target before configuring.')
endif
deps += [
- dependency('appleframeworks', modules: ['AppKit', 'Metal', 'QuartzCore', 'UserNotifications']),
+ dependency('appleframeworks', modules: ['AppKit', 'Metal', 'QuartzCore', 'UserNotifications', 'OpenGL']),
]
else
error('YASL supports Linux and macOS.')
endif
+if has_cocoa
+ vulkan_dep = dependency('vulkan', required: false)
+ has_vulkan = vulkan_dep.found()
+endif
+
if not has_wayland and not has_x11 and not has_cocoa
error('Enable at least one window backend.')
endif
add_project_arguments(
+ '-DYASL_HAS_EGL=' + (has_egl ? '1' : '0'),
+ '-DYASL_HAS_VULKAN=' + (has_vulkan ? '1' : '0'),
'-DYASL_HAS_WAYLAND=' + (has_wayland ? '1' : '0'),
'-DYASL_HAS_X11=' + (has_x11 ? '1' : '0'),
'-DYASL_HAS_COCOA=' + (has_cocoa ? '1' : '0'),
@@ -103,10 +123,12 @@ yasl_dep = declare_dependency(
meson.override_dependency('yasl', yasl_dep)
install_headers(
- 'include/yasl/yasl.h', 'include/yasl/app.h', 'include/yasl/loop.h',
- 'include/yasl/timing.h', 'include/yasl/keycodes.h', 'include/yasl/native.h',
- 'include/yasl/desktop.h', subdir: 'yasl',
+ 'include/yasl/yasl.h', 'include/yasl/keycodes.h', 'include/yasl/cpu.h',
+ 'include/yasl/gl.h', 'include/yasl/metal.h', 'include/yasl/desktop.h', subdir: 'yasl',
)
+if has_vulkan
+ install_headers('include/yasl/vulkan.h', subdir: 'yasl')
+endif
if has_wayland
install_headers('include/yasl/native/wayland.h', subdir: 'yasl/native')
endif