Files
ppsspp/Windows/GPU/WindowsGLContext.h

51 lines
1.2 KiB
C
Raw Permalink Normal View History

2012-11-01 16:19:01 +01:00
#pragma once
#include "Common/CommonWindows.h"
#include "Windows/GPU/WindowsGraphicsContext.h"
2012-11-01 16:19:01 +01:00
2016-12-25 18:18:19 +01:00
namespace Draw {
2016-12-25 21:01:57 +01:00
class DrawContext;
2016-12-25 18:18:19 +01:00
}
class GLRenderManager;
class WindowsGLContext : public WindowsGraphicsContext {
public:
bool Init(HINSTANCE hInst, HWND window, std::string *error_message) override;
bool InitFromRenderThread(std::string *errorMessage) override;
void ShutdownFromRenderThread() override;
void Shutdown() override;
void Poll() override;
// Used during window resize. Must be called from the window thread,
// not the rendering thread or CPU thread.
void Pause() override;
void Resume() override;
void Resize() override;
void ThreadStart() override;
void ThreadEnd() override;
bool ThreadFrame() override;
void StopThread() override;
Draw::DrawContext *GetDrawContext() override { return draw_; }
2016-01-01 12:50:38 +01:00
private:
void ReleaseGLContext();
bool renderThread_;
Draw::DrawContext *draw_;
GLRenderManager *renderManager_;
HINSTANCE hInst_;
2016-01-01 12:50:38 +01:00
HDC hDC; // Private GDI Device Context
HGLRC hRC; // Permanent Rendering Context
HWND hWnd_; // Holds Our Window Handle
2016-01-01 12:50:38 +01:00
volatile bool pauseRequested;
volatile bool resumeRequested;
HANDLE pauseEvent;
HANDLE resumeEvent;
};