Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ option('rt_cap', type: 'feature', description: 'Support for
option('drm_backend', type: 'feature', description: 'DRM Atomic Backend')
option('sdl2_backend', type: 'feature', description: 'SDL2 Window Backend')
option('avif_screenshots', type: 'feature', description: 'Support for saving .AVIF HDR screenshots')
option('jxl_screenshots', type: 'feature', description: 'Support for saving .JXL HDR screenshots')
option('input_emulation' , type: 'feature', description: 'Support for XTest/Input Emulation with libei')
option('enable_gamescope', type : 'boolean', value : true, description: 'Build Gamescope executable')
option('enable_gamescope_wsi_layer', type : 'boolean', value : true, description: 'Build Gamescope layer')
Expand Down
2 changes: 2 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ const struct option *gamescope_options = (struct option[]){
{ "hdr-itm-enabled", no_argument, nullptr, 0 },
{ "hdr-itm-sdr-nits", required_argument, nullptr, 0 },
{ "hdr-itm-target-nits", required_argument, nullptr, 0 },
{ "screenshot-format", required_argument, nullptr, 0 },
{ "hdr-debug-force-support", no_argument, nullptr, 0 },
{ "hdr-debug-force-output", no_argument, nullptr, 0 },
{ "hdr-debug-heatmap", no_argument, nullptr, 0 },
Expand Down Expand Up @@ -212,6 +213,7 @@ const char usage[] =
" Default: 100 nits, Max: 1000 nits\n"
" --hdr-itm-target-nits set the target luminace of the inverse tone mapping process.\n"
" Default: 1000 nits, Max: 10000 nits\n"
" --screenshot-format 0: AVIF, 1: JXL\n"
" --framerate-limit Set a simple framerate limit. Used as a divisor of the refresh rate, rounds down eg 60 / 59 -> 60fps, 60 / 25 -> 30fps. Default: 0, disabled.\n"
" --mangoapp Launch with the mangoapp (mangohud) performance overlay enabled. You should use this instead of using mangohud on the game or gamescope.\n"
" --adaptive-sync Enable adaptive sync if available (variable rate refresh)\n"
Expand Down
6 changes: 5 additions & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ cap_dep = dependency('libcap', required: get_option('rt_cap'))
epoll_dep = dependency('epoll-shim', required: false)
sdl2_dep = dependency('SDL2', required: get_option('sdl2_backend'))
avif_dep = dependency('libavif', version: '>=1.0.0', required: get_option('avif_screenshots'))
jxl_dep = dependency('libjxl', version: '>=0.7.0', required: get_option('jxl_screenshots'))
jxl_threads_dep = dependency('libjxl_threads', version: '>=0.7.0', required: get_option('jxl_screenshots'))
pixman_dep = dependency('pixman-1')
udev_dep = dependency('libudev')

Expand Down Expand Up @@ -105,6 +107,7 @@ src = [
'Script/Script.cpp',
'BufferMemo.cpp',
'steamcompmgr.cpp',
'screenshot_format.cpp',
'convar.cpp',
'commit.cpp',
'color_helpers.cpp',
Expand Down Expand Up @@ -149,6 +152,7 @@ endif
gamescope_cpp_args += '-DHAVE_DRM=@0@'.format(drm_dep.found().to_int())
gamescope_cpp_args += '-DHAVE_SDL2=@0@'.format(sdl2_dep.found().to_int())
gamescope_cpp_args += '-DHAVE_AVIF=@0@'.format(avif_dep.found().to_int())
gamescope_cpp_args += '-DHAVE_JXL=@0@'.format(jxl_dep.found().to_int())
gamescope_cpp_args += '-DHAVE_LIBCAP=@0@'.format(cap_dep.found().to_int())
gamescope_cpp_args += '-DHAVE_LIBEIS=@0@'.format(eis_dep.found().to_int())
gamescope_cpp_args += '-DHAVE_LIBSYSTEMD=@0@'.format(libsystemd_dep.found().to_int())
Expand Down Expand Up @@ -198,7 +202,7 @@ gamescope_version = configure_file(
dep_xxf86vm, dep_xres, glm_dep, drm_dep, wayland_server,
xkbcommon, thread_dep, sdl2_dep, wlroots_dep,
vulkan_dep, liftoff_dep, dep_xtst, dep_xmu, cap_dep, epoll_dep, pipewire_dep, librt_dep,
stb_dep, displayinfo_dep, openvr_dep, dep_xcursor, avif_dep, dep_xi,
stb_dep, displayinfo_dep, openvr_dep, dep_xcursor, avif_dep, jxl_dep, jxl_threads_dep, dep_xi,
libdecor_dep, eis_dep, luajit_dep, libinput_dep, libsystemd_dep, pixman_dep, udev_dep,
],
install: true,
Expand Down
4 changes: 4 additions & 0 deletions src/screenshot_format.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "screenshot_format.h"

// Initialize as AVIF
screenshot_format format = screenshot_format::AVIF;
9 changes: 9 additions & 0 deletions src/screenshot_format.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#pragma once

enum class screenshot_format : int {
AVIF = 0,
JXL = 1
};

// Global variable declaration
extern screenshot_format format;
Loading