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/Common/GraphicsContext.h
Views: 1401
1
#pragma once
2
3
#include <string>
4
5
#include "Common/GPU/thin3d.h"
6
7
// Init is done differently on each platform, and done close to the creation, so it's
8
// expected to be implemented by subclasses.
9
class GraphicsContext {
10
public:
11
virtual ~GraphicsContext() {}
12
13
virtual bool InitFromRenderThread(std::string *errorMessage) { return true; }
14
virtual void ShutdownFromRenderThread() {}
15
16
virtual void Shutdown() = 0;
17
18
// Used during window resize. Must be called from the window thread,
19
// not the rendering thread or CPU thread.
20
virtual void Pause() {}
21
virtual void Resume() {}
22
23
virtual void Resize() = 0;
24
25
// Needs casting to the appropriate type, unfortunately. Should find a better solution..
26
virtual void *GetAPIContext() { return nullptr; }
27
28
// Called from the render thread from threaded backends.
29
virtual void ThreadStart() {}
30
virtual bool ThreadFrame() { return true; }
31
virtual void ThreadEnd() {}
32
virtual void StopThread() {}
33
34
// Useful for checks that need to be performed every frame.
35
// Should strive to get rid of these.
36
virtual void Poll() {}
37
38
virtual Draw::DrawContext *GetDrawContext() = 0;
39
};
40
41