Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hrydgard
GitHub Repository: hrydgard/ppsspp
Path: blob/master/Windows/GPU/WindowsGLContext.h
5682 views
1
#pragma once
2
3
#include "Common/CommonWindows.h"
4
#include "Windows/GPU/WindowsGraphicsContext.h"
5
6
namespace Draw {
7
class DrawContext;
8
}
9
10
class GLRenderManager;
11
12
class WindowsGLContext : public WindowsGraphicsContext {
13
public:
14
bool Init(HINSTANCE hInst, HWND window, std::string *error_message) override;
15
16
bool InitFromRenderThread(std::string *errorMessage) override;
17
void ShutdownFromRenderThread() override;
18
19
void Shutdown() override;
20
21
void Poll() override;
22
23
// Used during window resize. Must be called from the window thread,
24
// not the rendering thread or CPU thread.
25
void Pause() override;
26
void Resume() override;
27
void Resize() override;
28
29
void ThreadStart() override;
30
void ThreadEnd() override;
31
bool ThreadFrame(bool waitIfEmpty) override;
32
33
Draw::DrawContext *GetDrawContext() override { return draw_; }
34
35
private:
36
void ReleaseGLContext();
37
38
bool renderThread_;
39
Draw::DrawContext *draw_;
40
GLRenderManager *renderManager_;
41
HINSTANCE hInst_;
42
HDC hDC; // Private GDI Device Context
43
HGLRC hRC; // Permanent Rendering Context
44
HWND hWnd_; // Holds Our Window Handle
45
volatile bool pauseRequested;
46
volatile bool resumeRequested;
47
HANDLE pauseEvent;
48
HANDLE resumeEvent;
49
};
50
51