41 lines
743 B
C++
41 lines
743 B
C++
#pragma once
|
|
#ifndef H_RENDERER_
|
|
#define H_RENDERER_
|
|
|
|
#include <EGL/egl.h>
|
|
#include <EGL/eglext.h>
|
|
#include <wayland-egl.h>
|
|
|
|
class Renderer {
|
|
public:
|
|
static Renderer *GetInstance();
|
|
|
|
public:
|
|
const EGLConfig &GetConfig() const;
|
|
|
|
public:
|
|
void DestroyWindow(const EGLSurface& surface, struct wl_egl_window* window);
|
|
|
|
void DestroyContext(const EGLContext& context);
|
|
|
|
EGLContext CreateContext();
|
|
|
|
EGLSurface CreateSurface(struct wl_egl_window *window);
|
|
|
|
void SurfaceSetContext(const EGLSurface &surface, const EGLContext &context);
|
|
|
|
void SwapBuffers(const EGLSurface &surface);
|
|
|
|
private:
|
|
Renderer();
|
|
~Renderer();
|
|
|
|
private:
|
|
static Renderer *s_instance;
|
|
|
|
EGLDisplay m_egl_display;
|
|
EGLConfig m_config;
|
|
};
|
|
|
|
#endif // H_RENDERER_
|