summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/windows/video.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/windows/video.cpp')
-rw-r--r--src/osd/windows/video.cpp129
1 files changed, 29 insertions, 100 deletions
diff --git a/src/osd/windows/video.cpp b/src/osd/windows/video.cpp
index 889e76caa6b..439f0019f69 100644
--- a/src/osd/windows/video.cpp
+++ b/src/osd/windows/video.cpp
@@ -6,12 +6,14 @@
//
//============================================================
-// standard windows headers
-#include <windows.h>
+#include "modules/osdwindow.h"
+#include "modules/monitor/monitor_module.h"
+#include "modules/render/render_module.h"
// MAME headers
#include "emu.h"
#include "emuopts.h"
+#include "main.h"
#include "render.h"
#include "uiinput.h"
@@ -20,7 +22,8 @@
#include "window.h"
#include "strconv.h"
-#include "modules/osdwindow.h"
+// standard windows headers
+#include <windows.h>
//============================================================
// CONSTANTS
@@ -57,14 +60,20 @@ bool windows_osd_interface::video_init()
window_init();
// create the windows
- windows_options &options = downcast<windows_options &>(machine().options());
+ auto &options = downcast<windows_options &>(machine().options());
for (int index = 0; index < video_config.numscreens; index++)
{
- win_window_info::create(machine(), index, m_monitor_module->pick_monitor(options, index), &windows[index]);
+ auto window = win_window_info::create(
+ machine(),
+ *m_render,
+ index,
+ m_monitor_module->pick_monitor(options, index),
+ &windows[index]);
+ s_window_list.emplace_back(std::move(window));
}
- if (video_config.mode != VIDEO_MODE_NONE)
- SetForegroundWindow(std::static_pointer_cast<win_window_info>(osd_common_t::s_window_list.front())->platform_window());
+ if (m_render->is_interactive())
+ SetForegroundWindow(dynamic_cast<win_window_info &>(*osd_common_t::s_window_list.front()).platform_window());
return true;
}
@@ -90,15 +99,11 @@ void windows_osd_interface::update(bool skip_redraw)
if (!skip_redraw)
{
// profiler_mark(PROFILER_BLIT);
- for (auto window : osd_common_t::s_window_list)
+ for (const auto &window : osd_common_t::s_window_list)
window->update();
// profiler_mark(PROFILER_END);
}
- // poll the joystick values here
- winwindow_process_events(machine(), true, false);
- poll_input(machine());
- check_osd_inputs();
// if we're running, disable some parts of the debugger
if ((machine().debug_flags & DEBUG_FLAG_OSD_ENABLED) != 0)
debugger_update();
@@ -106,6 +111,17 @@ void windows_osd_interface::update(bool skip_redraw)
//============================================================
+// input_update
+//============================================================
+
+void windows_osd_interface::input_update(bool relative_reset)
+{
+ // poll the joystick values here
+ process_events(true, false);
+ poll_input_modules(relative_reset);
+}
+
+//============================================================
// check_osd_inputs
//============================================================
@@ -136,13 +152,10 @@ void windows_osd_interface::check_osd_inputs()
void windows_osd_interface::extract_video_config()
{
- const char *stemp;
-
// global options: extract the data
video_config.windowed = options().window();
video_config.prescale = options().prescale();
video_config.filter = options().filter();
- video_config.keepaspect = options().keep_aspect();
video_config.numscreens = options().numscreens();
// if we are in debug mode, never go full screen
@@ -156,100 +169,16 @@ void windows_osd_interface::extract_video_config()
get_resolution(default_resolution, options().resolution(2), &windows[2], TRUE);
get_resolution(default_resolution, options().resolution(3), &windows[3], TRUE);
- // video options: extract the data
- stemp = options().video();
- if (strcmp(stemp, "d3d") == 0)
- video_config.mode = VIDEO_MODE_D3D;
- else if (strcmp(stemp, "auto") == 0)
- video_config.mode = VIDEO_MODE_D3D;
- else if (strcmp(stemp, "gdi") == 0)
- video_config.mode = VIDEO_MODE_GDI;
- else if (strcmp(stemp, "bgfx") == 0)
- video_config.mode = VIDEO_MODE_BGFX;
- else if (strcmp(stemp, "none") == 0)
- {
- video_config.mode = VIDEO_MODE_NONE;
- if (!emulator_info::standalone() && options().seconds_to_run() == 0)
- osd_printf_warning("Warning: -video none doesn't make much sense without -seconds_to_run\n");
- }
-#if (USE_OPENGL)
- else if (strcmp(stemp, "opengl") == 0)
- video_config.mode = VIDEO_MODE_OPENGL;
-#endif
- else
- {
- osd_printf_warning("Invalid video value %s; reverting to gdi\n", stemp);
- video_config.mode = VIDEO_MODE_GDI;
- }
video_config.waitvsync = options().wait_vsync();
video_config.syncrefresh = options().sync_refresh();
video_config.triplebuf = options().triple_buffer();
video_config.switchres = options().switch_res();
- if (video_config.prescale < 1 || video_config.prescale > 3)
+ if (video_config.prescale < 1 || video_config.prescale > 20)
{
osd_printf_warning("Invalid prescale option, reverting to '1'\n");
video_config.prescale = 1;
}
- #if (USE_OPENGL)
- // default to working video please
- video_config.forcepow2texture = options().gl_force_pow2_texture();
- video_config.allowtexturerect = !(options().gl_no_texture_rect());
- video_config.vbo = options().gl_vbo();
- video_config.pbo = options().gl_pbo();
- video_config.glsl = options().gl_glsl();
- if ( video_config.glsl )
- {
- int i;
-
- video_config.glsl_filter = options().glsl_filter();
-
- video_config.glsl_shader_mamebm_num=0;
-
- for(i=0; i<GLSL_SHADER_MAX; i++)
- {
- stemp = options().shader_mame(i);
- if (stemp && strcmp(stemp, OSDOPTVAL_NONE) != 0 && strlen(stemp)>0)
- {
- video_config.glsl_shader_mamebm[i] = (char *) malloc(strlen(stemp)+1);
- strcpy(video_config.glsl_shader_mamebm[i], stemp);
- video_config.glsl_shader_mamebm_num++;
- } else {
- video_config.glsl_shader_mamebm[i] = nullptr;
- }
- }
-
- video_config.glsl_shader_scrn_num=0;
-
- for(i=0; i<GLSL_SHADER_MAX; i++)
- {
- stemp = options().shader_screen(i);
- if (stemp && strcmp(stemp, OSDOPTVAL_NONE) != 0 && strlen(stemp)>0)
- {
- video_config.glsl_shader_scrn[i] = (char *) malloc(strlen(stemp)+1);
- strcpy(video_config.glsl_shader_scrn[i], stemp);
- video_config.glsl_shader_scrn_num++;
- } else {
- video_config.glsl_shader_scrn[i] = nullptr;
- }
- }
- } else {
- int i;
- video_config.glsl_filter = 0;
- video_config.glsl_shader_mamebm_num=0;
- for(i=0; i<GLSL_SHADER_MAX; i++)
- {
- video_config.glsl_shader_mamebm[i] = nullptr;
- }
- video_config.glsl_shader_scrn_num=0;
- for(i=0; i<GLSL_SHADER_MAX; i++)
- {
- video_config.glsl_shader_scrn[i] = nullptr;
- }
- }
-
- #endif /* USE_OPENGL */
-
}