Created
March 25, 2018 00:01
-
-
Save AustinBrunkhorst/9f40e50eebceecb040d1b53318909909 to your computer and use it in GitHub Desktop.
C++ Reflection | Attribute Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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