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

@ -96,6 +96,7 @@ public:
void call(int i) const;
void call(int i, int j) const;
void call(const std::vector<int>& ints) const;
void call(double x, double y) const;
// void call();
// void call(int i);
// void call(int i, int j);

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