refactor b3RobotSimulatorClientAPI into a main part without GUI dependencies (no OpenGL, gwen, glew etc)
so that App_RobotSimulator_NoGUI can link against BulletRobotics and App_RobotSimulator links against BulletRobotics and some extra files.
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
|
||||
#include "b3RobotSimulatorClientAPI.h"
|
||||
#ifdef B3_USE_ROBOTSIM_GUI
|
||||
#include "b3RobotSimulatorClientAPI.h"
|
||||
#else
|
||||
#include "b3RobotSimulatorClientAPI_NoGUI.h"
|
||||
#endif
|
||||
|
||||
|
||||
#include "../Utils/b3Clock.h"
|
||||
|
||||
#include <string.h>
|
||||
@@ -7,11 +13,23 @@
|
||||
#include <assert.h>
|
||||
#define ASSERT_EQ(a,b) assert((a)==(b));
|
||||
#include "MinitaurSetup.h"
|
||||
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
#ifdef B3_USE_ROBOTSIM_GUI
|
||||
b3RobotSimulatorClientAPI* sim = new b3RobotSimulatorClientAPI();
|
||||
|
||||
sim->connect(eCONNECT_GUI);
|
||||
bool isConnected = sim->connect(eCONNECT_GUI);
|
||||
#else
|
||||
b3RobotSimulatorClientAPI_NoGUI* sim = new b3RobotSimulatorClientAPI_NoGUI();
|
||||
bool isConnected = sim->connect(eCONNECT_DIRECT);
|
||||
#endif
|
||||
if (!isConnected)
|
||||
{
|
||||
printf("Cannot connect\n");
|
||||
return -1;
|
||||
}
|
||||
//Can also use eCONNECT_DIRECT,eCONNECT_SHARED_MEMORY,eCONNECT_UDP,eCONNECT_TCP, for example:
|
||||
//sim->connect(eCONNECT_UDP, "localhost", 1234);
|
||||
sim->configureDebugVisualizer( COV_ENABLE_GUI, 0);
|
||||
|
||||
Reference in New Issue
Block a user