summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/vi/vsync_manager.cpp
blob: bdc4dfa966ff359213d027515078bd435fe44474 (plain) (blame)
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
// SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later

#include "core/hle/service/os/event.h"
#include "core/hle/service/vi/vsync_manager.h"

namespace Service::VI {

VsyncManager::VsyncManager() = default;
VsyncManager::~VsyncManager() = default;

void VsyncManager::SignalVsync() {
    for (auto* event : m_vsync_events) {
        event->Signal();
    }
}

void VsyncManager::LinkVsyncEvent(Event* event) {
    m_vsync_events.insert(event);
}

void VsyncManager::UnlinkVsyncEvent(Event* event) {
    m_vsync_events.erase(event);
}

} // namespace Service::VI