mirror of
https://github.com/libretro/parallel-gx1.git
synced 2026-11-07 04:26:01 -10:00
The OpenGL renderer draws on the context the frontend hands over through libretro GL, and the core makes no context of its own: the platform context code goes, EGL, EGLX11, EGL for Android, WGL, AGL, BGL and the GLX window, with the shared contexts made for the shader compiler's threads, and GLContext::Create makes the libretro context alone. Programs are compiled on the frontend's context, so the OpenGL backend reports no background compiling and its shader compiler runs no threads; the shared-context compiler, its glFinish and VAO rebinds and the driver bug that switched it off go with it. Android no longer links libEGL.
74 lines
1.4 KiB
C++
74 lines
1.4 KiB
C++
// Copyright 2014 Dolphin Emulator Project
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
#include <memory>
|
|
|
|
#include "Common/GL/GLContext.h"
|
|
|
|
#include "DolphinLibretro/VideoContexts/GLContextLR.h"
|
|
|
|
const std::array<std::pair<int, int>, 9> GLContext::s_desktop_opengl_versions = {
|
|
{{4, 6}, {4, 5}, {4, 4}, {4, 3}, {4, 2}, {4, 1}, {4, 0}, {3, 3}, {3, 2}}};
|
|
|
|
GLContext::~GLContext() = default;
|
|
|
|
bool GLContext::Initialize(const WindowSystemInfo& wsi, bool stereo, bool core)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
bool GLContext::IsHeadless() const
|
|
{
|
|
return true;
|
|
}
|
|
|
|
bool GLContext::MakeCurrent()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
bool GLContext::ClearCurrent()
|
|
{
|
|
return false;
|
|
}
|
|
|
|
void GLContext::Update()
|
|
{
|
|
}
|
|
|
|
void GLContext::UpdateSurface(void* window_handle)
|
|
{
|
|
}
|
|
|
|
void GLContext::Swap()
|
|
{
|
|
}
|
|
|
|
void GLContext::SwapInterval(int interval)
|
|
{
|
|
}
|
|
|
|
void* GLContext::GetFuncAddress(const std::string& name)
|
|
{
|
|
return nullptr;
|
|
}
|
|
|
|
std::unique_ptr<GLContext> GLContext::Create(const WindowSystemInfo& wsi, bool stereo, bool core,
|
|
bool prefer_gles)
|
|
{
|
|
std::unique_ptr<GLContext> context;
|
|
if (wsi.type == WindowSystemType::Libretro)
|
|
context = std::make_unique<GLContextLR>();
|
|
if (!context)
|
|
return nullptr;
|
|
|
|
// Option to prefer GLES on desktop platforms, useful for testing.
|
|
if (prefer_gles)
|
|
context->m_opengl_mode = Mode::OpenGLES;
|
|
|
|
if (!context->Initialize(wsi, stereo, core))
|
|
return nullptr;
|
|
|
|
return context;
|
|
}
|