Jump to content

making use of windows api


photo

Recommended Posts

Posted

Is it possible to make use of windows API in our project?(like DCB structure) How to set up the compile environment?

Posted

Please, compile the project using SCons because we check all of the options for each file and for the included and referenced libraries.

Posted

Could you please provide us more details on what are you trying to achieve?

Posted

Thank you for answering. And how could UnigineScript get return data(value) from external function of exported user defined class?

Posted

You can use Variable type or any build in type (float,int). Please, see the following sample: Samples/Api/Functions/Function.cpp


/*
*/
Variable my_sum(const Variable &v0,const Variable &v1) {

if(v0.getType() == Variable::INT && v1.getType() == Variable::INT) {
	Log::warning("my_sum(%d,%d): called\n",v0.getInt(),v1.getInt());
	return Variable(v0.getInt() + v1.getInt());
}

if(v0.getType() == Variable::STRING && v1.getType() == Variable::STRING) {
	Log::warning("my_sum(%s,%s): called\n",v0.getString(),v1.getString());
	return Variable((std::string(v0.getString()) + "+" + std::string(v1.getString())).c_str());
}

Log::warning("my_sum(%s,%s): called\n",v0.getTypeName(),v1.getTypeName());

return Variable("unknown");
}

  • Like 1
×
×
  • Create New...