CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
hrydgard

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: hrydgard/ppsspp
Path: blob/master/libretro/LibretroGLCoreContext.cpp
Views: 1401
1
#include "ppsspp_config.h"
2
#include "Common/Log.h"
3
#include "Core/Config.h"
4
#include "Core/ConfigValues.h"
5
#include "Core/System.h"
6
#include "Common/GPU/OpenGL/GLFeatures.h"
7
8
#include "libretro/LibretroGLCoreContext.h"
9
10
bool LibretroGLCoreContext::Init() {
11
if (!LibretroHWRenderContext::Init(false))
12
return false;
13
14
g_Config.iGPUBackend = (int)GPUBackend::OPENGL;
15
return true;
16
}
17
18
void LibretroGLCoreContext::CreateDrawContext() {
19
if (!glewInitDone) {
20
#if !PPSSPP_PLATFORM(IOS) && !defined(USING_GLES2)
21
if (glewInit() != GLEW_OK) {
22
ERROR_LOG(Log::G3D, "glewInit() failed.\n");
23
return;
24
}
25
#endif
26
glewInitDone = true;
27
CheckGLExtensions();
28
}
29
draw_ = Draw::T3DCreateGLContext(false);
30
renderManager_ = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
31
renderManager_->SetInflightFrames(g_Config.iInflightFrames);
32
SetGPUBackend(GPUBackend::OPENGL);
33
draw_->CreatePresets();
34
}
35
36
void LibretroGLCoreContext::DestroyDrawContext() {
37
LibretroHWRenderContext::DestroyDrawContext();
38
renderManager_ = nullptr;
39
}
40
41