summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/bgfx/writereader.cpp
blob: 6ec148f9e4642af6b2d176054c48a2c16128c723 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// license:BSD-3-Clause
// copyright-holders:Ryan Holtz
//============================================================
//
//  cullreader.h - BGFX alpha/color write state JSON reader
//
//============================================================

#include <bgfx/bgfx.h>

#include "writereader.h"

uint64_t write_reader::read_from_value(const Value& value)
{
	uint64_t rgb = get_bool(value, "rgb", false) ? BGFX_STATE_RGB_WRITE : 0;
	uint64_t alpha = get_bool(value, "alpha", false) ? BGFX_STATE_ALPHA_WRITE : 0;
	return rgb | alpha;
}