2013-04-17 23:43:35 -04:00
|
|
|
// Copyright 2013 Dolphin Emulator Project
|
|
|
|
// Licensed under GPLv2
|
|
|
|
// Refer to the license.txt file included.
|
2012-12-17 15:01:52 -06:00
|
|
|
|
2014-02-10 13:54:46 -05:00
|
|
|
#pragma once
|
2012-12-17 15:01:52 -06:00
|
|
|
|
2014-02-17 05:18:15 -05:00
|
|
|
#include "Common/Thread.h"
|
2014-01-19 19:06:55 -07:00
|
|
|
|
2013-03-24 21:06:34 -05:00
|
|
|
#if USE_EGL
|
2014-02-17 05:18:15 -05:00
|
|
|
#include "DolphinWX/GLInterface/EGL.h"
|
2012-12-17 15:01:52 -06:00
|
|
|
#elif defined(__APPLE__)
|
2014-02-17 05:18:15 -05:00
|
|
|
#include "DolphinWX/GLInterface/AGL.h"
|
2012-12-17 15:01:52 -06:00
|
|
|
#elif defined(_WIN32)
|
2014-02-17 05:18:15 -05:00
|
|
|
#include "DolphinWX/GLInterface/WGL.h"
|
2014-01-19 19:06:55 -07:00
|
|
|
#elif HAVE_X11
|
2014-02-17 05:18:15 -05:00
|
|
|
#include "DolphinWX/GLInterface/GLX.h"
|
2014-01-13 03:14:09 -06:00
|
|
|
#include <GL/glx.h>
|
2013-02-26 13:49:00 -06:00
|
|
|
#else
|
|
|
|
#error Platform doesnt have a GLInterface
|
2012-12-17 15:01:52 -06:00
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef struct {
|
2014-01-19 19:06:55 -07:00
|
|
|
#if USE_EGL
|
2012-12-17 15:01:52 -06:00
|
|
|
EGLSurface egl_surf;
|
|
|
|
EGLContext egl_ctx;
|
|
|
|
EGLDisplay egl_dpy;
|
2014-01-19 19:06:55 -07:00
|
|
|
EGLNativeWindowType native_window;
|
2014-08-05 20:45:18 -04:00
|
|
|
#elif defined(__APPLE__)
|
2013-03-13 21:34:52 -05:00
|
|
|
NSView *cocoaWin;
|
2012-12-17 15:01:52 -06:00
|
|
|
NSOpenGLContext *cocoaCtx;
|
2014-01-19 19:06:55 -07:00
|
|
|
#elif HAVE_X11
|
2014-08-05 20:45:18 -04:00
|
|
|
GLXContext ctx;
|
2012-12-17 15:01:52 -06:00
|
|
|
int screen;
|
|
|
|
Window win;
|
|
|
|
Window parent;
|
|
|
|
// dpy used for glx stuff, evdpy for window events etc.
|
|
|
|
// evdpy is to be used by XEventThread only
|
|
|
|
Display *dpy, *evdpy;
|
|
|
|
XVisualInfo *vi;
|
|
|
|
XSetWindowAttributes attr;
|
|
|
|
std::thread xEventThread;
|
2014-01-19 19:06:55 -07:00
|
|
|
#endif
|
2012-12-17 15:01:52 -06:00
|
|
|
} GLWindow;
|
|
|
|
|
|
|
|
extern GLWindow GLWin;
|