summaryrefslogtreecommitdiff
path: root/kmscube/cube-egl.h
blob: 73e3ab1283e469d229241e1540a2c9f46d58e31a (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
#pragma once

#include <EGL/egl.h>

class EglState
{
public:
	EglState(void* native_display);
	EglState(void* native_display, EGLint native_visual_id);
	~EglState();

	EGLDisplay display() const { return m_display; }
	EGLConfig config() const { return m_config; }
	EGLContext context() const { return m_context; }
	EGLint native_visual_id() const { return m_native_visual_id; }

private:
	EGLDisplay m_display;
	EGLConfig m_config;
	EGLContext m_context;
	EGLint m_native_visual_id;
};

class EglSurface
{
public:
	EglSurface(const EglState& egl, void* native_window);
	~EglSurface();

	void make_current();
	void swap_buffers();

private:
	const EglState& egl;

	EGLSurface esurface;
};