summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/sdl/osd_opengl.h
diff options
context:
space:
mode:
author couriersud <couriersud@arcor.de>2015-02-25 23:44:17 +0100
committer couriersud <couriersud@arcor.de>2015-02-25 23:44:17 +0100
commit0fd2001a675cd51c7ec0915ec590fd486e9189cb (patch)
tree616a6b5082f8ca65bdb6286abf88aac5991a58bb /src/osd/sdl/osd_opengl.h
parentf0525b96cec2ef7134133abdc5565af72015c22b (diff)
Enable OpenGL renderer on Windows. By default, run-time function
resolution is enabled. To resolve addresses, the code now first tries GetProcAddress followed by wglGetProcAddress. [Couriersud]
Diffstat (limited to 'src/osd/sdl/osd_opengl.h')
-rw-r--r--src/osd/sdl/osd_opengl.h33
1 files changed, 30 insertions, 3 deletions
diff --git a/src/osd/sdl/osd_opengl.h b/src/osd/sdl/osd_opengl.h
index 73ef2071233..e41911a4b3e 100644
--- a/src/osd/sdl/osd_opengl.h
+++ b/src/osd/sdl/osd_opengl.h
@@ -15,13 +15,17 @@
/* equivalent to #include <GL/gl.h>
* #include <GL/glext.h>
*/
+ #ifdef OSD_WINDOWS
+ #include "GL/gl.h"
+ #include "GL/glext.h"
+ #else
#if (SDLMAME_SDL2)
#include <SDL2/SDL_version.h>
#else
#include <SDL/SDL_version.h>
#endif
-#if (SDL_VERSION_ATLEAST(1,2,10))
+ #if (SDL_VERSION_ATLEAST(1,2,10))
#if defined(SDLMAME_WIN32)
// Avoid that winnt.h (included via sdl_opengl.h, windows.h, windef.h includes intrin.h
#define __INTRIN_H_
@@ -31,13 +35,36 @@
#else
#include <SDL/SDL_opengl.h>
#endif
-#else
+ #else
/*
* SDL 1.2.9 does not provide everything we need
* We therefore distribute it ourselves
*/
#include "SDL1211_opengl.h"
-#endif
+ #endif
+ #endif
+
+ class osd_gl_context
+ {
+ public:
+ osd_gl_context() { }
+ virtual ~osd_gl_context() { }
+ virtual void MakeCurrent() = 0;
+ virtual const char *LastErrorMsg() = 0;
+ virtual void *getProcAddress(const char *proc) = 0;
+ /*
+ * 0 for immediate updates,
+ * 1 for updates synchronized with the vertical retrace,
+ * -1 for late swap tearing
+ *
+ * returns -1 if swap interval is not supported
+ *
+ */
+ virtual int SetSwapInterval(const int swap) = 0;
+ virtual void SwapBuffer() = 0;
+ };
+
+
#ifdef USE_DISPATCH_GL
#ifdef MACOSX_USE_LIBSDL