BlosSOM
Interactive dimensionality reduction on large datasets (EmbedSOM and FLOWER combined)
wrapper_glfw.h
Go to the documentation of this file.
1/* This file is part of BlosSOM.
2 *
3 * Copyright (C) 2021 Sona Molnarova
4 *
5 * BlosSOM is free software: you can redistribute it and/or modify it under
6 * the terms of the GNU General Public License as published by the Free
7 * Software Foundation, either version 3 of the License, or (at your option)
8 * any later version.
9 *
10 * BlosSOM is distributed in the hope that it will be useful, but WITHOUT ANY
11 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13 * details.
14 *
15 * You should have received a copy of the GNU General Public License along with
16 * BlosSOM. If not, see <https://www.gnu.org/licenses/>.
17 */
18
19#ifndef WRAPPER_GLFW_H
20#define WRAPPER_GLFW_H
21
22#include "input_data.h"
23
24#define GLFW_INCLUDE_NONE
25#include <GLFW/glfw3.h>
26#include <glad/glad.h>
27
28#include <string>
29
30#include "frame_stats.h"
31
32/**
33 * @brief Wrapper of the Glfw library.
34 *
35 * It abstracts window creation, deletition and handles callbacks.
36 *
37 */
39{
40public:
43 bool init(const std::string &window_name, InputData &input);
45 void end_frame(FrameStats &fs);
46 void destroy();
47
48 GLFWwindow *window;
49
50private:
51 static void error_callback(int error, const char *description);
52 static void framebuffer_size_callback(GLFWwindow *window,
53 int width,
54 int height);
55 static void key_callback(GLFWwindow *window,
56 int key,
57 int scancode,
58 int action,
59 int mods);
60 static void scroll_callback(GLFWwindow *window,
61 double xoffset,
62 double yoffset);
63 static void mouse_button_callback(GLFWwindow *window,
64 int button,
65 int action,
66 int mods);
67 static void cursor_position_callback(GLFWwindow *window,
68 double xpos,
69 double ypos);
70};
71
72#endif // WRAPPER_GLFW_H
Wrapper of the Glfw library.
Definition: wrapper_glfw.h:39
static void cursor_position_callback(GLFWwindow *window, double xpos, double ypos)
static void error_callback(int error, const char *description)
static void framebuffer_size_callback(GLFWwindow *window, int width, int height)
bool init(const std::string &window_name, InputData &input)
GLFWwindow * window
Definition: wrapper_glfw.h:48
bool window_should_close()
void end_frame(FrameStats &fs)
static void scroll_callback(GLFWwindow *window, double xoffset, double yoffset)
static void key_callback(GLFWwindow *window, int key, int scancode, int action, int mods)
static void mouse_button_callback(GLFWwindow *window, int button, int action, int mods)
void destroy()
Input events data storage.
Definition: input_data.h:30