Exemplo n.º 1
0
static render_primitive_list &draw13_window_get_primitives(sdl_window_info *window)
{
	if ((!window->fullscreen) || (video_config.switchres))
	{
		sdlwindow_blit_surface_size(window, window->width, window->height);
	}
	else
	{
		sdlwindow_blit_surface_size(window, window->monitor->center_width, window->monitor->center_height);
	}
	window->target->set_bounds(window->blitwidth, window->blitheight, sdlvideo_monitor_get_aspect(window->monitor));
	return window->target->get_primitives();
}
Exemplo n.º 2
0
Arquivo: window.c Projeto: clobber/UME
void sdlwindow_video_window_update(running_machine &machine, sdl_window_info *window)
{

	osd_ticks_t     event_wait_ticks;
	ASSERT_MAIN_THREAD();

	// adjust the cursor state
	sdlwindow_update_cursor_state(machine, window);

	// if we're visible and running and not in the middle of a resize, draw
	if (window->target != NULL)
	{
		int tempwidth, tempheight;

		// see if the games video mode has changed
		window->target->compute_minimum_size(tempwidth, tempheight);
		if (tempwidth != window->minwidth || tempheight != window->minheight)
		{
			window->minwidth = tempwidth;
			window->minheight = tempheight;
			if (!window->fullscreen)
			{
				sdlwindow_blit_surface_size(window, window->width, window->height);
				sdlwindow_resize(window, window->blitwidth, window->blitheight);
			}
			else if (video_config.switchres)
			{
				pick_best_mode(window, &tempwidth, &tempheight);
				sdlwindow_resize(window, tempwidth, tempheight);
			}
		}

		if (video_config.waitvsync && video_config.syncrefresh)
			event_wait_ticks = osd_ticks_per_second(); // block at most a second
		else
			event_wait_ticks = 0;

		if (osd_event_wait(window->rendered_event, event_wait_ticks))
		{
			worker_param wp;
			render_primitive_list *primlist;

			clear_worker_param(&wp);

			// ensure the target bounds are up-to-date, and then get the primitives
			primlist = &window->get_primitives(window);

			// and redraw now

			wp.list = primlist;
			wp.window = window;
			wp.m_machine = &machine;

			execute_async(&draw_video_contents_wt, &wp);
		}
	}
}
Exemplo n.º 3
0
static const render_primitive_list *drawgx_window_get_primitives(sdl_window_info *window)
{
    sdl_info *sdl = window->dxdata;

    if ((!window->fullscreen) || (video_config.switchres))
    {
        sdlwindow_blit_surface_size(window, window->width, window->height);
    }
    else
    {
        sdlwindow_blit_surface_size(window, window->monitor->center_width, window->monitor->center_height);
    }
    if (!sdl->scale_mode->is_scale)
        render_target_set_bounds(window->target, window->blitwidth, window->blitheight, sdlvideo_monitor_get_aspect(window->monitor));
    else
        render_target_set_bounds(window->target, sdl->hw_scale_width, sdl->hw_scale_height, 0);
    return render_target_get_primitives(window->target);
}
Exemplo n.º 4
0
void sdlwindow_video_window_update(running_machine *machine, sdl_window_info *window)
{

	ASSERT_MAIN_THREAD();

	// adjust the cursor state
	sdlwindow_update_cursor_state(machine, window);

	// if we're visible and running and not in the middle of a resize, draw
	if (window->target != NULL)
	{
		int tempwidth, tempheight;

		// see if the games video mode has changed
		render_target_get_minimum_size(window->target, &tempwidth, &tempheight);
		if (tempwidth != window->minwidth || tempheight != window->minheight)
		{
			window->minwidth = tempwidth;
			window->minheight = tempheight;
			if (!window->fullscreen)
			{
				sdlwindow_blit_surface_size(window, window->width, window->height);
				sdlwindow_resize(window, window->blitwidth, window->blitheight);
			}
			else if (video_config.switchres)
			{
				pick_best_mode(window, &tempwidth, &tempheight);
				sdlwindow_resize(window, tempwidth, tempheight);
			}
		}

		// only render if we have been signalled
		if (osd_event_wait(window->rendered_event, 0))
		{
			worker_param wp;
			const render_primitive_list *primlist;

			clear_worker_param(&wp);

			// ensure the target bounds are up-to-date, and then get the primitives
			primlist = window->get_primitives(window);

			// and redraw now

			wp.list = primlist;
			wp.window = window;
			wp.machine = machine;

			execute_async(&draw_video_contents_wt, &wp);
		}
	}
}
Exemplo n.º 5
0
Arquivo: window.c Projeto: clobber/UME
static OSDWORK_CALLBACK( sdlwindow_resize_wt )
{
	worker_param *      wp = (worker_param *) param;
	sdl_window_info *   window = wp->window;

	ASSERT_WINDOW_THREAD();

	window->destroy_all_textures(window);
	window->resize(window, wp->resize_new_width, wp->resize_new_height);

	sdlwindow_blit_surface_size(window, wp->resize_new_width, wp->resize_new_height);

	sdlwindow_clear(window);

	osd_free(wp);
	return NULL;
}