summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/windows/window.h
diff options
context:
space:
mode:
author couriersud <couriersud@arcor.de>2015-02-05 23:24:15 +0100
committer couriersud <couriersud@arcor.de>2015-02-05 23:24:15 +0100
commit950b1b05147dea8dd86bb2326d841e0b05f2580a (patch)
tree5aec42b8c8f05b36981b57c4079bec900b88f4f4 /src/osd/windows/window.h
parent388875c61d471d882c811a785ea27c93f9349ff4 (diff)
Introduced a comparable "osd_renderer" interface like it now exists for
SDL to mainline. Ultimately, this will allow renderers to be placed in modules\renderer and e.g. allow the opengl renderer to be used in mainline or the d3d renderer to be used in sdlmame. (nw)
Diffstat (limited to 'src/osd/windows/window.h')
-rw-r--r--src/osd/windows/window.h48
1 files changed, 38 insertions, 10 deletions
diff --git a/src/osd/windows/window.h b/src/osd/windows/window.h
index b2c6ea2e994..4d61b8e843e 100644
--- a/src/osd/windows/window.h
+++ b/src/osd/windows/window.h
@@ -32,6 +32,8 @@
// TYPE DEFINITIONS
//============================================================
+class osd_renderer;
+
class win_window_info
{
public:
@@ -77,24 +79,50 @@ public:
int m_lastclicky;
// drawing data
- void * m_drawdata;
+ osd_renderer * m_renderer;
private:
running_machine & m_machine;
};
+class osd_renderer
+{
+public:
+
+ /* Generic flags */
+ static const int FLAG_NONE = 0x0000;
+ static const int FLAG_NEEDS_OPENGL = 0x0001;
+
+ /* SDL 1.2 flags */
+ static const int FLAG_NEEDS_DOUBLEBUF = 0x0100;
+ static const int FLAG_NEEDS_ASYNCBLIT = 0x0200;
+
+ osd_renderer(win_window_info *window, const int flags)
+ : m_window(window), m_flags(flags) { }
+
+ virtual ~osd_renderer() { }
-struct win_draw_callbacks
+ win_window_info &window() { return *m_window; }
+ int flags() const { return m_flags; }
+ bool check_flag(const int flag) { return ((m_flags & flag)) == flag; }
+
+ virtual int init() = 0;
+ virtual render_primitive_list *get_primitives() = 0;
+ virtual int draw(HDC dc, int update) = 0;
+ virtual void save() = 0;
+ virtual void record() = 0;
+ virtual void toggle_fsfx() = 0;
+ virtual void destroy() = 0;
+
+private:
+ win_window_info *m_window;
+ int m_flags;
+};
+
+struct osd_draw_callbacks
{
+ osd_renderer *(*create)(win_window_info *window);
void (*exit)(void);
-
- int (*window_init)(win_window_info *window);
- render_primitive_list *(*window_get_primitives)(win_window_info *window);
- int (*window_draw)(win_window_info *window, HDC dc, int update);
- void (*window_save)(win_window_info *window);
- void (*window_record)(win_window_info *window);
- void (*window_toggle_fsfx)(win_window_info *window);
- void (*window_destroy)(win_window_info *window);
};