ppsspp/libretro/LibretroGLCoreContext.cpp
Henrik Rydgård e01ca5b057
Logging API change (refactor) (#19324)
* Rename LogType to Log

* Explicitly use the Log:: enum when logging. Allows for autocomplete when editing.

* Mac/ARM64 buildfix

* Do the same with the hle result log macros

* Rename the log names to mixed case while at it.

* iOS buildfix

* Qt buildfix attempt, ARM32 buildfix
2024-07-14 14:42:59 +02:00

40 lines
1.0 KiB
C++

#include "ppsspp_config.h"
#include "Common/Log.h"
#include "Core/Config.h"
#include "Core/ConfigValues.h"
#include "Core/System.h"
#include "Common/GPU/OpenGL/GLFeatures.h"
#include "libretro/LibretroGLCoreContext.h"
bool LibretroGLCoreContext::Init() {
if (!LibretroHWRenderContext::Init(false))
return false;
g_Config.iGPUBackend = (int)GPUBackend::OPENGL;
return true;
}
void LibretroGLCoreContext::CreateDrawContext() {
if (!glewInitDone) {
#if !PPSSPP_PLATFORM(IOS) && !defined(USING_GLES2)
if (glewInit() != GLEW_OK) {
ERROR_LOG(Log::G3D, "glewInit() failed.\n");
return;
}
#endif
glewInitDone = true;
CheckGLExtensions();
}
draw_ = Draw::T3DCreateGLContext(false);
renderManager_ = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
renderManager_->SetInflightFrames(g_Config.iInflightFrames);
SetGPUBackend(GPUBackend::OPENGL);
draw_->CreatePresets();
}
void LibretroGLCoreContext::DestroyDrawContext() {
LibretroHWRenderContext::DestroyDrawContext();
renderManager_ = nullptr;
}