Photon Engine 2.0.0-beta
A physically based renderer.
|
#include "SDL/ISdlResource.h"
#include "SDL/TSdl.h"
#include "SDL/Introspect/TSdlEnum.h"
#include "SDL/Introspect/SdlClass.h"
#include "SDL/Introspect/SdlStruct.h"
#include "SDL/Introspect/SdlFunction.h"
#include "SDL/Introspect/SdlEnum.h"
#include "SDL/Introspect/TSdlGeneralEnum.h"
#include "SDL/Introspect/TSdlOwnerClass.h"
#include "SDL/Introspect/TSdlOwnerStruct.h"
#include "SDL/Introspect/TSdlBool.h"
#include "SDL/Introspect/TSdlInteger.h"
#include "SDL/Introspect/TSdlReal.h"
#include "SDL/Introspect/TSdlString.h"
#include "SDL/Introspect/TSdlVector2.h"
#include "SDL/Introspect/TSdlVector3.h"
#include "SDL/Introspect/TSdlVector4.h"
#include "SDL/Introspect/TSdlQuaternion.h"
#include "SDL/Introspect/TSdlRealArray.h"
#include "SDL/Introspect/TSdlVector3Array.h"
#include "SDL/Introspect/TSdlReference.h"
#include "SDL/Introspect/TSdlReferenceArray.h"
#include "SDL/Introspect/TSdlEnumField.h"
#include "SDL/Introspect/TSdlPath.h"
#include "SDL/Introspect/TSdlResourceIdentifier.h"
#include "SDL/Introspect/TSdlStructArray.h"
#include "SDL/Introspect/TSdlMethod.h"
#include <type_traits>
Go to the source code of this file.
Macros | |
#define | PH_DEFINE_SDL_CLASS(...) |
Define a SDL class with function-like syntax. | |
#define | PH_DEFINE_SDL_STRUCT(...) |
#define | PH_DEFINE_SDL_FUNCTION(...) |
#define | PH_DEFINE_SDL_ENUM(...) |
Define a SDL enum with function-like syntax. | |
#define PH_DEFINE_SDL_CLASS | ( | ... | ) |
Define a SDL class with function-like syntax.
Use this macro in the class body of a SDL resource to provide an interface for introspection. The SDL class instance type to be defined should be the only argument to the macro. Followed is a ordinary C++ scope (a pair of curly braces) where the definition for the SDL class instance resides. Several utility types can be used within the scope: ClassType
for the type of the SDL class, and OwnerType
for the type of the SDL resource. Finally, use a return statement to return the SDL class instance.
Available functionalities after defining the macro:
const ClassType* getSdlClass()
const SdlClass* getDynamicSdlClass() const
#define PH_DEFINE_SDL_ENUM | ( | ... | ) |
Define a SDL enum with function-like syntax.
One does not need to define all enum entries. It is valid to partially expose some enum entries and keep the others hidden from SDL. Note that it is highly encouraged to provide a valid entry with the value 0 as it will be used as the default.
A limitation of this macro is that it must be called in the enclosing namespace of ph
(within namespace ph
itself). Note this should not cause any name collision–the enum type can still be defined in an appropriate namespace. (The underlying implementation depends on explicit template specialization which requires the aforementioned rule. As long as a unique enum type is used for specializing TSdlEnum
, the resulting type should still be unique.)
For a enum EnumType
, after the definition is done by calling this macro, you can use methods in TSdlEnum<EnumType>
to access functionalities. See TSdlEnum
for what methods are available.
#define PH_DEFINE_SDL_FUNCTION | ( | ... | ) |
#define PH_DEFINE_SDL_STRUCT | ( | ... | ) |