trunk/src/osd/sdl/draw13.c
| r242697 | r242698 | |
| 200 | 200 | static void drawsdl2_window_resize(sdl_window_info *window, int width, int height); |
| 201 | 201 | static void drawsdl2_window_destroy(sdl_window_info *window); |
| 202 | 202 | static int drawsdl2_window_draw(sdl_window_info *window, UINT32 dc, int update); |
| 203 | | static render_primitive_list &drawsdl2_window_get_primitives(sdl_window_info *window); |
| 203 | static void drawsdl2_set_target_bounds(sdl_window_info *window); |
| 204 | 204 | static void drawsdl2_destroy_all_textures(sdl_window_info *window); |
| 205 | 205 | static void drawsdl2_window_clear(sdl_window_info *window); |
| 206 | 206 | static int drawsdl2_xy_to_render_target(sdl_window_info *window, int x, int y, int *xt, int *yt); |
| r242697 | r242698 | |
| 559 | 559 | // fill in the callbacks |
| 560 | 560 | window->create = drawsdl2_window_create; |
| 561 | 561 | window->resize = drawsdl2_window_resize; |
| 562 | | window->get_primitives = drawsdl2_window_get_primitives; |
| 562 | window->set_target_bounds = drawsdl2_set_target_bounds; |
| 563 | 563 | window->draw = drawsdl2_window_draw; |
| 564 | 564 | window->destroy = drawsdl2_window_destroy; |
| 565 | 565 | window->destroy_all_textures = drawsdl2_destroy_all_textures; |
| r242697 | r242698 | |
| 687 | 687 | // drawsdl2_window_get_primitives |
| 688 | 688 | //============================================================ |
| 689 | 689 | |
| 690 | | static render_primitive_list &drawsdl2_window_get_primitives(sdl_window_info *window) |
| 690 | static void drawsdl2_set_target_bounds(sdl_window_info *window) |
| 691 | 691 | { |
| 692 | | if ((!window->fullscreen()) || (video_config.switchres)) |
| 693 | | { |
| 694 | | window->blit_surface_size(window->width, window->height); |
| 695 | | } |
| 696 | | else |
| 697 | | { |
| 698 | | window->blit_surface_size(window->monitor()->center_width, window->monitor()->center_height); |
| 699 | | } |
| 700 | 692 | window->target->set_bounds(window->blitwidth, window->blitheight, sdlvideo_monitor_get_aspect(window->monitor())); |
| 701 | | return window->target->get_primitives(); |
| 702 | 693 | } |
| 703 | 694 | |
| 704 | 695 | //============================================================ |
trunk/src/osd/sdl/drawogl.c
| r242697 | r242698 | |
| 367 | 367 | static void drawogl_window_resize(sdl_window_info *window, int width, int height); |
| 368 | 368 | static void drawogl_window_destroy(sdl_window_info *window); |
| 369 | 369 | static int drawogl_window_draw(sdl_window_info *window, UINT32 dc, int update); |
| 370 | | static render_primitive_list &drawogl_window_get_primitives(sdl_window_info *window); |
| 370 | static void drawogl_set_target_bounds(sdl_window_info *window); |
| 371 | 371 | static void drawogl_destroy_all_textures(sdl_window_info *window); |
| 372 | 372 | static void drawogl_window_clear(sdl_window_info *window); |
| 373 | 373 | static int drawogl_xy_to_render_target(sdl_window_info *window, int x, int y, int *xt, int *yt); |
| r242697 | r242698 | |
| 454 | 454 | // fill in the callbacks |
| 455 | 455 | window->create = drawogl_window_create; |
| 456 | 456 | window->resize = drawogl_window_resize; |
| 457 | | window->get_primitives = drawogl_window_get_primitives; |
| 457 | window->set_target_bounds = drawogl_set_target_bounds; |
| 458 | 458 | window->draw = drawogl_window_draw; |
| 459 | 459 | window->destroy = drawogl_window_destroy; |
| 460 | 460 | window->destroy_all_textures = drawogl_destroy_all_textures; |
| r242697 | r242698 | |
| 840 | 840 | // drawogl_window_get_primitives |
| 841 | 841 | //============================================================ |
| 842 | 842 | |
| 843 | | static render_primitive_list &drawogl_window_get_primitives(sdl_window_info *window) |
| 843 | static void drawogl_set_target_bounds(sdl_window_info *window) |
| 844 | 844 | { |
| 845 | | if ((!window->fullscreen()) || (video_config.switchres)) |
| 846 | | { |
| 847 | | window->blit_surface_size(window->width, window->height); |
| 848 | | } |
| 849 | | else |
| 850 | | { |
| 851 | | window->blit_surface_size(window->monitor()->center_width, window->monitor()->center_height); |
| 852 | | } |
| 853 | 845 | window->target->set_bounds(window->blitwidth, window->blitheight, sdlvideo_monitor_get_aspect(window->monitor())); |
| 854 | | return window->target->get_primitives(); |
| 855 | 846 | } |
| 856 | 847 | |
| 857 | 848 | //============================================================ |
trunk/src/osd/sdl/drawsdl.c
| r242697 | r242698 | |
| 105 | 105 | static int drawsdl_window_create(sdl_window_info *window, int width, int height); |
| 106 | 106 | static void drawsdl_window_resize(sdl_window_info *window, int width, int height); |
| 107 | 107 | static void drawsdl_window_destroy(sdl_window_info *window); |
| 108 | | static render_primitive_list &drawsdl_window_get_primitives(sdl_window_info *window); |
| 108 | static void drawsdl_set_target_bounds(sdl_window_info *window); |
| 109 | 109 | static int drawsdl_window_draw(sdl_window_info *window, UINT32 dc, int update); |
| 110 | 110 | static void drawsdl_destroy_all_textures(sdl_window_info *window); |
| 111 | 111 | static void drawsdl_window_clear(sdl_window_info *window); |
| r242697 | r242698 | |
| 221 | 221 | // fill in the callbacks |
| 222 | 222 | window->create = drawsdl_window_create; |
| 223 | 223 | window->resize = drawsdl_window_resize; |
| 224 | | window->get_primitives = drawsdl_window_get_primitives; |
| 224 | window->set_target_bounds = drawsdl_set_target_bounds; |
| 225 | 225 | window->draw = drawsdl_window_draw; |
| 226 | 226 | window->destroy = drawsdl_window_destroy; |
| 227 | 227 | window->destroy_all_textures = drawsdl_destroy_all_textures; |
| r242697 | r242698 | |
| 460 | 460 | |
| 461 | 461 | if (!found) |
| 462 | 462 | { |
| 463 | | osd_printf_verbose("window: Scale mode %s not supported!\n", sm->name); |
| 464 | | window->machine().ui().popup_time(3, "Scale mode %s not supported!", sm->name); |
| 463 | fatalerror("window: Scale mode %s not supported!", sm->name); |
| 465 | 464 | } |
| 466 | 465 | } |
| 467 | 466 | } |
| r242697 | r242698 | |
| 618 | 617 | // drawsdl_window_get_primitives |
| 619 | 618 | //============================================================ |
| 620 | 619 | |
| 621 | | static render_primitive_list &drawsdl_window_get_primitives(sdl_window_info *window) |
| 620 | static void drawsdl_set_target_bounds(sdl_window_info *window) |
| 622 | 621 | { |
| 623 | 622 | sdl_info *sdl = (sdl_info *) window->dxdata; |
| 624 | 623 | const sdl_scale_mode *sm = &scale_modes[video_config.scale_mode]; |
| 625 | 624 | |
| 626 | | if ((!window->fullscreen()) || (video_config.switchres)) |
| 627 | | { |
| 628 | | window->blit_surface_size(window->width, window->height); |
| 629 | | } |
| 630 | | else |
| 631 | | { |
| 632 | | window->blit_surface_size(window->monitor()->center_width, window->monitor()->center_height); |
| 633 | | } |
| 634 | | |
| 635 | 625 | if (!sm->is_scale) |
| 636 | 626 | window->target->set_bounds(window->blitwidth, window->blitheight, sdlvideo_monitor_get_aspect(window->monitor())); |
| 637 | 627 | else |
| 638 | 628 | window->target->set_bounds(sdl->hw_scale_width, sdl->hw_scale_height); |
| 639 | | |
| 640 | | return window->target->get_primitives(); |
| 641 | 629 | } |
| 642 | 630 | |
| 643 | 631 | //============================================================ |
trunk/src/osd/sdl/window.c
| r242697 | r242698 | |
| 109 | 109 | : m_window(awindow), m_list(NULL), m_machine(&amachine), m_resize_new_width(0), m_resize_new_height(0) |
| 110 | 110 | { |
| 111 | 111 | } |
| 112 | | worker_param(running_machine &amachine, sdl_window_info *awindow, render_primitive_list *alist) |
| 113 | | : m_window(awindow), m_list(alist), m_machine(&amachine), m_resize_new_width(0), m_resize_new_height(0) |
| 112 | worker_param(running_machine &amachine, sdl_window_info *awindow, render_primitive_list &alist) |
| 113 | : m_window(awindow), m_list(&alist), m_machine(&amachine), m_resize_new_width(0), m_resize_new_height(0) |
| 114 | 114 | { |
| 115 | 115 | } |
| 116 | 116 | worker_param(sdl_window_info *awindow, int anew_width, int anew_height) |
| r242697 | r242698 | |
| 980 | 980 | |
| 981 | 981 | if (osd_event_wait(rendered_event, event_wait_ticks)) |
| 982 | 982 | { |
| 983 | if ((!fullscreen()) || (video_config.switchres)) |
| 984 | { |
| 985 | blit_surface_size(width, height); |
| 986 | } |
| 987 | else |
| 988 | { |
| 989 | blit_surface_size(monitor()->center_width, monitor()->center_height); |
| 990 | } |
| 991 | |
| 983 | 992 | // ensure the target bounds are up-to-date, and then get the primitives |
| 984 | | render_primitive_list *primlist = &get_primitives(this); |
| 993 | set_target_bounds(this); |
| 985 | 994 | |
| 995 | render_primitive_list &primlist = target->get_primitives(); |
| 996 | |
| 986 | 997 | // and redraw now |
| 987 | 998 | |
| 988 | 999 | execute_async(&draw_video_contents_wt, worker_param(machine, this, primlist)); |
trunk/src/osd/sdl/window.h
| r242697 | r242698 | |
| 94 | 94 | int (*create)(sdl_window_info *window, int width, int height); |
| 95 | 95 | void (*resize)(sdl_window_info *window, int width, int height); |
| 96 | 96 | int (*draw)(sdl_window_info *window, UINT32 dc, int update); |
| 97 | | render_primitive_list &(*get_primitives)(sdl_window_info *window); |
| 97 | void (*set_target_bounds)(sdl_window_info *window); |
| 98 | 98 | int (*xy_to_render_target)(sdl_window_info *window, int x, int y, int *xt, int *yt); |
| 99 | 99 | void (*destroy_all_textures)(sdl_window_info *window); |
| 100 | 100 | void (*destroy)(sdl_window_info *window); |