ppsspp/libretro/LibretroGLContext.h

41 lines
1.1 KiB
C
Raw Normal View History

2018-03-24 11:44:53 +00:00
#pragma once
#include "Common/GPU/OpenGL/GLCommon.h"
2018-03-24 11:44:53 +00:00
#include "libretro/LibretroGraphicsContext.h"
#include "Common/GPU/OpenGL/GLRenderManager.h"
2018-03-24 11:44:53 +00:00
class LibretroGLContext : public LibretroHWRenderContext {
2018-03-26 16:37:34 +00:00
public:
2018-03-24 11:44:53 +00:00
LibretroGLContext()
#ifdef USING_GLES2
: LibretroHWRenderContext(RETRO_HW_CONTEXT_OPENGLES2)
2018-03-24 11:44:53 +00:00
#else
2018-03-26 16:37:34 +00:00
: LibretroHWRenderContext(RETRO_HW_CONTEXT_OPENGL)
2018-03-24 11:44:53 +00:00
#endif
{
hw_render_.bottom_left_origin = true;
}
bool Init() override;
void CreateDrawContext() override;
void DestroyDrawContext() override;
2018-03-26 16:37:34 +00:00
void SetRenderTarget() override {
2018-03-24 11:44:53 +00:00
extern GLuint g_defaultFBO;
g_defaultFBO = hw_render_.get_current_framebuffer();
}
void ThreadStart() override { renderManager_->ThreadStart(draw_); }
2018-03-24 11:44:53 +00:00
bool ThreadFrame() override { return renderManager_->ThreadFrame(); }
void ThreadEnd() override { renderManager_->ThreadEnd(); }
2018-03-26 16:37:34 +00:00
void StopThread() override {
2018-03-24 11:44:53 +00:00
renderManager_->StopThread();
}
GPUCore GetGPUCore() override { return GPUCORE_GLES; }
const char *Ident() override { return "OpenGL"; }
2018-03-26 16:37:34 +00:00
private:
2018-03-24 11:44:53 +00:00
GLRenderManager *renderManager_ = nullptr;
bool glewInitDone = false;
};