KiCad PCB EDA Suite
Loading...
Searching...
No Matches
rhi_control_commands.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#ifndef RHI_CONTROL_COMMANDS_H
21#define RHI_CONTROL_COMMANDS_H
22
23#include <rhi/rhi_surface.h>
24
25#include <cstdint>
26#include <functional>
27#include <variant>
28
29namespace KIGFX
30{
31class FRAME_MAILBOX;
32}
33
34
39using RHI_WINDOW_ID = uint32_t;
40
41
43{
45 uint64_t generation = 0;
46 float refreshHz = 0.0f;
47};
48
49
61
62
64{
66 uint32_t width = 0;
67 uint32_t height = 0;
68 float dpiScale = 1.0f;
69};
70
71
76
77
79{
80 std::function<void()> onComplete;
81
83 bool flushFrames = false;
84};
85
86
90using RHI_CONTROL_COMMAND = std::variant<
96>;
97
98
99
100#endif // RHI_CONTROL_COMMANDS_H
Lock-free single-slot mailbox carrying frame state from the main thread to the render thread.
The Cairo implementation of the graphics abstraction layer.
Definition eda_group.h:30
std::variant< RHI_CMD_FRAME_REQUEST, RHI_CMD_SWAPCHAIN_CREATE, RHI_CMD_SWAPCHAIN_RESIZE, RHI_CMD_SWAPCHAIN_DESTROY, RHI_CMD_FENCE > RHI_CONTROL_COMMAND
One entry in the render thread control queue.
uint32_t RHI_WINDOW_ID
Routes control commands to a swapchain.
bool flushFrames
Draw the frames requested before the fence, for a reader of their pixels.
std::function< void()> onComplete
float refreshHz
display refresh rate, 0 when unknown
KIGFX::FRAME_MAILBOX * frame2DMailbox
Owned by the panel.
RHI_NATIVE_WINDOW_HANDLE nativeHandle
Platform-agnostic wrapper for a native window handle.
Definition rhi_surface.h:45