~ppsspp/ppsspp/ppsspp_1.3.0

« back to all changes in this revision

Viewing changes to Common/GL/GLInterface/EGL.h

  • Committer: Sérgio Benjamim
  • Date: 2017-01-02 00:12:05 UTC
  • Revision ID: sergio_br2@yahoo.com.br-20170102001205-cxbta9za203nmjwm
1.3.0 source (from ppsspp_1.3.0-r160.p5.l1762.a165.t83~56~ubuntu16.04.1.tar.xz).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2008 Dolphin Emulator Project
 
2
// Licensed under GPLv2+
 
3
// Refer to the license.txt file included.
 
4
 
 
5
#pragma once
 
6
 
 
7
#include <string>
 
8
#include <EGL/egl.h>
 
9
 
 
10
#include "Common/GL/GLInterfaceBase.h"
 
11
 
 
12
#ifdef ANDROID
 
13
// On Android, EGL creation is so early that our regular logging system is not
 
14
// up and running yet. Use Android logging.
 
15
#include "base/logging.h"
 
16
#define EGL_ILOG(...) ILOG(__VA_ARGS__)
 
17
#define EGL_ELOG(...) ELOG(__VA_ARGS__)
 
18
 
 
19
#else
 
20
 
 
21
#define EGL_ILOG(...) INFO_LOG(G3D, __VA_ARGS__)
 
22
#define EGL_ELOG(...) INFO_LOG(G3D, __VA_ARGS__)
 
23
 
 
24
#endif
 
25
 
 
26
 
 
27
class cInterfaceEGL : public cInterfaceBase {
 
28
public:
 
29
        void SwapInterval(int Interval) override;
 
30
        void Swap() override;
 
31
        void SetMode(u32 mode) override { s_opengl_mode = mode; }
 
32
        void* GetFuncAddress(const std::string& name) override;
 
33
        bool Create(void *window_handle, bool core, bool use565) override;
 
34
        bool MakeCurrent() override;
 
35
        bool ClearCurrent() override;
 
36
        void Shutdown() override;
 
37
 
 
38
protected:
 
39
        EGLSurface egl_surf;
 
40
        EGLContext egl_ctx;
 
41
        EGLDisplay egl_dpy;
 
42
 
 
43
        virtual EGLDisplay OpenDisplay() = 0;
 
44
        virtual EGLNativeWindowType InitializePlatform(EGLNativeWindowType host_window, EGLConfig config) = 0;
 
45
        virtual void ShutdownPlatform() = 0;
 
46
        virtual void SetInternalResolution(int internalWidth, int internalHeight) {}
 
47
        const char *EGLGetErrorString(EGLint error);
 
48
 
 
49
private:
 
50
        bool ChooseAndCreate(void *window_handle, bool core, bool use565);
 
51
        void DetectMode();
 
52
};