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/Windows/GPU/WindowsGLContext.h
Views: 1401
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() override;
32
void StopThread() override;
33
34
Draw::DrawContext *GetDrawContext() override { return draw_; }
35
36
private:
37
void ReleaseGLContext();
38
39
bool renderThread_;
40
Draw::DrawContext *draw_;
41
GLRenderManager *renderManager_;
42
HINSTANCE hInst_;
43
HDC hDC; // Private GDI Device Context
44
HGLRC hRC; // Permanent Rendering Context
45
HWND hWnd_; // Holds Our Window Handle
46
volatile bool pauseRequested;
47
volatile bool resumeRequested;
48
HANDLE pauseEvent;
49
HANDLE resumeEvent;
50
};
51
52