branches/kale/src/osd/sdl/video.c
| r244564 | r244565 | |
| 83 | 83 | static void check_osd_inputs(running_machine &machine); |
| 84 | 84 | |
| 85 | 85 | static float get_aspect(const char *defdata, const char *data, int report_error); |
| 86 | | static void get_resolution(const char *defdata, const char *data, sdl_window_config *config, int report_error); |
| 86 | static void get_resolution(const char *defdata, const char *data, osd_window_config *config, int report_error); |
| 87 | 87 | |
| 88 | 88 | |
| 89 | 89 | //============================================================ |
| r244564 | r244565 | |
| 110 | 110 | // create the windows |
| 111 | 111 | for (index = 0; index < video_config.numscreens; index++) |
| 112 | 112 | { |
| 113 | | sdl_window_config conf; |
| 113 | osd_window_config conf; |
| 114 | 114 | memset(&conf, 0, sizeof(conf)); |
| 115 | 115 | get_resolution(options().resolution(), options().resolution(index), &conf, TRUE); |
| 116 | 116 | |
| r244564 | r244565 | |
| 215 | 215 | static int first_call=0; |
| 216 | 216 | static int cw = 0, ch = 0; |
| 217 | 217 | |
| 218 | | SDL_VideoDriverName(m_monitor_device, ARRAY_LENGTH(m_name) - 1); |
| 218 | SDL_VideoDriverName(m_name, ARRAY_LENGTH(m_name) - 1); |
| 219 | 219 | if (first_call==0) |
| 220 | 220 | { |
| 221 | 221 | const char *dimstr = osd_getenv(SDLENV_DESKTOPDIM); |
| r244564 | r244565 | |
| 779 | 779 | // get_resolution |
| 780 | 780 | //============================================================ |
| 781 | 781 | |
| 782 | | static void get_resolution(const char *defdata, const char *data, sdl_window_config *config, int report_error) |
| 782 | static void get_resolution(const char *defdata, const char *data, osd_window_config *config, int report_error) |
| 783 | 783 | { |
| 784 | 784 | config->width = config->height = config->depth = config->refresh = 0; |
| 785 | 785 | if (strcmp(data, OSDOPTVAL_AUTO) == 0) |
branches/kale/src/osd/sdl/window.c
| r244564 | r244565 | |
| 894 | 894 | size_score *= 0.1f; |
| 895 | 895 | |
| 896 | 896 | // if we're looking for a particular mode, that's a winner |
| 897 | | if (mode.w == m_maxwidth && mode.h == m_maxheight) |
| 897 | if (mode.w == m_win_config.width && mode.h == m_win_config.height) |
| 898 | 898 | size_score = 2.0f; |
| 899 | 899 | |
| 900 | 900 | // refresh adds some points |
| 901 | | if (m_refresh) |
| 902 | | size_score *= 1.0f / (1.0f + fabsf(m_refresh - mode.refresh_rate) / 10.0f); |
| 901 | if (m_win_config.refresh) |
| 902 | size_score *= 1.0f / (1.0f + fabsf(m_win_config.refresh - mode.refresh_rate) / 10.0f); |
| 903 | 903 | |
| 904 | 904 | osd_printf_verbose("%4dx%4d@%2d -> %f\n", (int)mode.w, (int)mode.h, (int) mode.refresh_rate, size_score); |
| 905 | 905 | |
| r244564 | r244565 | |
| 953 | 953 | } |
| 954 | 954 | else if (modes == (SDL_Rect **)-1) // all modes are possible |
| 955 | 955 | { |
| 956 | | *fswidth = m_maxwidth; |
| 957 | | *fsheight = m_maxheight; |
| 956 | *fswidth = m_win_config.width; |
| 957 | *fsheight = m_win_config.height; |
| 958 | 958 | } |
| 959 | 959 | else |
| 960 | 960 | { |
| r244564 | r244565 | |
| 972 | 972 | size_score *= 0.1f; |
| 973 | 973 | |
| 974 | 974 | // if we're looking for a particular mode, that's a winner |
| 975 | | if (modes[i]->w == m_maxwidth && modes[i]->h == m_maxheight) |
| 975 | if (modes[i]->w == m_win_config.width && modes[i]->h == m_win_config.height) |
| 976 | 976 | size_score = 2.0f; |
| 977 | 977 | |
| 978 | 978 | osd_printf_verbose("%4dx%4d -> %f\n", (int)modes[i]->w, (int)modes[i]->h, size_score); |
| r244564 | r244565 | |
| 1120 | 1120 | instead of letting sdlwindow_blit_surface_size() resize it |
| 1121 | 1121 | this stops the window from "flashing" from the wrong aspect |
| 1122 | 1122 | size to the right one at startup. */ |
| 1123 | | tempwidth = (window->m_maxwidth != 0) ? window->m_maxwidth : 640; |
| 1124 | | tempheight = (window->m_maxheight != 0) ? window->m_maxheight : 480; |
| 1123 | tempwidth = (window->m_win_config.width != 0) ? window->m_win_config.width : 640; |
| 1124 | tempheight = (window->m_win_config.height != 0) ? window->m_win_config.height : 480; |
| 1125 | 1125 | |
| 1126 | 1126 | window->get_min_bounds(&tempwidth, &tempheight, video_config.keepaspect ); |
| 1127 | 1127 | } |
| r244564 | r244565 | |
| 1187 | 1187 | window->m_original_mode = mode; |
| 1188 | 1188 | mode.w = tempwidth; |
| 1189 | 1189 | mode.h = tempheight; |
| 1190 | | if (window->m_refresh) |
| 1191 | | mode.refresh_rate = window->m_refresh; |
| 1190 | if (window->m_win_config.refresh) |
| 1191 | mode.refresh_rate = window->m_win_config.refresh; |
| 1192 | 1192 | |
| 1193 | 1193 | SDL_SetWindowDisplayMode(window->sdl_window(), &mode); // Try to set mode |
| 1194 | 1194 | #ifndef SDLMAME_WIN32 |
| r244564 | r244565 | |
| 1266 | 1266 | // (window thread) |
| 1267 | 1267 | //============================================================ |
| 1268 | 1268 | |
| 1269 | | void sdl_window_info::measure_fps(UINT32 dc, int update) |
| 1269 | void sdl_window_info::measure_fps(int update) |
| 1270 | 1270 | { |
| 1271 | 1271 | const unsigned long frames_skip4fps = 100; |
| 1272 | 1272 | static int64_t lastTime=0, sumdt=0, startTime=0; |
| r244564 | r244565 | |
| 1281 | 1281 | |
| 1282 | 1282 | t0 = osd_ticks(); |
| 1283 | 1283 | |
| 1284 | | renderer().draw(dc, update); |
| 1284 | renderer().draw(update); |
| 1285 | 1285 | |
| 1286 | 1286 | frames++; |
| 1287 | 1287 | currentTime = osd_ticks(); |
| r244564 | r244565 | |
| 1310 | 1310 | |
| 1311 | 1311 | OSDWORK_CALLBACK( sdl_window_info::draw_video_contents_wt ) |
| 1312 | 1312 | { |
| 1313 | | UINT32 dc = 0; |
| 1314 | 1313 | int update = 1; |
| 1315 | 1314 | worker_param *wp = (worker_param *) param; |
| 1316 | 1315 | sdl_window_info *window = wp->window(); |
| r244564 | r244565 | |
| 1357 | 1356 | else |
| 1358 | 1357 | { |
| 1359 | 1358 | if( video_config.perftest ) |
| 1360 | | window->measure_fps(dc, update); |
| 1359 | window->measure_fps(update); |
| 1361 | 1360 | else |
| 1362 | | window->renderer().draw(dc, update); |
| 1361 | window->renderer().draw(update); |
| 1363 | 1362 | } |
| 1364 | 1363 | |
| 1365 | 1364 | /* all done, ready for next */ |
| r244564 | r244565 | |
| 1432 | 1431 | else |
| 1433 | 1432 | { |
| 1434 | 1433 | // further clamp to the maximum width/height in the window |
| 1435 | | if (this->m_maxwidth != 0) |
| 1436 | | maxwidth = MIN(maxwidth, this->m_maxwidth + extrawidth); |
| 1437 | | if (this->m_maxheight != 0) |
| 1438 | | maxheight = MIN(maxheight, this->m_maxheight + extraheight); |
| 1434 | if (this->m_win_config.width != 0) |
| 1435 | maxwidth = MIN(maxwidth, this->m_win_config.width + extrawidth); |
| 1436 | if (this->m_win_config.height != 0) |
| 1437 | maxheight = MIN(maxheight, this->m_win_config.height + extraheight); |
| 1439 | 1438 | } |
| 1440 | 1439 | |
| 1441 | 1440 | // clamp to the maximum |
| r244564 | r244565 | |
| 1514 | 1513 | maxheight = m_monitor->position_size().h; |
| 1515 | 1514 | |
| 1516 | 1515 | // clamp to the window's max |
| 1517 | | if (this->m_maxwidth != 0) |
| 1516 | if (this->m_win_config.width != 0) |
| 1518 | 1517 | { |
| 1519 | | int temp = this->m_maxwidth + WINDOW_DECORATION_WIDTH; |
| 1518 | int temp = this->m_win_config.width + WINDOW_DECORATION_WIDTH; |
| 1520 | 1519 | if (temp < maxwidth) |
| 1521 | 1520 | maxwidth = temp; |
| 1522 | 1521 | } |
| 1523 | | if (this->m_maxheight != 0) |
| 1522 | if (this->m_win_config.height != 0) |
| 1524 | 1523 | { |
| 1525 | | int temp = this->m_maxheight + WINDOW_DECORATION_HEIGHT; |
| 1524 | int temp = this->m_win_config.height + WINDOW_DECORATION_HEIGHT; |
| 1526 | 1525 | if (temp < maxheight) |
| 1527 | 1526 | maxheight = temp; |
| 1528 | 1527 | } |
branches/kale/src/osd/sdl/window.h
| r244564 | r244565 | |
| 49 | 49 | : |
| 50 | 50 | #ifdef OSD_SDL |
| 51 | 51 | #else |
| 52 | | m_hwnd(0), m_focus_hwnd(0), m_resize_state(0), |
| 53 | | m_maxwidth(0), m_maxheight(0), |
| 54 | | m_refresh(0), |
| 52 | m_hwnd(0), m_dc(0), m_focus_hwnd(0), m_resize_state(0), |
| 55 | 53 | #endif |
| 56 | 54 | m_prescale(1), |
| 57 | 55 | m_primlist(NULL) |
| r244564 | r244565 | |
| 84 | 82 | |
| 85 | 83 | // window handle and info |
| 86 | 84 | HWND m_hwnd; |
| 85 | HDC m_dc; // only used by GDI renderer! |
| 87 | 86 | // FIXME: this is the same as win_window_list->m_hwnd, i.e. first window. |
| 88 | 87 | // During modularization, this should be passed in differently |
| 89 | 88 | HWND m_focus_hwnd; |
| 90 | 89 | |
| 91 | 90 | int m_resize_state; |
| 92 | | int m_maxwidth, m_maxheight; |
| 93 | | int m_refresh; |
| 94 | 91 | #endif |
| 95 | 92 | |
| 93 | osd_window_config m_win_config; |
| 96 | 94 | int m_prescale; |
| 97 | 95 | render_primitive_list *m_primlist; |
| 98 | 96 | }; |
| r244564 | r244565 | |
| 106 | 104 | static const int FLAG_NEEDS_OPENGL = 0x0001; |
| 107 | 105 | static const int FLAG_HAS_VECTOR_SCREEN = 0x0002; |
| 108 | 106 | |
| 109 | | #if (!(SDLMAME_SDL2)) |
| 110 | 107 | /* SDL 1.2 flags */ |
| 111 | 108 | static const int FLAG_NEEDS_DOUBLEBUF = 0x0100; |
| 112 | 109 | static const int FLAG_NEEDS_ASYNCBLIT = 0x0200; |
| 113 | | #endif |
| 114 | 110 | |
| 115 | 111 | osd_renderer(osd_window *window, const int flags) |
| 116 | 112 | : m_window(window), m_flags(flags) { } |
| r244564 | r244565 | |
| 130 | 126 | virtual int create() = 0; |
| 131 | 127 | virtual render_primitive_list *get_primitives() = 0; |
| 132 | 128 | |
| 129 | virtual int draw(const int update) = 0; |
| 133 | 130 | #ifdef OSD_SDL |
| 134 | | virtual int draw(const UINT32 dc, const int update) = 0; |
| 135 | 131 | virtual int xy_to_render_target(const int x, const int y, int *xt, int *yt) = 0; |
| 136 | 132 | #else |
| 137 | | virtual int draw(HDC dc, int update) = 0; |
| 138 | 133 | virtual void save() = 0; |
| 139 | 134 | virtual void record() = 0; |
| 140 | 135 | virtual void toggle_fsfx() = 0; |
| r244564 | r244565 | |
| 158 | 153 | { |
| 159 | 154 | public: |
| 160 | 155 | sdl_window_info(running_machine &a_machine, int index, sdl_monitor_info *a_monitor, |
| 161 | | const sdl_window_config *config) |
| 156 | const osd_window_config *config) |
| 162 | 157 | : osd_window(), m_next(NULL), |
| 163 | 158 | // Following three are used by input code to defer resizes |
| 164 | 159 | #if (SDLMAME_SDL2) |
| r244564 | r244565 | |
| 176 | 171 | #endif |
| 177 | 172 | m_machine(a_machine), m_monitor(a_monitor), m_fullscreen(0), m_index(0) |
| 178 | 173 | { |
| 179 | | m_maxwidth = config->width; |
| 180 | | m_maxheight = config->height; |
| 181 | | m_depth = config->depth; |
| 182 | | m_refresh = config->refresh; |
| 174 | m_win_config = *config; |
| 183 | 175 | m_index = index; |
| 184 | 176 | |
| 185 | 177 | //FIXME: these should be per_window in config-> or even better a bit set |
| r244564 | r244565 | |
| 247 | 239 | |
| 248 | 240 | // diverse flags |
| 249 | 241 | int m_minwidth, m_minheight; |
| 250 | | int m_maxwidth, m_maxheight; |
| 251 | | int m_refresh; |
| 252 | | int m_depth; |
| 253 | 242 | int m_windowed_width; |
| 254 | 243 | int m_windowed_height; |
| 255 | 244 | |
| r244564 | r244565 | |
| 303 | 292 | static OSDWORK_CALLBACK( notify_changed_wt ); |
| 304 | 293 | static OSDWORK_CALLBACK( update_cursor_state_wt ); |
| 305 | 294 | |
| 306 | | void measure_fps(UINT32 dc, int update); |
| 295 | void measure_fps(int update); |
| 307 | 296 | |
| 308 | 297 | }; |
| 309 | 298 | |
branches/kale/src/osd/windows/window.c
| r244564 | r244565 | |
| 121 | 121 | //============================================================ |
| 122 | 122 | |
| 123 | 123 | static void winwindow_video_window_destroy(win_window_info *window); |
| 124 | | static void draw_video_contents(win_window_info *window, HDC dc, int update); |
| 125 | 124 | |
| 126 | 125 | static unsigned __stdcall thread_entry(void *param); |
| 127 | 126 | static int complete_create(win_window_info *window); |
| r244564 | r244565 | |
| 660 | 659 | // (main thread) |
| 661 | 660 | //============================================================ |
| 662 | 661 | |
| 663 | | void winwindow_video_window_create(running_machine &machine, int index, win_monitor_info *monitor, const win_window_config *config) |
| 662 | void winwindow_video_window_create(running_machine &machine, int index, win_monitor_info *monitor, const osd_window_config *config) |
| 664 | 663 | { |
| 665 | 664 | win_window_info *window, *win; |
| 666 | 665 | |
| r244564 | r244565 | |
| 669 | 668 | // allocate a new window object |
| 670 | 669 | window = global_alloc(win_window_info(machine)); |
| 671 | 670 | //printf("%d, %d\n", config->width, config->height); |
| 672 | | window->m_maxwidth = config->width; |
| 673 | | window->m_maxheight = config->height; |
| 674 | | window->m_refresh = config->refresh; |
| 671 | window->m_win_config = *config; |
| 675 | 672 | window->m_monitor = monitor; |
| 676 | 673 | window->m_fullscreen = !video_config.windowed; |
| 677 | 674 | |
| r244564 | r244565 | |
| 1213 | 1210 | return 0; |
| 1214 | 1211 | |
| 1215 | 1212 | // adjust the window position to the initial width/height |
| 1216 | | tempwidth = (window->m_maxwidth != 0) ? window->m_maxwidth : 640; |
| 1217 | | tempheight = (window->m_maxheight != 0) ? window->m_maxheight : 480; |
| 1213 | tempwidth = (window->m_win_config.width != 0) ? window->m_win_config.width : 640; |
| 1214 | tempheight = (window->m_win_config.height != 0) ? window->m_win_config.height : 480; |
| 1218 | 1215 | SetWindowPos(window->m_hwnd, NULL, monitorbounds.left + 20, monitorbounds.top + 20, |
| 1219 | 1216 | monitorbounds.left + tempwidth + wnd_extra_width(window), |
| 1220 | 1217 | monitorbounds.top + tempheight + wnd_extra_height(window), |
| r244564 | r244565 | |
| 1252 | 1249 | // (window thread) |
| 1253 | 1250 | //============================================================ |
| 1254 | 1251 | |
| 1255 | | LRESULT CALLBACK winwindow_video_window_proc(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam) |
| 1252 | LRESULT CALLBACK win_window_info::video_window_proc(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam) |
| 1256 | 1253 | { |
| 1257 | 1254 | LONG_PTR ptr = GetWindowLongPtr(wnd, GWLP_USERDATA); |
| 1258 | 1255 | win_window_info *window = (win_window_info *)ptr; |
| r244564 | r244565 | |
| 1272 | 1269 | { |
| 1273 | 1270 | PAINTSTRUCT pstruct; |
| 1274 | 1271 | HDC hdc = BeginPaint(wnd, &pstruct); |
| 1275 | | draw_video_contents(window, hdc, TRUE); |
| 1272 | window->draw_video_contents(hdc, TRUE); |
| 1276 | 1273 | if (window->win_has_menu()) |
| 1277 | 1274 | DrawMenuBar(window->m_hwnd); |
| 1278 | 1275 | EndPaint(wnd, &pstruct); |
| r244564 | r244565 | |
| 1421 | 1418 | |
| 1422 | 1419 | mtlog_add("winwindow_video_window_proc: WM_USER_REDRAW begin"); |
| 1423 | 1420 | window->m_primlist = (render_primitive_list *)lparam; |
| 1424 | | draw_video_contents(window, hdc, FALSE); |
| 1421 | window->draw_video_contents(hdc, FALSE); |
| 1425 | 1422 | mtlog_add("winwindow_video_window_proc: WM_USER_REDRAW end"); |
| 1426 | 1423 | |
| 1427 | 1424 | ReleaseDC(wnd, hdc); |
| r244564 | r244565 | |
| 1470 | 1467 | // (window thread) |
| 1471 | 1468 | //============================================================ |
| 1472 | 1469 | |
| 1473 | | static void draw_video_contents(win_window_info *window, HDC dc, int update) |
| 1470 | void win_window_info::draw_video_contents(HDC dc, int update) |
| 1474 | 1471 | { |
| 1475 | 1472 | assert(GetCurrentThreadId() == window_threadid); |
| 1476 | 1473 | |
| 1477 | 1474 | mtlog_add("draw_video_contents: begin"); |
| 1478 | 1475 | |
| 1479 | 1476 | mtlog_add("draw_video_contents: render lock acquire"); |
| 1480 | | osd_lock_acquire(window->m_render_lock); |
| 1477 | osd_lock_acquire(m_render_lock); |
| 1481 | 1478 | mtlog_add("draw_video_contents: render lock acquired"); |
| 1482 | 1479 | |
| 1483 | 1480 | // if we're iconic, don't bother |
| 1484 | | if (window->m_hwnd != NULL && !IsIconic(window->m_hwnd)) |
| 1481 | if (m_hwnd != NULL && !IsIconic(m_hwnd)) |
| 1485 | 1482 | { |
| 1486 | 1483 | // if no bitmap, just fill |
| 1487 | | if (window->m_primlist == NULL) |
| 1484 | if (m_primlist == NULL) |
| 1488 | 1485 | { |
| 1489 | 1486 | RECT fill; |
| 1490 | | GetClientRect(window->m_hwnd, &fill); |
| 1487 | GetClientRect(m_hwnd, &fill); |
| 1491 | 1488 | FillRect(dc, &fill, (HBRUSH)GetStockObject(BLACK_BRUSH)); |
| 1492 | 1489 | } |
| 1493 | 1490 | |
| 1494 | 1491 | // otherwise, render with our drawing system |
| 1495 | 1492 | else |
| 1496 | 1493 | { |
| 1497 | | window->m_renderer->draw(dc, update); |
| 1494 | // update DC |
| 1495 | m_dc = dc; |
| 1496 | m_renderer->draw(update); |
| 1498 | 1497 | mtlog_add("draw_video_contents: drawing finished"); |
| 1499 | 1498 | } |
| 1500 | 1499 | } |
| 1501 | 1500 | |
| 1502 | | osd_lock_release(window->m_render_lock); |
| 1501 | osd_lock_release(m_render_lock); |
| 1503 | 1502 | mtlog_add("draw_video_contents: render lock released"); |
| 1504 | 1503 | |
| 1505 | 1504 | mtlog_add("draw_video_contents: end"); |
| r244564 | r244565 | |
| 1575 | 1574 | maxheight = rect_height(&monitor->usuable_position_size()) - extraheight; |
| 1576 | 1575 | |
| 1577 | 1576 | // further clamp to the maximum width/height in the window |
| 1578 | | if (window->m_maxwidth != 0) |
| 1579 | | maxwidth = MIN(maxwidth, window->m_maxwidth + extrawidth); |
| 1580 | | if (window->m_maxheight != 0) |
| 1581 | | maxheight = MIN(maxheight, window->m_maxheight + extraheight); |
| 1577 | if (window->m_win_config.width != 0) |
| 1578 | maxwidth = MIN(maxwidth, window->m_win_config.width + extrawidth); |
| 1579 | if (window->m_win_config.height != 0) |
| 1580 | maxheight = MIN(maxheight, window->m_win_config.height + extraheight); |
| 1582 | 1581 | } |
| 1583 | 1582 | |
| 1584 | 1583 | // clamp to the maximum |
| r244564 | r244565 | |
| 1703 | 1702 | maximum = window->m_monitor->usuable_position_size(); |
| 1704 | 1703 | |
| 1705 | 1704 | // clamp to the window's max |
| 1706 | | if (window->m_maxwidth != 0) |
| 1705 | if (window->m_win_config.width != 0) |
| 1707 | 1706 | { |
| 1708 | | int temp = window->m_maxwidth + wnd_extra_width(window); |
| 1707 | int temp = window->m_win_config.width + wnd_extra_width(window); |
| 1709 | 1708 | if (temp < rect_width(&maximum)) |
| 1710 | 1709 | maximum.right = maximum.left + temp; |
| 1711 | 1710 | } |
| 1712 | | if (window->m_maxheight != 0) |
| 1711 | if (window->m_win_config.height != 0) |
| 1713 | 1712 | { |
| 1714 | | int temp = window->m_maxheight + wnd_extra_height(window); |
| 1713 | int temp = window->m_win_config.height + wnd_extra_height(window); |
| 1715 | 1714 | if (temp < rect_height(&maximum)) |
| 1716 | 1715 | maximum.bottom = maximum.top + temp; |
| 1717 | 1716 | } |
branches/kale/src/osd/windows/window.h
| r244564 | r244565 | |
| 49 | 49 | : |
| 50 | 50 | #ifdef OSD_SDL |
| 51 | 51 | #else |
| 52 | | m_hwnd(0), m_focus_hwnd(0), m_resize_state(0), |
| 53 | | m_maxwidth(0), m_maxheight(0), |
| 54 | | m_refresh(0), |
| 52 | m_hwnd(0), m_dc(0), m_focus_hwnd(0), m_resize_state(0), |
| 55 | 53 | #endif |
| 56 | 54 | m_prescale(1), |
| 57 | 55 | m_primlist(NULL) |
| r244564 | r244565 | |
| 84 | 82 | |
| 85 | 83 | // window handle and info |
| 86 | 84 | HWND m_hwnd; |
| 85 | HDC m_dc; // only used by GDI renderer! |
| 87 | 86 | // FIXME: this is the same as win_window_list->m_hwnd, i.e. first window. |
| 88 | 87 | // During modularization, this should be passed in differently |
| 89 | 88 | HWND m_focus_hwnd; |
| 90 | 89 | |
| 91 | 90 | int m_resize_state; |
| 92 | | int m_maxwidth, m_maxheight; |
| 93 | | int m_refresh; |
| 94 | 91 | #endif |
| 95 | 92 | |
| 93 | osd_window_config m_win_config; |
| 96 | 94 | int m_prescale; |
| 97 | 95 | render_primitive_list * m_primlist; |
| 98 | 96 | }; |
| r244564 | r244565 | |
| 128 | 126 | virtual int create() = 0; |
| 129 | 127 | virtual render_primitive_list *get_primitives() = 0; |
| 130 | 128 | |
| 129 | virtual int draw(const int update) = 0; |
| 131 | 130 | #ifdef OSD_SDL |
| 132 | | virtual int draw(const UINT32 dc, const int update) = 0; |
| 133 | 131 | virtual int xy_to_render_target(const int x, const int y, int *xt, int *yt) = 0; |
| 134 | 132 | #else |
| 135 | | virtual int draw(HDC dc, int update) = 0; |
| 136 | 133 | virtual void save() = 0; |
| 137 | 134 | virtual void record() = 0; |
| 138 | 135 | virtual void toggle_fsfx() = 0; |
| r244564 | r244565 | |
| 180 | 177 | |
| 181 | 178 | win_monitor_info *monitor() const { return m_monitor; } |
| 182 | 179 | |
| 180 | // static callbacks |
| 181 | |
| 182 | static LRESULT CALLBACK video_window_proc(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam); |
| 183 | |
| 184 | // member variables |
| 185 | |
| 183 | 186 | win_window_info * m_next; |
| 184 | 187 | volatile int m_init_state; |
| 185 | 188 | |
| r244564 | r244565 | |
| 212 | 215 | osd_renderer * m_renderer; |
| 213 | 216 | |
| 214 | 217 | private: |
| 218 | void draw_video_contents(HDC dc, int update); |
| 219 | |
| 215 | 220 | running_machine & m_machine; |
| 216 | 221 | }; |
| 217 | 222 | |
| r244564 | r244565 | |
| 237 | 242 | //============================================================ |
| 238 | 243 | |
| 239 | 244 | // creation/deletion of windows |
| 240 | | void winwindow_video_window_create(running_machine &machine, int index, win_monitor_info *monitor, const win_window_config *config); |
| 245 | void winwindow_video_window_create(running_machine &machine, int index, win_monitor_info *monitor, const osd_window_config *config); |
| 241 | 246 | |
| 242 | 247 | BOOL winwindow_has_focus(void); |
| 243 | 248 | void winwindow_update_cursor_state(running_machine &machine); |
| 244 | 249 | |
| 245 | | LRESULT CALLBACK winwindow_video_window_proc(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam); |
| 246 | 250 | extern LRESULT CALLBACK winwindow_video_window_proc_ui(HWND wnd, UINT message, WPARAM wparam, LPARAM lparam); |
| 247 | 251 | |
| 248 | 252 | void winwindow_toggle_full_screen(void); |