From 69751dc0849d994bef32bc3a92dd9d45a4c4ba8f Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Sun, 29 Mar 2009 15:36:41 +0000 Subject: [PATCH] To bind a template, you must bind a specific instantiation of it. I'm binding the instantiations defined by the typedefs in Vector.h (though I have to specify them manually in SWIG). The uint8 etc. typedefs aren't working for now though. --- library/bindings/PolyVoxCore.i | 4 ++-- library/bindings/Vector.i | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/library/bindings/PolyVoxCore.i b/library/bindings/PolyVoxCore.i index e771e25f..e235a305 100644 --- a/library/bindings/PolyVoxCore.i +++ b/library/bindings/PolyVoxCore.i @@ -7,5 +7,5 @@ %include "Enums.i" %include "PolyVoxCStdInt.i" %include "Utility.i" -%include "PolyVoxForwardDeclarations.i" -//%include "Vector.i" +//%include "PolyVoxForwardDeclarations.i" //Shouldn't be needed +%include "Vector.i" diff --git a/library/bindings/Vector.i b/library/bindings/Vector.i index dc341a8e..493fb918 100644 --- a/library/bindings/Vector.i +++ b/library/bindings/Vector.i @@ -1,10 +1,18 @@ %module Vector %{ #include "PolyVoxCore/Vector.h" +//#include "PolyVoxCore/PolyVoxCStdInt.h" %} %include "PolyVoxCore/Vector.h" -%template(VectorTest) PolyVox::Vector<3,float>; +%template(Vector3DFloat) PolyVox::Vector<3,float>; +%template(Vector3DDouble) PolyVox::Vector<3,double>; +//%template(Vector3DInt8) PolyVox::Vector<3,int8>; +//%template(Vector3DUint8) PolyVox::Vector<3,uint8>; +//%template(Vector3DInt16) PolyVox::Vector<3,int16>; +//%template(Vector3DUint16) PolyVox::Vector<3,uint16>; +//%template(Vector3DInt32) PolyVox::Vector<3,int32>; +//%template(Vector3DUint32) PolyVox::Vector<3,uint32>; -%rename(assign) VectorTest::operator=; +%rename(assign) Vector3DFloat::operator=;