From c98b332b046d3be53e7a0fc0975dcd1e1f2b398a Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Fri, 26 Feb 2021 19:13:02 +1000 Subject: [PATCH] GL: Add missing context_egl_fbdev files --- src/common/gl/context_egl_fbdev.cpp | 32 +++++++++++++++++++++++++++++ src/common/gl/context_egl_fbdev.h | 21 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 src/common/gl/context_egl_fbdev.cpp create mode 100644 src/common/gl/context_egl_fbdev.h diff --git a/src/common/gl/context_egl_fbdev.cpp b/src/common/gl/context_egl_fbdev.cpp new file mode 100644 index 000000000..26e106f6f --- /dev/null +++ b/src/common/gl/context_egl_fbdev.cpp @@ -0,0 +1,32 @@ +#include "context_egl_fbdev.h" + +namespace GL { +ContextEGLFBDev::ContextEGLFBDev(const WindowInfo& wi) : ContextEGL(wi) {} +ContextEGLFBDev::~ContextEGLFBDev() = default; + +std::unique_ptr ContextEGLFBDev::Create(const WindowInfo& wi, const Version* versions_to_try, + size_t num_versions_to_try) +{ + std::unique_ptr context = std::make_unique(wi); + if (!context->Initialize(versions_to_try, num_versions_to_try)) + return nullptr; + + return context; +} + +std::unique_ptr ContextEGLFBDev::CreateSharedContext(const WindowInfo& wi) +{ + std::unique_ptr context = std::make_unique(wi); + context->m_display = m_display; + + if (!context->CreateContextAndSurface(m_version, m_context, false)) + return nullptr; + + return context; +} + +EGLNativeWindowType ContextEGLFBDev::GetNativeWindow(EGLConfig config) +{ + return static_cast(0); +} +} // namespace GL diff --git a/src/common/gl/context_egl_fbdev.h b/src/common/gl/context_egl_fbdev.h new file mode 100644 index 000000000..a0178700b --- /dev/null +++ b/src/common/gl/context_egl_fbdev.h @@ -0,0 +1,21 @@ +#pragma once +#include "context_egl.h" + +namespace GL { + +class ContextEGLFBDev final : public ContextEGL +{ +public: + ContextEGLFBDev(const WindowInfo& wi); + ~ContextEGLFBDev() override; + + static std::unique_ptr Create(const WindowInfo& wi, const Version* versions_to_try, + size_t num_versions_to_try); + + std::unique_ptr CreateSharedContext(const WindowInfo& wi) override; + +protected: + EGLNativeWindowType GetNativeWindow(EGLConfig config) override; +}; + +} // namespace GL