Skip to content

Instantly share code, notes, and snippets.

@AustinBrunkhorst
Created March 25, 2018 00:01
Show Gist options
  • Save AustinBrunkhorst/9f40e50eebceecb040d1b53318909909 to your computer and use it in GitHub Desktop.
Save AustinBrunkhorst/9f40e50eebceecb040d1b53318909909 to your computer and use it in GitHub Desktop.
C++ Reflection | Attribute Example
enum class SliderType
{
Horizontal,
Vertical
};
struct Slider : public MetaProperty
{
SliderType type;
Slider(SliderType type)
: type( type ) { }
};
struct Range : public MetaProperty
{
float min, max;
Range(float min, float max)
: min( min )
, max( max ) { }
};
Meta(Range(0.0f, 1.0f), Slider(SliderType::Horizontal))
float someIntensityField;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment