-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathuwp_egl_context.h
65 lines (46 loc) · 1.11 KB
/
uwp_egl_context.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// SPDX-FileCopyrightText: 2023 Rebel Engine contributors
// SPDX-FileCopyrightText: 2014-2022 Godot Engine contributors
// SPDX-FileCopyrightText: 2007-2014 Juan Linietsky, Ariel Manzur
//
// SPDX-License-Identifier: MIT
#ifndef UWP_EGL_CONTEXT_H
#define UWP_EGL_CONTEXT_H
#include "core/error_list.h"
#include "core/os/os.h"
#include <EGL/egl.h>
#include <wrl.h>
using namespace Windows::UI::Core;
class UwpGLContext {
public:
enum Driver {
GLES_2_0,
GLES_3_0,
};
private:
CoreWindow ^ window;
EGLDisplay mEglDisplay;
EGLContext mEglContext;
EGLSurface mEglSurface;
EGLint width;
EGLint height;
bool vsync;
Driver driver;
public:
void release_current();
void make_current();
int get_window_width();
int get_window_height();
void swap_buffers();
void set_use_vsync(bool use) {
vsync = use;
}
bool is_using_vsync() const {
return vsync;
}
Error initialize();
void reset();
void cleanup();
UwpGLContext(CoreWindow ^ p_window, Driver p_driver);
~UwpGLContext();
};
#endif // UWP_EGL_CONTEXT_H