summaryrefslogtreecommitdiff
path: root/Runtime/Camera/RenderLoops/GlobalLayeringData.h
blob: 176eddee3dae4036c15b3afcd603961fac534f64 (plain)
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
#pragma once

struct GlobalLayeringData
{
	// Per-renderer sorting data.
	SInt16 layer; // Layer order.
	SInt16 order; // In-layer order.
};

inline GlobalLayeringData GlobalLayeringDataCleared () { GlobalLayeringData data = {0,0}; return data;  }

inline bool CompareGlobalLayeringData(const GlobalLayeringData& lhs, const GlobalLayeringData& rhs, bool& result)
{
	if (lhs.layer != rhs.layer)
	{
		result = lhs.layer < rhs.layer;
		return true;
	}
	else if (lhs.order != rhs.order)
	{
		result = lhs.order < rhs.order;
		return true;
	}

	return false;
}