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/android/jni/AndroidGraphicsContext.h
Views: 1401
1
#pragma once
2
3
#include <android/native_window_jni.h>
4
5
#include "Common/GPU/thin3d.h"
6
#include "Common/GraphicsContext.h"
7
8
enum {
9
ANDROID_VERSION_GINGERBREAD = 9,
10
ANDROID_VERSION_ICS = 14,
11
ANDROID_VERSION_JELLYBEAN = 16,
12
ANDROID_VERSION_KITKAT = 19,
13
ANDROID_VERSION_LOLLIPOP = 21,
14
ANDROID_VERSION_MARSHMALLOW = 23,
15
ANDROID_VERSION_NOUGAT = 24,
16
ANDROID_VERSION_NOUGAT_1 = 25,
17
};
18
19
enum class GraphicsContextState {
20
PENDING,
21
INITIALIZED,
22
FAILED_INIT,
23
SHUTDOWN,
24
};
25
26
class AndroidGraphicsContext : public GraphicsContext {
27
public:
28
// This is different than the base class function since on
29
// Android (EGL, Vulkan) we do have all this info on the render thread.
30
virtual bool InitFromRenderThread(ANativeWindow *wnd, int desiredBackbufferSizeX, int desiredBackbufferSizeY, int backbufferFormat, int androidVersion) = 0;
31
virtual void BeginAndroidShutdown() {}
32
virtual GraphicsContextState GetState() const { return state_; }
33
34
protected:
35
GraphicsContextState state_ = GraphicsContextState::PENDING;
36
37
private:
38
using GraphicsContext::InitFromRenderThread;
39
};
40
41