Code-style consistency improvement:
Apply clang-format-all.sh using the _clang-format file through all the cpp/.h files. make sure not to apply it to certain serialization structures, since some parser expects the * as part of the name, instead of type. This commit contains no other changes aside from adding and applying clang-format-all.sh
This commit is contained in:
@@ -6,102 +6,91 @@
|
||||
struct CommandProcessorCreationInterface
|
||||
{
|
||||
virtual ~CommandProcessorCreationInterface() {}
|
||||
virtual class CommandProcessorInterface* createCommandProcessor()=0;
|
||||
virtual void deleteCommandProcessor(CommandProcessorInterface*)=0;
|
||||
virtual class CommandProcessorInterface* createCommandProcessor() = 0;
|
||||
virtual void deleteCommandProcessor(CommandProcessorInterface*) = 0;
|
||||
};
|
||||
|
||||
|
||||
struct CommonExampleOptions
|
||||
{
|
||||
struct GUIHelperInterface* m_guiHelper;
|
||||
struct GUIHelperInterface* m_guiHelper;
|
||||
|
||||
//Those are optional, some examples will use them others don't. Each example should work with them being 0.
|
||||
int m_option;
|
||||
int m_option;
|
||||
const char* m_fileName;
|
||||
class SharedMemoryInterface* m_sharedMem;
|
||||
CommandProcessorCreationInterface* m_commandProcessorCreation;
|
||||
bool m_skipGraphicsUpdate;
|
||||
|
||||
CommonExampleOptions(struct GUIHelperInterface* helper, int option=0)
|
||||
:m_guiHelper(helper),
|
||||
m_option(option),
|
||||
m_fileName(0),
|
||||
m_sharedMem(0),
|
||||
m_commandProcessorCreation(0),
|
||||
m_skipGraphicsUpdate(false)
|
||||
bool m_skipGraphicsUpdate;
|
||||
|
||||
CommonExampleOptions(struct GUIHelperInterface* helper, int option = 0)
|
||||
: m_guiHelper(helper),
|
||||
m_option(option),
|
||||
m_fileName(0),
|
||||
m_sharedMem(0),
|
||||
m_commandProcessorCreation(0),
|
||||
m_skipGraphicsUpdate(false)
|
||||
{
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class CommonExampleInterface
|
||||
{
|
||||
public:
|
||||
|
||||
typedef class CommonExampleInterface* (CreateFunc)(CommonExampleOptions& options);
|
||||
typedef class CommonExampleInterface*(CreateFunc)(CommonExampleOptions& options);
|
||||
|
||||
virtual ~CommonExampleInterface()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
virtual void initPhysics()=0;
|
||||
virtual void exitPhysics()=0;
|
||||
virtual void updateGraphics(){}
|
||||
virtual void stepSimulation(float deltaTime)=0;
|
||||
virtual void renderScene()=0;
|
||||
virtual void physicsDebugDraw(int debugFlags)=0;//for now we reuse the flags in Bullet/src/LinearMath/btIDebugDraw.h
|
||||
virtual void initPhysics() = 0;
|
||||
virtual void exitPhysics() = 0;
|
||||
virtual void updateGraphics() {}
|
||||
virtual void stepSimulation(float deltaTime) = 0;
|
||||
virtual void renderScene() = 0;
|
||||
virtual void physicsDebugDraw(int debugFlags) = 0; //for now we reuse the flags in Bullet/src/LinearMath/btIDebugDraw.h
|
||||
//reset camera is only called when switching demo. this way you can restart (initPhysics) and watch in a specific location easier
|
||||
virtual void resetCamera(){};
|
||||
virtual bool mouseMoveCallback(float x,float y)=0;
|
||||
virtual bool mouseButtonCallback(int button, int state, float x, float y)=0;
|
||||
virtual bool keyboardCallback(int key, int state)=0;
|
||||
virtual void resetCamera(){};
|
||||
virtual bool mouseMoveCallback(float x, float y) = 0;
|
||||
virtual bool mouseButtonCallback(int button, int state, float x, float y) = 0;
|
||||
virtual bool keyboardCallback(int key, int state) = 0;
|
||||
|
||||
virtual void vrControllerMoveCallback(int controllerId, float pos[4], float orientation[4], float analogAxis, float auxAnalogAxes[10]) {}
|
||||
virtual void vrControllerButtonCallback(int controllerId, int button, int state, float pos[4], float orientation[4]){}
|
||||
virtual void vrHMDMoveCallback(int controllerId, float pos[4], float orientation[4]){}
|
||||
virtual void vrGenericTrackerMoveCallback(int controllerId, float pos[4], float orientation[4]){}
|
||||
virtual void vrControllerMoveCallback(int controllerId, float pos[4], float orientation[4], float analogAxis, float auxAnalogAxes[10]) {}
|
||||
virtual void vrControllerButtonCallback(int controllerId, int button, int state, float pos[4], float orientation[4]) {}
|
||||
virtual void vrHMDMoveCallback(int controllerId, float pos[4], float orientation[4]) {}
|
||||
virtual void vrGenericTrackerMoveCallback(int controllerId, float pos[4], float orientation[4]) {}
|
||||
|
||||
virtual void processCommandLineArgs(int argc, char* argv[]){};
|
||||
virtual void processCommandLineArgs(int argc, char* argv[]){};
|
||||
};
|
||||
|
||||
class ExampleEntries
|
||||
{
|
||||
|
||||
public:
|
||||
virtual ~ExampleEntries() {}
|
||||
|
||||
virtual ~ExampleEntries() {}
|
||||
virtual void initExampleEntries() = 0;
|
||||
|
||||
virtual void initOpenCLExampleEntries() = 0;
|
||||
|
||||
virtual void initExampleEntries()=0;
|
||||
virtual int getNumRegisteredExamples() = 0;
|
||||
|
||||
virtual void initOpenCLExampleEntries()=0;
|
||||
virtual CommonExampleInterface::CreateFunc* getExampleCreateFunc(int index) = 0;
|
||||
|
||||
virtual int getNumRegisteredExamples()=0;
|
||||
virtual const char* getExampleName(int index) = 0;
|
||||
|
||||
virtual CommonExampleInterface::CreateFunc* getExampleCreateFunc(int index)=0;
|
||||
|
||||
virtual const char* getExampleName(int index)=0;
|
||||
|
||||
virtual const char* getExampleDescription(int index)=0;
|
||||
|
||||
virtual int getExampleOption(int index)=0;
|
||||
virtual const char* getExampleDescription(int index) = 0;
|
||||
|
||||
virtual int getExampleOption(int index) = 0;
|
||||
};
|
||||
|
||||
|
||||
CommonExampleInterface* StandaloneExampleCreateFunc(CommonExampleOptions& options);
|
||||
|
||||
#ifdef B3_USE_STANDALONE_EXAMPLE
|
||||
#define B3_STANDALONE_EXAMPLE(ExampleFunc) CommonExampleInterface* StandaloneExampleCreateFunc(CommonExampleOptions& options)\
|
||||
{\
|
||||
return ExampleFunc(options);\
|
||||
#define B3_STANDALONE_EXAMPLE(ExampleFunc) \
|
||||
CommonExampleInterface* StandaloneExampleCreateFunc(CommonExampleOptions& options) \
|
||||
{ \
|
||||
return ExampleFunc(options); \
|
||||
}
|
||||
#else//B3_USE_STANDALONE_EXAMPLE
|
||||
#define B3_STANDALONE_EXAMPLE(ExampleFunc)
|
||||
#endif //B3_USE_STANDALONE_EXAMPLE
|
||||
#else //B3_USE_STANDALONE_EXAMPLE
|
||||
#define B3_STANDALONE_EXAMPLE(ExampleFunc)
|
||||
#endif //B3_USE_STANDALONE_EXAMPLE
|
||||
|
||||
|
||||
|
||||
#endif //COMMON_EXAMPLE_INTERFACE_H
|
||||
#endif //COMMON_EXAMPLE_INTERFACE_H
|
||||
|
||||
Reference in New Issue
Block a user