2014-02-10 11:54:46 -07:00
|
|
|
// Copyright 2014 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2012-12-17 14:01:52 -07:00
|
|
|
|
2014-02-10 11:54:46 -07:00
|
|
|
#pragma once
|
2012-12-17 14:01:52 -07:00
|
|
|
|
2014-03-12 13:33:41 -06:00
|
|
|
#include <string>
|
2014-03-27 18:26:52 -06:00
|
|
|
#include <EGL/egl.h>
|
2014-02-17 03:18:15 -07:00
|
|
|
|
|
|
|
#include "Core/ConfigManager.h"
|
2014-08-02 00:21:03 -06:00
|
|
|
#include "VideoBackends/OGL/GLInterfaceBase.h"
|
2012-12-17 14:01:52 -07:00
|
|
|
|
2014-01-19 19:06:55 -07:00
|
|
|
|
|
|
|
class cPlatform
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
#if HAVE_X11
|
|
|
|
cXInterface XInterface;
|
|
|
|
#endif
|
|
|
|
#if HAVE_WAYLAND
|
|
|
|
cWaylandInterface WaylandInterface;
|
|
|
|
#endif
|
|
|
|
public:
|
|
|
|
enum egl_platform platform;
|
|
|
|
bool SelectDisplay(void);
|
2014-01-23 19:41:07 -07:00
|
|
|
bool Init(EGLConfig config, void *window_handle);
|
2014-01-19 19:06:55 -07:00
|
|
|
EGLDisplay EGLGetDisplay(void);
|
|
|
|
EGLNativeWindowType CreateWindow(void);
|
|
|
|
void DestroyWindow(void);
|
2014-03-12 13:33:41 -06:00
|
|
|
void UpdateFPSDisplay(const std::string& text);
|
2014-01-19 19:06:55 -07:00
|
|
|
void ToggleFullscreen(bool fullscreen);
|
|
|
|
void SwapBuffers();
|
|
|
|
};
|
2013-03-24 20:06:34 -06:00
|
|
|
|
2012-12-17 14:01:52 -07:00
|
|
|
class cInterfaceEGL : public cInterfaceBase
|
|
|
|
{
|
|
|
|
private:
|
2013-03-24 20:06:34 -06:00
|
|
|
cPlatform Platform;
|
2014-01-17 21:11:59 -07:00
|
|
|
void DetectMode();
|
2012-12-17 14:01:52 -07:00
|
|
|
public:
|
2013-03-24 20:06:34 -06:00
|
|
|
friend class cPlatform;
|
2013-01-24 09:31:08 -07:00
|
|
|
void SwapInterval(int Interval);
|
2012-12-25 23:34:09 -07:00
|
|
|
void Swap();
|
2014-02-06 14:41:11 -07:00
|
|
|
void SetMode(u32 mode) { s_opengl_mode = mode; }
|
2014-03-12 13:33:41 -06:00
|
|
|
void UpdateFPSDisplay(const std::string& text);
|
|
|
|
void* GetFuncAddress(const std::string& name);
|
2012-12-25 23:07:43 -07:00
|
|
|
bool Create(void *&window_handle);
|
2012-12-17 14:01:52 -07:00
|
|
|
bool MakeCurrent();
|
2013-10-28 23:23:17 -06:00
|
|
|
void Shutdown();
|
2012-12-17 14:01:52 -07:00
|
|
|
};
|