summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/bgfx/inputpair.h
blob: 1f5c4f59dfcbe4f779e0283cb4e966bab2447e61 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
// license:BSD-3-Clause
// copyright-holders:Ryan Holtz
//============================================================
//
//  inputpair.h - BGFX sampler-and-texture pair
//
//  Keeps track of the texture which is bound to the sampler
//  which is bound to the specified stage index.
//
//============================================================

#pragma once

#ifndef __DRAWBGFX_INPUT_PAIR__
#define __DRAWBGFX_INPUT_PAIR__

#include <string>

#include "../frontend/mame/ui/menuitem.h"

class bgfx_effect;
class chain_manager;

class bgfx_input_pair
{
public:
	bgfx_input_pair(int index, std::string sampler, std::string texture, std::vector<std::string> available_textures, std::string selection, chain_manager& chains, uint32_t screen_index);

	void bind(bgfx_effect *effect, const int32_t screen) const;
	int32_t texture_changed(int32_t index, std::string *str, int32_t newval);

	// Getters
	chain_manager& chains() const { return m_chains; }
	std::string sampler() const { return m_sampler; }
	std::string texture() const { return m_texture; }
	std::vector<ui_menu_item> get_slider_list();

private:
	void create_selection_slider(uint32_t screen_index);
	bool needs_sliders();

	int                       m_index;
	std::string               m_sampler;
	std::string               m_texture;
	std::vector<std::string>  m_available_textures;
	std::string               m_selection;
	chain_manager&            m_chains;
	int32_t                   m_current_texture;
	ui_menu_item              m_selection_slider;
};

#endif // __DRAWBGFX_INPUT_PAIR__