1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//! ## Asdf Overlay
//! Asdf overlay let you put overlay infront of existing windows gpu framebuffer.
//!
//! It hooks various graphics API call to detect graphical windows in the process.
//! Asdf overlay automatically decides which graphics API the window is using,
//! chooses suitable renderer.
//!
//! It can also capture inputs going through the target window.
//! You can listen them or even block them from reaching application handlers.
//!
//! ## Example
//! ```no_run
//! use asdf_overlay::initialize;
//! use asdf_overlay::event_sink::OverlayEventSink;
//!
//! let module_handle, window_hwnd;
//! // Initialize asdf-overlay.
//! initialize(module_handle).expect("initialization failed");
//!
//! // Initialize Event sink.
//! // Without setting it, the overlay will not render.
//! // This is intended because windows state will be out of sync if you miss any events.
//! OverlayEventSink::set(move |event| {
//! // Do something with events.
//! });
//!
//! Backends::with_backend(window_hwnd, |backend| {
//! // Do something with overlay window backend.
//! });
//! ```
/// Generated OpenGL bindings and global function tables.
/// Generated WGL bindings and global function tables.
use ;
use OnceCell;
use HINSTANCE;
/// Module handle of the overlay.
static INSTANCE: = new;
/// Get overlay [`HINSTANCE`]
pub
/// Initialize overlay, hooks.
///
/// * Calling more than once will fail.
/// * Calling with holding loader lock (DllMain) will fail.
/// * If given `hinstance` is invalid, some resources may not appear correctly.