summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author therealmogminer@gmail.com <therealmogminer@gmail.com>2016-03-18 04:49:37 +0100
committer therealmogminer@gmail.com <therealmogminer@gmail.com>2016-03-18 04:49:37 +0100
commite37b96b68daeaef26467c66ad6a747bf2611fc15 (patch)
tree1452af88a1c107ab5d2d505a60a4decf96d989b8
parentea9e591a0c5d0e16a6d7fcfb4c5eb3e633977993 (diff)
Some bugfixes for BGFX on SDL, nw
-rw-r--r--src/osd/modules/lib/osdobj_common.cpp1
-rw-r--r--src/osd/modules/lib/osdobj_common.h3
-rw-r--r--src/osd/modules/render/drawbgfx.cpp2
-rw-r--r--src/osd/sdl/osdsdl.h9
-rw-r--r--src/osd/sdl/video.cpp60
-rw-r--r--src/osd/sdl/window.h4
-rw-r--r--src/osd/windows/winmain.h6
7 files changed, 76 insertions, 9 deletions
diff --git a/src/osd/modules/lib/osdobj_common.cpp b/src/osd/modules/lib/osdobj_common.cpp
index 160e7dd8ceb..57007ee7600 100644
--- a/src/osd/modules/lib/osdobj_common.cpp
+++ b/src/osd/modules/lib/osdobj_common.cpp
@@ -554,7 +554,6 @@ bool osd_common_t::font_get_bitmap(osd_font *font, unicode_char chnum, bitmap_ar
slider_state* osd_common_t::get_slider_list()
{
- printf("Core get_slider_list\n");
return nullptr;
}
diff --git a/src/osd/modules/lib/osdobj_common.h b/src/osd/modules/lib/osdobj_common.h
index 78fc2620e64..d53ad78b8bd 100644
--- a/src/osd/modules/lib/osdobj_common.h
+++ b/src/osd/modules/lib/osdobj_common.h
@@ -244,6 +244,9 @@ protected:
virtual bool input_init();
virtual void input_pause();
+ virtual void build_slider_list() { }
+ virtual void update_slider_list() { }
+
private:
// internal state
running_machine * m_machine;
diff --git a/src/osd/modules/render/drawbgfx.cpp b/src/osd/modules/render/drawbgfx.cpp
index 4d305983ff0..f4a377a29c3 100644
--- a/src/osd/modules/render/drawbgfx.cpp
+++ b/src/osd/modules/render/drawbgfx.cpp
@@ -732,7 +732,7 @@ int renderer_bgfx::draw(int update)
#ifdef OSD_WINDOWS
m_framebuffer = m_targets->create_backbuffer(window().m_hwnd, m_width[window_index], m_height[window_index]);
#else
- m_framebuffer = m_targets->create_backbuffer(sdlNativeWindowHandle(window().sdl_window()), m_width[index], m_height[index]);
+ m_framebuffer = m_targets->create_backbuffer(sdlNativeWindowHandle(window().sdl_window()), m_width[window_index], m_height[window_index]);
#endif
bgfx::setViewFrameBuffer(view_index, m_framebuffer->target());
m_dimensions = osd_dim(m_width[window_index], m_height[window_index]);
diff --git a/src/osd/sdl/osdsdl.h b/src/osd/sdl/osdsdl.h
index e61008275ec..0f6c3526c14 100644
--- a/src/osd/sdl/osdsdl.h
+++ b/src/osd/sdl/osdsdl.h
@@ -142,6 +142,9 @@ public:
virtual void init(running_machine &machine) override;
virtual void update(bool skip_redraw) override;
+ // video overridables
+ virtual slider_state *get_slider_list() override;
+
// input overridables
virtual void customize_input_type_list(simple_list<input_type_entry> &typelist) override;
@@ -173,6 +176,10 @@ public:
sdl_options &options() { return m_options; }
+protected:
+ virtual void build_slider_list() override;
+ virtual void update_slider_list() override;
+
private:
virtual void osd_exit() override;
@@ -181,7 +188,7 @@ private:
sdl_options &m_options;
watchdog *m_watchdog;
-
+ slider_state * m_sliders;
};
//============================================================
diff --git a/src/osd/sdl/video.cpp b/src/osd/sdl/video.cpp
index 3df00d90078..b20dbcb9498 100644
--- a/src/osd/sdl/video.cpp
+++ b/src/osd/sdl/video.cpp
@@ -140,6 +140,60 @@ float osd_monitor_info::aspect()
+//============================================================
+// update_slider_list
+//============================================================
+
+void sdl_osd_interface::update_slider_list()
+{
+ for (sdl_window_info *window = sdl_window_list; window != nullptr; window = window->m_next)
+ {
+ if (window->renderer().sliders_dirty())
+ {
+ build_slider_list();
+ return;
+ }
+ }
+}
+
+//============================================================
+// get_slider_list
+//============================================================
+
+slider_state *sdl_osd_interface::get_slider_list()
+{
+ return m_sliders;
+}
+
+//============================================================
+// build_slider_list
+//============================================================
+
+void sdl_osd_interface::build_slider_list()
+{
+ m_sliders = nullptr;
+ slider_state *curr = m_sliders;
+ for (sdl_window_info *info = sdl_window_list; info != nullptr; info = info->m_next)
+ {
+ slider_state *window_sliders = info->renderer().get_slider_list();
+ if (window_sliders != nullptr)
+ {
+ if (m_sliders == nullptr)
+ {
+ m_sliders = window_sliders;
+ curr = m_sliders;
+ }
+ else
+ {
+ while (curr->next != nullptr)
+ {
+ curr = curr->next;
+ }
+ curr->next = window_sliders;
+ }
+ }
+ }
+}
//============================================================
// update
@@ -152,6 +206,8 @@ void sdl_osd_interface::update(bool skip_redraw)
if (m_watchdog != NULL)
m_watchdog->reset();
+ update_slider_list();
+
// if we're not skipping this redraw, update all windows
if (!skip_redraw)
{
@@ -385,10 +441,10 @@ void sdl_osd_interface::extract_video_config()
if (options().seconds_to_run() == 0)
osd_printf_warning("Warning: -video none doesn't make much sense without -seconds_to_run\n");
}
-#if (USE_OPENGL)
+#if (USE_OPENGL)
else if (strcmp(stemp, SDLOPTVAL_OPENGL) == 0)
video_config.mode = VIDEO_MODE_OPENGL;
-#endif
+#endif
else if ((strcmp(stemp, SDLOPTVAL_SDL2ACCEL) == 0))
{
video_config.mode = VIDEO_MODE_SDL2ACCEL;
diff --git a/src/osd/sdl/window.h b/src/osd/sdl/window.h
index 6cb2a497ebb..c7ba6201e7b 100644
--- a/src/osd/sdl/window.h
+++ b/src/osd/sdl/window.h
@@ -87,6 +87,7 @@ public:
osd_dim blit_surface_size() override;
int prescale() const { return m_prescale; }
+ osd_renderer &renderer() const { return *m_renderer; }
// Pointer to next window
sdl_window_info * m_next;
@@ -122,8 +123,7 @@ private:
}
static OSDWORK_CALLBACK( complete_create_wt );
-protected:
- osd_renderer &renderer() { return *m_renderer; }
+
private:
int wnd_extra_width();
int wnd_extra_height();
diff --git a/src/osd/windows/winmain.h b/src/osd/windows/winmain.h
index 8855e191b90..c0bd9f7e56a 100644
--- a/src/osd/windows/winmain.h
+++ b/src/osd/windows/winmain.h
@@ -298,10 +298,12 @@ public:
int window_count();
+protected:
+ virtual void build_slider_list() override;
+ virtual void update_slider_list() override;
+
private:
virtual void osd_exit() override;
- void build_slider_list();
- void update_slider_list();
windows_options & m_options;
slider_state * m_sliders;