summaryrefslogtreecommitdiff
path: root/src/SSVOpenHexagon/Global/Imgui.cpp
blob: 3dbe2ddcbcdda36dd478f8f71737384325d6789c (plain)
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
// Copyright (c) 2013-2020 Vittorio Romeo
// License: Academic Free License ("AFL") v. 3.0
// AFL License page: https://opensource.org/licenses/AFL-3.0

#include "SSVOpenHexagon/Global/Imgui.hpp"

#ifndef SSVOH_ANDROID
#include <imgui.h>
#include <misc/cpp/imgui_stdlib.h>
#include <imgui-SFML.h>
#endif

#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>

namespace hg::Imgui {

[[nodiscard]] bool initialize([[maybe_unused]] sf::RenderWindow& window)
{
#ifndef SSVOH_ANDROID
    return ImGui::SFML::Init(window);
#endif
}

void shutdown()
{
#ifndef SSVOH_ANDROID
    ImGui::SFML::Shutdown();
#endif
}

[[nodiscard]] bool wantCaptureKeyboard()
{
#ifndef SSVOH_ANDROID
    return ImGui::GetIO().WantCaptureKeyboard;
#else
    return false;
#endif
}

[[nodiscard]] bool wantCaptureMouse()
{
#ifndef SSVOH_ANDROID
    return ImGui::GetIO().WantCaptureMouse;
#else
    return false;
#endif
}

void processEvent([[maybe_unused]] const sf::Event& event)
{
#ifndef SSVOH_ANDROID
    ImGui::SFML::ProcessEvent(event);
#endif
}

void render([[maybe_unused]] sf::RenderTarget& renderTarget)
{
#ifndef SSVOH_ANDROID
    ImGui::SFML::Render(renderTarget);
#endif
}

} // namespace hg::Imgui