GL: Add missing context_egl_fbdev files

This commit is contained in:
Connor McLaughlin 2021-02-26 19:13:02 +10:00
parent 52c842e3b3
commit c98b332b04
2 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,32 @@
#include "context_egl_fbdev.h"
namespace GL {
ContextEGLFBDev::ContextEGLFBDev(const WindowInfo& wi) : ContextEGL(wi) {}
ContextEGLFBDev::~ContextEGLFBDev() = default;
std::unique_ptr<Context> ContextEGLFBDev::Create(const WindowInfo& wi, const Version* versions_to_try,
size_t num_versions_to_try)
{
std::unique_ptr<ContextEGLFBDev> context = std::make_unique<ContextEGLFBDev>(wi);
if (!context->Initialize(versions_to_try, num_versions_to_try))
return nullptr;
return context;
}
std::unique_ptr<Context> ContextEGLFBDev::CreateSharedContext(const WindowInfo& wi)
{
std::unique_ptr<ContextEGLFBDev> context = std::make_unique<ContextEGLFBDev>(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<EGLNativeWindowType>(0);
}
} // namespace GL

View File

@ -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<Context> Create(const WindowInfo& wi, const Version* versions_to_try,
size_t num_versions_to_try);
std::unique_ptr<Context> CreateSharedContext(const WindowInfo& wi) override;
protected:
EGLNativeWindowType GetNativeWindow(EGLConfig config) override;
};
} // namespace GL