class 3D callbacks moved to c++

This commit is contained in:
Enrico Turri 2018-06-07 11:18:28 +02:00
parent ff86407840
commit a8500d6bae
11 changed files with 250 additions and 92 deletions

View file

@ -266,6 +266,24 @@ void PerlCallback::call(const std::vector<int>& ints) const
LEAVE;
}
//##############################################################################################################
void PerlCallback::call(double x, double y) const
{
if (!m_callback)
return;
dSP;
ENTER;
SAVETMPS;
PUSHMARK(SP);
XPUSHs(sv_2mortal(newSVnv(x)));
XPUSHs(sv_2mortal(newSVnv(y)));
PUTBACK;
perl_call_sv(SvRV((SV*)m_callback), G_DISCARD);
FREETMPS;
LEAVE;
}
//##############################################################################################################
#ifdef WIN32
#ifndef NOMINMAX
# define NOMINMAX