46 lines
975 B
C
Raw Normal View History

// Copyright 2013 Dolphin Emulator Project
// Licensed under GPLv2
// Refer to the license.txt file included.
2012-12-17 15:01:52 -06:00
#pragma once
2012-12-17 15:01:52 -06:00
#include "Common/Thread.h"
2014-01-19 19:06:55 -07:00
#if USE_EGL
#include "DolphinWX/GLInterface/EGL.h"
2012-12-17 15:01:52 -06:00
#elif defined(__APPLE__)
#include "DolphinWX/GLInterface/AGL.h"
2012-12-17 15:01:52 -06:00
#elif defined(_WIN32)
#include "DolphinWX/GLInterface/WGL.h"
2014-01-19 19:06:55 -07:00
#elif HAVE_X11
#include "DolphinWX/GLInterface/GLX.h"
#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;
#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
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;