ladybird/Userland/Libraries/LibAccelGfx/Context.h
Aliaksandr Kalenik 6d1a1daff9 LibAccelGfx+LibWeb: Use framebuffer object instead of EGLs PBuffer
Framebuffer object is allocated using OpenGL's API and is not platform
specific which means it could be used on both macOS and Linux unlike
EGL specific PBuffer.
2023-11-11 22:19:43 +01:00

38 lines
768 B
C++

/*
* Copyright (c) 2023, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Assertions.h>
#include <AK/OwnPtr.h>
// Make sure egl.h doesn't give us definitions from X11 headers
#define EGL_NO_X11
#include <EGL/egl.h>
#undef EGL_NO_X11
namespace AccelGfx {
class Context {
public:
static Context& the();
static OwnPtr<Context> create();
Context(EGLDisplay egl_display, EGLContext egl_context, EGLConfig egl_config)
: m_egl_display(egl_display)
, m_egl_context(egl_context)
, m_egl_config(egl_config)
{
}
private:
EGLDisplay m_egl_display { nullptr };
EGLContext m_egl_context { nullptr };
EGLConfig m_egl_config { nullptr };
};
}