Sunshine master
Self-hosted game stream host for Moonlight.
x11grab.h
Go to the documentation of this file.
1
5#pragma once
6
7// standard includes
8#include <optional>
9
10// local includes
11#include "src/platform/common.h"
12#include "src/utility.h"
13
14// X11 Display
15extern "C" struct _XDisplay;
16
17namespace egl {
18 class cursor_t;
19}
20
21namespace platf::x11 {
22 struct cursor_ctx_raw_t;
28 void freeCursorCtx(cursor_ctx_raw_t *ctx);
34 void freeDisplay(_XDisplay *xdisplay);
35
44
48 class cursor_t {
49 public:
55 static std::optional<cursor_t> make();
56
62 void capture(egl::cursor_t &img);
63
73 void blend(img_t &img, int offsetX, int offsetY);
74
76 };
77
83 xdisplay_t make_display();
84} // namespace platf::x11
Cursor image and hotspot metadata captured from the window system.
Definition graphics.h:587
X11 cursor image and positioning state used during capture.
Definition x11grab.h:48
static std::optional< cursor_t > make()
Allocate the underlying object and wrap it in the owning handle.
Definition x11grab.cpp:1026
void blend(img_t &img, int offsetX, int offsetY)
Definition x11grab.cpp:1065
cursor_ctx_t ctx
X11 cursor context used to track and blend cursor images.
Definition x11grab.h:75
void capture(egl::cursor_t &img)
Run the capture loop for this backend.
Definition x11grab.cpp:1038
Unique pointer wrapper with customizable pointer and deleter types.
Definition utility.h:820
Declarations for common platform specific utilities.
Captured frame buffer shared between capture and encode stages.
Definition common.h:502
Declarations for utility functions.
void freeDisplay(_XDisplay *xdisplay)
Release display resources.
Definition x11grab.cpp:1079
void freeCursorCtx(cursor_ctx_t::pointer ctx)
Release cursor context resources.
Definition x11grab.cpp:1088