-
Notifications
You must be signed in to change notification settings - Fork 345
/
Copy pathopengl.h
40 lines (34 loc) · 1.08 KB
/
opengl.h
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
//
// Created by Alan Freitas on 26/08/20.
//
#ifndef MATPLOTPLUSPLUS_OPENGL_H
#define MATPLOTPLUSPLUS_OPENGL_H
#include <matplot/detail/config.h>
#include <matplot/backend/opengl_embed.h>
#include <mutex>
#include <thread>
namespace matplot::backend {
class MATPLOT_EXPORTS opengl : public opengl_embed {
public:
opengl();
~opengl();
public:
bool new_frame() override;
bool render_data() override;
void show(matplot::figure_type *) override;
bool should_close() override;
void window_title(const std::string& title) override;
std::string window_title() override;
public:
static constexpr unsigned int default_screen_width = 560;
static constexpr unsigned int default_screen_height = 420;
static void initialize_glfw();
static double get_time();
private:
GLFWwindow *window_;
std::string window_title_;
std::mutex this_window_in_context_;
static bool glfw_is_initialized;
};
} // namespace matplot::backend
#endif // MATPLOTPLUSPLUS_OPENGL_H