With the recent changes to the command-line handling and parsing I now have ospInit() getting stuck. I can't immediately figure out why it doesn't get out of ospInit(), but I'm calling it in a slightly non-standard way. Instead of passing argc and argv from main() I'm using a vector of strings containing arguments that get converted to a temporary array of values like this (this is a reduced test case, btw):
#include <ospray/ospray_cpp.h>
using namespace ospray::cpp;
std::vector<std::string>
init(const std::vector<std::string>& args)
{
int argc = args.size();
const char **argv = new const char*[argc];
for (int i = 0; i < argc; i++)
argv[i] = args[i].c_str();
OSPError res = ospInit(&argc, argv);
if (res != OSP_NO_ERROR)
{
delete [] argv;
std::string msg = "ospInit() failed: " + std::to_string(res);
throw std::runtime_error(msg);
}
std::vector<std::string> newargs;
for (int i = 0; i < argc; i++)
newargs.push_back(std::string(argv[i]));
delete [] argv;
return newargs;
}
int main(int argc, const char *argv[])
{
std::vector<std::string> args;
args.push_back("python");
args.push_back("./plyrender.py");
args.push_back("--osp:debug");
args.push_back("tests/pyramid.ply");
init(args);
}
This is with 098fd12e7ef1fcbfc4c73c391161df69e63ace7e.
With the recent changes to the command-line handling and parsing I now have
ospInit()
getting stuck. I can't immediately figure out why it doesn't get out ofospInit()
, but I'm calling it in a slightly non-standard way. Instead of passingargc
andargv
frommain()
I'm using a vector of strings containing arguments that get converted to a temporary array of values like this (this is a reduced test case, btw):This is with 098fd12e7ef1fcbfc4c73c391161df69e63ace7e.