summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/drawnone.cpp
blob: f56660a7d058a8b145f636a2c5358f2076a0c09f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// license:BSD-3-Clause
// copyright-holders:Aaron Giles
//============================================================
//
//  drawnone.cpp - stub "nothing" drawer
//
//============================================================

// standard windows headers
#include <windows.h>

// MAME headers
#include "emu.h"

#include "drawnone.h"

//============================================================
//  drawnone_window_get_primitives
//============================================================

render_primitive_list *renderer_none::get_primitives()
{
	auto win = try_getwindow();
	if (win == nullptr)
		return nullptr;

	RECT client;
#if defined(OSD_WINDOWS)
	GetClientRect(std::static_pointer_cast<win_window_info>(win)->platform_window(), &client);
#elif defined(OSD_UWP)
	auto bounds = std::static_pointer_cast<uwp_window_info>(win)->platform_window()->Bounds;
	client.left = bounds.Left;
	client.right = bounds.Right;
	client.top = bounds.Top;
	client.bottom = bounds.Bottom;
#endif
	win->target()->set_bounds(rect_width(&client), rect_height(&client), win->pixel_aspect());
	return &win->target()->get_primitives();
}